[PD] [multiCurveAdsr] v.2

Claude Heiland-Allen claudiusmaximus at goto10.org
Sat May 19 21:20:24 CEST 2007

Frank Barknecht wrote:
> Hallo,
> Phil Stone hat gesagt: // Phil Stone wrote:
>> It would be pretty easy to modify this to have a separate C (curve) 
>> parameter for attack and decay/release (or even separate C's for decay 
>> and release as well, if one were so inclined).  
> Actually I believe that it's not that easy at all, if you want to get
> retriggered envelopes right. If you need to enter a release
> phase with a concave curve, while your still in an attacke phase with
> a convex curve, it's tricky to do this in a clickless way
> Ciao

Agreed, and given that an abstraction I made for something similar using 
fexpr~ used 20% of my CPU for just one instance, I went the C route and 
made my first DSP external, which is around 10 times faster.

Source code here:


It operates completely in the signal domain.

~ trigger (rising edge triggers attack, falling edge triggers release)
~ attack time
~ peak level
~ decay time
~ sustain level
~ release time
~ threshold (when the output rises above the threshold (values just 
below 1 work best), the mode switches from attack to decay+sustain)

~ curved envelope (true exponential decay shapes for all phases, as 
documented here: 
http://www.music.mcgill.ca/~gary/306/week11/envelopes.html )


More information about the Pd-list mailing list