sst-filters
Filters submodule for the Surge Synthesizer
Loading...
Searching...
No Matches
Namespaces | Classes | Concepts | Enumerations | Functions
sst::filtersplusplus Namespace Reference

configuration_selector contains a set of useful functions to genreate uis and allow users to navigate the configuration space more naturally than the simple flat list in the core api. More...

Namespaces

namespace  details
 
namespace  models
 

Classes

struct  Filter
 A class representing the surge filter models with a easier-to-use api. More...
 
struct  ModelConfig
 

Concepts

concept  is_modelconfig_enum
 
concept  is_distinct_modelconfig_enum
 

Enumerations

enum struct  FilterModel : uint32_t {
  None = 0 , VemberClassic = 0x10 , VemberLadder = 0x18 , CytomicSVF = 0x20 ,
  K35 = 0x30 , DiodeLadder = 0x35 , OBXD_4Pole = 0x40 , OBXD_2Pole = 0x45 ,
  OBXD_Xpander = 0x47 , VintageLadder = 0x50 , CutoffWarp = 0x60 , ResonanceWarp = 0x65 ,
  TriPole = 0x70 , Comb = 0x80 , SampleAndHold = 0x85
}
 
enum struct  Passband : uint32_t {
  UNSUPPORTED = 0 , LP = 0x04 , HP = 0x08 , BP = 0x0C ,
  Notch = 0x10 , Peak = 0x14 , Allpass = 0x18 , LowShelf = 0x50 ,
  Bell = 0x60 , HighShelf = 0x70 , Phaser = 0x80 , NotchAndLP = 0x92 ,
  PhaserAndLP = 0x94 , LowLowLow = 0x30 + 0b000 , LowHighLow = 0x30 + 0b010 , HighLowHigh = 0x30 + 0b101 ,
  HighHighHigh = 0x30 + 0b111
}
 
enum struct  Slope : uint32_t {
  UNSUPPORTED = 0 , Slope_6dB = 0x06 , Slope_12dB = 0x12 , Slope_18dB = 0x18 ,
  Slope_24dB = 0x24 , Slope_6dB12dB = 0x07 , Slope_6dB18dB = 0x08 , Slope_12dB6dB = 0x13 ,
  Slope_18dB6dB = 0x19 , Slope_Morph = 0x40 , Comb_Negative_ContinuousMix = 0x50 , Comb_Negative_100 = 0x51 ,
  Comb_Negative_50 = 0x52 , Comb_Positive_50 = 0x53 , Comb_Positive_100 = 0x54 , Comb_Positive_ContinuousMix = 0x55 ,
  Comb_Bipolar_ContinuousMix = 0x56
}
 
enum struct  DriveMode : uint32_t {
  UNSUPPORTED = 0 , Standard = 0x10 , Clean = 0x12 , Driven = 0x14 ,
  NotchMild = 0x18 , K35_None = 0x30 , K35_Mild = 0x32 , K35_Moderate = 0x34 ,
  K35_Heavy = 0x36 , K35_Extreme = 0x38 , K35_Continuous = 0x39 , Pushed = 0x50 ,
  Tanh = 0x40 , SoftClip = 0x42 , OJD = 0x44
}
 
enum struct  FilterSubModel : uint32_t {
  UNSUPPORTED = 0 , BrokenOBXD4Pole24 = 0x10 , RungeKutta = 0x20 , RungeKuttaCompensated = 0x22 ,
  Huov = 0x24 , HuovCompensated = 0x26 , First_output = 0x31 , Second_output = 0x32 ,
  Third_output = 0x33 , Warp_1Stage = 0x60 , Warp_2Stage = 0x61 , Warp_3Stage = 0x62 ,
  Warp_4Stage = 0x63
}
 

Functions

bool isModelConfigValid (const FilterModel &fm, const ModelConfig &tc)
 A simple boolean check of if a given model config is valid for a given model.
 
bool isPartialConfigValid (const FilterModel &fm, Passband p)
 This API allows you to build a partial config and test if you are valid so far.
 
bool isPartialConfigValid (const FilterModel &fm, Passband p, Slope s)
 
bool isPartialConfigValid (const FilterModel &fm, Passband p, Slope s, DriveMode d)
 
template<is_modelconfig_enum T, typename... Args>
requires (is_modelconfig_enum<Args> && ...)
bool isPartialMatch (const ModelConfig &mc, Args... cstr)
 isPartialMatch is just a utility where you can send a model config and then any subset of enums and get a true/false.
 
ModelConfig closestValidModelTo (const FilterModel &fm, const ModelConfig &mc)
 Given a model config, which is the 'closes' valid model to the one handed in.
 
template<is_modelconfig_enum T>
std::vector< T > potentialValuesFor (const FilterModel &fm)
 Given an enum type, what are the potential values this model could support for just that dimension.
 
template<is_modelconfig_enum T>
bool supportsChoice (const FilterModel &fm)
 If a model doesn't use a particular dimension at all (namely all values of that dimension are UNSUPPORTED) return true.
 
template<is_modelconfig_enum T>
std::vector< std::pair< T, bool > > valuesAndValidityForPartialConfig (const FilterModel &fm)
 To probe a partial config, you want to know which values are possible valid and either get a list with only valid ones, or get a list of values with validity.
 
template<is_modelconfig_enum T>
std::vector< std::pair< T, bool > > valuesAndValidityForPartialConfig (const FilterModel &fm, Passband p)
 
template<is_modelconfig_enum T>
std::vector< std::pair< T, bool > > valuesAndValidityForPartialConfig (const FilterModel &fm, Passband p, Slope s)
 
template<is_modelconfig_enum T>
std::vector< std::pair< T, bool > > valuesAndValidityForPartialConfig (const FilterModel &fm, Passband p, Slope s, DriveMode d)
 
template<is_modelconfig_enum T, typename... Args>
requires (is_distinct_modelconfig_enum<Args, T> && ...)
std::vector< std::pair< T, bool > > valuesAndValidityForPartiaulConfig (const FilterModel &fm, Args... args)
 
template<is_modelconfig_enum T>
std::vector< T > valuesForPartialConfig (const FilterModel &fm)
 And this provides the filtered version, so items in the above api with false here would just not appear in the list.
 
template<is_modelconfig_enum T>
std::vector< T > valuesForPartialConfig (const FilterModel &fm, const Passband &p)
 
template<is_modelconfig_enum T>
std::vector< T > valuesForPartialConfig (const FilterModel &fm, const Passband &p, const Slope &s)
 
template<is_modelconfig_enum T>
std::vector< T > valuesForPartialConfig (const FilterModel &fm, const Passband &p, const Slope &s, const DriveMode &d)
 
template<is_modelconfig_enum T, typename... Args>
requires (is_distinct_modelconfig_enum<Args, T> && ...)
std::vector< T > valuesForPartialConfig (const FilterModel &fm, Args... args)
 
template<is_modelconfig_enum T, typename... Args>
requires (is_distinct_modelconfig_enum<Args, T> && ...)
bool noChoicesOrOnlyUnsupported (const FilterModel &fm, Args... args)
 
SIMD_M128 offFun (sst::filters::QuadFilterUnitState *__restrict, SIMD_M128 in)
 
std::string toString (const FilterModel &f)
 
std::string toString (const Passband &p)
 
std::string toString (const Slope &s)
 
std::string toString (const DriveMode &d)
 
std::string toString (const FilterSubModel &s)
 
template<>
Passband get< Passband > (const ModelConfig &mc)
 
template<>
Slope get< Slope > (const ModelConfig &mc)
 
template<>
DriveMode get< DriveMode > (const ModelConfig &mc)
 
template<>
FilterSubModel get< FilterSubModel > (const ModelConfig &mc)
 
template<>
void set< Passband > (ModelConfig &mc, const Passband &t)
 
template<>
void set< Slope > (ModelConfig &mc, const Slope &t)
 
template<>
void set< DriveMode > (ModelConfig &mc, const DriveMode &t)
 
template<>
void set< FilterSubModel > (ModelConfig &mc, const FilterSubModel &t)
 
bool operator== (const ModelConfig &lhs, const ModelConfig &rhs) noexcept
 
bool operator< (const ModelConfig &lhs, const ModelConfig &rhs) noexcept
 

Detailed Description

configuration_selector contains a set of useful functions to genreate uis and allow users to navigate the configuration space more naturally than the simple flat list in the core api.

To make this easier, we have editorialized a hierarchy of enums, PassBand > Slope > Drive > FilterSubModel. That is, the 'partical config validity' means you check passband first and so on.

You could make a different choice of course! Its just tweaking the presented API. The internal stuff in the impl/details is just all vararg packs anyway

Enumeration Type Documentation

◆ FilterModel

enum struct FilterModel : uint32_t
strong
Enumerator
None 
VemberClassic 
VemberLadder 
CytomicSVF 
K35 
DiodeLadder 
OBXD_4Pole 
OBXD_2Pole 
OBXD_Xpander 
VintageLadder 
CutoffWarp 
ResonanceWarp 
TriPole 
Comb 
SampleAndHold 

◆ Passband

enum struct Passband : uint32_t
strong
Enumerator
UNSUPPORTED 
LP 
HP 
BP 
Notch 
Peak 
Allpass 
LowShelf 
Bell 
HighShelf 
Phaser 
NotchAndLP 
PhaserAndLP 
LowLowLow 
LowHighLow 
HighLowHigh 
HighHighHigh 

◆ Slope

enum struct Slope : uint32_t
strong
Enumerator
UNSUPPORTED 
Slope_6dB 
Slope_12dB 
Slope_18dB 
Slope_24dB 
Slope_6dB12dB 
Slope_6dB18dB 
Slope_12dB6dB 
Slope_18dB6dB 
Slope_Morph 
Comb_Negative_ContinuousMix 
Comb_Negative_100 
Comb_Negative_50 
Comb_Positive_50 
Comb_Positive_100 
Comb_Positive_ContinuousMix 
Comb_Bipolar_ContinuousMix 

◆ DriveMode

enum struct DriveMode : uint32_t
strong
Enumerator
UNSUPPORTED 
Standard 
Clean 
Driven 
NotchMild 
K35_None 
K35_Mild 
K35_Moderate 
K35_Heavy 
K35_Extreme 
K35_Continuous 
Pushed 
Tanh 
SoftClip 
OJD 

◆ FilterSubModel

enum struct FilterSubModel : uint32_t
strong
Enumerator
UNSUPPORTED 
BrokenOBXD4Pole24 
RungeKutta 
RungeKuttaCompensated 
Huov 
HuovCompensated 
First_output 
Second_output 
Third_output 
Warp_1Stage 
Warp_2Stage 
Warp_3Stage 
Warp_4Stage 

Function Documentation

◆ isModelConfigValid()

bool isModelConfigValid ( const FilterModel fm,
const ModelConfig tc 
)

A simple boolean check of if a given model config is valid for a given model.

Parameters
fmA given model
tcA candidate config

References Filter::availableModelConfigurations().

Referenced by closestValidModelTo().

◆ isPartialConfigValid() [1/3]

bool isPartialConfigValid ( const FilterModel fm,
Passband  p 
)

This API allows you to build a partial config and test if you are valid so far.

So for a model, do you have a valid passband, passband/slope and passband/slope/drive. The full quartet can be answered with isModelConfigValid

References Filter::availableModelConfigurations(), and get< Passband >().

◆ isPartialConfigValid() [2/3]

bool isPartialConfigValid ( const FilterModel fm,
Passband  p,
Slope  s 
)

◆ isPartialConfigValid() [3/3]

bool isPartialConfigValid ( const FilterModel fm,
Passband  p,
Slope  s,
DriveMode  d 
)

◆ isPartialMatch()

template<is_modelconfig_enum T, typename... Args>
requires (is_modelconfig_enum<Args> && ...)
bool isPartialMatch ( const ModelConfig mc,
Args...  cstr 
)

isPartialMatch is just a utility where you can send a model config and then any subset of enums and get a true/false.

References sst::filtersplusplus::details::mcequal().

◆ closestValidModelTo()

ModelConfig closestValidModelTo ( const FilterModel fm,
const ModelConfig mc 
)

Given a model config, which is the 'closes' valid model to the one handed in.

If the model config is valid, it is just returned, otherwise find partial matches up the stack dropping SM, DT, Slp, and Filt each.

References Filter::availableModelConfigurations(), ModelConfig::dt, isModelConfigValid(), ModelConfig::pt, and ModelConfig::st.

◆ potentialValuesFor()

template<is_modelconfig_enum T>
std::vector< T > potentialValuesFor ( const FilterModel fm)

Given an enum type, what are the potential values this model could support for just that dimension.

So like potentialValuesFor<sst::filtersplusplus::Slope>(fm) would give you all the slopes that any configuration of the model would use.

References Filter::availableModelConfigurations().

◆ supportsChoice()

template<is_modelconfig_enum T>
bool supportsChoice ( const FilterModel fm)

If a model doesn't use a particular dimension at all (namely all values of that dimension are UNSUPPORTED) return true.

◆ valuesAndValidityForPartialConfig() [1/4]

template<is_modelconfig_enum T>
std::vector< std::pair< T, bool > > valuesAndValidityForPartialConfig ( const FilterModel fm)

To probe a partial config, you want to know which values are possible valid and either get a list with only valid ones, or get a list of values with validity.

This first api provides the second - a pair of values and bools for a partiaul config in one dimension along the second dimension.

◆ valuesAndValidityForPartialConfig() [2/4]

template<is_modelconfig_enum T>
std::vector< std::pair< T, bool > > valuesAndValidityForPartialConfig ( const FilterModel fm,
Passband  p 
)

◆ valuesAndValidityForPartialConfig() [3/4]

template<is_modelconfig_enum T>
std::vector< std::pair< T, bool > > valuesAndValidityForPartialConfig ( const FilterModel fm,
Passband  p,
Slope  s 
)

◆ valuesAndValidityForPartialConfig() [4/4]

template<is_modelconfig_enum T>
std::vector< std::pair< T, bool > > valuesAndValidityForPartialConfig ( const FilterModel fm,
Passband  p,
Slope  s,
DriveMode  d 
)

◆ valuesAndValidityForPartiaulConfig()

template<is_modelconfig_enum T, typename... Args>
requires (is_distinct_modelconfig_enum<Args, T> && ...)
std::vector< std::pair< T, bool > > valuesAndValidityForPartiaulConfig ( const FilterModel fm,
Args...  args 
)

◆ valuesForPartialConfig() [1/5]

template<is_modelconfig_enum T>
std::vector< T > valuesForPartialConfig ( const FilterModel fm)

And this provides the filtered version, so items in the above api with false here would just not appear in the list.

◆ valuesForPartialConfig() [2/5]

template<is_modelconfig_enum T>
std::vector< T > valuesForPartialConfig ( const FilterModel fm,
const Passband p 
)

◆ valuesForPartialConfig() [3/5]

template<is_modelconfig_enum T>
std::vector< T > valuesForPartialConfig ( const FilterModel fm,
const Passband p,
const Slope s 
)

◆ valuesForPartialConfig() [4/5]

template<is_modelconfig_enum T>
std::vector< T > valuesForPartialConfig ( const FilterModel fm,
const Passband p,
const Slope s,
const DriveMode d 
)

◆ valuesForPartialConfig() [5/5]

template<is_modelconfig_enum T, typename... Args>
requires (is_distinct_modelconfig_enum<Args, T> && ...)
std::vector< T > valuesForPartialConfig ( const FilterModel fm,
Args...  args 
)

◆ noChoicesOrOnlyUnsupported()

template<is_modelconfig_enum T, typename... Args>
requires (is_distinct_modelconfig_enum<Args, T> && ...)
bool noChoicesOrOnlyUnsupported ( const FilterModel fm,
Args...  args 
)

◆ offFun()

SIMD_M128 offFun ( sst::filters::QuadFilterUnitState __restrict,
SIMD_M128  in 
)

Referenced by Filter::prepareInstance().

◆ toString() [1/5]

std::string toString ( const FilterModel f)

◆ toString() [2/5]

std::string toString ( const Passband p)

◆ toString() [3/5]

std::string toString ( const Slope s)

◆ toString() [4/5]

std::string toString ( const DriveMode d)

◆ toString() [5/5]

std::string toString ( const FilterSubModel s)

◆ get< Passband >()

template<>
Passband get< Passband > ( const ModelConfig mc)

◆ get< Slope >()

template<>
Slope get< Slope > ( const ModelConfig mc)

◆ get< DriveMode >()

template<>
DriveMode get< DriveMode > ( const ModelConfig mc)

References ModelConfig::dt.

Referenced by isPartialConfigValid().

◆ get< FilterSubModel >()

template<>
FilterSubModel get< FilterSubModel > ( const ModelConfig mc)

References ModelConfig::mt.

◆ set< Passband >()

template<>
void set< Passband > ( ModelConfig mc,
const Passband t 
)

References ModelConfig::pt.

◆ set< Slope >()

template<>
void set< Slope > ( ModelConfig mc,
const Slope t 
)

References ModelConfig::st.

◆ set< DriveMode >()

template<>
void set< DriveMode > ( ModelConfig mc,
const DriveMode t 
)

References ModelConfig::dt.

◆ set< FilterSubModel >()

template<>
void set< FilterSubModel > ( ModelConfig mc,
const FilterSubModel t 
)

References ModelConfig::mt.

◆ operator==()

bool operator== ( const ModelConfig lhs,
const ModelConfig rhs 
)
noexcept

◆ operator<()

bool operator< ( const ModelConfig lhs,
const ModelConfig rhs 
)
noexcept

References L.