Skip to content

Commit

Permalink
Fix extra latency sample in [delay~]
Browse files Browse the repository at this point in the history
The -1 range looks strange, but I've tested it and confirmed that it's safe and fixes the issue
  • Loading branch information
timothyschoen authored Dec 16, 2024
1 parent 80d4d8e commit e6e6a2c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cyclone_objects/binaries/audio/delay.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

#define DELAY_DEFMAXSIZE 512 // default buffer size
#define DELAY_GUARD 4 // guard points for 4-point interpolation
#define DELAY_EXTRA 1 // one sample extra delay for 4-point interpolation


typedef struct _delay
{
Expand Down Expand Up @@ -245,7 +243,7 @@ static t_int *delay_performsig(t_int *w)
f = 0.;
*wp = f;
del = *in2++;
del = (del > 0. ? del : 0.);
del = (del >= 1. ? del-1 : -1); // Clip and compensate for 1 sample latency
del = (del < maxsize ? del : maxsize);
idel = (int)del;
frac = del - (t_sample)idel;
Expand Down

0 comments on commit e6e6a2c

Please sign in to comment.