fix(vm/compiler): invert the logic of the release flag in the voices (closes #102)

This makes all envelopes released by default, instead of attacking. Add also test to demonstrate the buggy behaviour.
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2023-09-02 20:54:37 +03:00
parent 20b0598a57
commit 1ac2ad3c75
13 changed files with 46 additions and 19 deletions

View File

@ -15,9 +15,9 @@
ret
su_op_envelope_mono:
{{- end}}
mov eax, dword [{{.INP}}-su_voice.inputs+su_voice.release] ; eax = su_instrument.release
test eax, eax ; if (eax == 0)
je su_op_envelope_process ; goto process
mov eax, dword [{{.INP}}-su_voice.inputs+su_voice.sustain] ; eax = su_instrument.sustain
test eax, eax ; if (eax != 0)
jne su_op_envelope_process ; goto process
mov al, {{.InputNumber "envelope" "release"}} ; [state]=RELEASE
mov dword [{{.WRK}}], eax ; note that mov al, XXX; mov ..., eax is less bytes than doing it directly
su_op_envelope_process: