diff --git a/include/sst/basic-blocks/params/ParamMetadata.h b/include/sst/basic-blocks/params/ParamMetadata.h index eea1614..cde6737 100644 --- a/include/sst/basic-blocks/params/ParamMetadata.h +++ b/include/sst/basic-blocks/params/ParamMetadata.h @@ -695,10 +695,10 @@ struct ParamMetaData .withIntegerQuantization() .withDecimalPlaces(0); } - ParamMetaData asLfoRate() + ParamMetaData asLfoRate(float from = -7.f, float to = 9.f) { return withType(FLOAT) - .withRange(-7, 9) + .withRange(from, to) .temposyncable() .withTemposyncMultiplier(-1) .withIntegerQuantization() diff --git a/include/sst/basic-blocks/tables/TwoToTheXProvider.h b/include/sst/basic-blocks/tables/TwoToTheXProvider.h index 62ba49d..27684e7 100644 --- a/include/sst/basic-blocks/tables/TwoToTheXProvider.h +++ b/include/sst/basic-blocks/tables/TwoToTheXProvider.h @@ -34,6 +34,7 @@ namespace sst::basic_blocks::tables { struct TwoToTheXProvider { + bool isInit{false}; static constexpr int intBase{-15}; static constexpr int providerRange{32}; @@ -44,6 +45,9 @@ struct TwoToTheXProvider void init() { + if (isInit) + return; + for (int i = 0; i < providerRange; i++) { baseValue[i] = pow(2.0, i + intBase); @@ -54,6 +58,8 @@ struct TwoToTheXProvider double frac = i * 1.0 / (nInterp - 1); table_two_to_the[i] = pow(2.0, frac); } + + isInit = true; } float twoToThe(float x) const