change: do not respect polyphony when importing 4klang patches

Using polyphony 2 gave errors: 16 instruments with polyphony 2 + 1 global was a total of 33 voices and gave errors when sointu compiling. User will set anyway polyphony as needed for every instrument, like 1 for most instruments, so just use NumVoices 1 always.
This commit is contained in:
5684185+vsariola@users.noreply.github.com 2023-07-08 15:22:18 +03:00
parent 9d6ca519a2
commit 7af7d4332d

View File

@ -11,7 +11,6 @@ func Read4klangPatch(r io.Reader) (patch Patch, err error) {
var versionTag uint32
var version int
var polyphonyUint32 uint32
var polyphony int
var instrumentNames [_4KLANG_MAX_INSTRS]string
patch = make(Patch, 0)
if err := binary.Read(r, binary.LittleEndian, &versionTag); err != nil {
@ -24,10 +23,6 @@ func Read4klangPatch(r io.Reader) (patch Patch, err error) {
if err := binary.Read(r, binary.LittleEndian, &polyphonyUint32); err != nil {
return nil, fmt.Errorf("binary.Read: %w", err)
}
polyphony = int(polyphonyUint32)
if polyphony < 1 {
polyphony = 1
}
for i := range instrumentNames {
instrumentNames[i], err = read4klangName(r)
if err != nil {
@ -42,7 +37,7 @@ func Read4klangPatch(r io.Reader) (patch Patch, err error) {
return nil, fmt.Errorf("read4klangUnits: %w", err)
}
if len(units) > 0 {
patch = append(patch, Instrument{Name: instrumentNames[instrIndex], NumVoices: polyphony, Units: units})
patch = append(patch, Instrument{Name: instrumentNames[instrIndex], NumVoices: 1, Units: units})
}
}
var units []Unit