From 85dcc86b93b7e39b51b1d7cd750b64cfe3239ee9 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 9 Jul 2022 12:14:48 -0400 Subject: [PATCH] Gates and Logic: Generate monophonic output when unpatched. --- src/Gates.cpp | 2 +- src/Logic.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Gates.cpp b/src/Gates.cpp index b31495d..514f980 100644 --- a/src/Gates.cpp +++ b/src/Gates.cpp @@ -64,7 +64,7 @@ struct Gates : Module { } void process(const ProcessArgs& args) override { - int channels = inputs[IN_INPUT].getChannels(); + int channels = std::max(1, inputs[IN_INPUT].getChannels()); bool anyRise = false; bool anyFall = false; diff --git a/src/Logic.cpp b/src/Logic.cpp index 7131cbb..7b43fbc 100644 --- a/src/Logic.cpp +++ b/src/Logic.cpp @@ -55,7 +55,7 @@ struct Logic : Module { } void process(const ProcessArgs& args) override { - int channels = std::max(inputs[A_INPUT].getChannels(), inputs[B_INPUT].getChannels()); + int channels = std::max({1, inputs[A_INPUT].getChannels(), inputs[B_INPUT].getChannels()}); bool bPush = params[B_PARAM].getValue() > 0.f; bool anyState[8] = {};