drafting increasing maximum voice numbers to 256

This commit is contained in:
5684185+vsariola@users.noreply.github.com
2026-04-04 02:41:34 +03:00
parent ac218e7e54
commit 44ee37882b
18 changed files with 821 additions and 43 deletions

View File

@ -49,7 +49,6 @@ func Synth(patch sointu.Patch, bpm int) (*NativeSynth, error) {
if len(comPatch.Opcodes) == 0 {
s.Opcodes[0] = 0
s.NumVoices = 1
s.Polyphony = 0
return &NativeSynth{csynth: *s}, nil
}
for i, v := range comPatch.Opcodes {
@ -67,7 +66,9 @@ func Synth(patch sointu.Patch, bpm int) (*NativeSynth, error) {
s.SampleOffsets[i].LoopLength = (C.ushort)(v.LoopLength)
}
s.NumVoices = C.uint(comPatch.NumVoices)
s.Polyphony = C.uint(comPatch.PolyphonyBitmask)
for i, v := range comPatch.PolyphonyBitmask {
s.Polyphony[i] = (C.uchar)(v)
}
s.RandSeed = 1
return &NativeSynth{csynth: *s}, nil
}
@ -160,7 +161,6 @@ func (bridgesynth *NativeSynth) Update(patch sointu.Patch, bpm int) error {
if len(comPatch.Opcodes) == 0 {
s.Opcodes[0] = 0
s.NumVoices = 1
s.Polyphony = 0
return nil
}
needsRefresh := false
@ -182,7 +182,9 @@ func (bridgesynth *NativeSynth) Update(patch sointu.Patch, bpm int) error {
s.SampleOffsets[i].LoopLength = (C.ushort)(v.LoopLength)
}
s.NumVoices = C.uint(comPatch.NumVoices)
s.Polyphony = C.uint(comPatch.PolyphonyBitmask)
for i, v := range comPatch.PolyphonyBitmask {
s.Polyphony[i] = (C.uchar)(v)
}
if needsRefresh {
for i := range s.SynthWrk.Voices {
// if any of the opcodes change, we retrigger all units