# Bus layout for 2 stereo outs?

**URL:** <https://forum.juce.com/t/bus-layout-for-2-stereo-outs/23323>\
**Category:** Audio Plugins\
**Created:** [July 14, 2017, 3:25pm UTC](https://forum.juce.com/t/bus-layout-for-2-stereo-outs/23323 "2017-07-14T15:25:18Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![pizzafilms](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pizzafilms/32/562_2.png) [@pizzafilms](https://forum.juce.com/u/pizzafilms)\
**Post date:** [July 14, 2017, 3:25pm UTC](https://forum.juce.com/t/bus-layout-for-2-stereo-outs/23323/1 "2017-07-14T15:25:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pizzafilms](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pizzafilms/32/562_2.png) [@pizzafilms](https://forum.juce.com/u/pizzafilms)\
**Post date:** [July 15, 2017, 4:29pm UTC](https://forum.juce.com/t/bus-layout-for-2-stereo-outs/23323/2 "2017-07-15T16:29:52Z")

</div>

Anyone?

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [July 15, 2017, 4:46pm UTC](https://forum.juce.com/t/bus-layout-for-2-stereo-outs/23323/3 "2017-07-15T16:46:27Z")

</div>

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):

> [@Multi-Input Multibus](https://forum.juce.com/t/multi-input-multibus/22645/3):
>
> Hi @daniel, JUCE does support this but I don’t think you will have any luck with any of the major DAWs. I know that Logic Pro only supports max one sidechain bus. The same is with ProTools and Cubase. I think the only host that supports 32 input buses is Reaper and JUCE’s audio plugin host frowning. Also, you don’t need to list all 32 input buses in your constructor. You can also do something like this: class MyAudioProcessor { MyAudioProcessor() : AudioProcessor (getBusesPro…

---

<div class="post-metadata">

**Author:** ![pizzafilms](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pizzafilms/32/562_2.png) [@pizzafilms](https://forum.juce.com/u/pizzafilms)\
**Post date:** [July 15, 2017, 4:48pm UTC](https://forum.juce.com/t/bus-layout-for-2-stereo-outs/23323/4 "2017-07-15T16:48:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [July 15, 2017, 4:51pm UTC](https://forum.juce.com/t/bus-layout-for-2-stereo-outs/23323/5 "2017-07-15T16:51:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pizzafilms](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pizzafilms/32/562_2.png) [@pizzafilms](https://forum.juce.com/u/pizzafilms)\
**Post date:** [July 15, 2017, 7:24pm UTC](https://forum.juce.com/t/bus-layout-for-2-stereo-outs/23323/6 "2017-07-15T19:24:47Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![pizzafilms](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pizzafilms/32/562_2.png) [@pizzafilms](https://forum.juce.com/u/pizzafilms)\
**Post date:** [July 16, 2017, 11:16pm UTC](https://forum.juce.com/t/bus-layout-for-2-stereo-outs/23323/7 "2017-07-16T23:16:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [July 17, 2017, 8:45am UTC](https://forum.juce.com/t/bus-layout-for-2-stereo-outs/23323/8 "2017-07-17T08:45:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pizzafilms](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pizzafilms/32/562_2.png) [@pizzafilms](https://forum.juce.com/u/pizzafilms)\
**Post date:** [July 17, 2017, 12:42pm UTC](https://forum.juce.com/t/bus-layout-for-2-stereo-outs/23323/9 "2017-07-17T12:42:54Z")

</div>

Yes, that worked!

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

Thank you.

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [July 17, 2017, 12:55pm UTC](https://forum.juce.com/t/bus-layout-for-2-stereo-outs/23323/10 "2017-07-17T12:55:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pizzafilms](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pizzafilms/32/562_2.png) [@pizzafilms](https://forum.juce.com/u/pizzafilms)\
**Post date:** [July 18, 2017, 11:56am UTC](https://forum.juce.com/t/bus-layout-for-2-stereo-outs/23323/11 "2017-07-18T11:56:05Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [July 18, 2017, 4:54pm UTC](https://forum.juce.com/t/bus-layout-for-2-stereo-outs/23323/12 "2017-07-18T16:54:21Z")

</div>

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

![](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/4/4fc336ae39e05ccf0612c332cb8ddd6e9ad7c569.png)

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`.

---

<div class="post-metadata">

**Author:** ![pizzafilms](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pizzafilms/32/562_2.png) [@pizzafilms](https://forum.juce.com/u/pizzafilms)\
**Post date:** [July 19, 2017, 12:28pm UTC](https://forum.juce.com/t/bus-layout-for-2-stereo-outs/23323/13 "2017-07-19T12:28:39Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [July 20, 2017, 8:02am UTC](https://forum.juce.com/t/bus-layout-for-2-stereo-outs/23323/14 "2017-07-20T08:02:42Z")

</div>

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;
 }
```
