private void initialiseSequencer() {
        try {
            // Attempt to locate the MIDE sequencer as one of the MIDI devices
            MidiDevice.Info[] midiDeviceInfo = MidiSystem.getMidiDeviceInfo();
            int sequencerPos = -1;
            for (int idx = 0; idx < midiDeviceInfo.length; idx++) {
                if (midiDeviceInfo[idx].getName().indexOf("Sequencer") != -1) {
                    sequencerPos = idx;
                }
            }
            
            if (sequencerPos != -1) {
                sequencer = (Sequencer) MidiSystem.getMidiDevice( 
                        midiDeviceInfo[sequencerPos] );
            }
            
            if (sequencer == null) {
                throw new MidiUnavailableException();
            }

            // Now that a sequencer has been found, open it
            sequencer.open();

            // Attempt to locate and open a suitable synthesizer for the sequencer
            if (!(sequencer instanceof Synthesizer)) {
                synthesizer = MidiSystem.getSynthesizer();
                synthesizer.open();
                
                Receiver synthReceiver = synthesizer.getReceiver();
                Transmitter seqTransmitter = sequencer.getTransmitter();
                seqTransmitter.setReceiver(synthReceiver);
            } else {
                synthesizer = (Synthesizer) sequencer;
            }
        } catch (MidiUnavailableException e) {
            throw new IllegalStateException("MidiAsset.initialiseSequencer: " + "Cannot initialise sequencer");
        }
    }