Mapping MIDI CC to LADSPA Filters in Ecasound

This guide explains the exact Ecasound syntax required to bind a physical MIDI controller knob to a LADSPA filter frequency for real-time sound processing. By using Ecasound’s built-in MIDI controller operator (-km), you can route continuous control change (CC) messages directly to LADSPA plugin parameters, establishing minimum and maximum frequency boundaries for dynamic hardware automation.

The -km Controller Syntax

In Ecasound, continuous parameter modulation from MIDI hardware is configured using the -km controller operator. The syntax is:

-km:fx_param,low_val,high_val,controller_number,midi_channel

Setting Up the LADSPA Filter

Before applying the controller, instantiate your filter with the -el (enable LADSPA) option:

-el:lowpass_iir,1000,2

In the lowpass_iir plugin, parameter 1 is the cutoff frequency in Hz (initially set to 1000 Hz), and parameter 2 is the number of filter stages.

Specifying the MIDI Device

To route physical MIDI data into Ecasound, define an ALSA sequencer MIDI input device using the -Md flag:

-Md:alsaseq,client:port

Replace client:port with your controller's ALSA port identification (obtained by running aconnect -l or amidi -l).

Complete Working Example

The following command takes real-time audio input from your soundcard, passes it through a LADSPA low-pass filter, outputs the audio back to your speakers, and maps MIDI CC #74 on channel 1 to sweep the filter cutoff frequency between 80 Hz and 12,000 Hz:

ecasound -i:alsahw,0,0 -o:alsahw,0,0 -el:lowpass_iir,1000,2 -km:1,80,12000,74,1 -Md:alsaseq,20:0