From 7c26d1971febfd1b3b5d0dbd48e6b8294333ddad Mon Sep 17 00:00:00 2001 From: Weird Constructor Date: Wed, 20 Jul 2022 05:23:20 +0200 Subject: [PATCH] Fixing sample player reverse --- CHANGELOG.md | 3 +++ src/dsp/node_sampl.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d29614..b3b1149 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,3 +5,6 @@ about implementing new DSP nodes. * Bugfix: TriSawLFO (TsLFO) node did output too high values if the `rev` parameter was changed or modulated at runtime. +* Bugfix: Found a bug in cubic interpolation in the sample player and +similar bugs in the delay line (and all-pass & comb filters). Refactored +the cubic interpolation and tested it seperately now. diff --git a/src/dsp/node_sampl.rs b/src/dsp/node_sampl.rs index 7964a26..0fc9ca1 100644 --- a/src/dsp/node_sampl.rs +++ b/src/dsp/node_sampl.rs @@ -148,7 +148,7 @@ impl Sampl { return 0.0; } - let j = self.phase.floor() as usize; + let j = self.phase.floor() as usize % sd_len; let i = ((sd_len - 1) - j); let f = self.phase.fract();