PatchEdit.waitDialog.show();
PatchEdit.showWaitDialog();
  protected void sendPatchWorker (Patch p, int bankNum) {    byte tmp[] = new byte[singleSize];  // send in 99 single-program messages    int max;    if (bankNum == 0) {      max = 40; // only the first 40 programs are writeable in the user bank    } else {      max = NUM_IN_BANK;    }    try {      PatchEdit.waitDialog.show();      for (int i = 0; i < max; i++) {        System.arraycopy(p.sysex, i * singleSize, tmp, 0, singleSize);        tmp[deviceIDoffset] = (byte) (((NordLeadDevice) getDevice()).getGlobalChannel() - 1);        tmp[BANK_NUM_OFFSET] = (byte)(bankNum + 1);        tmp[PATCH_NUM_OFFSET] = (byte)i; // program #        send(tmp);        Thread.sleep(50);      }      PatchEdit.waitDialog.hide();    } catch (Exception e) {      ErrorMsg.reportStatus (e);      ErrorMsg.reportError("Error", "Unable to send Patch");    }  }