Inanyway - here is my naive code:
Code: Select all
for( int s = sampleFrames; s > 0; --s )
{
float input1 = *in1 + 1.0e-18f;
float fdbk = *in3;
float lenf = *in2 * Samplerate;
float c_epsilon = 0.4f;
unsigned short int delayInt = lenf - c_epsilon;
if (delayInt > 65534) delayInt = 65534; // check at delay length calculation
else if (delayInt < 1) delayInt = 1;
float fractionalDelay = lenf - delayInt;
float APcoeff = (1.0f - fractionalDelay) / (1.0f + fractionalDelay);
r = p - delayInt;
r0 = r - 1;
if (r < 0) r += 65536;
if (r0 < 0) r0 += 65536;
nout = buffer[r0] + APcoeff * buffer[r] - APcoeff * nout;//nout= unit-delay
buffer[p] = input1 + nout * fdbk;
p++;
if (p > 65535) p = 0;
*out1 = nout;
// move to next sample in buffers
in1++;
in2++;
in3++;
out1++;
P.S - I'm a serious nOOb
Regards
Andrew

