Hi all!
I’m working on a small VST3 plugin host for Unity using interop with a native Juce dynamic library. So far, I’ve had success scanning for plugins, instantiating a VST3 plugin and having it process audio coming from the game engine.
For testing I am using a simple VST3 test plugin which produces noise and has two AudioParameterFloat
added in the plugin constructor with addParameter
. Problem is that I cannot find these parameters in my host - getParameters
called on plugin instance doesn’t return any parameters.
Opening the plugin in another host (tested with Reaper, 64 bit Windows 10), these parameters are indeed visible and work as expected when automated.
This makes me think I have missed some step in instantiating the plugin. I have poked around in the Juce plugin host source, but didn’t find anything about exposed parameters.
Here is the code, simplified for readability:
// ...Plugins directory scanned
// KnownPluginsList returned as XML and deserialized
// Test VST3 plugin selected from list and serialized to XML, provided as xmlPluginDescription
pluginDescription = new PluginDescription();
ScopedPointer<XmlDocument> document = new XmlDocument(xmlPluginDescription);
XmlElement* element = document->getDocumentElement();
if (pluginDescription->loadFromXml(*element))
{
String error = "Could not create plugin instance.";
pluginInstance = formatManager->createPluginInstance(*pluginDescription, sampleRate, bufferSize, error);
if (pluginInstance)
{
pluginEditor = pluginInstance->createEditor();
pluginInstance->prepareToPlay(sampleRate, expectedSamplesPerBlock);
}
}
// ...Plugin was loaded and is now providing audio in the game engine
// Now we attempt to get the number of parameters:
const OwnedArray<AudioProcessorParameter>& params = pluginInstance->getParameters();
return params.size();
// When debugging, we see that params is empty (numUsed=0) and params.size returns 0.
// In Reaper, two parameters are visible, as expected.
Am I missing some important setup step here? Thanks!