Hi everyone,
I’m starting to learn JUCE and I’ve built a basic delay plugin. Now I’m trying to take it a step further by adding a wow/flutter effect that modulates the delay time over time.
Right now, I have a knob in the editor that controls the depth of the wow effect (in milliseconds), and I’ve hardcoded the rate to 1 Hz. The wow modulation is applied before calling popSample(...) from the delay line.
The issue is:
When I increase the depth, I start hearing distortion in the delayed repetitions — instead of just smooth pitch variation, I get clicks or artifacts.
Here’s the function I use to apply wow:
float SimpleDelayTapeAudioProcessor::applyWowFlutter(float baseDelaySamples, double sampleRate)
{
constexpr float twoPi = juce::MathConstants<float>::twoPi;
float wowDepthMs = *tree.getRawParameterValue(WOW_ID);
float wowDepth = (wowDepthMs * sampleRate) / 1000.0f;
float wowStep = twoPi * wowRate / (float)sampleRate;
float wowMod = std::sin(wowPhase) * wowDepth;
wowPhase += wowStep;
if (wowPhase > twoPi) wowPhase -= twoPi;
return baseDelaySamples + wowMod;
}
And here’s how I call it in processBlock:
float delayMs = (channel == 0 ? smoothedDelayTimeL.getNextValue()
: smoothedDelayTimeR.getNextValue());
float delaySamples = delayMs * getSampleRate() / 1000.0f;
float modulatedDelaySamples = applyWowFlutter(delaySamples, getSampleRate());
float delayed = delayLines[channel].popSample(0, modulatedDelaySamples);
I’m using juce::dsp::DelayLine with Lagrange interpolation enabled.
Does anyone have suggestions on how to avoid the distortion when increasing the wow depth?
Is there something wrong with how I apply the modulation?
Thanks in advance!
