Multichannel output plugins


#1

In projucer I change ‘Plugin Channel Configurations’ to {2, 3} to test an extra output channel.

I can’t do anything with this channel in the process block since getTotalNumOutputChannels() and getMainBusNumOutputChannels() both still return 2.

What am I doing wrong? Thanks!


#3

I believe that to use non-standard io configurations (sidechains, aux outputs), you need to add the channel configurations in the AudioProcessor constructor, and leave the ‘Plugin Channel Configurations’ field blank in the Projucer. See the MultiOutSynth demo or NoiseGate demo for how to set up the channel configurations.


#4

Thanks for your help, I’ve had a look at the demo projects and the tutorial here: https://docs.juce.com/master/tutorial_plugin_examples.html
But I’m not too sure what to do past adding the extra channel to the initialiser list. The noise gate sample uses an extra input so the rest of the code (process etc) doesn’t apply and the multiOutSynth uses 16 output buses (good) but has a different system in the process block. How should I be doing the process block? DBG("NUM channels In: " << totalNumInputChannels << " Out: " << getMainBusNumOutputChannels()); Still gives me 2 and 2.


#5

It might be, that the host you are testing is not offering that layout.
What you have to make sure:
a) leave the preferred plugin layout in Projucer empty
b) add the extra output in the constructor
c) make sure that isBusesLayoutSupported() returns true for the selected layout

Some hosts make a difference, if you add the additional buses enabled or disabled in the constructor, best to try both versions…

But my hunch is you are using a host that does not support that configuration.

Out of curiosity, which host are you targeting and what is the purpose of the additional mono channel?


#6

I’ve got a) and b) done right, I’m not sure how to print isBusesLayoutSupported since it’s a bool function pointer but not or something…
I haven’t got to the point where I’m testing in a host yet since I don’t know how to use the extra channel in process. I use Reaper (:heart:) usually though


#7

When I try things like this I start returning true for every setup in isBusesLayoutSupported.

The version that supports only your desired layout should look like that:

bool isBusesLayoutSupported (const BusesLayout& layout) override
{
    if (layout.getChannelSet (true, 0) == AudioChannelSet::stereo() &&
        layout.getChannelSet (false, 0) == AudioChannelSet::stereo() &&
        layout.getChannelSet (false, 1) == AudioChannelSet::mono())
        return true;
    return false;
}

But chances are, the plugin will not show at all, if that specific setup is not supported by the host.

@Xenakios knows a lot about Reaper, let’s hope he chimes in…

EDIT: added missing return false


#8

Reaper supports up to 64 channels of input and output in the plugins, but I am not sure if they’ve implemented much in terms of channel layouts. It indeed is bit of a hassle to deal with the plugin IO configurations with Reaper. (And I think VST3 plugins add even more complexity…)

edit : The track in Reaper needs to be set to have 4 or more channels in order to have more than 2 channels of processing. (Reaper doesn’t get the track channel counts from the plugins, it just attempts to use as many channels with the plugins as possible, up to the number of channels set in the track IO panel.)


#9

Cool, I’ve updated the constructor so the extra channel is a stereo channel, so 4 outputs now. I’ve changed the isBusesLayoutSupported() function but aren’t sure what BusesLayout object I can use to run it.

How will I use these buses in the processBlock()? The MultiOutSynth tutorial shows using buses instead of the regular way of running through each channel then sample. I need to run through each sample for my DSP, ie. not the tutorial’s synth [busNr]->renderNextBlock method. I’ve tried replacing running through buses in the same way as channels but just get massive overload when run in reaper. Do you cycle through buses and each channel of each bus? Or just through the 3/4 channels somehow?


#10

bump?


#11

I think it is hard to answer for anybody without knowing about the content of your channels. I still have no idea, why there is a separate mono channel, and what you want to render into it, if these channels are correlated in some way etc.
All these questions would play a role setting up a render algorithm.

The only general advise I can give: always render channel blocks in a row, don’t iterate over the channels in each sample, since this kills your performance (as you seem to have found out). The thing to google for is “Cache coherency”.