From 1698b616dd284db3d7e1eb0d2a54f3931a4772db Mon Sep 17 00:00:00 2001 From: hemmer <915048+hemmer@users.noreply.github.com> Date: Tue, 26 Dec 2023 09:12:34 +0000 Subject: [PATCH 1/2] Fix Rampage bug #44 --- CHANGELOG.md | 4 ++++ plugin.json | 2 +- src/Rampage.cpp | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6e9650..8400b3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## v2.4.1 + * Rampage + * Fix SIMD bug + ## v2.4.0 * MotionMTR * Initial release diff --git a/plugin.json b/plugin.json index 8edb3d1..a001e22 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "slug": "Befaco", - "version": "2.4.0", + "version": "2.4.1", "license": "GPL-3.0-or-later", "name": "Befaco", "brand": "Befaco", diff --git a/src/Rampage.cpp b/src/Rampage.cpp index b204b84..53923ed 100644 --- a/src/Rampage.cpp +++ b/src/Rampage.cpp @@ -240,8 +240,9 @@ struct Rampage : Module { float shape = params[SHAPE_A_PARAM + part].getValue(); out[part][c / 4] += shapeDelta(delta, rate, shape) * args.sampleTime; - float_4 rising = (in[c / 4] - out[part][c / 4]) > 1e-3f; - float_4 falling = (in[c / 4] - out[part][c / 4]) < -1e-3f; + float_4 rising = simd::ifelse(delta_gt_0, (in[c / 4] - out[part][c / 4]) > 1e-3f, float_4::zero()); + float_4 falling = simd::ifelse(delta_lt_0, (in[c / 4] - out[part][c / 4]) < -1e-3f, float_4::zero()); + float_4 end_of_cycle = simd::andnot(falling, delta_lt_0); endOfCyclePulse[part][c / 4].trigger(end_of_cycle, 1e-3); From 4c55f117212e758324412efe73f2f573a18f75d3 Mon Sep 17 00:00:00 2001 From: Vijay Marupudi Date: Thu, 4 Jan 2024 12:02:00 -0500 Subject: [PATCH 2/2] Change trigger inputs to follow Rack voltage standards (#45) Certain modules didn't follow VCV's recommended voltage standards for detecting triggers Changed them to follow them. Standards: https://vcvrack.com/manual/VoltageStandards#Triggers-and-Gates --- src/Kickall.cpp | 4 ++-- src/Muxlicer.cpp | 2 +- src/Rampage.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Kickall.cpp b/src/Kickall.cpp index fc48fea..f415505 100644 --- a/src/Kickall.cpp +++ b/src/Kickall.cpp @@ -81,7 +81,7 @@ struct Kickall : Module { void process(const ProcessArgs& args) override { // TODO: check values - const bool risingEdgeGate = gateTrigger.process(inputs[TRIGG_INPUT].getVoltage() / 2.0f); + const bool risingEdgeGate = gateTrigger.process(inputs[TRIGG_INPUT].getVoltage() / 2.0f, 0.1, 2.0); const bool buttonTriggered = buttonTrigger.process(params[TRIGG_BUTTON_PARAM].getValue()); // can be triggered by either rising edge on trigger in, or a button press if (risingEdgeGate || buttonTriggered) { @@ -156,4 +156,4 @@ struct KickallWidget : ModuleWidget { }; -Model* modelKickall = createModel("Kickall"); \ No newline at end of file +Model* modelKickall = createModel("Kickall"); diff --git a/src/Muxlicer.cpp b/src/Muxlicer.cpp index 23ed3b6..cafa397 100644 --- a/src/Muxlicer.cpp +++ b/src/Muxlicer.cpp @@ -1120,7 +1120,7 @@ struct Mex : Module { // 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()); + gateInTrigger.process(inputs[GATE_IN_INPUT].getVoltage(), 0.1, 2.0); gate = gateInTrigger.isHigh(); } // otherwise the main Muxlicer output clock (including divisions/multiplications) diff --git a/src/Rampage.cpp b/src/Rampage.cpp index 53923ed..545bc49 100644 --- a/src/Rampage.cpp +++ b/src/Rampage.cpp @@ -220,7 +220,7 @@ struct Rampage : Module { for (int c = 0; c < channels[part]; c += 4) { // process SchmittTriggers - float_4 trig_mask = trigger_4[part][c / 4].process(in_trig[c / 4] / 2.0); + float_4 trig_mask = trigger_4[part][c / 4].process(in_trig[c / 4] / 2.0, 0.1, 2.0); gate[part][c / 4] = ifelse(trig_mask, float_4::mask(), gate[part][c / 4]); in[c / 4] = ifelse(gate[part][c / 4], 10.0f, in[c / 4]);