Ecasound Command-Line Syntax Structure Explained

This article provides an overview of the core syntax architecture required to build commands in Ecasound, a multitrack audio processing tool for Unix-like systems. Readers will learn how Ecasound organizes audio routing through the interaction of global engine options, chains, audio inputs, audio outputs, and chain operators (effects and filters).

The Core Invocation Template

At its most fundamental level, an Ecasound command follows this sequential structure:

ecasound [global_options] [chain_definition] [chain_operators] [inputs_and_outputs]

Ecasound operates on the concept of chains. A chain is an independent audio signal path. Inputs feed audio into a chain, operators modify the audio within the chain, and outputs collect the processed stream.

Key Syntax Components

  1. Global Options Global options affect the behavior of the entire engine rather than individual audio streams. Common global options include:

    • -c: Starts Ecasound in interactive mode.
    • -B:mode: Sets the buffering mode (e.g., auto, nonrt, rt, rtlowlatency).
    • -r:rate: Sets the global sampling rate in Hz (e.g., -r:44100).
    • -b:size: Sets the buffer size in sample frames.
  2. Chain Selection (-a) The -a switch assigns subsequent inputs, outputs, and operators to a specific chain or comma-separated list of chains.

    • Example: -a:1 assigns following parameters to Chain 1.
    • Example: -a:1,2 applies the following parameters simultaneously to both Chain 1 and Chain 2.
    • Example: -a:all targets all existing chains.
  3. Audio Inputs (-i) and Outputs (-o) Inputs and outputs are attached to the currently selected chain(s). Ecasound supports standard audio files, ALSA/JACK devices, and null sources:

    • Input syntax: -i:source_type,parameter (e.g., -i:track1.wav, -i:alsa,default, -i:null).
    • Output syntax: -o:target_type,parameter (e.g., -o:master.wav, -o:alsa,hw:0).
  4. Chain Operators (-e*, -f*, -c*) Chain operators perform digital signal processing (DSP) sequentially on the audio traveling through the selected chain:

    • Volume/Amp: -ea:gain_% (e.g., -ea:200 for a 200% volume boost).
    • Filters: -efl:frequency (low-pass filter) or -efh:frequency (high-pass filter).
    • Routing: -erc:from_channel,to_channel or -chcopy:from,to to control channel mapping.

Complete Syntactical Example

A complete multi-track invocation combines these elements into a single execution:

ecasound -B:rt -a:1 -i:vocals.wav -ea:120 -efh:150 -a:2 -i:beat.wav -ea:90 -a:1,2 -o:alsa,default

In this structure: