Optical compressor model — RMS detector, wide knee, T4 program-dependent release (LA-2A class)
Listen
// "Local Forecast" by Kevin MacLeod (incompetech.com), CC BY 4.0, incompetech.com/music/royalty-free/faq.html
audio('/samples/music/modern/local-forecast.mp3').opto()
// "Local Forecast" by Kevin MacLeod (incompetech.com), CC BY 4.0, incompetech.com/music/royalty-free/faq.html
Parameters
threshold- −20 dB
- −60 to 0 dB
ratio- 3
- 1.5 to 6
knee- 10 dB
- 4 to 24 dB
attack- 10 ms
- 1 to 100 ms
makeup- 0 dB
- −12 to 24 dB
link- 0
- 0 to 1
Optical compressor model (LA-2A class) — RMS detection, wide soft knee, program-dependent release
import opto from '@audio/dynamics-opto'
Models a Teletronix LA-2A-style electro-optical gain cell: RMS-detected soft-knee compression (~3:1, wide 10 dB knee) plus the T4 cell's signature — release time that slows the longer gain reduction persists. An internal ~3 s memory of time-under-reduction stretches release up to 7× on sustained material, then relaxes back toward the nominal value once the signal clears.
opto(data, { threshold: -20, ratio: 3 }) // batch
opto(data) // defaults
let write = opto({ threshold: -20, ratio: 3 }) // streaming
let out1 = write(block1)
let tail = write() // flush
| Param | Default | |
|---|---|---|
threshold |
-20 |
dB |
ratio |
3 |
— |
knee |
10 |
dB (wide) |
attack |
10 |
ms |
release |
300 |
ms (nominal; program-dependent stretch multiplies this up to 7×) |
makeup |
0 |
dB |
sampleRate |
44100 |
Hz (alias fs) |
Use when: vocals, bass — smooth, program-dependent gain riding without pumping.
Not for: fast peak-catching character — use fet. Aggressive drive-dependent ratio — use varimu.
Part of @audio/dynamics — the dynamics family umbrella.
MIT © audiojs