Step mixing gains per-sample for non-HRTF mixing
commit81e049bd47cc2423dc6983c47d9f99e70c3135ac
authorChris Robinson <chris.kcat@gmail.com>
Sun, 23 Mar 2014 13:57:00 +0000 (23 06:57 -0700)
committerChris Robinson <chris.kcat@gmail.com>
Sun, 23 Mar 2014 13:57:00 +0000 (23 06:57 -0700)
tree74424462f69b97dffaebdc04dc263bf5eeb6183c
parent0ce0a88fd67ddcf7cb5248ac08d36cfa1c0013eb
Step mixing gains per-sample for non-HRTF mixing

This fades the dry mixing gains using a logarithmic curve, which should produce
a smoother transition than a linear one. It functions similarly to a linear
fade except that

step = (target - current) / numsteps;
...
gain += step;

becomes

step = powf(target / current, 1.0f / numsteps);
...
gain *= step;

where 'target' and 'current' are clamped to a lower bound that is greater than
0 (which makes no sense on a logarithmic scale).

Consequently, the non-HRTF direct mixers do not do not feed into the click
removal and pending click buffers, as this per-sample fading would do an
adequate job of stopping clicks and pops caused by extreme gain changes. These
buffers should be removed shortly.
Alc/ALu.c
Alc/mixer.c
Alc/mixer_c.c
Alc/mixer_inc.c
Alc/mixer_neon.c
Alc/mixer_sse.c
OpenAL32/Include/alu.h