# Help with simple FIR filter convolution

**URL:** <https://forum.juce.com/t/help-with-simple-fir-filter-convolution/66937>\
**Category:** Development\
**Created:** [August 24, 2025, 4:41pm UTC](https://forum.juce.com/t/help-with-simple-fir-filter-convolution/66937 "2025-08-24T16:41:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amusz](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@amusz](https://forum.juce.com/u/amusz)\
**Post date:** [August 24, 2025, 4:41pm UTC](https://forum.juce.com/t/help-with-simple-fir-filter-convolution/66937/1 "2025-08-24T16:41:37Z")

</div>

Not an expert in CPP and/or JUCE, but I’m trying to implement a long (\>511) FIR filter with the convolution class.

Everything seems to run and build from a simple example, but I notice that the filter is not doing anything while bypassing on/ff with the plugin host. There are 10dB dfference in low freq resp, so when you listen to it is very easy to notice that is working. (When testing it offline without JUCE of course)

When debugging with CMAKE I continuously see: `AudioPluginHost[10831:2836784] [AMCP] 88331 HALC_ProxyIOContext.cpp:1334 HALC_ProxyIOContext::IOWorkLoop: skipping cycle due to overload`

A brief on the implementation:

**In my pluginProcessor.h:**

```auto
    struct ConvolutionWithLatency : public juce::dsp::Convolution
    {
        ConvolutionWithLatency() : juce::dsp::Convolution(juce::dsp::Convolution::NonUniform{256}) {}
    };

    juce::dsp::ProcessorChain<juce::dsp::Gain<float>, ConvolutionWithLatency> processorChain;

```

**In my pluginProcessor.cpp**

```auto
    int numTries = 0;
    auto dir = juce::File::getCurrentWorkingDirectory();
     while (! dir.getChildFile ("hinv.wav").exists() && numTries++ < 15)
            dir = dir.getParentDirectory();
    auto& convolution = processorChain.get<1>();
    convolution.loadImpulseResponse(dir.getChildFile ("hinv.wav"), juce::dsp::Convolution::Stereo::no, juce::dsp::Convolution::Trim::no, 0);

    processorChain.prepare(spec);

```

The filter has 511 samples and here is a REW screenshot of its analysis:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/juce/original/3X/5/a/5a1e2c57c27a02eda75c6cae18d4bb2e7c3e4270.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/juce/original/3X/c/b/cb623b9eaf3b91216d7f502eb05c102c285dba34.png)

Any comment are appreciated

---

<div class="post-metadata">

**Author:** ![kerfuffle](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kerfuffle/32/11805_2.png) [@kerfuffle](https://forum.juce.com/u/kerfuffle)\
**Post date:** [August 24, 2025, 4:44pm UTC](https://forum.juce.com/t/help-with-simple-fir-filter-convolution/66937/2 "2025-08-24T16:44:27Z")

</div>

You’re not showing how you’re actually using the processorChain inside processBlock.

---

<div class="post-metadata">

**Author:** ![amusz](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@amusz](https://forum.juce.com/u/amusz)\
**Post date:** [August 24, 2025, 6:06pm UTC](https://forum.juce.com/t/help-with-simple-fir-filter-convolution/66937/3 "2025-08-24T18:06:53Z")

</div>

thanks for the quick reply. Like this:

```auto
void PluginProcessor::processBlock (juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midiMessages)
{
    juce::ScopedNoDenormals noDenormals;
    
    // if (requiresUpdate.load())
    // update();

    auto totalNumInputChannels = getTotalNumInputChannels();
    auto totalNumOutputChannels = getTotalNumOutputChannels();
    
    const auto numChannels = juce::jmax(totalNumInputChannels, totalNumOutputChannels);

    auto inoutBlock = juce::dsp::AudioBlock<float> (buffer).getSubsetChannelBlock (0, (size_t) numChannels);
    processorChain.process (juce::dsp::ProcessContextReplacing<float> (inoutBlock));
}

```

---

<div class="post-metadata">

**Author:** ![kerfuffle](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kerfuffle/32/11805_2.png) [@kerfuffle](https://forum.juce.com/u/kerfuffle)\
**Post date:** [August 24, 2025, 6:18pm UTC](https://forum.juce.com/t/help-with-simple-fir-filter-convolution/66937/4 "2025-08-24T18:18:50Z")

</div>

> [@amusz](#):
>
> ```auto
> auto dir = juce::File::getCurrentWorkingDirectory();
> while (! dir.getChildFile ("hinv.wav").exists() && numTries++ < 15)
> dir = dir.getParentDirectory();
> 
> ```

Have you verified this actually finds the wav file?

---

<div class="post-metadata">

**Author:** ![amusz](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@amusz](https://forum.juce.com/u/amusz)\
**Post date:** [August 24, 2025, 6:25pm UTC](https://forum.juce.com/t/help-with-simple-fir-filter-convolution/66937/5 "2025-08-24T18:25:39Z")

</div>

yes, basically renaming the file to something else just asserts. So it goes through when putting the correct name
