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

@ -102,6 +102,7 @@ func (bridgesynth *BridgeSynth) Trigger(voice int, note byte) {
}
s.SynthWrk.Voices[voice] = C.Voice{}
s.SynthWrk.Voices[voice].Note = C.int(note)
s.SynthWrk.Voices[voice].Sustain = 1
}
// Release is part of C.Synths' implementation of sointu.Synth interface
@ -110,7 +111,7 @@ func (bridgesynth *BridgeSynth) Release(voice int) {
if voice < 0 || voice >= len(s.SynthWrk.Voices) {
return
}
s.SynthWrk.Voices[voice].Release = 1
s.SynthWrk.Voices[voice].Sustain = 0
}
// Update