aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-11-21 14:40:15 -0800
committerChris Robinson <[email protected]>2023-11-21 14:40:15 -0800
commit62c5b38c811ac1552a1cadb00604477ebb39c646 (patch)
tree2d9413d5029bea1f535f9c29db04f4bbf963a886
parentd6d572df66eb2b5beeb3da7f3b11a328500c33c3 (diff)
Don't combine both early reflection taps for the late reverb
It doesn't make much sense to include both early reflections to feed the late reverb, since it increases the total energy in the reverb decay. This better fits with the design described in papers for this type of reverb, and seems to better match volume levels of hardware EAX/EFX reverb (though there are still some apparent differences). Note that this adds a bit more delay to the late reverb, specifically EARLY_LINE_LENGTHS[0] * density_mult. This can be compensated for somewhat by reducing the late reverb delay by that amount (clamping to a minimum of 0). Alternatively, adjust the delay lines for the second early tap to have a zero- delay pass-through line with 3 delay lines (as opposed to the current 4 delay lines), as suggested by the paper "ADAPTING ARTIFICIAL REVERBERATION ARCHITECTURES FOR B-FORMAT SIGNAL PROCESSING". Although doing so may require additional adjustments to the delay lengths and gains to avoid the 0-length lines accumulating unattenuated copies of the signal for the early reflection output.
-rw-r--r--alc/effects/reverb.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp
index 0e63c7bc..5068c8d7 100644
--- a/alc/effects/reverb.cpp
+++ b/alc/effects/reverb.cpp
@@ -1482,8 +1482,9 @@ void ReverbPipeline::processEarly(size_t offset, const size_t samplesToDo,
feedb_tap &= early_delay.Mask;
size_t td{minz(early_delay.Mask+1 - feedb_tap, todo - i)};
do {
- tempSamples[j][i] += early_delay.Line[feedb_tap++][j]*feedb_coeff;
- out[i] = tempSamples[j][i];
+ float sample{early_delay.Line[feedb_tap++][j]};
+ out[i] = tempSamples[j][i] + sample*feedb_coeff;
+ tempSamples[j][i] = sample;
++i;
} while(--td);
}