| @@ -91,13 +91,16 @@ void ADSR::step() { | |||||
| decaying = false; | decaying = false; | ||||
| } | } | ||||
| bool sustaining = nearf(env, sustain, 1e-3); | |||||
| bool resting = nearf(env, 0.0, 1e-3); | |||||
| outputs[ENVELOPE_OUTPUT].value = 10.0 * env; | outputs[ENVELOPE_OUTPUT].value = 10.0 * env; | ||||
| // Lights | // Lights | ||||
| lights[ATTACK_LIGHT].value = (gated && !decaying) ? 1.0 : 0.0; | 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; | |||||
| } | } | ||||
| @@ -157,7 +157,7 @@ LFOWidget::LFOWidget() { | |||||
| addOutput(createOutput<PJ301MPort>(Vec(80, 320), module, LFO::SAW_OUTPUT)); | addOutput(createOutput<PJ301MPort>(Vec(80, 320), module, LFO::SAW_OUTPUT)); | ||||
| addOutput(createOutput<PJ301MPort>(Vec(114, 320), module, LFO::SQR_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)); | 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)); | |||||
| } | } | ||||
| @@ -266,7 +266,7 @@ VCOWidget::VCOWidget() { | |||||
| addOutput(createOutput<PJ301MPort>(Vec(80, 320), module, VCO::SAW_OUTPUT)); | addOutput(createOutput<PJ301MPort>(Vec(80, 320), module, VCO::SAW_OUTPUT)); | ||||
| addOutput(createOutput<PJ301MPort>(Vec(114, 320), module, VCO::SQR_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)); | 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)); | |||||
| } | } | ||||