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

Can't host a VST in a VST

Jul 4, 2015 at 9:38 AM
I want to host a VST from within a plugin. It would be pretty straight except that a host app requires the interop DLL. When I try to open a host from within a plugin, I get this:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in System.Windows.Forms.dll

Additional information: Could not load file or assembly 'Jacobi.Vst.Interop, Version=1.1.0.0, Culture=neutral, PublicKeyToken=fa678e13c1efc859' or one of its dependencies. The system cannot find the file specified.

If there is a handler for this exception, the program may be safely continued.

But, if I put that DLL in the same folder, I can't even open the plugin in the first place. I guess it is spitting the dummy because Interop already exists in the App Domain as the different DLL name.

:(
Jul 4, 2015 at 9:52 AM
Tried this:
            var bytes = File.ReadAllBytes(@"C:\Audio\Backup\Code\Dependencies\VST.Net\Jacobi.Vst.Interop.dll");
            AppDomain.CurrentDomain.Load(bytes);
No dice.
Jul 4, 2015 at 11:02 AM
Checkout the PluginWrapper sample. Perhaps that is what you are looking for.

VST.NET does NOT support the Shell-plugin feature of VST 2.4 for managed plugins - a managed host can query shell plugins though.

If that doesn't work for you, I need to see more details on what it is you are doing...
Jul 4, 2015 at 12:51 PM
Hmm...

You might be right. I get the same error when I try to load the Plugin Wrapper sample in Ableton.

https://onedrive.live.com/redir?resid=47321C0630B57E1D!4854&authkey=!AMiAQOgp6T3wNpI&ithint=file%2cpng
Jul 4, 2015 at 12:54 PM
VST.NET does NOT support the Shell-plugin feature of VST 2.4 for managed plugins - a managed host can query shell plugins though.

I'm not sure what that means. All I want to do is load plugins inside plugins.
Jul 4, 2015 at 1:45 PM
The plugin-wrapper sample uses the VST.NET host to load another plugin. This 'inner' plugin can be any plugin - managed or unmanaged. So it needs the Jacobi.Vst.Interop assembly to do so. Did you deploy it next to the plugin-wrapper assemblies?

A VST2.4 Shell Plugin is a plugin that is a proxy for other plugins. The host may iterate over the multiple inner proxies that the shell-plugin may provide. Specific calls are available to do that - which are not implemented for a VST.NET plugin (but are hot the VST.NET host).

The plugin-wrapper sample simply wraps whatever plugin you point to and passes most plugin calls from the host to the plugin on to the inner plugin. So in that regard the host thinks it only deals with a single plugin.

By wrapping a plugin some functionality may be implemented generically (like resampling) and transparently. The plugin-wrapper sample also demonstrates how to load a plugin using the VST.NET host API.
Jul 4, 2015 at 7:41 PM
Have you tried running fusion log to debug assembly loading?
Retry static linking with logs enabled, check out which location has priority and put required assemblies there.
Wort case I fixed involve putting the relevent reference in machine.config to override some ORM references.
Jul 5, 2015 at 12:53 AM
"The plugin-wrapper sample uses the VST.NET host to load another plugin. This 'inner' plugin can be any plugin - managed or unmanaged. So it needs the Jacobi.Vst.Interop assembly to do so. Did you deploy it next to the plugin-wrapper assemblies?"

I tried with and without doing that. When I do that, Ableton crashes on startup. This is what I tried:
https://onedrive.live.com/redir?resid=47321C0630B57E1D!4861&authkey=!AL-c2Ca97uEF7ds&v=3&ithint=photo%2cpng

This is the error that comes up in Ableton when I do that:
https://onedrive.live.com/redir?resid=47321C0630B57E1D!4862&authkey=!AHHCVHAduPg6sO4&ithint=file%2cpng

Here is my config file:
<?xml version="1.0"?>
<configuration>
  <appSettings>
    <add key="PluginPath" value="C:\Program Files (x86)\VstPlugins\NI\Massive.dll"/>
  </appSettings>

  <!--<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>-->
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
I think the problem is that the interop dll is in the folder twice but with two different names which would confuse the AppDomain.

Have you tried running fusion log to debug assembly loading?

I don't know how to do that, but googling now!
Jul 5, 2015 at 1:05 AM
I don't exactly know what I changed but now it's working!

This library is hot shit!

https://onedrive.live.com/redir?resid=47321C0630B57E1D!4863&authkey=!ACU3aVFNFTCMoZA&ithint=file%2cpng
Jul 5, 2015 at 2:09 AM
Help me obiwanjacobi. You're my only hope!

Here's my sample app. It's dead simple. I'm trying to smash together the Core (UI Sample), and the Wrapper sample.
https://onedrive.live.com/redir?resid=47321C0630B57E1D!4864&authkey=!ADtiVkQZXw6omhI&ithint=file%2c7z

All I want to do is open a plugin on button click. It's close but I keep getting an error.

You can have a look at the build event, and fix it up to suit your machine.
Jul 5, 2015 at 2:48 AM
Fusion log helped!

_=== Pre-bind state information ===
LOG: DisplayName = Jacobi.Vst.Interop, Version=1.1.0.0, Culture=neutral, PublicKeyToken=fa678e13c1efc859
(Fully-specified)
LOG: Appbase = file:///C:/ProgramData/Ableton/Live 9 Suite/Program/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = Ableton Live 9 Suite.exe

Calling assembly : (Unknown).

LOG: This bind starts in default load context.
LOG: Download of application configuration file was attempted from file:///C:/ProgramData/Ableton/Live 9 Suite/Program/Ableton Live 9 Suite.exe.config.
LOG: Configuration file C:\ProgramData\Ableton\Live 9 Suite\Program\Ableton Live 9 Suite.exe.config does not exist.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Jacobi.Vst.Interop, Version=1.1.0.0, Culture=neutral, PublicKeyToken=fa678e13c1efc859
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/ProgramData/Ableton/Live 9 Suite/Program/Jacobi.Vst.Interop.DLL.
LOG: Attempting download of new URL file:///C:/ProgramData/Ableton/Live 9 Suite/Program/Jacobi.Vst.Interop/Jacobi.Vst.Interop.DLL.
LOG: Attempting download of new URL file:///C:/ProgramData/Ableton/Live 9 Suite/Program/Jacobi.Vst.Interop.EXE.
LOG: Attempting download of new URL file:///C:/ProgramData/Ableton/Live 9 Suite/Program/Jacobi.Vst.Interop/Jacobi.Vst.Interop.EXE.
LOG: All probing URLs attempted and failed._

Don't know why, but it's looking for the DLL in the C:/ProgramData/Ableton/Live 9 Suite/Program folder so I whacked it in there and now, no error!

However, my plugin (Massive) doesn't open. What am I missing?
Jul 5, 2015 at 3:13 AM
Jul 5, 2015 at 3:14 AM
Now to route audio out of the hosted plugin, and back in to the DAW!
Jul 5, 2015 at 3:22 AM
Don't know why, but it's looking for the DLL in the C:/ProgramData/Ableton/Live 9 Suite/Program folder so I whacked it in there and now, no error!
  • The host has to make an explicit or implicit decision on which startup path context to use for your dll plugin.
Jul 5, 2015 at 8:05 AM
I don't understand...

Anyway, I have it working and here is a pretty cool sample app that others might like. It allows you to open a VST inside a VST, midi map a parameter, and then control that parameter from within .Net. Pretty powerful stuff already.

-Tested on NI FM8.
-Only Float Step parameters implemented but more could be added
-Make sure you check the build event because I've hacked it
-Make sure you put the interop DLL in the Ableton folder.

https://onedrive.live.com/redir?resid=47321C0630B57E1D!4875&authkey=!APvsgTS0icTcxVo&ithint=file%2c7z
Jul 5, 2015 at 8:07 AM