aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/echo.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2015-11-01 04:43:55 -0800
committerChris Robinson <[email protected]>2015-11-01 05:41:06 -0800
commitc57f57192067e2d68cfe4ab0fc9479d2453bfbda (patch)
treefb9dabd6296c87ff72f4271774ae9951898d9227 /Alc/effects/echo.c
parentf094d94608e00b1b08bd8c607d16651072323bb5 (diff)
Pass in the Q parameter for setting the filter parameters
Also better handle the peaking filter gain.
Diffstat (limited to 'Alc/effects/echo.c')
-rw-r--r--Alc/effects/echo.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Alc/effects/echo.c b/Alc/effects/echo.c
index b852a096..f5a53c36 100644
--- a/Alc/effects/echo.c
+++ b/Alc/effects/echo.c
@@ -85,8 +85,7 @@ static ALvoid ALechoState_update(ALechoState *state, ALCdevice *Device, const AL
{
ALfloat pandir[3] = { 0.0f, 0.0f, 0.0f };
ALuint frequency = Device->Frequency;
- ALfloat gain = Slot->Gain;
- ALfloat lrpan;
+ ALfloat gain, lrpan;
state->Tap[0].delay = fastf2u(Slot->EffectProps.Echo.Delay * frequency) + 1;
state->Tap[1].delay = fastf2u(Slot->EffectProps.Echo.LRDelay * frequency);
@@ -96,9 +95,12 @@ static ALvoid ALechoState_update(ALechoState *state, ALCdevice *Device, const AL
state->FeedGain = Slot->EffectProps.Echo.Feedback;
+ gain = minf(1.0f - Slot->EffectProps.Echo.Damping, 0.01f);
ALfilterState_setParams(&state->Filter, ALfilterType_HighShelf,
- 1.0f - Slot->EffectProps.Echo.Damping,
- LOWPASSFREQREF/frequency, 0.0f);
+ gain, LOWPASSFREQREF/frequency,
+ calc_rcpQ_from_slope(gain, 0.75f));
+
+ gain = Slot->Gain;
/* First tap panning */
pandir[0] = -lrpan;