From 66a17b67c4a6f6e254ae194de942fa0a2cf2fe0d Mon Sep 17 00:00:00 2001 From: Gordon JC Pearce Date: Sat, 20 Dec 2025 00:06:03 +0000 Subject: [PATCH] crazy how you don't notice some silly bugs --- plugin/module.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/module.cpp b/plugin/module.cpp index 5d308e1..9f9118e 100644 --- a/plugin/module.cpp +++ b/plugin/module.cpp @@ -34,6 +34,8 @@ void Module::run(Voice* voice) { r = decayTable[patchRam.env_r]; // release time coeff looked up in table s = patchRam.env_s << 7; // scale 0x00-0x7f to 0x0000-0x3f80 + printf("%04x %04x %04x %04x\n", a, d, s, r); + square = (patchRam.switch1 & 0x08) ? 0.63 : 0; saw = (patchRam.switch1 & 0x10) ? 0.8 : 0; sub = patchRam.sub / 127.0f; @@ -59,7 +61,7 @@ void Module::run(Voice* voice) { Voice* v = &voice[i]; switch (v->envPhase) { case 0: // release phase FIXME use an enum I guess - v->env = (v->env * d) >> 16; // "RC" decay to zero + v->env = (v->env * r) >> 16; // "RC" decay to zero break; case 1: // attack phase v->env += a; // linear attack to 0x3fff