Patch tmpPatch = new Patch(tmpSysex);  tmpPatch.sysex[7] = (byte) patchNum; tmpPatch.sysex[size - 2] = calcChkSum(tmpPatch, 6, size - 3);
tmpSysex[6] = (byte) 0x41; tmpSysex[7] = (byte) patchNum; tmpSysex[8] = (byte) i; tmpSysex[size - 2] = calcChkSum(tmpSysex, 6, size - 3);
  public void storePatch (Patch p, int bankNum, int patchNum) {    int i, size, ofst;    // Patch must be sent in 13 packets.  data packet for the 1st    // packet is 13 byte, and one for others is 55 byte.    for (i = ofst = 0; i < 13; i++, ofst += size) {      // create a Patch data for each packet      size = (i == 0) ? 37 : 55; // SysEX data size      byte [] tmpSysex = new byte [size];      System.arraycopy(p.sysex, ofst, tmpSysex, 0, size);      Patch tmpPatch = new Patch(tmpSysex);      // Drum kit "01" : patchNum 0 : address 04 00 00 00      tmpPatch.sysex[7] = (byte) patchNum;      tmpPatch.sysex[size - 2] = calcChkSum(tmpPatch, 6, size - 3);      // send created patch to synthersizer      sendPatchWorker(tmpPatch);    }//     try {//       Thread.sleep(100);	// at least 100 milliseconds.//     } catch (Exception e) {//     }  }