VST3 & Event Bus Channel Count


I’ve been doing some exploration of the host side of JUCE’s VST3 support and have come across an issue with (at least) Arturia plugins. I’m waiting for more information from those guys, but until then… they are not setting the Event Bus BusInfo.channelCount field for their instrument plugins, leaving it at 0. The VST3 spec is, well, poorly specified:
int32 channelCount; ///< number of channels (if used then need to be recheck after \ref
/// IAudioProcessor::setBusArrangements is called).
/// For a bus of type MediaTypes::kEvent the channelCount corresponds
/// to the number of supported MIDI channels by this bus

Which reads to me as though it should be set, but it could also be interpreted to mean that it needn’t be used – and if you accept “omni” MIDI, you might assume that you don’t need to bother to set it at all – you have an Event Bus, after all, and that needs to respond to something, in this case everything, right? Anyway, I don’t know what Arturia (and potentially others) are thinking here, just puzzling about loud.

Point of information: Steinberg’s ‘validator’ and ‘hostchecker’ example unit/host tester projects DO NOT test for any value in channelCount for MIDI events (although they do test it for MIDI mapping, note expression and key switch).

In any case, this affects around 20 plugins on my system (and on client machines) and I need a fix. My current workaround is to not check the channelCount at all, as in:

bool acceptsMidi() const override { return holder->component->getBusCount (Vst::kEvent, Vst::kInput); }

which is to say, if the input event bus exists, the plugin can accept MIDI.

Thoughts, concerns, opinions, previous experience?

Thank you, Jeremy

With your change, did you observe any previously non-midi plug-ins suddenly pop up as midi plug-ins? If no, then I’m happy to put your change in.

Here are my changed implementations:

bool acceptsMidi() const override    { return holder->component->getBusCount (Vst::kEvent, Vst::kInput) ? true : false; }
bool producesMidi() const override   { return holder->component->getBusCount (Vst::kEvent, Vst::kOutput) ? true : false; }

With those in place, Arturia instruments are working properly with MIDI. One of Arturia’s developers has been in touch with me and he’s looking into it on his end, too (whether the channelCount==0 is an oversight or not), but the fact that this isn’t flagged as a problem by Steinberg suggests to me that this change could be appropriate.

Best + thanks, Jeremy