private MidiDevice openMidiDevice(String containsString) {
		message("Searching for MIDI device with name containing '"
				+ containsString + "'");
		MidiDevice device = null;
		MidiDevice.Info[] midiDevices = MidiSystem.getMidiDeviceInfo();
		for (int i = 0; i < midiDevices.length; i++) {
			device = null;
			try {
				device = MidiSystem.getMidiDevice(midiDevices[i]);
			} catch (MidiUnavailableException e) {
				message("    Problem in method 'getMidiDevice':  "
						+ "MIDIUnavailableException was thrown");
				device = null;
			}
			if (device != null
					&& midiDevices[i].getName().contains(containsString)) {
				message("    Found MIDI device named '"
						+ midiDevices[i].getName() + "'");
				if (device instanceof Synthesizer)
					message("        *this is a Synthesizer instance");
				if (device instanceof Sequencer)
					message("        *this is a Sequencer instance");
				try {
					device.open();
				} catch (MidiUnavailableException mue) {
					message("    Unable to open this MIDI device");
					device = null;
				}
				return device;
			}
		}
		message("    MIDI device not found");
		return null;
	}