How to Bind MIDI Controllers in Ecasound
Ecasound enables real-time parameter manipulation using external hardware via MIDI continuous controller (CC) messages. This guide covers the exact command-line syntax used to connect an external MIDI input device and bind specific MIDI CC knobs, sliders, or pedals to chain operator parameters within an Ecasound processing session.
The MIDI Binding Syntax:
-km
In Ecasound, continuous parameter controllers are attached to the
preceding chain operator using the -km option. The basic
syntax is:
-km:param_id,midi-channel,controller-id,lower-bound,upper-boundThe parameters are defined as follows:
param_id: The numeric index of the effect parameter you want to automate. For example, in an amplify operator (-ea:100), parameter1corresponds to the amplification percentage.midi-channel: The MIDI channel to listen on (typically1to16).controller-id: The continuous controller number (CC0to127) transmitted by your hardware (e.g., CC 7 for volume, CC 1 for modulation wheel).lower-bound: The minimum value assigned to the target parameter when the MIDI controller sends its minimum value (0).upper-bound: The maximum value assigned to the target parameter when the MIDI controller sends its maximum value (127).
Defining the MIDI Input
Device: -Md
Before Ecasound can read continuous controller messages, you must
register your hardware device using the global MIDI device flag
-Md.
For ALSA sequencer connections:
-Md:alsaseq,defaultFor raw MIDI devices:
-Md:rawmidi,/dev/midi00Complete Command-Line Example
The following command routes audio from an ALSA input to an ALSA
output across a chain named main, adds an amplification
operator (-ea), and maps MIDI CC 7 on channel 1 to control
the volume level between 0% and 200%:
ecasound -Md:alsaseq,default -a:main -i:alsa,default -o:alsa,default -ea:100 -km:1,1,7,0,200In this command:
-Md:alsaseq,defaultopens the ALSA sequencer MIDI subsystem.-a:maincreates and selects chainmain.-i:alsa,default -o:alsa,defaultassigns the audio input and output.-ea:100applies an amplifier operator initialized at 100%.-km:1,1,7,0,200binds parameter 1 of-eato MIDI Channel 1, CC 7, scaling values from 0 to 200.
After launching, you can use ALSA utilities like
aconnect to connect your physical MIDI controller port to
Ecasound's sequencer port if it is not routed automatically.