From 86be01c0f95eac419747e34037ec99591936a4c4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 24 Sep 2020 18:38:44 +0200 Subject: [PATCH] VST3: Ignore MIDI channel count for a bus Assume that simply the presence of an Event bus indicates that MIDI is supported. This fixes Arturia synths, among others. see also https://forum.juce.com/t/vst3-event-bus-channel-count/25051 --- libs/ardour/vst3_plugin.cc | 8 +++++++- libs/ardour/vst3_scan.cc | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/libs/ardour/vst3_plugin.cc b/libs/ardour/vst3_plugin.cc index e57fd22fe0..84639c8187 100644 --- a/libs/ardour/vst3_plugin.cc +++ b/libs/ardour/vst3_plugin.cc @@ -1386,11 +1386,17 @@ VST3PI::count_channels (Vst::MediaType media, Vst::BusDirection dir, Vst::BusTyp bool is_sidechain = (type == Vst::kAux) && (dir == Vst::kInput); if (media == Vst::kEvent) { - /* MIDI Channel count -> MIDI input */ +#if 0 + /* Supported MIDI Channel count (for a single MIDI input) */ if (bus.channelCount > 0) { _io_name[media][dir].push_back (Plugin::IOPortDescription (bus_name, is_sidechain)); } return std::min (1, bus.channelCount); +#else + /* Some plugin leave it at zero, even though they accept events */ + _io_name[media][dir].push_back (Plugin::IOPortDescription (bus_name, is_sidechain)); + return 1; +#endif } else { for (int32_t j = 0; j < bus.channelCount; ++j) { std::string channel_name; diff --git a/libs/ardour/vst3_scan.cc b/libs/ardour/vst3_scan.cc index 72d8beb739..72cb0dc310 100644 --- a/libs/ardour/vst3_scan.cc +++ b/libs/ardour/vst3_scan.cc @@ -61,8 +61,13 @@ count_channels (Vst::IComponent* c, Vst::MediaType media, Vst::BusDirection dir, } #endif if (media == Vst::kEvent) { - /* MIDI Channel count -> MIDI input */ +#if 0 + /* Supported MIDI Channel count (for a single MIDI input) */ return std::min (1, bus.channelCount); +#else + /* Some plugin leave it at zero, even though they accept events */ + return 1; +#endif } else { n_channels += bus.channelCount; }