Пример #1
0
  /**
   * 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();
  }
Пример #2
0
  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;
    }
  }