Hello guys,
I’m working on a multichannel audio effect plugin and I observed that VST2 always uses the plugin’s default buses layout. Additionally isBusesLayoutSupported() never gets called when the plugin has least 2 input buses.
You can reproduce this with the following steps (I tested on Windows 10 with JUCE 6.0.3 and Reaper 6.14):
-
Create a new plugin in Projucer.
-
Add 3 buses in PluginProcessor’s constructor by creating the BusesProperties by
BusesProperties() .withInput("Input", AudioChannelSet::stereo(), true) .withInput("SideChain", AudioChannelSet::stereo(), true) .withOutput("Output", AudioChannelSet::stereo(), true);
-
Load the VST2 plugin on a track in Reaper.
-
Show the used AudioChannelSets on gui by adding the following code to PluginEditor’s paint method:
const auto* mainInputBus = audioProcessor.getBus(true, 0);
const auto* mainOutputBus = audioProcessor.getBus(false, 0);
const auto* sideChainBus = audioProcessor.getBus(true, 1);auto mainInputBusAudioChannelSet = AudioChannelSet{}; auto sideChainBusAudioChannelSet = AudioChannelSet{}; auto mainOutputBusAudioChannelSet = AudioChannelSet{}; auto mainInputBusInfo = String{}; auto mainOutputBusInfo = String{}; auto sideChainBusInfo = String("No sidechain"); if (mainInputBus && mainOutputBus) { mainInputBusAudioChannelSet = audioProcessor.getBusesLayout().getMainInputChannelSet(); mainOutputBusAudioChannelSet = audioProcessor.getBusesLayout().getMainOutputChannelSet(); mainInputBusInfo = "MainInputBus = " + mainInputBusAudioChannelSet.getDescription(); mainOutputBusInfo = "MainOutputBus = " + mainOutputBusAudioChannelSet.getDescription(); } if (sideChainBus) { sideChainBusAudioChannelSet = audioProcessor.getBusesLayout().getChannelSet(true, 1); sideChainBusInfo = "SideChainBus = " + sideChainBusAudioChannelSet.getDescription(); } juce::Font font(15.f); g.setFont(font); auto x = 5; auto y = 5; g.drawFittedText(mainInputBusInfo, x, y, font.getStringWidth(mainInputBusInfo), fontHeight, Justification::left, false); y += roundToInt(1.1 * fontHeight); g.drawFittedText(sideChainBusInfo, x, y, font.getStringWidth(sideChainBusInfo), fontHeight, Justification::left, false); y += roundToInt(1.1 * fontHeight); g.drawFittedText(mainOutputBusInfo, x, y, font.getStringWidth(mainOutputBusInfo), fontHeight, Justification::left, false);
-
As expected the gui shows the AudioChannelSets of main input / output and sidechain buses configured as “stereo”.
-
Now change the number of track channels (e.g. from 2 to 4 or to 6) in Reaper’s track routing dialog “Route”.
-
The gui shows the AudioChannelSets of main input / output and sidechain configured as “stereo” - but it should be “1st Order Ambisonics” resp. “5.1 Surround” or something like that.
-
Also the number of channels of the delivered audio buffer in processBlock() has 4 channels (2 main input / output channels + 2 sidechain input channels) instead of 8 resp. 12 channels.
-
Furthermore, the PluginProcessor’s method isBusesLayoutSupported() never gets called.
-
It is also astonishing that after removing the SideChain bus the method isBusesLayoutSupported() is called, but it always returns false when using the default JUCE code.
After changing the number of track channels in Reaper I would expect the methods AudioProcessor::setBusesLayout() resp. AudioProcessor::audioIOChanged() to be called (that’s what VST3 does). But this does not happen in VST2.
Am I doing something wrong?
Thank you in advance.