Overview
Parameters are the core of plugin automation and user control. In iPlug2, parameters are:- Fixed at compile time - Count defined in constructor
- Indexed by enum - Type-safe parameter access
- Thread-safe - Atomic values for audio/UI access
- Non-normalized - Real values (e.g., 0-100) not 0-1
- Automatable - Unless explicitly disabled
Parameters use
std::atomic<double> for lock-free thread-safe access. See IPlugParameter.h:516Parameter Basics
Defining Parameters
Parameters are typically defined in your plugin constructor using an enum:Accessing Parameters
Always useGetParam() to access parameters:
Parameter Types
iPlug2 provides multiple parameter initialization methods for different use cases.- Double
- Specialized Types
- Integer & Enum
- Boolean
InitDouble - General-purpose floating point parameterExamples:
Parameter Shapes
Parameter shapes control how the parameter responds across its range.Linear
ShapeLinear()Even distribution across range.
Exponential
ShapeExp()Logarithmic curve, great for frequencies.
Power Curve
ShapePowCurve(n)Custom curve with exponent.
From IPlugParameter.h:74-136, shapes affect both display and automation curves.
Parameter Flags
Flags modify parameter behavior:Parameter Groups
Groups organize parameters in the host’s automation dialog:Working with Groups
Getting and Setting Values
- Getting Values
- Setting Values
- Display Values
- Display Texts
Custom Display Functions
For complex display formatting, use a custom display function:Parameter Automation
Host Automation
When the host automates a parameter, your plugin is notified:OnParamChange() is called on the UI thread, not the audio thread. Safe to allocate memory or do file I/O here.Informing the Host
When your plugin changes parameters internally:Bulk Parameter Operations
iPlug2 provides methods to operate on multiple parameters at once:- Range Operations
- Group Operations
- All Parameters
AudioUnit Parameter Units
AudioUnit plugins can specify parameter units for better host integration:Advanced: Parameter Modulation
For real-time modulation (LFO, envelope) that shouldn’t be automated:This modulates the internal DSP without changing the parameter’s stored value or triggering host automation.
Best Practices
Use Real Values
Store parameters as real values (e.g., -70 to +12 dB), not normalized 0-1. Easier to work with in DSP code.
Fixed Parameter Count
Never add/remove parameters after release. Host automation breaks if parameter count changes.
Enums for Indexing
Always use enums to index parameters. Type-safe and self-documenting.
Groups for Organization
Use parameter groups to organize related parameters in host automation dialogs.
Appropriate Shapes
Use exponential curves for frequencies, linear for most others. Test what feels natural.
Sensible Defaults
Choose defaults that produce useful sound immediately. Users may never touch some parameters.
Display Precision
Match step size to display precision. Step 0.01 = 2 decimals, 0.1 = 1 decimal.
Thread Safety
Parameters are atomic and thread-safe. Access directly from any thread.
Complete Example
Next Steps
Audio Processing
Use parameters in ProcessBlock for real-time audio
Architecture
Understand how parameters fit into the architecture
Plugin Formats
Learn format-specific parameter features
Project Structure
See how parameters fit into your project files