On Sat, Oct 1, 2011 at 3:23 AM, Tomtom
SinOsc s => Dyno d => dac; 100 => s.gain; 0 => d.slopeAbove; 1 => d.slopeBelow; 1 => d.thresh; 0::ms => d.attackTime; 0::ms => d.releaseTime; day => now;
Unfortunately, this does not have the expected behaviour.
note(); while (1){ 1::samp => now; <<< d.last() >>> ; }
this will show values oscillating between -1 and -X, with X moving to -infinity.
Ah, you're right. Things looked fine when I checked in Audacity, but I forgot Audacity clips to [-1, 1] when it opens files anyway. I checked Dyno's source and it works differently than I imagined. double slope = d->xd > d->thresh ? d->slopeAbove : d->slopeBelow; double f = slope == 1.0 ? 1.0 : pow( d->xd / d->thresh, slope - 1.0 ); *out = f * in; I haven't been able to find a way to do what you want.
You are right, it can be simply done manually within the shred, but the performance cost is pretty high, isn't it ?
Maybe; I've rarely needed to optimize ChucK scripts, so I'm not the best person to answer this. :D -- Tom Lieber http://AllTom.com/ http://infinite-sketchpad.com/