Math help for ADSR curved Decay and Relase segments

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

The math there actually breaks down like so:

value(coefficient, time) = (1 - coefficient) ^ time
coefficient(value, time) = 1 - nthroot(value, time)
time(coefficient, value) = apow(value, 1 - coefficient)

Note this is for decay from 1 to value. You can get any output you want by switching around some inversions (1 - x).

nthroot(x, y) = x ^ (1/y)
apow(x, y) = log(x) / log(y)
pow(x, y) = exp(log(x) * y)
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post Reply

Return to “DSP and Plugin Development”