From f2b08db15e78c2d36ca2eb7f479f58e4e8690cb8 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Wed, 27 Sep 2023 09:17:10 +0200 Subject: [PATCH] fix(dsp): return delayed value in Delay.next() --- packages/dsp/src/delay.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/dsp/src/delay.ts b/packages/dsp/src/delay.ts index 9abf9f815f..1963f10eb3 100644 --- a/packages/dsp/src/delay.ts +++ b/packages/dsp/src/delay.ts @@ -109,14 +109,14 @@ export class Delay } /** - * Progresses read & write pos, stores & returns new value. + * Progresses read & write pos, stores new value and returns delayed value. * * @param x - */ next(x: T) { this.step(); this._buf[this._wpos] = x; - return x; + return (this._val = this._buf[this._rpos]); } /**