Read repeated point spellings in a fixed order and end comments at a carriage return

Two spellings of one curve point, as v064 and v64, now give the same
result each time. A line comment ends at a lone carriage return, as in
sfizz. Header.Set's documentation says an include in the header's range
can override what it sets.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-02 00:46:19 +00:00
co-authored by Claude Sonnet 5.5
parent 37d2866fe9
commit 535856ba77
5 changed files with 45 additions and 4 deletions
+6 -1
View File
@@ -1,8 +1,10 @@
package sfz
import (
"maps"
"math"
"regexp"
"slices"
"sort"
"strconv"
"strings"
@@ -85,7 +87,10 @@ func readCurves(defs []Opcodes) (map[int]curve, map[int][]CurveStop) {
continue
}
points := map[int]float64{0: 0, 127: 1}
for name, v := range def {
// The points are read in the order of their names, so that two spellings of
// one value, as v064 and v64, give the same result each time.
for _, name := range slices.Sorted(maps.Keys(def)) {
v := def[name]
m := pointRE.FindStringSubmatch(name)
if m == nil {
continue