diff --git a/src/ADSR.cpp b/src/ADSR.cpp index 45998c7..be7d196 100644 --- a/src/ADSR.cpp +++ b/src/ADSR.cpp @@ -213,6 +213,8 @@ struct ADSRDisplay : LedDisplay { float decay = std::pow(decayLambda, -power); float release = std::pow(releaseLambda, -power); float totalLambda = attack + decay + release; + if (totalLambda == 0.f) + return; Rect r = box.zeroPos().shrink(Vec(4, 5)); Vec p0 = r.getBottomLeft(); diff --git a/src/Sum.cpp b/src/Sum.cpp index 376e599..06566e9 100644 --- a/src/Sum.cpp +++ b/src/Sum.cpp @@ -126,7 +126,7 @@ struct SumWidget : ModuleWidget { addOutput(createOutputCentered(mm2px(Vec(7.62, 113.066)), module, Sum::MONO_OUTPUT)); - SumDisplay* display = createWidget(mm2px(Vec(0.0, 12.834))); + SumDisplay* display = createWidget(mm2px(Vec(0.0, 13.039))); display->box.size = mm2px(Vec(15.241, 36.981)); display->module = module; addChild(display); diff --git a/src/VCO.cpp b/src/VCO.cpp index e557c21..9c3040d 100644 --- a/src/VCO.cpp +++ b/src/VCO.cpp @@ -58,7 +58,7 @@ struct VoltageControlledOscillator { void process(float deltaTime, T syncValue) { // Advance phase - T deltaPhase = simd::clamp(freq * deltaTime, 1e-6f, 0.35f); + T deltaPhase = simd::clamp(freq * deltaTime, 0.f, 0.35f); if (soft) { // Reverse direction deltaPhase *= syncDirection; @@ -320,7 +320,7 @@ struct VCO : Module { oscillator.soft = soft; // Get frequency - float_4 pitch = freqParam / 12.f + inputs[PITCH_INPUT].getPolyVoltageSimd(c); + float_4 pitch = freqParam + inputs[PITCH_INPUT].getPolyVoltageSimd(c); float_4 freq; if (!linear) { pitch += inputs[FM_INPUT].getPolyVoltageSimd(c) * fmParam; diff --git a/src/Viz.cpp b/src/Viz.cpp index cd304a7..99f82e1 100644 --- a/src/Viz.cpp +++ b/src/Viz.cpp @@ -104,7 +104,7 @@ struct VizWidget : ModuleWidget { addInput(createInputCentered(mm2px(Vec(7.62, 113.115)), module, Viz::POLY_INPUT)); - VizDisplay* display = createWidget(mm2px(Vec(0.003, 13.039))); + VizDisplay* display = createWidget(mm2px(Vec(0.0, 13.039))); display->box.size = mm2px(Vec(15.237, 89.344)); display->module = module; addChild(display); diff --git a/src/WTVCO.cpp b/src/WTVCO.cpp index d0a9068..69fa019 100644 --- a/src/WTVCO.cpp +++ b/src/WTVCO.cpp @@ -243,9 +243,9 @@ struct WTVCO : Module { // Light if (lightDivider.process()) { 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); } else {