You are initializing your Moog object every call and you’re also using only one object for both channels.
// PluginProcessor.h
class EarthhfilterAudioProcessor
{
[...]
private:
Moog moogLeft;
Moog moogRight;
};
void EarthhfilterAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
{
[...]
float *DataL = buffer.getSampleData(0, 0);
float *DataR = buffer.getSampleData(1, 0);
for (int i = 0; i < buffer.getNumSamples(); i++)
{
DataL[i] = moogLeft.process(DataL[i], Freq, Rez);
DataR[i] = moogRight.process(DataR[i], Freq, Rez);
lastL = DataL[i]; // whatever this is used for...
lastR = DataR[i];
}
}
You really need a better understanding of C++ (object lifetime, class members, local variables) or you will run in such problems again and again.