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).
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:
- Perfect reconstruction – low and high are filtered; mid = original – low – high. This ensures that low + mid + high = original exactly, eliminating the phasy crossover‑boost artefacts of v1.0.
- Envelope‑following compression – gain reduction is computed from the band’s RMS level
(measured at 1 kHz), smoothed with attack/release, resampled, and applied as a gain envelope. v1.0 used a sample‑by‑sample
Formulathat distorted the waveform. - Attack, release, and makeup gain are now properly implemented and effective.
- Solo mode allows listening to individual bands for fine‑tuning.
Quick start
- In Praat, select exactly one Sound object.
- Run script… →
Multiband_Compressor.praat. - Choose a Preset:
- Master Bus, Vocal Polish, Bass Control, Brighten & Punch, De‑Harsh, Broadcast Ready, Lo‑Fi Crush
- 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).
- Optionally choose a Solo band to listen to only low, mid, or high.
- Click OK. The script splits the sound, compresses each band, recombines, and imports the result as
originalname_multiband(ororiginalname_BAND_solo).
The 7 presets (+ Custom)
| Preset | Crossovers (Hz) | LOW thresh/ratio/makeup | MID thresh/ratio/makeup | HIGH thresh/ratio/makeup | Description |
|---|---|---|---|---|---|
| Master Bus | 150 / 3000 | -18 dB / 2.0 / +1 dB | -16 dB / 1.5 / 0 dB | -14 dB / 2.0 / +1 dB | Gentle glue for full mixes. |
| Vocal Polish | 200 / 4000 | -24 dB / 4.0 / -2 dB | -18 dB / 2.5 / +2 dB | -20 dB / 2.0 / +1 dB | Controls plosives and sibilance. |
| Bass Control | 120 / 2500 | -15 dB / 6.0 / +3 dB | -20 dB / 1.5 / 0 dB | -18 dB / 1.5 / 0 dB | Tames low end while preserving clarity. |
| Brighten & Punch | 200 / 3500 | -18 dB / 3.0 / +2 dB | -20 dB / 2.0 / 0 dB | -12 dB / 2.5 / +3 dB | Adds high‑end sparkle and low‑mid punch. |
| De‑Harsh | 250 / 2500 | -20 dB / 1.5 / 0 dB | -16 dB / 3.0 / -1 dB | -10 dB / 4.0 / -2 dB | Reduces harshness in upper mids. |
| Broadcast Ready | 150 / 3000 | -20 dB / 4.0 / +2 dB | -18 dB / 3.0 / +2 dB | -16 dB / 3.0 / +1 dB | Competitive loudness, radio‑style. |
| Lo‑Fi Crush | 300 / 2000 | -25 dB / 8.0 / +4 dB | -22 dB / 6.0 / +3 dB | -20 dB / 10.0 / +2 dB | Extreme 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):
- 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.
- 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). - 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). - Resample: Upsample the 1 kHz gain envelope to the audio sample rate using Praat’s sinc resampler (C‑level, fast).
- 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
| Parameter | Range | Default | Description |
|---|---|---|---|
| Low_mid_crossover_Hz | 20 … Nyquist | 200 Hz | Boundary between low and mid bands. |
| Mid_high_crossover_Hz | 20 … Nyquist | 2000 Hz | Boundary between mid and high bands. |
Per‑band controls
| Parameter | Range | Default | Description |
|---|---|---|---|
| Low/Mid/High_threshold_dB | ‑∞ … 0 | -20 / -18 / -15 | Level above which compression begins (relative to band peak). |
| Low/Mid/High_ratio | ≥1 | 2.0 / 2.0 / 3.0 | Compression ratio (e.g., 2:1 means 2 dB input over threshold gives 1 dB output). |
| Low/Mid/High_makeup_dB | any | 0 / 0 / 0 | Makeup gain applied after compression. |
Global & output
| Parameter | Range | Default | Description |
|---|---|---|---|
| Attack_ms | ≥0 | 10 ms | Time for compression to engage. |
| Release_ms | ≥0 | 100 ms | Time for compression to release. |
| Normalize_output | yes/no | yes | Scale output peak to 0.95 (‑0.5 dBFS). |
| Solo | Off / LOW / MID / HIGH | Off | Listen to individual bands – useful for setting thresholds. |
| Visualize | yes/no | yes | Show input, bands, and output waveforms. |
| Play | yes/no | yes | Auto‑play after processing. |
Visualization (Praat picture)
When Visualize = 1, the script draws:
- Input waveform (grey).
- LOW band (red), MID band (green), HIGH band (blue) after compression.
- Output waveform (purple).
- Band info panel – colour‑coded rectangles showing threshold and ratio for each band.
FAQ / troubleshooting
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.
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.
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.
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.
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.