Add lossless SFZ document, flattening, typed model and opcode registry

Parse keeps a file exactly as written, with #define and #include
unexpanded and each include as its own file in a tree. Flatten resolves
directives and header inheritance, and Flat.Instrument reads regions into
the typed model ported from Zampler's internal/sfz. The opcode registry
is generated from the SFZ format's syntax data and drives Lookup, GetAs
and Validate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-01 17:38:10 +00:00
co-authored by Claude Sonnet 5.5
commit d124690ecf
29 changed files with 11677 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
# Opcode registry generator
`syntax.yml` is `data/sfz/syntax.yml` from [sfzformat/sfzformat.github.io](https://github.com/sfzformat/sfzformat.github.io) (branch `source`, commit `43addaf8f532bcdb9c268729c754a850280924ef`, 23 January 2026), which is the data behind sfzformat.com. That repository is released under CC0 1.0.
`main.go` turns it into `registry_data.go` in the `sfz` package. It is a separate module so that the library has no dependencies. Run `go generate ./...` from the repository root after replacing `syntax.yml`.