Usage of AudioProcessorParameterGroup

Hello guys,

I’m trying to use AudioProcessorParameterGroup but I don’t succeed. I added the following code to PluginProcessor’s constructor:

auto parameterGroup = std::make_unique<AudioProcessorParameterGroup>("GroupID", "GroupName", "|");
parameterGroup->addChild(std::make_unique<AudioParameterFloat>("INPUT", "Input Volume", { 0.0f,  60.0f, 0.0f, 1.0f }, 0.0f, "dB"));

Unfortunately this does not work. What am I doing wrong? Can anyone give an example for correct usage of AudioProcessorParameterGroup, please?

Can you tell us what you mean by “does not work”?

The above code is based on here

https://forum.juce.com/t/plug-in-parameter-groups/29409/7

Obviously the second line is wrong. I added the code to DSPModulePluginDemo. When trying to build I get the following errors in VS 2019:

>D:\DSPModulePluginDemo\Source\DSPModulePluginDemo.h(109,39): error C2672: 'std::make_unique': no matching overloaded function found (compiling source file ..\..\Source\Main.cpp)
>D:\DSPModulePluginDemo\Source\DSPModulePluginDemo.h(109,1): error C2784: 'std::unique_ptr<_Ty,std::default_delete<_Ty>> std::make_unique(_Types &&...)': could not deduce template argument for '_Types &&...' from 'initializer list' (compiling source file ..\..\Source\Main.cpp)
>D:\DSPModulePluginDemo\Source\DSPModulePluginDemo.h(109,23): error C2672: 'juce::AudioProcessorParameterGroup::addChild': no matching overloaded function found (compiling source file ..\..\Source\Main.cpp)

How can I avoid them?

I already looked at some of the tutorials and the Projucer’s demo projects but I haven’t found an example which explains the usage of AudioProcessorParameterGroup yet.

I found the problem producing the errors. The second line must be

parameterGroup->addChild(std::make_unique<AudioParameterFloat>("INPUT", "Input Volume", NormalisableRange<float>(0.0f,  60.0f, 0.0f, 1.0f), 0.0f, "dB"));

Nevertheless, a tutorial about using AudioProcessorParameterGroup or at least detailed instructions would be very helpful.