From 7e06d5411ca874c26e00556826f389579f453fe2 Mon Sep 17 00:00:00 2001 From: hemmer <915048+hemmer@users.noreply.github.com> Date: Fri, 13 Sep 2024 07:29:25 +0100 Subject: [PATCH] Fix GOMA initialisation * fix higher CPU on GOMA II * SlewLFO add description to capacitor expander --- README.md | 8 +++----- src/GomaII.cpp | 42 +++++++++++++++++++++++++++--------------- src/SlewLFO.cpp | 3 ++- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 678e2c5..0ff255d 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,6 @@ This repo contains VCV ports of Black Noise Modular Eurorack modules. See: https License: GPL-3.0-or-later -## Screenshots - - - - ## Differences with hardware We have tried to make the VCV implementations as authentic as possible, however there are some minor changes that have been made (either for usuability or to bring modules in line with VCV rack conventions and standards). @@ -25,3 +20,6 @@ SlewLFO More information and resources for the hardware versions can be found at https://github.com/BlackNoiseModular/Eurorack +## Screenshots + + diff --git a/src/GomaII.cpp b/src/GomaII.cpp index 6af924c..35456e3 100644 --- a/src/GomaII.cpp +++ b/src/GomaII.cpp @@ -78,16 +78,35 @@ struct GomaII : Module { updateCounter.setDivision(32); } - std::vector getPolyphonyStatus(int expanderPolyphonyChannels) { - std::vector result; + void onReset(const ResetEvent& e) override { + Module::onReset(e); + + // gain knobs default values depend on mode + updateKnobSettingsForMode(); + + for (int m = 0; m < 4; m++) { + params[GAIN_EXT_PARAM + m].setValue(getParamQuantity(GAIN_EXT_PARAM + m)->defaultValue); + } + } + + void updateKnobSettingsForMode() { + for (int m = 0; m < 4; m++) { + getParamQuantity(GAIN_EXT_PARAM + m)->displayOffset = params[MODE_EXT_PARAM + m].getValue() ? 0.f : -100.f; + getParamQuantity(GAIN_EXT_PARAM + m)->displayMultiplier = params[MODE_EXT_PARAM + m].getValue() ? 100.f : 200.f; + getParamQuantity(GAIN_EXT_PARAM + m)->defaultValue = params[MODE_EXT_PARAM + m].getValue() ? 0.f : 0.5f; + } + } + + int polyphonyStatus[4] = {1, 1, 1, 1}; + void updatePolyphonyStatus(int expanderPolyphonyChannels) { + for (int i = 0; i < 4; i++) { if (i == 0) { - result.push_back(std::max({1, inputs[EXT_INPUT + i].getChannels(), expanderPolyphonyChannels})); + polyphonyStatus[i] = std::max({1, inputs[EXT_INPUT + i].getChannels(), expanderPolyphonyChannels}); } else { - result.push_back(std::max(1, inputs[EXT_INPUT + i].getChannels())); + polyphonyStatus[i] = std::max(1, inputs[EXT_INPUT + i].getChannels()); } - } for (int i = 0; i < 4; i++) { @@ -96,15 +115,13 @@ struct GomaII : Module { } for (int j = i + 1; j < 4; j++) { - result[j] = result[i] = std::max(result[i], result[j]); + polyphonyStatus[j] = polyphonyStatus[i] = std::max(polyphonyStatus[i], polyphonyStatus[j]); if (outputs[EXT_OUTPUT + j].isConnected()) { break; } } } - - return result; } void process(const ProcessArgs& args) override { @@ -112,14 +129,9 @@ struct GomaII : Module { // only need to do rarely, but update gain label based on whether we are in attenuator mode or attenuverter mode if (updateCounter.process()) { - for (int m = 0; m < 4; m++) { - getParamQuantity(GAIN_EXT_PARAM + m)->displayOffset = params[MODE_EXT_PARAM + m].getValue() ? 0.f : -100.f; - getParamQuantity(GAIN_EXT_PARAM + m)->displayMultiplier = params[MODE_EXT_PARAM + m].getValue() ? 100.f : 200.f; - getParamQuantity(GAIN_EXT_PARAM + m)->defaultValue = params[MODE_EXT_PARAM + m].getValue() ? 0.f : 0.5f; - } + updateKnobSettingsForMode(); } - const float_4 normalledVoltageValue = (normalledVoltage == NORMALLED_5V) ? 5.f : 10.f; float_4 activeSum[4] = {}; @@ -135,7 +147,7 @@ struct GomaII : Module { } numExpanderPolyphonyChannels = leftExpanderData->numActivePolyphonyChannels; } - const std::vector polyphonyStatus = getPolyphonyStatus(numExpanderPolyphonyChannels); + updatePolyphonyStatus(numExpanderPolyphonyChannels); // loop over the four mixer channels (ext, ch1, ch2, ch3) for (int m = 0; m < 4; m++) { diff --git a/src/SlewLFO.cpp b/src/SlewLFO.cpp index aba6987..6a98253 100644 --- a/src/SlewLFO.cpp +++ b/src/SlewLFO.cpp @@ -48,7 +48,8 @@ struct SlewLFO : Module { configParam(FALL_PARAM, 0.f, 1.f, 0.5f, "Fall"); configSwitch(MODE_PARAM, 0.f, 1.f, 0.f, "Mode", {"LFO", "Slew"}); configSwitch(RATE_PARAM, 0.f, 1.f, 0.f, "Rate", {"Slow", "Fast"}); - configSwitch(CAPACITOR_PARAM, CAP_NONE, CAP_SLOOOOW, CAP_NONE, "Capacitor", {"None", "10uF (slow)", "100uF (sloooow)"}); + auto capacitorExpander = configSwitch(CAPACITOR_PARAM, CAP_NONE, CAP_SLOOOOW, CAP_NONE, "Capacitor Expander", {"None", "Slow (~10uF)", "Sloooow (~100uF)"}); + capacitorExpander->description = "The capacitor expander allows the user to add their own capacitor to modify the slew rate."; configInput(RISE_INPUT, "Rise CV"); configInput(FALL_INPUT, "Fall CV"); configInput(IN_INPUT, "In");