public void putPatch(Patch bank, Patch p, int patchNum)
public void putPatch(IPatch bank, IPatch p, int patchNum)
  public void putPatch(Patch bank, Patch p, int patchNum)  {    if (!canHoldPatch(p))    {      ErrorMsg.reportError("Error", "This type of patch does not fit in to this type of bank.");      return;    }    byte bankSysex[] = new byte[32];    // TONE NUMBER    bankSysex[0] |= p.sysex[7];    // KEY RANGE LOW    bankSysex[1] |= (byte)(p.sysex[8] + 4);  // sysex docs didn't show, but needed to get correct value    // KEY RANGE HIGH    bankSysex[2] |= (byte)(p.sysex[9] + 4);  // sysex docs didn't show, but needed to get correct value    // PORTAMENTO TIME    bankSysex[3] |= p.sysex[10];    // PORTAMENTO    bankSysex[10] |= (byte)(p.sysex[11] << 4);    // MOD SENS    bankSysex[4] |= p.sysex[12];    // KEY SHIFT    bankSysex[5] |= p.sysex[13];    // VOLUME    bankSysex[6] |= p.sysex[14];    // DETUNE    bankSysex[7] |= p.sysex[15];    // MIDI FUNCTION    bankSysex[9] |= p.sysex[16];    // MONO BENDER RANGE    bankSysex[8] |= (byte)(p.sysex[17] << 4);    // CHORD MEMORY    bankSysex[8] |= p.sysex[18];    // KEY ASSIGN MODE    bankSysex[10] |= (byte)(p.sysex[19] & 0x60);    // PATCH NAME (10 bytes)    for (int i = 0; i < 10; i++)    {      bankSysex[i+11] = p.sysex[20+i];    }    byte bankSysexNibbles[] = new byte[64];    for (int i = 0; i < 32; i++)    {      bankSysexNibbles[i*2] = (byte)(bankSysex[i] & 0x0F);      bankSysexNibbles[i*2+1] = (byte)((bankSysex[i] & 0xF0) >> 4);    }    int patchOffset = getPatchStart(patchNum);    System.arraycopy(bankSysexNibbles, 0, bank.sysex, patchOffset, 64);  }