I found out that some VSTi’s (for instance JunoX2 from ReFX) report that they don’t want MIDI messages, so:
dispatch (effCanDo, 0, 0, (void*) “receiveVstMidiEvent”, 0) = 0.
The problem is that this will cause the VSTPluginInstance to crash because the variable midiMessages will be 0 and the code will try to read from.
So, I think it would be better to call ensureMidiEventSize() with a small number if wantsMidiMessages was false. Other possibility is to check from the PluginDescription if it is an instrument and to OR that with the result from the “receiveVstMidiEvent” dispatch.
Further, the lines: case audioMasterWantMidi:
wantsMidiMessages = true;
break;
must be rewritten to:case audioMasterWantMidi:
wantsMidiMessages = true;
ensureMidiEventSize (256);
break;
Otherwise same problem with 0-pointer.