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

Applies a noise gate transform to an input signal. More...

#include <NoiseGateNode.hpp>

Inheritance diagram for switchboard::NoiseGateNode:
switchboard::SingleBusAudioProcessorNode switchboard::AudioProcessorNode switchboard::AudioNode

Public Member Functions

WASM NoiseGateNode ()
 Creates a NoiseGateNode instance.
 
WASM ~NoiseGateNode ()
 NoiseGateNode destructor.
 
WASM float getOpenThresholdDB ()
 Gets open threshold setting in decibels.
 
WASM void setOpenThresholdDB (float openThreshold)
 Sets the noise gate opening threshold in decibels.
 
WASM float getCloseThresholdDB ()
 Gets the close threshold setting in decibels.
 
WASM void setCloseThresholdDB (float closeThreshold)
 Sets the noise gate closing threshold setting in decibels.
 
WASM float getAttackTimeSeconds ()
 Gets the attack time setting in seconds.
 
WASM void setAttackTimeSeconds (float attackTimeSeconds)
 Sets the volume envelope filter attack time in seconds. Minimum value: 0.0f Maximum value: 0.5f.
 
WASM float getHoldTimeSeconds ()
 Gets hold time setting value in seconds.
 
WASM void setHoldTimeSeconds (float holdTimeSeconds)
 Sets the volume envelope filter hold time in seconds. Minimum value: 0.0f Maximum value: 1.0f.
 
WASM float getReleaseTimeSeconds ()
 Gets the release time setting value in seconds.
 
WASM void setReleaseTimeSeconds (float releaseTimeSeconds)
 Sets the volume envelope filter release time in seconds. Minimum value: 0.0f Maximum value: 1.0f.
 
WASM bool isEnabled ()
 Gets the enabled setting value of the noise gate.
 
WASM void setEnabled (bool enabled)
 Enables or disables the noise gate.
 
WASM bool setBusFormat (AudioBusFormat &inputBusFormat, AudioBusFormat &outputBusFormat) override
 Sets bus format.
 
WASM bool process (AudioBus &inBus, AudioBus &outBus) override
 Processes audio data from the given input bus and produces the audio output to the given output bus.
 
- Public Member Functions inherited from switchboard::SingleBusAudioProcessorNode
bool setNumberOfBuses (const uint numberOfInputBuses, const uint numberOfOutputBuses) override
 Sets number of buses.
 
bool setBusFormats (AudioBusFormatList &inputBusFormats, AudioBusFormatList &outputBusFormats) override
 Sets bus formats.
 
bool process (AudioBusList &inBuses, AudioBusList &outBuses) override
 Processes audio data from the given input buses and produces the audio output to the given output buses.
 
- Public Member Functions inherited from switchboard::AudioProcessorNode
virtual ~AudioProcessorNode ()=default
 AudioProcessorNode virtual destructor.
 
- Public Member Functions inherited from switchboard::AudioNode
 AudioNode ()
 AudioNode constructor.
 
virtual ~AudioNode ()=default
 AudioNode virtual destructor.
 
const std::string & getType () const
 Gets the type of the audio node.
 
virtual const std::string getDisplayName () const
 Gets the display name of the audio node.
 
virtual std::vector< std::unique_ptr< Parameter > > & getParameters ()
 Gets the parameters of the audio node.
 
virtual ParametergetParameter (const std::string &id)
 Gets the parameter with the given name.
 

Additional Inherited Members

- Public Attributes inherited from switchboard::AudioNode
std::string name
 The name of the audio node.
 
- Protected Member Functions inherited from switchboard::AudioNode
void initParameters (std::map< std::string, std::any > config)
 Initializes the node parameters from the given configuration values.
 
- Protected Attributes inherited from switchboard::AudioNode
std::string type
 
std::vector< std::unique_ptr< Parameter > > parameters
 

Detailed Description

Applies a noise gate transform to an input signal.

NoiseGateNode class.

Member Function Documentation

◆ getAttackTimeSeconds()

float switchboard::NoiseGateNode::getAttackTimeSeconds ( )

Gets the attack time setting in seconds.

Returns
The attack time.

◆ getCloseThresholdDB()

float switchboard::NoiseGateNode::getCloseThresholdDB ( )

Gets the close threshold setting in decibels.

Returns
The threshold value.

◆ getHoldTimeSeconds()

float switchboard::NoiseGateNode::getHoldTimeSeconds ( )

Gets hold time setting value in seconds.

Returns
The hold time setting.

◆ getOpenThresholdDB()

float switchboard::NoiseGateNode::getOpenThresholdDB ( )

Gets open threshold setting in decibels.

Returns
The threshold value.

◆ getReleaseTimeSeconds()

float switchboard::NoiseGateNode::getReleaseTimeSeconds ( )

Gets the release time setting value in seconds.

Returns
The release time setting value.

◆ isEnabled()

bool switchboard::NoiseGateNode::isEnabled ( )

Gets the enabled setting value of the noise gate.

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

◆ process()

bool switchboard::NoiseGateNode::process ( AudioBus & inBus,
AudioBus & outBus )
overridevirtual

Processes audio data from the given input bus and produces the audio output to the given output bus.

Should be overridden by subclasses.

Parameters
inBusThe input bus that contain the audio data.
outBusThe output bus which should be filled with the processed audio data.
Returns
True if audio was processed successfully, false otherwise.

Implements switchboard::SingleBusAudioProcessorNode.

◆ setAttackTimeSeconds()

void switchboard::NoiseGateNode::setAttackTimeSeconds ( 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.

◆ setBusFormat()

bool switchboard::NoiseGateNode::setBusFormat ( AudioBusFormat & inputBusFormat,
AudioBusFormat & outputBusFormat )
overridevirtual

Sets bus format.

Should be overridden by subclasses.

Parameters
inputBusFormatThe input bus format to set.
outputBusFormatThe output bus format to set.
Returns
True if the bus formats were set successfully, false otherwise.

Implements switchboard::SingleBusAudioProcessorNode.

◆ setCloseThresholdDB()

void switchboard::NoiseGateNode::setCloseThresholdDB ( 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::NoiseGateNode::setEnabled ( bool enabled)

Enables or disables the noise gate.

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

◆ setHoldTimeSeconds()

void switchboard::NoiseGateNode::setHoldTimeSeconds ( 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::NoiseGateNode::setOpenThresholdDB ( 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::NoiseGateNode::setReleaseTimeSeconds ( 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.