How to create a simple plug in host?

Hello!

I’m new to JUCE and audio plugin development in general and I want to create my own command line plug in host that opens up the plug-in, allows for midi input, and audio output. Does anyone have any tips on how I would do this or what resources I should be looking at? I’ve built JUCE’s existing plug-in host example and have been trying to understand some of that code to get somewhat familiar, but I am still a bit lost. I’m working on MacOS.

I appreciate any help or insights!

Thank you

Best place I’ve looked for tips on this subject is in the TRACKTION framework, which sits on top of JUCE and provides a lot of the services and session-management features that one would expect to use in a DAW - i.e. hosting plugins, recreating edit sessions from file, etc.

Even if you decide not to use the framework, you can still learn a lot about how plugins are hosted from the TRACKTION sources themselves.

In addition, take a look at the Helio and LMN-3-DAW projects, both of which are mini-DAW’s using JUCE to host plugins - there may be some clues for you to follow there, as well:

[1] - Tracktion - GitHub - Tracktion/tracktion_engine: Tracktion Engine module
[2] - Helio Workstation - GitHub - helio-fm/helio-workstation: One music sequencer for all major platforms, desktop and mobile
[3] - LMN-3-DAW - GitHub - FundamentalFrequency/LMN-3-DAW: LMN-3 DAW

If you are working on a new plugin implementation, allow me to suggest you take a look at TRACKTION’s “.trackedit” Edit loading functionality, which does a lot of the homework for you already …

Hello!
It’s not very obvious because there’s no class with the word “host” in it, and of course, most people aren’t interested in doing this, so I couldn’t find any tutorials or explanations.
I once managed to do it using
AudioPluginFormatManager::CreatePluginInstance()
That returns an AudioPluginInstance which you can hold in a std::unique_ptr and do what you will with it. You’d just keep it in your AudioProcessor subclass and feed it buffers and such.
I had a semi-working prototype for a plugin that wraps another plugin, imitates it visually, and holds an array of identical instances to force microtonal tunings out of it. I got it to load and imitate one instance of the other plugin, but other people made better working versions and I moved on to other projects.
I think the Plugin Host uses AudioProcessorGraphs, which are useful for having the option to string plugins in series. I wasn’t interested in that, so I didn’t use the same setup.
Good luck!

I found this post really helpful:

Hosting Plugins - General JUCE discussion - JUCE

Thank you all for the replies I’ll check these out!

Thanks for your reply! Just curious what does it mean to “string plugins in series”?

I mean that the Audio Plugin Host is able to connect the output of one plugin to the input of another, and the graph classes help with that. My own goal was to host exactly one plugin per instance, so I didn’t look into it much.

Hi,

I’m trying to use AudioPluginFormatManager::CreatePluginInstance() but I notice it takes in PluginDescription as one of its arguments. I’m trying to take the path of the VST, create the plugin description and then pass it to to CreatePluginInstance. However, I’m stuck at the part of creating a plugin description from path because I cannot find a way to do this. Is my thought process ok or am I misunderstanding something?

You can’t create PluginDescription from a path, you need to set the path of the plugin binary etc after constructing it

So, something like this might work :

juce::PluginDescription desc;
desc.fileOrIdentifier = "C:\\Program Files\\Common Files\\VST3\\MyPlugin.vst3";
desc.pluginFormatName = "VST3";
desc.uid = 0;

I see now thanks!