Sorry, but I have very small experience with more than one main bus.
I suppose that it is better (and faster) to not copy whole buffer from each bus, so I decided to create reference for each bus, and it looks like that:
void MyAudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer& midiMessages)
{
AudioBuffer<float> &_input = getBusBuffer(buffer, true, 0);
AudioBuffer<float> &_sideChain = getBusBuffer(buffer, true, 1);
//......
}
Is it good routine? Or is there anything more efficient?\
And the other question is: Of course I want use _sideChain bus only if there is any input defined in host, else I want to use only _input. What is the best way to verify that?
Should I do something like that:
for(int channel=0; channel<numInputChannels; channel++) { if(_sideChain.getMagnitude(channel, 0, _sideChain.getNumSamples() > 0.0f) { // use _sideChain } else { // use _input } }
Intuition tells me it’s not good solution. And it’s not efficient to check each samples in each buffer. So could anyone help me and tell what is the best solution to do such things?
For any help thanks in advance.
