From 03ca50fa70268644b0c57ec7c36638f5edbb7909 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 15 Jan 2008 18:29:21 -0800 Subject: Use the previous low-pass filter again, as it seems to match the intended output better --- Alc/ALu.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Alc/ALu.c b/Alc/ALu.c index 3b9e0611..3e9387bb 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -217,9 +217,13 @@ static __inline ALfloat aluComputeDrySample(ALsource *source, ALfloat DryGainHF, { if(DryGainHF < 1.0f) { - ALfloat u = sample + source->LastDrySample; - ALfloat v = sample - source->LastDrySample; - sample = (u + (v*DryGainHF)) * 0.5; + if(DryGainHF > 0.0f) + { + sample *= DryGainHF; + sample += source->LastDrySample * (1.0f-DryGainHF); + } + else + sample = 0.0f; } source->LastDrySample = sample; @@ -230,9 +234,13 @@ static __inline ALfloat aluComputeWetSample(ALsource *source, ALfloat WetGainHF, { if(WetGainHF < 1.0f) { - ALfloat u = sample + source->LastWetSample; - ALfloat v = sample - source->LastWetSample; - sample = (u + (v*WetGainHF)) * 0.5; + if(WetGainHF > 0.0f) + { + sample *= WetGainHF; + sample += source->LastWetSample * (1.0f-WetGainHF); + } + else + sample = 0.0f; } source->LastWetSample = sample; -- cgit v1.2.3