//Maya Acharya Music 220a Final Project //Tanpura notes //usage: first three args are notes //fourth arg is tempo in seconds //start with Tanpura on right channel Tanpura s => dac.chan(1); //set up notes array [Std.atoi(me.arg(0)), Std.atoi(me.arg(1)), Std.atoi(me.arg(2))] @=> int notes[]; //set up tempo Std.atof(me.arg(3))::second => dur tempo; //start a counter 0 => int c; //go through the array (you can change the modulo in the code //to decide if you want to go through all three notes, or just the //first two. There will be a semi-random amount of time //between the notes (it'll be 1, 2, or 3 times the seconds //duration given in 'tempo' while(true){ //mod 2 instead of mod 3 because I realized it sounds better //and more ~authentic~ with only the first two notes Std.mtof(notes[c%2] + 12) => s.freq; s => dac.chan(c%2); s !=> dac.chan(1-(c%2)); s.tanpuraOn(1); Math.random2(1,3) *tempo => now; c++; }