Robin Gareus
6f755c3c02
Exponential approach to zero: 1 / exp(t) == exp (-t) we "stretch" it by a time-constant "c": gain(t) = exp (-t * c) To find the time t, at which the exponential approach reaches gain "g": exp (-c * t) = g take the log of both sides: log (exp (-c * t) = log (g) since log (exp (x)) == x : -c t = log (g) divide by -c : t = -log (g) / c set g = 1e-5 and c = _a/sr and we get: t = -log (1e-5) / (_a/sr) The iterative approach using g += c * (target_gain - g); converges faster than the exact exp() calculation. Except with 32-bit float, if target-gain is 1.0f and "c" is small. With 32bit float (1.0 - 1e-5) = .9999900 is represented as sign: +1 | mantissa: 0x7fff58 | exponent: 126 there are only 126 "steps" to 1.0. Rounding of the lowest mantissa bit does matter. We have to assume worst-case, and increase the required loop_fade_length buffersize. vs. approaching 0, where there are over 2^110 steps between zero and 1e-5. |
||
---|---|---|
.. | ||
appleutility | ||
ardour | ||
ardouralsautil | ||
audiographer | ||
backends | ||
canvas | ||
clearlooks-newer | ||
evoral | ||
fluidsynth | ||
fst | ||
gtkmm2ext | ||
hidapi | ||
libltc | ||
lua | ||
midi++2 | ||
panners | ||
pbd | ||
plugins | ||
ptformat | ||
qm-dsp | ||
surfaces | ||
temporal | ||
vamp-plugins | ||
vamp-pyin | ||
vfork | ||
waveview | ||
widgets | ||
zita-convolver | ||
zita-resampler |