public static final Patch createNewPatch(int patchNum) {  byte [] sysex = new byte[TG100Constants.PATCH_SIZE]; int iTemp = TG100Constants.SYSEX_VOICE_START_ADDRESS3 + (patchNum * TG100Constants.SYSEX_SINGLE_VOICE_SIZE);    sysex[0]  = (byte) 0xF0; sysex[1]  = (byte) 0x43; sysex[2]  = (byte) 0x10; sysex[3]  = (byte) 0x27;   sysex[4]  = (byte) 0x30; sysex[5]  = (byte) ((iTemp / 128) + TG100Constants.SYSEX_VOICE_START_ADDRESS2 ); sysex[6]  = (byte) (iTemp % 128);   sysex[7]  = (byte) 0x02; sysex[8]  = (byte) 0x7F; sysex[9]  = (byte) 0x7F; sysex[10] = (byte) 0x40; sysex[11] = (byte) 0x40; sysex[12] = (byte) 0x01; sysex[13] = (byte) 0x0F; sysex[14] = (byte) 0x00; sysex[15] = (byte) 0x00; sysex[16] = (byte) 0x00; sysex[17] = (byte) 0x00; sysex[18] = (byte) 0x3C; sysex[19] = (byte) 0x40; sysex[20] = (byte) 0x40; sysex[21] = (byte) 0x00; sysex[22] = (byte) 0x3C;  sysex[23] = (byte) 'N'; sysex[24] = (byte) 'e'; sysex[25] = (byte) 'w'; sysex[26] = (byte) 'V'; sysex[27] = (byte) 'o'; sysex[28] = (byte) 'i'; sysex[29] = (byte) 'c'; sysex[30] = (byte) 'e';   sysex[31] = (byte) 0x00; sysex[32] = (byte) 0x00; sysex[33] = (byte) 0x40; sysex[34] = (byte) 0x40; sysex[35] = (byte) 0x40; sysex[36] = (byte) 0x40; sysex[37] = (byte) 0x40; sysex[38] = (byte) 0x40; sysex[39] = (byte) 0x08; sysex[40] = (byte) 0x00; sysex[41] = (byte) 0x08; sysex[42] = (byte) 0x00; sysex[43] = (byte) 0x08; sysex[44] = (byte) 0x00; sysex[45] = (byte) 0x08; sysex[46] = (byte) 0x00; sysex[47] = (byte) 0x00; sysex[48] = (byte) 0x04; sysex[49] = (byte) 0x00; sysex[50] = (byte) 0x00; sysex[51] = (byte) 0x00; sysex[52] = (byte) 0x00; sysex[53] = (byte) 0x00; sysex[54] = (byte) 0x01; sysex[55] = (byte) 0x01; sysex[56] = (byte) 0x00; sysex[57] = (byte) 0x3F; sysex[58] = (byte) 0x3F; sysex[59] = (byte) 0x3F; sysex[60] = (byte) 0x3F; sysex[61] = (byte) 0x40; sysex[62] = (byte) 0x40; sysex[63] = (byte) 0x40; sysex[64] = (byte) 0x40; sysex[65] = (byte) 0x40; sysex[66] = (byte) 0x00;   sysex[67] = (byte) 0x00; sysex[68] = (byte) 0x00; sysex[69] = (byte) 0x40; sysex[70] = (byte) 0x40; sysex[71] = (byte) 0x40; sysex[72] = (byte) 0x40; sysex[73] = (byte) 0x40; sysex[74] = (byte) 0x40; sysex[75] = (byte) 0x08; sysex[76] = (byte) 0x00; sysex[77] = (byte) 0x08; sysex[78] = (byte) 0x00; sysex[79] = (byte) 0x08; sysex[80] = (byte) 0x00; sysex[81] = (byte) 0x08; sysex[82] = (byte) 0x00; sysex[83] = (byte) 0x00; sysex[84] = (byte) 0x04; sysex[85] = (byte) 0x00; sysex[86] = (byte) 0x00; sysex[87] = (byte) 0x00; sysex[88] = (byte) 0x00; sysex[89] = (byte) 0x00; sysex[90] = (byte) 0x01; sysex[91] = (byte) 0x01; sysex[92] = (byte) 0x00; sysex[93] = (byte) 0x3F; sysex[94] = (byte) 0x3F; sysex[95] = (byte) 0x3F; sysex[96] = (byte) 0x3F; sysex[97] = (byte) 0x40; sysex[98] = (byte) 0x40; sysex[99] = (byte) 0x40; sysex[100] = (byte) 0x40; sysex[101] = (byte) 0x40; sysex[102] = (byte) 0x00;    sysex[104] = (byte) 0xF7;   Patch p = new Patch(sysex);
public IPatch createNewPatch() { Patch p = this.createNewPatch(0); calculateChecksum(p);
    public static final Patch createNewPatch(int patchNum) {        byte [] sysex = new byte[TG100Constants.PATCH_SIZE];        int iTemp = TG100Constants.SYSEX_VOICE_START_ADDRESS3                    + (patchNum * TG100Constants.SYSEX_SINGLE_VOICE_SIZE);        // Create new patch on internal voice 1        sysex[0]  = (byte) 0xF0;        sysex[1]  = (byte) 0x43;        sysex[2]  = (byte) 0x10; // Device number        sysex[3]  = (byte) 0x27;        // Internal voice 0 (= 1 in the TG-100 UI)        sysex[4]  = (byte) 0x30;        sysex[5]  = (byte) ((iTemp / 128) + TG100Constants.SYSEX_VOICE_START_ADDRESS2 );        sysex[6]  = (byte) (iTemp % 128);        // Common Parameter (24 Bytes)        sysex[7]  = (byte) 0x02; // 2 Elements        sysex[8]  = (byte) 0x7F; // Level 127        sysex[9]  = (byte) 0x7F; // Level 127        sysex[10] = (byte) 0x40;        sysex[11] = (byte) 0x40;        sysex[12] = (byte) 0x01;        sysex[13] = (byte) 0x0F;        sysex[14] = (byte) 0x00; // don't care        sysex[15] = (byte) 0x00;        sysex[16] = (byte) 0x00; // don't care        sysex[17] = (byte) 0x00;        sysex[18] = (byte) 0x3C;        sysex[19] = (byte) 0x40;        sysex[20] = (byte) 0x40;        sysex[21] = (byte) 0x00;        sysex[22] = (byte) 0x3C;        // 23 - 30 : Patch Name        sysex[23] = (byte) 'N';        sysex[24] = (byte) 'e';        sysex[25] = (byte) 'w';        sysex[26] = (byte) 'V';        sysex[27] = (byte) 'o';        sysex[28] = (byte) 'i';        sysex[29] = (byte) 'c';        sysex[30] = (byte) 'e';        // Element 1 parameter (36 Bytes)        sysex[31] = (byte) 0x00; sysex[32] = (byte) 0x00; // Waveform 0        sysex[33] = (byte) 0x40;        sysex[34] = (byte) 0x40;        sysex[35] = (byte) 0x40;        sysex[36] = (byte) 0x40;        sysex[37] = (byte) 0x40;        sysex[38] = (byte) 0x40;        sysex[39] = (byte) 0x08; sysex[40] = (byte) 0x00;        sysex[41] = (byte) 0x08; sysex[42] = (byte) 0x00;        sysex[43] = (byte) 0x08; sysex[44] = (byte) 0x00;        sysex[45] = (byte) 0x08; sysex[46] = (byte) 0x00;        sysex[47] = (byte) 0x00; // Panpot        sysex[48] = (byte) 0x04; // LFO Speed        sysex[49] = (byte) 0x00; // LFO Delay        sysex[50] = (byte) 0x00; // "don't care"        sysex[51] = (byte) 0x00;        sysex[52] = (byte) 0x00;        sysex[53] = (byte) 0x00;        sysex[54] = (byte) 0x01;        sysex[55] = (byte) 0x01;        sysex[56] = (byte) 0x00;        sysex[57] = (byte) 0x3F; // P-EG R1 (Rate 1)        sysex[58] = (byte) 0x3F; // P-EG R2 (Rate 2)        sysex[59] = (byte) 0x3F; // P-EG R3 (Rate 3)        sysex[60] = (byte) 0x3F; // P-EG RR (Release Rate)        sysex[61] = (byte) 0x40; // P-EG LO (Level Offset???)        sysex[62] = (byte) 0x40; // P-EG L1 (Level 1)        sysex[63] = (byte) 0x40; // P-EG L2 (Level 2)        sysex[64] = (byte) 0x40; // P-EG L3 (Level 3)        sysex[65] = (byte) 0x40; // P-EG RL (Release Level)        sysex[66] = (byte) 0x00; // Velocity curve        // Element 2 parameter (36 Bytes)        sysex[67] = (byte) 0x00; sysex[68] = (byte) 0x00; // Waveform 0        sysex[69] = (byte) 0x40;        sysex[70] = (byte) 0x40;        sysex[71] = (byte) 0x40;        sysex[72] = (byte) 0x40;        sysex[73] = (byte) 0x40;        sysex[74] = (byte) 0x40;        sysex[75] = (byte) 0x08; sysex[76] = (byte) 0x00;        sysex[77] = (byte) 0x08; sysex[78] = (byte) 0x00;        sysex[79] = (byte) 0x08; sysex[80] = (byte) 0x00;        sysex[81] = (byte) 0x08; sysex[82] = (byte) 0x00;        sysex[83] = (byte) 0x00; // Panpot        sysex[84] = (byte) 0x04; // LFO Speed        sysex[85] = (byte) 0x00; // LFO Delay        sysex[86] = (byte) 0x00; // "don't care"        sysex[87] = (byte) 0x00;        sysex[88] = (byte) 0x00;        sysex[89] = (byte) 0x00;        sysex[90] = (byte) 0x01;        sysex[91] = (byte) 0x01;        sysex[92] = (byte) 0x00;        sysex[93] = (byte) 0x3F; // P-EG R1 (Rate 1)        sysex[94] = (byte) 0x3F; // P-EG R2 (Rate 2)        sysex[95] = (byte) 0x3F; // P-EG R3 (Rate 3)        sysex[96] = (byte) 0x3F; // P-EG RR (Release Rate)        sysex[97] = (byte) 0x40; // P-EG L0 (Level 0)        sysex[98] = (byte) 0x40; // P-EG L1 (Level 1)        sysex[99] = (byte) 0x40; // P-EG L2 (Level 2)        sysex[100] = (byte) 0x40; // P-EG L3 (Level 3)        sysex[101] = (byte) 0x40; // P-EG RL (Release Level)        sysex[102] = (byte) 0x00; // Velocity curve        // 103 is the checksum        sysex[104] = (byte) 0xF7;        Patch p = new Patch(sysex);                return p;    }