audioeffects.noisegate

NoiseGate - a noise gate after the Drawmer DS201.

The player’s text is the class docstring; the CLAIMS table in the class’s test file ties its claim sentences to tests.

audioeffects.noisegate.MINIMUM_HOLD_MS = 2.0

452` is on only when hold_frames != 0, and below that the node is the memoryless computer with its over * 8.0f slope, no hold and no one-shot. The Hold macro’s floor is what keeps it on: 2 ms is 96 frames at 48 kHz and 44 at 22.05 kHz, so no rate reachable here rounds it to zero.

Type:

The gate machine in `audiodsp_dynamics.c

audioeffects.noisegate.INVERTING_LEVEL = -32768

(a * -32768) >> 15 == -a on signed int16 (audiodsp_multiply.c:38). +32767 does not - it is the WIRE planted fault, 32767/32768 - which is why a built duck graph cannot be switched back to a plain gate by levels alone.

Type:

The one modulator value that inverts exactly

audioeffects.noisegate.SILENT_DB = -120.0

Range is a depth, and 0 dB of ducking is no ducking. 20*log10(0) is not a number, so the duck’s blend gain floors here instead; -120 dB leaves the dry path a wire to well under an LSB.

class audioeffects.noisegate.NoiseGate(source, *options, **keywords)[source]

Bases: Component

A noise gate after the Drawmer DS201: below the Threshold your signal is held down, and above it the gate opens and lets it through.

Controls. Threshold is the level where the gate opens. Range is how far the closed gate holds the signal down, with 0 dB where the output is the input; it is a fixed depth, however far under the Threshold the signal falls. A crossing opens the gate over the Attack, holds it open for the Hold, and only then lets it fall over the Release. A long Hold with a short Release chops a reverb’s tail off square: that is the gated-reverb snare. Once a crossing opens the gate, the gate runs through its Attack, Hold and Release even if the signal drops away at once. The Effect controls page lists what the knobs span.

The key never touches the sound. The gate listens through its own band, with Key Low and Key High setting its edges, the top held just under half the sample rate, so a gate on a tom can ignore the hi-hat above it and the kick below it. Key Listen puts that band on the output in place of the audio, so you can hear what you are tuning.

Options. Give the class key= another stream and that stream opens and closes the gate, which is how one sound gates another. lookahead_ms lets the gate read ahead of the audio, up to 50 ms, so it is already open when a transient arrives; each millisecond of look-ahead is a millisecond of latency. duck=True turns the gate inside out, for voice-overs: below the Threshold your signal passes untouched, and above it Range pushes it down. A duck’s depth is honest to about -40 dB, and past that it falls short: Range -80 measures about -77 dB.

Levels. With the gate open, the output is your signal at its own level. Silence in is silence out, and a mono source gets the same gate as stereo. The first opening after construction or reset() fades in from silence over the Attack, even at Range 0 dB.

Timing. Latency is zero unless you set lookahead_ms. The tail is zero, except while Key Listen is on, when it covers the key band’s ring; with key= the key decides, and the tail is None.

The detector reads peaks. A sine opens the gate at a Threshold about 3 dB higher than a square of the same loudness, because its peaks are higher. A square of the same peak as a sine opens it about 0.63 dB higher than the sine, because the key band rings on the square’s edges.

On a board. The class needs audiodsp’s audiodynamics, audioroute and audiomath, and on a board without any of them construction raises ImportError.

NAME = 'NoiseGate'

The stable provider name audioeffects.create() discovers.

TIER = 'audiodsp'

STOCK or AUDIODSP, with REQUIRES naming the audiodsp-own modules an AUDIODSP class needs.

Type:

roadmap §3

REQUIRES = ('audiodynamics', 'audioroute', 'audiomath')

audiodynamics first, because that is the one the default build needs and the one a stock board’s ImportError should name. audioroute and audiomath are built only by duck=True.

CAPABILITIES = ()

nothing here reads self._transport() (dossier D10).

Type:

The DS201 has no tempo control and neither has this

LATENCY_SAMPLES = 0

The default build. lookahead_ms moves both of these, and the properties below report the instance rather than the class.

MACRO_LABELS = ('Threshold', 'Attack', 'Hold', 'Release', 'Range', 'Key Low', 'Key High', 'Key Listen')

Knob names, one per macro index; one mode per label; the private engineering spans behind them; and the patches on the 0-127 grid.

MAX_LOOKAHEAD_MS = 50.0

104`. The node clamps for itself; the class clamps too so latency_samples reports what the node will do.

Type:

`audiodsp_dynamics.h

property latency_samples

The look-ahead, in frames, and nothing else.

Overridden because _component keeps LATENCY_SAMPLES on the class, and lookahead_ms is a per-instance choice: two gates in one graph may legitimately report different figures.

property tail_samples

The same number, with Key Listen off: what is left to come out after the input goes quiet is exactly the audio held in the look-ahead buffer. Nothing here has a feedback path or a delay line.

With Key Listen on, the output is the key band, and its one-pole filters ring after the input stops (audiocomponents#114: 2 048 frames at the default Key Low). Each pole adds the frames its state takes to fall from four times full scale - the most a high-pass hands the next stage - to under half an LSB. With an external key= the band follows the key, not the input, so there is no bound: None.