crazy how you don't notice some silly bugs

This commit is contained in:
Gordon JC Pearce 2025-12-20 00:06:03 +00:00
parent 3d161edc02
commit 66a17b67c4
1 changed files with 3 additions and 1 deletions

View File

@ -34,6 +34,8 @@ void Module::run(Voice* voice) {
r = decayTable[patchRam.env_r]; // release time coeff looked up in table r = decayTable[patchRam.env_r]; // release time coeff looked up in table
s = patchRam.env_s << 7; // scale 0x00-0x7f to 0x0000-0x3f80 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; square = (patchRam.switch1 & 0x08) ? 0.63 : 0;
saw = (patchRam.switch1 & 0x10) ? 0.8 : 0; saw = (patchRam.switch1 & 0x10) ? 0.8 : 0;
sub = patchRam.sub / 127.0f; sub = patchRam.sub / 127.0f;
@ -59,7 +61,7 @@ void Module::run(Voice* voice) {
Voice* v = &voice[i]; Voice* v = &voice[i];
switch (v->envPhase) { switch (v->envPhase) {
case 0: // release phase FIXME use an enum I guess 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; break;
case 1: // attack phase case 1: // attack phase
v->env += a; // linear attack to 0x3fff v->env += a; // linear attack to 0x3fff