sst-filters
Filters submodule for the Surge Synthesizer
Public Member Functions | Public Attributes | List of all members
FilterCoefficientMaker< TuningProvider > Class Template Reference

Class for creating filter coefficients. More...

Public Member Functions

 FilterCoefficientMaker ()
 Default constructor. More...
 
void setSampleRateAndBlockSize (float newSampleRate, int newBlockSize)
 Sets the sample rate and block size to use for processing the filters. More...
 
void Reset ()
 Resets the coefficients to zero, and the tuning provider to nullptr. More...
 
void FromDirect (const float(&N)[n_cm_coeffs])
 Creates filter coefficients directly from an array. More...
 
void MakeCoeffs (float Freq, float Reso, FilterType Type, FilterSubType SubType, TuningProvider *provider, bool tuningAdjusted)
 Creates filter coefficients for a given set of filter parameters. More...
 
template<typename StateType >
void updateState (StateType &state, int channel=-1)
 Update the coefficients in a filter state. More...
 
template<typename StateType >
void updateCoefficients (StateType &state, int channel=0)
 Update the local coefficients with the coefficients from the filter state. More...
 

Public Attributes

float C [n_cm_coeffs] {}
 Current filter coefficients. More...
 
float dC [n_cm_coeffs] {}
 Filter coefficients "delta" to update current coefficients. More...
 
float tC [n_cm_coeffs] {}
 "Target" filter coefficients More...
 

Detailed Description

template<typename TuningProvider = detail::BasicTuningProvider>
class sst::filters::FilterCoefficientMaker< TuningProvider >

Class for creating filter coefficients.

Template Parameters
TuningProviderA 12-TET tuning provider is used by default, but if you would like to support other tunings, you should use a custom tuning provider.

Constructor & Destructor Documentation

◆ FilterCoefficientMaker()

Default constructor.

Member Function Documentation

◆ setSampleRateAndBlockSize()

void setSampleRateAndBlockSize ( float  newSampleRate,
int  newBlockSize 
)

Sets the sample rate and block size to use for processing the filters.

◆ Reset()

void Reset

Resets the coefficients to zero, and the tuning provider to nullptr.

References C, and sst::filters::n_cm_coeffs.

◆ FromDirect()

void FromDirect ( const float(&)  N[n_cm_coeffs])

◆ MakeCoeffs()

void MakeCoeffs ( float  Freq,
float  Reso,
FilterType  Type,
FilterSubType  SubType,
TuningProvider *  provider,
bool  tuningAdjusted 
)

Creates filter coefficients for a given set of filter parameters.

Note that frequency is expected in units of MIDI note number, with A440 = 0.

References sst::filters::OBXDFilter::FOUR_POLE, sst::filters::fut_apf, sst::filters::fut_bp12, sst::filters::fut_bp24, sst::filters::fut_comb_neg, sst::filters::fut_comb_pos, sst::filters::fut_cutoffwarp_ap, sst::filters::fut_cutoffwarp_bp, sst::filters::fut_cutoffwarp_hp, sst::filters::fut_cutoffwarp_lp, sst::filters::fut_cutoffwarp_n, sst::filters::fut_diode, sst::filters::fut_hp12, sst::filters::fut_hp24, sst::filters::fut_k35_hp, sst::filters::fut_k35_lp, sst::filters::fut_k35_saturations, sst::filters::fut_lp12, sst::filters::fut_lp24, sst::filters::fut_lpmoog, sst::filters::fut_none, sst::filters::fut_notch12, sst::filters::fut_notch24, sst::filters::fut_obxd_2pole_bp, sst::filters::fut_obxd_2pole_hp, sst::filters::fut_obxd_2pole_lp, sst::filters::fut_obxd_2pole_n, sst::filters::fut_obxd_4pole, sst::filters::fut_resonancewarp_ap, sst::filters::fut_resonancewarp_bp, sst::filters::fut_resonancewarp_hp, sst::filters::fut_resonancewarp_lp, sst::filters::fut_resonancewarp_n, sst::filters::fut_SNH, sst::filters::fut_tripole, sst::filters::fut_vintageladder, sst::filters::K35Filter::makeCoefficients(), sst::filters::DiodeLadderFilter::makeCoefficients(), sst::filters::OBXDFilter::makeCoefficients(), sst::filters::ResonanceWarp::makeCoefficients(), sst::filters::VintageLadder::RK::makeCoefficients(), sst::filters::CutoffWarp::makeCoefficients(), sst::filters::TriPoleFilter::makeCoefficients(), sst::filters::VintageLadder::Huov::makeCoefficients(), sst::filters::num_filter_types, sst::filters::st_Standard, and sst::filters::OBXDFilter::TWO_POLE.

◆ updateState()

void updateState ( StateType &  state,
int  channel = -1 
)

Update the coefficients in a filter state.

To update the coefficients for a single channel, pass a channel index to the channel argument, otherwise the same coefficients will be used for all channels.

References C, sst::filters::n_cm_coeffs, and sst::filters::detail::set1f().

◆ updateCoefficients()

void updateCoefficients ( StateType &  state,
int  channel = 0 
)

Update the local coefficients with the coefficients from the filter state.

This is necessary since the filter state is responsible for smoothing the filter coefficients.

References C, sst::filters::detail::get1f(), and sst::filters::n_cm_coeffs.

Member Data Documentation

◆ C

float C[n_cm_coeffs] {}

Current filter coefficients.

◆ dC

float dC[n_cm_coeffs] {}

Filter coefficients "delta" to update current coefficients.

◆ tC

float tC[n_cm_coeffs] {}

"Target" filter coefficients


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