Midi events being ignored by the host

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

Hi,

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)
    {
        this.outEvents.Add(evnt);
    }
}

public void OnAudioProcessingCycleEnd()
{
    IVstMidiProcessor midiHost = this.vstHost.GetInstance<IVstMidiProcessor>();
    midiHost.Process(outEvents);
    outEvents.Clear();
}

I tested this by looping a midi clip, running it through my plugin and recording the output.
When the input clip looks like this:
 http://dl.dropbox.com/u/20066539/Forum%20Links/Vst.Net/Screenshot001.png
I get the expected output:
http://dl.dropbox.com/u/20066539/Forum%20Links/Vst.Net/Screenshot002.png

However if there is some variation in the input clip and it looks like this:
http://dl.dropbox.com/u/20066539/Forum%20Links/Vst.Net/Screenshot003.png

Then the output misses a lot of the events being passed through my plugin:
http://dl.dropbox.com/u/20066539/Forum%20Links/Vst.Net/Screenshot004.png

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:
http://dl.dropbox.com/u/20066539/Forum%20Links/Vst.Net/Screenshot005.png

Any idea what could be causing this?
Thanks!
Rob
Coordinator
May 3, 2012 at 8: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,
Marc 

May 9, 2012 at 6: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.