Gate the spectrum, not the signal. A short-time Fourier transform splits the audio into about a thousand frequency bands, and each band is kept or dropped on its own level, four times per window.
Keep above
The default. Every band louder than the threshold passes; every band quieter is turned down. On a sustained note the harmonics survive and the hiss between them goes, which gives the hard, synthetic cleanliness spectral gating is known for. Pushed further, with the threshold up near the level of the harmonics, a chord thins to its loudest partials and a voice becomes a set of whistling tones.
Keep below
The inverse. The partials go and what they were sitting on stays: breath, room, the noise floor, the scrape of a bow, the fret noise under a guitar line. The result is the residue of a recording, and layered quietly under the original it adds air without changing the notes.
Threshold
The threshold is per band, in dB, calibrated so a full-scale sine centred on a band reads 0 dB in it whatever the window length. The window spreads that sine into the two bands beside it at about -6 dB, and those carry part of its energy, so a threshold between -6 dB and 0 dB thins a pure tone rather than keeping it whole. A broadband sound spreads its energy over many bands, so each band is far below the overall level. Pink noise at -20 dBFS has bands near -50 dB; a single sustained note at -20 dBFS has its fundamental near -20 dB and its noise floor far lower. Start at -40 dB and move until the material splits where you want it.
Softness and response
Softness is the span over which a band fades rather than switches. At 0 a band is either in or out, which chatters on anything near the threshold. At 6 dB a band 3 dB under the threshold is at half level, and the result is less brittle. At 24 dB the gate is closer to a spectral expander.
Response is how long a band takes to open or close once it has crossed, from instant to half a second. Short response tracks every flicker of the spectrum; longer settings let bands ring on after their partial has gone, which smears transients and smooths the texture.
Window and latency
The analysis window is 2048 samples at 48 kHz, about 43 ms, with four overlapping frames per window. A band is about 23 Hz wide. The window has to arrive before it can be transformed, so the wet signal is delayed by one window; that delay is declared, the dry half of the mix is held back to match, and the export is trimmed.
What it is not
It is not the denoiser, which learns the noise’s shape from the file and subtracts it; this applies one rule to every band and leaves the characteristic artefacts. It is not the expander or the noise gate, which work on the whole signal in time. It is closest to the PV_MagAbove and PV_MagBelow units in SuperCollider, which do exactly this to a phase vocoder stream.