Browse Source

Use SwitchQuantity for switches.

tags/v2.0.1
Andrew Belt 5 years ago
parent
commit
bfed46040f
5 changed files with 27 additions and 13 deletions
  1. +8
    -4
      src/LFO.cpp
  2. +4
    -2
      src/Random.cpp
  3. +4
    -2
      src/Unity.cpp
  4. +3
    -1
      src/VCA.cpp
  5. +8
    -4
      src/VCO.cpp

+ 8
- 4
src/LFO.cpp View File

@@ -117,8 +117,10 @@ struct LFO : Module {

LFO() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configParam(OFFSET_PARAM, 0.f, 1.f, 1.f, "Offset");
configParam(INVERT_PARAM, 0.f, 1.f, 1.f, "Invert");
SwitchQuantity* offsetQ = configParam<SwitchQuantity>(OFFSET_PARAM, 0.f, 1.f, 1.f, "Offset");
offsetQ->setLabels({"Bipolar", "Unipolar"});
SwitchQuantity* invertQ = configParam<SwitchQuantity>(INVERT_PARAM, 0.f, 1.f, 1.f, "Orientation");
invertQ->setLabels({"Inverted", "Normal"});
configParam(FREQ_PARAM, -8.f, 10.f, 1.f, "Frequency", " Hz", 2, 1);
configParam(FM1_PARAM, 0.f, 1.f, 0.f, "Frequency modulation 1", "%", 0.f, 100.f);
configParam(PW_PARAM, 0.01f, 0.99f, 0.5f, "Pulse width", "%", 0.f, 100.f);
@@ -265,8 +267,10 @@ struct LFO2 : Module {

LFO2() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configParam(OFFSET_PARAM, 0.f, 1.f, 1.f, "Offset");
configParam(INVERT_PARAM, 0.f, 1.f, 1.f, "Invert");
SwitchQuantity* offsetQ = configParam<SwitchQuantity>(OFFSET_PARAM, 0.f, 1.f, 1.f, "Offset");
offsetQ->setLabels({"Bipolar", "Unipolar"});
SwitchQuantity* invertQ = configParam<SwitchQuantity>(INVERT_PARAM, 0.f, 1.f, 1.f, "Orientation");
invertQ->setLabels({"Inverted", "Normal"});
configParam(FREQ_PARAM, -8.f, 10.f, 1.f, "Frequency", " Hz", 2, 1);
configParam(WAVE_PARAM, 0.f, 3.f, 1.5f, "Wave");
configParam(FM_PARAM, 0.f, 1.f, 1.f, "Frequency modulation", "%", 0.f, 100.f);


+ 4
- 2
src/Random.cpp View File

@@ -40,8 +40,10 @@ struct Random : Module {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configParam(RATE_PARAM, std::log2(0.002f), std::log2(2000.f), std::log2(2.f), "Rate", " Hz", 2);
configParam(SHAPE_PARAM, 0.f, 1.f, 0.5f, "Shape", "%", 0, 100);
configParam(OFFSET_PARAM, 0.f, 1.f, 1.f, "Bipolar/unipolar");
configParam(MODE_PARAM, 0.f, 1.f, 1.f, "Relative/absolute randomness");
SwitchQuantity* offsetQ = configParam<SwitchQuantity>(OFFSET_PARAM, 0.f, 1.f, 1.f, "Offset");
offsetQ->setLabels({"Bipolar", "Unipolar"});
SwitchQuantity* modeQ = configParam<SwitchQuantity>(MODE_PARAM, 0.f, 1.f, 1.f, "Randomness mode");
modeQ->setLabels({"Relative", "Absolute"});
configInput(RATE_INPUT, "Rate");
configInput(SHAPE_INPUT, "Shape");
configInput(TRIGGER_INPUT, "Trigger");


+ 4
- 2
src/Unity.cpp View File

@@ -29,8 +29,10 @@ struct Unity : Module {

Unity() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configParam(AVG1_PARAM, 0.0, 1.0, 0.0, "Ch 1 average mode");
configParam(AVG2_PARAM, 0.0, 1.0, 0.0, "Ch 2 average mode");
SwitchQuantity* avg1Q = configParam<SwitchQuantity>(AVG1_PARAM, 0.0, 1.0, 0.0, "Ch 1 mode");
avg1Q->setLabels({"Sum", "Average"});
SwitchQuantity* avg2Q = configParam<SwitchQuantity>(AVG2_PARAM, 0.0, 1.0, 0.0, "Ch 2 mode");
avg2Q->setLabels({"Sum", "Average"});
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 6; j++) {
configInput(IN_INPUTS + i * 6 + j, string::f("In %d ch %d", i + 1, j + 1));


+ 3
- 1
src/VCA.cpp View File

@@ -158,7 +158,9 @@ struct VCA_1 : Module {
VCA_1() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configParam(LEVEL_PARAM, 0.0, 1.0, 1.0, "Level", "%", 0, 100);
configParam(EXP_PARAM, 0.0, 1.0, 1.0, "Response mode");
SwitchQuantity* expQ = configParam<SwitchQuantity>(EXP_PARAM, 0.0, 1.0, 1.0, "Response mode");
expQ->setLabels({"Exponential", "Linear"});

}

void process(const ProcessArgs& args) override {


+ 8
- 4
src/VCO.cpp View File

@@ -280,8 +280,10 @@ struct VCO : Module {

VCO() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configParam(MODE_PARAM, 0.f, 1.f, 1.f, "Analog mode");
configParam(SYNC_PARAM, 0.f, 1.f, 1.f, "Hard sync");
SwitchQuantity* modeQ = configParam<SwitchQuantity>(MODE_PARAM, 0.f, 1.f, 1.f, "Engine mode");
modeQ->setLabels({"Digital", "Analog"});
SwitchQuantity* syncQ = configParam<SwitchQuantity>(SYNC_PARAM, 0.f, 1.f, 1.f, "Sync mode");
syncQ->setLabels({"Soft", "Hard"});
configParam(FREQ_PARAM, -54.f, 54.f, 0.f, "Frequency", " Hz", dsp::FREQ_SEMITONE, dsp::FREQ_C4);
configParam(FINE_PARAM, -1.f, 1.f, 0.f, "Fine frequency");
configParam(FM_PARAM, 0.f, 1.f, 0.f, "Frequency modulation", "%", 0.f, 100.f);
@@ -423,8 +425,10 @@ struct VCO2 : Module {

VCO2() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configParam(MODE_PARAM, 0.f, 1.f, 1.f, "Analog mode");
configParam(SYNC_PARAM, 0.f, 1.f, 1.f, "Hard sync");
SwitchQuantity* modeQ = configParam<SwitchQuantity>(MODE_PARAM, 0.f, 1.f, 1.f, "Engine mode");
modeQ->setLabels({"Digital", "Analog"});
SwitchQuantity* syncQ = configParam<SwitchQuantity>(SYNC_PARAM, 0.f, 1.f, 1.f, "Sync mode");
syncQ->setLabels({"Soft", "Hard"});
configParam(FREQ_PARAM, -54.f, 54.f, 0.f, "Frequency", " Hz", dsp::FREQ_SEMITONE, dsp::FREQ_C4);
configParam(WAVE_PARAM, 0.f, 3.f, 1.5f, "Wave");
configParam(FM_PARAM, 0.f, 1.f, 1.f, "Frequency modulation", "%", 0.f, 100.f);


Loading…
Cancel
Save