From 403aaa4fdd0ddca725cb06560dda99f8766e0750 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 22 Nov 2023 07:28:50 -0800 Subject: Compensate the late delay tap by the early delay buffer --- alc/effects/reverb.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'alc') diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp index 5068c8d7..1af50559 100644 --- a/alc/effects/reverb.cpp +++ b/alc/effects/reverb.cpp @@ -1018,8 +1018,12 @@ void ReverbPipeline::updateDelayLine(const float earlyDelay, const float lateDel mEarlyDelayTap[i][1] = float2uint((earlyDelay+length) * frequency); mEarlyDelayCoeff[i] = CalcDecayCoeff(length, decayTime); + /* Reduce the late delay tap by the shortest early delay line length to + * compensate for the late line input being fed by the delayed early + * output. + */ length = (LATE_LINE_LENGTHS[i] - LATE_LINE_LENGTHS.front())/float{NUM_LINES}*density_mult + - lateDelay; + std::max(lateDelay - EARLY_LINE_LENGTHS[0]*density_mult, 0.0f); mLateDelayTap[i][1] = float2uint(length * frequency); } } -- cgit v1.2.3