// Space Music Controller // Copyright 2009 Les Hall class spacey { // the effects chain Gain input => LPF lpf => JCRev rev1 => Echo echo1 => NRev rev2 => Gain boost => dac; second => echo1.max; second / 16 => echo1.delay; 0.5 => echo1.mix; 300.0 => lpf.freq; 0.2 => rev1.mix; 0.1 => rev2.mix; 0.8 => boost.gain; // guitar input adc.left => Gain guitarGain => input; 2 => guitarGain.gain; // banded wave guide instrument BandedWG band => input; 1 => band.preset; 3 => band.gain; // rhodey instrument Rhodey rhodey => input; Flute flute => echo1; 0.07 => flute.gain; // mandolin instrument Mandolin mandy => input; 0.8 => mandy.stringDamping; 0 => mandy.stringDetune; 0.6 => mandy.gain; // recording interface dac => Gain attenuate => WvOut wvout => blackhole; 0.5 => attenuate.gain; "SpaceMusic.wav" => wvout.wavFilename; fun void bandPluck() { while (true) { 1 => band.pluck; Math.rand2f(10, 20) * second => now; } } spork ~ bandPluck(); fun void rhodeyPluck() { while (true) { 1 => rhodey.noteOn; Math.rand2f(5, 15) * second => now; } } spork ~ rhodeyPluck(); fun void flutePlay() { 1::minute => now; 1 => flute.noteOn; while (true) { Math.mtof(Math.rand2(50, 70)) => flute.freq; Math.rand2f(2, 10) * second => now; } } spork ~ flutePlay(); fun void mandyPlay() { 4::minute => now; 1 => mandy.noteOn; now => time tStart; while ((now-tStart) < 2::minute) { Math.mtof(Math.rand2(25, 40)) => mandy.freq; 1 => mandy.pluck; Math.rand2f(4, 11) * second => now; } } spork ~ mandyPlay(); 8::minute => now; "SpaceMusic.wav" => wvout.closeFile; } spacey Shane;