13
0
livetrax/libs
Robin Gareus 6f755c3c02
Fix loop-fade and de-click buffersize calculation
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.
2020-02-12 17:28:53 +01:00
..
appleutility
ardour Fix loop-fade and de-click buffersize calculation 2020-02-12 17:28:53 +01:00
ardouralsautil
audiographer NO-OP: whitespace 2020-01-14 00:52:24 +01:00
backends Downgrade "using all channels" warning to info - part 2 2020-01-25 04:17:53 +01:00
canvas Explicitly use OSX 2020-01-25 04:07:41 +01:00
clearlooks-newer Special case checkbox border color in Treeview 2020-01-25 03:40:04 +01:00
evoral Fix building unit-tests 2020-01-27 17:43:37 +01:00
fluidsynth
fst Update waf2.x "subst" feature uses obj attributes 2020-01-25 06:20:28 +01:00
gtkmm2ext Explicitly use OSX 2020-01-25 04:07:41 +01:00
hidapi
libltc
lua Lua Array, assert indices > 0 2020-02-06 17:30:21 +01:00
midi++2 Fix building unit-tests 2020-01-27 17:43:37 +01:00
panners Explicitly use OSX 2020-01-25 04:07:41 +01:00
pbd Changes needed for building with MSVC 2020-02-07 11:27:22 +00:00
plugins Update waf2.x "subst" feature uses obj attributes 2020-01-25 06:20:28 +01:00
ptformat ptformat: Update to upstream 55f08d8 (simplify version detection) 2020-02-09 17:55:48 +11:00
qm-dsp Do not install static libs 2020-01-22 02:00:25 +01:00
surfaces LCXL: Adopt pan knob behaviour 2020-02-09 23:34:20 +01:00
temporal NO-OP: whitespace 2020-01-14 00:52:24 +01:00
vamp-plugins Fix some clang-scan warnings 2020-01-27 03:31:49 +01:00
vamp-pyin
vfork
waveview NO-OP: whitespace 2020-01-14 00:52:24 +01:00
widgets Explicitly use OSX 2020-01-25 04:07:41 +01:00
zita-convolver Do not install static libs 2020-01-22 02:00:25 +01:00
zita-resampler Do not install static libs 2020-01-22 02:00:25 +01:00