From 48aa1e10d64d7c62cab856a0c5d7f9e140efbd6b Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 28 May 2013 10:57:38 -0700 Subject: Use the high-shelf filter in place of low-pass They effectively both work to lower (or raise) high frequencies. However, the high-shelf performs better when gain=1. --- Alc/ALu.c | 8 ++++---- Alc/effects/echo.c | 2 +- Alc/effects/reverb.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'Alc') diff --git a/Alc/ALu.c b/Alc/ALu.c index 57dfa30f..c05fb48c 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -455,7 +455,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) ALfloat gain = maxf(0.001f, sqrtf(DryGainHF)); for(c = 0;c < num_channels;c++) ALfilterState_setParams(&ALSource->Params.Direct.Filter[c], - ALfilterType_LowPass, gain, + ALfilterType_HighShelf, gain, (ALfloat)LOWPASSFREQREF/Frequency, 0.0f); } for(i = 0;i < NumSends;i++) @@ -463,7 +463,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) ALfloat gain = maxf(0.001f, sqrtf(WetGainHF[i])); for(c = 0;c < num_channels;c++) ALfilterState_setParams(&ALSource->Params.Send[i].Filter[c], - ALfilterType_LowPass, gain, + ALfilterType_HighShelf, gain, (ALfloat)LOWPASSFREQREF/Frequency, 0.0f); } } @@ -904,14 +904,14 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) { ALfloat gain = maxf(0.001f, sqrtf(DryGainHF)); ALfilterState_setParams(&ALSource->Params.Direct.Filter[0], - ALfilterType_LowPass, gain, + ALfilterType_HighShelf, gain, (ALfloat)LOWPASSFREQREF/Frequency, 0.0f); } for(i = 0;i < NumSends;i++) { ALfloat gain = maxf(0.001f, sqrtf(WetGainHF[i])); ALfilterState_setParams(&ALSource->Params.Send[i].Filter[0], - ALfilterType_LowPass, gain, + ALfilterType_HighShelf, gain, (ALfloat)LOWPASSFREQREF/Frequency, 0.0f); } } diff --git a/Alc/effects/echo.c b/Alc/effects/echo.c index a45f3398..9d17ead0 100644 --- a/Alc/effects/echo.c +++ b/Alc/effects/echo.c @@ -104,7 +104,7 @@ static ALvoid ALechoState_Update(ALechoState *state, ALCdevice *Device, const AL state->FeedGain = Slot->EffectProps.Echo.Feedback; - ALfilterState_setParams(&state->Filter, ALfilterType_LowPass, + ALfilterState_setParams(&state->Filter, ALfilterType_HighShelf, 1.0f - Slot->EffectProps.Echo.Damping, (ALfloat)LOWPASSFREQREF/frequency, 0.0f); diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index 5d85ee7b..74f2368c 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -1095,7 +1095,7 @@ static ALvoid ALreverbState_Update(ALreverbState *State, ALCdevice *Device, cons freq_scale = Slot->EffectProps.Reverb.HFReference / frequency; else freq_scale = (ALfloat)LOWPASSFREQREF / frequency; - ALfilterState_setParams(&State->LpFilter, ALfilterType_LowPass, + ALfilterState_setParams(&State->LpFilter, ALfilterType_HighShelf, Slot->EffectProps.Reverb.GainHF, freq_scale, 0.0f); -- cgit v1.2.3