Generating MIDI messages within a VST plugin and passing them to the host

In the cases above, I was only adding a Juce controller message to the buffer, not a LegacyMIDICCOutEvent. I’m not going to experiment with that until Reaper releases their update and I can confirm that Steinberg’s testing VST3 works within it.

When you add a CC to the buffer inside VST3, it doesn’t make it out to the host, EXCEPT if and only if JUCE is copying it from there to the LegacyCC out feature. VST3 does not add CC’s to that buffer, nor look for them after callback. That is the VST2 way.

Juce is attempting to give you the same JUCE api of seeing both midi and cc in that midi buffer, but unless JUCE moves those to the VST3 way of getting them, then NO host will get them.

So fundamentally JUCE has to use legacy feature to get those CC events out…and not all DAW’s will support that legacyCC feature.

You don’t add a LegacyMIDICCOutEvent anywhere.

You modify the JUCE Audio Plugin Host code to process LegacyMIDICCOutEvents as I explained in that other thread. Then, when you insert controller messages into a JUCE buffer, they come out of the VST3 plugin.

But as has been explained, this only fixes it in the JUCE PluginHost and not in any DAWs that are out there, so it’s really just an exercise for the curious at this point.

But as has been explained, this only fixes it in the JUCE PluginHost and not in any DAWs that are out there, so it’s really just an exercise for the curious at this point.

As well as a way to verify that JUCE is actually doing what its supposed to be doing in terms of moving or copying CC’s from the midi buffer to the legacyMIDICCOUT queue. Once we know for sure JUCE is handling that, then we can blame everything after that on the various DAW’s

I am still not clear, some here said things work when there are notes added to the buffer, but not until then. So either that is JUCE not moving/copying the CC’s from the midi buffer to the legacy Cue, unless there is at least some notes added…or something is strange about that report. So… Fix AudioPluginHost to work as all hosts are supposed to work with legacyCC, then we can see for ourselves whether JUCE is to blame for any of the problems people are having or not.

Hi,

I’m trying to make a plugin that generates and sends MIDI note messages and MIDI CCs to control a piece of hardware, much the same as @1gn4ci0. I understand that MIDI messages are generated/sent out of the plugin by copying the buffer received from the host, modifying the copy and passing it to the host which passes to the MIDI device. After a while of searching google and finding this post, I was made aware that VST3 don’t play well with MIDI CCs. @1gn4ci0 is there any reason why you aren’t creating a standard VST instead of VST3? I’ve been trying to figure out how to make a very simple plugin creates and outputs MIDI CCs for a while and I feel like that there should be a simple way of doing this. I’ve scoured the JUCE tutorials and I cannot find a straightforward way of simply creating MIDI CCs and sending them to a MIDI device. All I need is to output the values of a few sliders and buttons as MIDI messages but it seems near impossible to find any info on how to actually implement this. I’m hoping you’ve got an idea.

Thanks for any help in advance!

The reason many people aren’t making a VST2 is that, unless you already have a license for VST2 from Steinberg, you no longer can get one and are not legally allowed to release a VST2. If you are making this plugin for your own use only, then by all means you can make a VST2, and have easily usable MIDI - unlike VST3. Just enable JUCE_PLUGINHOST_VST in the Projucer juce_audio_processors module settings.

2 Likes

Hi - someone has indicated to me that it’s possible to share the MIDI ports opened by a host directly, but I’m not aware of this… Is this possible?

I have had limited success with sending MIDI messages directly to an output port from a VST3. I was experimenting with sending out CC messages when an AudioProcessorParameter was changed. In the parameterValueChanged() function in the processor, I included the following code:

auto deviceIdentifier{ MidiOutput::getAvailableDevices()[1].identifier };
midiOutput = MidiOutput::openDevice(deviceIdentifier);
if (midiOutput != nullptr)
    midiOutput->sendBlockOfMessagesNow(pluginMidiBuf);

I did manage to send CC messages out, but the plugin was unstable. In fact, if I remember correctly, the plugin would only work when I was in debug mode in VisualStudio and attached to the host process (Reaper). Long story short: it is indeed possible to directly access MIDI ports from a VST3, but there are a bunch of obscure issues related to it and I have neither the skill nor the motivation to work them out.

I hit upon a way to output CC messages from a VST3 which doesn’t require LegacyMidiCCOutEvent. Detailed here.

2 Likes