HomeBlog
Published on October 06, 2019

Automatic GUI for Audio Parameters in Juce

These days, GUI is a major deciding factor for a good audio plugin. But when we are prototyping or just experimenting, we don't care about the GUI.
We simply need a set of controls to modify the plugin parameters.
Fortunately, with Juce, you have two options:

1. Do Not Provide an Editor

The first option is simple. We simply don't provide a GUI for our plugin. Rather, the host (usually a DAW) will provide a GUI for our parameters.
Ableton Live always shows the GUI for parameters, and it's pretty good.
How Ableton Live shows parameters.
You can easily implement this by applying the following change your AudioProcessor class.
bool JuceAutoParamsAudioProcessor::hasEditor() const
{
    return false;
}

AudioProcessorEditor* JuceAutoParamsAudioProcessor::createEditor()
{
    return nullptr;
}

2. Use the Generic Editor Provided by Juce

In Ableton Live, the default GUI for parameters is pretty nice and easy to use. But in some other DAWs, that's not the case.
How Reaper shows the default GUI for a plugin which has no GUI.
In that case, we can use the built-in Editor provided by Juce. It'll try to create a GUI for the parameters we defined in the PluginProcessor.
Enabling that is also very easy.
  1. Make sure you return true from the hasEditor method.
  2. Return new GenericAudioProcessorEditor (*this) from the createEditor method.
bool JuceAutoParamsAudioProcessor::hasEditor() const
{
    return true;
}

AudioProcessorEditor* JuceAutoParamsAudioProcessor::createEditor()
{
    return new GenericAudioProcessorEditor (*this);
}
Then you can see a GUI like this for our parameters.
How Reaper shows the default plugin editor GUI.
You can inspect the complete plugin code at iohacks/JuceAutoParams.

Kudos

I want to thank Xenakios for pointing out these options.