Bus layout for 2 stereo outs?


#1

I’m trying to add a second output to my plugin and not really sure what to do. it only shows up as one stereo out. I want it to be stereo or dual stereo.

I currently have:

RGAudioProcessor::D3AudioProcessor()
   : AudioProcessor (BusesProperties().withOutput ("Main Output", AudioChannelSet::stereo(), true)
                                      .withOutput ("Direct Output", AudioChannelSet::stereo(), true))
{}

and

bool RGAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const
{
    // must be stereo out
    if (layouts.getMainOutputChannelSet() != AudioChannelSet::stereo())
        return false;

    // must be no inputs
    if(layouts.getMainInputChannelSet() != AudioChannelSet::disabled() )
        return false;
    
    return true;
}

I probably need to change isBusesLayoutSupported(), but to what?


[plugin] Send a copy of audio to a bus in host
#2

Anyone?


#3

Maybe you have to set it to be a generator or a synth, depending on which wrapper and which host you are using.

Apart from that I would have expected this to work.

Last times I tried to use multibus features, I learned, that there is a lot of “theroetically yes, but…”. See e.g. this answer (my problem was multiple input buses, so you might have more luck, fingers crossed):


#4

Yes, it’s set to be a synth. The other bus shows up in Plugin Host, but not Logic/Mainstage.


#5

Seems to be a host issue then, sorry to hear that. Maybe somebody else has ideas how to convince Logic and Mainstage… Good luck!


#6

I took a look at the MultiOutSynth example and that’s pretty simple, but when I run auval on the plugin, I see this:

Source AU supports multi-channel output but does not provide a channel layout

PluginHost shows my plugin correctly and each bus as stereo pairs. This is making me crazy…


#7

I’ve got Plugin Host showing 2 stereo outs but MainStage shows 2 options: Stereo and MultiChannel (16 x stereo). But what I want and what I’m expecting to see is Stereo and MultiChannel (2 x stereo).

I’ve looked and I can’t seem to find any documentation as to what configurations Logic/Mainstage support, but I do see a few plugins in my stash that DO show MultiChannel (2 x stereo).

No matter what I do, MainStage always shows 16 x stereo, so it must be supported, but somehow I’m not configuring my plugin correctly.

@fabian ?

This is what I have now:

RGAudioProcessor::D3AudioProcessor()
   : AudioProcessor (BusesProperties().withOutput ("Main Output", AudioChannelSet::stereo(), true)
                                      .withOutput ("Direct Output", AudioChannelSet::stereo(), false))
{}

bool canAddBus(bool isInput) const override
{
    return (!isInput && getBusCount(false) < 2);
}
bool canRemoveBus(bool isInput) const override
{
    return (!isInput && getBusCount(false) > 1);
}

bool isBusesLayoutSupported (const BusesLayout& layouts) const override
{
    if(layouts.getMainInputChannels() != 0)
        return false;
    if(layouts.getMainOutputChannels() != 2)
        return false;
    if(layouts.outputBuses.size() > 2)
        return false;
    if(layouts.getNumChannels(false, 1) != 2)
        return false;
    
    return true;
}

What am I missing?


#8

Your code looks good to me. However, for some reason, Logic will only show the 2 x stereo option if you do not allow it to change the bus count. This means the last argument in the .withOutput calls in the constructor must both be true and your canAddBus and canRemoveBus must both return false.

Let me know if this works for you.


#9

Yes, that worked!

I’d be lying if I said I understood why.

Thank you.


#10

It’s strange because auval does show everything correctly without my suggested changes. It just seems that Logic seems extremely picky when it comes to multiple buses.


#11

Well, I spoke too soon.

Using your suggestions, in does in fact, show my 2 desired configurations (Stereo & 2xStereo) in MainStage, but now Plugin Host only shows 1 stereo out and nothing else. Opening Configure I/O gives me no other options.

This feels like voodoo. Any thoughts @fabian?


#12

Really? I just tried this and it’s coming up with two bus outputs:

I took the MultiOutSynth example, removed the extra buses (3-16), set the third parameter of .withOutput to true and modified canAddBus/canRemoveBus ``to return false.


#13

Okay, now I’ve got it going in both MainStage and Plugin Host, but there’s another issue with a standalone app…

It seems that having 2 stereo outs, it fails this assert in AudioProcessor::setPlayConfigDetails()

success &= disableNonMainBuses();
jassert (success);

I thought about checking the wrapperType but it hasn’t been set when the constructor of my plugin has been called. Maybe some kind of compile-time check?


#14

Try allowing the disabled layout on the second bus.

bool isBusesLayoutSupported (const BusesLayout& layouts) const override
{
     if(layouts.getMainInputChannels() != 0)
         return false;
    if(layouts.getMainOutputChannels() != 2)
        return false;
    if(layouts.outputBuses.size() > 2)
         return false;
     if(layouts.getNumChannels(false, 1) != 2 && layouts.getNumChannels(false, 1) != 0)
         return false;

     return true;
 }