Applying a wow/flutter effect to a delay

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:
:backhand_index_pointing_right: 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!

You may want to have a JUCE SmoothedValue limit the rate of change in your wowDepthMs parameter.

You are using the same applyWowFlutter function for both channels which means wowPhase is updated for both the left and right channel. You’d need to have two wowPhase values, one for each channel, or calculate the wow modulation just once for both channels.

1 Like

Thanks, now it works. I also applied the SmoothedValue to the wowDepthMs parameter. The problem i get now is that i hear some artifacts/clicks when i move the depth knob of the wow effect.

Apply smoothing to the depth amount too? :slightly_smiling_face: