This project has moved and is read-only. For the latest updates, please go here.

Midi events being ignored by the host

Topics: Host Processing, Midi
May 2, 2012 at 3:35 AM
Edited May 2, 2012 at 3:44 AM


I'm working on a midi plugin that does some mapping and generating. I recently noticed that some events I send to the host are being ignored. I tried bypassing all of my mapping and generating code but I'm still getting the problem. This is basically all my implementation of IVstMidiProcessor and IVstPluginMidiSource does:

public void Process(VstEventCollection vstEvents)
    foreach (VstEvent evnt in vstEvents)

public void OnAudioProcessingCycleEnd()
    IVstMidiProcessor midiHost = this.vstHost.GetInstance<IVstMidiProcessor>();

I tested this by looping a midi clip, running it through my plugin and recording the output.
When the input clip looks like this:
I get the expected output:

However if there is some variation in the input clip and it looks like this:

Then the output misses a lot of the events being passed through my plugin:

I tested this with a tempo of 200 BPM but if I slow it down to something like 20 BPM then host seems to be getting all of the events:

Any idea what could be causing this?
May 3, 2012 at 9:16 AM

That is an odd problem!? Never heard that before.

Are you 100% sure your queue/list contains the actual midi events? Are there no multi-threading locking or race condition issues? Note that the host will call your plugin on separate threads.

A second option I can think of is to not output the midi during Audio Processing time, but straight in the MidiProcessor.Process method. 

Also have you tried different hosts? And did they all respond the same (if so, probably a bug in your code ;-)

Hope it helps,

May 9, 2012 at 7:33 PM

Thanks for all the suggestions. Somehow I didn't think to try this with a different midi plugin until now. I just tried it with one that doesn't use VST.NET and I get the same issue so I guess it must be an issue with the Host. I've been testing things in Abelton Live so I just assumed that wasn't the issue. Maybe I need to upgrade from version 6 to 8.....I've been trying to hold out for BitWig though.