Creating Sub-Mix Chains in Ecasound

This article explains how to construct sub-mix chains inside an Ecasound configuration by routing multiple audio streams into intermediary buses. In Ecasound, sub-mixing is achieved using virtual loop devices, which collect audio outputs from multiple individual chains and redirect them as a combined input into a secondary processing chain before reaching the final master output.

The Loop Device Mechanism

Ecasound uses the loop object syntax (loop,id) to pass audio internally between chains without writing to physical disk storage or external sound cards. To create a sub-mix:

  1. Route the outputs of source chains to a designated loop device: -o:loop,name
  2. Assign that same loop device as the input for a processing or bus chain: -i:loop,name

Any chains that output to the same loop identifier are automatically summed together, effectively functioning as a sub-mix bus.

Core Syntax Structure

When executing via the command line or within an .ecs preset file, define the individual inputs, direct them to a shared loop, and attach the loop to a final target chain:

ecasound \
  -a:track1 -i:kick.wav -ea:100 -o:loop,drums \
  -a:track2 -i:snare.wav -ea:90 -o:loop,drums \
  -a:drum_bus -i:loop,drums -efl:800 -o:alsa

Breakdown of the Configuration Parameters

Multi-Bus Sub-Mixing Example

To route multiple sub-mixes (for example, drums and synths) into a final master output bus:

ecasound \
  -a:drum1 -i:drum1.wav -o:loop,drums \
  -a:drum2 -i:drum2.wav -o:loop,drums \
  -a:synth1 -i:lead.wav -o:loop,synths \
  -a:synth2 -i:pad.wav -o:loop,synths \
  -a:drum_bus -i:loop,drums -ea:110 -o:loop,master \
  -a:synth_bus -i:loop,synths -ea:95 -o:loop,master \
  -a:master -i:loop,master -epp:50 -o:final_output.wav

In this setup, drum1 and drum2 sum into loop,drums, which is managed by the drum_bus chain. Similarly, the synths sum into loop,synths. Both buses are then processed and routed to loop,master, which handles global gain and stereo panning before exporting to a physical output file.