audio

@audio/dynamics-gate0.2.0

Noise gate with hold-then-close logic and smoothed gain transitions

Status
pending calibration
Updated
Family
dynamics, 17 packages under it
Plugin
gate, effect, streaming, 8 parameters
Category
effects
Licence
MIT
Dependencies
1 package, all permissive: MIT
Downloads
4,394 last month
Tests
92 in audiojs/dynamics's CI, passed at 2ee3ad9,

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').gate()

// "Local Forecast" by Kevin MacLeod (incompetech.com), CC BY 4.0, incompetech.com/music/royalty-free/faq.html

Parameters

  • effect
  • streaming
  • key input
  • latency
threshold
−40 dB
−80 to 0 dB
closeThreshold
−46 dB
−90 to 0 dB
range
−60 dB
−90 to 0 dB
hold
10 ms
0 to 500 ms
attack
0.1 ms
0.01 to 100 ms
release
100 ms
1 to 1000 ms
lookaheadfixed
0 ms
0 to 50 ms
link
0
0 to 1
import gate from '@audio/dynamics-gate'

Noise gate with hysteresis, hold-then-close logic and look-ahead. Opens above threshold, closes only below closeThreshold (hysteresis prevents chatter around a single threshold); below it, signal is attenuated by range dB. A hold timer keeps the gate open after a drop-out; attack/release smooth the gain transitions. lookahead runs detection ahead of emission so the gate is already opening when a transient reaches the output — batch calls stay sample-aligned (no silence prefix, no dropped tail); block hosts get the delay declared as atom latency.

import gate from '@audio/dynamics-gate'

gate(data, { threshold: -40 })
gate(data, { threshold: -35, range: -80, hold: 20, attack: 1, release: 150, lookahead: 5 })
Param Default
threshold -40 dB, open above
closeThreshold threshold − 6 dB, close below (hysteresis)
range -60 dB attenuation when closed
hold 10 ms
attack 0.1 ms (opening)
release 100 ms (closing)
lookahead 0 ms, detection leads emission

Use when: drum mics, voice dialogue with ambient noise, removing hiss between phrases.
Not for: subtle low-level reduction — use expander.


Part of @audio/dynamics — the dynamics family umbrella. This README is generated from the umbrella docs.

MIT © audiojs