Studio Dynamic Compressor — User Guide
Professional RMS-based dynamics processing: transparent level control with auto-calibration, 6 factory presets, and mathematical compression curves for broadcast-quality results.
What this does
This script implements a professional-grade dynamic compressor using RMS-based detection with automatic calibration for accurate level matching. The processor analyzes input levels, applies precise gain reduction based on mathematical compression curves, and automatically compensates with makeup gain. Key features include: (1) RMS detection: Uses Praat's Intensity object for perceptually accurate level measurement. (2) Auto-calibration: Automatically matches envelope levels to input signal for precise threshold operation. (3) 6 factory presets: Optimized settings for vocals, drums, mix bus, limiting, and creative effects. (4) Mathematical compression: Pure algorithmic processing without look-ahead artifacts. (5) Professional workflow: Automatic naming, peak normalization, and cleanup.
Key Features:
- RMS Detection — Perceptually accurate level measurement
- Auto-Calibration — Automatic envelope level matching
- 6 Factory Presets — Professional starting points
- Mathematical Compression — Precise gain reduction curves
- Time Constant Control — Unified attack/release window
- Makeup Gain — Automatic level compensation
Technical Implementation: (1) Input analysis: Measure peak level and convert to dBFS. (2) Envelope generation: Create RMS envelope using Praat's Intensity object with calculated frequency response. (3) Auto-calibration: Shift envelope to match input levels for accurate threshold operation. (4) Gain computation: Apply mathematical compression formula to generate gain reduction curve. (5) Makeup gain: Apply calculated gain compensation. (6) Signal application: Multiply audio by gain envelope for final compression. (7) Output management: Peak normalization, automatic naming, and cleanup.
Quick start
- In Praat, select exactly one Sound object.
- Run script… →
studio_dynamic_compressor.praat. - Choose Preset from dropdown:
- Vocal Leveler: Smooth vocal compression
- Drum Punch: Fast, aggressive drum control
- Mix Bus Glue: Gentle bus compression
- Hard Limiter: Peak control and protection
- Squash: Heavy creative compression
- NUKE: Extreme effect compression
- Or select Custom and adjust:
- Threshold_dB: Compression start point
- Ratio: Amount of compression
- Attack_Release_window: Time response
- Makeup_Gain_dB: Output level compensation
- Set Scale_peak (0.99 recommended)
- Enable Play_result for immediate audition
- Enable Keep_original to preserve source
- Click OK — processed sound created with descriptive suffix
Compression Theory
Dynamic Range Fundamentals
What is Dynamic Range?
Audio level variation:
Compression Parameters
Key control parameters:
🎛️ Compression Controls
Threshold:
- Level where compression begins
- Below threshold: no effect
- Above threshold: gain reduction applied
- Typical range: -40 dB to 0 dB
Ratio:
- Amount of compression above threshold
- 2:1 = gentle, 4:1 = medium, 10:1 = heavy
- ∞:1 = limiting (no signal above threshold)
- Our range: 1.5:1 to 100:1
Time Constants:
- How fast compressor responds to level changes
- Fast: aggressive, punchy
- Slow: smooth, transparent
- Our implementation: Unified attack/release window
RMS vs Peak Detection
Detection Method Differences
RMS (Root Mean Square):
Perceptual Advantages
Why RMS sounds more natural:
Scenario: Drum hit with sharp transient
Peak detection: Sees transient peak → heavy compression
RMS detection: Sees average level → moderate compression
Result:
Peak: Transient suppressed, "flat" sound
RMS: Transient preserved, natural dynamics
Human hearing:
We perceive loudness based on average power, not peaks
RMS matches our perceptual experience
Creates more transparent, musical compression
Exception: Peak limiting for protection still needed
Compression Mathematics
Gain Reduction Formula
Mathematical compression curve:
Compression Curve Visualization
Input/Output Transfer Characteristics:
Ratio 1:1 | 2:1 | 4:1 | 10:1 | ∞:1
-40dB → -40 | -40 | -40 | -40 | -40
-30dB → -30 | -30 | -30 | -30 | -30
-20dB → -20 | -20 | -20 | -20 | -20
-10dB → -10 | -15 | -17.5| -19 | -20
0dB → 0 | -10 | -15 | -18 | -20
Threshold = -20 dB, makeup gain applied for visualization
Processing Algorithm
Auto-Calibration System
Input Level Measurement
Precise level matching:
Time Constant Calculation
Attack/Release Response:
Gain Computation
Mathematical Compression
Precise gain reduction:
Makeup Gain Strategy
Level compensation:
Purpose: Compensate for level loss from compression
Without makeup gain: Compressed signal is quieter
Automatic calculation in presets:
Vocal: +4dB (moderate compression)
Drum: +3dB (fast, aggressive)
Mix Bus: +1dB (gentle, transparent)
Limiter: 0dB (peak control only)
Squash: +8dB (heavy compression)
NUKE: +12dB (extreme effect)
Manual adjustment:
- Listen for consistent perceived loudness
- Avoid excessive gain that causes noise
- Match to target loudness standards if needed
Peak normalization: Final safety net to prevent clipping
Signal Application
Final Processing Stage
Gain envelope application:
Complete Processing Pipeline
Factory Presets
Vocal Leveler (Smooth)
| Parameter | Value | Rationale |
|---|---|---|
| Threshold | -24.0 dB | Catches most vocal phrases |
| Ratio | 2.5:1 | Gentle, transparent compression |
| Time Window | 0.08 s | Smooth, musical response |
| Makeup Gain | +4.0 dB | Compensates for level reduction |
| Suffix | _Vocal | Clear identification |
🎤 Vocal Compression Characteristics
Best for: Lead vocals, spoken word, vocal ensembles
Sonic character: Smooth, transparent, controlled
Technical notes: Gentle ratio prevents "pumping", slow attack preserves transients, smooth release maintains natural decay
Drum Punch (Fast & Hard)
| Parameter | Value | Rationale |
|---|---|---|
| Threshold | -18.0 dB | Catches drum peaks |
| Ratio | 6.0:1 | Aggressive control |
| Time Window | 0.02 s | Fast, punchy response |
| Makeup Gain | +3.0 dB | Brings up body and sustain |
| Suffix | _Drum | Clear identification |
🥁 Drum Compression Characteristics
Best for: Drum buses, individual drums, percussion
Sonic character: Punchy, aggressive, controlled
Technical notes: Fast attack controls transients, high ratio adds density, makeup gain emphasizes body and sustain
Mix Bus Glue (Gentle)
| Parameter | Value | Rationale |
|---|---|---|
| Threshold | -12.0 dB | Only catches peaks |
| Ratio | 1.5:1 | Very gentle compression |
| Time Window | 0.10 s | Slow, transparent response |
| Makeup Gain | +1.0 dB | Minimal compensation |
| Suffix | _Bus | Clear identification |
🎚️ Mix Bus Compression Characteristics
Best for: Stereo mixes, subgroup buses, mastering
Sonic character: Cohesive, transparent, "glued"
Technical notes: Very gentle ratio for transparency, slow timing for smooth operation, minimal makeup gain preserves dynamics
Hard Limiter (Peak Control)
| Parameter | Value | Rationale |
|---|---|---|
| Threshold | -6.0 dB | Catches only extreme peaks |
| Ratio | 20.0:1 | Effectively limiting |
| Time Window | 0.005 s | Very fast response |
| Makeup Gain | 0.0 dB | Pure peak control |
| Suffix | _Lim | Clear identification |
Squash (Heavy Effect)
| Parameter | Value | Rationale |
|---|---|---|
| Threshold | -30.0 dB | Compresses most of signal |
| Ratio | 10.0:1 | Heavy compression |
| Time Window | 0.05 s | Medium response |
| Makeup Gain | +8.0 dB | Significant compensation |
| Suffix | _Squash | Clear identification |
NUKE (Very Aggressive)
| Parameter | Value | Rationale |
|---|---|---|
| Threshold | -40.0 dB | Compresses everything |
| Ratio | 100.0:1 | Extreme compression |
| Time Window | 0.015 s | Fast, aggressive response |
| Makeup Gain | +12.0 dB | Maximum compensation |
| Suffix | _NUKE | Clear identification |
- Vocal Leveler: Everyday vocal compression
- Drum Punch: Aggressive drum control
- Mix Bus Glue: Subtle mix cohesion
- Hard Limiter: Peak protection only
- Squash: Creative heavy compression
- NUKE: Extreme effect processing
Parameters & Settings
Compression Parameters
| Parameter | Range | Default | Description |
|---|---|---|---|
| Threshold_dB | -60 to 0 | -20.0 | Level where compression begins |
| Ratio | 1.0-100.0 | 4.0 | Compression amount above threshold |
Time Parameters
| Parameter | Range | Default | Description |
|---|---|---|---|
| Attack_Release_window | 0.001-1.0 | 0.05 | Combined attack/release time |
Output Parameters
| Parameter | Range | Default | Description |
|---|---|---|---|
| Makeup_Gain_dB | -20 to +20 | 2.0 | Output level compensation |
| Scale_peak | 0.1-1.0 | 0.99 | Final peak normalization |
| Play_result | boolean | 1 | Auto-play after processing |
| Keep_original | boolean | 1 | Preserve source sound |
Parameter Guidance
- -40 to -30 dB: Heavy compression (most of signal)
- -30 to -20 dB: Medium compression
- -20 to -10 dB: Light compression (only peaks)
- -10 to 0 dB: Limiting (extreme peaks only)
- 1.5:1 to 2:1: Very gentle, transparent
- 2:1 to 4:1: Moderate, musical
- 4:1 to 8:1: Heavy, obvious compression
- 8:1 to 20:1: Very heavy, limiting territory
- 20:1+: Hard limiting
- 0.005-0.02s: Very fast (drums, percussion)
- 0.02-0.05s: Fast (vocals, bass)
- 0.05-0.10s: Medium (general purpose)
- 0.10-0.20s: Slow (mix bus, mastering)
- 0.20s+: Very slow (special effects)
Applications
Vocal Processing
Use case: Consistent vocal levels in mixes
Technique: Use Vocal Leveler preset with medium threshold
Benefits: Smooth level control, preserved expression, reduced manual automation
Drum Enhancement
Use case: Adding punch and density to drums
Technique: Use Drum Punch preset on drum buses or individual drums
Results: Controlled transients, enhanced sustain, cohesive drum sound
Mix Bus Processing
Use case: Creating cohesive final mixes
Technique: Use Mix Bus Glue preset on stereo mix
Benefits: Gentle cohesion, controlled peaks, "glued" sound
Creative Effects
Use case: Extreme compression for artistic effect
Technique: Use Squash or NUKE presets on various sources
Results: Pumping, breathing, aggressive textures
Practical Workflow Examples
🎤 Lead Vocal Compression
Goal: Smooth, consistent vocal level without artifacts
Setup:
- Preset: Vocal Leveler
- Source: Lead vocal recording
- Adjustment: Lower threshold if more compression needed
- Result: Professional vocal sound
Tip: Compare with/without compression to ensure transparency
🥁 Drum Bus Punch
Goal: Aggressive, punchy drum sound
Setup:
- Preset: Drum Punch
- Source: Drum bus or individual drum
- Adjustment: Increase ratio for more aggression
- Result: Powerful, controlled drums
Tip: Use parallel compression for extreme effects
🎚️ Mix Bus Glue
Goal: Cohesive final mix
Setup:
- Preset: Mix Bus Glue
- Source: Stereo mix
- Adjustment: Very subtle - listen for "glue" not obvious compression
- Result: Professional, cohesive mix
Tip: A/B compare to ensure transparency
Advanced Techniques
- Method: Process copy with heavy compression, mix with dry signal
- Benefits: Density without losing transients
- Presets: Use Squash or NUKE for parallel processing
- Result: Best of both worlds - dynamics and density
- Stage 1: Gentle compression with Vocal Leveler
- Stage 2: Aggressive compression with Drum Punch
- Stage 3: Final control with Hard Limiter
- Result: Complex, professional compression chain
Troubleshooting Common Issues
Cause: Too fast release time or too low threshold
Solution: Increase time window, raise threshold, or reduce ratio
Cause: Too fast attack time or too low threshold
Solution: Increase time window, raise threshold, or use parallel compression
Cause: Too much makeup gain with heavy compression
Solution: Reduce makeup gain, use less compression, or address noise at source
Cause: Threshold too high or ratio too low
Solution: Lower threshold, increase ratio, or check auto-calibration
Algorithmic Extensions
Advanced Detection Methods
Multi-band Compression
Frequency-dependent compression:
Advanced Time Constants
Separate Attack/Release
Independent time control:
Advanced Metering
Comprehensive Level Analysis
Professional monitoring: