Rewrite the documentation and add runnable examples

- Bring the README up to date with editing, Apply, the model tags, validation
  codes, errors, limits, concurrency and development.
- Fix the typed-model link and wording in docs/opcodes.md.
- Add examples to the package documentation.
- Describe the regeneration steps for the registry, and the licence status of
  the Splendid Grand Piano fixture.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-01 19:15:55 +00:00
co-authored by Claude Sonnet 5.5
parent e08f3a5d0b
commit 04419062f3
6 changed files with 248 additions and 18 deletions
+10 -1
View File
@@ -2,4 +2,13 @@
`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`.
`main.go` turns it into `registry_data.go` in the `sfz` package. It is a separate module so that the library has no dependencies, and it needs `gopkg.in/yaml.v3`, which `go run` fetches the first time.
To update the registry:
1. Replace `syntax.yml`, and note the commit and date above.
2. Run `go generate ./...` from the repository root. This rewrites `registry_data.go`.
3. Run `go test -update` from the root. This rewrites `docs/opcodes.md`, which a test checks against the registry.
4. Run `go test ./...` and look at the diff of both files.
A name in the data that stands for a family has placeholders: `N`, `X` and `Y` for a number, and `*` for any name. `Lookup` in the `sfz` package reads them, so a new placeholder letter in the data needs `patternRE` in `registry.go` to change as well.