Setting plugin's types for DAWs (busses)

Hi.
I’m doing plugin which has one stereo output or 8 stereo outputs.
When I select plugin in a DAW I want to see two options

  1. Stereo
  2. Multi-Output (8xstereo).

Now I have code like that

#if ! JucePlugin_IsSynth
                  .withInput  ("Input",  AudioChannelSet::stereo(), true)
#endif
                  .withOutput("Master", AudioChannelSet::stereo(), true)
                  .withOutput("1 out", AudioChannelSet::stereo(), false)
                  .withOutput("2 out", AudioChannelSet::stereo(), false)
                  .withOutput("3 out", AudioChannelSet::stereo(), false)
                  .withOutput("4 out", AudioChannelSet::stereo(), false)
                  .withOutput("5 out", AudioChannelSet::stereo(), false)
                  .withOutput("6 out", AudioChannelSet::stereo(), false)
                  .withOutput("7 out", AudioChannelSet::stereo(), false)

bool NewProjectAudioProcessor::isBusesLayoutSupported(const BusesLayout& layouts) const
{
const auto numOutput = layouts.getMainInputChannelSet().size();

if (numOutput == 1 || numOutput == 8)
    return true;

return false;

}

But in Logic I see many combinations of the busses (Mono, Stereo, Multi-Output(1 mono-7 stereo, 4 mono-4 stereo, etc), instead of just Stereo and Multi-Output (8xstereo).

What I’m doing wrong? How to fix it?

Thank you

Firstly, you’re calling getMainInputChannelSet() to get the number of output channels, which is clearly not right!

Secondly, IIRC, getMainOutputChannelSet().size() will return the number of channels in that channel set which, since you specified stereo channels in the withOutput() calls, will always return 2. And since you’re only returning true for numOutput == 1 or numOutput == 8, your isBusesLayoutSupported() method is always returning false - so I’d guess Logic is assuming that’s wrong and so gives a set of common options for channel layouts instead?

I haven’t tested anything but I’d guess you instead want to have:

const auto numOutput = layouts.outputBuses.size();

to get the number of buses, not the number of channels inside the main bus.

1 Like

Now it works. Thank you!