Compression Effect Adder
Apply real dynamic range compression to audio files in your browser. Adjust threshold, ratio, attack, release, knee, and makeup gain. Download the processed result.
About
Dynamic range compression reduces the volume difference between the loudest and quietest parts of an audio signal. A compressor attenuates signal that exceeds a threshold by a defined ratio. Incorrect settings destroy transients, introduce pumping artifacts, or leave audio untouched. This tool applies real DSP compression via the Web Audio API's DynamicsCompressorNode, processing the entire file offline at full sample rate. The result is a downloadable WAV file. It assumes input is unmastered or requires dynamic control. It does not replace multi-band compression or limiting for broadcast-standard loudness (EBU R128 / ITU-R BS.1770).
Compression parameters interact nonlinearly. A fast attack below 5 ms clamps transients, reducing punch in percussive material. A high ratio above 10:1 approaches limiting behavior. The knee parameter controls the sharpness of the gain reduction curve around the threshold: a soft knee (20 - 30 dB) provides gentler onset. After compression, makeup gain restores perceived loudness. Monitor the before/after waveforms to verify you are not over-compressing.
Formulas
The compressor applies gain reduction GR to any signal exceeding the threshold. Below threshold, the signal passes unchanged. Above threshold, the output level is governed by:
where x = input level in dB, y = output level in dB, T = threshold in dB, R = ratio. The gain reduction at any instant is:
A soft knee (K in dB) creates a gradual transition zone from T โ K2 to T + K2 where the ratio ramps from 1:1 to the set R. Attack (ta) and Release (tr) define the time constants of the envelope follower that smooths the gain reduction signal, preventing instantaneous jumps. Makeup gain GM is applied post-compression as a linear gain multiplier:
where T = threshold (dBFS), R = compression ratio, K = knee width (dB), ta = attack time (s), tr = release time (s), GM = makeup gain multiplier.
Reference Data
| Preset | Threshold (dB) | Ratio | Attack (s) | Release (s) | Knee (dB) | Makeup (dB) | Use Case |
|---|---|---|---|---|---|---|---|
| Gentle Vocal | โ18 | 2.5:1 | 0.010 | 0.150 | 12 | +3 | Podcast, narration |
| Vocal Presence | โ24 | 4:1 | 0.005 | 0.100 | 6 | +6 | Lead vocals in a mix |
| Drum Bus Glue | โ14 | 3:1 | 0.020 | 0.200 | 10 | +4 | Cohesive drum group |
| Drum Slam | โ20 | 8:1 | 0.001 | 0.050 | 0 | +8 | Parallel / NY-style compression |
| Acoustic Guitar | โ16 | 3:1 | 0.015 | 0.120 | 8 | +3 | Evening out strumming dynamics |
| Bass Leveler | โ12 | 4:1 | 0.010 | 0.180 | 6 | +5 | Consistent bass level |
| Mix Bus | โ10 | 2:1 | 0.030 | 0.300 | 20 | +2 | Gentle stereo bus glue |
| Broadcast Limiter | โ6 | 20:1 | 0.001 | 0.050 | 0 | +6 | Broadcast / streaming ceiling |
| Transparent Master | โ8 | 1.5:1 | 0.025 | 0.250 | 30 | +1 | Mastering with minimal coloring |
| Speech De-Esser (approx) | โ30 | 6:1 | 0.001 | 0.030 | 2 | +0 | Taming sibilance (broadband approx) |
| Room Mic Crush | โ30 | 12:1 | 0.002 | 0.080 | 0 | +10 | Heavily compressed ambient mic |
| Finger-Picked Guitar | โ20 | 2:1 | 0.012 | 0.100 | 15 | +2 | Preserving dynamics while controlling peaks |
| Piano Dynamics | โ22 | 2.5:1 | 0.020 | 0.200 | 18 | +3 | Taming fortissimo without killing expression |
| Podcast Loud | โ16 | 5:1 | 0.003 | 0.080 | 4 | +7 | Maximized perceived loudness for spoken word |
| No Compression | 0 | 1:1 | 0.010 | 0.100 | 0 | +0 | Bypass / reference comparison |