byte buffer[] = new byte[256*1024]; try { while (PatchEdit.MidiIn.messagesWaiting(inPort) > 0) PatchEdit.MidiIn.readMessage(inPort, buffer, 1024); } catch (Exception ex) { ErrorMsg.reportError("Error", "Error Clearing Midi In buffer.",ex); } } }
byte buffer[] = new byte[256*1024]; try { while (PatchEdit.MidiIn.messagesWaiting(getInPort()) > 0) PatchEdit.MidiIn.readMessage(getInPort(), buffer, 1024); } catch (Exception ex) { ErrorMsg.reportError("Error", "Error Clearing Midi In buffer.",ex); } } }
  public void requestPatchDump(int bankNum, int patchNum)  {    if ( ((YamahaDX7Device)(PatchEdit.appConfig.getDevice(getDeviceNum()))).getDX7sPBPflag()==1 )    {      // make Sys Info available      DX7ParamChanges.mkSysInfoAvail(port, (byte)(channel+0x10));      // let the DX7 transmit the bank dump      DX7ParamChanges.xmitBankDump(port, (byte)(channel+0x10));    }    else    {      if ( ((YamahaDX7Device)(PatchEdit.appConfig.getDevice(getDeviceNum()))).getTipsMsgFlag()==1 )        // Information        JOptionPane.showMessageDialog(PatchEdit.instance,                                      getDriverName()+"Driver:"+ DX7Strings.REQUEST_VOICE_STRING,                                      "Get "+getDriverName()+"Patch",                                      JOptionPane.WARNING_MESSAGE);      byte buffer[] = new byte[256*1024];      try       {        while (PatchEdit.MidiIn.messagesWaiting(inPort) > 0)              PatchEdit.MidiIn.readMessage(inPort, buffer, 1024);      }      catch (Exception ex)      {        ErrorMsg.reportError("Error", "Error Clearing Midi In buffer.",ex);      }    }  }