SndBuf mySound_short_eerie_chorus => dac; "/Users/hannahleechoi/Documents/hw3_final_submit/seedWav/437475__camel7695__short-eerie-chorus.wav" => string filename_short_eerie_chorus; //Lasts for 37 seconds fun void short_eerie_chorus() { // tell SndBuf to read this file filename_short_eerie_chorus => mySound_short_eerie_chorus.read; //Asks the sound how long it is (in samples). mySound_short_eerie_chorus.samples() => int numSamples; // set gain 1.0 => mySound_short_eerie_chorus.gain; // play sound from the beginning 0 => mySound_short_eerie_chorus.pos; 0.0::second => dur HOLD_TIME; //numSamples/1 => dur HOLD_TIME; now + HOLD_TIME => time end; //end = 3 + now while (now < end) { 1 - (end-now) / HOLD_TIME => float progress; for (0 => int i; i < 60; i++) { 5.0 * Math.pow(progress, 3) => mySound_short_eerie_chorus.gain; } 10 ::ms => now; } numSamples :: samp => now; // Play for whole duration, but backward. } repeat(0) { short_eerie_chorus(); } while(true) { short_eerie_chorus(); }