How to Group Multiple Audio Chains in Ecasound

This article explains how to define, group, and route multiple audio chains within a single Ecasound command-line execution. By utilizing Ecasound's chain allocation flag (-a), audio engineers can split signals, process multiple streams concurrently, and assign inputs and outputs across individual or grouped processing paths. The guide covers chain selection syntax, input distribution across multiple chains, selective processing, and using wildcard groupings.

The Chain Concept in Ecasound

In Ecasound, an audio processing graph is composed of one or more chains. A chain is an independent signal flow that typically connects an input, zero or more audio operators (effects, filters, volume controls), and an output. By running multiple chains concurrently, you can build complex routing setups, such as crossover networks, multi-track recorders, and parallel effect processors.

Defining and Grouping Chains with the -a Flag

The -a (or --audio-chain) option is the primary mechanism for declaring and activating chains. Any inputs (-i), outputs (-o), or controllers (-e*, -c*) placed after an -a option apply exclusively to the chains specified by that flag.

To group multiple chains together, separate their identifiers with commas without spaces:

ecasound -a:chain1,chain2 [options]

When multiple chain names are grouped after -a, any configuration options that follow will apply simultaneously to every chain in that group.

Sharing Inputs Across Multiple Chains

A common use case for grouping chains is routing a single audio input into multiple parallel processing streams.

ecasound -a:low,high -i:audio.wav

In this command, audio.wav is assigned as the source for both the low and high chains. Rather than opening the file twice, Ecasound duplicates the stream internally.

Applying Independent Processing to Grouped Chains

After defining a shared input, you switch chain context by invoking -a again with specific individual chain names to apply unique filters, effects, and outputs.

Consider a simple two-way crossover filter applied to a single input file:

ecasound -a:low,high -i:source.wav \
         -a:low  -efl:800 -o:subwoofer.wav \
         -a:high -efh:800 -o:tweeter.wav

Breaking down the command execution:

  1. -a:low,high -i:source.wav: Creates chains low and high and assigns source.wav to both.
  2. -a:low -efl:800 -o:subwoofer.wav: Switches the active context to the low chain only, applies a low-pass filter at 800 Hz (-efl:800), and writes the result to subwoofer.wav.
  3. -a:high -efh:800 -o:tweeter.wav: Switches the active context to the high chain only, applies a high-pass filter at 800 Hz (-efh:800), and writes the result to tweeter.wav.

Grouping All Active Chains with all

Ecasound includes the reserved keyword all to group every chain declared in the current session. This is useful for applying universal settings, such as a master volume boost or an aggregate controller, across every existing chain without listing them manually:

ecasound -a:1 -i:drum.wav \
         -a:2 -i:bass.wav \
         -a:3 -i:synth.wav \
         -a:all -ea:90 \
         -a:all -o:alsa

In this configuration:

Numbered Chains vs. Named Chains

Ecasound supports both integer identifiers and alphanumeric strings for chain names.

Numeric chains are faster to write for simple pipelines, while descriptive named chains improve readability and prevent routing errors in complex multi-chain scripts. Both conventions follow the identical grouping rule: separate names with commas to group, and re-declare -a to isolate or regroup.