From c57f57192067e2d68cfe4ab0fc9479d2453bfbda Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 1 Nov 2015 04:43:55 -0800 Subject: Pass in the Q parameter for setting the filter parameters Also better handle the peaking filter gain. --- Alc/effects/reverb.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Alc/effects/reverb.c') diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index 6c3f2691..71e12b33 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -1112,6 +1112,7 @@ static ALvoid ALreverbState_update(ALreverbState *State, ALCdevice *Device, cons const ALeffectProps *props = &Slot->EffectProps; ALuint frequency = Device->Frequency; ALfloat lfscale, hfscale, hfRatio; + ALfloat gainlf, gainhf; ALfloat cw, x, y; if(Slot->EffectType == AL_EFFECT_EAXREVERB && !EmulateEAXReverb) @@ -1121,11 +1122,13 @@ static ALvoid ALreverbState_update(ALreverbState *State, ALCdevice *Device, cons // Calculate the master filters hfscale = props->Reverb.HFReference / frequency; + gainhf = maxf(props->Reverb.GainHF, 0.0001f); ALfilterState_setParams(&State->LpFilter, ALfilterType_HighShelf, - props->Reverb.GainHF, hfscale, 0.0f); + gainhf, hfscale, calc_rcpQ_from_slope(gainhf, 0.75f)); lfscale = props->Reverb.LFReference / frequency; + gainlf = maxf(props->Reverb.GainLF, 0.0001f); ALfilterState_setParams(&State->HpFilter, ALfilterType_LowShelf, - props->Reverb.GainLF, lfscale, 0.0f); + gainlf, lfscale, calc_rcpQ_from_slope(gainlf, 0.75f)); // Update the modulator line. UpdateModulator(props->Reverb.ModulationTime, props->Reverb.ModulationDepth, -- cgit v1.2.3