// Michael J. Wilson // Music 220a Fall 2010 // Final Project // A bell / orchestral chime tone public class Bell { 2 => int num_instruments; int i; BandedWG myInst[num_instruments]; Envelope e[num_instruments]; NRev revs[num_instruments]; Std.mtof(42) => myInst[0].freq; Std.mtof(54) => myInst[1].freq; for (0 => i ; i < num_instruments; i++) { // Give this instrument channel 7 myInst[i] => e[i] => revs[i] => Control.chan[7]; 0.2 => revs[i].mix; 1 => myInst[i].preset; .25 => myInst[i].modesGain; } fun void play() { for (0 => i ; i < num_instruments; i++) { 1.0 => e[i].value; 1.0 => e[i].target; myInst[i].pluck(0.5); } 2 * Control.beat => now; for (0 => i ; i < num_instruments; i++) { myInst[i].noteOff(0.5); 2 * Control.beat => e[i].duration; e[i].keyOff(); } 2 * Control.beat => now; } }