# Juce::dsp::convolution crackling at higher sample rates

**URL:** <https://forum.juce.com/t/juce-convolution-crackling-at-higher-sample-rates/57520>\
**Category:** Audio Plugins\
**Created:** [August 21, 2023, 6:04pm UTC](https://forum.juce.com/t/juce-convolution-crackling-at-higher-sample-rates/57520 "2023-08-21T18:04:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ndeet](https://avatars.discourse-cdn.com/v4/letter/n/f04885/32.png) [@ndeet](https://forum.juce.com/u/ndeet)\
**Post date:** [August 21, 2023, 6:04pm UTC](https://forum.juce.com/t/juce-convolution-crackling-at-higher-sample-rates/57520/1 "2023-08-21T18:04:47Z")

</div>

Hello Everyone,

I have been building a guitar amp simulator and for the reverb I am using the juce::dsp::convolution class. For some reason, the plugin crackles at higher sample rates (88.2k,96k), but not at lower ones. I have been setting my block size low (32 samples), however I have tested it against another commercial guitar amp plugin so I am confident that it is an issue with my implementation of the JUCE convolution class.

Here is the following code I am using:  
in the header file:

```auto
juce::dsp::ConvolutionMessageQueue queue;
 juce::dsp::Convolution reverbConv{ juce::dsp::Convolution::NonUniform {2048}, queue};

```

and then In the process block:

```auto
    //Getting number and Size of IR
    irNumber = *apvts.getRawParameterValue("REVERBSELECTOR");
    juce::String irName = BinaryData::namedResourceList[irNumber];
// DBG(irName);
    irData = BinaryData::getNamedResource(irName.toRawUTF8(), irSize);

    audioBlock.copyTo(temp);
    if (*apvts.getRawParameterValue("REVERBYPASS") != true)
    {
        // Update IR if it has been changed in GUI
        if (irNumber != currentLoadedIr)
        {
// DBG(irNumber);
// DBG(currentLoadedIr);
            loadIR();
            currentLoadedIr = irNumber;
        }

        updateReverbEq();
        reverbConv.process(context);
        reverbLP.process(context);
        reverbHP.process(context);
    }

```

If anyone has any suggestions or has encountered the problem before, I’d love to hear them! It’s also worth mentioning that in prepare to play I am just passing it the spec object which uses the sample rate values from that.

Thanks!  
Noah

---

<div class="post-metadata">

**Author:** ![PaulDriessen](https://avatars.discourse-cdn.com/v4/letter/p/a88e57/32.png) [@PaulDriessen](https://forum.juce.com/u/PaulDriessen)\
**Post date:** [August 21, 2023, 6:24pm UTC](https://forum.juce.com/t/juce-convolution-crackling-at-higher-sample-rates/57520/2 "2023-08-21T18:24:18Z")

</div>

the plugin crackles because the CPU overloads: the convolution uses more CPU at higher samplerates. Lower blocksizes further increase CPU usage.  
The JUCE convolution is not the most economic convoluter on the market, but you can try set the latency of it longer, so that it tones down its CPOU usage.

---

<div class="post-metadata">

**Author:** ![ndeet](https://avatars.discourse-cdn.com/v4/letter/n/f04885/32.png) [@ndeet](https://forum.juce.com/u/ndeet)\
**Post date:** [August 21, 2023, 11:39pm UTC](https://forum.juce.com/t/juce-convolution-crackling-at-higher-sample-rates/57520/3 "2023-08-21T23:39:36Z")

</div>

Gotcha thanks for the tip!

I instantiated it the following way:

` juce::dsp::Convolution reverbConv{juce::dsp::Convolution::Latency {128}, queue};`

Just out of curiosity, does anyone know why one cannot initialize a convolution object to be non-uniform and have a fixed latency size? I am probably missing something but I am just curious!

 ![Screenshot 2023-08-21 at 6.39.22 PM](https://us1.discourse-cdn.com/flex026/uploads/juce/original/3X/a/a/aa9959aee305b91595839c13b773b7dd9e80d630.png)
