From: Certain MIDI velocity values get decremented by 1 when read into VST3
If you send out a midi note with iPlug2 VST3 and read it back in with iPlug2 VST3 certain velocity values get decremented by 1. These are a set of values to test with…
9, 13, 18, 26, 36, 52
they arrive as…
8, 12, 17, 25, 35, 51
I was discussing this with the guys at Blue Cat Audio and they pointed me to this line (84) of code in IPlugVST3_ProcessorBase.cpp:
From: Certain MIDI velocity values get decremented by 1 when read into VST3
If you send out a midi note with iPlug2 VST3 and read it back in with iPlug2 VST3 certain velocity values get decremented by 1. These are a set of values to test with… 9, 13, 18, 26, 36, 52 they arrive as… 8, 12, 17, 25, 35, 51
I was discussing this with the guys at Blue Cat Audio and they pointed me to this line (84) of code in IPlugVST3_ProcessorBase.cpp:
msg.MakeNoteOnMsg(event.noteOn.pitch, event.noteOn.velocity * 127, event.sampleOffset, event.noteOn.channel);
Rounding up of the velocity is needed. This works for me:
msg.MakeNoteOnMsg(event.noteOn.pitch, (int)(event.noteOn.velocity * 127.0 + 0.5), event.sampleOffset, event.noteOn.channel);