I’m writing software which loads and uses AU/VST3 plugins and I have some confusion regarding AudioPluginInstance channel and and bus counts and how they can be changed.
If the plugin instance says that it allows adding more audio busses to it, how should it be done in practise? Below is my test code which gave me really weird results: (see code comments for what the return values are)
juce::AudioPluginInstance* p_plugin = ....; // Native Instruments Battery AU plugin is loaded here
const bool can_add_bus = p_plugin->canAddBus(false); // Returns TRUE
const int bus_count_1 = p_plugin->getBusCount(false); // Returns 1
const int temp1a = p_plugin->getTotalNumOutputChannels(); // Returns 2
const int temp1b = p_plugin->getMainBusNumOutputChannels(); // Returns 2
p_plugin->addBus(false);
p_plugin->addBus(false);
p_plugin->enableAllBuses();
const int bus_count_2 = p_plugin->getBusCount(false); // Returns 1 !!!!!!!!
const int temp2a = p_plugin->getTotalNumOutputChannels(); // Returns 2 !!!!!!!!
const int temp2b = p_plugin->getMainBusNumOutputChannels(); // Returns 2
As you can see, the bus/channel count didn’t change even when I tried adding two more output busses to the plugin. What am I doing wrong here?
To make matters weirder, This plugin seems to always already have 4 busses inside its own menu, regardless of how many busses I may add to it in my code:
On top of that, the plugin has some extra “Direct Outs”. A lot of them. How do I access those through my code? I’m confused what to think of this.
Any points to make this situation less confusing is appreciated.



