// for DBAP4e: note that Binaural4 class is required SndBuf sampled => LPF l => DBAP4e samp4e; "/user/t/tsob/220a/HW3/samp.wav" => string _sfile; _sfile => sampled.read; cherr <= "[score] SndBuf: " <= _sfile <= IO.newline(); samp4e.setReverb(0.01); 5000.0 => l.freq; SndBuf physical => DBAP4e phys4e; "/user/t/tsob/220a/HW3/phys.wav" => string _pfile; _pfile => physical.read; cherr <= "[score] SndBuf: " <= _pfile <= IO.newline(); // Note 102 seconds long // write signals to files dac.left => WvOut leftOut => blackhole; dac.right => WvOut rightOut => blackhole; me.sourceDir() + "/left_final.wav" => string _captureL; me.sourceDir() + "/right_final.wav" => string _captureR; _captureL => leftOut.wavFilename; _captureR => rightOut.wavFilename; sampled.play; physical.play; 0.0 => float t; while(t < 5.00) { 0.05 +=> t; phys4e.setPosition(Math.sin(2.0*pi*t/5.0), Math.cos(2.0*pi*t/5.0)); 50::ms => now; } while(t < 10.00) { 0.05 +=> t; phys4e.setPosition(Math.sin(pi*t/5.0), Math.cos(pi*t/5.0)); 50::ms => now; } // sample comes in... samp4e.setPosition(-1.0, -1.0); while(t < 103.00) { 0.05 +=> t; phys4e.setPosition( Math.sin(t*(1.0-t)), Math.cos(t*(1.0-t))); // samp4e.setPosition( 0.5*(((t/10.0) % 2.0)-1.0), -0.5*(((t/10.0) % 2.0)-1.0) ); samp4e.setPosition(Math.sin(pi*t/50.0), Math.cos(pi*t/50.0)); 50::ms => now; } // ------------------------------------------------------------ // finish the show leftOut.closeFile(); rightOut.closeFile(); // print message in terminal for sox command cherr <= "[score] Finished. Merge two products with the command below.\n"; cherr <= "sox -M " <= _captureL <= " " <= _captureR <= " "; cherr <= me.sourceDir() + "/Final.wav";