Finally figured out how to use Lagrange interpolator going to try some others

Update its to buggy to do with out properly buffering in a synth voice so i just did sample by sample

void MySamplerVoice::renderNextBlock(AudioBuffer<float>& outputBuffer, int startSample, int numSamples) {
    if(auto* sound = static_cast<MySamplerSound*> (getCurrentlyPlayingSound().get())) {
        auto& data = *sound->odata;
        


        float* outL = outputBuffer.getWritePointer (0, startSample);
        float* outR = outputBuffer.getNumChannels() > 1 ? outputBuffer.getWritePointer (1, startSample) : nullptr;

        
        
        while(--numSamples >= 0) {
            
            const float* const inL = data.getReadPointer (0, sourceSamplePosition);
            const float* const inR = data.getNumChannels() > 1 ? data.getReadPointer (1,sourceSamplePosition) : nullptr;
            
            float tl[1] = {0.0};
            float tr[1] = {0.0};
            
            float l = ResamplerL.process(pitchRatio, inL, tl, 1);
            float r = 0.0;
            
            if(outR != nullptr) {
                r = ResamplerR.process(pitchRatio, inR, tr, 1);
                *outL++ = tl[0];
                *outR++ = tr[0];
            }else{
                *outL++ = (tl[0] + tr[0]) * 0.5;
            }
            
            sourceSamplePosition += pitchRatio;
            
            if(sourceSamplePosition > sound->length) {
                sourceSamplePosition = 0;
                stopNote(0.0, false);
            }
        }

    }
}

code above is not quite right you need a buffer of four samples

void MySamplerVoice::lagrange (AudioBuffer<float>& outputBuffer, int startSample, int numSamples) {
    if(auto* sound = static_cast<MySamplerSound*> (getCurrentlyPlayingSound().get())) {
        auto& data = *sound->data;
        
        float* outL = outputBuffer.getWritePointer (0, startSample);
        float* outR = outputBuffer.getNumChannels() > 1 ? outputBuffer.getWritePointer (1, startSample) : nullptr;
        

        int nsmp = numSamples;
        while(nsmp > 0) {
            
            int srcPos = sourceSamplePosition;
            const float* const inL = data.getReadPointer (0,srcPos);
            const float* const inR = data.getNumChannels() > 1 ? data.getReadPointer (1,srcPos) : nullptr;


            
            int n = 4 - (bufpos & 3);
            if(n > nsmp) {
                n = nsmp;
            }
                        
            int opposite = (bufpos + 4) & 8;
            float *pl = bufl + opposite;
            float *pr = bufr + opposite;
        
            memcpy(pl,outL,n * sizeof(float));
            memcpy(pr,outR,n * sizeof(float));
                
            int bufnext = (bufpos + n) & 8;
            if(0 == (bufnext & 3)){
                
                
                lresL.process(pitchRatio,inL, bufl + bufnext, 4);
                lresR.process(pitchRatio,inR, bufr + bufnext, 4);
            }

            float *rl = bufl + bufpos;
            float *rr = bufr + bufpos;
        
            for(int i=0; i<n; i++)
            {
                *outL++ += *rl++;
                *outR++ += *rr++;
            }
                
            bufpos = bufnext;
            nsmp -= n;
            
            sourceSamplePosition += n * pitchRatio;
            if(sourceSamplePosition > sound->length) {
                stopNote(0, false);
                sourceSamplePosition = 0;
            }
        }
    

    }
}