// new chubgraph // future improvement - allow the user to input the desired foldover frequency as an .freq type argument class foldoverMPL extends Chubgraph { SinOsc inst0; TriOsc inst1; PulseOsc inst2; 0.0025=> inst0.gain => inst1.gain => inst2.gain; function void wave (int oscWave) { if (oscWave == 0) { inst0 => outlet; 0 => inst1.gain; 0 => inst2.gain; } else if (oscWave == 1) { inst1 => outlet; 0 => inst2.gain; 0 => inst0.gain; } else if (oscWave == 2) { inst2 => outlet; 0 => inst1.gain; 0 => inst0.gain; } } function void freq (float Hz) { Hz => inst0.freq => inst1.freq => inst2.freq; } function void randOsc (int onOff) { if (onOff ==1) { Math.random2f(0.1,1.0) => inst1.width => inst2.width; Math.random2f(0.1,1.0) => inst0.phase => inst1.phase => inst2.phase;} else 0.5 => inst1.width => inst2.width => inst0.phase => inst1.phase => inst2.phase; } //function void filter (int onOFF) // { // if ( } foldoverMPL foldME => dac; 0.1 => foldME.gain; while (true) { 1 => foldME.randOsc; 2 => foldME.wave; 41554.0 => foldME.freq; 40::ms => now; }