From 0da2c2625401f08b282c54c29de86bffecc9b82a Mon Sep 17 00:00:00 2001 From: hemmer <915048+hemmer@users.noreply.github.com> Date: Wed, 1 Sep 2021 07:07:16 +0100 Subject: [PATCH] Mex: gate in acts as a SchmittTrigger Muxlicer: removed leftover debug message --- README.md | 2 +- src/Mex.cpp | 13 ++++++++++++- src/Muxlicer.cpp | 5 +---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1e46a88..929d223 100644 --- a/README.md +++ b/README.md @@ -15,4 +15,4 @@ We have tried to make the VCV implementations as authentic as possible, however * Chopping Kinky hardward is DC coupled, but we add the option (default disabled) to remove this offset. -* The hardware Muxlicer assigns multiple functions to the "Speed Div/Mult" dial, that cannot be reproduced with a single mouse click. Some of these have been moved to the context menu, specifically: quadratic gates, the "All In" normalled voltage, and the output clock division/mult. \ No newline at end of file +* The hardware Muxlicer assigns multiple functions to the "Speed Div/Mult" dial, that cannot be reproduced with a single mouse click. Some of these have been moved to the context menu, specifically: quadratic gates, the "All In" normalled voltage, and the input/output clock division/mult. The "Speed Div/Mult" dial remains only as a tap-tempo button. \ No newline at end of file diff --git a/src/Mex.cpp b/src/Mex.cpp index a6e7032..a96a662 100644 --- a/src/Mex.cpp +++ b/src/Mex.cpp @@ -25,6 +25,7 @@ struct Mex : Module { }; MexMessage leftMessages[2] = {}; + dsp::SchmittTrigger gateInTrigger; Mex() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); @@ -57,7 +58,17 @@ struct Mex : Module { gate = message->allGates; } else if (state == GATE_IN_MODE) { - gate = inputs[GATE_IN_INPUT].getNormalVoltage(message->outputClock); + // gate in will convert non-gate signals to gates (via schmitt trigger) + // if input is present + if (inputs[GATE_IN_INPUT].isConnected()) { + gateInTrigger.process(inputs[GATE_IN_INPUT].getVoltage()); + gate = 10.f * gateInTrigger.isHigh(); + } + // otherwise the main Muxlicer output clock (including divisions/multiplications) + // is normalled in + else { + gate = message->outputClock; + } } lights[currentStep].setBrightness(gate); diff --git a/src/Muxlicer.cpp b/src/Muxlicer.cpp index c5941c0..f12d7e6 100644 --- a/src/Muxlicer.cpp +++ b/src/Muxlicer.cpp @@ -432,10 +432,7 @@ struct Muxlicer : Module { const float stepVolume = params[LEVEL_PARAMS + addressIndex].getValue(); for (int c = 0; c < numActiveEngines; c += 4) { const float_4 allInValue = inputs[ALL_INPUT].getNormalPolyVoltageSimd((float_4) allInNormalVoltage, c); - const float_4 stepValue = inputs[MUX_INPUTS + addressIndex].getNormalPolyVoltageSimd(allInValue, c) * stepVolume; - if (c == 0) { - DEBUG(string::f("%f %f %d", allInValue[0], stepValue[0], addressIndex).c_str()); - } + const float_4 stepValue = inputs[MUX_INPUTS + addressIndex].getNormalPolyVoltageSimd(allInValue, c) * stepVolume; outputs[COM_OUTPUT].setVoltageSimd(stepValue, c); } outputs[COM_OUTPUT].setChannels(numActiveEngines);