refactor(tracker): Rewrote the sequencer loop to use simple mutex

This commit is contained in:
Veikko Sariola
2020-12-29 16:30:44 +02:00
parent 8029dbd1a8
commit cd498e775b
14 changed files with 315 additions and 166 deletions

View File

@ -77,12 +77,18 @@ func (synth *C.Synth) Render(buffer []float32, maxtime int) (int, int, error) {
// Trigger is part of C.Synths' implementation of sointu.Synth interface
func (s *C.Synth) Trigger(voice int, note byte) {
if voice < 0 || voice >= len(s.SynthWrk.Voices) {
return
}
s.SynthWrk.Voices[voice] = C.Voice{}
s.SynthWrk.Voices[voice].Note = C.int(note)
}
// Release is part of C.Synths' implementation of sointu.Synth interface
func (s *C.Synth) Release(voice int) {
if voice < 0 || voice >= len(s.SynthWrk.Voices) {
return
}
s.SynthWrk.Voices[voice].Release = 1
}