Configure FFmpeg Chorus Filter Delays Feedback and Speed
The FFmpeg chorus filter is a powerful tool for adding
depth and texture to audio files by simulating multiple voices or
instruments playing together. This article provides a straightforward
guide on how to configure the key parameters of the chorus
filter—specifically delays, feedback (decay), speeds, and
depths—enabling you to customize the intensity and character of the
chorus effect in your audio processing workflows.
Understanding the Chorus Filter Syntax
The basic syntax for the FFmpeg chorus filter is:
chorus=in_gain:out_gain:delays:decays:speeds:depthsWhen adding multiple voices to create the chorus effect, you specify
multiple values for delays, decays, speeds, and depths. Each voice's
parameters are separated by a pipe (|) symbol.
1. Configuring Delays
The delays parameter specifies the delay time in
milliseconds for each voice.
- Values: Typically between 20ms and 50ms.
- How it works: Shorter delays (around 20ms) create a tighter, more subtle double-tracking effect. Longer delays (above 40ms) create a more distinct, spacious separation between the original signal and the chorus voices.
- Syntax Example: For a three-voice chorus, you might
use
40|50|60to space out the entry of each voice.
2. Configuring Decays (Feedback/Volume)
The decays parameter controls the volume or attenuation
of each delayed voice relative to the input signal. It acts as the
feedback or mix level for each voice.
- Values: Decimal numbers between
0.0(silent) and1.0(maximum volume). Normal range is0.2to0.4. - How it works: Higher decay values make the chorus effect much more pronounced and louder, while lower values keep the effect subtle and blended in the background.
- Syntax Example:
0.3|0.25|0.3sets slightly different volumes for three voices to sound more natural.
3. Configuring Speeds
The speeds parameter determines the modulation speed of
the Low-Frequency Oscillator (LFO) in Hertz (Hz) for each voice.
- Values: Typically between
0.1and2.0Hz. - How it works: Speed controls how fast the pitch of
the chorus voice fluctuates. Lower speeds (e.g.,
0.2to0.5Hz) create a gentle, slow sweeping effect. Higher speeds (above1.5Hz) create a rapid vibrato or warbling effect. - Syntax Example:
0.25|0.4|0.3modulates each voice at a slightly different rate to prevent them from modulating in unison, which sounds more organic.
4. Configuring Depths
The depths parameter dictates the LFO modulation depth
in milliseconds. It determines how far the delay time deviates from the
set delays value.
- Values: Typically between
1.0and5.0ms. - How it works: Higher depths result in wider pitch variations, making the detuning effect of the chorus much more obvious. Lower depths keep the pitch modulation tight and subtle.
- Syntax Example:
2.0|2.5|1.5
Practical Command Examples
Subtle, Natural Chorus (Two Voices): This configuration uses moderate delays and slow speeds to add a gentle warmth to the audio.
ffmpeg -i input.mp3 -af "chorus=0.7:0.9:40|50:0.3|0.25:0.25|0.4:2.0|2.5" output.mp3Heavy, Sweeping Chorus (Three Voices): This configuration uses longer delays, higher decay levels, and distinct modulation speeds to create a thick, dramatic effect.
ffmpeg -i input.mp3 -af "chorus=0.5:0.9:50|60|70:0.4|0.35|0.3:0.5|0.7|0.9:3.0|3.5|4.0" output.mp3