//gkc: demonstration of dyna.limit() mode //a limiter keeps the level from getting above a //threshold by negatively compensating for any gains //above that level. //you can use this to avoid clipping at your dac //WARNING: LOUD sndbuf inst => Limiter lim => dac; "special:dope" => inst.read; lim.input( inst ); //set mode and presets for limiter spork ~ lim.limit(); //fiddle with the presets //dyn.thresh( 0.5 ); //dyn.attackTime( 10::ms ); //dyn.releaseTime( 100::ms ); //dyn.slope( 1.0 ); //dyn.ratio( 1000000000 ); inst.gain( 0.6 ); for(0=>int i; ;i++) { //toggle processing every 4 beats if ( i%4==0 ) { lim.op( -lim.op() ); <<<"op:",lim.op()>>>; } //louder and louder "doh!" inst.gain( 2.0*(i%4+2) ); inst.pos( 0 ); 1::second => now; }