From ed0420f4297712d8104da8eef5301e3d9b899056 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 2 Dec 2023 00:42:13 -0800 Subject: Adjust the secondary early reflections This reduces the delay to provide a direct (no delay) line from the early reflections to the late reverb delay buffer. This also reduces the early reflection output gain by half. The reasoning here is that EFX seems to expect only one set of initial reflections, while we use two. And being close enough in time, nearly doubles the amount of output energy. This does seem to improve the "harshness" of certain reverbs, smoothing the difference between reverbs, and makes it more like other implementations (still some work to do on late reverb, though). --- alc/effects/reverb.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'alc') diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp index 603d20c3..6a9d1997 100644 --- a/alc/effects/reverb.cpp +++ b/alc/effects/reverb.cpp @@ -252,7 +252,7 @@ constexpr std::array EARLY_ALLPASS_LENGTHS{{ * Using an average dimension of 1m, we get: */ constexpr std::array EARLY_LINE_LENGTHS{{ - 5.9850400e-4f, 1.0913150e-3f, 1.5376658e-3f, 1.9419362e-3f + 0.0000000e+0f, 4.9281100e-4f, 9.3916180e-4f, 1.3434322e-3f }}; /* The late all-pass filter lengths are based on the late line lengths: @@ -1057,7 +1057,7 @@ void ReverbPipeline::updateDelayLine(const float earlyDelay, const float lateDel * output. */ length = (LATE_LINE_LENGTHS[i] - LATE_LINE_LENGTHS.front())/float{NUM_LINES}*density_mult + - std::max(lateDelay - EARLY_LINE_LENGTHS[0]*density_mult, 0.0f); + lateDelay; mLateDelayTap[i][1] = float2uint(length * frequency); } } @@ -1504,10 +1504,11 @@ void ReverbPipeline::processEarly(size_t offset, const size_t samplesToDo, mEarlyDelayTap[j][0] = mEarlyDelayTap[j][1]; } - /* Apply a vector all-pass, to help color the initial reflections based - * on the diffusion strength. + /* Apply a vector all-pass, to help color the initial reflections. + * Don't apply diffusion-based scattering since these are still the + * first reflections. */ - mEarly.VecAp.process(tempSamples, offset, mixX, mixY, todo); + mEarly.VecAp.process(tempSamples, offset, 1.0f, 0.0f, todo); /* Apply a delay and bounce to generate secondary reflections, combine * with the primary reflections and write out the result for mixing. @@ -1525,7 +1526,7 @@ void ReverbPipeline::processEarly(size_t offset, const size_t samplesToDo, size_t td{minz(early_delay.Mask+1 - feedb_tap, todo - i)}; do { float sample{early_delay.Line[feedb_tap++][j]}; - out[i] = tempSamples[j][i] + sample*feedb_coeff; + out[i] = (tempSamples[j][i] + sample*feedb_coeff) * 0.5f; tempSamples[j][i] = sample; ++i; } while(--td); -- cgit v1.2.3