| @@ -213,6 +213,8 @@ struct ADSRDisplay : LedDisplay { | |||||
| float decay = std::pow(decayLambda, -power); | float decay = std::pow(decayLambda, -power); | ||||
| float release = std::pow(releaseLambda, -power); | float release = std::pow(releaseLambda, -power); | ||||
| float totalLambda = attack + decay + release; | float totalLambda = attack + decay + release; | ||||
| if (totalLambda == 0.f) | |||||
| return; | |||||
| Rect r = box.zeroPos().shrink(Vec(4, 5)); | Rect r = box.zeroPos().shrink(Vec(4, 5)); | ||||
| Vec p0 = r.getBottomLeft(); | Vec p0 = r.getBottomLeft(); | ||||
| @@ -126,7 +126,7 @@ struct SumWidget : ModuleWidget { | |||||
| addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(7.62, 113.066)), module, Sum::MONO_OUTPUT)); | addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(7.62, 113.066)), module, Sum::MONO_OUTPUT)); | ||||
| SumDisplay* display = createWidget<SumDisplay>(mm2px(Vec(0.0, 12.834))); | |||||
| SumDisplay* display = createWidget<SumDisplay>(mm2px(Vec(0.0, 13.039))); | |||||
| display->box.size = mm2px(Vec(15.241, 36.981)); | display->box.size = mm2px(Vec(15.241, 36.981)); | ||||
| display->module = module; | display->module = module; | ||||
| addChild(display); | addChild(display); | ||||
| @@ -58,7 +58,7 @@ struct VoltageControlledOscillator { | |||||
| void process(float deltaTime, T syncValue) { | void process(float deltaTime, T syncValue) { | ||||
| // Advance phase | // Advance phase | ||||
| T deltaPhase = simd::clamp(freq * deltaTime, 1e-6f, 0.35f); | |||||
| T deltaPhase = simd::clamp(freq * deltaTime, 0.f, 0.35f); | |||||
| if (soft) { | if (soft) { | ||||
| // Reverse direction | // Reverse direction | ||||
| deltaPhase *= syncDirection; | deltaPhase *= syncDirection; | ||||
| @@ -320,7 +320,7 @@ struct VCO : Module { | |||||
| oscillator.soft = soft; | oscillator.soft = soft; | ||||
| // Get frequency | // Get frequency | ||||
| float_4 pitch = freqParam / 12.f + inputs[PITCH_INPUT].getPolyVoltageSimd<float_4>(c); | |||||
| float_4 pitch = freqParam + inputs[PITCH_INPUT].getPolyVoltageSimd<float_4>(c); | |||||
| float_4 freq; | float_4 freq; | ||||
| if (!linear) { | if (!linear) { | ||||
| pitch += inputs[FM_INPUT].getPolyVoltageSimd<float_4>(c) * fmParam; | pitch += inputs[FM_INPUT].getPolyVoltageSimd<float_4>(c) * fmParam; | ||||
| @@ -104,7 +104,7 @@ struct VizWidget : ModuleWidget { | |||||
| addInput(createInputCentered<PJ301MPort>(mm2px(Vec(7.62, 113.115)), module, Viz::POLY_INPUT)); | addInput(createInputCentered<PJ301MPort>(mm2px(Vec(7.62, 113.115)), module, Viz::POLY_INPUT)); | ||||
| VizDisplay* display = createWidget<VizDisplay>(mm2px(Vec(0.003, 13.039))); | |||||
| VizDisplay* display = createWidget<VizDisplay>(mm2px(Vec(0.0, 13.039))); | |||||
| display->box.size = mm2px(Vec(15.237, 89.344)); | display->box.size = mm2px(Vec(15.237, 89.344)); | ||||
| display->module = module; | display->module = module; | ||||
| addChild(display); | addChild(display); | ||||
| @@ -243,9 +243,9 @@ struct WTVCO : Module { | |||||
| // Light | // Light | ||||
| if (lightDivider.process()) { | if (lightDivider.process()) { | ||||
| if (channels == 1) { | if (channels == 1) { | ||||
| float b = 1.f - phases[0][0]; | |||||
| lights[PHASE_LIGHT + 0].setSmoothBrightness(b, args.sampleTime * lightDivider.getDivision()); | |||||
| lights[PHASE_LIGHT + 1].setBrightness(0.f); | |||||
| float b = std::sin(2 * M_PI * phases[0][0]); | |||||
| lights[PHASE_LIGHT + 0].setSmoothBrightness(-b, args.sampleTime * lightDivider.getDivision()); | |||||
| lights[PHASE_LIGHT + 1].setSmoothBrightness(b, args.sampleTime * lightDivider.getDivision()); | |||||
| lights[PHASE_LIGHT + 2].setBrightness(0.f); | lights[PHASE_LIGHT + 2].setBrightness(0.f); | ||||
| } | } | ||||
| else { | else { | ||||