commit db3b45f011dc2af94eac5e8d11293272e807dc7d parent 1b0b92a64c280f8c3139508d0b39089f656ec724 Author: Adam M <aemalone@gmail.com> Date: Fri, 29 Oct 2021 12:27:33 -0500 debug dont update if no connection Diffstat:
M | src/ComputerscareDebug.cpp | | | 20 | +++++++++++++------- |
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/src/ComputerscareDebug.cpp b/src/ComputerscareDebug.cpp @@ -99,6 +99,8 @@ struct ComputerscareDebug : Module { getParamQuantity(WHICH_CLOCK)->randomizeEnabled = false; getParamQuantity(CLOCK_CHANNEL_FOCUS)->randomizeEnabled = false; getParamQuantity(INPUT_CHANNEL_FOCUS)->randomizeEnabled = false; + + randomizeStorage(); } void process(const ProcessArgs &args) override; @@ -208,6 +210,8 @@ void ComputerscareDebug::process(const ProcessArgs &args) { inputChannel = floor(params[INPUT_CHANNEL_FOCUS].getValue()); clockChannel = floor(params[CLOCK_CHANNEL_FOCUS].getValue()); + bool inputConnected = inputs[VAL_INPUT].isConnected(); + float min = outputRanges[outputRangeEnum][0]; float max = outputRanges[outputRangeEnum][1]; float spread = max - min; @@ -236,15 +240,17 @@ void ComputerscareDebug::process(const ProcessArgs &args) { } } else if (clockMode == INTERNAL_MODE) { - if (inputMode == POLY_MODE) { - for (int i = 0; i < 16; i++) { - logLines[i] = inputs[VAL_INPUT].getVoltage(i); + if (inputConnected) { + if (inputMode == POLY_MODE) { + for (int i = 0; i < 16; i++) { + logLines[i] = inputs[VAL_INPUT].getVoltage(i); + } + } + else if (inputMode == SINGLE_MODE) { + logLines[inputChannel] = inputs[VAL_INPUT].getVoltage(inputChannel); } } - else if (inputMode == SINGLE_MODE) { - logLines[inputChannel] = inputs[VAL_INPUT].getVoltage(inputChannel); - } - else if (inputMode == INTERNAL_MODE) { + if (inputMode == INTERNAL_MODE) { for (int i = 0; i < 16; i++) { logLines[i] = min + spread * random::uniform(); }