Excellent,
VST3 is one of the cleaner plugin APIs. But the main frustration I’ve experienced with it is having to use hundreds of dummy parameters to implement a MIDI instrument that supports all the continuous controllers.
I do support the concept of having the DAW able to map MIDI controllers to the plugin parameters, but this mechanism becomes unwieldy when you need to support all MIDI channels and all MIDI continuous controllers (that’s 129 * 16 dummy parameters).
To assess the feasibility of this proposal I implemented it.
It took 1 hour of time to add MIDI 2.0 support to both a plugin and a host.
Here it is in action. At the top is the VST3 plugins editor showing a keyboard responding to the events, and a scope showing the synth producing sound, at the bottom is the DAW feeding some MIDI 2.0 data into the plugin.
I added to the DAW the following code:
#define VST3_USE_MIDI_EXTENSION 1
#include "ivstmidi2extension.h"
void ProcessorWrapper::onMidi2Message(const midi::message_view msg, int timeDelta)
{
Steinberg::Vst::Event m = {};
#if VST3_USE_MIDI_EXTENSION
m.type = vst3_ext_midi::UMPEvent::kType;
auto& midi2event = *reinterpret_cast<vst3_ext_midi::UMPEvent*>(&m.noteOn);
memcpy(&midi2event.words, msg.begin(), msg.size());
#else // convert to VST3 note events...
I added to the plugin an additional case in the event handing ‘switch’ statement…
tresult PLUGIN_API SeProcessor::process (ProcessData& data)
{
const int32 numEvents = data.inputEvents ? data.inputEvents->getEventCount() : 0;
for (int32 eventIndex = 0; eventIndex < numEvents ; ++eventIndex)
{
switch (e.type)
{
case vst3_ext_midi::UMPEvent::kType:
{
auto& midi2event = *reinterpret_cast<vst3_ext_midi::UMPEvent*>(&e.noteOn);
const auto midi2data = reinterpret_cast<const unsigned char*>(&midi2event.words);
const int midi2size = 8; // asumming common 8-byte MIDI 2.0 message for now
synthEditProject.MidiIn(e.sampleOffset, midi2data, midi2size);
}
break;
case Event::kNoteOnEvent:
{
I hope this information is helpful to assess the feasibility if this proposal.