Hi,
This is a library that I started writing on March 2012 and I have been using ever since in my plugins. Hopefully it will be useful to some of you too, specially those who don’t have the time or the resources to create a similar system.
PluginParameters is a JUCE module which manages automatically different types of plugin parameters. It intends to help automating things in the development of cross-platform plugins taking it from where JUCE leaves you in the wild. It should be simple to use with only a few lines doing the job (see an example below).
This version of the PluginParameters module is released under the GPLv.2. Please donate if you find it useful. Alternatively, a Commercial License (available for 200eur) allows you to use this module in closed-source projects and provides you full compatibility with the latest release of JUCE, support for XCode and Visual Studio and extra features.
Links: [Download] [Reference] [Doxygen Documentation]
What it does
- It can be used to build a VST/AU/RTAS plugin or built-in plugins (AudioPluginInstance’s).
- Includes methods to map any integer, float or bool parameter types to the host float range of [0,1] back and forth linearly, logarithmically (w/out a 0, w/out a sign). Custom mappings can also be defined.
- Parameters can be grouped as ParamGroups, which may be nested. This allows to create quite easily independent plugin building blocks.
- Arrays and Matrices are defined for each defined parameter type (they are both a subclass of ParamGroup).
- Allows parameters to be registered at the host (automated by default) or to be left unregistered (non-automated) but saved/restored anyway internally at the end/beginning of each session.
- Provides methods to load/save selected parameters from/to the host session automatically.
- Should compile correctly in Visual Studio and Xcode.
Only with a commercial license
- Includes Undo/Redo’s from parameter changes made in the UI.
- Preset Manager.
The Preset manager is a class which provides utilities to load, save, rename, delete, reset XML preset files that store all parameter values of a ParamGroup recursively. It marks files that are loaded as read-only so that they cannot loaded twice or modified outside the plugin, supports preset “folder-files” (where the actual preset file is created inside a folder of the same name) and tracks unsaved changes with an “*” next to the preset file name.
A possible user interface for this class (PresetsComponent) is available in the PluginParametersGroupsDemo example. In this project you may find too (commented) code to setup the Preset Manager.
Please refer to the last section of the Reference (Advanced Usages), to see how Undos/Redos, custom float parameter mappings and parameters with other float and int types are supported.
Example plugins
- PluginParametersDemo implements a gain which can be set linearly or logarithmically. It includes examples of the following parameter types: FloatParam, LogParam. LogWith0Param, LogWithSignParam, IntParam, BoolParam.
float floatVar;
float logVar;
float logWith0Var;
float symSignedLogVar;
float asymSignedLogVar;
int intVar;
bool boolVar;
bool boolButtonVar;
enum Params{
floatIndex=0,
logIndex,
logWith0Index,
symSignedLogIndex,
asymSignedLogIndex,
intIndex,
boolIndex,
boolButtonIndex
};
void initParameters(){
addFloatParam(floatIndex,"float",true,true,&floatVar,-6.f,6.f);
addLogParam(logIndex,"log",true,true,&logVar,0.001f,6.f);
addLogWith0Param(logWith0Index,"logWith0",true,true,&logWith0Var,0.001f,6.f);
addLogWithSignParam(symSignedLogIndex,"symSignedLog",true,true,&symSignedLogVar,-6.f,6.f,0.001f);
addLogWithSignParam(asymSignedLogIndex,"asymSignedLog",true,true,&asymSignedLogVar,-4.f,3.f,0.001f);
addIntParam(intIndex,"int",true,true,&intVar,0,4);
addBoolParam(boolIndex,"bool",true,true,&boolVar);
addBoolParam(boolButtonIndex,"boolButton",true,false,&boolButtonVar);
}
- PluginParametersGroupsDemo implements 3 chained Midi effects:
- A sustain effect.
- A delay effect.
- A “note gain” effect (every note velocity is multiplied by a different gain).
The code is structured in three independent modules contained in the following folders: MidiSustain, MidiDelay, MidiNoteGain and it is meant to show how the ParamGroup class works. Additionally an example of the pre-defined IntParamArray class is included in the “note gain” effect.
Remember too that a non-functional/demo PresetsComponent is included in this project.
Enjoy!