shorepine / amy

AMY - A high-performance fixed-point Music synthesizer librarY for microcontrollers
https://shorepine.github.io/amy/
MIT License
184 stars 11 forks source link

VCA "gate" on juno simulation doesn't work right #95

Closed dpwe closed 7 months ago

dpwe commented 7 months ago

Patch 30 on juno_ui (called A47 Funky I) uses the "VCA gate" option. However, it clearly doesn't stop immediately after key-off, and sometimes it sounds very bad after note off.

I expected BP0 to have no values set for VCA gate, but alles.send(debug=99) shows that BP0 has nonzero values, possibly left over from the previous patch.

dpwe commented 7 months ago

Problem was that setting EGs only sets values that are not UNSET, but the variable-length EG messages terminate with unset values. This was leaving spurious trailing values if an EG was re-written with fewer breakpoints (and, in particular, trying to write a zero-length EG, to get pure keying, as in "VCA gate", did nothing). I added a bp_is_set[bpset] flag to the event structure, and modified the code so that one UNSET value will be copied across to terminate the set.