Hi all,
Currently, I am implementing an amplitude splitter processor, which will split a single audio signal and put the quiet part of the signal in one channel, and the loud part of the signal in another. My question is not how to implement the DSP, as I have multiple ideas on how to do this and I would like to figure it out myself.
My question is more general. What would be the JUCE idiomatic way of implementing a DSP processor that takes a mono signal and splits it into two separate channels based on some arbitrary criteria? So, it can be included in a ProcessorChain, and the channels can be processed separately.
My first idea was to create a processor with a process method that takes a ProcessContextNonReplacing, which points to a single channel input block, and a two channel output block. (or alternatively takes a two channel input block, and a 4 channel output block for stereo signals) But I don’t know how this pattern would fit into a ProcessorChain. Am I supposed to use a ProcessorDuplicator?
Right now I have my ProcessorChain organized like this: (it might be overly complicated for such a simple plugin, but this will function as my template moving forwards)
using PreMixLinearChain = juce::dsp::ProcessorChain<Gain>;
using PreMixNonLinearChain = juce::dsp::ProcessorChain<Processor>;
using MixedChain = qxy::MixerProcessor<juce::dsp::ProcessorChain<PreMixLinearChain, PreMixNonLinearChain>>;
using PostMixLinearChain = juce::dsp::ProcessorChain<Gain>;
using ProcessorChain = juce::dsp::ProcessorChain<MixedChain, PostMixLinearChain>;
Only the PreMixNonLinearChain gets oversampled, that is why I have it divided like this. The MixerProcessor is a wrapper around a DryWetMixer, so it can be used in the ProcessorChain. And I’m looking for something similar for the amplitude splitter. Where I can first split up the signal, process the resulting channels separately, and then recombine them at a later point in the ProcessorChain.
My second question is, how do I create additional output busses in JUCE? And how do I assign a chain to a output bus? As I would also like to create a plugin that I can insert into my DAW, and it will create two busses for me, one for the quiet part of the signal, and one for the loud part.
Hopefully someone can give me a push in the right direction or point me to a good example of a similar implementation somewhere.
Many thanks!
