So with the code below, if I return y it's a standard delay with no interpolation, however if I enable linear interpolation it sounds completely different?! :S
Code: Select all
float buffer[22050];
float delay;
float feedback;
float delaylen;
float recipdelaylen;
float delayindex;
void initdelay(float fDelay, float fFeedBack)
{
delayindex = 0.f;
delay = fDelay;
feedback = fFeedBack;
delaylen = fDelay * (SAMPLE_RATE - 1.f);
recipdelaylen = 1.f / delaylen;
}
float delayline(float x)
{
const UINT32 iy = int(delayindex * delaylen);
const float y = buffer[iy];
buffer[int(delayindex * delaylen)] = x + y * feedback;
delayindex += recipdelaylen;
if(delayindex >= 1.0f)
delayindex = 0.f;
//wrap(delayindex);
//return y;
return LinearInterpolate(y, m_data[iy+1], delayindex - int(delayindex));
}