// @title playPulses.ck // @desc play genomic sequences as pulse trains // @author Brent Townshend (b@tc.com) //=== TODO: modify this path and name for your system ===// "/Users/bst/Dropbox/Music220a/HW1/" => string dataDir; //"N30region.txt" => string dataFile; "seq.dat" => string dataFile; // Block length (potential repeat period of sequence) 30 => int blocklen; // Fundamental of repeated sequences 20=> float blockpitch; // update rate in ms 1000.0/(blocklen*4*blockpitch) => float update; <<<"Update period: ",update," milliseconds">>>; SeqReader sr; if (!sr.open(dataDir+dataFile)) me.exit(); Step imp => LPF lpf => dac; blocklen*blockpitch/2 => lpf.freq; // Filter out pulse train 10 => lpf.gain; while (true) { sr.next() => int w; // <<<"w=",w>>>; if (w==0) { // Silent update::ms*4 => now; continue; } if (w==-99) break; for (1=>int i; i now; 1.0 => imp.next; update::ms => now; -0.333 => imp.next; for (w=>int i;i<4;i++) update::ms => now; } <<<"Done.">>>; me.exit();