Combining VST.Net and MIDI.Net

Topics: Audio, Midi
Mar 2 at 9:41 PM
First off thank you for two wonderful libraries!

I'm trying to hack a very simple working VSTi host together using VST.Net and MIDI.Net.

Looking at MIDI.Net I see the MIDIThru example reading live MIDI input.

How can I convert that to send the MIDIOutShort messages "into" (for lack of better term) the sample VST host app from VST.Net?

As I understand it I will need some "audio processing" code / library to output the data from ProcessReplacing to some sound card (preferably ASIO if possible).

Any tips, suggestions, or even simple code samples on plumbing live MIDI input, into the VST host (so the VSTi reacts) then how to get that to any audio output would be much appreciated. Just getting started with both of these .NET tools and all I can say is Wow!
Apr 21 at 12:50 PM
First I am very sorry I did not see your message sooner. It seems codeplex does not send notification emails anymore.

That is quite a topic. You have to inject the MIDI message received with MIDI.NET into the audio engine (you have to write) of VST.NET.
VST plugins that process MIDI usually also require the ProcessReplace method to be called on a regular basis - that is what your audio engine should do. VST instruments will convert the VstMidiEvents they receive through ProcessEvents into audio samples (ProcessReplacing). Then these sample buffers (VstAudioBuffer) need to be converted in whatever format your audio output supports (like NAudio or ASIO) - because the sample values of a VST plugin are in range of [-1.0, +1.0] but for audio output they may have to be converted to say an int starting at zero.

Searh the discussion list for more on this subject, others have done this already.

hope it helps,