Class for creating filter coefficients. More...
#include <FilterCoefficientMaker.h>
Public Member Functions | |
| FilterCoefficientMaker () | |
| Default constructor. | |
| void | setSampleRateAndBlockSize (float newSampleRate, int newBlockSize) |
| Sets the sample rate and block size to use for processing the filters. | |
| void | Reset () |
| Resets the coefficients to zero, and the tuning provider to nullptr. | |
| void | FromDirect (const float(&N)[n_cm_coeffs]) |
| Creates filter coefficients directly from an array. | |
| void | MakeCoeffs (float Freq, float Reso, FilterType Type, FilterSubType SubType, TuningProvider *provider, bool tuningAdjusted, float extra=0.f, float extra2=0.f, float extra3=0.f) |
| Creates filter coefficients for a given set of filter parameters. | |
| template<typename StateType > | |
| void | updateState (StateType &state, int channel=-1) |
| Update the coefficients in a filter state. | |
| template<typename StateType > | |
| void | updateCoefficients (StateType &state, int channel=0) |
| Update the local coefficients with the coefficients from the filter state. | |
Static Public Member Functions | |
| static float | provider_note_to_pitch (TuningProvider *provider, float note) |
| static float | provider_note_to_pitch_ignoring_tuning (TuningProvider *provider, float note) |
| static float | provider_note_to_pitch_inv_ignoring_tuning (TuningProvider *provider, float note) |
| static void | provider_note_to_omega_ignoring_tuning (TuningProvider *provider, float x, float &sinu, float &cosi, float sampleRate) |
Public Attributes | |
| float | C [n_cm_coeffs] {} |
| Current filter coefficients. | |
| float | dC [n_cm_coeffs] {} |
| Filter coefficients "delta" to update current coefficients. | |
| float | tC [n_cm_coeffs] {} |
| "Target" filter coefficients | |
| float | fromDirectLast [n_cm_coeffs] {} |
| Last 'N' value used in fromdirect You would think this would be target (and ultimately it is) but the original usage calculated and applied these over and over and target was and still is the low pass filtered value. | |
Class for creating filter coefficients.
| TuningProvider | A 12-TET tuning provider is used by default, but if you would like to support other tunings, you should use a custom tuning provider. |
| FilterCoefficientMaker | ( | ) |
Default constructor.
| void setSampleRateAndBlockSize | ( | float | newSampleRate, |
| int | newBlockSize | ||
| ) |
Sets the sample rate and block size to use for processing the filters.
| void Reset | ( | ) |
Resets the coefficients to zero, and the tuning provider to nullptr.
References sst::filters::n_cm_coeffs.
| void FromDirect | ( | const float(&) | N[n_cm_coeffs] | ) |
Creates filter coefficients directly from an array.
References N, sst::filters::n_cm_coeffs, and sst::filters::smooth.
Referenced by sst::filters::cytomic_quadform::makeCoefficients(), sst::filters::K35Filter::makeCoefficients(), sst::filters::VintageLadder::RK::makeCoefficients(), sst::filters::VintageLadder::Huov::makeCoefficients(), sst::filters::VintageLadder::Huov2010::makeCoefficients(), sst::filters::DiodeLadderFilter::makeCoefficients(), sst::filters::ResonanceWarp::makeCoefficients(), sst::filters::CutoffWarp::makeCoefficients(), sst::filters::TriPoleFilter::makeCoefficients(), and sst::filters::OBXDFilter::makeCoefficients().
| void MakeCoeffs | ( | float | Freq, |
| float | Reso, | ||
| FilterType | Type, | ||
| FilterSubType | SubType, | ||
| TuningProvider * | provider, | ||
| bool | tuningAdjusted, | ||
| float | extra = 0.f, |
||
| float | extra2 = 0.f, |
||
| float | extra3 = 0.f |
||
| ) |
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_cytomic_svf, 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_obxd_xpander, 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::cytomic_quadform::makeCoefficients(), sst::filters::K35Filter::makeCoefficients(), sst::filters::VintageLadder::RK::makeCoefficients(), sst::filters::VintageLadder::Huov::makeCoefficients(), sst::filters::VintageLadder::Huov2010::makeCoefficients(), sst::filters::DiodeLadderFilter::makeCoefficients(), sst::filters::ResonanceWarp::makeCoefficients(), sst::filters::CutoffWarp::makeCoefficients(), sst::filters::TriPoleFilter::makeCoefficients(), sst::filters::OBXDFilter::makeCoefficients(), sst::filters::num_filter_types, sst::filters::st_bp12_LegacyClean, sst::filters::st_bp12_LegacyDriven, sst::filters::st_Clean, sst::filters::st_Driven, sst::filters::st_k35_continuous, sst::filters::st_k35_extreme, sst::filters::st_obxd4pole_broken24dB, sst::filters::st_obxd4pole_morph, sst::filters::st_Standard, sst::filters::st_vintage_type1, sst::filters::st_vintage_type1_compensated, sst::filters::st_vintage_type2, sst::filters::st_vintage_type2_compensated, sst::filters::st_vintage_type3, sst::filters::st_vintage_type3_compensated, sst::filters::OBXDFilter::TWO_POLE, and sst::filters::OBXDFilter::XPANDER.
| 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 sst::filters::n_cm_coeffs, and sst::filters::detail::set1f().
| 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 sst::filters::detail::get1f(), and sst::filters::n_cm_coeffs.
|
static |
|
static |
|
static |
|
static |
| float C[n_cm_coeffs] {} |
Current filter coefficients.
| float dC[n_cm_coeffs] {} |
Filter coefficients "delta" to update current coefficients.
| float tC[n_cm_coeffs] {} |
"Target" filter coefficients
| float fromDirectLast[n_cm_coeffs] {} |
Last 'N' value used in fromdirect You would think this would be target (and ultimately it is) but the original usage calculated and applied these over and over and target was and still is the low pass filtered value.
So this is that value and if you know that the register calculation is unchanged you can just apply it again in FromDirect (like Filters++::freezeCoefficients does)