Studio Dynamic Compressor — User Guide
RMS-based downward compression with separate attack and release, quadratic soft knee, phase-safe multichannel linking, optional sidechain filtering, and explicit output-level policies.
What this does
The script applies one linked gain envelope to the selected Sound. It first builds an RMS-style detector from all input channels, optionally filters the sidechain, smooths the detected level with separate attack and release constants, converts the smoothed level to a gain-reduction curve, adds optional makeup gain, and multiplies that curve into every source channel.
sqrt(mean(channel²)), so opposite-polarity channels do not cancel each other. The same final gain curve is then applied to every channel.The processor is an offline RMS compressor. Even the two fastest presets are not sample-accurate peak limiters. The optional sidechain filters are zero-phase frequency-domain filters, which are useful offline but are acausal and can create a small amount of gain movement before a transient.
Quick start
- Select exactly one Sound object. Mono, stereo, and wider multichannel Sounds are supported.
- Run
Compressor.praat. - Choose a preset or leave Custom.
- Set threshold, ratio, knee, attack, release, and makeup behavior.
- Enable Advanced settings only when detector, sidechain, output policy, statistics, or original-object handling needs to be changed.
- Run the processor. The result remains selected and can optionally be played.
Controls
Main form
| Control | Default | Implemented behavior |
|---|---|---|
| Preset | Custom | Selects one of six fixed starting configurations. Presets override several detector and dynamics fields; details are listed below. |
| Threshold_dB | −20.0 | Detector level at which compression begins. No fixed GUI range is enforced. |
| Ratio | 4.0 | Downward-compression ratio. The script rejects values below 1:1. |
| Knee_dB | 6.0 | Width of the quadratic soft-knee region. 0 gives a hard knee; negative values are rejected. |
| Attack_ms | 10 | Smoothing time used when the detected level rises. |
| Release_ms | 100 | Smoothing time used when the detected level falls. |
| Makeup_gain_dB | 0.0 | Flat gain added after gain reduction. If Auto makeup is on, this value is replaced by the script's automatic estimate. |
| Auto_makeup | Yes | Computes makeup from threshold and ratio; it is not loudness matching or input/output RMS matching. |
| Advanced_settings | No | Opens the detector/output-policy dialog. |
| Draw_result | Yes | Draws transfer, waveform, metering, gain-reduction, and summary panels. |
| Play_result | Yes | Plays the final Sound after processing. |
Advanced settings
| Control | Default | Implemented behavior |
|---|---|---|
| Rms_window_ms | 8.0 | Controls the Praat Intensity analysis window through pitch_floor = 3.2 / window_seconds. |
| Detector_update_ms | 2.0 | Time step of the Intensity analysis. |
| Sidechain_filter | Off | Off; high-pass 80 Hz; high-pass 150 Hz; or low-pass 8 kHz. Filtering is detector-only. |
| Output_mode | Limiter (scale down only if needed) | Three final level policies are available. In this guide the middle mode is described more precisely as a peak ceiling; it is global scaling, not a dynamic limiter. |
| Scale_peak | 0.99 | Target used by the scale-down and normalize modes. Must be >0 and ≤1. |
| Show_stats | Yes | Reports output peak, output RMS, and maximum compression-only gain reduction. |
| Keep_original | Yes | If disabled, the original Sound is removed after successful processing. |
Factory presets
| Preset | Threshold | Ratio | Knee | A / R | RMS / update | Makeup | Sidechain | Suffix |
|---|---|---|---|---|---|---|---|---|
| Vocal Leveler | −24 dB | 2.5:1 | 8 dB | 15 / 150 ms | 15 / 3 ms | +4 dB, Auto off | HP 150 Hz | _Vocal |
| Drum Punch | −18 dB | 6:1 | 3 dB | 1 / 50 ms | 3 / 1 ms | +3 dB, Auto off | Off | _Drum |
| Mix Bus Glue | −14 dB | 2:1 | 10 dB | 30 / 200 ms | 25 / 5 ms | +2 dB, Auto off | Off | _Bus |
| Fast Compressor RMS | −3 dB | 20:1 | 0 dB | 0.5 / 50 ms | 2 / 0.5 ms | 0 dB, Auto off | Off | _FastComp |
| Squash | −30 dB | 10:1 | 6 dB | 5 / 80 ms | 5 / 1 ms | +8 dB, Auto off | Off | _Squash |
| NUKE Extreme RMS | −40 dB | 100:1 | 0 dB | 0.5 / 30 ms | 2 / 0.5 ms | +15 dB, Auto off | Off | _NUKE |
Custom uses suffix _Comp. Every preset preserves the source duration, sample rate, and channel count because compression is applied to a copy of the selected Sound.
Detector and sidechain
Phase-safe linked detector
This prevents anti-phase channels from cancelling the detector. A mono Sound and the same mono signal duplicated across two identical channels therefore drive the linked detector consistently.
Sidechain filters
| Mode | Praat filter | Purpose / limitation |
|---|---|---|
| Off | None | Full-band detector. |
| Highpass 80 Hz | Pass Hann band: 80 Hz → Nyquist, 50 Hz smoothing | Reduces low-bass influence on gain reduction. |
| Highpass 150 Hz | Pass Hann band: 150 Hz → Nyquist, 50 Hz smoothing | Further reduces low-frequency influence; the Vocal preset uses this mode. |
| Lowpass 8 kHz | Pass Hann band: DC → 8 kHz, 50 Hz smoothing | Reduces high-frequency contribution to the detector. It is explicitly not a dedicated de-esser. |
Praat's Hann-band frequency-domain filtering is zero-phase. That avoids phase shift in the detector path, but its symmetric impulse response is acausal, so gain movement can begin slightly before a transient. The filter also has a Nyquist validation check before processing.
RMS-style level conversion
The linked magnitude signal is passed to Praat's Intensity analysis with subtract mean = no. The script then applies a fixed calibration offset:
This follows Praat's pressure convention (reference pressure 2×10−5 Pa) and keeps a sidechain filter's level change intact. It is an approximation to a conventional rectangular-window RMS meter because Praat's Intensity analysis uses its own analysis window.
Attack and release
The detector is smoothed in the dB domain. Rising detector values use the attack constant; falling values use the release constant. For each direction:
Compression law
Gain reduction is computed from the smoothed detector level. With a hard knee (Knee_dB = 0), levels below threshold pass unchanged and levels above threshold follow the selected ratio.
For a non-zero knee, the transition region extends from threshold − knee/2 to threshold + knee/2. Inside that region the script uses the standard quadratic interpolation:
The visualization's transfer curve uses the same formula as the audio engine. That graph shows the static compression law only: it does not include makeup gain, sidechain timing, attack/release behavior, or final output scaling.
Auto makeup
Auto makeup is a fixed heuristic, not loudness matching:
When Auto makeup is enabled, this calculated value replaces the manual Makeup gain value for the run.
Output policies
| Mode | Exact behavior | Effect on makeup gain |
|---|---|---|
| Preserve level | No final scaling. If the processed peak exceeds 0 dBFS, the Info window warns but the Sound is left unchanged. | Fully preserved. |
| Limiter (scale down only if needed) | If the final peak exceeds Scale_peak, Praat scales the entire file down so its peak equals the target. If it is already below the target, no scaling occurs. | Preserved unless the global peak ceiling is hit. |
| Normalize to target | For any non-silent result, Praat scales the entire file so its peak equals Scale_peak. | The absolute magnitude of makeup gain is cancelled by the subsequent normalization. |
The default target is 0.99. The script rejects targets ≤0 or >1. A fully silent result is left silent in Normalize mode rather than being passed to Scale peak.
Visualization
When Draw result is enabled, the Picture window shows:
- Transfer curve: input dB vs output dB, including threshold and knee region. This is the static compression curve before makeup and output scaling.
- Waveform comparison: source in gray and final processed output in green. The amplitude range is shared and is chosen from both input and output extrema.
- Metering: input/output peak and RMS plus maximum compression-only gain reduction and makeup value.
- Gain-reduction timeline: compression gain in dB with makeup subtracted from the display, so 0 dB means no compression and negative values show reduction.
- Summary: threshold, ratio, knee, attack, release, sidechain selection, makeup, gain reduction, peak, and RMS values.
The waveform and gain-reduction panels use the Sound's actual xmin/xmax; they do not assume the file starts at 0 seconds.
Notes and limitations
- The detector is RMS-style and frame-based; it does not guarantee sample-peak containment.
- Praat Intensity is used as the detector analysis engine, so
Rms_window_mscontrols it indirectly through the script's3.2 / windowmapping rather than creating a literal rectangular RMS window. - Sidechain filters affect detection only; the source audio itself is not EQ'd.
- Zero-phase sidechain filtering is offline/acausal and may produce slight pre-transient gain movement.
- All channels share one linked gain curve; there is no independent per-channel compression.
- There is no dedicated look-ahead buffer, true-peak detector, brick-wall limiter, multiband split, external sidechain input, or dry/wet mix.
- Threshold has no fixed form range. Ratio must be ≥1 and knee ≥0.