Browse Source

Realign lights, fix stage lights of ADSR

tags/v0.5.0
Andrew Belt 6 years ago
parent
commit
608ee7bc03
3 changed files with 10 additions and 7 deletions
  1. +6
    -3
      src/ADSR.cpp
  2. +2
    -2
      src/LFO.cpp
  3. +2
    -2
      src/VCO.cpp

+ 6
- 3
src/ADSR.cpp View File

@@ -91,13 +91,16 @@ void ADSR::step() {
decaying = false;
}

bool sustaining = nearf(env, sustain, 1e-3);
bool resting = nearf(env, 0.0, 1e-3);

outputs[ENVELOPE_OUTPUT].value = 10.0 * env;

// Lights
lights[ATTACK_LIGHT].value = (gated && !decaying) ? 1.0 : 0.0;
lights[DECAY_LIGHT].value = (gated && decaying) ? 1.0 : 0.0;
lights[SUSTAIN_LIGHT].setBrightness(env);
lights[RELEASE_LIGHT].value = (!gated) ? 1.0 : 0.0;
lights[DECAY_LIGHT].value = (gated && decaying && !sustaining) ? 1.0 : 0.0;
lights[SUSTAIN_LIGHT].value = (gated && decaying && sustaining) ? 1.0 : 0.0;
lights[RELEASE_LIGHT].value = (!gated && !resting) ? 1.0 : 0.0;
}




+ 2
- 2
src/LFO.cpp View File

@@ -157,7 +157,7 @@ LFOWidget::LFOWidget() {
addOutput(createOutput<PJ301MPort>(Vec(80, 320), module, LFO::SAW_OUTPUT));
addOutput(createOutput<PJ301MPort>(Vec(114, 320), module, LFO::SQR_OUTPUT));

addChild(createLight<SmallLight<GreenRedLight>>(Vec(99, 42), module, LFO::PHASE_POS_LIGHT));
addChild(createLight<SmallLight<GreenRedLight>>(Vec(99, 42.5), module, LFO::PHASE_POS_LIGHT));
}


@@ -247,5 +247,5 @@ LFO2Widget::LFO2Widget() {

addOutput(createOutput<PJ301MPort>(Vec(54, 319), module, LFO2::INTERP_OUTPUT));

addChild(createLight<SmallLight<GreenRedLight>>(Vec(68, 41), module, LFO2::PHASE_POS_LIGHT));
addChild(createLight<SmallLight<GreenRedLight>>(Vec(68, 42.5), module, LFO2::PHASE_POS_LIGHT));
}

+ 2
- 2
src/VCO.cpp View File

@@ -266,7 +266,7 @@ VCOWidget::VCOWidget() {
addOutput(createOutput<PJ301MPort>(Vec(80, 320), module, VCO::SAW_OUTPUT));
addOutput(createOutput<PJ301MPort>(Vec(114, 320), module, VCO::SQR_OUTPUT));

addChild(createLight<SmallLight<GreenRedLight>>(Vec(99, 42), module, VCO::PHASE_POS_LIGHT));
addChild(createLight<SmallLight<GreenRedLight>>(Vec(99, 42.5), module, VCO::PHASE_POS_LIGHT));
}


@@ -358,7 +358,7 @@ VCO2Widget::VCO2Widget() {

addOutput(createOutput<PJ301MPort>(Vec(54, 320), module, VCO2::OUT_OUTPUT));

addChild(createLight<SmallLight<GreenRedLight>>(Vec(68, 41), module, VCO2::PHASE_POS_LIGHT));
addChild(createLight<SmallLight<GreenRedLight>>(Vec(68, 42.5), module, VCO2::PHASE_POS_LIGHT));
}




Loading…
Cancel
Save