public MidiPlayer()
    {
        try
        {
            sequencer = MidiSystem.getSequencer();
            sequencer.open();
            paused = true;
        }
        catch (MidiUnavailableException e)
        {
            sequencer = null;
        }
    }