Ecasound Custom Presets for Chain Operators

Ecasound fully supports combining multiple chain operators into reusable custom presets, allowing you to streamline complex signal-processing workflows. Instead of chaining dozens of individual parameters directly on the command line, you can bundle filters, envelopes, amplifiers, and LADSPA plugins into predefined modules. This guide explains how Ecasound presets function, how to configure them using preset files, and how to execute your custom processing chains.

Understanding Ecasound Chain Operator Presets

In Ecasound, a chain operator modifies an audio signal passing through a chain. Complex audio workflows often require stacking several operators together, such as applying a low-pass filter, adjusting the gain, and adding dynamic compression.

Ecasound enables you to define custom chain operator presets (often referred to as COP presets). These presets act as macros or aliases, grouping multiple operators under a single name. They also accept dynamic positional parameters, making them adaptable to different audio sources.

Preset Configuration and File Locations

Presets are defined in text-based configuration files. When Ecasound launches, it parses preset definitions from standard locations:

  • System-wide configuration: Typically located at /etc/ecasound/ecasoundrc or dedicated preset directories like /usr/share/ecasound/generic_presets/.
  • User-specific configuration: Located in your home directory at ~/.ecasound/ecasoundrc or within individual preset files stored in ~/.ecasound/presets/.

Creating a dedicated preset file inside ~/.ecasound/presets/ with the .cop extension is the cleanest approach for managing custom setups.

Defining Custom Preset Syntax

A preset definition consists of a preset name, an optional description, parameter definitions, and the list of chain operators to execute. Dynamic values are injected using positional placeholders like $1, $2, and so on.

Here is the general syntax used in a preset file:

preset_name = [description] ; operator1 , operator2 , ...

For a concrete implementation, consider a custom mastering filter that rolls off extreme low-end frequencies and boosts overall gain:

# Define a high-pass filter followed by an amplifier
clean_bass_boost = High-pass filter and gain ; -efh:$1,2 -ea:$2

In this definition:

  • clean_bass_boost is the identifier called from the command line.
  • High-pass filter and gain is an optional descriptive string.
  • -efh:$1,2 applies a high-pass filter using the first supplied argument as the cutoff frequency with a 2-pole resonance.
  • -ea:$2 applies an amplification factor using the second argument.

Calling Presets via the Command Line

Once your preset is saved in ~/.ecasound/ecasoundrc or a recognized preset file, call it using the -pn (preset name) chain operator option:

ecasound -i input.wav -pn:clean_bass_boost,80,120 -o output.wav

In this command:

  • -pn:clean_bass_boost,80,120 applies the preset.
  • 80 replaces $1 (setting the cutoff to 80 Hz).
  • 120 replaces $2 (applying a 120% volume boost).

Loading External Preset Files

If you create an independent preset file outside of the default search paths (such as my_effects.cop), load it explicitly during execution using the -pf flag:

ecasound -pf:my_effects.cop -i input.wav -pn:clean_bass_boost,80,120 -o output.wav

Benefits of Using Presets

  • Readability: Replaces dozens of verbose operator flags with clean, descriptive aliases.
  • Reusability: Allows the same multi-stage processing chains to be shared across shell scripts and interactive sessions.
  • Consistency: Guarantees that audio effects like normalization, equalization curves, and plugin routings are applied uniformly across different projects.