LagrangeInterpolator for signal resampling

I’m facing the challenge of implementing the LagrangeInterpolator (or any of the JUCE interpolator classes for that matter) as a basic resampler inside my plugin. The goal is to run at 192kHz internal as an alternative to oversampling at an absolute factor of 2 or 4. Here is an example of the processBlock that I’ve been using to test the interpolators:

double targetSampleRate = 44100;
double speedRatio = targetSampleRate / getSampleRate();

// juce::AudioBuffer from processBlock() function call
const float* const inL = buffer.getReadPointer(0);
const float* const inR = buffer.getReadPointer(1);
    
// Separate "working buffer" allocated in prepareToPlay()
float* outL = outputBuffer.getWritePointer (0);
float* outR = outputBuffer.getWritePointer (1);
    
// numSamples == buffer.getNumSamples()
lagrange[0].process(speedRatio, inL, outL, numSamples);
lagrange[1].process(speedRatio, inR, outR, numSamples);
  
// Copy, output interpolation data
auto inL_write = buffer.getWritePointer(0);
auto inR_write = buffer.getWritePointer(1);
    
memcpy(inL_write, outL++, buffer.getNumSamples());
memcpy(inR_write, outR++, buffer.getNumSamples());

I’ve swapped out the Lagrange for a linear interpolator just to cover my bases.

When the targetSampleRate is 44100, a sine wave is “generally” fine but has blips (weird buffer offsets during the Lagrange… single-sample offsets with the linear interpolator) that clearly need to be avoided. The second the speedRatio is anything other than 1, the signal is totally destroyed. It seems like I am missing some kind of recursive index call to sync everything up. If anyone has any leads, I would greatly appreciate it!

Zach