# ProcessorChain not affecting audio

**URL:** https://forum.juce.com/t/processorchain-not-affecting-audio/53827
**Category:** General JUCE discussion
**Created:** [November 21, 2022, 4:20pm UTC](https://forum.juce.com/t/processorchain-not-affecting-audio/53827 "2022-11-21T16:20:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![helveticat](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@helveticat](https://forum.juce.com/u/helveticat)
#### Post date: [November 21, 2022, 4:20pm UTC](https://forum.juce.com/t/processorchain-not-affecting-audio/53827/1 "2022-11-21T16:20:32Z")

</div>

I decided to try out the ProcessorChain in juce::dsp but am having trouble getting it wired up. Currently my VST passes the signal completely unchanged and I’m not sure why.

In Processor.h I have:

```auto
    juce::dsp::ProcessorChain<juce::dsp::IIR::Filter<float>, Gain> filter_stage_0;

```

In prepareToPlay I have:

```auto
    juce::dsp::ProcessSpec spec;
    spec.sampleRate = host_sample_rate;
    spec.maximumBlockSize = juce::uint32(samplesPerBlock);
    spec.numChannels = juce::uint32(getTotalNumOutputChannels());

    filter_stage_0.prepare(spec);
    filter_stage_0.reset();

```

In parameterChanged I get some parameters from an AudioProcessorValueTreeState and set the coefficients:

```auto
    low_cutoff_1 = *tree.getRawParameterValue("low_cutoff_1");
    low_q_1 = *tree.getRawParameterValue("low_q_1");
    gain_1 = *tree.getRawParameterValue("gain_1");
    newCoefficients = juce::dsp::IIR::Coefficients<float>::makeHighPass(
        host_sample_rate, low_cutoff_1, low_q_1);
    filter_stage_0.get<0>().coefficients = newCoefficients;
    filter_stage_0.get<1>().setGainLinear(gain_1);

```

In processBlock I have:

```auto
    juce::dsp::ProcessContextReplacing<float> context(
        juce::dsp::AudioBlock<float>(buffer)
    );
    filter_stage_0.process(context);

```

When the VST is loaded, changing the cutoff or gain does nothing – the audio is being passed through completely unchanged.

I guess I’m just missing a step but looking through the examples / tutorials I can find online hasn’t clarified it for me.

---

<div class="post-metadata">

### Author: ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)
#### Post date: [November 21, 2022, 4:32pm UTC](https://forum.juce.com/t/processorchain-not-affecting-audio/53827/2 "2022-11-21T16:32:13Z")

</div>

> [@helveticat](#):
>
> `filter_stage_0.get<0>().coefficients = newCoefficients;`

Coefficients is a ptr, so you need to dereference here:

```auto
*filter_stage_0.get<0>().coefficients = *newCoefficients;

```

---

<div class="post-metadata">

### Author: ![helveticat](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@helveticat](https://forum.juce.com/u/helveticat)
#### Post date: [November 21, 2022, 5:29pm UTC](https://forum.juce.com/t/processorchain-not-affecting-audio/53827/3 "2022-11-21T17:29:22Z")

</div>

@daniel Good spot, thanks – I made the change. It hasn’t altered the behaviour though.
