ModPlug Central

OpenMPT => Development Corner => Topic started by: Saga Musix on March 12, 2012, 23:37:21

Title: Now available for testing: The MIDI Input / Output plugin!
Post by: Saga Musix on March 12, 2012, 23:37:21
After years of VST host development, I have decided to also have a look at the "other side of the VST SDK". I've written my first VST plugin, which is to be included with upcoming versions of OpenMPT. It's a MIDI Input and Output plugin and is supposed to replace VST2MID for OpenMPT users.

(Download link removed, as the plugin is officially part of the OpenMPT download package)

What's the point of making it an Input and Output plugin?


Combining these two previous points, you can use the plugin to control another instrument plugin exclusively using the MIDI data from the MIDI plugin. Only the selected output plugin of the MIDI plugin will receive this input. At the same time, this also means that the MIDI events captured by this plugin cannot be recorded to the pattern editor.

You can set up plugin chains with several MIDI processing plugins to go crazy: How about sending the MIDI events captured by this plugin to an arpeggiator plugin, and then send the arpeggiated MIDI data generated by that plugin to another instance of the MIDI Input / Output plugin to control external gear that has no built-in arpeggiator? It's up to you!

MIDI Input only works in recent test versions of OpenMPT, btw.
Title: Re: Now available for testing: The MIDI Input / Output plugin!
Post by: Harbinger on March 13, 2012, 13:50:09
EXCELLENT! I'm inspired to go out and buy a new MIDI keyboard with this plugin. ;D

Just wondering: Is the plugin only helpful for external MIDI hardware? IOW, can some use be made for MIDI-based VSTi's, such as Roland's Orchestral board? Or would it be kind of redundant when using your plugin with others?
Title: Re: Now available for testing: The MIDI Input / Output plugin!
Post by: Saga Musix on March 13, 2012, 14:57:34
Well, since the only thing this plugin does is sending data from the host to MIDI hardware or vice versa, it wouldn't be very helpful without external MIDI gear. But it can of course address any virtual MIDI device as well, like Windows' built-in GM player.
Title: Re: Now available for testing: The MIDI Input / Output plugin!
Post by: oxxi on March 26, 2012, 20:22:13
When I saw this, I quickly downloaded it! There is a latency issue though. I used the lowest possible settings for Midi and Audio, including ASIO, and sending midi to my Casio CZ101 was a bit delayed with Modplug. Any other ideas as to what else I could try to remedy this?
Title: Re: Now available for testing: The MIDI Input / Output plugin!
Post by: Saga Musix on March 26, 2012, 21:05:07
I have practically zero latency when using the plugin together with an ASIO driver at 10ms latency. Do you get better performance with other audio software using the same drivers? Does VST2MID (http://tobybear.de/p_midibag.html) have any significant differences in latency?

The plugin makes use of PortMidi with a zero length buffer, so the plugin itself doesn't cause any latency that I could fix. I have only noticed higher latencies when using the plugin together with WaveOut and DirectX.
Title: Re: Now available for testing: The MIDI Input / Output plugin!
Post by: oxxi on March 27, 2012, 04:17:12
Well today my Midi-to-USB stopped working. I had to uninstall MidiYoke so that my Midi Usb Cable could work on my system along with your plugin. After this,  I tested your plugin in Modplug and the latency was practically non-existent! The only thing now is if I try to record notes while the pattern is playing, the sequence/pattern automatically starts to play back slow. I have to stop and replay the pattern to hear the original speed. Don't know if this is a bug or not. Also, I can't do both Midi IN/OUT at the same time. It's either one or the other. So I've just been using my pc keyboard to enter the note data and having Modlug play the sequence on my synth. 
Title: Re: Now available for testing: The MIDI Input / Output plugin!
Post by: Saga Musix on March 27, 2012, 13:24:08
Quote from: oxxi on March 27, 2012, 04:17:12The only thing now is if I try to record notes while the pattern is playing, the sequence/pattern automatically starts to play back slow.
That sounds weird. To isolate the problem, do use tempo commands in your song, and does the tempo in the pattern you want to record into differ from the initial tempo setting?

Quote from: oxxi on March 27, 2012, 04:17:12Also, I can't do both Midi IN/OUT at the same time. It's either one or the other.
Sounds like a driver issue, though that shouldn't even happen with the generic Windows USB MIDI Interface drivers - I have tried them and they work perfectly. Are you sure that no other application is accessing MIDI ports when you try to use them in OpenMPT?
Title: Re: Now available for testing: The MIDI Input / Output plugin!
Post by: oxxi on April 06, 2012, 04:18:21
Well I haven't had much time to test things lately, but the tempo in the pattern does differ from the initial setting. I have to change it back to the original tempo. It could be a midi driver issue though, or maybe I should do a fresh install of XP (it's been a while). I did have trouble installing the midi drivers for the Roland UM-one when I first got it. Windows XP did not recognize it and neither did other Win 7 computers. I tried the UM-one in OSX, and it worked fine. So I guess that could be the issue. I'll see if I can try another midi device sometime in the future along with your plugin.
Title: Re: Now available for testing: The MIDI Input / Output plugin!
Post by: Saga Musix on April 06, 2012, 08:33:12
Well, that would be weird if the MIDI callback would slow down OpenMPT. Are you sure that OpenMPT is not simply reverting the tempo settings to the defaults when you try to play the pattern?