Passing LADSPA Plugin Parameters in Ecasound
This article explains how to pass control port parameters to LADSPA audio plugins when configuring audio processing chains in Ecasound. It covers the command-line syntax required for both label-based and ID-based plugin instantiation, details how control input values are mapped, and provides practical examples for both static assignments and dynamic parameter control.
LADSPA Operator Syntax
Ecasound integrates LADSPA (Linux Audio Developer's Simple Plugin API) plugins directly into its signal chain using chain operators. Control port parameters are supplied as a comma-separated list immediately following the plugin identifier.
There are two primary operators for adding LADSPA plugins:
-el:plugin_label,param1,param2,...: Loads a plugin using its textual label.-eli:plugin_id,param1,param2,...: Loads a plugin using its unique numerical identifier.
Determining Control Port Order
Ecasound distinguishes between audio ports and control ports automatically:
- Audio Ports: Ecasound automatically routes the chain's audio channels through the plugin's audio input and output ports.
- Control Ports: Only control input ports accept user-defined parameters. Control output ports are handled internally by the host or monitored via controllers.
The parameters passed after the plugin label or ID must match the exact sequence of the plugin's control input ports as defined by the plugin developer.
To determine the correct sequence and valid ranges for a given
plugin, run the analyseplugin utility provided by the
LADSPA SDK:
analyseplugin /usr/lib/ladspa/filter.soThe output displays each port's index, direction (input/output), type (audio/control), and acceptable bounds (minimum, maximum, and default values).
Static Parameter Example
Consider a simple low-pass filter (lowpass_iir) that
requires two control inputs:
- Cutoff Frequency (Hz)
- Stages (Poles)
To apply this filter with a 1,200 Hz cutoff and 2 stages to an audio file, structure the command as follows:
ecasound -i input.wav -o output.wav -el:lowpass_iir,1200,2If using the plugin's numeric ID (for example, 1042),
the command is:
ecasound -i input.wav -o output.wav -eli:1042,1200,2Dynamic Parameter Control
Control port values are not restricted to static numbers. Ecasound allows you to modulate LADSPA parameters over time using dynamic controllers attached to chain operators.
Using Envelopes and Oscillators
Parameters can be modulated using control envelopes like linear
sweeps (-klg) or sine oscillators (-kos):
ecasound -i input.wav -o output.wav \
-el:lowpass_iir,500,2 \
-klg:1,200,4000,10In this syntax:
- The filter is initialized with a cutoff of 500 Hz on parameter 1.
- The
-klgoperator modulates chain operator parameter1(cutoff frequency) from200Hz to4000Hz over a duration of10seconds.
Real-Time Interactive Adjustments
When running Ecasound in interactive mode (-c),
parameters can be modified on the fly using the cop-set
command:
cop-set chain_operator_id parameter_index new_value
For instance, to update the first parameter of the active chain's first operator to 800 Hz during playback:
cop-set 1 1 800