Multibus and Speaker Arrangement

OK I now understand the origin of this problem: it occurs if the VST2 plug-in sets VST2’s kVstPinIsStereo flag on every other output pin but does not supply any arrangement information.

In old JUCE versions this would happen if you override AudioProcessor::isInputChannelStereoPair (int index) to always return true.

The way that JUCE handles this situation kind of makes sense: if every other output is marked as stereo then the plug-in must have multiple stereo outputs - hence the several stereo output buses that you are seeing!

The confusion comes on how to interpret surround formats. For example, the “L R”, “Ls Rs”, “C” in “L R Ls Rs C” can also be interpreted as two stereo pairs (L R), (Ls Rs) and a mono channel C - hence two stereo buses and a mono bus.

In any case, JUCE will use the correct layout if the VST2 explicitly returns a valid speakerArrangement (which all plug-ins should be doing anyway). In this case, JUCE will just use that.

Unfortunately, older JUCE versions do not return a valid speakerArrangement unless the host specifically asks for a specific layout.

I’ve now added a workaround (it will appear on develop in a few minutes) which should fix this situation: if the plug-in does not return any valid speaker arrangement, then JUCE will try to assign a default layout with the same number of channels as the plug-in reports. This will then force old JUCE plug-ins to then report the correct layout.

OK this is on develop now. Please let me know if this works for you!

Thank you very much, Fabian – I just tested with the tip of the “develop” branch and it all seems to work fine now! :slight_smile:

Can also confirm that this is much better. One down side you should be aware of (and probably fix if possible) is that now these plugins show up as mono as default in the juce host (and other hosts that don’t define the bus)
Also you can not change the bus layout I/O count it seems.
So if you change your stereo bus to 5.1 they don’t follow. Have no idea how to fix it though

Thanks for the heads up, Nikolai. That’s not much of a problem for me since it’s an audio editor where the host decides the channel format (based on the file currently loaded).