Compared to the toolbox delay, the toolbox interpolated delay seems not to be right.

I managed to fix it introducing stage3. I think the code should be:

- Code: Select all
`streamin in;`

streamout out;

streamin delay;

float index;

float intdelay,frac;

float temp1,temp2;

float out1;

float mem[44100];

float MAXDELAY=44100;

stage(2)

{

index=index+1;

index=(index<MAXDELAY)&index;

}

stage(3)

{

mem[index]=in;

intdelay = delay - 0.499999;

intdelay = rndint(intdelay);

frac = delay - intdelay;

temp1 = index - intdelay;

temp2 = temp1 - 1;

temp1 = temp1 + (temp1 < 0)&MAXDELAY;

temp1 = mem[temp1];

temp2 = temp2 + (temp2 < 0)&MAXDELAY;

temp2 = mem[temp2];

frac = (1 - frac)/(1 + frac);

out = temp2 + frac * (temp1 - out1);

out1 = out;

}