I know this is an old question, but before I go nuts trying to figure things all at once, I just want to know if I’m doing things right. I’m using the Plugin example. It compiles a VST DLL and it runs on Orion. Now, I want to load the Wusik Station VST (.dll file) inside it, and play it, without doing anything extra. I’m using the following to load the VST and connect to a graph object, which seems to be working fine.
[code] // Load VST //
AudioPluginFormatManager::getInstance()->addDefaultFormats();
String errorMessage;
AudioPluginInstance* VSTinstance = 0;
AudioPluginInstance* AudioOutinstance = 0;
AudioPluginInstance* MidiIninstance = 0;
PluginDescription PlugDesc;
PlugDesc.pluginFormatName = T(“vst”);
PlugDesc.fileOrIdentifier = T(“c:\vstplugins\Wusikstation.dll”);
VSTinstance = AudioPluginFormatManager::getInstance()->createPluginInstance (PlugDesc, errorMessage);
AudioProcessorGraph::Node* node = 0;
static juce::uint32 MidiInputID = 0;
static juce::uint32 AudioOutID = 0;
static juce::uint32 VstID = 0;
if (VSTinstance != 0)
{
node = graph.addNode (VSTinstance);
VstID = node->id;
AudioProcessorGraph::AudioGraphIOProcessor p (AudioProcessorGraph::AudioGraphIOProcessor::audioOutputNode);
p.fillInPluginDescription (PlugDesc);
AudioProcessorGraph::AudioGraphIOProcessor p2 (AudioProcessorGraph::AudioGraphIOProcessor::midiInputNode);
p2.fillInPluginDescription (PlugDesc);
AudioOutinstance = AudioPluginFormatManager::getInstance()->createPluginInstance (PlugDesc, errorMessage);
MidiIninstance = AudioPluginFormatManager::getInstance()->createPluginInstance (PlugDesc, errorMessage);
if (AudioOutinstance != 0)
{
node = graph.addNode (VSTinstance);
AudioOutID = node->id;
node = graph.addNode (MidiIninstance);
MidiInputID = node->id;
bool didConnect = true;
if (!graph.addConnection(VstID,0,AudioOutID,0)) didConnect = false;
if (!graph.addConnection(VstID,1,AudioOutID,1)) didConnect = false;
if (!graph.addConnection(MidiInputID,4096,VstID,4096)) didConnect = false;
if (!didConnect) AlertWindow::showMessageBox (AlertWindow::WarningIcon,T("Error!"),T("Error Connecting!"));
}
else
{
AlertWindow::showMessageBox (AlertWindow::WarningIcon,T("Error Loading Wusikstation.dll VST!"),errorMessage);
}
}
else
{
AlertWindow::showMessageBox (AlertWindow::WarningIcon,T("Error Loading Wusikstation.dll VST!"),errorMessage);
}
graphPlayer.setProcessor(&graph);[/code]
Now I need to figure out how to play graphPlayer, I guess. In any event, I’m sure that once I rest a bit I can figure it out, but just in case I’m doing something totally stupid and wrong, here’s my current code.
Best Regards, WilliamK