mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-14 02:54:37 -04:00
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:
parent
20b0598a57
commit
1ac2ad3c75
@ -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
|
||||
|
Reference in New Issue
Block a user