public class HarmonyTwo { BeeThree sound => NRev n => ResonZ r => dac; n.mix(0.05); r.Q(0.4); r.gain(.45); BPM t; // key of the song, with 0 being key of C and 11 being key of B //t.randomKeyNum => int key; 0 => int key; // int for which octave above/below midde C 0 => int octave; (octave*12) + key => key; //harmony pitch int hPitch; fun void setTempo(float tempo) { tempo => t.tempo; } fun void playVerse() { while(true) { playHarmonyNote("VI"); playHarmonyNote("V"); playHarmonyNote("IV"); playHarmonyNote("V2"); } } fun void playChorus() { while(true) { playHarmonyNote("I"); playHarmonyNote("III"); playHarmonyNote("IV2"); playHarmonyNote("V3"); } } fun void playHarmonyNote(string chord) { if(chord == "I") { 64 + key => hPitch; } else if(chord == "II") { 74 + key => hPitch; } else if(chord == "III") { 67 + key => hPitch; } else if(chord == "IV") { 65 + key => hPitch; // second harmony option for the IV chord } else if(chord == "IV2") { 69 + key => hPitch; } else if(chord == "V") { 64 + key => hPitch; // second harmony option for the V chord } else if(chord == "V2") { 67 + key => hPitch; //third harmony option for the V chord; } else if(chord == "V3") { 71 + key => hPitch; } else if(chord == "VI") { 60 + key => hPitch; } else if(chord == "VII") { 83 + key => hPitch; } Std.mtof(hPitch) => sound.freq; sound.noteOff(1); t.quarterNote => now; sound.noteOn(1); t.halfNote => now; sound.noteOff(1); t.quarterNote => now; } } HarmonyTwo h2; spork ~ h2.playVerse(); while(1) { 1::second => now; }