@Override
	public void setSubNoteSource(SubNoteSource subNoteSource) {
		if(transmitter != null) {
			transmitter.close();
		}
		if(device != null) {
			device.close();
		}

		if(subNoteSource.getIdentifier() == null) {
			// No device
			return;
		}

		try {
			device = (MidiDevice)subNoteSource.getIdentifier();
			transmitter = device.getTransmitter();
			device.open();
			transmitter.setReceiver(new MIDINoteSourceReceiver());

			System.out.println("Changed sub note source to "+ subNoteSource.getDisplayName());
		} catch(MidiUnavailableException e) {
			// XXX: Ignore

			System.out.println("Error changing sub note source to "+ subNoteSource.getDisplayName() +": "+ e.getMessage());
		}
	}