Monitoring Real-Time MIDI Input in Ecasound
This article explains how to configure and monitor incoming real-time MIDI events directly from the terminal using Ecasound. By attaching Ecasound to the ALSA sequencer or raw MIDI subsystems, users can inspect active MIDI event streams, verify hardware controllers, and trace parameter automation changes in real time without a graphical interface.
Setting Up the MIDI Input Driver
Ecasound accesses hardware and virtual MIDI streams through its MIDI
input subsystem designated by the -Md option. For modern
Linux distributions, the Advanced Linux Sound Architecture (ALSA)
sequencer is the most versatile driver option.
To open an ALSA sequencer port ready for MIDI monitoring, use the following syntax:
ecasound -Md:alsaseq,default -cHere, -Md:alsaseq,default instructs Ecasound to register
a client port within the ALSA sequencer subsystem. The -c
flag starts Ecasound in interactive mode, allowing real-time session
control and preventing the program from terminating immediately.
Connecting the MIDI Device
Once Ecasound is running with the sequencer input enabled, connect your MIDI keyboard, pad controller, or sequencer interface using ALSA's routing tools. In a separate terminal, list available input and output ports:
aconnect -lLocate your MIDI controller's port ID (e.g., 20:0) and
Ecasound's client ID (e.g., 128:0). Route the controller
directly to Ecasound:
aconnect 20:0 128:0Ecasound will now receive all raw events transmitted across the hardware MIDI bus.
Tracking Events with Debug Output
To see active MIDI data packets printed directly to the standard
output, adjust Ecasound’s internal debug and verbosity levels. The
-d parameter controls event logging:
ecasound -d:15 -Md:alsaseq,default -cSetting a high debug mask outputs granular information regarding packet delivery, driver hooks, and system events. As messages flow through the MIDI layer, the terminal console prints event reception notifications and timing intervals.
Monitoring Continuous Controller (CC) Mappings
For monitoring specific MIDI parameters such as Continuous
Controllers (CC), pitch bend, or note triggers affecting an audio
signal, map the incoming MIDI data to an audio chain operator using
controller assignment syntax (-km).
For example, to attach an ALSA MIDI CC to an audio amplifier module:
ecasound -i:null -o:null -ea:100 -Md:alsaseq,default -km:1,0,200,7,1 -cBreakdown of the mapping flags:
-i:null -o:null: Runs a lightweight virtual processing chain without requiring active audio hardware routing.-ea:100: Adds an amplification effect operator.-km:1,0,200,7,1: Connects Controller #1 to target effect operator 1, varying values between 0 and 200, mapped specifically to MIDI CC #7 (standard volume) on MIDI Channel 1.
Using Interactive Mode to Inspect Parameter Changes
Once the engine is initiated by typing start inside the
interactive command console, any adjustment to the assigned physical
controller produces real-time terminal updates.
You can inspect the state of any controller mapping dynamically by entering:
controller-status
or query the operational health of the overall processing engine:
engine-status
Ecasound will return the current normalized values received from the incoming MIDI stream, providing immediate confirmation of your controller's transmission range and communication state.