SndBuf mySound_wind_chime_gamelan_gong_a => dac; "/Users/hannahleechoi/Documents/hw3_final_submit/seedWav/411090__inspectorj__wind-chime-gamelan-gong-a.wav" => string filename_wind_chime_gamelan_gong_a; //Lasts for 15 seconds fun void wind_chime_gamelan_gong_a() { // tell SndBuf to read this file filename_wind_chime_gamelan_gong_a => mySound_wind_chime_gamelan_gong_a.read; //Asks the sound how long it is (in samples). mySound_wind_chime_gamelan_gong_a.samples() => int numSamples; // set gain 1.0 => mySound_wind_chime_gamelan_gong_a.gain; // play sound from the beginning 0 => mySound_wind_chime_gamelan_gong_a.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_wind_chime_gamelan_gong_a.gain; } 10 ::ms => now; } numSamples :: samp => now; // Play for whole duration, but backward. } repeat(0) { wind_chime_gamelan_gong_a(); } while(true) { wind_chime_gamelan_gong_a(); }