From 104cb6aa0a814cc9fb01647f1f1b6dfa3a3fc6f5 Mon Sep 17 00:00:00 2001 From: Kelebek1 Date: Thu, 2 Mar 2023 05:48:53 +0000 Subject: Fix a bug with the Reverb command in reading from the pre_delay line. --- src/audio_core/renderer/effect/reverb.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/audio_core/renderer/effect/reverb.h') diff --git a/src/audio_core/renderer/effect/reverb.h b/src/audio_core/renderer/effect/reverb.h index a72475c3c..6cc345ef6 100644 --- a/src/audio_core/renderer/effect/reverb.h +++ b/src/audio_core/renderer/effect/reverb.h @@ -79,12 +79,10 @@ public: return; } sample_count = delay_time; - input = &buffer[(output - buffer.data() + sample_count) % (sample_count_max + 1)]; + input = &buffer[0]; } Common::FixedPoint<50, 14> Tick(const Common::FixedPoint<50, 14> sample) { - Write(sample); - auto out_sample{Read()}; output++; @@ -92,6 +90,7 @@ public: output = buffer.data(); } + Write(sample); return out_sample; } @@ -100,7 +99,8 @@ public: } void Write(const Common::FixedPoint<50, 14> sample) { - *(input++) = sample; + *input = sample; + input++; if (input >= buffer_end) { input = buffer.data(); } -- cgit v1.2.3