From 5f1d620a4645f501c0ce15d1b58859374f350434 Mon Sep 17 00:00:00 2001 From: Gordon JC Pearce Date: Sun, 8 Sep 2024 20:57:11 +0100 Subject: [PATCH] env/gate --- plugin/voice.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/voice.cpp b/plugin/voice.cpp index e5e195b..ff9be2a 100644 --- a/plugin/voice.cpp +++ b/plugin/voice.cpp @@ -149,6 +149,8 @@ void Voice::run(Synth &s, float *buffer, uint32_t samples) { float gain = 0.5 * powf(2, (s.patchRam.vca / 64.0f) - 1); + float vcaEnv = (s.patchRam.switch2 & 0x04)?(float)ff11:(env / 16384.0f); + for (uint32_t i = 0; i < samples; i++) { y = delay; delay = 0; @@ -197,7 +199,7 @@ void Voice::run(Synth &s, float *buffer, uint32_t samples) { out = y; // widthDelay = pw; - vr58c106 += (((env / 16383.0) - vr58c106) * 0.0075); + vr58c106 += ((vcaEnv- vr58c106) * 0.0075); buffer[i] += (gain * out * vr58c106); } }