/g;
newPatchScreen[ip] = newPatchScreen[ip].replace(regex2, '>');
// Is the Patch array increment even? //
if(ip % 2 == 0) {patchL = patchL + 128;}
// Is the Patch array iincrement odd? //
else {patchL = patchL + 138;}
}
// Scour the file and find all Tone names //
for (ip=128; ip<192; ip++)
{
patch[ip] = contents.substr(timbreL,10); name = ""; onePatch = patch[ip];
newPatchScreen[ip] = onePatch.slice(0,10);
timbreL = timbreL + 266;
// ASCII character 06 poses a display problem so replace it with a space character // Added to v2.1
newPatchScreen[ip] = newPatchScreen[ip].replace(/[^a-zA-Z0-9!?.,:;'"*+-/<=>]/g, " ");
// Less Than "<" and Greater Than ">" symbols alter the Tone and Patch name display // Added to v2.1
// So... replace them using equivalent ASCII character inserts "< and ">"
regex1 = //g;
newPatchScreen[ip] = newPatchScreen[ip].replace(regex2, '>');
}
if (document.querySelector('input[name = kllama1]:checked').value == "YES")
{
a01 = " a01 Acou Piano 1 b01 Fantasy r01 Closed High Hat-1";
a02 = " a02 Acou Piano 2 b02 Harmo Pan r02 Closed High Hat-2";
a03 = " a03 Acou Piano 3 b03 Chorale r03 Open High Hat-1";
a04 = " a04 Honky-Tonk b04 Glasses r04 Open High Hat-2";
a05 = " a05 Elec Piano 1 b05 Soundtrack r05 Crash Cymbal";
a06 = " a06 Elec Piano 2 b06 Atmosphere r06 Crash Cymbal (Short)";
a07 = " a07 Elec Piano 3 b07 Warm Bell r07 Crash Cymbal (Mute)";
a08 = " a08 Elec Piano 4 b08 Space Horn r08 Ride Cymbal";
a09 = " a09 Elec Organ 1 b09 Echo Bell r09 Ride Cymbal (Short)";
a10 = " a10 Elec Organ 2 b10 Icе Rains r10 Ride Cymbal (Mute)";
a11 = " a11 Elec Organ 3 b11 Oboe 2002 r11 Cup";
a12 = " a12 Elec Organ 4 b12 Echo Pan r12 Cup (Mute)";
a13 = " a13 Pipe Organ 1 b13 Bell Swing r13 China Cymbal";
a14 = " a14 Pipe Organ 2 b14 Reso Synth r14 Splash Cymbal";
a15 = " a15 Pipe Organ 3 b15 Steam Pad r15 Bass Drum-1";
a16 = " a16 Accordion b16 Vibe String r16 Bass Drum-2";
a17 = " a17 Harpsi 1 b17 Syn Lead 1 r17 Bass Drum-3";
a18 = " a18 Harpsi 2 b18 Syn Lead 2 r18 Bass Drum-4";
a19 = " a19 Harpsi 3 b19 Syn Lead 3 r19 Snare Drum-1";
a20 = " a20 Clav 1 b20 Syn Lead 4 r20 Snare Drum-2";
a21 = " a21 Clav 2 b21 Syn Bass 1 r21 Snare Drum-3";
a22 = " a22 Clav 3 b22 Syn Bass 2 r22 Snare Drum-4";
a23 = " a23 Celesta 1 b23 Syn Bass 3 r23 Snare Drum-5";
a24 = " a24 Celesta 2 b24 Syn Bass 4 r24 Snare Drum-6";
a25 = " a25 Violin 1 b25 Acou Bass 1 r25 Rim Shot";
a26 = " a26 Violin 2 b26 Acou Bass 2 r26 Brush-1";
a27 = " a27 Celo 1 b27 Elec Bass 1 r27 Brush-2";
a28 = " a28 Celo 2 b28 Elec Bass 2 r28 High Tom Tom-1";
a29 = " a29 Contrabass b29 Slap Bass 1 r29 Middle Tom Tom-1";
a30 = " a30 Pizzicato b30 Slap Bass 2 r30 Low Tom Tom-1";
a31 = " a31 Harp 1 b31 Fretless 1 r31 High Tom Tom-2";
a32 = " a32 Harp 2 b32 Fretless 2 r32 Middle Tom Tom-2";
a33 = " a33 Strings 1 b33 Vibe r33 Low Tom Tom-2";
a34 = " a34 Strings 2 b34 Glock r34 High Tom Tom-3";
a35 = " a35 Strings 3 b35 Marimba r35 Middle Tom Tom-3";
a36 = " a36 Strings 4 b36 Xylophone r36 Low Tom Tom-3";
a37 = " a37 Brass 1 b37 Guitar 1 r37 High Tom Tom-1";
a38 = " a38 Brass 2 b38 Guitar 2 r38 High Tom Tom-2";
a39 = " a39 Brass 3 b39 Elec Gtr 1 r39 Hand Clap";
a40 = " a40 Brass 4 b40 Elec Gtr 2 r40 Tambourine";
a41 = " a41 Trumpet 1 b41 Koto r41 Cowbell";
a42 = " a42 Trumpet 2 b42 Shamisen r42 High Bongo";
a43 = " a43 Trombone 1 b43 Jamisen r43 Low Bongo";
a44 = " a44 Trombone 2 b44 Sho r44 High Conga (Mute)";
a45 = " a45 Horn b45 Shakuhachi r45 High Conga";
a46 = " a46 Fr Horn b46 Wadako Set r46 Low Conga";
a47 = " a47 Engl Horn b47 Sitar r47 High Timbale";
a48 = " a48 Tuba b48 Steel Drum r48 Low Timbale";
a49 = " a49 Flute 1 b49 Tech Snare r49 High Agogo";
a50 = " a50 Flute 2 b50 Elec Tom r50 Low Agogo";
a51 = " a51 Piccolo b51 Reverse Cym r51 Cabasa";
a52 = " a52 Recorder b52 Ethno Hi r52 Maracas";
a53 = " a53 Pan Pipes b53 Timpani r53 Short Whistle";
a54 = " a54 Bottlebiow b54 Triangle r54 Long Whistle";
a55 = " a55 Breathpipe b55 Wind Bell r55 Quijada";
a56 = " a56 Whistle b56 Tube Bell r56 Claves";
a57 = " a57 Sax 1 b57 Orche Hit r57 Castanets";
a58 = " a58 Sax 2 b58 Bird Tweet r58 Triangle";
a59 = " a59 Sax 3 b59 One Note Jam r59 Wood Block";
a60 = " a60 Clarinet 1 b60 Telephone r60 Bell";
a61 = " a61 Clarinet 2 b61 Typewrier r61 Native Drum-1";
a62 = " a62 Oboe b62 Insect r62 Native Drum-2";
a63 = " a63 Bassoon b63 Water Bells r63 Native Drum-3";
a64 = " a64 Harmonica b64 Jungle Tune r64 OFF";
screenLine = "Filename: " + newFilename + " " + ftype; screenLine += "
----------------------- --------------------- ------------------------ ------------------------ --------------------------
"; screenLine += "P# PATCH NAME (RAM) T# TONE NAME (RAM) T# TONE NAME (ROM) T# TONE NAME (ROM) R# RHYTHM NAME (ROM)
"; screenLine += "----------------------- --------------------- ------------------------ ------------------------ --------------------------
";
document.querySelector("#display").insertAdjacentHTML('beforeend',screenLine);
}
if (document.querySelector('input[name = kllama1]:checked').value == "NO")
{
a01 = "";
a02 = "";
a03 = "";
a04 = "";
a05 = "";
a06 = "";
a07 = "";
a08 = "";
a09 = "";
a10 = "";
a11 = "";
a12 = "";
a13 = "";
a14 = "";
a15 = "";
a16 = "";
a17 = "";
a18 = "";
a19 = "";
a20 = "";
a21 = "";
a22 = "";
a23 = "";
a24 = "";
a25 = "";
a26 = "";
a27 = "";
a28 = "";
a29 = "";
a30 = "";
a31 = "";
a32 = "";
a33 = "";
a34 = "";
a35 = "";
a36 = "";
a37 = "";
a38 = "";
a39 = "";
a40 = "";
a41 = "";
a42 = "";
a43 = "";
a44 = "";
a45 = "";
a46 = "";
a47 = "";
a48 = "";
a49 = "";
a50 = "";
a51 = "";
a52 = "";
a53 = "";
a54 = "";
a55 = "";
a56 = "";
a57 = "";
a58 = "";
a59 = "";
a60 = "";
a61 = "";
a62 = "";
a63 = "";
a64 = "";
screenLine = "Filename: " + newFilename + " " + ftype; screenLine += "
----------------------- ---------------------
"; screenLine += "P# PATCH NAME (RAM) T# TONE NAME (RAM)
"; screenLine += "----------------------- ---------------------
";
document.querySelector("#display").insertAdjacentHTML('beforeend',screenLine);
}
// Setup the Patch and Tone arrays to be displayed on the screen //
screenLine =
"I-11 " + newPatchScreen[0] + " " + " i01 " + newPatchScreen[128] + a01 + "
" +
"I-12 " + newPatchScreen[1] + " " + " i02 " + newPatchScreen[129] + a02 + "
" +
"I-13 " + newPatchScreen[2] + " " + " i03 " + newPatchScreen[130] + a03 + "
" +
"I-14 " + newPatchScreen[3] + " " + " i04 " + newPatchScreen[131] + a04 + "
" +
"I-15 " + newPatchScreen[4] + " " + " i05 " + newPatchScreen[132] + a05 + "
" +
"I-16 " + newPatchScreen[5] + " " + " i06 " + newPatchScreen[133] + a06 + "
" +
"I-17 " + newPatchScreen[6] + " " + " i07 " + newPatchScreen[134] + a07 + "
" +
"I-18 " + newPatchScreen[7] + " " + " i08 " + newPatchScreen[135] + a08 + "
" +
" i09 " + newPatchScreen[136] + a09 + "
" +
"I-21 " + newPatchScreen[8] + " " + " i10 " + newPatchScreen[137] + a10 + "
" +
"I-22 " + newPatchScreen[9] + " " + " i11 " + newPatchScreen[138] + a11 + "
" +
"I-23 " + newPatchScreen[10] + " " + " i12 " + newPatchScreen[139] + a12 + "
" +
"I-24 " + newPatchScreen[11] + " " + " i13 " + newPatchScreen[140] + a13 + "
" +
"I-25 " + newPatchScreen[12] + " " + " i14 " + newPatchScreen[141] + a14 + "
" +
"I-26 " + newPatchScreen[13] + " " + " i15 " + newPatchScreen[142] + a15 + "
" +
"I-27 " + newPatchScreen[14] + " " + " i16 " + newPatchScreen[143] + a16 + "
" +
"I-28 " + newPatchScreen[15] + " " + " i17 " + newPatchScreen[144] + a17 + "
" +
" i18 " + newPatchScreen[145] + a18 + "
" +
"I-31 " + newPatchScreen[16] + " " + " i19 " + newPatchScreen[146] + a19 + "
" +
"I-32 " + newPatchScreen[17] + " " + " i20 " + newPatchScreen[147] + a20 + "
" +
"I-33 " + newPatchScreen[18] + " " + " i21 " + newPatchScreen[148] + a21 + "
" +
"I-34 " + newPatchScreen[19] + " " + " i22 " + newPatchScreen[149] + a22 + "
" +
"I-35 " + newPatchScreen[20] + " " + " i23 " + newPatchScreen[150] + a23 + "
" +
"I-36 " + newPatchScreen[21] + " " + " i24 " + newPatchScreen[151] + a24 + "
" +
"I-37 " + newPatchScreen[22] + " " + " i25 " + newPatchScreen[152] + a25 + "
" +
"I-38 " + newPatchScreen[23] + " " + " i26 " + newPatchScreen[153] + a26 + "
" +
" i27 " + newPatchScreen[154] + a27 + "
" +
"I-41 " + newPatchScreen[24] + " " + " i28 " + newPatchScreen[155] + a28 + "
" +
"I-42 " + newPatchScreen[25] + " " + " i29 " + newPatchScreen[156] + a29 + "
" +
"I-43 " + newPatchScreen[26] + " " + " i30 " + newPatchScreen[157] + a30 + "
" +
"I-44 " + newPatchScreen[27] + " " + " i31 " + newPatchScreen[158] + a31 + "
" +
"I-45 " + newPatchScreen[28] + " " + " i32 " + newPatchScreen[159] + a32 + "
" +
"I-46 " + newPatchScreen[29] + " " + " i33 " + newPatchScreen[160] + a33 + "
" +
"I-47 " + newPatchScreen[30] + " " + " i34 " + newPatchScreen[161] + a34 + "
" +
"I-48 " + newPatchScreen[31] + " " + " i35 " + newPatchScreen[162] + a35 + "
" +
" i36 " + newPatchScreen[163] + a36 + "
" +
"I-51 " + newPatchScreen[32] + " " + " i37 " + newPatchScreen[164] + a37 + "
" +
"I-52 " + newPatchScreen[33] + " " + " i38 " + newPatchScreen[165] + a38 + "
" +
"I-53 " + newPatchScreen[34] + " " + " i39 " + newPatchScreen[166] + a39 + "
" +
"I-54 " + newPatchScreen[35] + " " + " i40 " + newPatchScreen[167] + a40 + "
" +
"I-55 " + newPatchScreen[36] + " " + " i41 " + newPatchScreen[168] + a41 + "
" +
"I-56 " + newPatchScreen[37] + " " + " i42 " + newPatchScreen[169] + a42 + "
" +
"I-57 " + newPatchScreen[38] + " " + " i43 " + newPatchScreen[170] + a43 + "
" +
"I-58 " + newPatchScreen[39] + " " + " i44 " + newPatchScreen[171] + a44 + "
" +
" i45 " + newPatchScreen[172] + a45 + "
" +
"I-61 " + newPatchScreen[40] + " " + " i46 " + newPatchScreen[173] + a46 + "
" +
"I-62 " + newPatchScreen[41] + " " + " i47 " + newPatchScreen[174] + a47 + "
" +
"I-63 " + newPatchScreen[42] + " " + " i48 " + newPatchScreen[175] + a48 + "
" +
"I-64 " + newPatchScreen[43] + " " + " i49 " + newPatchScreen[176] + a49 + "
" +
"I-65 " + newPatchScreen[44] + " " + " i50 " + newPatchScreen[177] + a50 + "
" +
"I-66 " + newPatchScreen[45] + " " + " i51 " + newPatchScreen[178] + a51 + "
" +
"I-67 " + newPatchScreen[46] + " " + " i52 " + newPatchScreen[179] + a52 + "
" +
"I-68 " + newPatchScreen[47] + " " + " i53 " + newPatchScreen[180] + a53 + "
" +
" i54 " + newPatchScreen[181] + a54 + "
" +
"I-71 " + newPatchScreen[48] + " " + " i55 " + newPatchScreen[182] + a55 + "
" +
"I-72 " + newPatchScreen[49] + " " + " i56 " + newPatchScreen[183] + a56 + "
" +
"I-73 " + newPatchScreen[50] + " " + " i57 " + newPatchScreen[184] + a57 + "
" +
"I-74 " + newPatchScreen[51] + " " + " i58 " + newPatchScreen[185] + a58 + "
" +
"I-75 " + newPatchScreen[52] + " " + " i59 " + newPatchScreen[186] + a59 + "
" +
"I-76 " + newPatchScreen[53] + " " + " i60 " + newPatchScreen[187] + a60 + "
" +
"I-77 " + newPatchScreen[54] + " " + " i61 " + newPatchScreen[188] + a61 + "
" +
"I-78 " + newPatchScreen[55] + " " + " i62 " + newPatchScreen[189] + a62 + "
" +
" i63 " + newPatchScreen[190] + a63 + "
" +
"I-81 " + newPatchScreen[56] + " " + " i64 " + newPatchScreen[191] + a64 + "
" +
"I-82 " + newPatchScreen[57] + "
" +
"I-83 " + newPatchScreen[58] + "
" +
"I-84 " + newPatchScreen[59] + "
" +
"I-85 " + newPatchScreen[60] + "
" +
"I-86 " + newPatchScreen[61] + "
" +
"I-87 " + newPatchScreen[62] + "
" +
"I-88 " + newPatchScreen[63] + "
"
document.querySelector("#display").insertAdjacentHTML('beforeend',screenLine); newk = newk + 32;
if (newk > 125)
{
newk = 0; ip = ip + 1;
}
}
reader.readAsBinaryString(oneFile);
}
else
{
alert("Failed to load file");
}
}
// Send all Patch and Tone arrays to the screen //
document.getElementById('myFile').addEventListener('change',readSingleFile, false);