#include <audio/node/filternode.h>
Public Types | |
enum | EMode { LowPass, HighPass, BandPass, LowRes, HighRes } |
Public Member Functions | |
FilterNode (NodeManager &nodeManager) | |
void | process () override |
void | prepare (ControllerValue frequency, ControllerValue resonanceBand, ControllerValue gain) |
void | setMode (EMode mode) |
void | setFrequency (ControllerValue cutoffFrequency) |
void | setResonance (ControllerValue resonance) |
void | setBand (ControllerValue band) |
void | setGain (ControllerValue gain) |
EMode | getMode () const |
ControllerValue | getFrequency () const |
ControllerValue | getResonance () const |
ControllerValue | getBand () const |
ControllerValue | getGain () const |
![]() | |
Node (NodeManager &manager) | |
const std::set< OutputPin * > & | getOutputs () const |
const std::set< InputPinBase * > & | getInputs () const |
![]() | |
Process (NodeManager &nodeManager) | |
Process (ParentProcess &parent) | |
Process (const Process &)=delete | |
Process & | operator= (const Process &)=delete |
virtual | ~Process () |
void | update () |
NodeManager & | getNodeManager () const |
int | getBufferSize () const |
float | getSampleRate () const |
DiscreteTimeValue | getSampleTime () const |
Public Attributes | |
InputPin | audioInput = {this} |
OutputPin | audioOutput = {this} |
Additional Inherited Members | |
![]() | |
SampleBuffer & | getOutputBuffer (OutputPin &output) |
![]() | |
virtual void | sampleRateChanged (float sampleRate) |
virtual void | bufferSizeChanged (int bufferSize) |
bool | isRegisteredWithNodeManager () const |
Multi-purpose DSP filter using the Butterworth filter algorithm to calculate biquad coefficients. Is able to apply lowpass and highpass with or without variable resonance peak and bandpass filtering.
|
strong |
FilterNode | ( | NodeManager & | nodeManager | ) |
ControllerValue getBand | ( | ) | const |
ControllerValue getFrequency | ( | ) | const |
ControllerValue getGain | ( | ) | const |
EMode getMode | ( | ) | const |
ControllerValue getResonance | ( | ) | const |
void prepare | ( | ControllerValue | frequency, |
ControllerValue | resonanceBand, | ||
ControllerValue | gain | ||
) |
Immediately changes the settings of the filter. Only call this before the filter starts being processed.
frequency | cutoff frequency of the filter in Hz |
resonanceBand | In case of LowRes or HighRes: Resonance value. 0 means no resonance, 30 means self-oscillation. In case of bandpass: bandwith in herz. |
gain | the gaining factor of the filter output |
|
overridevirtual |
Has to be overwritted by descendants to specify the actual process.
Reimplemented from Node.
void setBand | ( | ControllerValue | band | ) |
Sets the bandwith for bandpass filtering in Hz.
void setFrequency | ( | ControllerValue | cutoffFrequency | ) |
Sets the frequency parameter of the filter in Hz. For the different modes this means:
void setGain | ( | ControllerValue | gain | ) |
Sets the gaining factor of the filter's output.
void setMode | ( | EMode | mode | ) |
Sets the mode of the filter.
mode | lowpass, highpass, bandpass, lowpass with resonance peak or highpass with resonance peak. |
void setResonance | ( | ControllerValue | resonance | ) |
Sets the resonance peak of the filter. 0 means no resonance, 30 means self-oscillation.
InputPin audioInput = {this} |
The input to be filtered
OutputPin audioOutput = {this} |
Outputs the filtered signal