Hosting VST

Topics: Host Development
Jul 1, 2012 at 10:04 PM

I try to host VST with C # but I have too much knowledge VSTHost .... I downloaded the source code here but the problem is that whenever there is a bug especially from the dll ....
Please, it's very urgent ...
thank you

Jul 2, 2012 at 7:43 AM

Can you be a bit specific what you are trying to accomplish and what the problem is?
Perhaps a code example?

Jul 3, 2012 at 1:49 PM
Edited Jul 3, 2012 at 2:10 PM

Thanks for you reply

I was just trying to use VST synths to produce music with C#.

The main problem, is that I failed to load the  Jacobi.Vst.Interop.dll library.


Jul 3, 2012 at 2:11 PM

I am using visual studio  10. 

Is there any compatibility issue ?

Jul 3, 2012 at 4:15 PM

I got a BadImageFormatException :

Could not load file or assembly 'Jacobi.Vst.Interop, Version=, Culture=neutral, PublicKeyToken=fa678e13c1efc859' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Jul 3, 2012 at 4:54 PM

The binaries that you can download from codeplex are 32-bit (CLR2) binaries. The BadImageFormatException is usually an indication that you're mixing 32 and 64 bit assemblies.

You are building a host application in VS 2010, so most likely your host exe project has CLR4 / 64 bit settings. This will not allow you to load the CLR2/32 bit VST.NET Interop assembly. Either rebuild your host exe project with CLR 2 and 32 bit settings or rebuild VST.NET using the CLR 4 /64 bit project files. For building the VST.NET code refer to this page:


Hope it helps.

Jul 4, 2012 at 9:25 PM

thank you, It worked...

Jul 6, 2012 at 9:09 AM
Edited Jul 6, 2012 at 9:36 AM

I have another problem about how to capture the audio data from the plugin resulting from a midi event. 

That is to say, after sending


PluginContext.PluginCommandStub.ProcessEvents(new VstEvent[] { new VstMidiEvent(...) })




  PluginContext.PluginCommandStub.ProcessReplacing(inputBuffers, outputBuffers);

the right way ?  (of course without any data in the inputBuffers)

or perhaps there is a callback to implement ?


Really sorry to bother, but I could not find any documentations about that ... 


Jul 6, 2012 at 9:21 AM

Yep. That is the correct way.

There are two versions of ProcessReplacing (Three versions if you also support VST version < 2.4).
You should check the capabilities of the plugin to see which method to use.

Hope it helps.

Aug 18, 2012 at 3:04 PM
Edited Aug 18, 2012 at 3:42 PM


Here you can find a example of VSTi hosting with midi and keyboard input support:

The download can be found at


Get code for getting NAudio and VST NET working together flawlessly was mostly copied from the microDRUM project.

I only added support for the new NAudio way of handling midi.



Per Ivar