Can Ecasound Filter MIDI Aftertouch Messages?

Ecasound does not have built-in capabilities to filter out specific MIDI event types such as polyphonic or channel aftertouch. While Ecasound excels at multitrack audio processing, routing, and real-time effect handling, its MIDI functionality is primarily limited to MIDI clock synchronization, transport control, and mapping incoming Control Change (CC) messages to effect parameters. To reduce processing overhead caused by dense aftertouch data streams, you must strip these messages using an external MIDI processing utility before the data reaches your synthesizer or processing chain.

Ecasound's MIDI Capabilities and Limitations

Ecasound interacts with MIDI primarily via the ALSA sequencer subsystem or OSS MIDI devices. Its design focuses on:

Ecasound does not inspect, parse, or mutate the general stream of MIDI performance data (such as Note-On, Note-Off, Pitch Bend, or Aftertouch) passing through an arbitrary signal path. Because it lacks a native MIDI event transformation engine, it cannot drop, block, or filter raw Aftertouch (Status bytes 0xA0 for Polyphonic Key Pressure or 0xD0 for Channel Pressure) to lower message density.

Why Aftertouch Generates Overhead

Aftertouch sensors generate continuous, high-frequency streams of data when a performer varies pressure on the keys. In resource-constrained environments, this continuous data can saturate the ALSA sequencer buffer, trigger unnecessary CPU interrupts, and introduce latency into software synthesizers or DAW environments. Removing these messages is a common optimization when the receiving sound engine does not use pressure data.

The Solution: External MIDI Pre-Filtering

To prevent aftertouch messages from consuming processing bandwidth, you should filter the MIDI stream upstream before it enters your synth or DAW pipeline.

Using mididings

The most effective tool for this task on Linux systems is mididings, a Python-based MIDI router and processor. You can run a lightweight background script that discards aftertouch events entirely:

from mididings import *

run(
    Filter(AFTERTOUCH) >> Discard()
)

This ensures only desired messages (such as Note events, Pitch Bend, and relevant CC data) are passed through to ALSA client ports, completely removing the processing overhead of aftertouch from your audio setup.