bank.sysex[getPatchStart(patchNum)+ 0]=(byte)(p.sysex[6+ 2]*64+patchNum);  bank.sysex[getPatchStart(patchNum)+ 1]=(byte)((p.sysex[6+ 4]&7)*16+p.sysex[6+ 3]);  bank.sysex[getPatchStart(patchNum)+ 2]=(byte)(p.sysex[6+ 5]); bank.sysex[getPatchStart(patchNum)+ 3]=(byte)(p.sysex[6+ 7]* 2+p.sysex[6+ 6]);  bank.sysex[getPatchStart(patchNum)+ 4]=(byte)(p.sysex[6+10]*16+p.sysex[6+ 9]);  bank.sysex[getPatchStart(patchNum)+ 5]=(byte)(p.sysex[6+12]*16+p.sysex[6+11]);  bank.sysex[getPatchStart(patchNum)+ 6]=(byte)(p.sysex[6+14]*16+p.sysex[6+13]);  bank.sysex[getPatchStart(patchNum)+ 7]=(byte)(p.sysex[6+16]*16+p.sysex[6+15]);  bank.sysex[getPatchStart(patchNum)+ 8]=(byte)(0); bank.sysex[getPatchStart(patchNum)+ 9]=(byte)(0); bank.sysex[getPatchStart(patchNum)+10]=(byte)(0); bank.sysex[getPatchStart(patchNum)+11]=(byte)(0); bank.sysex[getPatchStart(patchNum)+12]=(byte)(0); bank.sysex[getPatchStart(patchNum)+13]=(byte)(0); bank.sysex[getPatchStart(patchNum)+14]=(byte)(p.sysex[6+26]); bank.sysex[getPatchStart(patchNum)+15]=(byte)(((p.sysex[6+ 4]&15)>>3)*64);
bank.sysex[getPatchStart(patchNum)+ 0]=(byte)( ((p.sysex[6+ 2]&  1)    *64) +  (patchNum     & 63)); bank.sysex[getPatchStart(patchNum)+ 1]=(byte)( ((p.sysex[6+ 4]&  7)    *16) +  (p.sysex[6+ 3]& 15)); bank.sysex[getPatchStart(patchNum)+ 2]=(byte)(  (p.sysex[6+ 5]& 127)); bank.sysex[getPatchStart(patchNum)+ 3]=(byte)( ((p.sysex[6+ 1]& 15)    * 8) + ((p.sysex[6+ 8]&  1)    * 4) + ((p.sysex[6+ 7]&  1)    * 2) +  (p.sysex[6+ 6]&  1)); bank.sysex[getPatchStart(patchNum)+ 4]=(byte)( ((p.sysex[6+10]&  7)    *16) +  (p.sysex[6+ 9]& 15)); bank.sysex[getPatchStart(patchNum)+ 5]=(byte)( ((p.sysex[6+12]&  7)    *16) +  (p.sysex[6+11]& 15)); bank.sysex[getPatchStart(patchNum)+ 6]=(byte)( ((p.sysex[6+14]&  7)    *16) +  (p.sysex[6+13]& 15)); bank.sysex[getPatchStart(patchNum)+ 7]=(byte)( ((p.sysex[6+16]&  7)    *16) + 	(p.sysex[6+15]& 15)); bank.sysex[getPatchStart(patchNum)+ 8]=(byte)(0); bank.sysex[getPatchStart(patchNum)+ 9]=(byte)(0); bank.sysex[getPatchStart(patchNum)+10]=(byte)(0); bank.sysex[getPatchStart(patchNum)+11]=(byte)(0); bank.sysex[getPatchStart(patchNum)+12]=(byte)(0); bank.sysex[getPatchStart(patchNum)+13]=(byte)(0); bank.sysex[getPatchStart(patchNum)+14]=(byte)( 	(p.sysex[6+26]&  7)); bank.sysex[getPatchStart(patchNum)+15]=(byte)((((p.sysex[6+ 4]& 15)>>3)*64) + 	(p.sysex[6+29]& 63));
	public void putPatch(Patch bank,Patch p,int patchNum)		//puts a patch into the bank, converting it as needed	{		if (!canHoldPatch(p))		{			DX7FamilyStrings.dxShowError(toString(), "This type of patch does not fit in to this type of bank.");			return;		}			// Transform Voice Data to Bulk Dump Packed Format				//    ***** Voice A *****		bank.sysex[getPatchStart(patchNum)+ 0]=(byte)(p.sysex[6+ 2]*64+patchNum);		// Poly/Mono ..............(0- 1)													//	| UNDOCUMENTED! matching voice#(0-63)		bank.sysex[getPatchStart(patchNum)+ 1]=(byte)((p.sysex[6+ 4]&7)*16+p.sysex[6+ 3]);	// Pitch Bend Step (Low)...(0-12)													//	| Pitch Bend Range ............(0-12)		bank.sysex[getPatchStart(patchNum)+ 2]=(byte)(p.sysex[6+ 5]);				// Portamento Time ........(0-99)		bank.sysex[getPatchStart(patchNum)+ 3]=(byte)(p.sysex[6+ 7]* 2+p.sysex[6+ 6]);		// Portamento Mode ........(0- 1)													//	| Portamento/Glissando ........(0- 1)		bank.sysex[getPatchStart(patchNum)+ 4]=(byte)(p.sysex[6+10]*16+p.sysex[6+ 9]);		// Modulation Wheel Assign (0- 7)													//	| Modulation Wheel Sensitivity (0-15)		bank.sysex[getPatchStart(patchNum)+ 5]=(byte)(p.sysex[6+12]*16+p.sysex[6+11]);		// Foot Control Assign ....(0- 7)													//	| Foot Control Sensitivity ....(0-15)		bank.sysex[getPatchStart(patchNum)+ 6]=(byte)(p.sysex[6+14]*16+p.sysex[6+13]);		// Aftertouch Assign ......(0- 7)													//	| Aftertouch Sensitivity ......(0-15)		bank.sysex[getPatchStart(patchNum)+ 7]=(byte)(p.sysex[6+16]*16+p.sysex[6+15]);		// Breath Control Assign ..(0- 7)													//	| Breath Control Sensitivity ..(0-15)		bank.sysex[getPatchStart(patchNum)+ 8]=(byte)(0);					// not used?		bank.sysex[getPatchStart(patchNum)+ 9]=(byte)(0);					// not used?		bank.sysex[getPatchStart(patchNum)+10]=(byte)(0);					// not used?		bank.sysex[getPatchStart(patchNum)+11]=(byte)(0);					// not used?		bank.sysex[getPatchStart(patchNum)+12]=(byte)(0);					// not used?		bank.sysex[getPatchStart(patchNum)+13]=(byte)(0);					// not used?		bank.sysex[getPatchStart(patchNum)+14]=(byte)(p.sysex[6+26]);				// Attenuation ............(0- 7)		bank.sysex[getPatchStart(patchNum)+15]=(byte)(((p.sysex[6+ 4]&15)>>3)*64);		// Pitch Bend Step (High)..(0-12)		//    ***** Voice B *****		bank.sysex[getPatchStart(patchNum)+16]=(byte)(p.sysex[6+32]*64+patchNum);		// Poly/Mono ..............(0- 1)													//	| UNDOCUMENTED! matching voice#(0-63)		bank.sysex[getPatchStart(patchNum)+17]=(byte)((p.sysex[6+34]&7)*16+p.sysex[6+33]);	// Pitch Bend Step (Low)...(0-12)													//	| Pitch Bend Range ............(0-12)		bank.sysex[getPatchStart(patchNum)+18]=(byte)(p.sysex[6+35]);				// Portamento Time ........(0-99)		bank.sysex[getPatchStart(patchNum)+19]=(byte)(p.sysex[6+37]* 2+p.sysex[6+36]);		// Portamento Mode ........(0- 1)													//	| Portamento/Glissando ........(0- 1)		bank.sysex[getPatchStart(patchNum)+20]=(byte)(p.sysex[6+40]*16+p.sysex[6+39]);		// Modulation Wheel Assign (0- 7)													//	| Modulation Wheel Sensitivity (0-15)		bank.sysex[getPatchStart(patchNum)+21]=(byte)(p.sysex[6+42]*16+p.sysex[6+41]);		// Foot Control Assign ....(0- 7)													//	| Foot Control Sensitivity ....(0-15)		bank.sysex[getPatchStart(patchNum)+22]=(byte)(p.sysex[6+44]*16+p.sysex[6+43]);		// Aftertouch Assign ......(0- 7)													//	| Aftertouch Sensitivity ......(0-15)		bank.sysex[getPatchStart(patchNum)+23]=(byte)(p.sysex[6+46]*16+p.sysex[6+45]);		// Breath Control Assign ..(0- 7)													//	| Breath Control Sensitivity ..(0-15)		bank.sysex[getPatchStart(patchNum)+24]=(byte)(0);					// not used?		bank.sysex[getPatchStart(patchNum)+25]=(byte)(0);					// not used?		bank.sysex[getPatchStart(patchNum)+26]=(byte)(0);					// not used?		bank.sysex[getPatchStart(patchNum)+27]=(byte)(0);					// not used?		bank.sysex[getPatchStart(patchNum)+28]=(byte)(0);					// not used?		bank.sysex[getPatchStart(patchNum)+29]=(byte)(0);					// not used?		bank.sysex[getPatchStart(patchNum)+30]=(byte)(p.sysex[6+56]);				// Attenuation ............(0- 7)		bank.sysex[getPatchStart(patchNum)+31]=(byte)(((p.sysex[6+34]&15)>>3)*64);		// Pitch Bend Step (High)..(0-12)		//    ***** Common *****		bank.sysex[getPatchStart(patchNum)+32]=(byte)(p.sysex[6+61]*4+(p.sysex[6+60]&3));	// Voice Memory Select ....(0- 1)													//	| Key Assign Mode ...(0- 2)		bank.sysex[getPatchStart(patchNum)+33]=(byte)(p.sysex[6+63]);				// not used?		bank.sysex[getPatchStart(patchNum)+34]=(byte)(p.sysex[6+64]);				// Voice name  1 ...........ASCII		bank.sysex[getPatchStart(patchNum)+35]=(byte)(p.sysex[6+65]);				// Voice name  2 ...........ASCII		bank.sysex[getPatchStart(patchNum)+36]=(byte)(p.sysex[6+66]);				// Voice name  3 ...........ASCII		bank.sysex[getPatchStart(patchNum)+37]=(byte)(p.sysex[6+67]);				// Voice name  4 ...........ASCII		bank.sysex[getPatchStart(patchNum)+38]=(byte)(p.sysex[6+68]);				// Voice name  5 ...........ASCII		bank.sysex[getPatchStart(patchNum)+39]=(byte)(p.sysex[6+69]);				// Voice name  6 ...........ASCII		bank.sysex[getPatchStart(patchNum)+40]=(byte)(p.sysex[6+70]);				// Voice name  7 ...........ASCII		bank.sysex[getPatchStart(patchNum)+41]=(byte)(p.sysex[6+71]);				// Voice name  8 ...........ASCII		bank.sysex[getPatchStart(patchNum)+42]=(byte)(p.sysex[6+72]);				// Voice name  9 ...........ASCII		bank.sysex[getPatchStart(patchNum)+43]=(byte)(p.sysex[6+73]);				// Voice name 10 ...........ASCII		bank.sysex[getPatchStart(patchNum)+44]=(byte)(p.sysex[6+74]);				// Voice name 11 ...........ASCII		bank.sysex[getPatchStart(patchNum)+45]=(byte)(p.sysex[6+75]);				// Voice name 12 ...........ASCII		bank.sysex[getPatchStart(patchNum)+46]=(byte)(p.sysex[6+76]);				// Voice name 13 ...........ASCII		bank.sysex[getPatchStart(patchNum)+47]=(byte)(p.sysex[6+77]);				// Voice name 14 ...........ASCII		bank.sysex[getPatchStart(patchNum)+48]=(byte)(p.sysex[6+78]);				// Voice name 15 ...........ASCII		bank.sysex[getPatchStart(patchNum)+49]=(byte)(p.sysex[6+79]);				// Voice name 16 ...........ASCII		bank.sysex[getPatchStart(patchNum)+50]=(byte)(p.sysex[6+80]);				// Voice name 17 ...........ASCII		bank.sysex[getPatchStart(patchNum)+51]=(byte)(p.sysex[6+81]);				// Voice name 18 ...........ASCII		bank.sysex[getPatchStart(patchNum)+52]=(byte)(p.sysex[6+82]);				// Voice name 19 ...........ASCII		bank.sysex[getPatchStart(patchNum)+53]=(byte)(p.sysex[6+83]);				// Voice name 20 ...........ASCII		bank.sysex[getPatchStart(patchNum)+54]=(byte)(p.sysex[6+84]);				// Voice name 21 ...........ASCII		bank.sysex[getPatchStart(patchNum)+55]=(byte)(p.sysex[6+85]);				// Voice name 22 ...........ASCII		bank.sysex[getPatchStart(patchNum)+56]=(byte)(p.sysex[6+86]);				// Voice name 23 ...........ASCII		bank.sysex[getPatchStart(patchNum)+57]=(byte)(p.sysex[6+87]);				// Voice name 24 ...........ASCII		bank.sysex[getPatchStart(patchNum)+58]=(byte)(p.sysex[6+88]);				// Voice name 25 ...........ASCII		bank.sysex[getPatchStart(patchNum)+59]=(byte)(p.sysex[6+89]);				// Voice name 26 ...........ASCII		bank.sysex[getPatchStart(patchNum)+60]=(byte)(p.sysex[6+90]);				// Voice name 27 ...........ASCII		bank.sysex[getPatchStart(patchNum)+61]=(byte)(p.sysex[6+91]);				// Voice name 28 ...........ASCII		bank.sysex[getPatchStart(patchNum)+62]=(byte)(p.sysex[6+92]);				// Voice name 29 ...........ASCII		bank.sysex[getPatchStart(patchNum)+63]=(byte)(p.sysex[6+93]);				// Voice name 30 ...........ASCII			calculateChecksum(bank);	}