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
+5 -1
View File
@@ -242,7 +242,11 @@ var velocityCurveRE = regexp.MustCompile(`^amp_velcurve_(\d{1,3})$`)
// and ends at the full level for 127. It returns nil if the region sets none.
func velocityCurve(ops Opcodes) []CurvePoint {
points := map[int]float64{}
for name, v := range ops {
// The opcodes are read in the order of their names, so that two spellings of
// one velocity, as amp_velcurve_064 and amp_velcurve_64, give the same result
// each time.
for _, name := range slices.Sorted(maps.Keys(ops)) {
v := ops[name]
m := velocityCurveRE.FindStringSubmatch(name)
if m == nil {
continue