0 KNown Formats

Hi,

just started to discover JUCE (and also Xcode) - have been on the VSCode/embedded side on a low professional level so far - so please be patient and gentle to me :innocent:

I’m struggling to build my first console application to open a AU or VST Plugin and read out available Host Automation parameters.

I had some conversations with ChatGPT to get started at all, however I was not able to get a running application because of ‘no viable conversion’ or missing class members etc.

So I went back a few steps and started very basic:

#include <JuceHeader.h>

int main()
{
    juce::String pluginFilename = "path/to/your/plugin.vst3"; // Replace with your VST3 plugin path

    juce::AudioPluginFormatManager formatManager;
    formatManager.addDefaultFormats(); // Add VST3 format
    
    std::cout << "Known Formats: " << formatManager.getNumFormats() << "\n";
    
    ;
    
    /*
    juce::String err;

    juce::AudioPluginInstance* pluginInstance = formatManager.createPluginInstance(pluginFilename, 44100.0, 512, err);

    if (pluginInstance != nullptr)
    {
        // Your logic to use the plugin instance goes here

        delete pluginInstance; // Remember to delete the instance when done
    }
    else
    {
        // Handle plugin instantiation failure
        std::cerr << "Failed to create plugin instance" << std::endl;
    }
    */
    return 0;
}

As a result I get 0 Known Formats. I would have expected at least 1 (AU) on a mac.
What am I missing?

Can somebody point me to a suitable tutorial / GitHub repo especially handling console applications to get further?

My main problem is, that I was not able to create an instance of an installed plugin on my mac to communicate with…

The plugin formats need to be activated in the build settings

As you can see, they are all off by default.

1 Like

:man_facepalming:
It’ the simple things… THX!

Next challenge JUCE_ASSERT_MESSAGE_MANAGER_EXISTS - it will get a long day…

It’s a long way… :slight_smile:

Even in a console app you need to initialise the whole event machinery that is usually done in JUCE_START_APPLICATION.

Thankfully you can simply add a member called ScopedJuceInitialiser_GUI in your main().
That should take care of all. Despite the name it doesn’t create a GUI, but allows the necessary interactions with the OS.

const juce::ScopedJuceInitialiser_GUI init;
1 Like