# Recommended way to set up a multichannel plugin

**URL:** <https://forum.juce.com/t/recommended-way-to-set-up-a-multichannel-plugin/28302>\
**Category:** Audio Plugins\
**Created:** [June 28, 2018, 2:21pm UTC](https://forum.juce.com/t/recommended-way-to-set-up-a-multichannel-plugin/28302 "2018-06-28T14:21:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [June 28, 2018, 2:21pm UTC](https://forum.juce.com/t/recommended-way-to-set-up-a-multichannel-plugin/28302/1 "2018-06-28T14:21:54Z")

</div>

I’m in the process of porting an audio app that supports up to 4 inputs and outputs to a VST plugin.

Setting `JucePlugin_PreferredChannelConfigurations` to {4,4} works in the Plugin Host, but not Ableton. So I think I need to set the extra inputs/outputs as sidechain/aux channels.

I’m currently dealing with a crash when loading the plugin in Ableton but would like to know if the following set up is a good workaround to allow a user to route multiple audio channels into the plugin:

```auto
    static BusesProperties getBusesProperties()
    {
        BusesProperties buses;
        buses.addBus (false, "Stereo Output", AudioChannelSet::stereo());
        buses.addBus (false, "Mono Output", AudioChannelSet::mono());
        buses.addBus (false, "Output 1", AudioChannelSet::mono(), false);
        buses.addBus (false, "Output 2", AudioChannelSet::mono(), false);
        buses.addBus (false, "Output 3", AudioChannelSet::mono(), false);
        buses.addBus (false, "Output 4", AudioChannelSet::mono(), false);

        buses.addBus (true, "Stereo Input", AudioChannelSet::stereo());
        buses.addBus (true, "Mono Input", AudioChannelSet::mono());
        buses.addBus (true, "Input 1", AudioChannelSet::mono(), false);
        buses.addBus (true, "Input 2", AudioChannelSet::mono(), false);
        buses.addBus (true, "Input 3", AudioChannelSet::mono(), false);
        buses.addBus (true, "Input 4", AudioChannelSet::mono(), false);

        return buses;
    }

```

Any recommendations for how to set this up? The most important host to support is Ableton Live at the moment.

---

<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:** [June 28, 2018, 3:20pm UTC](https://forum.juce.com/t/recommended-way-to-set-up-a-multichannel-plugin/28302/2 "2018-06-28T15:20:24Z")

</div>

The above code would add a total number of 7 (=2+1+1+1+1+1) input and 7 output channels. Is this really what you want?

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [June 28, 2018, 3:22pm UTC](https://forum.juce.com/t/recommended-way-to-set-up-a-multichannel-plugin/28302/3 "2018-06-28T15:22:40Z")

</div>

No, I just want 4 channels, but I want to be able to route more than 2 channels in and out of the plugin in Ableton.

---

<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:** [June 28, 2018, 3:48pm UTC](https://forum.juce.com/t/recommended-way-to-set-up-a-multichannel-plugin/28302/4 "2018-06-28T15:48:13Z")

</div>

In the above code you are creating 6 buses each with a certain amount of channels. All those channels add up. What you really want is just one input and one output bus with 4 channels each. You would only add more than one bus when you need a sidechain or an aux bus.

In your case, the following would work:

```
class MyAudioProcessor : public AudioProcessor
{
public:
     MyAudioProcessor () 
         : AudioProcessor (BusesProperties().withInput ("Input", AudioChannelSet::discreteChannels (4), true)
                                            .withOutput ("Output", AudioChannelSet::discrete (4), true))
     {}

     .
     .
     .
     bool isBusesLayoutSupported (const BusesLayout& layouts) const override
     {
           auto numIns = layouts.getMainInputChannels();
           auto numOuts = layouts.getMainOutputChannels();

           // allow any configuration where there are at least 2 channels
           // and the number of inputs equals the number of outputs
           return (numIns >= 2 && numIns == numOuts);
     }
};

```

The above code assumes that you always want the same number of input and output channels and that the number of channels is between 2 and 4.

You should probably also read through this tutorial:

[https://docs.juce.com/master/tutorial\_audio\_bus\_layouts.html](https://docs.juce.com/master/tutorial_audio_bus_layouts.html)

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [June 28, 2018, 3:53pm UTC](https://forum.juce.com/t/recommended-way-to-set-up-a-multichannel-plugin/28302/5 "2018-06-28T15:53:16Z")

</div>

Thanks Fabian I wasn’t aware of that tutorial, I was looking in the forum for info.

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [June 29, 2018, 9:42am UTC](https://forum.juce.com/t/recommended-way-to-set-up-a-multichannel-plugin/28302/6 "2018-06-29T09:42:59Z")

</div>

OK so this is kind of working, however when attempting to route audio in from another track, the channels are only available in stereo pairs. I guess this is because Ableton does not support mono audio tracks, so any audio routed from a given channel will always be in stereo. So I guess (at least in Ableton) I’ll need to expect 8 input channels and then reduce them to 4 mono channels within the plugin.

**UPDATE:** That worked 🕶

The AU plugin fails to load with this configuration:

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

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [July 11, 2018, 2:48pm UTC](https://forum.juce.com/t/recommended-way-to-set-up-a-multichannel-plugin/28302/7 "2018-07-11T14:48:58Z")

</div>

For future reference and for anyone else who might be looking, I figured out what I needed for a 4 mono channel in/out setup:

```auto
        : AudioProcessor (BusesProperties().withInput ("Mono In 1", AudioChannelSet::mono(), true)
                                           .withInput ("Mono In 2", AudioChannelSet::mono(), true)
                                           .withInput ("Mono In 3", AudioChannelSet::mono(), true)
                                           .withInput ("Mono In 4", AudioChannelSet::mono(), true)
                                           .withOutput ("Mono Out 1", AudioChannelSet::mono(), true)
                                           .withOutput ("Mono Out 2", AudioChannelSet::mono(), true)
                                           .withOutput ("Mono Out 3", AudioChannelSet::mono(), true)
                                           .withOutput ("Mono Out 4", AudioChannelSet::mono(), true))

```

This also works for the AudioUnit version!

---

<div class="post-metadata">

**Author:** ![brettbuddin](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/brettbuddin/32/6225_2.png) [@brettbuddin](https://forum.juce.com/u/brettbuddin)\
**Post date:** [August 18, 2020, 12:47pm UTC](https://forum.juce.com/t/recommended-way-to-set-up-a-multichannel-plugin/28302/8 "2020-08-18T12:47:07Z")

</div>

@adamski I’ve had to do something similar to get bot the VST3 and AU versions to load in Ableton, but I’ve grouped them into 2 stereo in and 2 stereo out buses. One problem though, Ableton is assuming the 3/4 input channels are for sidechaining? Any ideas on how to get it not to do that, or is that out of my hands?

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [August 18, 2020, 2:35pm UTC](https://forum.juce.com/t/recommended-way-to-set-up-a-multichannel-plugin/28302/9 "2020-08-18T14:35:32Z")

</div>

I don’t remember having that issue, but its been a while since I worked on that project.
