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

VST.NET loading plugin

Topics: Audio, Getting Started, Host Processing, Newbie, Plugin Programs, VST.NET Core, VST.NET Framework, VST.NET Interop
May 4, 2014 at 9:59 PM

I am totally new to VST plugins so sorry if this question was already answered on this discussion channel but if I do not know what to exactly look for I cannot find it easily.

I need to use AGC plugin ( in a C# app. As I have mentioned I do not have much knowledge about VST plugins and standard. I do not know how to use VST.NET to load plugin and process some audio data. For recording and playing I use NAudio. I tried to get through the code in a samples but not knowing VST idea it is hard to understand for me.

Can anyone help me explaining what to do or sending some really basic code how to load plugins and process some data. My goal is to record voice with Auto Gain Control filter. My friend for whom I am writing this code wants the one above as he claims that it give very good results out of the box.

Thanks in advance.

May 5, 2014 at 6:54 AM
Hi Bartek,

Take a look at the Host Sample. It is not a real working audio app but it does show you how to make the basic calls to a plugin.

Writing a VST.NET host is not the easiest thing it would be a good idea to get acquainted with host-plugin interaction some more.
Note that the representation of an audio sample in VST(.NET) float[-1,1] is different than the representation in NAudio (Int16-interleaved). There is a thread in this discussion list about that (search for NAudio).

There are one or two VST.NET users that also have made host applications. Perhaps they could help you some more...

Good luck,
May 5, 2014 at 8:11 AM
Hey Bartek,

the most basic way to load and display a VST plugin is:
            HostCommandStub cmdstub = new HostCommandStub(); //Code for this class is in the VSTHost Sample code
            cont = VstPluginContext.Create("C:\\Path\\To\\Plugin.dll", cmdstub);
            Rectangle rect = new Rectangle();
            cont.PluginCommandStub.EditorOpen(this.Handle); //I have this code in a Form so i display the plugin directly inside it
Two Threads about Naudio and Sound processing are and . The last one being my one and it is still open as i couldn't figure it out yet though you might from the replies from Marc and Yuri.

May 5, 2014 at 9:12 AM
To elaborate: the HostCommandStub is the connection between one (or more) plugins and the host. The code in the sample is NOT representative of how you would implement that. Each plugin has several methods it can call to reach the host. These method calls end up on the HostCommandStub. It is up to the host app how to handle these calls.