how to send midi events in a VSTplugin

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

hi, is there any tutorial available? couldn´t find any in the VST SDK doc save for a sendMidiEvents declaration ...
trying to implement a pitch to midi plugin, sending CC (pitchbend) data. thank you...

pablo.

Post

I hope that I did understand your request correctly...
yesno wrote:hi, is there any tutorial available? couldn´t find any in the VST SDK doc save for a sendMidiEvents declaration ...
trying to implement a pitch to midi plugin, sending CC (pitchbend) data.
Just the same as with receiving MIDI from the host. Here's an example for exactly 1 Pitch Bend message...

Code: Select all

VstMidiEvent mEv =                /* the one MIDI event            */
  {
  kVstMidiType,                   /* event type                    */
  (sizeof(mEv) - 2*sizeof(long)), /* byte size                     */
  lDelta,                         /* delta frames                  */
  0,                              /* flags                         */
                                  /* rest is zero anyway           */
  };
VstEvents ev =                    /* the event list                */
  {
  1, 0, { (VstEvent *)&mEv, NULL }
  };
mEv.midiData[0] = 0xE0;
mEv.midiData[1] = 0x00;
mEv.midiData[2] = 0x40;
sendVstEventsToHost(&ev);         /* blow out the event            */
You can replace lDelta with 0 if you don't know/don't care for the delta. Or remove the line and the next one, since all following structure elements are set to 0 anyway.

To get the host to use the MIDI data correctly is a totally different thing, however...
"Until you spread your wings, you'll have no idea how far you can walk." Image

Post

thanks... i forgot i could also use mme (with much better documentation).

Post Reply

Return to “DSP and Plugin Development”