How to Use the FFmpeg Chorus Filter
The FFmpeg chorus filter is a powerful audio tool used
to make a single instrument or vocal sound like a larger group of
performers by adding multiple delayed and pitch-modulated copies of the
source signal. This article explains how the filter works, breaks down
its key parameters, and provides practical command-line examples to help
you apply professional-sounding chorus effects to your audio files.
Understanding the Chorus Filter Parameters
The chorus filter requires specific parameters to
control the behavior of the added voices. The basic syntax follows this
structure:
chorus=in_gain:out_gain:delays:decays:speeds:depths
Here is what each parameter represents:
- in_gain: The volume of the input signal (default is 0.4).
- out_gain: The volume of the output signal (default is 0.4).
- delays: A list of delays for each voice in milliseconds, separated by spaces or pipes (typically between 20ms and 50ms).
- decays: A list of volumes (gain) for each voice (usually between 0.2 and 0.4).
- speeds: A list of LFO (Low-Frequency Oscillator) speeds in Hz, which modulates the pitch of each voice (usually between 0.1Hz and 2Hz).
- depths: A list of modulation depths in milliseconds (typically between 1ms and 5ms).
Practical FFmpeg Chorus Examples
Example 1: Basic Stereo Chorus Effect
This command applies a standard chorus effect using one delayed voice, which is ideal for widening vocals or acoustic guitars.
ffmpeg -i input.mp3 -af "chorus=0.7:0.9:55:0.4:0.25:2" output.mp3In this example: * 0.7 and 0.9 represent
the input and output gains. * A single voice is added with a delay of
55 ms, a decay of 0.4, a modulation speed of
0.25 Hz, and a depth of 2 ms.
Example 2: Rich, Multi-Voice Chorus
To simulate a larger ensemble or a thicker, dreamier sound, you can
add multiple voices by separating the values with pipes (|)
inside the filter string.
ffmpeg -i input.wav -af "chorus=0.6:0.9:50|60|70:0.4|0.32|0.21:0.25|0.4|0.3:2|2.3|1.3" output.wavIn this multi-voice configuration: * Delays: Three separate voices are created with delays of 50ms, 60ms, and 70ms. * Decays: The volumes for these voices are set to 0.4, 0.32, and 0.21 respectively. * Speeds: The pitch modulation speeds are set to 0.25Hz, 0.4Hz, and 0.3Hz. * Depths: The modulation depths are set to 2.0ms, 2.3ms, and 1.3ms.
Tips for Tuning the Chorus Filter
- Avoid Clipping: Adding multiple voices can increase
the overall volume of your audio. If the output audio distorts, lower
the
out_gainor the individualdecaysvalues. - Natural Sounding Delays: Keep the delays above 20ms to avoid a metallic comb-filtering (flanger) effect, and below 100ms to prevent the voices from sounding like distinct echo repetitions.