/** * Constructs a new Test. * * @throws Exception if it feels like it. */ public Test() throws Exception { String MIDI_NAME = "USB Uno MIDI In"; MidiDevice dev = getMidiDevice(MIDI_NAME); dev.open(); MyReceiver rec = new MyReceiver(); dev.getTransmitter().setReceiver(rec); Thread.sleep(20000); dev.close(); }
private void init() throws MidiUnavailableException { try { if (!(device.isOpen())) { device.open(); } this.transmitter = device.getTransmitter(); this.mrftd = new MidiReceiverForTransmitterDevice(); } catch (MidiUnavailableException e) { device.close(); throw e; } }