| @@ -56,7 +56,22 @@ struct LFO : Module { | |||||
| config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); | config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); | ||||
| configButton(OFFSET_PARAM, "Offset 0-10V"); | configButton(OFFSET_PARAM, "Offset 0-10V"); | ||||
| configButton(INVERT_PARAM, "Invert"); | configButton(INVERT_PARAM, "Invert"); | ||||
| configParam(FREQ_PARAM, -8.f, 10.f, 1.f, "Frequency", " Hz", 2, 1); | |||||
| struct FrequencyQuantity : ParamQuantity { | |||||
| float getDisplayValue() override { | |||||
| LFO* module = reinterpret_cast<LFO*>(this->module); | |||||
| if (module->clockFreq == 2.f) { | |||||
| unit = " Hz"; | |||||
| displayMultiplier = 1.f; | |||||
| } | |||||
| else { | |||||
| unit = "x"; | |||||
| displayMultiplier = 1 / 2.f; | |||||
| } | |||||
| return ParamQuantity::getDisplayValue(); | |||||
| } | |||||
| }; | |||||
| configParam<FrequencyQuantity>(FREQ_PARAM, -8.f, 10.f, 1.f, "Frequency", " Hz", 2, 1); | |||||
| configParam(FM_PARAM, -1.f, 1.f, 0.f, "Frequency modulation", "%", 0.f, 100.f); | configParam(FM_PARAM, -1.f, 1.f, 0.f, "Frequency modulation", "%", 0.f, 100.f); | ||||
| getParamQuantity(FM_PARAM)->randomizeEnabled = false; | getParamQuantity(FM_PARAM)->randomizeEnabled = false; | ||||
| configParam(PW_PARAM, 0.01f, 0.99f, 0.5f, "Pulse width", "%", 0.f, 100.f); | configParam(PW_PARAM, 0.01f, 0.99f, 0.5f, "Pulse width", "%", 0.f, 100.f); | ||||