Phasing in chorus effect?
Posted: Tue Dec 20, 2022 5:47 pm
I'm noticing that in a chorus effect I've implemented, there's a phasing/flanging effect on the pure wet signal (i.e. only the delayed/pitch-bent sound) even when the speed and width of the effect are very low. Although it sounds cool in it's own way, it's not what I'm after, and I'm wondering what might be producing it. I'm doing no upsampling/downsampling, just using 3rd-degree Lagrangian interpolation to get the "fractional" delay out of the recording buffer, i.e.
I could understand slight aliasing, ringing etc that might need to be filtered out, but the phasing/flanging effect is unexpected - what might be causing it, and how might I counter it?
Code: Select all
public double readSample(double pointer) {
int ptrLeft = (int) pointer;
double dMinus1 = pointer - ptrLeft;
if (dMinus1 == 0.0) {
return buffer.readAt(ptrLeft);
}
double dMinus2 = dMinus1 - 1;
double dMinus3 = dMinus2 - 1;
double d = dMinus1 + 1;
double halfDTimesDMinus3 = d * dMinus3 * 0.5;
double oneSixthDMinus1TimesDMinus2 = dMinus1 * dMinus2 / 6.0;
double n0 = buffer.readAt(ptrLeft - 1);
double n1 = buffer.readAt(ptrLeft);
double n2 = buffer.readAt(ptrLeft + 1);
double n3 = buffer.readAt(ptrLeft + 2);
double h0 = -oneSixthDMinus1TimesDMinus2 * dMinus3;
double h1 = halfDTimesDMinus3 * dMinus2;
double h2 = -halfDTimesDMinus3 * dMinus1;
double h3 = d * oneSixthDMinus1TimesDMinus2;
return (n0 * h0) + (n1 * h1) + (n2 * h2) + (n3 * h3);
}