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));      // internal memory or RAM cartridge?      DX7ParamChanges.chBank(port, (byte)(channel+0x10), (byte)(bankNum+0x25));      // which patch do you want      DX7ParamChanges.chPatch(port, (byte)(channel+0x10), (byte)(patchNum));    }    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);             }    }  }