Noise Gate
Overview
A noise gate is an audio tool that reduces unwanted noise by muting or attenuating signals below specified thresholds. It is typically used to eliminate background noise or hum. The noise_gate
class implements a Q-flavored noise gate processor following Q’s Dynamic processor design. Unlike typical noise gates, noise_gate
has no parameters for attack and release and does not process audio waveform samples directly. Instead, it operates on the envelope of the audio signal. The objective is separation of concerns and the flexibility to use various envelope followers.
There are two thresholds. On onsets, the noise_gate opens up if the signal envelope goes above the specified onset threshold. On note release, the noise_gate turns off if the signal goes below a specified release threshold.
Declaration
struct noise_gate
{
noise_gate(decibel onset_threshold, decibel release_threshold);
noise_gate(decibel release_threshold);
bool operator()(float env);
bool operator()() const;
void onset_threshold(decibel onset_threshold);
void onset_threshold(float onset_threshold);
void release_threshold(decibel release_threshold);
void release_threshold(float release_threshold);
float onset_threshold() const;
float release_threshold() const;
};
Expressions
Notation
g
,a
,b
-
Objects of type
noise_gate
. env
-
Floating point value for the current envelope value.
ot
,rt
-
Object of type
decibel
representing onset and release thresholds, respectively.
Constructors and Assignment
Expression | Semantics |
---|---|
|
Construct a |
|
Construct a |
|
Copy construct a |
|
Assign |
C++ brace initialization may also be used. |
Function Call
Expression | Semantics | Return Type |
---|---|---|
|
Get the current state. |
|
|
Process the input envelope |
|
The noise_gate
state is a boolean flag that is true
if the noise_gate
is open or false
if the noise_gate
is closed.