Multiband Compressor — v1.1 User Guide

3‑band multiband compressor with independent threshold, ratio, and makeup gain per band. Perfect reconstruction via low + high filtering and mid = original – low – high. v1.1 fixes the filter bank (no more crossover boosting) and replaces sample‑by‑sample clipping with proper envelope‑following compression (attack/release, gain reduction in dB).

Author: Shai Cohen Affiliation: Department of Music, Bar‑Ilan University, Israel Version: 1.1 (2025) – Perfect reconstruction, envelope‑following License: MIT License Repo: GitHub
Contents:

What this does

Multiband Compressor v1.1 splits the audio into three frequency bands (low, mid, high) using Hann band‑pass filters, compresses each band independently with its own threshold, ratio, and makeup gain, and then recombines them. The key improvements over v1.0 are:

Quick start

  1. In Praat, select exactly one Sound object.
  2. Run script…Multiband_Compressor.praat.
  3. Choose a Preset:
    • Master Bus, Vocal Polish, Bass Control, Brighten & Punch, De‑Harsh, Broadcast Ready, Lo‑Fi Crush
  4. For custom mode (preset = Custom), adjust parameters as desired:
    • Crossover frequencies: Low_mid and Mid_high (Hz).
    • Per‑band threshold, ratio, makeup gain.
    • Global attack and release (ms).
  5. Optionally choose a Solo band to listen to only low, mid, or high.
  6. Click OK. The script splits the sound, compresses each band, recombines, and imports the result as originalname_multiband (or originalname_BAND_solo).
Tip: Start with Master Bus for gentle glue, or Vocal Polish to control sibilance. Use solo mode to hear what each band is contributing.
Important: This effect is implemented entirely in Praat – no Python required. Compression uses envelope‑following at 1 kHz for speed, then resamples with sinc interpolation. For very short sounds (<0.1 s), the 1 kHz analysis may be coarse.

The 7 presets (+ Custom)

PresetCrossovers (Hz)LOW thresh/ratio/makeupMID thresh/ratio/makeupHIGH thresh/ratio/makeupDescription
Master Bus150 / 3000-18 dB / 2.0 / +1 dB-16 dB / 1.5 / 0 dB-14 dB / 2.0 / +1 dBGentle glue for full mixes.
Vocal Polish200 / 4000-24 dB / 4.0 / -2 dB-18 dB / 2.5 / +2 dB-20 dB / 2.0 / +1 dBControls plosives and sibilance.
Bass Control120 / 2500-15 dB / 6.0 / +3 dB-20 dB / 1.5 / 0 dB-18 dB / 1.5 / 0 dBTames low end while preserving clarity.
Brighten & Punch200 / 3500-18 dB / 3.0 / +2 dB-20 dB / 2.0 / 0 dB-12 dB / 2.5 / +3 dBAdds high‑end sparkle and low‑mid punch.
De‑Harsh250 / 2500-20 dB / 1.5 / 0 dB-16 dB / 3.0 / -1 dB-10 dB / 4.0 / -2 dBReduces harshness in upper mids.
Broadcast Ready150 / 3000-20 dB / 4.0 / +2 dB-18 dB / 3.0 / +2 dB-16 dB / 3.0 / +1 dBCompetitive loudness, radio‑style.
Lo‑Fi Crush300 / 2000-25 dB / 8.0 / +4 dB-22 dB / 6.0 / +3 dB-20 dB / 10.0 / +2 dBExtreme compression, distorted character.

Perfect reconstruction filter bank

📐 Splitting method

LOW = Hann band‑pass from 0 Hz to low_mid_crossover_Hz (100 Hz transition width).
HIGH = Hann band‑pass from mid_high_crossover_Hz to Nyquist (100 Hz transition).
MID = original – LOW – HIGH.

This guarantees that LOW + MID + HIGH = original exactly, regardless of filter shape or transition width. v1.0 used three overlapping Hann filters, which caused energy boost in the crossover regions and a phasy timbre.

The Hann band filters are implemented with Praat’s Filter (pass Hann band) using a 100 Hz smoothing width, which gives steep but smooth transitions. The subtraction method ensures perfect reconstruction even with these transitional slopes.

Envelope‑following compression

Each band is compressed using the following steps (no sample‑by‑sample distortion):

  1. Level detection at 1 kHz: Convert the band to an Intensity object (time step = 1 ms). This gives a dB‑domain envelope of the band’s RMS level.
  2. Gain reduction calculation: For each 1 ms frame, compute required gain reduction in dB:
    if level_dB > threshold_dB: gr_dB = (threshold_dB - level_dB) × (1 – 1/ratio)
    (negative values = attenuation). Convert to linear gain: gain = 10^(gr_dB/20).
  3. Attack/release smoothing: Apply exponential smoothing to the gain envelope at 1 kHz using per‑band attack/release coefficients (α = 1 – exp(–4.6 / samples) for a 99 % transition).
  4. Resample: Upsample the 1 kHz gain envelope to the audio sample rate using Praat’s sinc resampler (C‑level, fast).
  5. Apply: Multiply the band signal by the gain envelope, then by makeup gain (linear).

This approach ensures smooth, click‑free gain changes and preserves the waveform shape – only the amplitude envelope is modified.

Parameters & defaults

Crossover frequencies

ParameterRangeDefaultDescription
Low_mid_crossover_Hz20 … Nyquist200 HzBoundary between low and mid bands.
Mid_high_crossover_Hz20 … Nyquist2000 HzBoundary between mid and high bands.

Per‑band controls

ParameterRangeDefaultDescription
Low/Mid/High_threshold_dB‑∞ … 0-20 / -18 / -15Level above which compression begins (relative to band peak).
Low/Mid/High_ratio≥12.0 / 2.0 / 3.0Compression ratio (e.g., 2:1 means 2 dB input over threshold gives 1 dB output).
Low/Mid/High_makeup_dBany0 / 0 / 0Makeup gain applied after compression.

Global & output

ParameterRangeDefaultDescription
Attack_ms≥010 msTime for compression to engage.
Release_ms≥0100 msTime for compression to release.
Normalize_outputyes/noyesScale output peak to 0.95 (‑0.5 dBFS).
SoloOff / LOW / MID / HIGHOffListen to individual bands – useful for setting thresholds.
Visualizeyes/noyesShow input, bands, and output waveforms.
Playyes/noyesAuto‑play after processing.

Visualization (Praat picture)

When Visualize = 1, the script draws:

Tip: The band waveforms show exactly how much energy remains in each frequency region after compression. Use solo mode to verify that a band is being compressed correctly before mixing.

FAQ / troubleshooting

Compression sounds “pumpy” / gain changes are audible

Increase Attack_ms and Release_ms to soften the gain changes. Very fast attack/release (e.g., 1 ms) can produce audible modulation, especially on low frequencies.

Output is distorted / clipping

The compressor applies makeup gain after reduction. If the total makeup is too high, the output may clip. Reduce makeup gains or enable Normalize_output. You can also check the per‑band peak levels printed in the Info window.

Solo bands don’t sum to original when solo is off

The perfect reconstruction property guarantees LOW + MID + HIGH = original. If you hear a difference, check that you haven’t accidentally soloed a band – solo mode replaces the output with that band only.

Why 1 kHz envelope sampling?

The Intensity object computes RMS in overlapping windows. Using a 1 ms hop gives 1000 measurements per second – sufficient for audio compression (attack/release times are typically ≥1 ms). This speeds up processing dramatically compared to sample‑by‑sample analysis.

Threshold relative to band peak

The threshold is specified relative to the peak level of that band (not the original full‑band signal). For example, if the low band’s peak is 0 dBFS and threshold is set to -20 dB, compression starts 20 dB below that band’s peak. This makes thresholds independent of overall gain.