Switchboard SDK
Loading...
Searching...
No Matches
switchboard::NoiseGate Class Reference

Class providing noise gating with hysteresis. More...

#include <NoiseGate.hpp>

Public Member Functions

 NoiseGate (const uint sampleRate)
 NoiseGate constructor.
 
 ~NoiseGate ()
 NoiseGate destructor.
 
void setOpenThresholdDB (const float openThreshold)
 Sets the noise gate opening threshold in decibels.
 
float getOpenThresholdDB () const
 Gets open threshold setting in decibels.
 
void setCloseThresholdDB (const float closeThreshold)
 Sets the noise gate closing threshold setting in decibels.
 
float getCloseThresholdDB () const
 Gets the close threshold setting in decibels.
 
void setAttackTimeSeconds (const float attackTimeSeconds)
 Sets the volume envelope filter attack time in seconds. Minimum value: 0.0f Maximum value: 0.5f.
 
float getAttackTimeSeconds () const
 Gets the attack time setting in seconds.
 
void setHoldTimeSeconds (const float holdTimeSeconds)
 Sets the volume envelope filter hold time in seconds. Minimum value: 0.0f Maximum value: 1.0f.
 
float getHoldTimeSeconds () const
 Gets hold time setting value in seconds.
 
void setReleaseTimeSeconds (const float releaseTimeSeconds)
 Sets the volume envelope filter release time in seconds. Minimum value: 0.0f Maximum value: 1.0f.
 
float getReleaseTimeSeconds () const
 Gets the release time setting value in seconds.
 
void setEnabled (const bool enabled)
 Enables or disables the noise gate.
 
bool isEnabled () const
 Gets the enabled setting value of the noise gate.
 
uint getSampleRate () const
 Gets the sample rate setting value of the noise gate.
 
void setSampleRate (const uint sampleRate)
 Sets the sample rate setting of the noise filter.
 
void process (const float *input, float *output, const uint numberOfFrames)
 Processes the audio buffer and applies the noise gate.
 

Detailed Description

Class providing noise gating with hysteresis.

Constructor & Destructor Documentation

◆ NoiseGate()

switchboard::NoiseGate::NoiseGate ( const uint sampleRate)

NoiseGate constructor.

Parameters
sampleRateThe initial sample rate.

Member Function Documentation

◆ getAttackTimeSeconds()

float switchboard::NoiseGate::getAttackTimeSeconds ( ) const

Gets the attack time setting in seconds.

Returns
The attack time.

◆ getCloseThresholdDB()

float switchboard::NoiseGate::getCloseThresholdDB ( ) const

Gets the close threshold setting in decibels.

Returns
The threshold value.

◆ getHoldTimeSeconds()

float switchboard::NoiseGate::getHoldTimeSeconds ( ) const

Gets hold time setting value in seconds.

Returns
The hold time setting.

◆ getOpenThresholdDB()

float switchboard::NoiseGate::getOpenThresholdDB ( ) const

Gets open threshold setting in decibels.

Returns
The threshold value.

◆ getReleaseTimeSeconds()

float switchboard::NoiseGate::getReleaseTimeSeconds ( ) const

Gets the release time setting value in seconds.

Returns
The release time setting value.

◆ getSampleRate()

uint switchboard::NoiseGate::getSampleRate ( ) const

Gets the sample rate setting value of the noise gate.

Returns
The sample rate.

◆ isEnabled()

bool switchboard::NoiseGate::isEnabled ( ) const

Gets the enabled setting value of the noise gate.

Returns
True if the noise gate is enabled, false otherwise.

◆ process()

void switchboard::NoiseGate::process ( const float * input,
float * output,
const uint numberOfFrames )

Processes the audio buffer and applies the noise gate.

Parameters
inputInterleaved stereo input audio buffer
outputInterleaved stereo output audio buffer
numberOfFramesThe number of frames to process.

◆ setAttackTimeSeconds()

void switchboard::NoiseGate::setAttackTimeSeconds ( const float attackTimeSeconds)

Sets the volume envelope filter attack time in seconds. Minimum value: 0.0f Maximum value: 0.5f.

Parameters
attackTimeSecondsThe new attack time in seconds.

◆ setCloseThresholdDB()

void switchboard::NoiseGate::setCloseThresholdDB ( const float closeThreshold)

Sets the noise gate closing threshold setting in decibels.

When the signal drops below this threshold value the noise gate closes. Minimum value: -96.0f Maximum value: 24.0f

Parameters
closeThresholdThe new close threshold value.

◆ setEnabled()

void switchboard::NoiseGate::setEnabled ( const bool enabled)

Enables or disables the noise gate.

Parameters
enabledFlag indicating whether the noise gate should be enabled or disabled.

◆ setHoldTimeSeconds()

void switchboard::NoiseGate::setHoldTimeSeconds ( const float holdTimeSeconds)

Sets the volume envelope filter hold time in seconds. Minimum value: 0.0f Maximum value: 1.0f.

Parameters
holdTimeSecondsThe new hold time in seconds.

◆ setOpenThresholdDB()

void switchboard::NoiseGate::setOpenThresholdDB ( const float openThreshold)

Sets the noise gate opening threshold in decibels.

When the signal raises above this threshold value the noise gate opens. Minimum: -96.0f Maximum: 24.0f

Parameters
openThresholdThe new open threshold value.

◆ setReleaseTimeSeconds()

void switchboard::NoiseGate::setReleaseTimeSeconds ( const float releaseTimeSeconds)

Sets the volume envelope filter release time in seconds. Minimum value: 0.0f Maximum value: 1.0f.

Parameters
releaseTimeSecondsThe new release time in seconds.

◆ setSampleRate()

void switchboard::NoiseGate::setSampleRate ( const uint sampleRate)

Sets the sample rate setting of the noise filter.

Parameters
sampleRateThe new sample rate to set.