Browse Source

Add FrequencyQuantity to LFO.

tags/v2.0.1
Andrew Belt 3 years ago
parent
commit
ce78196093
1 changed files with 16 additions and 1 deletions
  1. +16
    -1
      src/LFO.cpp

+ 16
- 1
src/LFO.cpp View File

@@ -56,7 +56,22 @@ struct LFO : Module {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configButton(OFFSET_PARAM, "Offset 0-10V");
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);
getParamQuantity(FM_PARAM)->randomizeEnabled = false;
configParam(PW_PARAM, 0.01f, 0.99f, 0.5f, "Pulse width", "%", 0.f, 100.f);


Loading…
Cancel
Save