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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user