Vital
Loading...
Searching...
No Matches
vital::DigitalSvf Class Reference

A state-variable filter (SVF) implementation, supporting multiple filter types (12/24 dB, shelving, dual modes). More...

#include <digital_svf.h>

Inheritance diagram for vital::DigitalSvf:
vital::Processor vital::SynthFilter

Classes

struct  FilterValues
 Stores three filter state variables (v0, v1, v2) used for multi-mode mixing. More...
 

Public Types

typedef OneDimLookup< computeSvfOnePoleFilterCoefficient, 2048 > SvfCoefficientLookup
 A lookup table type for quickly converting frequency ratios into filter coefficients.
 
- Public Types inherited from vital::SynthFilter
enum  {
  kAudio , kReset , kMidiCutoff , kResonance ,
  kDriveGain , kGain , kStyle , kPassBlend ,
  kInterpolateX , kInterpolateY , kTranspose , kSpread ,
  kNumInputs
}
 
enum  Style {
  k12Db , k24Db , kNotchPassSwap , kDualNotchBand ,
  kBandPeakNotch , kShelving , kNumStyles
}
 Different filter styles used in various derived classes. More...
 
typedef OneDimLookup< computeOnePoleFilterCoefficient, 2048 > CoefficientLookup
 A lookup table for quick computation of one-pole filter coefficients.
 

Public Member Functions

 DigitalSvf ()
 Constructor that initializes the filter’s internal states.
 
virtual ~DigitalSvf ()
 Default destructor.
 
virtual Processorclone () const override
 Creates a clone of this filter by invoking the copy constructor.
 
virtual void process (int num_samples) override
 Processes a block of samples by pulling from the primary audio input and computing the SVF output. Delegates to processWithInput().
 
void processWithInput (const poly_float *audio_in, int num_samples) override
 Processes a block of samples using a provided input buffer.
 
void reset (poly_mask reset_masks) override
 Resets internal filter states for voices specified by the reset_masks.
 
void hardReset () override
 Performs a complete reset of the filter states for all voices.
 
void setupFilter (const FilterState &filter_state) override
 Configures this SVF based on a FilterState (cutoff, resonance, style, etc.).
 
void setResonanceBounds (mono_float min, mono_float max)
 Sets the minimum and maximum resonance for the filter (used in resonance interpolation).
 
void process12 (const poly_float *audio_in, int num_samples, poly_float current_resonance, poly_float current_drive, poly_float current_post_multiply, FilterValues &blends)
 Processes a 12 dB filter style, iterating through the block.
 
void processBasic12 (const poly_float *audio_in, int num_samples, poly_float current_resonance, poly_float current_drive, poly_float current_post_multiply, FilterValues &blends)
 Processes a simpler 12 dB filter style, skipping extra color or overshoot logic.
 
void process24 (const poly_float *audio_in, int num_samples, poly_float current_resonance, poly_float current_drive, poly_float current_post_multiply, FilterValues &blends)
 Processes a 24 dB filter style, adding additional stages.
 
void processBasic24 (const poly_float *audio_in, int num_samples, poly_float current_resonance, poly_float current_drive, poly_float current_post_multiply, FilterValues &blends)
 Processes a simpler 24 dB filter style, skipping advanced processing.
 
void processDual (const poly_float *audio_in, int num_samples, poly_float current_resonance, poly_float current_drive, poly_float current_post_multiply, FilterValues &blends1, FilterValues &blends2)
 Processes a dual filter mode, e.g., dual notch + band pass.
 
force_inline poly_float tick (poly_float audio_in, poly_float coefficient, poly_float resonance, poly_float drive, FilterValues &blends)
 Applies advanced distortion to the input while performing a single SVF tick (12 dB).
 
force_inline poly_float tickBasic (poly_float audio_in, poly_float coefficient, poly_float resonance, poly_float drive, FilterValues &blends)
 A basic (non-distorting) single SVF tick for a 12 dB filter style.
 
force_inline poly_float tick24 (poly_float audio_in, poly_float coefficient, poly_float resonance, poly_float drive, FilterValues &blends)
 Tick function for a 24 dB multi-stage filter, adding an additional pre-stage.
 
force_inline poly_float tickBasic24 (poly_float audio_in, poly_float coefficient, poly_float resonance, poly_float drive, FilterValues &blends)
 A simpler 24 dB tick function without advanced distortion or color.
 
force_inline poly_float tickDual (poly_float audio_in, poly_float coefficient, poly_float resonance, poly_float drive, FilterValues &blends1, FilterValues &blends2)
 Tick function for a dual filter approach, e.g. notch + band, etc.
 
poly_float getDrive () const
 Retrieves the final drive (post drive compensation) used in the filter.
 
poly_float getMidiCutoff () const
 Retrieves the current MIDI-based cutoff frequency.
 
poly_float getResonance () const
 Retrieves the current resonance value (inverted if needed).
 
poly_float getLowAmount () const
 Retrieves the current low-frequency mix portion.
 
poly_float getBandAmount () const
 Retrieves the current band-frequency mix portion.
 
poly_float getHighAmount () const
 Retrieves the current high-frequency mix portion.
 
poly_float getLowAmount24 (int style) const
 Helper for a 24 dB filter style that may swap low/high in a dual notch band.
 
poly_float getHighAmount24 (int style) const
 Helper for a 24 dB filter style that may swap low/high in a dual notch band.
 
void setBasic (bool basic)
 Sets whether this filter should use a simpler, “basic” processing path.
 
void setDriveCompensation (bool drive_compensation)
 Enables or disables drive compensation (reducing drive as resonance increases).
 
- Public Member Functions inherited from vital::Processor
 Processor (int num_inputs, int num_outputs, bool control_rate=false, int max_oversample=1)
 Constructs a Processor with a given number of inputs/outputs and oversampling.
 
virtual ~Processor ()
 Virtual destructor.
 
virtual bool hasState () const
 Indicates whether this Processor requires per-voice state.
 
virtual void init ()
 Called after constructor, used for any additional initialization. Subclasses can override. Sets the initialized flag.
 
bool initialized ()
 Returns whether this Processor has been initialized.
 
virtual void setSampleRate (int sample_rate)
 Updates the sample rate of this Processor (scaled by oversampling).
 
virtual void setOversampleAmount (int oversample)
 Sets the oversampling amount and updates the effective sample rate.
 
force_inline bool enabled () const
 Checks if this Processor is enabled.
 
virtual void enable (bool enable)
 Enables or disables this Processor.
 
force_inline int getSampleRate () const
 Retrieves the current (effective) sample rate.
 
force_inline int getOversampleAmount () const
 Retrieves the current oversampling factor.
 
force_inline bool isControlRate () const
 Checks if this Processor is running at control rate (buffer_size == 1).
 
virtual void setControlRate (bool control_rate)
 Sets whether this Processor runs at control rate.
 
force_inline poly_mask getResetMask (int input_index) const
 Retrieves a mask indicating which voices triggered a note-on event. Compares the input's trigger_value to kVoiceOn.
 
force_inline void clearOutputBufferForReset (poly_mask reset_mask, int input_index, int output_index) const
 Clears output samples for voices that are about to be reset, based on the trigger offset.
 
bool inputMatchesBufferSize (int input=0)
 Checks whether the buffer size of a particular input matches the size needed by this Processor.
 
bool checkInputAndOutputSize (int num_samples)
 Checks if all inputs and outputs have buffers big enough for num_samples.
 
virtual bool isPolyphonic () const
 Checks if this Processor is polyphonic by querying its ProcessorRouter.
 
void plug (const Output *source)
 Connects an external Output to this Processor's first input.
 
void plug (const Output *source, unsigned int input_index)
 Connects an external Output to a specified input index.
 
void plug (const Processor *source)
 Connects the first output of a Processor to this Processor's first input.
 
void plug (const Processor *source, unsigned int input_index)
 Connects the first output of a Processor to a specified input index.
 
void plugNext (const Output *source)
 Connects an external Output to the first available (unplugged) input.
 
void plugNext (const Processor *source)
 Connects the first output of a Processor to the first available (unplugged) input.
 
void useInput (Input *input)
 Uses an existing Input object as this Processor's first input.
 
void useInput (Input *input, int index)
 Uses an existing Input object at a specified input index.
 
void useOutput (Output *output)
 Uses an existing Output object as this Processor's first output.
 
void useOutput (Output *output, int index)
 Uses an existing Output object at a specified output index.
 
int connectedInputs ()
 Counts how many inputs are connected to a real source (not null_source_).
 
virtual void unplugIndex (unsigned int input_index)
 Removes the connection at a specified input index, if any.
 
virtual void unplug (const Output *source)
 Removes a connection to a given Output from all inputs.
 
virtual void unplug (const Processor *source)
 Removes connections to all outputs from a given Processor.
 
virtual void numInputsChanged ()
 Called when the number of inputs changes (e.g., new connections). Subclasses may override for dynamic behavior.
 
force_inline void router (ProcessorRouter *router)
 Sets the ProcessorRouter that owns or manages this Processor.
 
force_inline ProcessorRouterrouter () const
 Returns the ProcessorRouter that currently owns this Processor.
 
ProcessorRoutergetTopLevelRouter () const
 Gets the topmost (root) ProcessorRouter by traversing parent routers.
 
virtual void registerInput (Input *input, int index)
 Registers a new input, appending it to the input list.
 
virtual OutputregisterOutput (Output *output, int index)
 Registers a new Output in the output list at a specified index.
 
virtual void registerInput (Input *input)
 Registers a new Input by appending it to the end of the input list.
 
virtual OutputregisterOutput (Output *output)
 Registers a new Output by appending it to the end of the output list.
 
force_inline int numInputs () const
 Returns the total number of Input pointers (owned or otherwise).
 
force_inline int numOutputs () const
 Returns the total number of Output pointers (owned or otherwise).
 
force_inline int numOwnedInputs () const
 Returns how many Input objects this Processor owns.
 
force_inline int numOwnedOutputs () const
 Returns how many Output objects this Processor owns.
 
force_inline Inputinput (unsigned int index=0) const
 Retrieves the Input pointer at a given index.
 
force_inline bool isInputSourcePolyphonic (int index=0)
 Checks if the input source at a given index is polyphonic.
 
force_inline InputownedInput (unsigned int index=0) const
 Retrieves an owned Input pointer at a given index.
 
force_inline Outputoutput (unsigned int index=0) const
 Retrieves the Output pointer at a given index.
 
force_inline OutputownedOutput (unsigned int index=0) const
 Retrieves an owned Output pointer at a given index.
 
void setPluggingStart (int start)
 Sets the position at which plugNext starts searching for an open input.
 
- Public Member Functions inherited from vital::SynthFilter
virtual ~SynthFilter ()
 Virtual destructor for the SynthFilter base class.
 

Static Public Member Functions

static force_inline mono_float computeSvfOnePoleFilterCoefficient (mono_float frequency_ratio)
 Computes a one-pole SVF coefficient from a normalized frequency ratio.
 
static const SvfCoefficientLookupgetSvfCoefficientLookup ()
 Retrieves a pointer to the global SVF coefficient lookup table.
 
- Static Public Member Functions inherited from vital::SynthFilter
static force_inline mono_float computeOnePoleFilterCoefficient (mono_float frequency_ratio)
 Computes a one-pole filter coefficient from a frequency ratio.
 
static const CoefficientLookupgetCoefficientLookup ()
 Retrieves a pointer to the static coefficient lookup table.
 
static SynthFiltercreateFilter (constants::FilterModel model)
 Factory method for creating a specialized filter based on a model enum.
 

Static Public Attributes

static constexpr mono_float kDefaultMinResonance = 0.5f
 Default minimum resonance used when filtering (if not overridden).
 
static constexpr mono_float kDefaultMaxResonance = 16.0f
 Default maximum resonance used when filtering (if not overridden).
 
static constexpr mono_float kMinCutoff = 1.0f
 Minimum allowed cutoff frequency in Hz for the filter.
 
static constexpr mono_float kMaxGain = 15.0f
 Maximum gain in dB for shelf or gain-based operations.
 
static constexpr mono_float kMinGain = -15.0f
 Minimum gain in dB for shelf or gain-based operations.
 
static const SvfCoefficientLookup svf_coefficient_lookup_
 A static global lookup table instance for SVF coefficients.
 
- Static Public Attributes inherited from vital::SynthFilter
static const CoefficientLookup coefficient_lookup_
 Static instance of the coefficient lookup table, generated at compile time.
 

Additional Inherited Members

- Protected Member Functions inherited from vital::Processor
OutputaddOutput (int oversample=1)
 Creates and registers a new Output. Handles control rate vs. audio rate.
 
InputaddInput ()
 Creates and registers a new Input, initially connected to null_source_.
 
- Protected Attributes inherited from vital::Processor
std::shared_ptr< ProcessorStatestate_
 Shared state (sample rate, oversample, etc.)
 
int plugging_start_
 The index at which plugNext starts searching for an unplugged input.
 
std::vector< std::shared_ptr< Input > > owned_inputs_
 Inputs owned by this Processor.
 
std::vector< std::shared_ptr< Output > > owned_outputs_
 Outputs owned by this Processor.
 
std::shared_ptr< std::vector< Input * > > inputs_
 All inputs, owned or external.
 
std::shared_ptr< std::vector< Output * > > outputs_
 All outputs, owned or external.
 
ProcessorRouterrouter_
 The ProcessorRouter that manages this Processor.
 
- Protected Attributes inherited from vital::SynthFilter
FilterState filter_state_
 Internal storage of the most recent FilterState, used by derived filters.
 
- Static Protected Attributes inherited from vital::Processor
static const Output null_source_
 A null (dummy) source used for unconnected inputs.
 

Detailed Description

A state-variable filter (SVF) implementation, supporting multiple filter types (12/24 dB, shelving, dual modes).

The DigitalSvf class provides a flexible filter design that can morph between low-pass, high-pass, band-pass, notch, peak, and specialized dual filter modes. It optionally supports a basic or advanced processing path, drive compensation, and user-defined resonance bounds.

Member Typedef Documentation

◆ SvfCoefficientLookup

A lookup table type for quickly converting frequency ratios into filter coefficients.

Constructor & Destructor Documentation

◆ DigitalSvf()

vital::DigitalSvf::DigitalSvf ( )

Constructor that initializes the filter’s internal states.

Constructs a DigitalSvf object, resetting its internal states to defaults.

◆ ~DigitalSvf()

virtual vital::DigitalSvf::~DigitalSvf ( )
inlinevirtual

Default destructor.

Member Function Documentation

◆ clone()

virtual Processor * vital::DigitalSvf::clone ( ) const
inlineoverridevirtual

Creates a clone of this filter by invoking the copy constructor.

Returns
A pointer to a newly allocated DigitalSvf object.

Implements vital::Processor.

◆ computeSvfOnePoleFilterCoefficient()

static force_inline mono_float vital::DigitalSvf::computeSvfOnePoleFilterCoefficient ( mono_float frequency_ratio)
inlinestatic

Computes a one-pole SVF coefficient from a normalized frequency ratio.

Ensures the ratio is clamped so that tan() doesn’t blow up near Nyquist.

Parameters
frequency_ratioThe normalized frequency in [0..0.5).
Returns
The computed one-pole filter coefficient.

◆ getBandAmount()

poly_float vital::DigitalSvf::getBandAmount ( ) const
inline

Retrieves the current band-frequency mix portion.

Returns
The band portion mix amount.

◆ getDrive()

poly_float vital::DigitalSvf::getDrive ( ) const
inline

Retrieves the final drive (post drive compensation) used in the filter.

Returns
The computed drive multiplied by post_multiply.

◆ getHighAmount()

poly_float vital::DigitalSvf::getHighAmount ( ) const
inline

Retrieves the current high-frequency mix portion.

Returns
The high portion mix amount.

◆ getHighAmount24()

poly_float vital::DigitalSvf::getHighAmount24 ( int style) const
inline

Helper for a 24 dB filter style that may swap low/high in a dual notch band.

Parameters
styleAn integer enumerating the filter style.
Returns
The appropriate high amount for a 24 dB style.

◆ getLowAmount()

poly_float vital::DigitalSvf::getLowAmount ( ) const
inline

Retrieves the current low-frequency mix portion.

Returns
The low portion mix amount.

◆ getLowAmount24()

poly_float vital::DigitalSvf::getLowAmount24 ( int style) const
inline

Helper for a 24 dB filter style that may swap low/high in a dual notch band.

Parameters
styleAn integer enumerating the filter style.
Returns
The appropriate low amount for a 24 dB style.

◆ getMidiCutoff()

poly_float vital::DigitalSvf::getMidiCutoff ( ) const
inline

Retrieves the current MIDI-based cutoff frequency.

Returns
The stored MIDI cutoff value.

◆ getResonance()

poly_float vital::DigitalSvf::getResonance ( ) const
inline

Retrieves the current resonance value (inverted if needed).

Returns
The stored resonance used by the filter.

◆ getSvfCoefficientLookup()

static const SvfCoefficientLookup * vital::DigitalSvf::getSvfCoefficientLookup ( )
inlinestatic

Retrieves a pointer to the global SVF coefficient lookup table.

Returns
Pointer to the svf_coefficient_lookup_.

◆ hardReset()

void vital::DigitalSvf::hardReset ( )
overridevirtual

Performs a complete reset of the filter states for all voices.

Performs a complete reset of all internal states for every voice.

Reimplemented from vital::Processor.

◆ process()

void vital::DigitalSvf::process ( int num_samples)
overridevirtual

Processes a block of samples by pulling from the primary audio input and computing the SVF output. Delegates to processWithInput().

Processes a block of samples by reading from the main audio input, then calls processWithInput().

Parameters
num_samplesNumber of samples to process.

Implements vital::Processor.

◆ process12()

void vital::DigitalSvf::process12 ( const poly_float * audio_in,
int num_samples,
poly_float current_resonance,
poly_float current_drive,
poly_float current_post_multiply,
FilterValues & blends )

Processes a 12 dB filter style, iterating through the block.

Parameters
audio_inInput audio data.
num_samplesNumber of samples in the buffer.
current_resonanceCurrent resonance value (possibly interpolated).
current_driveCurrent drive value.
current_post_multiplyAdditional multiplier after the filter.
blendsFilter mix gains (low/band/high).

◆ process24()

void vital::DigitalSvf::process24 ( const poly_float * audio_in,
int num_samples,
poly_float current_resonance,
poly_float current_drive,
poly_float current_post_multiply,
FilterValues & blends )

Processes a 24 dB filter style, adding additional stages.

Parameters
audio_inInput audio data.
num_samplesNumber of samples in the buffer.
current_resonanceCurrent resonance value.
current_driveCurrent drive value.
current_post_multiplyAdditional multiplier after the filter.
blendsFilter mix gains (low/band/high).

◆ processBasic12()

void vital::DigitalSvf::processBasic12 ( const poly_float * audio_in,
int num_samples,
poly_float current_resonance,
poly_float current_drive,
poly_float current_post_multiply,
FilterValues & blends )

Processes a simpler 12 dB filter style, skipping extra color or overshoot logic.

Parameters
audio_inInput audio data.
num_samplesNumber of samples in the buffer.
current_resonanceCurrent resonance value.
current_driveCurrent drive value.
current_post_multiplyAdditional multiplier after the filter.
blendsFilter mix gains (low/band/high).

◆ processBasic24()

void vital::DigitalSvf::processBasic24 ( const poly_float * audio_in,
int num_samples,
poly_float current_resonance,
poly_float current_drive,
poly_float current_post_multiply,
FilterValues & blends )

Processes a simpler 24 dB filter style, skipping advanced processing.

Parameters
audio_inInput audio data.
num_samplesNumber of samples in the buffer.
current_resonanceCurrent resonance value.
current_driveCurrent drive value.
current_post_multiplyAdditional multiplier after the filter.
blendsFilter mix gains (low/band/high).

◆ processDual()

void vital::DigitalSvf::processDual ( const poly_float * audio_in,
int num_samples,
poly_float current_resonance,
poly_float current_drive,
poly_float current_post_multiply,
FilterValues & blends1,
FilterValues & blends2 )

Processes a dual filter mode, e.g., dual notch + band pass.

Splits filter processing into two sets of FilterValues (blends1 and blends2).

Parameters
audio_inInput audio data.
num_samplesNumber of samples to process.
current_resonanceCurrent resonance value.
current_driveCurrent drive value.
current_post_multiplyAdditional multiplier.
blends1The first set of filter mixes (low/band/high).
blends2The second set of filter mixes (low/band/high).

◆ processWithInput()

void vital::DigitalSvf::processWithInput ( const poly_float * audio_in,
int num_samples )
overridevirtual

Processes a block of samples using a provided input buffer.

Detailed logic for processing a block of samples, handling filter style and interpolation.

Applies configured filter settings to compute the final output.

Parameters
audio_inPointer to the input audio buffer.
num_samplesNumber of samples to process.
audio_inPointer to the input audio buffer.
num_samplesNumber of samples to process.

Reimplemented from vital::Processor.

◆ reset()

void vital::DigitalSvf::reset ( poly_mask reset_mask)
overridevirtual

Resets internal filter states for voices specified by the reset_masks.

Resets specified voices in the filter’s internal state variables.

Parameters
reset_masksMask specifying which voices to reset.
reset_masksThe poly_mask selecting which voices to reset.

Reimplemented from vital::Processor.

◆ setBasic()

void vital::DigitalSvf::setBasic ( bool basic)
inline

Sets whether this filter should use a simpler, “basic” processing path.

Parameters
basicIf true, uses the simplified process path.

◆ setDriveCompensation()

void vital::DigitalSvf::setDriveCompensation ( bool drive_compensation)
inline

Enables or disables drive compensation (reducing drive as resonance increases).

Parameters
drive_compensationIf true, drive is reduced as resonance goes up.

◆ setResonanceBounds()

void vital::DigitalSvf::setResonanceBounds ( mono_float min,
mono_float max )

Sets the minimum and maximum resonance for the filter (used in resonance interpolation).

Parameters
minThe new minimum resonance value.
maxThe new maximum resonance value.

◆ setupFilter()

void vital::DigitalSvf::setupFilter ( const FilterState & filter_state)
overridevirtual

Configures this SVF based on a FilterState (cutoff, resonance, style, etc.).

Configures the filter based on the provided FilterState, computing resonance, drive, etc.

Parameters
filter_stateThe FilterState containing all relevant parameters.
filter_stateThe FilterState containing style, cutoff, resonance, gain, etc.

Implements vital::SynthFilter.

◆ tick()

force_inline poly_float vital::DigitalSvf::tick ( poly_float audio_in,
poly_float coefficient,
poly_float resonance,
poly_float drive,
FilterValues & blends )

Applies advanced distortion to the input while performing a single SVF tick (12 dB).

Tick function for advanced, saturating 12 dB filtering.

Parameters
audio_inThe current input sample.
driveAmount of drive (pre-gain).
resonanceThe filter resonance.
coefficientThe filter coefficient derived from cutoff.
blendsThe low/band/high mix values.
Returns
The final filter output for the sample.
Parameters
audio_inThe current input sample.
coefficientThe computed filter coefficient.
resonanceThe filter resonance.
driveInput drive multiplier.
blendsThe filter’s low/band/high mix.
Returns
The final processed sample with saturation.

◆ tick24()

force_inline poly_float vital::DigitalSvf::tick24 ( poly_float audio_in,
poly_float coefficient,
poly_float resonance,
poly_float drive,
FilterValues & blends )

Tick function for a 24 dB multi-stage filter, adding an additional pre-stage.

Tick function for 24 dB filtering, performing a pre-stage, saturating, then a second SVF pass.

Parameters
audio_inThe current input sample.
coefficientThe filter coefficient.
resonanceThe filter resonance.
driveThe input drive multiplier.
blendsThe filter’s mix values (low/band/high).
Returns
The filter output for the sample.
Parameters
audio_inThe input sample.
coefficientThe filter coefficient.
resonanceThe filter resonance.
driveInput drive multiplier.
blendsFilter mixing parameters.
Returns
Filtered sample after 24 dB of attenuation.

◆ tickBasic()

force_inline poly_float vital::DigitalSvf::tickBasic ( poly_float audio_in,
poly_float coefficient,
poly_float resonance,
poly_float drive,
FilterValues & blends )

A basic (non-distorting) single SVF tick for a 12 dB filter style.

A simpler single tick for a 12 dB filter, skipping advanced distortion.

Parameters
audio_inThe current input sample.
coefficientThe filter coefficient derived from cutoff.
resonanceThe filter resonance.
driveThe input drive multiplier.
blendsThe filter’s mix values for low/band/high output.
Returns
The filter output for the sample.
Parameters
audio_inThe input sample.
coefficientThe filter coefficient from the lookup.
resonanceThe filter resonance (inverted).
driveThe input drive multiplier.
blendsLow/band/high mix factors.
Returns
Filtered sample output.

◆ tickBasic24()

force_inline poly_float vital::DigitalSvf::tickBasic24 ( poly_float audio_in,
poly_float coefficient,
poly_float resonance,
poly_float drive,
FilterValues & blends )

A simpler 24 dB tick function without advanced distortion or color.

Basic, non-distorting 24 dB filter tick.

Parameters
audio_inThe current input sample.
coefficientThe filter coefficient.
resonanceThe filter resonance.
driveThe input drive multiplier.
blendsThe filter’s mix values (low/band/high).
Returns
Filtered sample.
Parameters
audio_inThe input sample.
coefficientThe filter coefficient.
resonanceThe filter resonance.
driveInput drive multiplier.
blendsFilter mixing parameters.
Returns
Final 24 dB filter output.

◆ tickDual()

force_inline poly_float vital::DigitalSvf::tickDual ( poly_float audio_in,
poly_float coefficient,
poly_float resonance,
poly_float drive,
FilterValues & blends1,
FilterValues & blends2 )

Tick function for a dual filter approach, e.g. notch + band, etc.

A dual-stage filter approach, e.g., for dual notch/band passes.

Parameters
audio_inThe current input sample.
coefficientThe filter coefficient (cutoff).
resonanceThe filter resonance.
driveThe input drive multiplier.
blends1Low/band/high mixing for the first filter pass.
blends2Low/band/high mixing for the second filter pass.
Returns
Filtered sample after both filter passes.
Parameters
audio_inThe input sample.
coefficientThe filter coefficient.
resonanceFilter resonance.
driveInput drive multiplier.
blends1The first filter stage blends.
blends2The second filter stage blends.
Returns
The final sample after going through both filter passes.

Member Data Documentation

◆ kDefaultMaxResonance

mono_float vital::DigitalSvf::kDefaultMaxResonance = 16.0f
staticconstexpr

Default maximum resonance used when filtering (if not overridden).

◆ kDefaultMinResonance

mono_float vital::DigitalSvf::kDefaultMinResonance = 0.5f
staticconstexpr

Default minimum resonance used when filtering (if not overridden).

◆ kMaxGain

mono_float vital::DigitalSvf::kMaxGain = 15.0f
staticconstexpr

Maximum gain in dB for shelf or gain-based operations.

◆ kMinCutoff

mono_float vital::DigitalSvf::kMinCutoff = 1.0f
staticconstexpr

Minimum allowed cutoff frequency in Hz for the filter.

◆ kMinGain

mono_float vital::DigitalSvf::kMinGain = -15.0f
staticconstexpr

Minimum gain in dB for shelf or gain-based operations.

◆ svf_coefficient_lookup_

const DigitalSvf::SvfCoefficientLookup vital::DigitalSvf::svf_coefficient_lookup_
static

A static global lookup table instance for SVF coefficients.

The global SVF coefficient lookup table instance.

Initializes a 2048-entry table converting normalized frequency ratios to one-pole filter coefficients using computeSvfOnePoleFilterCoefficient().


The documentation for this class was generated from the following files: