Skip to content

Commit

Permalink
small tweaks for comparator and transgate
Browse files Browse the repository at this point in the history
  • Loading branch information
scanner-darkly committed May 25, 2024
1 parent 13cec2b commit c7fe927
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 63 deletions.
6 changes: 3 additions & 3 deletions dev/cpp_comparator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct SDComparator : Module {
LEVEL6_PARAM,
LEVEL7_PARAM,
LEVEL8_PARAM,
MODE_PARAM,
DOT_PARAM,
PARAMS_LEN
};
enum InputId {
Expand Down Expand Up @@ -53,7 +53,7 @@ struct SDComparator : Module {
configParam(LEVEL6_PARAM, 0.f, 1.f, 0.f, "");
configParam(LEVEL7_PARAM, 0.f, 1.f, 0.f, "");
configParam(LEVEL8_PARAM, 0.f, 1.f, 0.f, "");
configParam(MODE_PARAM, 0.f, 1.f, 0.f, "");
configParam(DOT_PARAM, 0.f, 1.f, 0.f, "");
configInput(LEVELS_INPUT, "");
configInput(INPUT_INPUT, "");
configOutput(GATE1_OUTPUT, "");
Expand Down Expand Up @@ -85,7 +85,7 @@ struct SDComparatorWidget : ModuleWidget {
addParam(createParamCentered<SDSmallestKnob>(mm2px(Vec(6.271, 68.236)), module, SDComparator::LEVEL6_PARAM));
addParam(createParamCentered<SDSmallestKnob>(mm2px(Vec(6.271, 79.258)), module, SDComparator::LEVEL7_PARAM));
addParam(createParamCentered<SDSmallestKnob>(mm2px(Vec(6.271, 90.28)), module, SDComparator::LEVEL8_PARAM));
addParam(createParam<SDTwoSwitch>(mm2px(Vec(15.617, 101.089)), module, SDComparator::MODE_PARAM));
addParam(createParam<SDTwoSwitch>(mm2px(Vec(15.541, 101.089)), module, SDComparator::DOT_PARAM));

addInput(createInputCentered<SDPolyInPort>(mm2px(Vec(6.651, 104.61)), module, SDComparator::LEVELS_INPUT));
addInput(createInputCentered<SDMonoInPort>(mm2px(Vec(6.651, 119.319)), module, SDComparator::INPUT_INPUT));
Expand Down
2 changes: 1 addition & 1 deletion dev/cpp_transgate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct SDTransgateWidget : ModuleWidget {
addParam(createParamCentered<SDSmallestKnob>(mm2px(Vec(19.128, 68.236)), module, SDTransgate::TRANS6_PARAM));
addParam(createParamCentered<SDSmallestKnob>(mm2px(Vec(19.128, 79.258)), module, SDTransgate::TRANS7_PARAM));
addParam(createParamCentered<SDSmallestKnob>(mm2px(Vec(19.128, 90.28)), module, SDTransgate::TRANS8_PARAM));
addParam(createParam<SDTwoSwitch>(mm2px(Vec(15.617, 101.089)), module, SDTransgate::ALL_ON_PARAM));
addParam(createParam<SDTwoSwitch>(mm2px(Vec(15.541, 101.089)), module, SDTransgate::ALL_ON_PARAM));

addInput(createInputCentered<SDMonoInPort>(mm2px(Vec(6.652, 13.126)), module, SDTransgate::GATE1_INPUT));
addInput(createInputCentered<SDMonoInPort>(mm2px(Vec(6.652, 24.148)), module, SDTransgate::GATE2_INPUT));
Expand Down
30 changes: 15 additions & 15 deletions dev/panel_comparator.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions dev/panel_transgate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 41 additions & 23 deletions res/SDComparator.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions res/SDTransgate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions src/SDComparator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct SDComparator : Module {
LEVEL6_PARAM,
LEVEL7_PARAM,
LEVEL8_PARAM,
MODE_PARAM,
DOT_PARAM,
PARAMS_LEN
};
enum InputId {
Expand Down Expand Up @@ -57,8 +57,8 @@ struct SDComparator : Module {
configParam(LEVEL7_PARAM, -10.f, 10.f, 0.f, "");
configParam(LEVEL8_PARAM, -10.f, 10.f, 0.f, "");

configSwitch(MODE_PARAM, 0.0, 1.0, 0.0, "Mode", {"Dot", "Bar"});
getParamQuantity(MODE_PARAM)->randomizeEnabled = false;
configSwitch(DOT_PARAM, 0.0, 1.0, 0.0, "Dot Mode", {"On", "Off"});
getParamQuantity(DOT_PARAM)->randomizeEnabled = false;

configInput(LEVELS_INPUT, "Threshold Levels");
configInput(INPUT_INPUT, "Input");
Expand Down Expand Up @@ -104,7 +104,7 @@ struct SDComparator : Module {
}
}

if (params[MODE_PARAM].getValue() == 1) { // dot
if (params[DOT_PARAM].getValue() == 1) { // dot
for (int i = 0; i < CHANNEL_COUNT; i++) {
lights[GATEON1_LIGHT + i].setBrightness(i == highest_index ? 1.f : 0.f);
outputs[GATE1_OUTPUT + i].setVoltage(i == highest_index ? 10.f : 0.f);
Expand Down Expand Up @@ -136,7 +136,7 @@ struct SDComparatorWidget : ModuleWidget {
addParam(createParamCentered<SDSmallestKnob>(mm2px(Vec(6.271, 68.236)), module, SDComparator::LEVEL6_PARAM));
addParam(createParamCentered<SDSmallestKnob>(mm2px(Vec(6.271, 79.258)), module, SDComparator::LEVEL7_PARAM));
addParam(createParamCentered<SDSmallestKnob>(mm2px(Vec(6.271, 90.28)), module, SDComparator::LEVEL8_PARAM));
addParam(createParam<SDTwoSwitch>(mm2px(Vec(15.617, 101.089)), module, SDComparator::MODE_PARAM));
addParam(createParam<SDTwoSwitch>(mm2px(Vec(15.541, 101.089)), module, SDComparator::DOT_PARAM));

addInput(createInputCentered<SDPolyInPort>(mm2px(Vec(6.651, 104.61)), module, SDComparator::LEVELS_INPUT));
addInput(createInputCentered<SDMonoInPort>(mm2px(Vec(6.651, 119.319)), module, SDComparator::INPUT_INPUT));
Expand Down
2 changes: 1 addition & 1 deletion src/SDTransgate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ struct SDTransgateWidget : ModuleWidget {
addParam(createParamCentered<SDSmallestKnob>(mm2px(Vec(19.128, 68.236)), module, SDTransgate::TRANS6_PARAM));
addParam(createParamCentered<SDSmallestKnob>(mm2px(Vec(19.128, 79.258)), module, SDTransgate::TRANS7_PARAM));
addParam(createParamCentered<SDSmallestKnob>(mm2px(Vec(19.128, 90.28)), module, SDTransgate::TRANS8_PARAM));
addParam(createParam<SDTwoSwitch>(mm2px(Vec(15.617, 101.089)), module, SDTransgate::ALL_ON_PARAM));
addParam(createParam<SDTwoSwitch>(mm2px(Vec(15.541, 101.089)), module, SDTransgate::ALL_ON_PARAM));

addInput(createInputCentered<SDMonoInPort>(mm2px(Vec(6.652, 13.126)), module, SDTransgate::GATE1_INPUT));
addInput(createInputCentered<SDMonoInPort>(mm2px(Vec(6.652, 24.148)), module, SDTransgate::GATE2_INPUT));
Expand Down

0 comments on commit c7fe927

Please sign in to comment.