ADSR - Linear vs. Exponential

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

JoaCHIP wrote:Percussion typically has very very exponential fade-out curves. Most synthesizers I use are too close to linear, which sounds unnatural to me. (Oberheim SEM and Arp Odyssey are quite nice though.)
Yes, I think he problem is that most envelope-implementers don't consider how many dB down the release-termination point is, and cut it short. More of an issue in software ADSRs, as a hardware implementation can just bleed the capacitor voltage "forever" (until the ADSR retriggers). You can do that for a soft synth, but more typically you want an exact end to the release (either for features like cycling, or simply so you can stop calculating at some point, or as a denormal precaution, especially in older implementations).

I remember I was checking out the Prophet 12, a few years ago at NAMM, scrutinizing an ADSR release driving an oscillator, commented I thought the envelope release was a little truncated—Dave Smith scowled at me, oops, keep my mouth shut. :wink:

FWIW, it's 20 dB per factor of 10, so for a 0-1 envelope, an exponential release to -80 dB would require the stop point on the release would be 0.0001, for example. (My ADSR here has settable targets, so from linear to as exponential as you want: http://www.earlevel.com/main/category/e ... enerators/)
My audio DSP blog: earlevel.com

Post

earlevel wrote:You can do that for a soft synth, but more typically you want an exact end to the release (either for features like cycling, or simply so you can stop calculating at some point, or as a denormal precaution, especially in older implementations).
It's a CPU trade-off really. The closer you make it to a "natural" exponential decay (eg. the less you "over aim" or the lower your threshold for quick linear release or whatever your chosen method of eventually hitting zero), the longer it takes to actually free the CPU for the voice... and while in the ideal world you could simulate all the voices non-stop, whether or not any of them are actually playing, in practice "stupid users" will complain if you try. ;)

So basically you have to try to find a happy medium between sounding natural (not killing it off too early) and not producing too much CPU-heavy silence (ie. killing too late). It's particularly annoying for long release times, because it's really hard to predict what level is needed to sound natural and if you overestimate even slightly your CPU will stay high forever.

I would actually advice against stopping at some "almost zero" level though.. you get sort of better results if you set the target (very) slightly negative and just cut it off when it hits zero... it then behaves kind like exponential release that becomes linear at very low levels.

Post

mystran wrote:
earlevel wrote:You can do that for a soft synth, but more typically you want an exact end to the release (either for features like cycling, or simply so you can stop calculating at some point, or as a denormal precaution, especially in older implementations).
It's a CPU trade-off really. The closer you make it to a "natural" exponential decay (eg. the less you "over aim" or the lower your threshold for quick linear release or whatever your chosen method of eventually hitting zero), the longer it takes to actually free the CPU for the voice... and while in the ideal world you could simulate all the voices non-stop, whether or not any of them are actually playing, in practice "stupid users" will complain if you try. ;)

So basically you have to try to find a happy medium between sounding natural (not killing it off too early) and not producing too much CPU-heavy silence (ie. killing too late). It's particularly annoying for long release times, because it's really hard to predict what level is needed to sound natural and if you overestimate even slightly your CPU will stay high forever.

I would actually advice against stopping at some "almost zero" level though.. you get sort of better results if you set the target (very) slightly negative and just cut it off when it hits zero... it then behaves kind like exponential release that becomes linear at very low levels.
Sure, that's what I was implying, on cpu vs natural. I've seen various ADSR code on the web, though, an it looks like people pulled a small number out of the air, as if it was simply a small number that seemed like a good one. I don't think picking 0.01 sounds all that exponential, and I know I've seen that before (only exponential to -40 dB).

But as far as cpu goes, the code/articles on my site that I linked to sets time in ticks (that is, samples if run at the sample rate). So there is no surprise about how long the cpu hit will last, but of course if you set the target at -200 dB the release will sound short because much of its travel will be below audibility, so the idea is that you set it as high as you can for the fade you want.

And I totally agree on the truncation method—it absolutely should be heading to an asymptote below zero for release (below sustain for decay, above peak for attack). It's a mistake to decay towards zero with a positive termination level that forces to zero.
My audio DSP blog: earlevel.com

Post

earlevel wrote: And I totally agree on the truncation method—it absolutely should be heading to an asymptote below zero for release (below sustain for decay, above peak for attack). It's a mistake to decay towards zero with a positive termination level that forces to zero.
There's no need to set it "below sustain for decay" as you can just decay to sustain forever (or rather until note-off), it's not like that costs any CPU and it has the fun effect that you can then modulate sustain and have the decay act as a "slew-limiter" (or rather as a one-pole low-pass).

Ps. In fact, if you push the sustain value higher than the current envelope value while in decay phase, I personally see no reason why it shouldn't then decay "upwards" again and I quite like the effect... :)

Post

mystran wrote:
earlevel wrote: And I totally agree on the truncation method—it absolutely should be heading to an asymptote below zero for release (below sustain for decay, above peak for attack). It's a mistake to decay towards zero with a positive termination level that forces to zero.
There's no need to set it "below sustain for decay" as you can just decay to sustain forever (or rather until note-off), it's not like that costs any CPU and it has the fun effect that you can then modulate sustain and have the decay act as a "slew-limiter" (or rather as a one-pole low-pass).

Ps. In fact, if you push the sustain value higher than the current envelope value while in decay phase, I personally see no reason why it shouldn't then decay "upwards" again and I quite like the effect... :)
There's less cpu, of course, but another reason is that I want to know that the decay stage has completed for other uses. More importantly, I can set an exact time in ticks (not one that depends on the level and what it's driving for how long it seems to take), same as with my other stages, and also that the target (below sustain) sets how exponential (closer to sustain) or linear (farther) the decay segment is, like in the attack and release stages.
My audio DSP blog: earlevel.com

Post Reply

Return to “DSP and Plugin Development”