There have already been questions about bus arrangement for effect plugins and there is some good documentation about it, but we have problems figuring out how it works for instruments.
Can instruments be realized that support multiple output arrangements?
I can see two ways for the user to select the audio output arrangement:
- by routing the instrument to a bus that has the desired input configuration (upon creation of instance)
- and by selecting the configuration in the plugin GUI leaving it to the plugin to adapt the outputs.
Asking for Cubase for example. As I understand, generally, first the plugin just adds default audio inputs/outputs (https://developer.steinberg.help/display/VST/Frequently+Asked+Questions#FrequentlyAskedQuestions-Q:Myplug-iniscapableofprocessingallpossiblechannelconfigurations.) and then the host usually makes a suggestion for which arrangement to use according to the track layout etc…
For Cubase it seems, that the host does not make a suggestion for instruments (i.e. not calling
setBusArrangement()). This makes sense because instruments don’t (need to) have audio inputs. But the output configuration could be guessed like described above in (1.).
The way it is, the plugin just starts with its default configuration. Unfortunately, dynamically changing it through user interaction does not seem to work quite correctly (in Cubase at least). After calling
restartComponent(kIoChanged) from the UI thread,
AudioEffect::getBusArrangement() is called and we change the audio outputs and return the new arrangement. In the next call to
AudioEffect::process() the value of processData.outputs.numChannels has the correct value but Cubase still displays the old speaker arrangement in the channel settings.
However, the host still displays the old speaker arrangement in the “Channel Settings” window. Also, from then on, no sound is to the destination. I can verify though that the output buffers are still filled with valid audio.
Is this just a Cubase issue or are we missing something here? Are there known cases of VST instruments with variable output configuration?