Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LFORate gets range and twotox gets init-once #114

Merged
merged 1 commit into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/sst/basic-blocks/params/ParamMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 6 additions & 0 deletions include/sst/basic-blocks/tables/TwoToTheXProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ namespace sst::basic_blocks::tables
{
struct TwoToTheXProvider
{
bool isInit{false};
static constexpr int intBase{-15};
static constexpr int providerRange{32};

Expand All @@ -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);
Expand All @@ -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
Expand Down
Loading