Skip to content

Commit

Permalink
switch18 & 81: clamp weights to float values
Browse files Browse the repository at this point in the history
  • Loading branch information
alefnull committed Aug 23, 2022
1 parent fde47e0 commit bbe9bf1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/switch18.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ struct Switch18 : Module, SwitchBase {
weights[i] = params[STEP_1_PARAM + i].getValue();
}
else {
weights[i] = inputs[STEP_1_CV_INPUT + i].getVoltage();
weights[i] = clamp(weights[i] + params[STEP_1_PARAM].getValue(), 0, 1);
weights[i] = inputs[STEP_1_CV_INPUT + i].getVoltage() / 5.f;
weights[i] = clamp(weights[i] + params[STEP_1_PARAM].getValue(), 0.f, 1.f);
}
}
else {
Expand Down
4 changes: 2 additions & 2 deletions src/switch81.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ struct Switch81 : Module, SwitchBase {
weights[i] = params[STEP_1_PARAM + i].getValue();
}
else {
weights[i] = inputs[STEP_1_CV_INPUT + i].getVoltage();
weights[i] = clamp(weights[i] + params[STEP_1_PARAM].getValue(), 0, 1);
weights[i] = inputs[STEP_1_CV_INPUT + i].getVoltage() / 5.f;
weights[i] = clamp(weights[i] + params[STEP_1_PARAM].getValue(), 0.f, 1.f);
}
}
else {
Expand Down

0 comments on commit bbe9bf1

Please sign in to comment.