Patch p = new Patch(sysex);
IPatch p = new Patch(sysex);
  public Patch getPatch(Patch bank, int patchNum)  {      byte bankSysexNibbles[] = new byte[64];      byte bankSysex[] = new byte[32];      byte sysex[] = new byte[31];      sysex[0] = (byte)0xF0;      sysex[1] = (byte)0x41;      sysex[2] = (byte)0x35;      sysex[3] = (byte)0x00;      sysex[4] = (byte)0x23;      sysex[5] = (byte)0x30;      sysex[6] = (byte)0x01;      sysex[30] = (byte)0xF7;      int patchOffset = getPatchStart(patchNum);      System.arraycopy(bank.sysex, patchOffset, bankSysexNibbles, 0, 64);      //   convert bank patch (31 bytes, lo/hi nibble) to single patch (46 bytes)      for (int i = 0; i < 32; i++)      {        bankSysex[i] = (byte)(bankSysexNibbles[i*2] | bankSysexNibbles[i*2+1] << 4);      }      // TONE NUMBER      sysex[7] = bankSysex[0];      // KEY RANGE LOW      sysex[8] = (byte)(bankSysex[1] - 4);  // sysex docs didn't show, but needed to get correct value      // KEY RANGE HIGH      sysex[9] = (byte)(bankSysex[2] - 4);  // sysex docs didn't show, but needed to get correct value      // PORTAMENTO TIME      sysex[10] = bankSysex[3];      // PORTAMENTO      sysex[11] = (byte)((bankSysex[10] & 0x10) >> 4);      // MOD SENS      sysex[12] = bankSysex[4];      // KEY SHIFT      sysex[13] = bankSysex[5];      // VOLUME      sysex[14] = bankSysex[6];      // DETUNE      sysex[15] = bankSysex[7];      // MIDI FUNCTION      sysex[16] = bankSysex[9];      // MONO BENDER RANGE      sysex[17] = (byte)((bankSysex[8] & 0xF0) >> 4);      // CHORD MEMORY      sysex[18] = (byte)(bankSysex[8] & 0x0F);      // KEY ASSIGN MODE      sysex[19] = (byte)(bankSysex[10] & 0x60);      // PATCH NAME (10 bytes)      for (int i = 0; i < 10; i++)      {        sysex[20+i] = (byte)(bankSysex[i+11] & 0x3F);      }      Patch p = new Patch(sysex);      return p;  }