//Write to file dac => WvOut2 writer => blackhole; writer.wavFilename("/Users/catrian/Desktop/small_crowd_filtered.wav"); //Get sound file "/Users/catrian/Desktop/" => string dataDir; "small_crowd.wav" => string dataFile; "/Users/catrian/Desktop/" => string dataDir2; "large_crowd.wav" => string dataFile2; //patch SndBuf buf => ADSR e => dac; // load file dataDir + dataFile => buf.read; // set a, d, s, and r e.set( 20::second, 5::second, .5, 10::second ); //Durations 30::second => dur SMALL_CROWD_DUR; now + SMALL_CROWD_DUR => time end1; while(now < end1) { // key on - start attack e.keyOn(); 0 => buf.pos; .5 => buf.gain; 1 => buf.rate; 30::second => now; // key off - start release e.keyOff(); 5::second => now; }