From efc7cf5e6f64970ee0a08561622b07703f999e7d Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 22 May 2023 01:48:46 -0400 Subject: [PATCH] Random: Disable RND slider light if IN is connected. --- src/Random.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Random.cpp b/src/Random.cpp index 7982b17..6801f2d 100644 --- a/src/Random.cpp +++ b/src/Random.cpp @@ -94,9 +94,12 @@ struct Random : Module { shape += inputs[SHAPE_INPUT].getVoltage() / 10.f * params[SHAPE_CV_PARAM].getValue(); shape = clamp(shape, 0.f, 1.f); - float rand = params[RAND_PARAM].getValue(); - rand += inputs[RAND_INPUT].getVoltage() / 10.f * params[RAND_CV_PARAM].getValue(); - rand = clamp(rand, 0.f, 1.f); + float rand = 0.f; + if (!inputs[EXTERNAL_INPUT].isConnected()) { + rand = params[RAND_PARAM].getValue(); + rand += inputs[RAND_INPUT].getVoltage() / 10.f * params[RAND_CV_PARAM].getValue(); + rand = clamp(rand, 0.f, 1.f); + } bool uni = params[OFFSET_PARAM].getValue() > 0.f;