//This program generates an automatic bassline! //copyright (c) Jacob Wittenberg 2010 //TriOsc serves as the bass for now TriOsc player=> Gain g => dac; //StifKarp is the metronome that gives you 4 counts before //the bass line begins StifKarp metr => dac; 50 => metr.freq; .5 => metr.gain; 0 => g.gain; int key; int targ; int s; //Input tempo here 170 => int tempo; //These are the note length values 60000/tempo => int note4; note4/2 => int note8; note8/2 => int note16; note4*2 => int note2; note4/3 => int note3; note3/2 => int note6; //Metronome for (0 => int t; t<4; t++) { .5 => metr.pluck; note2::ms => now; } 0 => metr.gain; //Set volume of bass here. 3.0 => float gainInt; gainInt => g.gain; //Bass Generating Loop until (false) { //input chord changes in quotes, //lower case for minor, uppercase for major //do not use sharps (instead of "F#", write "Gb") ["f","bb","Eb","A", "Ab","Db","d","g", "C","c","f", "Bb","E","Eb","Ab", "a","D","G","E", "a","D","G", "gb","B","E","C", "f","bb","Eb","A", "Ab","Db","Gb","c", "b","bb","Eb","Ab","g","C"] @=> string chord[]; //input chord lengths, //for two measures long, type 4 //for one measure long, type 2 //for half measure long, type 1 //if you need anything more, change tempo and alter lengths //as needed [2,2,1,1, 2,2,1,1, 4,2,2, 1,1,2,2, 1,1,2,2, 2,2,4, 2,2,2,2, 2,2,1,1, 2,2,2,2, 2,2,2,2,1,1] @=> int length[]; //This messy for loop determines the target chord for (0 => int i; i < chord.cap(); i++) { if (i+1 <= chord.cap()) { i => s; } s+1 => int bound; <<>>; if (bound <= chord.cap()-1) { chord[bound] => string target; ["c","C","db","Db","d","D","eb","Eb","e","E", "f","F","gb","Gb","g", "G", "ab","Ab","a","A","bb","Bb", "b","B"] @=> string alphabet[]; for (0 => int j; j < alphabet.cap(); j++) { if (alphabet[j] == target) { 48 + (j/2) => targ; <<>>; <<<"target =", target>>>; } } } else { if (bound == chord.cap()) { chord[0] => string target2; ["c","C","db","Db","d","D","eb","Eb","e","E", "f","F","gb","Gb","g", "G", "ab","Ab","a","A","bb","Bb", "b","B"] @=> string alphabet2[]; for (0 => int j; j < alphabet2.cap(); j++) { if (alphabet2[j] == target2) { 48 + (j/2) => targ; <<>>; <<<"target2 =", target2>>>; } } } } //The rest of the code deals with each individual chord. //MINOR SCALES //c minor = 48 if (chord[i] == "c") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"c2">>>; 48 => key; [0, 7, 0] @=> int min2Scale[]; for (0 => int j; j < min2Scale.cap(); j ++) { min2Scale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } // if no flourish else { if (length[i] != 2) { <<<"length", length>>>; <<<"c">>>; 48 => key; //if length = 4 if (length[i] != 1) { [0, 2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 48 => key; [0, 3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //db minor = 49 if (chord[i] == "db") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"db2">>>; 49 => key; [0, 7, 0] @=> int min2Scale[]; for (0 => int j; j < min2Scale.cap(); j ++) { min2Scale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } // if no flourish else { if (length[i] != 2) { <<<"length", length>>>; <<<"db">>>; 49 => key; //if length = 4 if (length[i] != 1) { [0, 2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 49 => key; [0, 3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //d minor = 50 if (chord[i] == "d") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"d2">>>; 50 => key; [0, 7, 0] @=> int min2Scale[]; for (0 => int j; j < min2Scale.cap(); j ++) { min2Scale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } // if no flourish else { if (length[i] != 2) { <<<"length", length>>>; <<<"d">>>; 50 => key; //if length = 4 if (length[i] != 1) { [0, 2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 50 => key; [0, 3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //eb minor = 51 if (chord[i] == "eb") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"eb2">>>; 51 => key; [0, 7, 0] @=> int min2Scale[]; for (0 => int j; j < min2Scale.cap(); j ++) { min2Scale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } // if no flourish else { if (length[i] != 2) { <<<"length", length>>>; <<<"eb">>>; 51 => key; //if length = 4 if (length[i] != 1) { [0, 2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 51 => key; [0, 3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //e minor = 52 if (chord[i] == "e") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"e2">>>; 52 => key; [0, 7, 0] @=> int min2Scale[]; for (0 => int j; j < min2Scale.cap(); j ++) { min2Scale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } // if no flourish else { if (length[i] != 2) { <<<"length", length>>>; <<<"e">>>; 52 => key; //if length = 4 if (length[i] != 1) { [0, 2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 52 => key; [0, 3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //f minor = 53 if (chord[i] == "f") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"f2">>>; 53 => key; [0, 7, 0] @=> int min2Scale[]; for (0 => int j; j < min2Scale.cap(); j ++) { min2Scale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } // if no flourish else { if (length[i] != 2) { <<<"length", length>>>; <<<"f">>>; 53 => key; //if length = 4 if (length[i] != 1) { [0, 2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 53 => key; [0, 3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //gb minor = 54 if (chord[i] == "gb") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"gb2">>>; 54 => key; [0, 7, 0] @=> int min2Scale[]; for (0 => int j; j < min2Scale.cap(); j ++) { min2Scale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } // if no flourish else { if (length[i] != 2) { <<<"length", length>>>; <<<"gb">>>; 54 => key; //if length = 4 if (length[i] != 1) { [0, 2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 54 => key; [0, 3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //g minor = 55 if (chord[i] == "g") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"g2">>>; 55 => key; [0, 7, 0] @=> int min2Scale[]; for (0 => int j; j < min2Scale.cap(); j ++) { min2Scale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } // if no flourish else { if (length[i] != 2) { <<<"length", length>>>; <<<"g">>>; 55 => key; //if length = 4 if (length[i] != 1) { [0, 2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 55 => key; [0, 3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //ab minor = 56 if (chord[i] == "ab") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"ab2">>>; 56 => key; [0, 7, 0] @=> int min2Scale[]; for (0 => int j; j < min2Scale.cap(); j ++) { min2Scale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } // if no flourish else { if (length[i] != 2) { <<<"length", length>>>; <<<"ab">>>; 56 => key; //if length = 4 if (length[i] != 1) { [0, 2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 56 => key; [0, 3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //a minor = 57 if (chord[i] == "a") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"a2">>>; 57 => key; [0, 7, 0] @=> int min2Scale[]; for (0 => int j; j < min2Scale.cap(); j ++) { min2Scale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } // if no flourish else { if (length[i] != 2) { <<<"length", length>>>; <<<"a">>>; 57 => key; //if length = 4 if (length[i] != 1) { [0, 2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 57 => key; [0, 3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //bb minor = 58 if (chord[i] == "bb") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"bb2">>>; 58 => key; [0, 7, 0] @=> int min2Scale[]; for (0 => int j; j < min2Scale.cap(); j ++) { min2Scale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } // if no flourish else { if (length[i] != 2) { <<<"length", length>>>; <<<"bb">>>; 58 => key; //if length = 4 if (length[i] != 1) { [0, 2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 58 => key; [0, 3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //b minor = 59 if (chord[i] == "b") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"b2">>>; 59 => key; [0, 7, 0] @=> int min2Scale[]; for (0 => int j; j < min2Scale.cap(); j ++) { min2Scale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } // if no flourish else { if (length[i] != 2) { <<<"length", length>>>; <<<"b">>>; 59 => key; //if length = 4 if (length[i] != 1) { [0, 2, 3, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,3,7,Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 59 => key; [0, 3, 7, Math.abs(targ-key)-1] @=> int minScale[]; for (0 => int j; j < minScale.cap(); j ++) { minScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //MAJOR SCALES //C major = 48 if (chord[i] == "C") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"C2">>>; 48 => key; [0,7,0] @=> int maj2Scale[]; for (0 => int j; j < maj2Scale.cap(); j++) { maj2Scale[j]=> int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [4,7, Math.abs(targ-key) -1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } //if no flourish else { if (length[i] != 2) { <<<"C">>>; 48 => key; //if length = 4 if (length[i] !=1) { [0, 2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j< majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 48 => key; [0, 4, 7, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //Db Major = 49 if (chord[i] == "Db") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"Db2">>>; 49 => key; [0,7,0] @=> int maj2Scale[]; for (0 => int j; j < maj2Scale.cap(); j++) { maj2Scale[j]=> int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [4,7, Math.abs(targ-key) -1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } //if no flourish else { if (length[i] != 2) { <<<"Db">>>; 49 => key; //if length = 4 if (length[i] !=1) { [0, 2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j< majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 49 => key; [0, 4, 7, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } // D major = 50 if (chord[i] == "D") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"D2">>>; 50 => key; [0,7,0] @=> int maj2Scale[]; for (0 => int j; j < maj2Scale.cap(); j++) { maj2Scale[j]=> int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [4,7, Math.abs(targ-key) -1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } //if no flourish else { if (length[i] != 2) { <<<"D">>>; 50 => key; //if length = 4 if (length[i] !=1) { [0, 2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j< majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 50 => key; [0, 4, 7, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } // Eb major = 51 if (chord[i] == "Eb") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"Eb2">>>; 51 => key; [0,7,0] @=> int maj2Scale[]; for (0 => int j; j < maj2Scale.cap(); j++) { maj2Scale[j]=> int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [4,7, Math.abs(targ-key) -1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } //if no flourish else { if (length[i] != 2) { <<<"Eb">>>; 51 => key; //if length = 4 if (length[i] !=1) { [0, 2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j< majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 51 => key; [0, 4, 7, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //E major = 52 if (chord[i] == "E") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"E2">>>; 52 => key; [0,7,0] @=> int maj2Scale[]; for (0 => int j; j < maj2Scale.cap(); j++) { maj2Scale[j]=> int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [4,7, Math.abs(targ-key) -1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } //if no flourish else { if (length[i] != 2) { <<<"E">>>; 52 => key; //if length = 4 if (length[i] !=1) { [0, 2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j< majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 52 => key; [0, 4, 7, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //F major = 53 if (chord[i] == "F") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"F2">>>; 53 => key; [0,7,0] @=> int maj2Scale[]; for (0 => int j; j < maj2Scale.cap(); j++) { maj2Scale[j]=> int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [4,7, Math.abs(targ-key) -1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } //if no flourish else { if (length[i] != 2) { <<<"F">>>; 53 => key; //if length = 4 if (length[i] !=1) { [0, 2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j< majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 53 => key; [0, 4, 7, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //Gb Major = 54 if (chord[i] == "Gb") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"Gb2">>>; 54 => key; [0,7,0] @=> int maj2Scale[]; for (0 => int j; j < maj2Scale.cap(); j++) { maj2Scale[j]=> int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [4,7, Math.abs(targ-key) -1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } //if no flourish else { if (length[i] != 2) { <<<"Gb">>>; 54 => key; //if length = 4 if (length[i] !=1) { [0, 2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j< majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 54 => key; [0, 4, 7, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //G Major = 55 if (chord[i] == "G") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"G2">>>; 55 => key; [0,7,0] @=> int maj2Scale[]; for (0 => int j; j < maj2Scale.cap(); j++) { maj2Scale[j]=> int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [4,7, Math.abs(targ-key) -1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } //if no flourish else { if (length[i] != 2) { <<<"G">>>; 55 => key; //if length = 4 if (length[i] !=1) { [0, 2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j< majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 55 => key; [0, 4, 7, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //Ab Major = 56 if (chord[i] == "Ab") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"Ab2">>>; 56 => key; [0,7,0] @=> int maj2Scale[]; for (0 => int j; j < maj2Scale.cap(); j++) { maj2Scale[j]=> int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [4,7, Math.abs(targ-key) -1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } //if no flourish else { if (length[i] != 2) { <<<"Ab">>>; 56 => key; //if length = 4 if (length[i] !=1) { [0, 2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j< majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 56 => key; [0, 4, 7, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } // A Major = 57 if (chord[i] == "A") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"A2">>>; 57 => key; [0,7,0] @=> int maj2Scale[]; for (0 => int j; j < maj2Scale.cap(); j++) { maj2Scale[j]=> int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [4,7, Math.abs(targ-key) -1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } //if no flourish else { if (length[i] != 2) { <<<"A">>>; 57 => key; //if length = 4 if (length[i] !=1) { [0, 2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j< majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 57 => key; [0, 4, 7, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //Bb Major = 58 if (chord[i] == "Bb") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"Bb2">>>; 58 => key; [0,7,0] @=> int maj2Scale[]; for (0 => int j; j < maj2Scale.cap(); j++) { maj2Scale[j]=> int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [4,7, Math.abs(targ-key) -1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } //if no flourish else { if (length[i] != 2) { <<<"Bb">>>; 58 => key; //if length = 4 if (length[i] !=1) { [0, 2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j< majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 58 => key; [0, 4, 7, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } //B Major = 59 if (chord[i] == "B") { Std.rand2(1,3) => int rando; if (rando == 2) { <<<"B2">>>; 59 => key; [0,7,0] @=> int maj2Scale[]; for (0 => int j; j < maj2Scale.cap(); j++) { maj2Scale[j]=> int freq; Std.mtof((key - 12 + freq)) => player.freq; if (length[i] == 1) { note6::ms => now; } else { note3::ms => now; } } if (length[i] != 2) { <<<"length",length>>>; //if length isn't 1, and therefore = 4. if (length[i] !=1) { [2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } }// length = 1 else { [4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //length = 2 else { <<<"length", length[i]>>>; [4,7, Math.abs(targ-key) -1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } //if no flourish else { if (length[i] != 2) { <<<"B">>>; 59 => key; //if length = 4 if (length[i] !=1) { [0, 2, 4, 5, 7, 9, Math.abs(targ-key)+1, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } //if length = 1 else { [0,4,7,Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j< majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note8::ms => now; } } } //if length = 2 else { 59 => key; [0, 4, 7, Math.abs(targ-key)-1] @=> int majScale[]; for (0 => int j; j < majScale.cap(); j ++) { majScale[j] => int freq; Std.mtof((key - 12 + freq)) => player.freq; note4::ms => now; } } } } } }