Ok, I have had a little look/hack over a coffee this morning, first the good news, I got a plugin limited to 32 channels, unfortunately with a mix of mono and stereo, more on that later. I based this on what NI battery is doing.
And now the insanity:
To get Logic to act like this we need:
- single default stereo output;
return BusesProperties()
.withOutput ("Output #1", juce::AudioChannelSet::stereo(), true);
- isBusesLayoutSupported() supporting (0, -32):
const auto numInputs = layouts.getMainInputChannelSet().size();
const auto numOutputs = layouts.getMainOutputChannelSet().size();
return (numInputs == 0) && (numOutputs <= 32);
- SupportedNumChannels() in the juce_au_wrapper supporting one channel layout (0, -32)
UInt32 SupportedNumChannels (const AUChannelInfo** outInfo) override
{
if (outInfo != nullptr)
{
AUChannelInfo *pChannelInfo = new AUChannelInfo();
pChannelInfo->inChannels = 0;
pChannelInfo->outChannels = -32;
*outInfo = pChannelInfo;
}
return(1);
}
Now when the plugin is instantiated with one of the multichannel formats in Logic it creates multiple stereo buses:
20:02 08:41:36.187654 <Info > PluginProcessor.cpp [01263] (5838)(0x102b1e5c0) SUCESS canApplyBusCountChange(OUT, Adding) [Output #1, Stereo, Activated] = 2676169413
0x109deaa00 CACHED_IN = 0, CACHED_OUT = 4
20:02 08:41:40.831633 <Info > PluginProcessor.cpp [01263] (5838)(0x102b1e5c0) SUCESS canApplyBusCountChange(OUT, Adding) [Output #2, Stereo, Activated] = 2676169413
0x109deaa00 CACHED_IN = 0, CACHED_OUT = 6
20:02 08:41:40.831771 <Info > PluginProcessor.cpp [01263] (5838)(0x102b1e5c0) SUCESS canApplyBusCountChange(OUT, Adding) [Output #3, Stereo, Activated] = 2676169413
0x109deaa00 CACHED_IN = 0, CACHED_OUT = 8
20:02 08:41:40.831823 <Info > PluginProcessor.cpp [01263] (5838)(0x102b1e5c0) SUCESS canApplyBusCountChange(OUT, Adding) [Output #4, Stereo, Activated] = 2676169413
0x109deaa00 CACHED_IN = 0, CACHED_OUT = 10
20:02 08:41:40.831865 <Info > PluginProcessor.cpp [01263] (5838)(0x102b1e5c0) SUCESS canApplyBusCountChange(OUT, Adding) [Output #5, Stereo, Activated] = 2676169413
0x109deaa00 CACHED_IN = 0, CACHED_OUT = 12
20:02 08:41:40.831912 <Info > PluginProcessor.cpp [01263] (5838)(0x102b1e5c0) SUCESS canApplyBusCountChange(OUT, Adding) [Output #6, Stereo, Activated] = 2676169413
0x109deaa00 CACHED_IN = 0, CACHED_OUT = 14
20:02 08:41:40.831951 <Info > PluginProcessor.cpp [01263] (5838)(0x102b1e5c0) SUCESS canApplyBusCountChange(OUT, Adding) [Output #7, Stereo, Activated] = 2676169413
0x109deaa00 CACHED_IN = 0, CACHED_OUT = 16
20:02 08:41:40.832220 <Info > PluginProcessor.cpp [01263] (5838)(0x102b1e5c0) SUCESS canApplyBusCountChange(OUT, Adding) [Output #8, Stereo, Activated] = 2676169413
0x109deaa00 CACHED_IN = 0, CACHED_OUT = 18
20:02 08:41:40.832273 <Info > PluginProcessor.cpp [01263] (5838)(0x102b1e5c0) SUCESS canApplyBusCountChange(OUT, Adding) [Output #9, Stereo, Activated] = 2676169413
0x109deaa00 CACHED_IN = 0, CACHED_OUT = 20
20:02 08:41:40.832319 <Info > PluginProcessor.cpp [01263] (5838)(0x102b1e5c0) SUCESS canApplyBusCountChange(OUT, Adding) [Output #10, Stereo, Activated] = 2676169413
0x109deaa00 CACHED_IN = 0, CACHED_OUT = 22
20:02 08:41:40.832359 <Info > PluginProcessor.cpp [01263] (5838)(0x102b1e5c0) SUCESS canApplyBusCountChange(OUT, Adding) [Output #11, Stereo, Activated] = 2676169413
0x109deaa00 CACHED_IN = 0, CACHED_OUT = 24
20:02 08:41:40.832403 <Info > PluginProcessor.cpp [01263] (5838)(0x102b1e5c0) SUCESS canApplyBusCountChange(OUT, Adding) [Output #12, Stereo, Activated] = 2676169413
0x109deaa00 CACHED_IN = 0, CACHED_OUT = 26
20:02 08:41:40.832489 <Info > PluginProcessor.cpp [01263] (5838)(0x102b1e5c0) SUCESS canApplyBusCountChange(OUT, Adding) [Output #13, Stereo, Activated] = 2676169413
0x109deaa00 CACHED_IN = 0, CACHED_OUT = 28
20:02 08:41:40.832537 <Info > PluginProcessor.cpp [01263] (5838)(0x102b1e5c0) SUCESS canApplyBusCountChange(OUT, Adding) [Output #14, Stereo, Activated] = 2676169413
0x109deaa00 CACHED_IN = 0, CACHED_OUT = 30
20:02 08:41:40.832584 <Info > PluginProcessor.cpp [01263] (5838)(0x102b1e5c0) SUCESS canApplyBusCountChange(OUT, Adding) [Output #15, Stereo, Activated] = 2676169413
0x109deaa00 CACHED_IN = 0, CACHED_OUT = 32
So from this using a single (0,-32) channel map, Logic definitely seems to be using isBusesLayoutSupported() to determine the total number of channels across all buses, it then creates multiple stereo buses to create the required number of channels. If you set isBusesLayoutSupported to only support 2 channels auval throws a wobbly.
A side effect of all this is that mono channels are also used (-1).
I will have a play with what happens with lists of channel maps in a bitā¦