SndBuf mySound_chimes => dac; 1.0 => mySound_chimes.gain; "/Users/hannahleechoi/Documents/hw3_final_submit/seedWav/181897__supuhmagikarp__chimes.wav" => string filename_chimes; //Lasts for 0.6 seconds fun void chimes() { // tell SndBuf to read this file filename_chimes => mySound_chimes.read; //Asks the sound how long it is (in samples). mySound_chimes.samples() => int numSamples; // set gain 1.0 => mySound_chimes.gain; // play sound from the beginning 0 => mySound_chimes.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_chimes.gain; } 10 ::ms => now; } numSamples :: samp => now; // Play for whole duration, but backward. } repeat(0) { chimes(); } while(true) { chimes(); }