ProcessorChain and bypass

Hi everybody,

I started writing an equalizer plugin with 6 individual bands. I added them into a ProcessorChain.

Now I want to bypass the individual processors, but unfortunately I can only bypass the whole chain. I see two options:

  1. adding a bypassed flag to dsp::ProcessorBase -> generic solution for all chains
  2. in my case setting coefficients, that end up with a kind of “Identity” (does that even exist?) -> pro: can be solved outside JUCE, con: possibly burning CPU for no reason and b) I would ask for a dsp::Coefficients::makeIdentity()

What would be the best solution here?


Thanks @daniel, I’ll have a look at this.

Thanks @fabian, much appreciated!
For the moment I can live with using AllPass filters, they come close to a NOP, but would be good to have a conceptual switch in the long run.

At least I can now play around with the many filter types and see, how they sound and look like:

1 Like

Yes, I am in need of bypassing individual members of the process chain also. Even some sort of “Null” filter would be good, but a true bypass is ideal.

Isn’t the ProcessorChain resolved during compile-time for the whole chain to be optimized by the compiler? So I guess bypassing isn’t really an option here, is it? However, a “Null” filter could be created easily by just manually setting the filter coefficients (a single 1, the rest zeros (please figure out yourself where to put the 1 :slight_smile: can’t look into the implementation right now))

Yes, thats what in graphics is called identity… and since one doesn’t want to look into the implementation I asked for an IIR::Coefficients::makeIdentity() in the OP :wink:

Addition: seems b0 (aka coeffs[0]) =1 should be the one, all others to 0… I will test that later, but from reading the source it looks all right…

Addition 2: the default constructor does, what is needed: 1, 0, 1, 0 - but the docs are wrong claiming it would produce silence…

Hi @daniel,

I’ve added bypass support to all of the DSP module’s processors and to the ProcessChain. You can find it on the develop branch with commit 0ba6cb4. You use it by calling chain.setBypassed<5> (true), for example, to bypass the 5th processor in the chain.

Let me know if this works for you.

Also, nice plug-in you got there. Is the code for it open-source?



Great, that looks good to me, I will try it later.
I guess, whenever I switch a processor bypass on or off, I should call a reset on the whole chain…?

Not necessarily. The bypass will still keep the internal state of the filters up to date, so setting the bypass on and off should be fine.

Hey @fabian, just to let you know, the chain.setBypassed<5> (true) works like a charm, I added solo and bypass for each filter and have zero issues.


Yes, I put it up now:

and the code is on my github profile

Feedback is very welcome… here, PM, facebook or whatever channel one prefers…