I’m trying to modify the ProcessingAudioInputTutorial to make a delay pedal. I found some code for a circular buffer and tested it thoroughly, it’s working. I’ve implemented the code for the delay pedal but it’s not working and I can’t figure out why.
I initilialize the delay line here:
MainContentComponent() : delayLine(44100),
spectrogramFFT(fftOrder),
spectrogramImage (Image::RGB, 512, 512, true)
and the delay line is implemented inside getNextAudioBlock:
auto* outBuffer = bufferToFill.buffer->getWritePointer (channel, bufferToFill.startSample);
for (auto sample = 0; sample < bufferToFill.numSamples; ++sample)
{
auto xn = inBuffer[sample];
auto z_out = delayLine.get();
auto yn = xn + z_out;
delayLine.put(yn);
outBuffer[sample] = yn;
}
Any idea why it won’t work? Is it a problem that the delay line is longer than the audio buffer size?
Thanks