[RESOLVED] VST | Midi message Note On with velocity 0 doesn't work in Carla


I created a test audio plugin that sends a midi message 0x90 0x20 0x00 (note on, channel 0, pitch 32, velocity 0).

in the processBlock method:

juce::MidiBuffer myMessages;
juce::MidiMessage msgOut1( 0x90, 0x20,  0x00);
myMessages.addEvent(msgOut1, 0);

if i run it in standalone mode it works fine.
if I run it in carla, checking with jack_midi_dump, the message sent is 0x80 0x20 0x00 (note off, channel 0, pitch 32, velocity 0).

how can i fix it?

(I need a note on with velocity 0 to manage buttons color of the akai apc key25 controller, as explained here: https://mseprogramming.wordpress.com/2016/11/22/blog-post-title-2)


What plugin format are you building, VST2 or VST3?


VST3 doesn’t really have a concept of ‘MIDI events’. Instead, it has its own note-on and note-off events, and MIDI events inside the plugin must be converted to the corresponding VST3 events. The host may then convert these events back into MIDI if necessary.

The JUCE MIDI->VST3 event will convert a note-on with a velocity of 0 to a VST3 note-off, because for most applications (especially when using running-status) a note-on with a velocity of 0 is a note-off message.

If sending precise MIDI messages is important to your application, I’d advise using a format that can handle MIDI ‘natively’ (such as VST2, AudioUnit, or LV2 after the release of JUCE 7) instead.

Great! I compiled it in VST2 and now it works perfectly in Carla.

Thank you very much.

(if anyone needs it, this is the procedure: