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 |
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
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
bool isModelConfigValid | ( | const FilterModel & | fm, |
const ModelConfig & | tc | ||
) |
A simple boolean check of if a given model config is valid for a given model.
fm | A given model |
tc | A candidate config |
References Filter::availableModelConfigurations().
Referenced by closestValidModelTo().
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 >().
bool isPartialConfigValid | ( | const FilterModel & | fm, |
Passband | p, | ||
Slope | s | ||
) |
References Filter::availableModelConfigurations(), get< Passband >(), and get< Slope >().
bool isPartialConfigValid | ( | const FilterModel & | fm, |
Passband | p, | ||
Slope | s, | ||
DriveMode | d | ||
) |
References Filter::availableModelConfigurations(), get< DriveMode >(), get< Passband >(), and get< Slope >().
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().
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.
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().
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.
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.
std::vector< std::pair< T, bool > > valuesAndValidityForPartialConfig | ( | const FilterModel & | fm, |
Passband | p | ||
) |
std::vector< std::pair< T, bool > > valuesAndValidityForPartialConfig | ( | const FilterModel & | fm, |
Passband | p, | ||
Slope | s | ||
) |
std::vector< std::pair< T, bool > > valuesAndValidityForPartialConfig | ( | const FilterModel & | fm, |
Passband | p, | ||
Slope | s, | ||
DriveMode | d | ||
) |
std::vector< std::pair< T, bool > > valuesAndValidityForPartiaulConfig | ( | const FilterModel & | fm, |
Args... | args | ||
) |
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.
std::vector< T > valuesForPartialConfig | ( | const FilterModel & | fm, |
const Passband & | p | ||
) |
std::vector< T > valuesForPartialConfig | ( | const FilterModel & | fm, |
const Passband & | p, | ||
const Slope & | s | ||
) |
std::vector< T > valuesForPartialConfig | ( | const FilterModel & | fm, |
const Passband & | p, | ||
const Slope & | s, | ||
const DriveMode & | d | ||
) |
std::vector< T > valuesForPartialConfig | ( | const FilterModel & | fm, |
Args... | args | ||
) |
bool noChoicesOrOnlyUnsupported | ( | const FilterModel & | fm, |
Args... | args | ||
) |
SIMD_M128 offFun | ( | sst::filters::QuadFilterUnitState * | __restrict, |
SIMD_M128 | in | ||
) |
Referenced by Filter::prepareInstance().
std::string toString | ( | const FilterModel & | f | ) |
References Comb, CutoffWarp, CytomicSVF, DiodeLadder, K35, None, OBXD_2Pole, OBXD_4Pole, OBXD_Xpander, ResonanceWarp, SampleAndHold, TriPole, VemberClassic, VemberLadder, and VintageLadder.
Referenced by FilterPayload::displayName(), and ModelConfig::toString().
std::string toString | ( | const Passband & | p | ) |
References Allpass, Bell, BP, HighHighHigh, HighLowHigh, HighShelf, HP, LowHighLow, LowLowLow, LowShelf, LP, Notch, NotchAndLP, Peak, Phaser, PhaserAndLP, and UNSUPPORTED.
std::string toString | ( | const Slope & | s | ) |
References Comb_Bipolar_ContinuousMix, Comb_Negative_100, Comb_Negative_50, Comb_Negative_ContinuousMix, Comb_Positive_100, Comb_Positive_50, Comb_Positive_ContinuousMix, Slope_12dB, Slope_12dB6dB, Slope_18dB, Slope_18dB6dB, Slope_24dB, Slope_6dB, Slope_6dB12dB, Slope_6dB18dB, Slope_Morph, and UNSUPPORTED.
std::string toString | ( | const DriveMode & | d | ) |
References Clean, Driven, K35_Continuous, K35_Extreme, K35_Heavy, K35_Mild, K35_Moderate, K35_None, NotchMild, OJD, Pushed, SoftClip, Standard, Tanh, and UNSUPPORTED.
std::string toString | ( | const FilterSubModel & | s | ) |
References BrokenOBXD4Pole24, First_output, Huov, HuovCompensated, RungeKutta, RungeKuttaCompensated, Second_output, Third_output, UNSUPPORTED, Warp_1Stage, Warp_2Stage, Warp_3Stage, and Warp_4Stage.
Passband get< Passband > | ( | const ModelConfig & | mc | ) |
References ModelConfig::pt.
Referenced by isPartialConfigValid(), isPartialConfigValid(), and isPartialConfigValid().
Slope get< Slope > | ( | const ModelConfig & | mc | ) |
References ModelConfig::st.
Referenced by isPartialConfigValid(), and isPartialConfigValid().
DriveMode get< DriveMode > | ( | const ModelConfig & | mc | ) |
References ModelConfig::dt.
Referenced by isPartialConfigValid().
FilterSubModel get< FilterSubModel > | ( | const ModelConfig & | mc | ) |
References ModelConfig::mt.
void set< Passband > | ( | ModelConfig & | mc, |
const Passband & | t | ||
) |
References ModelConfig::pt.
void set< Slope > | ( | ModelConfig & | mc, |
const Slope & | t | ||
) |
References ModelConfig::st.
void set< DriveMode > | ( | ModelConfig & | mc, |
const DriveMode & | t | ||
) |
References ModelConfig::dt.
void set< FilterSubModel > | ( | ModelConfig & | mc, |
const FilterSubModel & | t | ||
) |
References ModelConfig::mt.
|
noexcept |
|
noexcept |
References L.