How Envelope Modulation Works in Ecasound
This article provides an overview of envelope modulation in Ecasound, explaining how dynamic parameter automation controls audio processing over time. It details the relationship between audio processing operators and control envelopes, the underlying mechanics of parameter updates during a session, and how to configure linear and oscillating envelope controllers to shape your audio chains.
Understanding Ecasound Control Architecture
Ecasound treats signal processing and parameter automation as distinct, complementary components within an audio chain. While standard chain operators (such as amplifiers, filters, and delays) process incoming audio buffers, envelope modulation operators act as controllers that vary the parameters of those audio operators over time.
Rather than modifying the audio waveform directly, an envelope modulation operator targets a specific parameter of an active audio effect (such as the gain percentage of an amplifier or the cutoff frequency of a low-pass filter) and systematically alters its value according to a predetermined curve or algorithm.
How the Modulation Mechanism Functions
When an envelope operator is attached to an effect inside an Ecasound session, it operates on a control-rate cycle linked to the processing engine's buffer size:
- Parameter Targeting: The controller is assigned to an operator using the operator's index position in the chain and the specific parameter index that requires modulation.
- Value Calculation: At each processing block, the envelope controller calculates the next value based on the current session position, duration, and curve profile.
- Parameter Injection: The calculated value updates the target operator's internal variable before the current audio buffer is rendered.
- Buffer Processing: The target operator applies the updated parameter value across the incoming audio samples for that block.
Because updates occur at the control buffer boundary, the
responsiveness and smoothness of the envelope modulation are directly
influenced by the session’s buffer size (-b:buffersize).
Smaller buffers provide finer resolution and smoother envelope
transitions.
Types of Modulation Envelopes
Ecasound provides multiple controller types that function as envelope modulators:
- Linear Envelopes (
-km): Generates linear transitions between defined starting and ending values over a specified time duration. This is commonly used for automated fade-ins, fade-outs, and gradual filter sweeps. - Oscillating Envelopes (
-kos): Produces periodic waveforms (such as sine or triangle shapes) that continuously modulate a parameter between minimum and maximum bounds at a defined frequency, enabling effects like tremolo, auto-pan, or vibrato. - File-Based Envelopes (
-kl): Reads automation curves from external text files containing time-stamped parameter values. This allows for complex, multi-point envelopes and arbitrary modulation shapes that cannot be described by simple mathematical curves.
Operational Workflow in a Session
To execute envelope modulation inside an Ecasound session:
- Define the Signal Chain: Specify the audio source
and assign the primary effect operator (for example, the amplify
operator
-ea:100). - Attach the Controller: Declare the controller operator immediately following the target operator or link it via chain controller syntax. You must define the target parameter index, start value, end value, and duration.
- Execute the Engine: As Ecasound runs, the engine advances the playhead, updates the envelope controller, and recalculates the target effect's state until the envelope finishes or the stream terminates.
By decoupling the modulation logic from the signal processing algorithms, Ecasound enables precise, scriptable automation curves across any chain operator in real-time or offline processing.