//------------------------------------------------------------------------ // name: X // desc: public class for globally-shared variables for 220b final project // This needs to be called for it all to work. // Running loadall.ck will prepare everything. //------------------------------------------------------------------------ public class X { // == global gain == static Gain @ out; static Gain @ outL; static Gain @ outR; static Gain @ in; static Gain @ inL; static Gain @ inR; static Dyno @ limiter; // == events to control parameters == // thumbs up static Event @ thumbsUp; // thumbs down static Event @ thumbsDown; // start synthesis static Event @ synthesize; } // instantiate the gain new Gain @=> X.out; new Gain @=> X.outL; new Gain @=> X.outR; new Gain @=> X.in; new Gain @=> X.inL; new Gain @=> X.inR; // instantiate limiter new Dyno @=> X.limiter; 0.3 => float maxAmp; X.out.gain(maxAmp); X.outL.gain(maxAmp); X.outR.gain(maxAmp); X.limiter.thresh(maxAmp); X.limiter.slopeBelow(maxAmp); X.limiter.slopeAbove(0.0); X.in => X.out; X.inL => X.outL; X.inR => X.outR; // patch to dac X.out => X.limiter => dac; X.outL => X.limiter => dac.chan(0); X.outR => X.limiter => dac.chan(1); // == events to control parameters == // thumbs up new Event @=> X.thumbsUp; // thumbs down new Event @=> X.thumbsDown; // start synthesis new Event @=> X.synthesize; // wait around while( true ) { 2::second => now; }