//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 => dyna dyn => dac; "special:dope" => inst.read; //set mode and presets for limiter dyn.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 ) { dyn.op( -dyn.op() ); <<<"op:",dyn.op()>>>; } //louder and louder "doh!" inst.gain( 2.0*(i%4+2) ); inst.pos( 0 ); 1::second => now; }