Skip to content

Commit

Permalink
fix(dsp): return delayed value in Delay.next()
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Sep 27, 2023
1 parent 7894cd4 commit f2b08db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/dsp/src/delay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ export class Delay<T>
}

/**
* 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]);
}

/**
Expand Down

0 comments on commit f2b08db

Please sign in to comment.