output.close (); MidiDevice destDevice=MidiSystem.getMidiDevice ((MidiDevice.Info)destinationInfoVector.get (port)); output=destDevice.getReceiver ();
if (currentOutport!=port) { output.close (); MidiDevice destDevice=MidiSystem.getMidiDevice ((MidiDevice.Info)destinationInfoVector.get (port)); output=destDevice.getReceiver (); } currentOutport=port;
  public void setOutputDeviceNum (int port)throws Exception  {    if (currentOutport!=port)    {      output.close ();      MidiDevice destDevice=MidiSystem.getMidiDevice ((MidiDevice.Info)destinationInfoVector.get (port));      output=destDevice.getReceiver ();    }    currentOutport=port;  }