Unlike linear decay, exponential decay is never really "done". So how can we assign a characteristic "decay time" in that case?
Consider the expression
a(t) = a0*exp(-t/T)
There is this time constant T which is a measure of how fast things change. If the decay continued at the initial rate, then it would be complete by the time t = T (dashed line in the image). Since the decay is exponential, however, at t = T the amplitude is still at roughly 37% of its initial value.
- expoDecay.png (6.51 KiB) Viewed 21714 times
There are other possibilities to characterize exponential decay times. Some common examples are:
1. Half-life T_1/2 in radioactive decay. Obviously that time is shorter than T. The relation is T_1/2 ≈ 0.69*T
2. Decay to ten percent is after T_10% ≈ 2.3*T
3. In reverbs, it is common to state the time forthe reverb tail to drop to -60dB. Assuming an exponential law, that duration is T_60 ≈ 6,9*T
So you see, there is no unique definition.
My expo module has four inputs:
A: Attack, linear rise time in samples (rounded to a multiple of 16).
D: Decay, exponetial decay time T in samples (rounded to a multiple of 16). Note that decay is not to zero but to the sustainn level.
S: Sustain level, a number between 0 and 1.
R: Release, exponetial release time T in samples (rounded to a multiple of 16).
If yo prefer to supply seconds instead of samples, you can convert seconds to samples by multiplying the time in seconds by the sample rate.