From d124690ecff19c3e5ab69b009c60031147f6ebbf Mon Sep 17 00:00:00 2001 From: Aneurin Barker Snook Date: Tue, 1 Dec 2026 17:38:10 +0000 Subject: [PATCH] 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 --- LICENSE | 21 + README.md | 38 + access.go | 59 + docs/opcodes.md | 740 +++ document.go | 179 + flatten.go | 191 + go.mod | 3 + instrument.go | 1035 ++++ internal/gen/README.md | 5 + internal/gen/go.mod | 5 + internal/gen/go.sum | 3 + internal/gen/main.go | 284 + internal/gen/syntax.yml | 6032 ++++++++++++++++++++ lex.go | 149 + parse.go | 205 + registry.go | 192 + registry_data.go | 754 +++ registry_test.go | 204 + roundtrip_test.go | 122 + sfz_test.go | 709 +++ testdata/splendid/Data/FF.txt | 57 + testdata/splendid/Data/MF.txt | 62 + testdata/splendid/Data/MP.txt | 62 + testdata/splendid/Data/PP.txt | 61 + testdata/splendid/Data/Res.txt | 60 + testdata/splendid/README.md | 9 + testdata/splendid/Splendid Grand Piano.sfz | 124 + validate.go | 197 + values.go | 115 + 29 files changed, 11677 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 access.go create mode 100644 docs/opcodes.md create mode 100644 document.go create mode 100644 flatten.go create mode 100644 go.mod create mode 100644 instrument.go create mode 100644 internal/gen/README.md create mode 100644 internal/gen/go.mod create mode 100644 internal/gen/go.sum create mode 100644 internal/gen/main.go create mode 100644 internal/gen/syntax.yml create mode 100644 lex.go create mode 100644 parse.go create mode 100644 registry.go create mode 100644 registry_data.go create mode 100644 registry_test.go create mode 100644 roundtrip_test.go create mode 100644 sfz_test.go create mode 100644 testdata/splendid/Data/FF.txt create mode 100644 testdata/splendid/Data/MF.txt create mode 100644 testdata/splendid/Data/MP.txt create mode 100644 testdata/splendid/Data/PP.txt create mode 100644 testdata/splendid/Data/Res.txt create mode 100644 testdata/splendid/README.md create mode 100644 testdata/splendid/Splendid Grand Piano.sfz create mode 100644 validate.go create mode 100644 values.go diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b7f4baf --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Aneurin Barker Snook + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..5d715eb --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# sfz + +A Go library that reads, validates and writes [SFZ](https://sfzformat.com/) instruments. It handles the format as data, covering SFZ v1, v2 and the ARIA extensions. It doesn't play instruments or load samples. + +```go +doc, err := sfz.ParseFile(os.DirFS("Piano"), "Piano.sfz") +if err != nil { + return err +} +for _, p := range doc.Validate() { + log.Printf("%s:%d: %s", p.File, p.Line, p.Msg) +} +inst := doc.Flatten().Instrument() +``` + +## Layers + +- **Document.** A file exactly as written: headers, opcodes in order, comments, unknown opcodes, and `#define` and `#include` unexpanded. Each `#include` that was read holds its file, so a document is a tree of files. Writing a document gives the same text back. +- **Flat.** `Document.Flatten` reads each `#include` where it stands, replaces variables with their values as of where they are used, and gives each region the opcodes of the ``, `` and `` above it. +- **Instrument.** `Flat.Instrument` reads the regions into a typed model, with settings taken at the controllers' starting values. Opcodes the model has no field for are counted in `Unread`. + +## Opcodes + +The library knows every opcode and header in the format, from the data behind [sfzformat.com](https://sfzformat.com/): [docs/opcodes.md](docs/opcodes.md) lists them. `Lookup` returns an opcode's type, range, unit, options and version, finding numbered families such as `loccN` and aliases such as `loopmode`. `Validate` checks values against it. `GetAs` reads any opcode's value as an int, float or string. An opcode the registry doesn't know is kept, read and written as text like any other. + +The registry is generated: replace `internal/gen/syntax.yml` and run `go generate ./...`, then `go test -update`. + +## Includes + +`Parse` reads includes with the resolver from `WithResolver`; `ParseFile` reads them from the folder of the main file. An include that can't be read is a `Problem` from `Validate`, and `WithIncludes(sfz.IncludesFail)` makes it an error. Includes nest at most 16 deep, and an instrument may hold 16 MB of text; `WithLimits` changes both. + +## Status + +The document, flattening, typed model, opcode registry and validation are in. Not yet in: editing a document, and building one from the typed model. + +## Licence + +MIT. diff --git a/access.go b/access.go new file mode 100644 index 0000000..baf3f24 --- /dev/null +++ b/access.go @@ -0,0 +1,59 @@ +package sfz + +import "strings" + +// Value is the Go types that an opcode's value can be read as. +type Value interface { + int | int64 | float64 | string +} + +// GetAs returns the value of an opcode, read as a T, or false if it isn't +// set or can't be read as one. A name the format gives an alias is also looked +// up by its aliases, so GetAs(o, "loop_mode") finds loopmode. An integer opcode +// that takes notes, such as lokey, reads a note name as its MIDI number, with +// middle C as c4. A string is returned without surrounding whitespace. +func GetAs[T Value](o Opcodes, name string) (T, bool) { + var zero T + raw, ok := o[name] + if !ok { + info, known := Lookup(name) + if !known { + return zero, false + } + for _, alias := range append([]string{info.Name}, info.Aliases...) { + if raw, ok = o[alias]; ok { + break + } + } + if !ok { + return zero, false + } + } + raw = strings.TrimSpace(raw) + switch any(zero).(type) { + case string: + return any(raw).(T), true + case float64: + f, ok := parseNumber(raw) + if !ok { + return zero, false + } + return any(f).(T), true + } + var n int + if info, known := Lookup(name); known && info.Note { + n, ok = parseNote(raw) + } else { + var f float64 + if f, ok = parseNumber(raw); ok { + n = int(f) + } + } + if !ok { + return zero, false + } + if _, is64 := any(zero).(int64); is64 { + return any(int64(n)).(T), true + } + return any(n).(T), true +} diff --git a/docs/opcodes.md b/docs/opcodes.md new file mode 100644 index 0000000..52ab286 --- /dev/null +++ b/docs/opcodes.md @@ -0,0 +1,740 @@ +# Opcodes + +Every opcode the library knows, from [sfzformat.com](https://sfzformat.com/)'s data. **Typed** opcodes are read into the [`Instrument`](../instrument.go) model; the rest are known, so the library validates them, and reads and writes them as text. This file is generated by `go test -update`. + +| Opcode | Version | Value | Typed | +|---|---|---|---| +| `script` | LinuxSampler | string | | +| `count` | SFZ v1 | integer | | +| `delay` | SFZ v1 | float (seconds) | | +| `delay_ccN`, `delay_onccN` | SFZ v1 | float (seconds) | | +| `delay_curveccN` | ARIA | integer | | +| `delay_random` | SFZ v1 | float (seconds) | | +| `delay_samples` | SFZ v2 | integer (sample units) | | +| `delay_samples_onccN` | SFZ v2 | integer (sample units) | | +| `end` | SFZ v1 | integer (sample units) | | +| `loop_count`, `loopcount` | SFZ v2 | integer | | +| `loop_crossfade` | SFZ v2 | float (seconds) | | +| `loop_end`, `loopend` | SFZ v1 | integer (sample units) | yes | +| `loop_lengthccN`, `loop_length_onccN` | SFZ v2 | unspecified | | +| `loop_mode`, `loopmode` | SFZ v1 | string | yes | +| `loop_start`, `loopstart` | SFZ v1 | integer (sample units) | yes | +| `loop_startccN`, `loop_start_onccN` | SFZ v2 | unspecified | | +| `loop_tune`, `looptune` | SFZ v2 | float (cents) | | +| `loop_type`, `looptype` | SFZ v2 | string | | +| `offset` | SFZ v1 | integer (sample units) | yes | +| `offset_ccN`, `offset_onccN` | SFZ v1 | integer (sample units) | yes | +| `offset_random` | SFZ v1 | integer (sample units) | | +| `offset_mode` | ARIA | string | | +| `sample` | SFZ v1 | string | yes | +| `sample_fadeout` | SFZ v2 | float (seconds) | | +| `sample_dyn_paramN` | ARIA | float | | +| `sample_dyn_paramN_onccX` | ARIA | float | | +| `sync_beats` | SFZ v1 | float (beats) | | +| `sync_offset` | SFZ v1 | float (beats) | | +| `delay_beats` | SFZ v2 | float (beats) | | +| `delay_beats_onccN` | ARIA | unspecified | | +| `delay_beats_curveccN` | ARIA | integer | | +| `delay_beats_random` | ARIA | float (beats) | | +| `stop_beats` | SFZ v2 | float (beats) | | +| `direction` | SFZ v2 | string | | +| `md5` | SFZ v2 | string | | +| `reverse_loccN` | SFZ v2 | integer | | +| `reverse_hiccN` | SFZ v2 | integer | | +| `waveguide` | SFZ v2 | string | | +| `default_path` | SFZ v2 | string | yes | +| `note_offset` | SFZ v2 | integer (semitones) | yes | +| `octave_offset` | SFZ v2 | integer (octaves) | yes | +| `label_ccN` | ARIA | string | yes | +| `label_keyN` | sfizz | string | | +| `label_outputN` | Calfbox | string | | +| `set_ccN` | SFZ v2 | integer | yes | +| `hint_*` | ARIA | unspecified | | +| `*_mod` | ARIA | string | | +| `set_hdccN`, `set_realccN` | ARIA | float | yes | +| `sw_note_offset` | ARIA | integer | | +| `sw_octave_offset` | ARIA | integer | | +| `loop_end_offset` | ARIA | integer | | +| `global_label` | ARIA | string | yes | +| `master_label` | ARIA | string | yes | +| `group_label` | ARIA | string | yes | +| `region_label` | ARIA | string | yes | +| `group`, `polyphony_group` | SFZ v1 | integer | yes | +| `off_by`, `offby` | SFZ v1 | integer | yes | +| `off_mode` | SFZ v1 | string | yes | +| `output` | SFZ v1 | integer | | +| `polyphony` | SFZ v2 | integer | yes | +| `note_polyphony` | SFZ v2 | integer | yes | +| `polyphony_stealing` | ARIA | integer | | +| `note_selfmask` | SFZ v2 | string | | +| `rt_dead` | SFZ v2 | string | | +| `off_curve` | ARIA | integer | | +| `off_shape` | ARIA | float | | +| `off_time` | ARIA | float | yes | +| `key` | SFZ v1 | integer | yes | +| `lokey` | SFZ v1 | integer | yes | +| `hikey` | SFZ v1 | integer | yes | +| `lovel` | SFZ v1 | integer | yes | +| `hivel` | SFZ v1 | integer | yes | +| `lochan` | SFZ v1 | integer | yes | +| `hichan` | SFZ v1 | integer | yes | +| `loccN` | SFZ v1 | integer | yes | +| `hiccN` | SFZ v1 | integer | yes | +| `lobend` | SFZ v1 | integer | yes | +| `hibend` | SFZ v1 | integer | yes | +| `sostenuto_cc` | ARIA | integer | | +| `sostenuto_lo` | ARIA | float | | +| `sostenuto_sw` | SFZ v2 | string | | +| `sustain_cc` | ARIA | integer | | +| `sustain_lo` | ARIA | float | | +| `sustain_sw` | SFZ v2 | string | | +| `sw_lokey` | SFZ v1 | integer | yes | +| `sw_hikey` | SFZ v1 | integer | yes | +| `sw_last` | SFZ v1 | integer | yes | +| `sw_down` | SFZ v1 | integer | yes | +| `sw_up` | SFZ v1 | integer | yes | +| `sw_previous` | SFZ v1 | integer | yes | +| `sw_vel` | SFZ v1 | string | | +| `loprog` | SFZ v2 | integer | | +| `hiprog` | SFZ v2 | integer | | +| `lohdccN` | ARIA | float | yes | +| `hihdccN` | ARIA | float | yes | +| `sw_default` | SFZ v2 | integer | yes | +| `sw_label` | ARIA | string | yes | +| `sw_lolast` | ARIA | integer | | +| `sw_hilast` | ARIA | integer | | +| `varNN_mod` | ARIA | string | | +| `varNN_onccX` | ARIA | float | | +| `varNN_curveccX` | ARIA | integer | | +| `varNN_*` | ARIA | unspecified | | +| `lobpm` | SFZ v1 | float (bpm) | | +| `hibpm` | SFZ v1 | float (bpm) | | +| `lochanaft` | SFZ v1 | integer | yes | +| `hichanaft` | SFZ v1 | integer | yes | +| `lopolyaft` | SFZ v1 | integer | yes | +| `hipolyaft` | SFZ v1 | integer | yes | +| `lorand` | SFZ v1 | float | yes | +| `hirand` | SFZ v1 | float | yes | +| `seq_length` | SFZ v1 | integer | yes | +| `seq_position` | SFZ v1 | integer | yes | +| `lotimer` | SFZ v2 | float | | +| `hitimer` | SFZ v2 | float | | +| `trigger` | SFZ v1 | string | yes | +| `on_loccN`, `start_loccN` | SFZ v1 | integer | | +| `on_hiccN`, `start_hiccN` | SFZ v1 | integer | | +| `on_lohdccN`, `start_lohdccN` | ARIA | float | | +| `on_hihdccN`, `start_hihdccN` | ARIA | float | | +| `stop_loccN` | SFZ v2 | integer | | +| `stop_hiccN` | SFZ v2 | integer | | +| `stop_lohdccN` | ARIA | float | | +| `stop_hihdccN` | ARIA | float | | +| `pan` | SFZ v1 | float (%) | yes | +| `pan_onccN`, `pan_ccN` | SFZ v2 | unspecified | yes | +| `pan_curveccN` | SFZ v2 | integer | yes | +| `pan_smoothccN` | SFZ v2 | unspecified | | +| `pan_stepccN` | SFZ v2 | unspecified | | +| `pan_random` | ARIA | float (%) | | +| `position` | SFZ v1 | float (%) | | +| `position_onccN` | ARIA | unspecified | | +| `position_curveccN` | ARIA | integer | | +| `position_smoothccN` | ARIA | unspecified | | +| `position_stepccN` | ARIA | unspecified | | +| `position_random` | ARIA | float (%) | | +| `position_keycenter` | ARIA | unspecified | | +| `position_keytrack` | ARIA | unspecified | | +| `position_veltrack` | ARIA | integer | | +| `volume` | SFZ v1 | float (dB) | yes | +| `gain_ccN`, `gain_onccN`, `volume_onccN` | SFZ v1 | float (dB) | yes | +| `volume_curveccN` | SFZ v2 | integer | yes | +| `volume_smoothccN` | SFZ v2 | unspecified | | +| `volume_stepccN` | SFZ v2 | unspecified | | +| `width` | SFZ v1 | float (%) | yes | +| `width_onccN` | SFZ v2 | unspecified | yes | +| `width_curveccN` | SFZ v2 | integer | yes | +| `width_smoothccN` | SFZ v2 | unspecified | | +| `width_stepccN` | SFZ v2 | unspecified | | +| `amp_keycenter` | SFZ v1 | integer | | +| `amp_keytrack` | SFZ v1 | float (dB) | | +| `amp_veltrack` | SFZ v1 | float (%) | yes | +| `amp_veltrack_onccN`, `amp_veltrack_ccN` | ARIA | unspecified | yes | +| `amp_veltrack_curveccN` | ARIA | integer | yes | +| `amp_veltrack_random` | ARIA | unspecified | | +| `amp_velcurve_N` | SFZ v1 | float | yes | +| `amp_random`, `gain_random` | SFZ v1 | float (dB) | | +| `rt_decay` | SFZ v1 | float (dB) | yes | +| `rt_decayN` | ARIA | float (dB) | | +| `rt_decayN_time` | ARIA | float (seconds) | | +| `xf_cccurve` | SFZ v1 | string | | +| `xf_keycurve` | SFZ v1 | string | yes | +| `xf_velcurve` | SFZ v1 | string | yes | +| `xfin_loccN` | SFZ v1 | integer | | +| `xfin_hiccN` | SFZ v1 | integer | | +| `xfout_loccN` | SFZ v1 | integer | | +| `xfout_hiccN` | SFZ v1 | integer | | +| `xfin_lokey` | SFZ v1 | integer | yes | +| `xfin_hikey` | SFZ v1 | integer | yes | +| `xfout_lokey` | SFZ v1 | integer | yes | +| `xfout_hikey` | SFZ v1 | integer | yes | +| `xfin_lovel` | SFZ v1 | integer | yes | +| `xfin_hivel` | SFZ v1 | integer | yes | +| `xfout_lovel` | SFZ v1 | integer | yes | +| `xfout_hivel` | SFZ v1 | integer | yes | +| `phase` | SFZ v2 | string | | +| `amplitude` | ARIA | float (%) | yes | +| `amplitude_onccN`, `amplitude_ccN` | ARIA | float (%) | yes | +| `amplitude_curveccN` | ARIA | integer | yes | +| `amplitude_smoothccN` | ARIA | unspecified | | +| `global_amplitude` | ARIA | float (%) | yes | +| `master_amplitude` | ARIA | float (%) | yes | +| `group_amplitude` | ARIA | float (%) | yes | +| `pan_law` | ARIA | string | | +| `pan_keycenter` | SFZ v2 | integer | | +| `pan_keytrack` | SFZ v2 | float (%) | | +| `pan_veltrack` | SFZ v2 | float (%) | | +| `global_volume` | ARIA | float (dB) | yes | +| `master_volume` | ARIA | float (dB) | yes | +| `group_volume` | ARIA | float (dB) | yes | +| `eqN_bw` | SFZ v1 | float (octaves) | | +| `eqN_bwccX`, `eqN_bw_onccX` | SFZ v1 | float (octaves) | | +| `eqN_freq` | SFZ v1 | float (Hz) | | +| `eqN_freqccX`, `eqN_freq_onccX` | SFZ v1 | float (Hz) | | +| `eqN_vel2freq` | SFZ v1 | float (Hz) | | +| `eqN_gain` | SFZ v1 | float (dB) | | +| `eqN_gainccX`, `eqN_gain_onccX` | SFZ v1 | float (dB) | | +| `eqN_vel2gain` | SFZ v1 | float (dB) | | +| `eqN_dynamic` | ARIA | integer | | +| `eqN_mode` | ARIA | string | | +| `eqN_type` | SFZ v2 | string | | +| `cutoff` | SFZ v1 | float (Hz) | | +| `cutoff_ccN`, `cutoff_onccN` | SFZ v1 | integer (cents) | | +| `cutoff_curveccN` | SFZ v2 | integer | | +| `cutoff_smoothccN` | SFZ v2 | float (ms) | | +| `cutoff_stepccN` | SFZ v2 | integer | | +| `cutoff_chanaft` | SFZ v1 | integer (cents) | | +| `cutoff_polyaft` | SFZ v1 | integer (cents) | | +| `cutoff2` | SFZ v2 | float (Hz) | | +| `cutoff2_ccN` | SFZ v1 | integer (cents) | | +| `cutoff2_onccN` | SFZ v2 | unspecified | | +| `cutoff2_curveccN` | SFZ v2 | integer | | +| `cutoff2_smoothccN` | SFZ v2 | float (ms) | | +| `cutoff2_stepccN` | SFZ v2 | integer | | +| `cutoff2_chanaft` | SFZ v1 | integer (cents) | | +| `cutoff2_polyaft` | SFZ v1 | integer (cents) | | +| `fil_gain` | ARIA | float (dB) | | +| `fil_gain_onccN` | ARIA | unspecified | | +| `fil2_gain` | ARIA | float (dB) | | +| `fil2_gain_onccN` | ARIA | unspecified | | +| `fil_keycenter`, `fil2_keycenter` | SFZ v1 | integer | | +| `fil_keytrack`, `fil2_keytrack` | SFZ v1 | integer (cents) | | +| `fil_mode`, `fil2_mode` | ARIA | string | | +| `fil_random`, `cutoff_random`, `cutoff2_random` | SFZ v1 | integer (cents) | | +| `fil_type`, `filtype`, `fil2_type` | SFZ v1 | string | | +| `fil_veltrack`, `fil2_veltrack` | SFZ v1 | integer (cents) | | +| `resonance` | SFZ v1 | float (dB) | | +| `resonance_onccN`, `resonance_ccN` | SFZ v2 | float (dB) | | +| `resonance_curveccN` | SFZ v2 | integer | | +| `resonance_smoothccN` | SFZ v2 | float (ms) | | +| `resonance_stepccN` | SFZ v2 | integer | | +| `resonance2` | SFZ v2 | float (dB) | | +| `resonance2_onccN`, `resonance2_ccN` | SFZ v2 | float (dB) | | +| `resonance2_curveccN` | SFZ v2 | integer | | +| `resonance2_smoothccN` | SFZ v2 | float (ms) | | +| `resonance2_stepccN` | SFZ v2 | integer | | +| `resonance_random` | ARIA | float (dB) | | +| `resonance2_random` | ARIA | float (dB) | | +| `noise_filter` | SFZ v2 | string | | +| `noise_stereo` | SFZ v2 | string | | +| `noise_level` | SFZ v2 | float (dB) | | +| `noise_level_onccN` | SFZ v2 | float (dB) | | +| `noise_level_smoothccN` | SFZ v2 | float (ms) | | +| `noise_step` | SFZ v2 | integer | | +| `noise_step_onccN` | SFZ v2 | integer | | +| `noise_tone` | SFZ v2 | integer | | +| `noise_tone_onccN` | SFZ v2 | integer | | +| `bend_up`, `bendup` | SFZ v1 | integer (cents) | yes | +| `bend_down`, `benddown` | SFZ v1 | integer (cents) | yes | +| `bend_smooth` | SFZ v2 | float (ms) | | +| `bend_step`, `bendstep` | SFZ v1 | integer (cents) | yes | +| `tune`, `pitch` | SFZ v1 | integer (cents) | yes | +| `pitch_onccN`, `tune_ccN`, `tune_onccN` | SFZ v2 | unspecified (cents) | yes | +| `pitch_curveccN`, `tune_curveccN` | SFZ v2 | integer | yes | +| `pitch_smoothccN`, `tune_smoothccN` | SFZ v2 | float (ms) | | +| `pitch_stepccN`, `tune_stepccN` | SFZ v2 | unspecified | | +| `group_tune` | ARIA | integer (cents) | | +| `master_tune` | ARIA | integer (cents) | | +| `global_tune` | ARIA | integer (cents) | | +| `pitch_keycenter` | SFZ v1 | integer | yes | +| `pitch_keytrack`, `tune_keytrack` | SFZ v1 | integer (cents) | yes | +| `pitch_random`, `tune_random` | SFZ v1 | integer (cents) | | +| `pitch_veltrack`, `tune_veltrack` | SFZ v1 | integer (cents) | | +| `transpose` | SFZ v1 | integer | yes | +| `bend_stepup` | SFZ v2 | integer (cents) | | +| `bend_stepdown` | SFZ v2 | integer (cents) | | +| `ampeg_attack`, `amp_attack` | SFZ v1 | float (seconds) | yes | +| `ampeg_attackccN`, `ampeg_attack_onccN` | SFZ v1 | float (seconds) | yes | +| `ampeg_attack_curveccN` | ARIA | integer | yes | +| `ampeg_vel2attack`, `amp_vel2attack` | SFZ v1 | float (seconds) | | +| `ampeg_decay`, `amp_decay` | SFZ v1 | float (seconds) | yes | +| `ampeg_decayccN`, `ampeg_decay_onccN` | SFZ v1 | float | yes | +| `ampeg_decay_curveccN` | ARIA | integer | yes | +| `ampeg_vel2decay`, `amp_vel2decay` | SFZ v1 | float (seconds) | | +| `ampeg_delay`, `amp_delay` | SFZ v1 | float (seconds) | yes | +| `ampeg_delayccN`, `ampeg_delay_onccN` | SFZ v1 | float | yes | +| `ampeg_delay_curveccN` | ARIA | integer | yes | +| `ampeg_vel2delay`, `amp_vel2delay` | SFZ v1 | float (seconds) | | +| `ampeg_hold`, `amp_hold` | SFZ v1 | float (seconds) | yes | +| `ampeg_holdccN`, `ampeg_hold_onccN` | SFZ v1 | float | yes | +| `ampeg_hold_curveccN` | ARIA | integer | yes | +| `ampeg_vel2hold`, `amp_vel2hold` | SFZ v1 | float (seconds) | | +| `ampeg_release`, `amp_release` | SFZ v1 | float (seconds) | yes | +| `ampeg_releaseccN`, `ampeg_release_onccN` | SFZ v1 | float (seconds) | yes | +| `ampeg_release_curveccN` | ARIA | integer | yes | +| `ampeg_vel2release`, `amp_vel2release` | SFZ v1 | float (seconds) | | +| `ampeg_sustain`, `amp_sustain` | SFZ v1 | float (%) | yes | +| `ampeg_sustainccN`, `ampeg_sustain_onccN` | SFZ v1 | float (%) | yes | +| `ampeg_sustain_curveccN` | ARIA | integer | yes | +| `ampeg_vel2sustain`, `amp_vel2sustain` | SFZ v1 | float (%) | | +| `ampeg_start` | SFZ v1 | float (%) | | +| `ampeg_startccN`, `ampeg_start_onccN` | SFZ v1 | float (%) | | +| `ampeg_start_curveccN` | ARIA | integer | | +| `ampeg_attack_shape` | ARIA | float | | +| `ampeg_decay_shape` | ARIA | float | | +| `ampeg_decay_zero` | ARIA | integer | | +| `ampeg_dynamic` | ARIA | integer | | +| `ampeg_release_shape` | ARIA | float | | +| `ampeg_release_zero` | ARIA | integer | | +| `fileg_attack_shape` | ARIA | float | | +| `fileg_decay_shape` | ARIA | float | | +| `fileg_decay_zero` | ARIA | integer | | +| `fileg_release_shape` | ARIA | float | | +| `fileg_release_zero` | ARIA | integer | | +| `fileg_dynamic` | ARIA | integer | | +| `pitcheg_attack_shape` | ARIA | float | | +| `pitcheg_decay_shape` | ARIA | float | | +| `pitcheg_decay_zero` | ARIA | integer | | +| `pitcheg_release_shape` | ARIA | float | | +| `pitcheg_release_zero` | ARIA | integer | | +| `pitcheg_dynamic` | ARIA | integer | | +| `fileg_attack`, `fil_attack` | SFZ v1 | float (seconds) | | +| `fileg_attack_onccN`, `fileg_attackccN` | ARIA | float (seconds) | | +| `fileg_attack_curveccN` | ARIA | integer | | +| `fileg_vel2attack`, `fil_vel2attack` | SFZ v1 | float (seconds) | | +| `fileg_decay`, `fil_decay` | SFZ v1 | float (seconds) | | +| `fileg_decay_onccN`, `fileg_decayccN` | ARIA | float | | +| `fileg_decay_curveccN` | ARIA | integer | | +| `fileg_vel2decay`, `fil_vel2decay` | SFZ v1 | float (seconds) | | +| `fileg_delay`, `fil_delay` | SFZ v1 | float (seconds) | | +| `fileg_delay_onccN`, `fileg_delayccN` | ARIA | float | | +| `fileg_delay_curveccN` | ARIA | integer | | +| `fileg_vel2delay`, `fil_vel2delay` | SFZ v1 | float (seconds) | | +| `fileg_depth`, `fil_depth` | SFZ v1 | integer (cents) | | +| `fileg_depth_onccN`, `fileg_depthccN` | ARIA | integer (cents) | | +| `fileg_depth_curveccN` | ARIA | integer | | +| `fileg_vel2depth`, `fil_vel2depth` | SFZ v1 | integer (cents) | | +| `fileg_hold`, `fil_hold` | SFZ v1 | float (seconds) | | +| `fileg_hold_onccN`, `fileg_holdccN` | ARIA | float | | +| `fileg_hold_curveccN` | ARIA | integer | | +| `fileg_vel2hold`, `fil_vel2hold` | SFZ v1 | float (seconds) | | +| `fileg_release`, `fil_release` | SFZ v1 | float (seconds) | | +| `fileg_release_onccN`, `fileg_releaseccN` | ARIA | float (seconds) | | +| `fileg_release_curveccN` | ARIA | integer | | +| `fileg_vel2release`, `fil_vel2release` | SFZ v1 | float (seconds) | | +| `fileg_start` | SFZ v1 | float (%) | | +| `fileg_start_onccN`, `fileg_startccN` | ARIA | float (seconds) | | +| `fileg_start_curveccN` | ARIA | integer | | +| `fileg_sustain`, `fil_sustain` | SFZ v1 | float (%) | | +| `fileg_sustain_onccN`, `fileg_sustainccN` | ARIA | float (%) | | +| `fileg_sustain_curveccN` | ARIA | integer | | +| `fileg_vel2sustain`, `fil_vel2sustain` | SFZ v1 | float (%) | | +| `pitcheg_attack`, `pitch_attack` | SFZ v1 | float (seconds) | | +| `pitcheg_attack_onccN` | ARIA | unspecified | | +| `pitcheg_attack_curveccN` | ARIA | integer | | +| `pitcheg_vel2attack`, `pitch_vel2attack` | SFZ v1 | float (seconds) | | +| `pitcheg_decay`, `pitch_decay` | SFZ v1 | float (seconds) | | +| `pitcheg_decay_onccN` | ARIA | float | | +| `pitcheg_decay_curveccN` | ARIA | integer | | +| `pitcheg_vel2decay`, `pitch_vel2decay` | SFZ v1 | float (seconds) | | +| `pitcheg_delay`, `pitch_delay` | SFZ v1 | float (seconds) | | +| `pitcheg_delay_onccN` | ARIA | float | | +| `pitcheg_delay_curveccN` | ARIA | integer | | +| `pitcheg_vel2delay`, `pitch_vel2delay` | SFZ v1 | float (seconds) | | +| `pitcheg_depth`, `pitch_depth` | SFZ v1 | integer (cents) | | +| `pitcheg_depth_onccN`, `pitcheg_depthccN` | ARIA | integer (cents) | | +| `pitcheg_depth_curveccN` | ARIA | integer | | +| `pitcheg_vel2depth`, `pitch_vel2depth` | SFZ v1 | integer (cents) | | +| `pitcheg_hold`, `pitch_hold` | SFZ v1 | float (seconds) | | +| `pitcheg_hold_onccN` | ARIA | float | | +| `pitcheg_hold_curveccN` | ARIA | integer | | +| `pitcheg_vel2hold`, `pitch_vel2hold` | SFZ v1 | float (seconds) | | +| `pitcheg_release`, `pitch_release` | SFZ v1 | float (seconds) | | +| `pitcheg_release_onccN` | ARIA | float (seconds) | | +| `pitcheg_release_curveccN` | ARIA | integer | | +| `pitcheg_vel2release`, `pitch_vel2release` | SFZ v1 | float (seconds) | | +| `pitcheg_start` | SFZ v1 | float (%) | | +| `pitcheg_start_onccN` | ARIA | float (%) | | +| `pitcheg_start_curveccN` | ARIA | integer | | +| `pitcheg_sustain`, `pitch_sustain` | SFZ v1 | float (%) | | +| `pitcheg_sustain_onccN` | ARIA | float (%) | | +| `pitcheg_sustain_curveccN` | ARIA | integer | | +| `pitcheg_vel2sustain`, `pitch_vel2sustain` | SFZ v1 | float (%) | | +| `egN_points` | SFZ v2 | unspecified | | +| `egN_timeX` | SFZ v2 | float (seconds) | | +| `egN_timeX_onccY` | SFZ v2 | float (seconds) | | +| `egN_levelX` | SFZ v2 | float | | +| `egN_levelX_onccY` | SFZ v2 | float | | +| `egN_ampeg` | ARIA | unspecified | | +| `egN_dynamic` | ARIA | integer | | +| `egN_shapeX` | SFZ v2 | float | | +| `egN_curveX` | SFZ v2 | unspecified | | +| `egN_sustain` | SFZ v2 | unspecified | | +| `egN_loop` | SFZ v2 | unspecified | | +| `egN_loop_count` | SFZ v2 | unspecified | | +| `egN_volume` | SFZ v2 | unspecified | | +| `egN_volume_onccX` | SFZ v2 | unspecified | | +| `egN_amplitude` | SFZ v2 | unspecified | | +| `egN_amplitude_onccX` | SFZ v2 | unspecified | | +| `egN_pan` | SFZ v2 | unspecified | | +| `egN_pan_onccX` | SFZ v2 | unspecified | | +| `egN_width` | SFZ v2 | unspecified | | +| `egN_width_onccX` | SFZ v2 | unspecified | | +| `egN_pan_curve` | SFZ v2 | unspecified | | +| `egN_pan_curveccX` | SFZ v2 | integer | | +| `egN_freq_lfoX` | SFZ v2 | float (Hz) | | +| `egN_depth_lfoX` | SFZ v2 | float (%) | | +| `egN_depthadd_lfoX` | SFZ v2 | unspecified | | +| `egN_pitch` | SFZ v2 | unspecified | | +| `egN_pitch_onccX` | SFZ v2 | unspecified | | +| `egN_cutoff` | SFZ v2 | unspecified | | +| `egN_cutoff_onccX` | SFZ v2 | unspecified | | +| `egN_cutoff2` | SFZ v2 | unspecified | | +| `egN_cutoff2_onccX` | SFZ v2 | unspecified | | +| `egN_resonance` | SFZ v2 | unspecified | | +| `egN_resonance_onccX` | SFZ v2 | unspecified | | +| `egN_resonance2` | SFZ v2 | unspecified | | +| `egN_resonance2_onccX` | SFZ v2 | unspecified | | +| `egN_eqXfreq` | SFZ v2 | unspecified | | +| `egN_eqXfreq_onccY` | SFZ v2 | unspecified | | +| `egN_eqXbw` | SFZ v2 | unspecified | | +| `egN_eqXbw_onccY` | SFZ v2 | unspecified | | +| `egN_eqXgain` | SFZ v2 | unspecified | | +| `egN_eqXgain_onccY` | SFZ v2 | unspecified | | +| `egN_decim` | SFZ v2 | unspecified | | +| `egN_decim_onccX` | SFZ v2 | unspecified | | +| `egN_bitred` | SFZ v2 | unspecified | | +| `egN_bitred_onccX` | SFZ v2 | unspecified | | +| `egN_rectify` | SFZ v2 | unspecified | | +| `egN_rectify_onccX` | SFZ v2 | unspecified | | +| `egN_ringmod` | SFZ v2 | unspecified | | +| `egN_ringmod_onccX` | SFZ v2 | unspecified | | +| `egN_noiselevel` | SFZ v2 | unspecified | | +| `egN_noiselevel_onccX` | SFZ v2 | unspecified | | +| `egN_noisestep` | SFZ v2 | unspecified | | +| `egN_noisestep_onccX` | SFZ v2 | unspecified | | +| `egN_noisetone` | SFZ v2 | unspecified | | +| `egN_noisetone_onccX` | SFZ v2 | unspecified | | +| `egN_driveshape` | SFZ v2 | unspecified | | +| `egN_driveshape_onccX` | SFZ v2 | unspecified | | +| `egN_sample_dyn_paramX` | ARIA | unspecified | | +| `egN_sample_dyn_paramX_onccY` | ARIA | unspecified | | +| `amplfo_delay` | SFZ v1 | float (seconds) | | +| `amplfo_depth` | SFZ v1 | float (dB) | | +| `amplfo_depthccN`, `amplfo_depth_onccN` | SFZ v1 | float (dB) | | +| `amplfo_depthchanaft` | SFZ v1 | float (dB) | | +| `amplfo_depthpolyaft` | SFZ v1 | float (dB) | | +| `amplfo_fade` | SFZ v1 | float (seconds) | | +| `amplfo_freq` | SFZ v1 | float (Hz) | | +| `amplfo_freqccN` | SFZ v1 | float (Hz) | | +| `amplfo_freqchanaft` | SFZ v1 | float (Hz) | | +| `amplfo_freqpolyaft` | SFZ v1 | float (Hz) | | +| `fillfo_delay` | SFZ v1 | float (seconds) | | +| `fillfo_depth` | SFZ v1 | float (cents) | | +| `fillfo_depthccN`, `fillfo_depth_onccN` | SFZ v1 | float (cents) | | +| `fillfo_depthchanaft` | SFZ v1 | float (cents) | | +| `fillfo_depthpolyaft` | SFZ v1 | float (cents) | | +| `fillfo_fade` | SFZ v1 | float (seconds) | | +| `fillfo_freq` | SFZ v1 | float (Hz) | | +| `fillfo_freqccN` | SFZ v1 | float (Hz) | | +| `fillfo_freqchanaft` | SFZ v1 | float (Hz) | | +| `fillfo_freqpolyaft` | SFZ v1 | float (Hz) | | +| `pitchlfo_delay` | SFZ v1 | float (seconds) | | +| `pitchlfo_depth` | SFZ v1 | float (cents) | | +| `pitchlfo_depthccN`, `pitchlfo_depth_onccN` | SFZ v1 | float (cents) | | +| `pitchlfo_depthchanaft` | SFZ v1 | float (cents) | | +| `pitchlfo_depthpolyaft` | SFZ v1 | float (cents) | | +| `pitchlfo_fade` | SFZ v1 | float (seconds) | | +| `pitchlfo_freq` | SFZ v1 | float (Hz) | | +| `pitchlfo_freqccN` | SFZ v1 | float (Hz) | | +| `pitchlfo_freqchanaft` | SFZ v1 | float (Hz) | | +| `pitchlfo_freqpolyaft` | SFZ v1 | float (Hz) | | +| `lfoN_freq` | SFZ v2 | float (Hz) | | +| `lfoN_freq_onccX` | SFZ v2 | unspecified | | +| `lfoN_freq_smoothccX` | SFZ v2 | unspecified | | +| `lfoN_freq_stepccX` | SFZ v2 | unspecified | | +| `lfoN_delay` | SFZ v2 | float (seconds) | | +| `lfoN_delay_onccX` | SFZ v2 | unspecified | | +| `lfoN_fade` | SFZ v2 | float | | +| `lfoN_fade_onccX` | SFZ v2 | float | | +| `lfoN_phase` | SFZ v2 | float | | +| `lfoN_phase_onccX` | SFZ v2 | unspecified | | +| `lfoN_count` | SFZ v2 | integer | | +| `lfoN_wave`, `lfoN_waveX` | SFZ v2 | integer | | +| `lfoN_wave_onccX` | ARIA | unspecified | | +| `lfoN_steps` | SFZ v2 | integer | | +| `lfoN_stepX` | SFZ v2 | float (percent) | | +| `lfoN_stepX_onccY` | SFZ v2 | unspecified | | +| `lfoN_smooth` | SFZ v2 | unspecified | | +| `lfoN_smooth_onccX` | SFZ v2 | unspecified | | +| `lfoN_volume` | SFZ v2 | unspecified | | +| `lfoN_volume_onccX` | SFZ v2 | unspecified | | +| `lfoN_volume_smoothccX` | SFZ v2 | unspecified | | +| `lfoN_volume_stepccX` | SFZ v2 | unspecified | | +| `lfoN_amplitude` | SFZ v2 | unspecified | | +| `lfoN_amplitude_onccX` | SFZ v2 | unspecified | | +| `lfoN_amplitude_smoothccX` | SFZ v2 | unspecified | | +| `lfoN_amplitude_stepccX` | SFZ v2 | unspecified | | +| `lfoN_pan` | SFZ v2 | unspecified | | +| `lfoN_pan_onccX` | SFZ v2 | unspecified | | +| `lfoN_pan_smoothccX` | SFZ v2 | unspecified | | +| `lfoN_pan_stepccX` | SFZ v2 | unspecified | | +| `lfoN_width` | SFZ v2 | unspecified | | +| `lfoN_width_onccX` | SFZ v2 | unspecified | | +| `lfoN_width_smoothccX` | SFZ v2 | unspecified | | +| `lfoN_width_stepccX` | SFZ v2 | unspecified | | +| `lfoN_freq_lfoX` | SFZ v2 | unspecified | | +| `lfoN_freq_lfoX_onccY` | ARIA | unspecified | | +| `lfoN_depth_lfoX` | SFZ v2 | unspecified | | +| `lfoN_depthadd_lfoX` | SFZ v2 | unspecified | | +| `lfoN_pitch` | SFZ v2 | unspecified | | +| `lfoN_pitch_curveccX` | SFZ v2 | integer | | +| `lfoN_pitch_onccX` | SFZ v2 | unspecified | | +| `lfoN_pitch_smoothccX` | SFZ v2 | unspecified | | +| `lfoN_pitch_stepccX` | SFZ v2 | unspecified | | +| `lfoN_cutoff` | SFZ v2 | unspecified | | +| `lfoN_cutoff_onccX` | SFZ v2 | unspecified | | +| `lfoN_cutoff_smoothccX` | SFZ v2 | unspecified | | +| `lfoN_cutoff_stepccX` | SFZ v2 | unspecified | | +| `lfoN_cutoff2` | SFZ v2 | unspecified | | +| `lfoN_cutoff2_onccX` | SFZ v2 | unspecified | | +| `lfoN_cutoff2_smoothccX` | SFZ v2 | unspecified | | +| `lfoN_cutoff2_stepccX` | SFZ v2 | unspecified | | +| `lfoN_resonance` | SFZ v2 | unspecified | | +| `lfoN_resonance_onccX` | SFZ v2 | unspecified | | +| `lfoN_resonance_smoothccX` | SFZ v2 | unspecified | | +| `lfoN_resonance_stepccX` | SFZ v2 | unspecified | | +| `lfoN_resonance2` | SFZ v2 | unspecified | | +| `lfoN_resonance2_onccX` | SFZ v2 | unspecified | | +| `lfoN_resonance2_smoothccX` | SFZ v2 | unspecified | | +| `lfoN_resonance2_stepccX` | SFZ v2 | unspecified | | +| `lfoN_eqXfreq` | SFZ v2 | unspecified | | +| `lfoN_eqXfreq_onccY` | SFZ v2 | unspecified | | +| `lfoN_eqXfreq_smoothccY` | SFZ v2 | unspecified | | +| `lfoN_eqXfreq_stepccY` | SFZ v2 | unspecified | | +| `lfoN_eqXbw` | SFZ v2 | unspecified | | +| `lfoN_eqXbw_onccY` | SFZ v2 | unspecified | | +| `lfoN_eqXbw_smoothccY` | SFZ v2 | unspecified | | +| `lfoN_eqXbw_stepccY` | SFZ v2 | unspecified | | +| `lfoN_eqXgain` | SFZ v2 | unspecified | | +| `lfoN_eqXgain_onccY` | SFZ v2 | unspecified | | +| `lfoN_eqXgain_smoothccY` | SFZ v2 | unspecified | | +| `lfoN_eqXgain_stepccY` | SFZ v2 | unspecified | | +| `lfoN_decim` | SFZ v2 | unspecified | | +| `lfoN_decim_onccX` | SFZ v2 | unspecified | | +| `lfoN_decim_smoothccX` | SFZ v2 | unspecified | | +| `lfoN_decim_stepccX` | SFZ v2 | unspecified | | +| `lfoN_bitred` | SFZ v2 | unspecified | | +| `lfoN_bitred_onccX` | SFZ v2 | unspecified | | +| `lfoN_bitred_smoothccX` | SFZ v2 | unspecified | | +| `lfoN_bitred_stepccX` | SFZ v2 | unspecified | | +| `lfoN_noiselevel` | SFZ v2 | unspecified | | +| `lfoN_noiselevel_onccX` | SFZ v2 | unspecified | | +| `lfoN_noiselevel_smoothccX` | SFZ v2 | unspecified | | +| `lfoN_noiselevel_stepccX` | SFZ v2 | unspecified | | +| `lfoN_noisestep` | SFZ v2 | unspecified | | +| `lfoN_noisestep_onccX` | SFZ v2 | unspecified | | +| `lfoN_noisestep_smoothccX` | SFZ v2 | unspecified | | +| `lfoN_noisestep_stepccX` | SFZ v2 | unspecified | | +| `lfoN_noisetone` | SFZ v2 | unspecified | | +| `lfoN_noisetone_onccX` | SFZ v2 | unspecified | | +| `lfoN_noisetone_smoothccX` | SFZ v2 | unspecified | | +| `lfoN_noisetone_stepccX` | SFZ v2 | unspecified | | +| `lfoN_drive` | SFZ v2 | unspecified | | +| `lfoN_drive_onccX` | SFZ v2 | unspecified | | +| `lfoN_drive_smoothccX` | SFZ v2 | unspecified | | +| `lfoN_drive_stepccX` | SFZ v2 | unspecified | | +| `lfoN_offset`, `lfoN_offsetX` | ARIA | float | | +| `lfoN_ratio`, `lfoN_ratioX` | ARIA | float | | +| `lfoN_scale`, `lfoN_scaleX` | ARIA | float | | +| `lfoN_sample_dyn_paramX` | ARIA | unspecified | | +| `lfoN_sample_dyn_paramX_onccY` | ARIA | unspecified | | +| `curve_index` | ARIA | integer | | +| `vNNN` | SFZ v2 | float | | +| `apan_depth` | SFZ v2 | unspecified | | +| `apan_depth_onccN` | SFZ v2 | unspecified | | +| `apan_dry` | SFZ v2 | unspecified | | +| `apan_dry_onccN` | SFZ v2 | unspecified | | +| `apan_freq` | SFZ v2 | float (Hz) | | +| `apan_freq_onccN` | SFZ v2 | unspecified | | +| `apan_phase` | SFZ v2 | float (°) | | +| `apan_phase_onccN` | SFZ v2 | unspecified | | +| `apan_waveform` | SFZ v2 | unspecified | | +| `apan_wet` | SFZ v2 | unspecified | | +| `apan_wet_onccN` | SFZ v2 | unspecified | | +| `bitred` | SFZ v2 | unspecified | | +| `bitred_onccN` | SFZ v2 | unspecified | | +| `bitred_curveccN` | SFZ v2 | integer | | +| `bitred_smoothccN` | SFZ v2 | unspecified | | +| `bitred_stepccN` | SFZ v2 | unspecified | | +| `bus` | SFZ v2 | string | | +| `bypass_onccN` | SFZ v2 | float | | +| `comp_attack` | SFZ v2 | float (seconds) | | +| `comp_gain` | SFZ v2 | unspecified | | +| `comp_ratio` | SFZ v2 | unspecified | | +| `comp_release` | SFZ v2 | float (seconds) | | +| `comp_stlink` | SFZ v2 | string | | +| `comp_threshold` | SFZ v2 | float (dB) | | +| `decim` | SFZ v2 | unspecified | | +| `decim_onccN` | SFZ v2 | unspecified | | +| `decim_curveccN` | SFZ v2 | integer | | +| `decim_smoothccN` | SFZ v2 | unspecified | | +| `decim_stepccN` | SFZ v2 | unspecified | | +| `delay_cutoff` | SFZ v2 | float (Hz) | | +| `delay_cutoff_onccN` | SFZ v2 | unspecified | | +| `delay_damphi` | SFZ v2 | unspecified | | +| `delay_damphi_onccN` | SFZ v2 | unspecified | | +| `delay_damplo` | SFZ v2 | unspecified | | +| `delay_damplo_onccN` | SFZ v2 | unspecified | | +| `delay_dry` | SFZ v2 | unspecified | | +| `delay_dry_onccN` | SFZ v2 | unspecified | | +| `delay_feedback` | SFZ v2 | unspecified | | +| `delay_feedback_onccN` | SFZ v2 | unspecified | | +| `delay_filter` | SFZ v2 | string | | +| `delay_input` | SFZ v2 | unspecified | | +| `delay_input_onccN` | SFZ v2 | unspecified | | +| `delay_levelc` | SFZ v2 | unspecified | | +| `delay_levell` | SFZ v2 | unspecified | | +| `delay_levelr` | SFZ v2 | unspecified | | +| `delay_lfofreq` | SFZ v2 | float (Hz) | | +| `delay_lfofreq_onccN` | SFZ v2 | unspecified | | +| `delay_moddepth` | SFZ v2 | unspecified | | +| `delay_moddepth_onccN` | SFZ v2 | unspecified | | +| `delay_mode` | SFZ v2 | string | | +| `delay_panc` | SFZ v2 | unspecified | | +| `delay_panc_onccN` | SFZ v2 | unspecified | | +| `delay_panl` | SFZ v2 | unspecified | | +| `delay_panl_onccN` | SFZ v2 | unspecified | | +| `delay_panr` | SFZ v2 | unspecified | | +| `delay_panr_onccN` | SFZ v2 | unspecified | | +| `delay_resonance` | SFZ v2 | unspecified | | +| `delay_resonance_onccN` | SFZ v2 | unspecified | | +| `delay_spread` | SFZ v2 | unspecified | | +| `delay_spread_onccN` | SFZ v2 | unspecified | | +| `delay_syncc_onccN` | SFZ v2 | unspecified | | +| `delay_syncl_onccN` | SFZ v2 | unspecified | | +| `delay_syncr_onccN` | SFZ v2 | unspecified | | +| `delay_time_tap` | SFZ v2 | unspecified | | +| `delay_timec` | SFZ v2 | unspecified | | +| `delay_timec_onccN` | SFZ v2 | unspecified | | +| `delay_timel` | SFZ v2 | unspecified | | +| `delay_timel_onccN` | SFZ v2 | unspecified | | +| `delay_timer` | SFZ v2 | unspecified | | +| `delay_timer_onccN` | SFZ v2 | unspecified | | +| `delay_wet` | SFZ v2 | unspecified | | +| `delay_wet_onccN` | SFZ v2 | unspecified | | +| `directtomain` | SFZ v2 | float (%) | | +| `disto_depth` | SFZ v2 | unspecified | | +| `disto_depth_onccN` | SFZ v2 | unspecified | | +| `disto_dry` | SFZ v2 | unspecified | | +| `disto_dry_onccN` | SFZ v2 | unspecified | | +| `disto_stages` | SFZ v2 | unspecified | | +| `disto_tone` | SFZ v2 | unspecified | | +| `disto_tone_onccN` | SFZ v2 | unspecified | | +| `disto_wet` | SFZ v2 | unspecified | | +| `disto_wet_onccN` | SFZ v2 | unspecified | | +| `dsp_order` | SFZ v2 | integer | | +| `effect1` | SFZ v1 | float (%) | | +| `effect2` | SFZ v1 | float (%) | | +| `effect3` | SFZ v2 | float (%) | | +| `effect4` | SFZ v2 | float (%) | | +| `eq_bw` | SFZ v2 | unspecified | | +| `eq_bw_onccN` | SFZ v2 | unspecified | | +| `eq_freq` | SFZ v2 | unspecified | | +| `eq_freq_onccN` | SFZ v2 | unspecified | | +| `eq_gain` | SFZ v2 | unspecified | | +| `eq_gain_onccN` | SFZ v2 | unspecified | | +| `eq_type` | SFZ v2 | unspecified | | +| `filter_cutoff` | SFZ v2 | unspecified | | +| `filter_cutoff_onccN` | SFZ v2 | unspecified | | +| `filter_resonance` | SFZ v2 | unspecified | | +| `filter_resonance_onccN` | SFZ v2 | unspecified | | +| `filter_type` | SFZ v2 | string | | +| `fxNtomain` | SFZ v2 | float (%) | | +| `fxNtomix` | SFZ v2 | float (%) | | +| `gate_onccN` | SFZ v2 | unspecified | | +| `gate_attack` | SFZ v2 | unspecified | | +| `gate_release` | SFZ v2 | unspecified | | +| `gate_stlink` | SFZ v2 | string | | +| `gate_threshold` | SFZ v2 | unspecified | | +| `internal` | SFZ v2 | string | | +| `param_offset` | ARIA | integer | | +| `phaser_depth` | SFZ v2 | unspecified | | +| `phaser_depth_onccN` | SFZ v2 | unspecified | | +| `phaser_feedback` | SFZ v2 | unspecified | | +| `phaser_feedback_onccN` | SFZ v2 | unspecified | | +| `phaser_freq` | SFZ v2 | float (Hz) | | +| `phaser_freq_onccN` | SFZ v2 | unspecified | | +| `phaser_phase_onccN` | SFZ v2 | unspecified | | +| `phaser_stages` | SFZ v2 | unspecified | | +| `phaser_waveform` | SFZ v2 | unspecified | | +| `phaser_wet` | SFZ v2 | unspecified | | +| `phaser_wet_onccN` | SFZ v2 | unspecified | | +| `reverb_damp` | SFZ v2 | unspecified | | +| `reverb_damp_onccN` | SFZ v2 | unspecified | | +| `reverb_dry` | SFZ v2 | unspecified | | +| `reverb_dry_onccN` | SFZ v2 | unspecified | | +| `reverb_input` | SFZ v2 | unspecified | | +| `reverb_input_onccN` | SFZ v2 | unspecified | | +| `reverb_predelay` | SFZ v2 | float (seconds) | | +| `reverb_predelay_onccN` | SFZ v2 | unspecified | | +| `reverb_size` | SFZ v2 | unspecified | | +| `reverb_size_onccN` | SFZ v2 | unspecified | | +| `reverb_tone` | SFZ v2 | unspecified | | +| `reverb_tone_onccN` | SFZ v2 | unspecified | | +| `reverb_type` | SFZ v2 | string | | +| `reverb_wet` | SFZ v2 | unspecified | | +| `reverb_wet_onccN` | SFZ v2 | unspecified | | +| `static_cyclic_level` | SFZ v2 | unspecified | | +| `static_cyclic_time` | SFZ v2 | float (seconds) | | +| `static_filter` | SFZ v2 | string | | +| `static_level` | SFZ v2 | unspecified | | +| `static_level_onccN` | SFZ v2 | unspecified | | +| `static_random_level` | SFZ v2 | unspecified | | +| `static_random_maxtime` | SFZ v2 | float (seconds) | | +| `static_random_mintime` | SFZ v2 | float (seconds) | | +| `static_stereo` | SFZ v2 | unspecified | | +| `static_tone` | SFZ v2 | unspecified | | +| `strings_number` | SFZ v2 | unspecified | | +| `strings_wet_onccN` | SFZ v2 | unspecified | | +| `tdfir_dry` | SFZ v2 | unspecified | | +| `tdfir_dry_onccN` | SFZ v2 | unspecified | | +| `tdfir_gain` | SFZ v2 | unspecified | | +| `tdfir_impulse` | SFZ v2 | unspecified | | +| `tdfir_wet` | SFZ v2 | unspecified | | +| `tdfir_wet_onccN` | SFZ v2 | unspecified | | +| `type` | SFZ v2 | string | | +| `vendor_specific` | ARIA | string | | +| `load_mode` | SFZ v2 | integer | | +| `load_start` | SFZ v2 | integer | | +| `load_end` | SFZ v2 | integer | | +| `sample_quality` | SFZ v2 | integer | | +| `image` | SFZ v2 | string | | +| `oscillator` | SFZ v2 | string | | +| `oscillator_detune` | SFZ v2 | unspecified | | +| `oscillator_detune_onccN` | SFZ v2 | unspecified | | +| `oscillator_mode` | SFZ v2 | integer | | +| `oscillator_mod_depth` | SFZ v2 | unspecified | | +| `oscillator_mod_depth_onccN` | SFZ v2 | unspecified | | +| `oscillator_mod_smoothccN` | SFZ v2 | unspecified | | +| `oscillator_multi` | SFZ v2 | integer | | +| `oscillator_phase` | SFZ v2 | float | | +| `oscillator_quality` | SFZ v2 | integer | | +| `oscillator_table_size` | SFZ v2 | unspecified | | diff --git a/document.go b/document.go new file mode 100644 index 0000000..45b3de2 --- /dev/null +++ b/document.go @@ -0,0 +1,179 @@ +// Package sfz reads, validates and writes SFZ instruments: text files that +// map samples to keys, velocities and playback settings. It handles SFZ v1 and +// v2 with the ARIA extensions as data. It doesn't play or load samples. +// +// A [Document] keeps a file exactly as written, including comments, spacing, +// unknown opcodes, and #define and #include directives, so that writing an +// unchanged document gives the same text back. [Document.Flatten] resolves +// directives and header inheritance into regions, and [Flat.Instrument] reads +// those into a typed model. +package sfz + +import ( + "errors" + "io" + "strings" +) + +// Errors that Parse and Flatten wrap. +var ( + // ErrInvalid is returned for text that can't be read as an instrument. + ErrInvalid = errors.New("invalid SFZ") + // ErrIncludeLoop is returned when a file includes itself, directly or not. + ErrIncludeLoop = errors.New("include loop") + // ErrUnresolved is returned, with [IncludesFail], for an include that + // can't be read. + ErrUnresolved = errors.New("unresolved include") +) + +// NodeKind is what a [Node] holds. +type NodeKind int + +// The kinds of node. +const ( + // KindSpace is a run of whitespace. + KindSpace NodeKind = iota + // KindComment is a // or /* */ comment. + KindComment + // KindHeader is a header such as . + KindHeader + // KindOpcode is an opcode and its value, such as lokey=60. + KindOpcode + // KindDefine is a #define directive. + KindDefine + // KindInclude is an #include directive. + KindInclude + // KindText is text that isn't any of the above, such as a directive that + // can't be read. + KindText +) + +// String returns the kind's name. +func (k NodeKind) String() string { + switch k { + case KindSpace: + return "space" + case KindComment: + return "comment" + case KindHeader: + return "header" + case KindOpcode: + return "opcode" + case KindDefine: + return "define" + case KindInclude: + return "include" + } + return "text" +} + +// Node is one piece of a file. The raw text of a file's nodes, in order, is +// the file's text. +type Node struct { + Kind NodeKind + // Raw is the node's text as written. + Raw string + // Name is a header's name without its brackets, as written, an opcode's + // name, or a define's variable name with its $. + Name string + // Value is an opcode's or a define's value without surrounding + // whitespace, or an include's path as written. + Value string + // Line and Col are where the node starts, from 1, with Col in bytes. + Line, Col int + // Resolved is an include's path with its variables substituted, with + // forward slashes, relative to the folder of the main file. + Resolved string + // File is the file an include reads, or nil if it wasn't read. + File *File +} + +// File is one file of a document: the main file or an included one. +type File struct { + // Path is the file's path relative to the folder of the main file, with + // forward slashes. For a file read with [Parse] and no name, it is empty. + Path string + Nodes []*Node +} + +// String returns the file's text. +func (f *File) String() string { + var b strings.Builder + for _, n := range f.Nodes { + b.WriteString(n.Raw) + } + return b.String() +} + +// Document is an instrument as written: a main file and the files it +// includes. +type Document struct { + // Root is the main file. + Root *File + // problems are those found while parsing. + problems []Problem +} + +// WriteTo writes the main file's text to w. An included file is a separate +// [File] with its own text, which stays in the document as an #include. +func (d *Document) WriteTo(w io.Writer) (int64, error) { + n, err := io.WriteString(w, d.Root.String()) + return int64(n), err +} + +// String returns the main file's text. +func (d *Document) String() string { return d.Root.String() } + +// Files returns the main file and the files it includes, in the order they are +// read, each time they are included. +func (d *Document) Files() []*File { + var out []*File + var walk func(f *File) + walk = func(f *File) { + out = append(out, f) + for _, n := range f.Nodes { + if n.Kind == KindInclude && n.File != nil { + walk(n.File) + } + } + } + walk(d.Root) + return out +} + +// Severity is how serious a [Problem] is. +type Severity int + +// The severities. +const ( + // SeverityInfo is something unusual that is allowed. + SeverityInfo Severity = iota + // SeverityWarning is something that is probably a mistake. + SeverityWarning + // SeverityError is something that makes the instrument unreadable. + SeverityError +) + +// String returns the severity's name. +func (s Severity) String() string { + switch s { + case SeverityInfo: + return "info" + case SeverityWarning: + return "warning" + } + return "error" +} + +// Problem is something found in a document. +type Problem struct { + // File is the path of the file, as in [File.Path]. + File string + // Line and Col are where the problem is, from 1. + Line, Col int + Severity Severity + // Code is a short stable name for the kind of problem, such as + // "include.unresolved". + Code string + Msg string +} diff --git a/flatten.go b/flatten.go new file mode 100644 index 0000000..2afeb50 --- /dev/null +++ b/flatten.go @@ -0,0 +1,191 @@ +package sfz + +import "strings" + +// Opcodes are the opcodes set at one point of an instrument, by name. +type Opcodes map[string]string + +// with returns the opcodes of o with those of more on top. +func (o Opcodes) with(more Opcodes) Opcodes { + out := make(Opcodes, len(o)+len(more)) + for k, v := range o { + out[k] = v + } + for k, v := range more { + out[k] = v + } + return out +} + +// FlatRegion is a with the opcodes it inherits. +type FlatRegion struct { + // Opcodes are the region's own and those of the headers above it, and the + // settings that apply to it. + Opcodes Opcodes + // File and Line are where the header is. + File string + Line int +} + +// Flat is an instrument with its directives expanded and its headers resolved. +type Flat struct { + // Control holds the opcodes of the headers. + Control Opcodes + // Curves holds the opcodes of each header. + Curves []Opcodes + // Regions are the regions, in order. + Regions []FlatRegion + // Headers counts the headers that aren't , , , + // , or , by name. + Headers map[string]int +} + +// level is how far down the header hierarchy a header is. +type level int + +const ( + levelGlobal level = iota + levelMaster + levelGroup + levelRegion +) + +// headerLevels are the headers whose opcodes regions inherit. +var headerLevels = map[string]level{ + "global": levelGlobal, + "master": levelMaster, + "group": levelGroup, + "region": levelRegion, +} + +// controlSettings are the opcodes that apply to the regions after +// them. +var controlSettings = []string{"default_path", "note_offset", "octave_offset"} + +// target is where the opcodes after a header go. +type target struct { + ops Opcodes + // region is the header of a , which becomes a region when the next + // header starts or the text ends. + region *Node + file string +} + +// flattener reads a document's nodes in order. +type flattener struct { + flat *Flat + defines map[string]string + // levels are the opcodes set at each level. + levels [levelRegion + 1]Opcodes + into *target +} + +// Flatten returns the instrument with each #include read where it stands, +// each variable replaced by its value as of where it is used, and each +// region given the opcodes of the , and above it. A +// new header clears the ones below it, so a starts with no group +// opcodes. Comments are dropped. An include that wasn't read is skipped. +func (d *Document) Flatten() *Flat { + f := &flattener{ + flat: &Flat{Control: Opcodes{}, Headers: map[string]int{}}, + defines: map[string]string{}, + } + for i := range f.levels { + f.levels[i] = Opcodes{} + } + f.file(d.Root) + f.closeRegion() + return f.flat +} + +func (f *flattener) file(file *File) { + for _, n := range file.Nodes { + switch n.Kind { + case KindDefine: + f.defines[n.Name] = strings.TrimSpace(substitute(f.defines, n.Value)) + case KindInclude: + if n.File != nil { + f.file(n.File) + } + case KindHeader: + f.header(n, file.Path) + case KindOpcode: + if !strings.Contains(n.Name+n.Value, "$") { + f.opcode(n.Name, n.Value) + continue + } + f.expand(n, file.Path, n.Name+"="+n.Value) + case KindText: + if strings.Contains(n.Raw, "$") { + f.expand(n, file.Path, n.Raw) + } + } + } +} + +// expand reads again the text that a node makes once its variables are +// replaced, as a variable's value can hold opcodes or headers. +func (f *flattener) expand(n *Node, file, text string) { + for _, m := range lex(substitute(f.defines, text)) { + switch m.Kind { + case KindHeader: + f.header(&Node{Name: m.Name, Line: n.Line}, file) + case KindOpcode: + f.opcode(m.Name, m.Value) + } + } +} + +// closeRegion adds the region being read, if any. A region takes the +// settings made before it, which later headers don't change. +func (f *flattener) closeRegion() { + if f.into == nil || f.into.region == nil { + return + } + control := Opcodes{} + for _, name := range controlSettings { + if v, ok := f.flat.Control[name]; ok { + control[name] = v + } + } + ops := control.with(f.levels[levelGlobal]).with(f.levels[levelMaster]).with(f.levels[levelGroup]).with(f.into.ops) + f.flat.Regions = append(f.flat.Regions, FlatRegion{Opcodes: ops, File: f.into.file, Line: f.into.region.Line}) +} + +func (f *flattener) header(n *Node, file string) { + f.closeRegion() + name := strings.ToLower(n.Name) + switch name { + case "control": + // A new resets default_path, as ARIA does, but keeps the + // other control settings. + delete(f.flat.Control, "default_path") + f.into = &target{ops: f.flat.Control} + case "curve": + c := Opcodes{} + f.flat.Curves = append(f.flat.Curves, c) + f.into = &target{ops: c} + default: + lvl, ok := headerLevels[name] + if !ok { + f.flat.Headers[name]++ + f.into = &target{ops: Opcodes{}} + return + } + for l := lvl; l <= levelRegion; l++ { + f.levels[l] = Opcodes{} + } + f.into = &target{ops: f.levels[lvl], file: file} + if lvl == levelRegion { + f.into.region = n + } + } +} + +func (f *flattener) opcode(name, value string) { + if f.into == nil { + // Opcodes before any header apply to every region. + f.into = &target{ops: f.levels[levelGlobal]} + } + f.into.ops[name] = value +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..172e1fb --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module code.aneur.in/zampler/sfz + +go 1.25.0 diff --git a/instrument.go b/instrument.go new file mode 100644 index 0000000..76e8566 --- /dev/null +++ b/instrument.go @@ -0,0 +1,1035 @@ +package sfz + +import ( + "cmp" + "fmt" + "math" + "path" + "regexp" + "slices" + "strconv" + "strings" +) + +// Envelope is a region's amplitude envelope. Times are in seconds. +type Envelope struct { + Delay float64 + Attack float64 + Hold float64 + Decay float64 + // Sustain is the level held after the decay, as a percentage. + Sustain float64 + Release float64 +} + +// CurvePoint is how much of its level a velocity plays, from 0 to 1. +type CurvePoint struct { + Velocity int + Gain float64 +} + +// The curves of a crossfade. +const ( + CrossfadePower = "power" + CrossfadeGain = "gain" +) + +// Crossfade fades a region in over one range of keys or velocities and out +// over another. It plays at no level below the start of its fade in and above +// the end of its fade out. A range whose ends are equal doesn't fade. +type Crossfade struct { + FadeInLow, FadeInHigh int + FadeOutLow, FadeOutHigh int + // Curve is power, which keeps the loudness steady through a crossfade + // between regions, or gain, which fades the level in a straight line. + Curve string +} + +// Where a condition's value comes from. +const ( + SourceController = "cc" + SourceBend = "bend" + SourceAftertouch = "aftertouch" + SourcePolyAftertouch = "polyAftertouch" + SourceChannel = "channel" +) + +// Condition limits when a region plays to a source being within a range, which +// includes both ends. A controller, aftertouch and polyphonic aftertouch are +// from 0 to 1, pitch bend from -1 to 1 and a MIDI channel from 1 to 16. +type Condition struct { + Source string + Controller int + Low, High float64 +} + +// Keyswitch limits when a region plays to the keyswitches that have been +// pressed: the last one, the one before it, and keys that are held or aren't. +// A field that isn't set is nil. +type Keyswitch struct { + Last, Previous, Down, Up *int +} + +// The settings a controller moves, as a modulation names them. +const ( + TargetAmplitude = "amplitude" + TargetVolume = "volume" + TargetPan = "pan" + TargetWidth = "width" + TargetTune = "tune" +) + +// CurveStop is a point of a custom curve: the controller at one of the values +// 0 to 127, and the result there. +type CurveStop struct { + At int + Value float64 +} + +// Modulation moves a region's setting as a controller does. The controller +// goes through the curve, and its result, from 0 to 1 or beyond, times Depth +// is added to the setting, or multiplies it for amplitude. Depth is in the +// setting's own units: percent for amplitude, pan and width, dB for volume, +// and cents for tune. +type Modulation struct { + Target string + Controller int + Depth float64 + // Curve is the index of one of SFZ's built-in curves, 0 to 6, when Points + // is empty. + Curve int + Points []CurveStop +} + +// Control is a controller an instrument uses, with the name its SFZ gives it, +// and its starting value from 0 to 1. +type Control struct { + Controller int + Label string + Value float64 +} + +// KeyswitchRange is the keys that are keyswitches, and the one that is down at +// the start, or nil if the instrument has no keyswitch. +type KeyswitchRange struct { + Low, High int + Default *int +} + +// DefaultEnvelope is the envelope of a region that sets none: it plays at full +// level at once, and stops almost at once when its note ends. +var DefaultEnvelope = Envelope{Sustain: 100, Release: defaultRelease} + +// Region is a sample and the notes and velocities that play it, with its +// settings at the instrument's starting controller values. +type Region struct { + // Sample is the sample's path, relative to the folder of the instrument's + // main file, with forward slashes. + Sample string + LowKey int + HighKey int + RootKey int + // RootFromSample says the root note is the one the sample file holds + // (pitch_keycenter=sample), which RootKey doesn't know. + RootFromSample bool + LowVelocity int + HighVelocity int + // KeyTrack is how far each key repitches the sample, in cents: 100 plays + // the keys' pitches, and 0 plays every key at the sample's own. + KeyTrack float64 + // Tune is in cents. + Tune float64 + // Volume is in dB. + Volume float64 + // Pan is from -100, left, to 100, right. + Pan float64 + // Offset is where the sample starts playing, in frames. + Offset int64 + // VelocityTracking is how much velocity sets the level, as a percentage: + // 100 follows it fully, and 0 plays every velocity at full level. + VelocityTracking float64 + // VelocityCurve is how much of its level each velocity plays, through + // straight lines between its points, or nil if the region sets none. Its + // points ascend by velocity, from 0 to 127. + VelocityCurve []CurvePoint + // KeyCrossfade and VelocityCrossfade are nil if the region sets none. + KeyCrossfade *Crossfade + VelocityCrossfade *Crossfade + Envelope Envelope + // Trigger is what starts the region: attack, when a note starts; release, + // when it ends; first; or legato. + Trigger string + // LoopMode is no_loop, one_shot, loop_continuous or loop_sustain, or + // empty to follow the sample file. + LoopMode string + // LoopStart and LoopEnd are frames, or nil to follow the sample file. + LoopStart *int64 + LoopEnd *int64 + // ReleaseDecay is how much quieter a release region plays for each second + // its note was held, in dB. + ReleaseDecay float64 + // SequenceLength and SequencePosition make the region one of a round + // robin: of each SequenceLength notes it matches, it plays the one at + // SequencePosition, counting from 1. + SequenceLength int + SequencePosition int + // LowRandom and HighRandom make the region a random variant: it plays when + // a number drawn for the note, from 0 to 1, is at least LowRandom and less + // than HighRandom. + LowRandom float64 + HighRandom float64 + // Group is the region's choke group, which other regions' OffBy names. + Group int + // OffBy is the group whose notes stop this region while it plays, or nil + // if none does. + OffBy *int + // Polyphony is how many voices the region's group may have playing at + // once, or nil if it sets none. A note past it stops the oldest voice. + Polyphony *int + // Conditions and Keyswitch decide, from the controllers and keyswitches + // when a note starts, whether the region plays. The region plays if every + // condition holds and its keyswitch does. + Conditions []Condition + Keyswitch *Keyswitch + // Modulations are the controllers that move the region's settings, which + // hold their values with no controller. + Modulations []Modulation + // Width is the stereo width in percent, or nil for the sample's own. BendUp + // and BendDown are how far pitch bend moves the pitch at its ends in cents, + // and BendStep the size of its steps, or nil for the SFZ defaults. + Width *float64 + BendUp *float64 + BendDown *float64 + BendStep *float64 + // NotePolyphony is how many voices of the region's group may play the + // same key at once, or nil if it sets none. + NotePolyphony *int + // OffMode is how the region stops when it is stopped by a group or past a + // voice limit: fast, time or normal. + OffMode string + // OffTime is how long a region whose OffMode is time takes to stop, in + // seconds. + OffTime float64 +} + +// Instrument is an SFZ instrument as typed regions, with its settings taken at +// the starting controller values. +type Instrument struct { + Regions []Region + // Unread counts, for each opcode or header the typed model has no field + // for, the regions that have it, or how often a header appears. + Unread map[string]int + // Skipped counts the regions that have no typed region, by why. + Skipped map[string]int + // Controls are the controllers that the instrument names, sets or uses. + Controls []Control + // Keyswitches are its keyswitch keys, or nil if it has none. + Keyswitches *KeyswitchRange +} + +// Reasons a region is skipped: the typed model has no region for it. +const ( + SkippedNoSample = "no sample file" + SkippedGenerated = "a generated sound" + SkippedByCC = "started by a controller" + SkippedNotKeys = "not played by keys" +) + +// Region defaults that SFZ gives. +const ( + defaultRootKey = 60 + // defaultLowVelocity is 1, as velocity 0 is a note-off. + defaultLowVelocity = 1 + // defaultRelease is in seconds. + defaultRelease = 0.001 + defaultTrigger = "attack" + // defaultOffMode is how a region stops when its group's voice limit or + // another group stops it, and defaultOffTime how long that takes when the + // mode is time, in seconds. + defaultOffMode = "fast" + defaultOffTime = 0.006 +) + +// Controllers above 127 that ARIA defines, which depend on the note: its +// velocity, its key, and whether it is held. +const ( + extendedVelocityCC = 131 + extendedKeyCC = 133 + extendedGateCC = 134 +) + +// Instrument reads the flattened instrument into the typed model. +func (f *Flat) Instrument() *Instrument { + inst := &Instrument{Unread: map[string]int{}, Skipped: map[string]int{}} + for h, n := range f.Headers { + inst.Unread["<"+h+">"] += n + } + curves, stops := readCurves(f.Curves) + e := evaluator{cc: controllerValues(f.Control), curves: curves, stops: stops} + regions := make([]Opcodes, len(f.Regions)) + for i, fr := range f.Regions { + ops := fr.Opcodes + regions[i] = ops + r, reason := e.region(ops) + if reason != "" { + inst.Skipped[reason]++ + continue + } + for name := range ops { + if !handled(name) { + inst.Unread[name]++ + } + } + inst.Regions = append(inst.Regions, r) + } + inst.Controls = e.controls(f.Control, inst.Regions) + inst.Keyswitches = keyswitchRange(regions) + return inst +} + +// maxControls is the most controllers an instrument has, one for each. +const maxControls = 128 + +// controls returns the controllers the instrument names with label_ccN, sets +// with set_ccN or set_hdccN, or has regions that use, by number, each with its +// starting value. +func (e evaluator) controls(control Opcodes, regions []Region) []Control { + labels := map[int]string{} + used := map[int]bool{} + for name, v := range control { + m := ccRE.FindStringSubmatch(name) + if m == nil { + continue + } + n, _ := strconv.Atoi(m[2]) + switch m[1] { + case "label_cc": + labels[n] = strings.TrimSpace(v) + used[n] = true + case "set_cc", "set_hdcc": + used[n] = true + } + } + for _, r := range regions { + for _, c := range r.Conditions { + if c.Source == SourceController { + used[c.Controller] = true + } + } + for _, m := range r.Modulations { + used[m.Controller] = true + } + } + var out []Control + for n := 0; n < maxControls; n++ { + if used[n] { + out = append(out, Control{Controller: n, Label: labels[n], Value: e.cc[n]}) + } + } + return out +} + +// keyswitchRange returns the keys that are keyswitches and the one that is down +// at the start, or nil if no region uses a keyswitch. Without sw_lokey and +// sw_hikey, they are the keys that the regions name. +func keyswitchRange(regions []Opcodes) *KeyswitchRange { + var r *KeyswitchRange + for _, ops := range regions { + shift := keyShift(ops) + low, lowOK := parseNote(ops["sw_lokey"]) + high, highOK := parseNote(ops["sw_hikey"]) + var keys []int + for _, name := range []string{"sw_last", "sw_previous", "sw_down", "sw_up"} { + if n, ok := parseNote(ops[name]); ok { + keys = append(keys, n+shift) + } + } + if !lowOK && !highOK && len(keys) == 0 { + continue + } + if r == nil { + r = &KeyswitchRange{Low: 127, High: 0} + } + if lowOK && highOK { + keys = append(keys, low+shift, high+shift) + } + for _, k := range keys { + r.Low, r.High = min(r.Low, k), max(r.High, k) + } + } + if r != nil { + r.Low, r.High = max(0, r.Low), min(127, r.High) + if d := defaultKeyswitch(regions); d >= 0 { + r.Default = &d + } + } + return r +} + +// ccRE reads a controller number from the end of an opcode, such as the 64 of +// locc64. +var ccRE = regexp.MustCompile(`^(.*?)(\d+)$`) + +// defaultControllers are the controllers that start somewhere other than 0 +// unless set_cc or set_hdcc say otherwise, as sfizz starts them: volume at +// 100, pan in the middle, and expression at full. +var defaultControllers = map[int]float64{7: 100.0 / 127, 10: 0.5, 11: 1} + +// controllerValues returns the starting values of the controllers, from 0 to +// 1: those that set_cc and set_hdcc give, then defaultControllers, then 0. +func controllerValues(control Opcodes) map[int]float64 { + values := map[int]float64{} + for n, v := range defaultControllers { + values[n] = v + } + for name, v := range control { + m := ccRE.FindStringSubmatch(name) + if m == nil { + continue + } + n, _ := strconv.Atoi(m[2]) + f, ok := parseNumber(v) + if !ok { + continue + } + switch m[1] { + case "set_cc": + values[n] = clamp(f/127, 0, 1) + case "set_hdcc": + values[n] = clamp(f, 0, 1) + } + } + return values +} + +// defaultKeyswitch returns the keyswitch that is active before any is +// pressed: the first sw_default, or failing that the first sw_last, or -1 +// if the instrument has no keyswitches. Without an sw_default, SFZ players +// play no keyswitched region until a keyswitch is pressed; a host that can't +// press one can use the first articulation instead. +func defaultKeyswitch(regions []Opcodes) int { + for _, ops := range regions { + if n, ok := parseNote(ops["sw_default"]); ok { + return n + keyShift(ops) + } + } + for _, ops := range regions { + if n, ok := parseNote(ops["sw_last"]); ok { + return n + keyShift(ops) + } + } + return -1 +} + +// keyShift is how far the header's note_offset and octave_offset +// move a region's key numbers. +func keyShift(ops Opcodes) int { + shift := 0 + if n, ok := parseNumber(ops["note_offset"]); ok { + shift += int(n) + } + if n, ok := parseNumber(ops["octave_offset"]); ok { + shift += 12 * int(n) + } + return shift +} + +// evaluator turns regions' Opcodes into regions. +type evaluator struct { + cc map[int]float64 + curves map[int]curve + // stops are the points of the custom curves, by index. + stops map[int][]CurveStop +} + +// region returns the region the opcodes describe, or why it is skipped. +func (e evaluator) region(ops Opcodes) (Region, string) { + sample := strings.TrimSpace(ops["sample"]) + switch { + case sample == "": + return Region{}, SkippedNoSample + case strings.HasPrefix(sample, "*"): + return Region{}, SkippedGenerated + } + for name := range ops { + if strings.HasPrefix(name, "on_lo") || strings.HasPrefix(name, "on_hi") { + return Region{}, SkippedByCC + } + } + shift := keyShift(ops) + + r := Region{ + Sample: samplePath(ops["default_path"], sample), + LowKey: 0, + HighKey: 127, + RootKey: defaultRootKey, + LowVelocity: defaultLowVelocity, + HighVelocity: 127, + KeyTrack: 100, + VelocityTracking: 100, + Envelope: DefaultEnvelope, + Trigger: defaultTrigger, + SequenceLength: 1, + SequencePosition: 1, + HighRandom: 1, + } + note := func(name string, into *int) { + if n, ok := parseNote(ops[name]); ok { + *into = n + shift + } + } + note("key", &r.LowKey) + note("key", &r.HighKey) + note("key", &r.RootKey) + note("lokey", &r.LowKey) + note("hikey", &r.HighKey) + // A root note of sample is the file's, which only the host can read, and + // which sfizz keeps over key. + if strings.EqualFold(strings.TrimSpace(ops["pitch_keycenter"]), "sample") { + r.RootFromSample = true + } else { + note("pitch_keycenter", &r.RootKey) + } + if r.HighKey < 0 || r.LowKey > 127 || r.LowKey > r.HighKey { + return Region{}, SkippedNotKeys + } + r.LowKey, r.HighKey = max(r.LowKey, 0), min(r.HighKey, 127) + r.RootKey = int(clamp(float64(r.RootKey), 0, 127)) + if n, ok := parseNumber(ops["lovel"]); ok { + r.LowVelocity = int(clamp(n, 0, 127)) + } + if n, ok := parseNumber(ops["hivel"]); ok { + r.HighVelocity = int(clamp(n, 0, 127)) + } + + // Controllers that depend on the note are taken at the region's root note + // and the middle of its velocities. + cc := func(n int) float64 { + switch n { + case extendedVelocityCC: + return float64(r.LowVelocity+r.HighVelocity) / 2 / 127 + case extendedKeyCC: + return float64(r.RootKey) / 127 + case extendedGateCC: + return 1 + } + return e.cc[n] + } + // A setting that the controllers move while a note plays has only what the + // note itself moves it by here, which is the controllers above 127, and the + // others are left to its modulations. The rest are taken at the starting + // controller values. + own := func(target string, base float64) float64 { + if v, ok := parseNumber(ops[target]); ok { + base = v + } + return base + e.modulation(ops, target, cc, extendedOnly) + } + value := func(target string, base float64) float64 { + if v, ok := parseNumber(ops[target]); ok { + base = v + } + return base + e.modulation(ops, target, cc, 0) + } + + r.KeyTrack = value("pitch_keytrack", 100) + r.Tune = own("tune", 0) + e.modulation(ops, "pitch", cc, extendedOnly) + if v, ok := parseNumber(ops["pitch"]); ok { + r.Tune += v + } + if v, ok := parseNumber(ops["transpose"]); ok { + r.Tune += 100 * v + } + r.Volume = own("volume", 0) + e.modulation(ops, "gain", cc, extendedOnly) + for _, name := range []string{"group_volume", "master_volume", "global_volume"} { + if v, ok := parseNumber(ops[name]); ok { + r.Volume += v + } + } + amplitude := e.amplitude(ops, cc) + if amplitude <= 0 { + r.Volume = minVolume + } else { + r.Volume = max(minVolume, r.Volume+20*math.Log10(amplitude)) + } + r.Pan = clamp(own("pan", 0), -100, 100) + if _, ok := parseNumber(ops["width"]); ok || e.hasModulation(ops, "width") { + r.Width = ptr(clamp(own("width", 100), -100, 100)) + } + r.BendUp = number(ops, "bend_up") + r.BendDown = number(ops, "bend_down") + r.BendStep = number(ops, "bend_step") + r.Conditions = conditions(ops) + r.Keyswitch = keyswitch(ops, shift) + r.Modulations = e.modulations(ops) + r.Offset = int64(max(0, value("offset", 0))) + r.VelocityTracking = clamp(value("amp_veltrack", 100), -100, 100) + r.VelocityCurve = velocityCurve(ops) + r.KeyCrossfade = crossfade(ops, "key", shift) + r.VelocityCrossfade = crossfade(ops, "vel", 0) + r.Envelope = Envelope{ + Delay: max(0, value("ampeg_delay", 0)), + Attack: max(0, value("ampeg_attack", 0)), + Hold: max(0, value("ampeg_hold", 0)), + Decay: max(0, value("ampeg_decay", 0)), + Sustain: clamp(value("ampeg_sustain", 100), 0, 100), + Release: max(0, value("ampeg_release", defaultRelease)), + } + if t := strings.TrimSpace(ops["trigger"]); t != "" { + r.Trigger = t + } + r.LoopMode = strings.TrimSpace(firstOf(ops, "loop_mode", "loopmode")) + r.LoopStart = frames(firstOf(ops, "loop_start", "loopstart")) + r.LoopEnd = frames(firstOf(ops, "loop_end", "loopend")) + r.ReleaseDecay = max(0, value("rt_decay", 0)) + + // A seq_length or seq_position below 1 plays as 1, as sfizz plays it. + if n, ok := parseNumber(ops["seq_length"]); ok { + r.SequenceLength = max(1, int(n)) + } + if n, ok := parseNumber(ops["seq_position"]); ok { + r.SequencePosition = max(1, int(n)) + } + if n, ok := parseNumber(ops["lorand"]); ok { + r.LowRandom = clamp(n, 0, 1) + } + if n, ok := parseNumber(ops["hirand"]); ok { + r.HighRandom = clamp(n, 0, 1) + } + // polyphony_group is SFZ v2's name for group. + if n, ok := parseNumber(firstOf(ops, "group", "polyphony_group")); ok { + r.Group = int(n) + } + if n, ok := parseNumber(ops["off_by"]); ok { + g := int(n) + r.OffBy = &g + } + r.Polyphony = voiceLimit(ops["polyphony"]) + r.NotePolyphony = voiceLimit(ops["note_polyphony"]) + r.OffMode = defaultOffMode + switch mode := strings.ToLower(strings.TrimSpace(ops["off_mode"])); mode { + case "fast", "time", "normal": + r.OffMode = mode + } + r.OffTime = defaultOffTime + if n, ok := parseNumber(ops["off_time"]); ok && n >= 0 { + r.OffTime = n + } + return r, "" +} + +// velocityCurveRE reads the velocity of an amp_velcurve_N opcode. +var velocityCurveRE = regexp.MustCompile(`^amp_velcurve_(\d{1,3})$`) + +// velocityCurve returns the points of a region's amp_velcurve_N Opcodes, with +// the ends the curve doesn't set at no level for velocity 0 and the full +// level for 127, or nil if the region sets none. +func velocityCurve(ops Opcodes) []CurvePoint { + points := map[int]float64{} + for name, v := range ops { + m := velocityCurveRE.FindStringSubmatch(name) + if m == nil { + continue + } + at, _ := strconv.Atoi(m[1]) + if gain, ok := parseNumber(v); ok && at <= 127 { + points[at] = clamp(gain, 0, 1) + } + } + if len(points) == 0 { + return nil + } + if _, ok := points[0]; !ok { + points[0] = 0 + } + if _, ok := points[127]; !ok { + points[127] = 1 + } + out := make([]CurvePoint, 0, len(points)) + for at, gain := range points { + out = append(out, CurvePoint{Velocity: at, Gain: gain}) + } + slices.SortFunc(out, func(a, b CurvePoint) int { return cmp.Compare(a.Velocity, b.Velocity) }) + return out +} + +// crossfade returns the crossfade of a region's xfin_ and xfout_ Opcodes over +// keys, or over velocities for which is "vel", or nil if it sets none. A +// fade in that isn't given starts and ends at 0, and a fade out at 127. +// shift moves keys, as the header's offsets do. +func crossfade(ops Opcodes, which string, shift int) *Crossfade { + read := func(name string, fallback int) (int, bool) { + v, ok := ops[name] + if !ok { + return fallback, false + } + var n int + if which == "key" { + if n, ok = parseNote(v); ok { + n += shift + } + } else if f, isNumber := parseNumber(v); isNumber { + n, ok = int(f), true + } + if !ok { + return fallback, false + } + return int(clamp(float64(n), 0, 127)), true + } + c := &Crossfade{Curve: CrossfadePower} + var set [4]bool + c.FadeInLow, set[0] = read("xfin_lo"+which, 0) + c.FadeInHigh, set[1] = read("xfin_hi"+which, 0) + c.FadeOutLow, set[2] = read("xfout_lo"+which, 127) + c.FadeOutHigh, set[3] = read("xfout_hi"+which, 127) + if !set[0] && !set[1] && !set[2] && !set[3] { + return nil + } + if strings.EqualFold(strings.TrimSpace(ops["xf_"+which+"curve"]), "gain") { + c.Curve = CrossfadeGain + } + return c +} + +// voiceLimit reads a number of voices, which is at least 1, or nil if v isn't +// one. +func voiceLimit(v string) *int { + n, ok := parseNumber(v) + if !ok || n < 1 { + return nil + } + limit := int(n) + return &limit +} + +// minVolume is the quietest a region plays, in dB, which stands for silence. +const minVolume = -144 + +// hicc's high end includes the whole of value N, as a controller at 0.5 is +// 63.5 out of 127 and so within hicc63, as sfizz compares them. So the range +// is made to end just below value N + 1, unless N is the top. +const topEpsilon = 1e-9 + +// controllerBounds are the Opcodes that limit a source that isn't a numbered +// controller to a range: the lowest and highest, the range they run over, and +// what they default to. +var controllerBounds = []struct { + source, low, high string + scale float64 + min, max float64 +}{ + {SourceChannel, "lochan", "hichan", 1, 1, 16}, + {SourceBend, "lobend", "hibend", 8192, -1, 1}, + {SourceAftertouch, "lochanaft", "hichanaft", 127, 0, 1}, + {SourcePolyAftertouch, "lopolyaft", "hipolyaft", 127, 0, 1}, +} + +// conditions returns the ranges a region's locc, hicc, lohdcc and hihdcc, and +// its channel, pitch bend and aftertouch Opcodes limit it to. Controllers +// above 127, which belong to the note, are left out. +func conditions(ops Opcodes) []Condition { + ranges := map[int]*Condition{} + for name, v := range ops { + m := ccRE.FindStringSubmatch(name) + if m == nil { + continue + } + n, _ := strconv.Atoi(m[2]) + limit, ok := parseNumber(v) + if !ok || n >= extendedVelocityCC { + continue + } + c := ranges[n] + if c == nil { + c = &Condition{Source: SourceController, Controller: n, Low: 0, High: 1} + } + switch m[1] { + case "locc": + c.Low = clamp(limit/127, 0, 1) + case "hicc": + c.High = 1 + if limit < 127 { + c.High = clamp((limit+1)/127-topEpsilon, 0, 1) + } + case "lohdcc": + c.Low = clamp(limit, 0, 1) + case "hihdcc": + c.High = clamp(limit, 0, 1) + default: + continue + } + ranges[n] = c + } + var out []Condition + for _, b := range controllerBounds { + lo, loOK := parseNumber(ops[b.low]) + hi, hiOK := parseNumber(ops[b.high]) + if !loOK && !hiOK { + continue + } + c := Condition{Source: b.source, Low: b.min, High: b.max} + if loOK { + c.Low = clamp(lo/b.scale, b.min, b.max) + } + if hiOK { + c.High = clamp(hi/b.scale, b.min, b.max) + } + out = append(out, c) + } + for n := 0; n < extendedVelocityCC; n++ { + if c := ranges[n]; c != nil { + out = append(out, *c) + } + } + return out +} + +// keyswitch returns the keyswitches a region needs, or nil if it has none. +func keyswitch(ops Opcodes, shift int) *Keyswitch { + var k Keyswitch + found := false + for name, into := range map[string]**int{"sw_last": &k.Last, "sw_previous": &k.Previous, "sw_down": &k.Down, "sw_up": &k.Up} { + if n, ok := parseNote(ops[name]); ok { + key := n + shift + *into = &key + found = true + } + } + if !found { + return nil + } + return &k +} + +// number returns the number an opcode sets, or nil if it doesn't set one. +func number(ops Opcodes, name string) *float64 { + if v, ok := parseNumber(ops[name]); ok { + return &v + } + return nil +} + +func ptr[T any](v T) *T { return &v } + +// modulatedBy are the settings controllers move while a note plays, with the +// Opcodes that set each. +var modulatedBy = []struct { + target string + Opcodes []string +}{ + {TargetAmplitude, []string{"amplitude"}}, + {TargetVolume, []string{"volume", "gain"}}, + {TargetPan, []string{"pan"}}, + {TargetWidth, []string{"width"}}, + {TargetTune, []string{"tune", "pitch"}}, +} + +// hasModulation reports whether a controller moves a target. +func (e evaluator) hasModulation(ops Opcodes, target string) bool { + return len(e.modulations(ops, target)) > 0 +} + +// modulations returns the controller modulations of a region's settings, which +// are the controllers 0 to 127, or only those of the targets named. They are in +// the order of the settings, then of the controllers. +func (e evaluator) modulations(ops Opcodes, only ...string) []Modulation { + var out []Modulation + for _, set := range modulatedBy { + if len(only) > 0 && !slices.Contains(only, set.target) { + continue + } + for _, opcode := range set.Opcodes { + for name, v := range ops { + n, ok := modulator(name, opcode) + depth, isNumber := parseNumber(v) + if !ok || !isNumber || n >= extendedOnly { + continue + } + m := Modulation{Target: set.target, Controller: n, Depth: depth, Curve: e.curveIndex(ops, opcode, n)} + if stops, ok := e.stops[m.Curve]; ok { + m.Points = stops + } + out = append(out, m) + } + } + } + order := func(t string) int { + for i, set := range modulatedBy { + if set.target == t { + return i + } + } + return len(modulatedBy) + } + slices.SortFunc(out, func(a, b Modulation) int { + return cmp.Or(order(a.Target)-order(b.Target), a.Controller-b.Controller, cmp.Compare(a.Depth, b.Depth)) + }) + return out +} + +// modulation returns how much the controllers from the number given up move an +// opcode from its own value: the sum of each target_onccN depth, or its SFZ v1 +// form targetccN, shaped by target_curveccN at the controller's value. +func (e evaluator) modulation(ops Opcodes, target string, cc func(int) float64, from int) float64 { + total := 0.0 + for name, v := range ops { + n, ok := modulator(name, target) + if !ok || n < from { + continue + } + depth, ok := parseNumber(v) + if !ok { + continue + } + total += depth * e.shape(ops, target, n, cc(n)) + } + return total +} + +// amplitude returns the region's amplitude as a factor: amplitude and the +// global, master and group amplitudes are percentages that multiply, and so +// does each amplitude_oncc of the controllers above 127. +func (e evaluator) amplitude(ops Opcodes, cc func(int) float64) float64 { + a := 1.0 + for _, name := range []string{"amplitude", "global_amplitude", "master_amplitude", "group_amplitude"} { + if v, ok := parseNumber(ops[name]); ok { + a *= v / 100 + } + } + for name, v := range ops { + n, ok := modulator(name, "amplitude") + if !ok || n < extendedOnly { + continue + } + if depth, ok := parseNumber(v); ok { + a *= depth / 100 * e.shape(ops, "amplitude", n, cc(n)) + } + } + return a +} + +// extendedOnly is the lowest of the controllers above 127, which belong to the +// note: its velocity, its key and whether it is held. A region takes the +// modulation of these at its root note and the middle of its velocities, as it +// can't follow them, and leaves the numbered controllers to be applied when a +// note plays. +const extendedOnly = 128 + +// shape returns a controller's value through the curve the region gives it +// for the target, or straight through if it gives none. +func (e evaluator) shape(ops Opcodes, target string, n int, x float64) float64 { + c, ok := e.curves[e.curveIndex(ops, target, n)] + if !ok { + c = builtinCurves[0] + } + return c(x) +} + +// curveIndex returns the curve a region gives a controller's modulation of a +// target, or 0, the straight one, if it gives none or the curve doesn't exist. +func (e evaluator) curveIndex(ops Opcodes, target string, n int) int { + if v, ok := parseNumber(ops[fmt.Sprintf("%s_curvecc%d", target, n)]); ok { + if _, exists := e.curves[int(v)]; exists { + return int(v) + } + } + return 0 +} + +// modulator reports whether an opcode is a controller modulation of the +// target, and of which controller: target_onccN, or targetccN or target_ccN +// in SFZ v1. +func modulator(name, target string) (int, bool) { + rest, ok := strings.CutPrefix(name, target) + if !ok { + return 0, false + } + for _, prefix := range []string{"_oncc", "cc", "_cc"} { + if digits, ok := strings.CutPrefix(rest, prefix); ok { + n, err := strconv.Atoi(digits) + return n, err == nil + } + } + return 0, false +} + +// samplePath joins a region's default_path and sample into a clean relative +// path with forward slashes. +func samplePath(defaultPath, sample string) string { + p := strings.ReplaceAll(strings.TrimSpace(defaultPath)+sample, `\`, "/") + return strings.TrimPrefix(path.Clean(p), "./") +} + +// firstOf returns the value of the first of the Opcodes that is set. +func firstOf(ops Opcodes, names ...string) string { + for _, n := range names { + if v, ok := ops[n]; ok { + return v + } + } + return "" +} + +// frames reads a sample position in frames, or returns nil if v isn't one. +func frames(v string) *int64 { + n, ok := parseNumber(v) + if !ok || n < 0 { + return nil + } + f := int64(n) + return &f +} + +func clamp(v, lo, hi float64) float64 { + return math.Min(hi, math.Max(lo, v)) +} + +// handledNames are the opcodes the typed model reads, or uses to choose +// regions. +var handledNames = map[string]bool{ + "sample": true, "default_path": true, "note_offset": true, "octave_offset": true, + "key": true, "lokey": true, "hikey": true, "pitch_keycenter": true, "lovel": true, "hivel": true, + "pitch_keytrack": true, "tune": true, "pitch": true, "transpose": true, + "volume": true, "group_volume": true, "master_volume": true, "global_volume": true, + "amplitude": true, "global_amplitude": true, "master_amplitude": true, "group_amplitude": true, + "pan": true, "offset": true, "amp_veltrack": true, + "ampeg_delay": true, "ampeg_attack": true, "ampeg_hold": true, "ampeg_decay": true, "ampeg_sustain": true, "ampeg_release": true, + "trigger": true, "loop_mode": true, "loopmode": true, "loop_start": true, "loopstart": true, "loop_end": true, "loopend": true, + "rt_decay": true, "sw_lokey": true, "sw_hikey": true, "sw_last": true, "sw_default": true, + "lorand": true, "hirand": true, "seq_position": true, "seq_length": true, + "xfin_lokey": true, "xfin_hikey": true, "xfout_lokey": true, "xfout_hikey": true, "xf_keycurve": true, + "xfin_lovel": true, "xfin_hivel": true, "xfout_lovel": true, "xfout_hivel": true, "xf_velcurve": true, + "group": true, "polyphony_group": true, "off_by": true, + "polyphony": true, "note_polyphony": true, "off_mode": true, "off_time": true, + "sw_previous": true, "sw_down": true, "sw_up": true, "width": true, "bend_up": true, "bend_down": true, "bend_step": true, + "lochan": true, "hichan": true, "lobend": true, "hibend": true, "lochanaft": true, "hichanaft": true, "lopolyaft": true, "hipolyaft": true, +} + +// modulatedTargets are the opcodes whose controller modulation the typed model +// reads. +var modulatedTargets = []string{ + "pitch_keytrack", "tune", "pitch", "volume", "gain", "amplitude", "pan", "width", "offset", "amp_veltrack", + "ampeg_delay", "ampeg_attack", "ampeg_hold", "ampeg_decay", "ampeg_sustain", "ampeg_release", "rt_decay", +} + +// handledRE matches the opcodes the typed model reads that carry a controller +// number or only name things. +var handledRE = regexp.MustCompile(`^(?:(?:lo|hi)(?:hd)?cc\d+|set_(?:hd)?cc\d+|label_cc\d+|amp_velcurve_\d+|[a-z_]*_label)$`) + +// handled reports whether the typed model reads an opcode. +func handled(name string) bool { + if handledNames[name] || handledRE.MatchString(name) { + return true + } + for _, target := range modulatedTargets { + if _, ok := modulator(name, target); ok { + return true + } + if rest, ok := strings.CutPrefix(name, target+"_curvecc"); ok { + if _, err := strconv.Atoi(rest); err == nil { + return true + } + } + } + return false +} diff --git a/internal/gen/README.md b/internal/gen/README.md new file mode 100644 index 0000000..74662cb --- /dev/null +++ b/internal/gen/README.md @@ -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`. diff --git a/internal/gen/go.mod b/internal/gen/go.mod new file mode 100644 index 0000000..408b2f0 --- /dev/null +++ b/internal/gen/go.mod @@ -0,0 +1,5 @@ +module code.aneur.in/zampler/sfz/internal/gen + +go 1.25.0 + +require gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/internal/gen/go.sum b/internal/gen/go.sum new file mode 100644 index 0000000..4bc0337 --- /dev/null +++ b/internal/gen/go.sum @@ -0,0 +1,3 @@ +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/gen/main.go b/internal/gen/main.go new file mode 100644 index 0000000..e77961f --- /dev/null +++ b/internal/gen/main.go @@ -0,0 +1,284 @@ +// Command gen turns the SFZ format's syntax data into the sfz package's +// opcode registry. +// +// Usage: go run . -in syntax.yml -out ../../registry_data.go +package main + +import ( + "bytes" + "flag" + "fmt" + "go/format" + "html" + "log" + "os" + "regexp" + "sort" + "strconv" + "strings" + + "gopkg.in/yaml.v3" +) + +// entry is an opcode as it goes into the registry. +type entry struct { + name string + aliases []string + version string + deprecated bool + category string + typeName string + min, max *float64 + def string + unit string + options []string + description string +} + +// notes are the integer opcodes that also take a note name. +var notes = regexp.MustCompile(`^(?:key|(?:lo|hi)key|pitch_keycenter|sw_(?:lokey|hikey|last|previous|down|up|default)|xf(?:in|out)_(?:lo|hi)key|(?:lo|hi)_?key)$`) + +var tags = regexp.MustCompile(`<[^>]*>`) + +// text turns the data's HTML snippets into plain text. +func text(v any) string { + s, _ := v.(string) + s = html.UnescapeString(tags.ReplaceAllString(s, "")) + return strings.Join(strings.Fields(s), " ") +} + +func str(v any) string { + if v == nil { + return "" + } + return fmt.Sprint(v) +} + +func number(v any) *float64 { + switch n := v.(type) { + case int: + f := float64(n) + return &f + case float64: + return &n + } + return nil +} + +func asMap(v any) map[string]any { + m, _ := v.(map[string]any) + return m +} + +func asList(v any) []any { + l, _ := v.([]any) + return l +} + +type generator struct { + entries []*entry + byName map[string]*entry +} + +// add reads an opcode of the data, and its aliases and modulations, into +// entries. inherit is the opcode whose value an opcode without one takes. +func (g *generator) add(x map[string]any, category string, inherit *entry) *entry { + name := str(x["name"]) + if name == "" || x["macro"] == true { + return nil + } + e := &entry{name: name, version: str(x["version"]), category: category} + e.deprecated, _ = x["deprecated"].(bool) + e.description = text(x["short_description"]) + if v := asMap(x["value"]); v != nil { + e.typeName = str(v["type_name"]) + e.min, e.max = number(v["min"]), number(v["max"]) + e.def, e.unit = text(v["default"]), str(v["unit"]) + for _, o := range asList(v["options"]) { + e.options = append(e.options, str(asMap(o)["name"])) + } + } else if inherit != nil { + e.typeName, e.min, e.max, e.def, e.unit, e.options = inherit.typeName, inherit.min, inherit.max, inherit.def, inherit.unit, inherit.options + if e.description == "" { + e.description = inherit.description + } + } + if e.version == "" && inherit != nil { + e.version = inherit.version + } + g.entries = append(g.entries, e) + + var independent []map[string]any + for _, a := range asList(x["alias"]) { + am := asMap(a) + if am == nil { + continue + } + // An alias with modulations of its own is another opcode, as cutoff2 is. + if am["modulation"] != nil { + independent = append(independent, am) + continue + } + e.aliases = append(e.aliases, str(am["name"])) + } + g.modulations(x, e, category, e) + for _, am := range independent { + g.addAlias(am, e, category) + } + return e +} + +// addAlias reads an alias that is an opcode in its own right, whose +// modulations take their values from those of the opcode it copies. +func (g *generator) addAlias(am map[string]any, parent *entry, category string) { + own := &entry{name: str(am["name"]), version: str(am["version"]), category: category} + own.typeName, own.min, own.max, own.def, own.unit, own.options, own.description = parent.typeName, parent.min, parent.max, parent.def, parent.unit, parent.options, parent.description + if own.version == "" { + own.version = parent.version + } + own.deprecated, _ = am["deprecated"].(bool) + g.entries = append(g.entries, own) + g.modulations(am, own, category, parent) +} + +// modulations reads the modulations that an opcode lists. A modulation +// without a value takes that of the one named like it under parent. +func (g *generator) modulations(x map[string]any, e *entry, category string, parent *entry) { + mods := asMap(x["modulation"]) + keys := make([]string, 0, len(mods)) + for k := range mods { + keys = append(keys, k) + } + sort.Strings(keys) + for _, k := range keys { + for _, item := range asList(mods[k]) { + m := asMap(item) + if m == nil { + continue + } + var inherit *entry + if parent != e { + swapped := strings.Replace(str(m["name"]), e.name, parent.name, 1) + for _, c := range g.entries { + if c.name == swapped { + inherit = c + } + } + } + me := g.add(m, category, inherit) + if me != nil && me.version == "" { + me.version = e.version + } + } + } +} + +func (g *generator) walk(o any, category string) { + switch v := o.(type) { + case map[string]any: + if n := str(v["name"]); n != "" && v["opcodes"] != nil && category == "" { + category = n + } + for _, x := range asList(v["opcodes"]) { + if m := asMap(x); m != nil { + g.add(m, category, nil) + } + } + for k, c := range v { + if k != "opcodes" { + g.walk(c, category) + } + } + case []any: + for _, c := range v { + cat := category + if m := asMap(c); m != nil { + if n := str(m["name"]); n != "" && (m["opcodes"] != nil || m["types"] != nil) { + if category == "" { + cat = n + } else if m["opcodes"] != nil { + cat = category + " / " + n + } + } + } + g.walk(c, cat) + } + } +} + +func quote(s string) string { return strconv.Quote(s) } + +func fl(p *float64) string { + if p == nil { + return "nil" + } + return "ptr(float64(" + strconv.FormatFloat(*p, 'g', -1, 64) + "))" +} + +func main() { + in := flag.String("in", "syntax.yml", "the syntax data") + out := flag.String("out", "registry_data.go", "the Go file to write") + flag.Parse() + + data, err := os.ReadFile(*in) + if err != nil { + log.Fatal(err) + } + var doc map[string]any + if err := yaml.Unmarshal(data, &doc); err != nil { + log.Fatal(err) + } + + g := &generator{byName: map[string]*entry{}} + g.walk(doc["categories"], "") + + var b bytes.Buffer + b.WriteString("// Code generated by internal/gen from the SFZ format's syntax data; DO NOT EDIT.\n\npackage sfz\n\n") + b.WriteString("// headerData are the headers of the format.\nvar headerData = []HeaderInfo{\n") + for _, h := range asList(doc["headers"]) { + m := asMap(h) + dep, _ := m["deprecated"].(bool) + fmt.Fprintf(&b, "\t{Name: %s, Version: %s, Deprecated: %t, Description: %s},\n", + quote(str(m["name"])), quote(str(m["version"])), dep, quote(text(m["short_description"]))) + } + b.WriteString("}\n\n// opcodeData are the opcodes of the format, with their aliases.\nvar opcodeData = []OpcodeInfo{\n") + seen := map[string]bool{} + count := 0 + for _, e := range g.entries { + if seen[e.name] { + log.Printf("duplicate opcode %s", e.name) + continue + } + seen[e.name] = true + count++ + typ := map[string]string{"integer": "TypeInteger", "float": "TypeFloat", "string": "TypeString"}[e.typeName] + if typ == "" { + typ = "TypeUnspecified" + } + note := e.typeName == "integer" && notes.MatchString(e.name) + fmt.Fprintf(&b, "\t{Name: %s, Aliases: %s, Version: %s, Deprecated: %t, Category: %s, Type: %s, Min: %s, Max: %s, Default: %s, Unit: %s, Options: %s, Note: %t, Description: %s},\n", + quote(e.name), strs(e.aliases), quote(e.version), e.deprecated, quote(e.category), typ, fl(e.min), fl(e.max), + quote(e.def), quote(e.unit), strs(e.options), note, quote(e.description)) + } + b.WriteString("}\n") + src, err := format.Source(b.Bytes()) + if err != nil { + os.WriteFile(*out, b.Bytes(), 0o644) + log.Fatal(err) + } + if err := os.WriteFile(*out, src, 0o644); err != nil { + log.Fatal(err) + } + log.Printf("wrote %d opcodes", count) +} + +func strs(s []string) string { + if len(s) == 0 { + return "nil" + } + q := make([]string, len(s)) + for i, v := range s { + q[i] = quote(v) + } + return "[]string{" + strings.Join(q, ", ") + "}" +} diff --git a/internal/gen/syntax.yml b/internal/gen/syntax.yml new file mode 100644 index 0000000..5c469a9 --- /dev/null +++ b/internal/gen/syntax.yml @@ -0,0 +1,6032 @@ +format: 2 +versions: ["ARIA", "Calfbox", "LinuxSampler", "SFZ v1", "SFZ v2", "sfizz"] # , "Unknown" +# ------------------------------------------------------------------------------ +# Headers +# ------------------------------------------------------------------------------ +headers: +- name: "region" + short_description: + "The basic component of an instrument. + An instrument is defined by one or more regions." + version: "SFZ v1" + +- name: "group" + short_description: + "Multiple regions can be arranged in a group. Groups allow entering + common parameters for multiple regions." + version: "SFZ v1" + +- name: "control" + short_description: "" + version: "SFZ v2" + +- name: "global" + short_description: + "Allows entering parameters which are common for all regions." + version: "SFZ v2" + +- name: "curve" + short_description: "A header for defining curves for MIDI CC controls." + version: "SFZ v2" + +- name: "effect" + short_description: "SFZ v2 header for effects controls." + version: "SFZ v2" + +- name: "master" + short_description: + "An intermediate level in the header hierarchy, between global and group." + version: "ARIA" + +- name: "midi" + short_description: + "ARIA extension, was added for MIDI pre-processor effects. + From ARIA v1.0.8.0+ an <effect> section with a + bus=midi can be used instead." + version: "ARIA" + deprecated: true + +- name: "sample" + short_description: "Allows to embed sample data directly in SFZ files (Rapture)." + version: "SFZ v2" +# ------------------------------------------------------------------------------ +# Opcodes +# +# NOTE: unlike `min` and `max`, the `default` value is also used as a +# documentation string, thus not reliable to evaluate in parsers. +# ------------------------------------------------------------------------------ +categories: +- name: "Real-Time Instrument Script" + id: "scr" + url: "http://doc.linuxsampler.org/Instrument_Scripts/" + opcodes: + - name: "script" + version: "LinuxSampler" + short_description: + "Allows to load real-time instrument scripts for SFZ instruments." + value: + type_name: "string" + +- name: "Sound Source" + url: "/misc/categories#sound-source" + short_description: + "Defines the nature of the voice generated. + It could be samples or oscillators" + types: + - name: "Sample Playback" + id: "spl" + short_description: + "Sample Playback opcodes defines the parameters of the sound generation." + opcodes: + - name: "count" + short_description: "The number of times the sample will be played." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 4294967296 + + - name: "delay" + short_description: "Region delay time." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + modulation: + midi_cc: + - name: "delay_ccN" + short_description: + "Region delay time after MIDI continuous controller N messages are + received. If the region receives a note-off message before + delay time, the region won't play." + alias: + - name: "delay_onccN" + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + - name: "delay_curveccN" + version: "ARIA" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate delay." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + + - name: "delay_random" + short_description: "Region random delay time." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + + - name: "delay_samples" + short_description: + "Allows the region playback to be postponed for the specified time, + measured in samples (and therefore dependent on current sample rate)." + version: "SFZ v2" + value: + type_name: "integer" + unit: "sample units" + modulation: + midi_cc: + - name: "delay_samples_onccN" + value: + type_name: "integer" + unit: "sample units" + + - name: "end" + short_description: "The endpoint of the sample. If unspecified, the entire sample will play." + version: "SFZ v1" + value: + type_name: "integer" + default: "unspecified" + min: 0 + max: 4294967296 + unit: "sample units" + + - name: "loop_count" + short_description: "The number of times a loop will repeat." + version: "SFZ v2" + alias: + - name: "loopcount" + version: "ARIA" + value: + type_name: "integer" + + - name: "loop_crossfade" + short_description: "Loop cross fade." + version: "SFZ v2" + #alias: + #- name: "loopcrossfade" + value: + type_name: "float" + unit: "seconds" + + - name: "loop_end" + short_description: "The loop end point, in samples." + version: "SFZ v1" + alias: + - name: "loopend" + value: + type_name: "integer" + unit: "sample units" + default: 0 + min: 0 + max: 4294967296 + modulation: + midi_cc: + - name: "loop_lengthccN" + version: "SFZ v2" + short_description: "Change of loop end point." + alias: + - name: "loop_length_onccN" + + - name: "loop_mode" + short_description: + "Allows playing samples with loops defined in the unlooped mode." + version: "SFZ v1" + alias: + - name: "loopmode" + value: + type_name: "string" + default: + "no_loop for samples without a loop defined, +
loop_continuous for samples with defined loop(s)." + options: + - name: "no_loop" + description: + "no looping will be performed. + Sample will play straight from start to end, or until note off, + whatever reaches first." + + - name: "one_shot" + description: + "sample will play from start to end, ignoring note off. + This is commonly used for drums. This mode is engaged automatically + if the count opcode is defined." + + - name: "loop_continuous" + description: + "once the player reaches sample loop point, + the loop will play until note expiration." + + - name: "loop_sustain" + description: + "the player will play the loop while the note is held, + by keeping it depressed or by using the sustain pedal (CC64). + The rest of the sample will play after note release." + + - name: "loop_start" + short_description: "The loop start point, in samples." + version: "SFZ v1" + alias: + - name: "loopstart" + value: + type_name: "integer" + unit: "sample units" + default: 0 + min: 0 + max: 4294967296 + modulation: + midi_cc: + - name: "loop_startccN" + short_description: "Change of loop start point." + version: "SFZ v2" + alias: + - name: "loop_start_onccN" + + - name: "loop_tune" + short_description: "Tuning for only the loop segment." + version: "SFZ v2" + alias: + - name: "looptune" + version: "ARIA" + value: + type_name: "float" + unit: "cents" + default: 0 + + - name: "loop_type" + short_description: "Defines the looping mode." + version: "SFZ v2" + alias: + - name: "looptype" + version: "ARIA" + value: + type_name: "string" + default: "forward" + options: + - name: "forward" + - name: "backward" + - name: "alternate" + + - name: "offset" + short_description: "The offset used to play the sample." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 4294967296 + unit: "sample units" + modulation: + midi_cc: + - name: "offset_ccN" + short_description: + "The offset used to play the sample according to last position + of MIDI continuous controller N." + alias: + - name: "offset_onccN" + version: "SFZ v2" + value: + type_name: "integer" + default: 0 + min: 0 + max: 4294967296 + unit: "sample units" + + - name: "offset_random" + short_description: "Random offset added to the region offset." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 4294967296 + unit: "sample units" + + - name: "offset_mode" + short_description: "Defines whether offset is measured in samples or percentage of sample length." + version: "ARIA" + value: + type_name: "string" + default: "samples" + options: + - name: "samples" + - name: "percent" + + - name: "sample" + short_description: "Defines which sample file the region will play." + version: "SFZ v1" + value: + type_name: "string" + + - name: "sample_fadeout" + short_description: + "Number of seconds before the end of sample playback that the player + should begin a realtime fadeout." + version: "SFZ v2" + value: + type_name: "float" + unit: "seconds" + + - name: "sample_dyn_paramN" + short_description: "ARIA-specific nameless destination for plugin modulations." + version: "ARIA" + value: + type_name: "float" + modulation: + midi_cc: + - name: "sample_dyn_paramN_onccX" + value: + type_name: "float" + + - name: "sync_beats" + short_description: "Region playing synchronization to host position." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 32 + unit: "beats" + + - name: "sync_offset" + short_description: "Region playing synchronization to host position offset." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 32 + unit: "beats" + + - name: "delay_beats" + short_description: + "Delays the start of the region + until a certain amount of musical beats are passed." + version: "SFZ v2" + value: + type_name: "float" + unit: "beats" + modulation: + midi_cc: + - name: "delay_beats_onccN" + version: "ARIA" + - name: "delay_beats_curveccN" + version: "ARIA" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate delay_beats." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + + - name: "delay_beats_random" + short_description: + "Delays the start of the region after a random amount of musical beats." + version: "ARIA" + value: + type_name: "float" + unit: "beats" + + - name: "stop_beats" + short_description: + "Stops a region after a certain amount of beats have played." + version: "SFZ v2" + value: + type_name: "float" + unit: "beats" + + - name: "direction" + short_description: "The direction in which the sample is to be played." + version: "SFZ v2" + value: + type_name: "string" + default: "forward" + options: + - name: "forward" + - name: "reverse" + + - name: "md5" + short_description: + "Calculates the MD5 + digital fingerprint hash of a sample file, + represented as a sequence of 32 hexadecimal digits." + version: "SFZ v2" + value: + type_name: "string" + default: "null" + + - name: "reverse_loccN" + short_description: + "If MIDI CC N is between reverse_loccN and + reverse_hiccN, the region plays reversed." + version: "SFZ v2" + value: + type_name: "integer" + min: 0 + max: 127 + + - name: "reverse_hiccN" + short_description: + "If MIDI CC N is between reverse_loccN and + reverse_hiccN, the region plays reversed." + version: "SFZ v2" + value: + type_name: "integer" + min: 0 + max: 127 + + - name: "waveguide" + short_description: "Enables waveguide synthesis for the region." + version: "SFZ v2" + value: + type_name: "string" + options: + - name: "on" + - name: "off" + +- name: "Instrument Settings" + id: "ins" + url: "/misc/categories#instrument-settings" + short_description: "Opcodes used under the header." + opcodes: + - name: "#define" + version: "SFZ v2" + short_description: "Creates a variable and gives it a value." + macro: true + value: + type_name: "string" + + - name: "default_path" + short_description: "Default file path." + version: "SFZ v2" + value: + type_name: "string" + + - name: "note_offset" + short_description: + "MIDI note transpose; tells the SFZ player to offset all incoming MIDI notes by the specified number of semitones." + version: "SFZ v2" + value: + type_name: "integer" + default: 0 + min: -127 + max: 127 + unit: "semitones" + + - name: "octave_offset" + short_description: + "MIDI octave transpose; tells the SFZ player to offset all incoming MIDI notes by the specified number of octaves." + version: "SFZ v2" + value: + type_name: "integer" + default: 0 + min: -10 + max: 10 + unit: "octaves" + + - name: "label_ccN" + short_description: "Creates a label for the MIDI CC." + version: "ARIA" + value: + type_name: "string" + + - name: "label_keyN" + short_description: "Creates a label for a key." + version: "sfizz" + value: + type_name: "string" + + - name: "label_outputN" + short_description: "Creates a label for the output N." + version: "Calfbox" + value: + type_name: "string" + + - name: "set_ccN" + short_description: + "Sets a default initial value for MIDI CC number N, + when the instrument is initially loaded." + version: "SFZ v2" + value: + type_name: "integer" + min: 0 + max: 127 + + - name: "#include" + short_description: + "A special directive, which allows using SFZ files as building blocks + for creating larger, more complex SFZ files." + version: "ARIA" + macro: true + value: + type_name: "string" + + - name: "hint_*" + short_description: + "Its a 'hint' to the ARIA engine, others implementations don't have to follow." + version: "ARIA" + + - name: "*_mod" + short_description: + "Determines whether a parameter is modulated by addition or multiplication." + version: "ARIA" + targets: + - name: "amplitude" + - name: "bitred" + - name: "cutoff" + - name: "cutoff2" + - name: "decim" + - name: "delay" + - name: "delay_beats" + - name: "fil_gain" + - name: "fil2_gain" + - name: "offset" + - name: "pan" + - name: "pitch" + - name: "position" + - name: "resonance" + - name: "resonance2" + - name: "stop_beats" + - name: "tune" + - name: "volume" + - name: "width" + value: + type_name: "string" + options: + - name: "add" + - name: "mult" + + - name: "set_hdccN" + short_description: + "Like set_ccN but with floating point MIDI CCs." + version: "ARIA" + alias: + - name: "set_realccN" + value: + type_name: "float" + min: 0 + max: 1 + + - name: "sw_note_offset" + short_description: + "Follows the same logic as SFZ 2.0’s + note_offset but for key switches." + version: "ARIA" + value: + type_name: "integer" + + - name: "sw_octave_offset" + short_description: + "Follows the same logic as SFZ 2.0’s + octave_offset but for key switches." + version: "ARIA" + value: + type_name: "integer" + + - name: "loop_end_offset" + short_description: + "Subtracts 1 from sample numbers in file metadata, as a workaround for incorrectly generated loop points." + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: -1 + max: 0 + + - name: "global_label" + short_description: + "An ARIA extension which sets what is displayed + in the default info tab of Sforzando." + version: "ARIA" + value: + type_name: "string" + + - name: "master_label" + short_description: + "An ARIA extension which sets what is displayed + in the default info tab of Sforzando." + version: "ARIA" + value: + type_name: "string" + + - name: "group_label" + short_description: + "An ARIA extension which sets what is displayed + in the default info tab of Sforzando." + version: "ARIA" + value: + type_name: "string" + + - name: "region_label" + short_description: + "An ARIA extension which sets what is displayed + in the default info tab of Sforzando." + version: "ARIA" + value: + type_name: "string" + + types: + - name: "Voice Lifecycle" + id: "vlc" + opcodes: + - name: "group" + short_description: "Exclusive group number for this region." + version: "SFZ v1" + alias: + - name: "polyphony_group" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: -2147483648 + max: 2147483647 + + - name: "off_by" + short_description: "Region off group." + version: "SFZ v1" + alias: + - name: "offby" + value: + type_name: "integer" + default: 0 + min: -2147483648 + max: 2147483647 + + - name: "off_mode" + short_description: "Region off mode." + version: "SFZ v1" + # alias: + # - name: "offmode" + value: + type_name: "string" + default: "fast" + options: + - name: "fast" + description: + "The voice will be turned off immediately. + Release settings will not have any effect." + + - name: "normal" + description: + "The region will be set into release stage. + All envelope generators will enter in release stage, + and region will expire when the amplifier envelope generator expired." + + - name: "time" + description: + "Used to specify a time independent + of the sample release time using off_time." + version: "ARIA" + + - name: "output" + short_description: "The stereo output number for this region." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 1024 + + - name: "polyphony" + short_description: "Polyphony voice limit." + version: "SFZ v2" + value: + type_name: "integer" + + - name: "note_polyphony" + short_description: "Polyphony limit for playing the same note repeatedly." + version: "SFZ v2" + value: + type_name: "integer" + + - name: "polyphony_stealing" + short_description: "" + version: "ARIA" + value: + type_name: "integer" + + - name: "note_selfmask" + short_description: + "Controls note-stealing behavior for a single pitch, + when using note_polyphony." + version: "SFZ v2" + value: + type_name: "string" + default: "on" + options: + - name: "on" + - name: "off" + + - name: "rt_dead" + short_description: + "Controls whether a release sample should play + if its sustain sample has ended, or not." + version: "SFZ v2" + value: + type_name: "string" + default: "off" + options: + - name: "on" + - name: "off" + + - name: "off_curve" + short_description: + "When off_mode is set to time, + this specifies the math to be used to fade out the regions being + muted by voice-stealing." + version: "ARIA" + value: + type_name: "integer" + default: 10 + min: -2 + max: 10 + options: + - name: "-2" + - name: "-1" + - name: "0" + - name: "1" + - name: "2" + - name: "10" + + - name: "off_shape" + short_description: + "The coefficient used by off_curve." + version: "ARIA" + value: + type_name: "float" + default: -10.3616 + + - name: "off_time" + short_description: + "When off_mode is set to time, + this specifies the fadeout time for regions being muted by voice-stealing." + version: "ARIA" + value: + type_name: "float" + default: 0.006 + +- name: "Region Logic" + url: "/misc/categories#region-logic" + short_description: + "Region Logic opcodes define the conditions under which a voice plays or stops." + types: + - name: "Key Mapping" + id: "map" + opcodes: + - name: "key" + short_description: + "Equivalent to using lokey, + hikey and + pitch_keycenter + and setting them all to the same note value." + version: "SFZ v1" + value: + type_name: "integer" + min: 0 + max: 127 + + - name: "lokey" + short_description: + "Determine the low boundary of a certain + region." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 127 + + - name: "hikey" + short_description: + "Determine the high boundary of a certain + region." + version: "SFZ v1" + value: + type_name: "integer" + default: 127 + min: 0 + max: 127 + + - name: "lovel" + short_description: + "If a note with velocity value equal to or higher than lovel + AND equal to or lower than hivel is played, + the region will play." + version: "SFZ v1" + value: + type_name: "integer" + default: 1 + min: 1 + max: 127 + + - name: "hivel" + short_description: + "If a note with velocity value equal to or higher than lovel + AND equal to or lower than hivel is played, + the region will play." + version: "SFZ v1" + value: + type_name: "integer" + default: 127 + min: 1 + max: 127 + + - name: "MIDI Conditions" + id: "mid" + opcodes: + - name: "lochan" + short_description: + "If incoming notes have a MIDI channel between lochan and + hichan, the region will play." + version: "SFZ v1" + value: + type_name: "integer" + default: 1 + min: 1 + max: 16 + + - name: "hichan" + short_description: + "If incoming notes have a MIDI channel between lochan and + hichan, the region will play." + version: "SFZ v1" + value: + type_name: "integer" + default: 16 + min: 1 + max: 16 + + - name: "loccN" + short_description: + "Defines the range of the last MIDI controller N required + for the region to play." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 127 + + - name: "hiccN" + short_description: + "Defines the range of the last MIDI controller N required + for the region to play." + version: "SFZ v1" + value: + type_name: "integer" + default: 127 + min: 0 + max: 127 + + - name: "lobend" + short_description: + "Defines the range of the last Pitch Bend message required + for the region to play." + version: "SFZ v1" + value: + type_name: "integer" + default: -8192 + min: -8192 + max: 8192 + + - name: "hibend" + short_description: + "Defines the range of the last Pitch Bend message required + for the region to play." + version: "SFZ v1" + value: + type_name: "integer" + default: 8192 + min: -8192 + max: 8192 + + - name: "sostenuto_cc" + short_description: "Reassigns the sostenuto pedal CC to a non-standard value." + version: "ARIA" + value: + type_name: "integer" + default: 66 + min: 0 + max: 127 + + - name: "sostenuto_lo" + short_description: + "Sets the minimum point at which the sostenuto pedal (MIDI CC 66) + is considered 'down'." + version: "ARIA" + value: + type_name: "float" + default: 0.5 + min: 0 + max: 127 + + - name: "sostenuto_sw" + short_description: "Turns the sostenuto switch on or off." + version: "SFZ v2" + value: + type_name: "string" + options: + - name: "on" + - name: "off" + + - name: "sustain_cc" + short_description: "Reassigns the sustain pedal CC to a non-standard value." + version: "ARIA" + value: + type_name: "integer" + default: 64 + min: 0 + max: 127 + + - name: "sustain_lo" + short_description: + "Sets the minimum point at which the sustain pedal (MIDI CC 64) + is considered 'down'." + version: "ARIA" + value: + type_name: "float" + default: 0.5 + min: 0 + max: 127 + + - name: "sustain_sw" + short_description: "Turns the sustain switch on or off." + version: "SFZ v2" + value: + type_name: "string" + options: + - name: "on" + - name: "off" + + - name: "sw_lokey" + short_description: + "Defines the range of the keyboard to be used as trigger selectors + for the sw_last opcode." + version: "SFZ v1" + value: + type_name: "integer" + default: -1 + min: 0 + max: 127 + + - name: "sw_hikey" + short_description: + "Defines the range of the keyboard to be used as trigger selectors + for the sw_last opcode." + version: "SFZ v1" + value: + type_name: "integer" + default: -1 + min: 0 + max: 127 + + - name: "sw_last" + short_description: + "Enables the region to play if the last key pressed in the range + specified by sw_lokey and sw_hikey + is equal to the sw_last value." + version: "SFZ v1" + value: + type_name: "integer" + default: -1 + min: 0 + max: 127 + + - name: "sw_down" + short_description: + "Enables the region to play if the key equal + to sw_down value is depressed. + Key has to be in the range specified by + sw_lokey and sw_hikey." + version: "SFZ v1" + value: + type_name: "integer" + default: -1 + min: 0 + max: 127 + + - name: "sw_up" + short_description: + "Enables the region to play if the key equal to sw_up value + is not depressed." + version: "SFZ v1" + value: + type_name: "integer" + default: -1 + min: 0 + max: 127 + + - name: "sw_previous" + short_description: + "Previous note value. The region will play if last note-on message + was equal to sw_previous value." + version: "SFZ v1" + value: + type_name: "integer" + min: 0 + max: 127 + + - name: "sw_vel" + short_description: + "Allows overriding the velocity for the region with the velocity + of the previous note." + version: "SFZ v1" + value: + type_name: "string" + default: "current" + options: + - name: "current" + description: "Region uses the velocity of current note." + + - name: "previous" + description: "Region uses the velocity of the previous note." + + - name: "loprog" + short_description: + "The region plays when the MIDI program number is between loprog + and hiprog." + version: "SFZ v2" + value: + type_name: "integer" + default: 0 + min: 0 + max: 127 + + - name: "hiprog" + short_description: + "The region plays when the MIDI program number is between loprog + and hiprog." + version: "SFZ v2" + value: + type_name: "integer" + default: 127 + min: 0 + max: 127 + + - name: "lohdccN" + short_description: + "Like loccN but with floating point MIDI CCs" + version: "ARIA" + value: + type_name: "float" + min: 0 + max: 1 + default: 0 + + - name: "hihdccN" + short_description: + "Like hiccN but with floating point MIDI CCs" + version: "ARIA" + value: + type_name: "float" + min: 0 + max: 1 + default: 1 + + - name: "sw_default" + short_description: + "Define keyswitch 'power on default' so that you hear something when a patch loads." + version: "SFZ v2" + value: + type_name: "integer" + min: 0 + max: 127 + + - name: "sw_label" + short_description: "Label for activated keyswitch on GUI." + version: "ARIA" + value: + type_name: "string" + + - name: "sw_lolast" + short_description: + "Like sw_last, but allowing a region + to be triggered across a range of keyswitches." + version: "ARIA" + value: + type_name: "integer" + min: 0 + max: 127 + + - name: "sw_hilast" + short_description: + "Like sw_last, + but allowing a region to be triggered across a range of keyswitches." + version: "ARIA" + value: + type_name: "integer" + min: 0 + max: 127 + + - name: "varNN_mod" + short_description: + "Specifies the method used to calculate variable number NN from MIDI CCs." + version: "ARIA" + value: + type_name: "string" + options: + - name: "mult" + description: + "Multiplication, with 1 being full scale, 0 at a CC value of 0, + and 1 at CC value of 127. This is how the amplitude opcode works." + - name: "add" + description: + "Addition, how volume, cutoff and all other modulation destinations + work by default when modulated." + modulation: + midi_cc: + - name: "varNN_onccX" + short_description: + "Specifies the method used to calculate variable number NN from MIDI CCs." + value: + type_name: "float" + min: 0 + max: 1 + - name: "varNN_curveccX" + short_description: + "Specifies the <curve> number + which MIDI CC X uses to modulate varNN." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + + - name: "varNN_*" + short_description: "Specifies the target for variable NN to modulate." + version: "ARIA" + targets: + - name: "amplitude" + - name: "bitred" + - name: "cutoff" + - name: "cutoff2" + - name: "decim" + - name: "eqNbw" + - name: "eqNfreq" + - name: "eqNgain" + - name: "pan" + - name: "pitch" + - name: "resonance" + - name: "resonance2" + - name: "sample_dyn_paramX" + - name: "volume" + - name: "width" + + - name: "Internal Conditions" + id: "int" + opcodes: + - name: "lobpm" + short_description: "Host tempo value." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 500 + unit: "bpm" + + - name: "hibpm" + short_description: "Host tempo value." + version: "SFZ v1" + value: + type_name: "float" + default: 500 + min: 0 + max: 500 + unit: "bpm" + + - name: "lochanaft" + short_description: + "Defines the range of last Channel Aftertouch message required + for the region to play." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 127 + + - name: "hichanaft" + short_description: + "Defines the range of last Channel Aftertouch message required + for the region to play." + version: "SFZ v1" + value: + type_name: "integer" + default: 127 + min: 0 + max: 127 + + - name: "lopolyaft" + short_description: + "Defines the range of last Polyphonic Aftertouch message required + for the region to play." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 127 + + - name: "hipolyaft" + short_description: + "Defines the range of last Polyphonic Aftertouch message required + for the region to play." + version: "SFZ v1" + value: + type_name: "integer" + default: 127 + min: 0 + max: 127 + + - name: "lorand" + short_description: + "The region will play if the random number is equal to or higher than + lorand, and lower than hirand." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 1 + + - name: "hirand" + short_description: + "The region will play if the random number is equal to or higher than + lorand, and lower than hirand." + version: "SFZ v1" + value: + type_name: "float" + default: 1 + min: 0 + max: 1 + + - name: "seq_length" + short_description: + "Sequence length, used together with seq_position + to use samples as round robins." + version: "SFZ v1" + value: + type_name: "integer" + default: 1 + min: 1 + max: 100 + + - name: "seq_position" + short_description: + "Sequence position. The region will play if the internal sequence counter + is equal to seq_position." + version: "SFZ v1" + value: + type_name: "integer" + default: 1 + min: 1 + max: 100 + + - name: "lotimer" + short_description: + "Region plays if the time passed since the last sample in the same group played + is between lotimer and hitimer." + version: "SFZ v2" + value: + type_name: "float" + + - name: "hitimer" + short_description: + "Region plays if timer is between lotimer and + hitimer." + version: "SFZ v2" + value: + type_name: "float" + + - name: "Triggers" + id: "trg" + opcodes: + - name: "trigger" + short_description: + "Sets the trigger which will be used for the sample to play." + version: "SFZ v1" + value: + type_name: "string" + default: "attack" + options: + - name: "attack" + description: "Region will play on note-on." + + - name: "release" + description: + "Region will play on note-off or sustain pedal off. + The velocity used to play the note-off sample is the velocity value + of the corresponding (previous) note-on message." + + - name: "first" + description: + "Region will play on note-on, but if there’s no other note + going on (staccato, or first note in a legato phrase)." + + - name: "legato" + description: + "Region will play on note-on, but only if there’s a note going on + (notes after first note in a legato phrase)." + + - name: "release_key" + description: + "Region will play on note-off. The velocity used to play + the note-off sample is the velocity value of the corresponding + (previous) note-on message. Ignores sustain pedal." + version: "SFZ v2" + + - name: "on_loccN" + short_description: + "If a MIDI control message with a value between on_loccN + and on_hiccN is received, the region will play. + Default value is -1, it means unassigned." + version: "SFZ v1" + value: + type_name: "integer" + default: -1 + min: 0 + max: 127 + alias: + - name: "start_loccN" + version: "SFZ v2" + + - name: "on_hiccN" + short_description: + "If a MIDI control message with a value between on_loccN + and on_hiccN is received, the region will play. + Default value is -1, it means unassigned." + version: "SFZ v1" + value: + type_name: "integer" + default: -1 + min: 0 + max: 127 + alias: + - name: "start_hiccN" + version: "SFZ v2" + + - name: "on_lohdccN" + short_description: + "Like on_loccN but with floating point MIDI CCs." + version: "ARIA" + value: + type_name: "float" + default: -1 + min: 0 + max: 1 + alias: + - name: "start_lohdccN" + short_description: + "Like start_loccN but with floating point MIDI CCs." + + - name: "on_hihdccN" + short_description: + "Like on_hiccN but with floating point MIDI CCs." + version: "ARIA" + value: + type_name: "float" + default: -1 + min: 0 + max: 1 + alias: + - name: "start_hihdccN" + short_description: + "Like start_hiccN but with floating point MIDI CCs." + + - name: "stop_loccN" + short_description: + "If a MIDI control message with a value between stop_loccN + and stop_hiccN is received, the region will stop playing. + Default value is -1, it means unassigned." + version: "SFZ v2" + value: + type_name: "integer" + default: -1 + min: 0 + max: 127 + + - name: "stop_hiccN" + short_description: + "If a MIDI control message with a value between stop_loccN + and stop_hiccN is received, the region will stop playing. + Default value is -1, it means unassigned." + version: "SFZ v2" + value: + type_name: "integer" + default: -1 + min: 0 + max: 127 + + - name: "stop_lohdccN" + short_description: + "Like stop_loccN but with floating point MIDI CCs." + version: "ARIA" + value: + type_name: "float" + default: -1 + min: 0 + max: 1 + + - name: "stop_hihdccN" + short_description: + "Like stop_hiccN but with floating point MIDI CCs." + version: "ARIA" + value: + type_name: "float" + default: -1 + min: 0 + max: 1 + +- name: "Performance Parameters" + url: "/misc/categories#performance-parameters" + short_description: "Performance Parameters are all sound modifiers." + types: + - name: "Amplifier" + id: "amp" + opcodes: + - name: "pan" + short_description: "The panoramic position for the region." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "%" + modulation: + midi_cc: + - name: "pan_onccN" + version: "SFZ v2" + alias: + - name: "pan_ccN" + version: "ARIA" + - name: "pan_curveccN" + version: "SFZ v2" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate pan." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + - name: "pan_smoothccN" + version: "SFZ v2" + - name: "pan_stepccN" + version: "SFZ v2" + + - name: "pan_random" + short_description: "Random panoramic position for the region." + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "%" + + - name: "position" + short_description: + "Only operational for stereo samples, position defines + the position in the stereo field of a stereo signal, + after channel mixing as defined in the + width opcode." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "%" + modulation: + midi_cc: + - name: "position_onccN" + version: "ARIA" + - name: "position_curveccN" + version: "ARIA" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate position." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + - name: "position_smoothccN" + version: "ARIA" + - name: "position_stepccN" + version: "ARIA" + + - name: "position_random" + short_description: + "" + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "%" + + - name: "position_keycenter" + short_description: "" + version: "ARIA" + + - name: "position_keytrack" + short_description: "" + version: "ARIA" + + - name: "position_veltrack" + short_description: "" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: -200 + max: 200 + + - name: "volume" + short_description: "The volume for the region, in decibels." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: -144 + max: 6 + unit: "dB" + modulation: + envelope: "✓" + lfo: "✓" + midi_cc: + - name: "gain_ccN" + short_description: "Gain applied on MIDI control N, in decibels." + alias: + - name: "gain_onccN" + version: "SFZ v2" + - name: "volume_onccN" + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: -144 + max: 48 + unit: "dB" + - name: "volume_curveccN" + version: "SFZ v2" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate volume." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + - name: "volume_smoothccN" + version: "SFZ v2" + - name: "volume_stepccN" + version: "SFZ v2" + + - name: "width" + short_description: + "Only operational for stereo samples, + width defines the amount of channel mixing applied to play the sample." + version: "SFZ v1" + value: + type_name: "float" + default: 100 + min: -100 + max: 100 + unit: "%" + modulation: + envelope: "✓" + lfo: "✓" + midi_cc: + - name: "width_onccN" + version: "SFZ v2" + - name: "width_curveccN" + version: "SFZ v2" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate width." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + - name: "width_smoothccN" + version: "SFZ v2" + - name: "width_stepccN" + version: "SFZ v2" + + - name: "amp_keycenter" + short_description: + "Center key for amplifier keyboard tracking. + In this key, the amplifier keyboard tracking will have no effect." + version: "SFZ v1" + value: + type_name: "integer" + default: 60 + min: 0 + max: 127 + + - name: "amp_keytrack" + short_description: + "Amplifier keyboard tracking (change in amplitude per key) in decibels." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: -96 + max: 12 + unit: "dB" + + - name: "amp_veltrack" + short_description: + "Amplifier velocity tracking, represents how much the amplitude changes + with incoming note velocity." + version: "SFZ v1" + value: + type_name: "float" + default: 100 + min: -100 + max: 100 + unit: "%" + modulation: + midi_cc: + - name: "amp_veltrack_onccN" + version: "ARIA" + alias: + - name: "amp_veltrack_ccN" + - name: "amp_veltrack_curveccN" + version: "ARIA" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate amp_veltrack." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + + - name: "amp_veltrack_random" + short_description: "" + version: "ARIA" + + - name: "amp_velcurve_N" + short_description: "User-defined amplifier velocity curve." + version: "SFZ v1" + index: + type_name: "integer" + min: 0 + max: 127 + value: + type_name: "float" + default: + "Standard curve (see amp_veltrack)" + min: 0 + max: 1 + + - name: "amp_random" + short_description: "Random volume for the region, in decibels." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 24 + unit: "dB" + alias: + - name: "gain_random" + version: "SFZ v2" + + - name: "rt_decay" + short_description: + "Applies only to regions that triggered through trigger=release. + The volume decrease (in decibels) per seconds + after the corresponding attack region was triggered." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 200 + unit: "dB" + + - name: "rt_decayN" + short_description: + "Applies only to regions that triggered through trigger=release. + The volume decrease (in decibels) per seconds after the + corresponding attack region was triggered, for decrease curve segment number N." + version: "ARIA" + value: + type_name: "float" + default: 0 + min: 0 + max: 200 + unit: "dB" + + - name: "rt_decayN_time" + short_description: + "The duration of release sample volue decrease curve segment number N." + version: "ARIA" + value: + type_name: "float" + unit: "seconds" + + - name: "xf_cccurve" + short_description: "MIDI controllers crossfade curve for the region." + version: "SFZ v1" + value: + type_name: "string" + default: "power" + options: + - name: "gain" + description: + "Linear gain crossfade. + This setting is best when crossfading phase-aligned material. + Linear gain crossfades keep constant amplitude during the crossfade, + preventing clipping." + + - name: "power" + description: + "Equal-power RMS crossfade. + This setting works better to mix very different material, + as a constant power level is kept during the crossfade." + + - name: "xf_keycurve" + short_description: "Keyboard crossfade curve for the region." + version: "SFZ v1" + value: + type_name: "string" + default: "power" + options: + - name: "gain" + description: + "Linear gain crossfade. + This setting is best when crossfading phase-aligned material. + Linear gain crossfades keep constant amplitude during the crossfade, + preventing clipping." + + - name: "power" + description: + "Equal-power RMS crossfade. + This setting works better to mix very different material, + as a constant power level is kept during the crossfade." + + - name: "xf_velcurve" + short_description: "Velocity crossfade curve for the region." + version: "SFZ v1" + value: + type_name: "string" + default: "power" + options: + - name: "gain" + description: + "Linear gain crossfade. + This setting is best when crossfading phase-aligned material. + Linear gain crossfades keep constant amplitude during the crossfade, + preventing clipping." + + - name: "power" + description: + "Equal-power RMS crossfade. + This setting works better to mix very different material, + as a constant power level is kept during the crossfade." + + - name: "xfin_loccN" + short_description: "Fade in control based on MIDI CC." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 127 + + - name: "xfin_hiccN" + short_description: "Fade in control based on MIDI CC." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 127 + + - name: "xfout_loccN" + short_description: "Fade out control based on MIDI CC." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 127 + + - name: "xfout_hiccN" + short_description: "Fade out control based on MIDI CC." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 127 + + - name: "xfin_lokey" + short_description: "Fade in control based on MIDI note (keyboard position)." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 127 + + - name: "xfin_hikey" + short_description: "Fade in control based on MIDI note (keyboard position)." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 127 + + - name: "xfout_lokey" + short_description: + "Fade out control based on MIDI note number (keyboard position)." + version: "SFZ v1" + value: + type_name: "integer" + default: 127 + min: 0 + max: 127 + + - name: "xfout_hikey" + short_description: + "Fade out control based on MIDI note number (keyboard position)." + version: "SFZ v1" + value: + type_name: "integer" + default: 127 + min: 0 + max: 127 + + - name: "xfin_lovel" + short_description: "Fade in control based on velocity." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 127 + + - name: "xfin_hivel" + short_description: "Fade in control based on velocity." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 127 + + - name: "xfout_lovel" + short_description: "Fade out control, based on velocity." + version: "SFZ v1" + value: + type_name: "integer" + default: 127 + min: 0 + max: 127 + + - name: "xfout_hivel" + short_description: "Fade out control, based on velocity." + version: "SFZ v1" + value: + type_name: "integer" + default: 127 + min: 0 + max: 127 + + - name: "phase" + short_description: + "If invert is set, the region is played with inverted phase." + version: "SFZ v2" + value: + type_name: "string" + default: "normal" + options: + - name: "normal" + - name: "invert" + + - name: "amplitude" + short_description: + "Amplitude for the specified region in percentage of full amplitude." + version: "ARIA" + value: + type_name: "float" + default: 100 + min: 0 + max: 100 + unit: "%" + modulation: + envelope: "✓" + lfo: "✓" + midi_cc: + - name: "amplitude_onccN" + alias: + - name: "amplitude_ccN" + value: + type_name: "float" + min: -100 + max: 100 + unit: "%" + - name: "amplitude_curveccN" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate amplitude." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + - name: "amplitude_smoothccN" + + - name: "global_amplitude" + short_description: + "ARIA extension, like amplitude, + but affecting everything when set under + the <global> header." + version: "ARIA" + value: + type_name: "float" + default: 100 + min: 0 + max: 100 + unit: "%" + + - name: "master_amplitude" + short_description: + "ARIA extension, like amplitude, + but affecting everything when set under + the <master> header." + version: "ARIA" + value: + type_name: "float" + default: 100 + min: 0 + max: 100 + unit: "%" + + - name: "group_amplitude" + short_description: + "ARIA extension, like amplitude, + but affecting everything when set under + the <group> header." + version: "ARIA" + value: + type_name: "float" + default: 100 + min: 0 + max: 100 + unit: "%" + + - name: "pan_law" + short_description: "Sets the pan law to be used." + version: "ARIA" + value: + type_name: "string" + options: + - name: "mma" + - name: "balance" + + - name: "pan_keycenter" + short_description: "Center key for pan keyboard tracking." + version: "SFZ v2" + value: + type_name: "integer" + default: 60 + min: 0 + max: 127 + + - name: "pan_keytrack" + short_description: + "The amount by which the panning of a note is shifted with each key." + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "%" + + - name: "pan_veltrack" + short_description: "The effect of note velocity on panning." + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "%" + + - name: "global_volume" + short_description: + "ARIA extension, like volume, + but affecting everything when set under + the <global> header." + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -144 + max: 6 + unit: "dB" + + - name: "master_volume" + short_description: + "ARIA extension, like volume, + but affecting everything when set under + the <master> header." + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -144 + max: 6 + unit: "dB" + + - name: "group_volume" + short_description: + "ARIA extension, like volume, + but affecting everything when set under + the <group> header." + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -144 + max: 6 + unit: "dB" + + - name: "EQ" + id: "eq" + opcodes: + - name: "eqN_bw" + short_description: "Bandwidth of the equalizer band, in octaves." + version: "SFZ v1" + value: + type_name: "float" + default: 1 + min: 0.001 + max: 4 + unit: "octaves" + modulation: + envelope: "✓" + lfo: "✓" + midi_cc: + - name: "eqN_bwccX" + alias: + - name: "eqN_bw_onccX" + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: -4 + max: 4 + unit: "octaves" + + - name: "eqN_freq" + short_description: "Frequency of the equalizer band, in Hertz." + version: "SFZ v1" + value: + type_name: "float" + default: "eq1_freq=50
eq2_freq=500
eq3_freq=5000" + min: 0 + max: 30000 + unit: "Hz" + modulation: + envelope: "✓" + lfo: "✓" + midi_cc: + - name: "eqN_freqccX" + alias: + - name: "eqN_freq_onccX" + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: -30000 + max: 30000 + unit: "Hz" + velocity: + - name: "eqN_vel2freq" + short_description: + "Frequency change of the equalizer band with MIDI velocity, in Hertz." + value: + type_name: "float" + default: 0 + min: -30000 + max: 30000 + unit: "Hz" + + - name: "eqN_gain" + short_description: "Gain of the equalizer band, in decibels." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: -96 + max: 24 + unit: "dB" + modulation: + envelope: "✓" + lfo: "✓" + midi_cc: + - name: "eqN_gainccX" + alias: + - name: "eqN_gain_onccX" + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: -96 + max: 24 + unit: "dB" + velocity: + - name: "eqN_vel2gain" + short_description: + "Gain change of the equalizer band with MIDI velocity, in decibels." + value: + type_name: "float" + default: 0 + min: -96 + max: 24 + unit: "dB" + + - name: "eqN_dynamic" + short_description: "Specifies when EQ is recalculated." + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 1 + + - name: "eqN_mode" + version: "ARIA" + short_description: + "Specifies whether EQ frequency modulation is in cents or Hertz. Valid values are hz and cents." + value: + type_name: "string" + default: "hz" + + - name: "eqN_type" + short_description: "Sets the type of EQ filter." + version: "SFZ v2" + value: + type_name: "string" + default: "peak" + options: + - name: "peak" + - name: "lshelf" + - name: "hshelf" + + - name: "Filter" + id: "flt" + opcodes: + - name: "cutoff" + version: "SFZ v1" + short_description: + "Sets the cutoff frequency (Hz) of the + filters." + value: + type_name: "float" + default: "filter disabled" + min: 0 + max: "SampleRate / 2" + unit: "Hz" + modulation: + envelope: "fileg_depth" + lfo: "fillfo_depth" + midi_cc: + - name: "cutoff_ccN" + short_description: + "The variation in the cutoff frequency when + MIDI continuous controller N is received." + value: + type_name: "integer" + default: 0 + min: -9600 + max: 9600 + unit: "cents" + alias: + - name: "cutoff_onccN" + version: "SFZ v2" + - name: "cutoff_curveccN" + version: "SFZ v2" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate cutoff." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + - name: "cutoff_smoothccN" + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: 0 + unit: "ms" + - name: "cutoff_stepccN" + version: "SFZ v2" + value: + type_name: "integer" + default: 0 + min: 0 + - name: "cutoff_chanaft" + short_description: + "The variation in the cutoff frequency when MIDI channel aftertouch + messages are received, in cents." + value: + type_name: "integer" + default: 0 + min: -9600 + max: 9600 + unit: "cents" + - name: "cutoff_polyaft" + short_description: + "The variation in the cutoff frequency when MIDI polyphonic aftertouch + messages are received, in cents." + value: + type_name: "integer" + default: 0 + min: -9600 + max: 9600 + unit: "cents" + alias: + - name: "cutoff2" + version: "SFZ v2" + modulation: + midi_cc: + - name: "cutoff2_ccN" + - name: "cutoff2_onccN" + - name: "cutoff2_curveccN" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate cutoff2." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + - name: "cutoff2_smoothccN" + - name: "cutoff2_stepccN" + - name: "cutoff2_chanaft" + - name: "cutoff2_polyaft" + + - name: "fil_gain" + short_description: "Gain for lsh, hsh and peq filter types." + version: "ARIA" + value: + type_name: "float" + default: 0 + unit: "dB" + modulation: + midi_cc: + - name: "fil_gain_onccN" + alias: + - name: "fil2_gain" + short_description: "Gain for lsh, hsh and peq filter types." + modulation: + midi_cc: + - name: "fil2_gain_onccN" + + - name: "fil_keycenter" + version: "SFZ v1" + short_description: "Center key for filter keyboard tracking." + value: + type_name: "integer" + default: 60 + min: 0 + max: 127 + alias: + - name: "fil2_keycenter" + short_description: + "Same as fil_keycenter, + but used to specify the type for the second filter." + version: "SFZ v2" + + - name: "fil_keytrack" + version: "SFZ v1" + short_description: + "Filter keyboard tracking (change on cutoff for each key) in cents." + value: + type_name: "integer" + default: 0 + min: 0 + max: 1200 + unit: "cents" + alias: + - name: "fil2_keytrack" + short_description: + "Same as fil_keytrack, + but used to specify tracking for the second filter." + version: "SFZ v2" + + - name: "fil_mode" + version: "ARIA" + short_description: + "Specifies whether filter modulation is in cents or Hertz. Valid values are cents and hz" + value: + type_name: "string" + default: "cents" + alias: + - name: "fil2_mode" + short_description: + "Same as fil_mode, + but used to specify modulation mode for the second filter." + version: "ARIA" + + - name: "fil_random" + short_description: + "Random value added to the filter cutoff for the region, in cents." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 9600 + unit: "cents" + alias: + - name: "cutoff_random" + version: "SFZ v2" + - name: "cutoff2_random" + version: "ARIA" + + - name: "fil_type" + short_description: "Filter type." + version: "SFZ v1" + alias: + - name: "filtype" + - name: "fil2_type" + short_description: "Filter type." + version: "SFZ v2" + value: + type_name: "string" + default: "lpf_2p" + options: + - name: "lpf_1p" + description: "One-pole low pass filter (6dB/octave)." + - name: "hpf_1p" + description: "One-pole high pass filter (6dB/octave)." + - name: "lpf_2p" + description: "Two-pole low pass filter (12dB/octave)." + - name: "hpf_2p" + description: "Two-pole high pass filter (12dB/octave)." + - name: "bpf_2p" + description: "Two-pole band pass filter (12dB/octave)." + - name: "brf_2p" + description: "Two-pole band rejection filter (12dB/octave)." + - name: "bpf_1p" + description: "One-pole band pass filter (6dB/octave)." + version: "SFZ v2" + - name: "brf_1p" + description: "One-pole band rejection filter (6dB/octave)." + version: "SFZ v2" + - name: "apf_1p" + description: "One-pole all pass filter (6dB/octave)." + version: "SFZ v2" + - name: "lpf_2p_sv" + description: "Two-pole low pass state variable filter (12dB/octave)." + version: "SFZ v2" + - name: "hpf_2p_sv" + description: "Two-pole high pass state variable filter (12dB/octave)." + version: "SFZ v2" + - name: "bpf_2p_sv" + description: "Two-pole band pass state variable filter (12dB/octave)." + version: "SFZ v2" + - name: "brf_2p_sv" + description: "Two-pole band rejection state variable filter (12dB/octave)." + version: "SFZ v2" + - name: "pkf_2p" + description: "Two-pole peak filter (12dB/octave)." + version: "SFZ v2" + - name: "lpf_4p" + description: "Four-pole low pass filter (24dB/octave)." + version: "SFZ v2" + - name: "hpf_4p" + description: "Four-pole high pass filter (24dB/octave)." + version: "SFZ v2" + - name: "lpf_6p" + description: "Six-pole low pass filter (36dB/octave)." + version: "SFZ v2" + - name: "hpf_6p" + description: "Six-pole high pass filter (36dB/octave)." + version: "SFZ v2" + - name: "comb" + description: "Comb filter." + version: "SFZ v2" + - name: "pink" + description: "Pink filter." + version: "SFZ v2" + - name: "lsh" + description: "Low shelf." + version: "ARIA" + - name: "hsh" + description: "High shelf." + version: "ARIA" + - name: "peq" + description: "Parametric EQ." + version: "ARIA" + + - name: "fil_veltrack" + version: "SFZ v1" + short_description: + "Filter velocity tracking, the amount by which the cutoff changes + with incoming note velocity, in cents." + value: + type_name: "integer" + default: 0 + min: -9600 + max: 9600 + unit: "cents" + alias: + - name: "fil2_veltrack" + short_description: + "Same as fil_veltrack, + but used to specify the type for the second filter." + version: "SFZ v2" + + - name: "resonance" + short_description: "The filter cutoff resonance value, in decibels." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 40 + unit: "dB" + modulation: + envelope: "✓" + lfo: "✓" + midi_cc: + - name: "resonance_onccN" + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: -40 + max: 40 + unit: "dB" + alias: + - name: "resonance_ccN" + - name: "resonance_curveccN" + version: "SFZ v2" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate resonance." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + - name: "resonance_smoothccN" + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: 0 + unit: "ms" + - name: "resonance_stepccN" + version: "SFZ v2" + value: + type_name: "integer" + default: 0 + min: 0 + alias: + - name: "resonance2" + version: "SFZ v2" + modulation: + midi_cc: + - name: "resonance2_onccN" + value: + type_name: "float" + default: 0 + min: -40 + max: 40 + unit: "dB" + alias: + - name: "resonance2_ccN" + version: "SFZ v2" # TODO: Inherit from the last defined? + - name: "resonance2_curveccN" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate resonance2." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + - name: "resonance2_smoothccN" + value: + type_name: "float" + default: 0 + min: 0 + unit: "ms" + - name: "resonance2_stepccN" + value: + type_name: "integer" + default: 0 + min: 0 + + - name: "resonance_random" + short_description: + "Filter cutoff resonance random value, in decibels." + version: "ARIA" + value: + type_name: "float" + default: 0 + min: 0 + max: 40 + unit: "dB" + + - name: "resonance2_random" + short_description: + "Filter#2 cutoff resonance random value, in decibels." + version: "ARIA" + value: + type_name: "float" + default: 0 + min: 0 + max: 40 + unit: "dB" + + - name: "noise_filter" + version: "SFZ v2" + short_description: "" + value: + type_name: "string" + options: + - name: "on" + - name: "off" + - name: "lpf_1p" + - name: "hpf_1p" + - name: "bpf_1p" + - name: "brf_1p" + - name: "apf_1p" + - name: "lpf_2p" + - name: "hpf_2p" + - name: "bpf_2p" + - name: "brf_2p" + - name: "pkf_2p" + - name: "lpf_4p" + - name: "hpf_4p" + - name: "lpf_6p" + - name: "hpf_6p" + - name: "comb" + - name: "pink" + + - name: "noise_stereo" + version: "SFZ v2" + short_description: "" + value: + type_name: "string" + options: + - name: "on" + - name: "off" + + - name: "noise_level" + version: "SFZ v2" + short_description: "" + value: + type_name: "float" + min: -96 + max: 24 + unit: "dB" + modulation: + midi_cc: + - name: "noise_level_onccN" + value: + type_name: "float" + min: -96 + max: 24 + unit: "dB" + - name: "noise_level_smoothccN" + value: + type_name: "float" + min: 0 + default: 0 + unit: "ms" + + - name: "noise_step" + version: "SFZ v2" + short_description: "" + value: + type_name: "integer" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "noise_step_onccN" + value: + type_name: "integer" + min: 0 + max: 100 + + - name: "noise_tone" + version: "SFZ v2" + short_description: "" + value: + type_name: "integer" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "noise_tone_onccN" + value: + type_name: "integer" + min: 0 + max: 100 + + - name: "Pitch" + id: "ptc" + opcodes: + - name: "bend_up" + version: "SFZ v1" + short_description: + "Pitch bend range when Bend Wheel or Joystick is moved up, in cents." + value: + type_name: "integer" + default: 200 + min: -9600 + max: 9600 + unit: "cents" + alias: + - name: "bendup" + + - name: "bend_down" + version: "SFZ v1" + short_description: + "Pitch bend range when Bend Wheel or Joystick is moved down, in cents." + value: + type_name: "integer" + default: -200 + min: -9600 + max: 9600 + unit: "cents" + alias: + - name: "benddown" + + - name: "bend_smooth" + version: "SFZ v2" + short_description: + "Pitch bend smoothness. Adds “inertia” to pitch bends, + so fast movements of the pitch bend wheel will have a delayed effect + on the pitch change." + value: + type_name: "float" + min: 0 + default: 0 + unit: "ms" + + - name: "bend_step" + version: "SFZ v1" + short_description: "Pitch bend step, in cents." + value: + type_name: "integer" + default: 1 + min: 1 + max: 1200 + unit: "cents" + alias: + - name: "bendstep" + + - name: "tune" + version: "SFZ v1" + short_description: "The fine tuning for the sample, in cents." + alias: + - name: "pitch" + version: "ARIA" + short_description: + "Pitch change in cents. ARIA alias for tune." + value: + type_name: "integer" + default: 0 + min: -100 + max: 100 + unit: "cents" + modulation: + midi_cc: + - name: "pitch_onccN" + version: "SFZ v2" + alias: + - name: "tune_ccN" + version: "ARIA" + - name: "tune_onccN" + version: "ARIA" + value: + min: -9600 + max: 9600 + unit: "cents" + - name: "pitch_curveccN" + version: "SFZ v2" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate pitch." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + alias: + - name: "tune_curveccN" + version: "ARIA" + - name: "pitch_smoothccN" + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: 0 + unit: "ms" + alias: + - name: "tune_smoothccN" + version: "ARIA" + - name: "pitch_stepccN" + version: "SFZ v2" + alias: + - name: "tune_stepccN" + version: "ARIA" + value: + min: 0 + default: 0 + + - name: "group_tune" + short_description: + "ARIA extension, like tune, + but affecting everything when set under + the <group> header." + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: -9600 + max: 9600 + unit: "cents" + + - name: "master_tune" + short_description: + "ARIA extension, like tune, + but affecting everything when set under + the <master> header." + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: -9600 + max: 9600 + unit: "cents" + + - name: "global_tune" + short_description: + "ARIA extension, like tune, + but affecting everything when set under + the <global> header." + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: -9600 + max: 9600 + unit: "cents" + + - name: "pitch_keycenter" + short_description: "Root key for the sample." + version: "SFZ v1" + value: + type_name: "integer" + default: 60 # (C4) + min: 0 + max: 127 + + - name: "pitch_keytrack" + short_description: + "Within the region, this value defines how much + the pitch changes with every note." + version: "SFZ v1" + value: + type_name: "integer" + default: 100 + min: -1200 + max: 1200 + unit: "cents" + alias: + - name: "tune_keytrack" + version: "ARIA" + + - name: "pitch_random" + short_description: "Random tuning for the region, in cents." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: 0 + max: 9600 + unit: "cents" + alias: + - name: "tune_random" + version: "ARIA" + + - name: "pitch_veltrack" + short_description: + "Pitch velocity tracking, represents how much the pitch changes + with incoming note velocity, in cents." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: -9600 + max: 9600 + unit: "cents" + alias: + - name: "tune_veltrack" + version: "ARIA" + + - name: "transpose" + short_description: + "The transposition value for this region + which will be applied to the sample." + version: "SFZ v1" + value: + type_name: "integer" + default: 0 + min: -127 + max: 127 + + - name: "bend_stepup" + version: "SFZ v2" + short_description: + "Pitch bend step, in cents, applied to upwards bends only." + value: + type_name: "integer" + default: 1 + min: 1 + max: 1200 + unit: "cents" + + - name: "bend_stepdown" + version: "SFZ v2" + short_description: "Pitch bend step, in cents, for downward pitch bends." + value: + type_name: "integer" + default: 1 + min: 1 + max: 1200 + unit: "cents" + +- name: "Modulation" + url: "/misc/categories#modulation" + short_description: "Modulation opcodes comprise of all the LFO and EG controls." + types: + - name: "Envelope Generators" + id: "eg" + url: "/modulations/envelope_generators" + opcodes: + - name: "ampeg_attack" + alias: + - name: "amp_attack" + version: "SFZ v2" + deprecated: true + short_description: "EG attack time." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + modulation: + midi_cc: + - name: "ampeg_attackccN" + alias: + - name: "ampeg_attack_onccN" + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + - name: "ampeg_attack_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "ampeg_vel2attack" + short_description: "Velocity effect on EG attack time." + alias: + - name: "amp_vel2attack" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + + - name: "ampeg_decay" + short_description: "EG decay time." + version: "SFZ v1" + alias: + - name: "amp_decay" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + modulation: + midi_cc: + - name: "ampeg_decayccN" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + alias: + - name: "ampeg_decay_onccN" + version: "SFZ v2" + - name: "ampeg_decay_curveccN" + version: "ARIA" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate ampeg_decay." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "ampeg_vel2decay" + short_description: "Velocity effect on EG decay time." + alias: + - name: "amp_vel2decay" + deprecated: true + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + + - name: "ampeg_delay" + short_description: "EG delay time." + version: "SFZ v1" + alias: + - name: "amp_delay" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + modulation: + envelope: "✓" + midi_cc: + - name: "ampeg_delayccN" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + alias: + - name: "ampeg_delay_onccN" + version: "SFZ v2" + - name: "ampeg_delay_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "ampeg_vel2delay" + short_description: "Velocity effect on EG delay time." + alias: + - name: "amp_vel2delay" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + + - name: "ampeg_hold" + version: "SFZ v1" + short_description: "EG hold time." + alias: + - name: "amp_hold" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + modulation: + envelope: "✓" + midi_cc: + - name: "ampeg_holdccN" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + alias: + - name: "ampeg_hold_onccN" + version: "SFZ v2" + - name: "ampeg_hold_curveccN" + version: "ARIA" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate ampeg_hold." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "ampeg_vel2hold" + short_description: "Velocity effect on EG hold time." + alias: + - name: "amp_vel2hold" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + + - name: "ampeg_release" + short_description: "EG release time (after note release)." + version: "SFZ v1" + alias: + - name: "amp_release" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0.001 + min: 0 + max: 100 + unit: "seconds" + modulation: + midi_cc: + - name: "ampeg_releaseccN" + alias: + - name: "ampeg_release_onccN" + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + - name: "ampeg_release_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "ampeg_vel2release" + short_description: "Velocity effect on EG release time." + alias: + - name: "amp_vel2release" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + + - name: "ampeg_sustain" + short_description: "EG sustain level, in percentage." + version: "SFZ v1" + alias: + - name: "amp_sustain" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 100 + min: 0 + max: 100 + unit: "%" + modulation: + midi_cc: + - name: "ampeg_sustainccN" + alias: + - name: "ampeg_sustain_onccN" + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "%" + - name: "ampeg_sustain_curveccN" + version: "ARIA" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate ampeg_sustain." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "ampeg_vel2sustain" + short_description: "Velocity effect on EG sustain level, in percentage." + alias: + - name: "amp_vel2sustain" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "%" + + - name: "ampeg_start" + short_description: "Envelope start level, in percentage." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "%" + modulation: + envelope: "✓" + midi_cc: + - name: "ampeg_startccN" + alias: + - name: "ampeg_start_onccN" + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "%" + - name: "ampeg_start_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + + - name: "ampeg_attack_shape" + short_description: "Specifies the curvature of attack stage of the envelope." + version: "ARIA" + value: + type_name: "float" + default: 0 + + - name: "ampeg_decay_shape" + version: "ARIA" + short_description: "Specifies the curvature of decay stage of the envelope." + value: + type_name: "float" + default: -10.3616 + + - name: "ampeg_decay_zero" + short_description: "Specifies how decay time is calculated." + version: "ARIA" + value: + type_name: "integer" + default: 1 + min: 0 + max: 1 + + - name: "ampeg_dynamic" + short_description: "Specifies when envelope durations are recalculated." + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 1 + + - name: "ampeg_release_shape" + short_description: "Specifies the curvature of release stage of the envelope." + version: "ARIA" + value: + type_name: "float" + default: -10.3616 + + - name: "ampeg_release_zero" + short_description: "Specifies how release time is calculated." + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 1 + + - name: "fileg_attack_shape" + short_description: "Specifies the curvature of attack stage of the envelope." + version: "ARIA" + value: + type_name: "float" + default: 0 + + - name: "fileg_decay_shape" + version: "ARIA" + short_description: "Specifies the curvature of decay stage of the envelope." + value: + type_name: "float" + default: 0 + + - name: "fileg_decay_zero" + short_description: "Specifies how decay time is calculated." + version: "ARIA" + value: + type_name: "integer" + default: 1 + min: 0 + max: 1 + + - name: "fileg_release_shape" + short_description: "Specifies the curvature of release stage of the envelope." + version: "ARIA" + value: + type_name: "float" + default: 0 + + - name: "fileg_release_zero" + short_description: "Specifies how release time is calculated." + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 1 + + - name: "fileg_dynamic" + short_description: "Specifies when envelope durations are recalculated." + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 1 + + - name: "pitcheg_attack_shape" + short_description: "Specifies the curvature of attack stage of the envelope." + version: "ARIA" + value: + type_name: "float" + default: 0 + + - name: "pitcheg_decay_shape" + version: "ARIA" + short_description: "Specifies the curvature of decay stage of the envelope." + value: + type_name: "float" + default: 0 + + - name: "pitcheg_decay_zero" + short_description: "Specifies how decay time is calculated." + version: "ARIA" + value: + type_name: "integer" + default: 1 + min: 0 + max: 1 + + - name: "pitcheg_release_shape" + short_description: "Specifies the curvature of release stage of the envelope." + version: "ARIA" + value: + type_name: "float" + default: 0 + + - name: "pitcheg_release_zero" + short_description: "Specifies how release time is calculated." + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 1 + + - name: "pitcheg_dynamic" + short_description: "Specifies when envelope durations are recalculated." + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 1 + + - name: "fileg_attack" + short_description: "EG attack time." + version: "SFZ v1" + alias: + - name: "fil_attack" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + modulation: + midi_cc: + - name: "fileg_attack_onccN" + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + alias: + - name: "fileg_attackccN" + - name: "fileg_attack_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "fileg_vel2attack" + short_description: "Velocity effect on EG attack time." + alias: + - name: "fil_vel2attack" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + + - name: "fileg_decay" + short_description: "EG decay time." + version: "SFZ v1" + alias: + - name: "fil_decay" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + modulation: + midi_cc: + - name: "fileg_decay_onccN" + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + alias: + - name: "fileg_decayccN" + - name: "fileg_decay_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "fileg_vel2decay" + short_description: "Velocity effect on filter EG decay time." + alias: + - name: "fil_vel2decay" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + + - name: "fileg_delay" + short_description: "EG delay time." + version: "SFZ v1" + alias: + - name: "fil_delay" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + modulation: + envelope: "✓" + midi_cc: + - name: "fileg_delay_onccN" + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + alias: + - name: "fileg_delayccN" + - name: "fileg_delay_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "fileg_vel2delay" + short_description: "Velocity effect on filter EG delay time." + alias: + - name: "fil_vel2delay" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + + - name: "fileg_depth" + short_description: "Envelope depth." + version: "SFZ v1" + alias: + - name: "fil_depth" + version: "SFZ v2" + deprecated: true + value: + type_name: "integer" + default: 0 + min: -12000 + max: 12000 + unit: "cents" + modulation: + midi_cc: + - name: "fileg_depth_onccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: -12000 + max: 12000 + unit: "cents" + alias: + - name: "fileg_depthccN" + - name: "fileg_depth_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "fileg_vel2depth" + short_description: + "Velocity effect on EG depth, in cents for pitch or filter cutoff." + alias: + - name: "fil_vel2depth" + version: "SFZ v2" + deprecated: true + value: + type_name: "integer" + default: 0 + min: -12000 + max: 12000 + unit: "cents" + + - name: "fileg_hold" + short_description: "EG hold time." + version: "SFZ v1" + alias: + - name: "fil_hold" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + modulation: + envelope: "✓" + midi_cc: + - name: "fileg_hold_onccN" + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + alias: + - name: "fileg_holdccN" + - name: "fileg_hold_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "fileg_vel2hold" + short_description: "Velocity effect on EG hold time." + alias: + - name: "fil_vel2hold" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + + - name: "fileg_release" + short_description: "EG release time (after note release)." + version: "SFZ v1" + alias: + - name: "fil_release" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + modulation: + midi_cc: + - name: "fileg_release_onccN" + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + alias: + - name: "fileg_releaseccN" + - name: "fileg_release_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "fileg_vel2release" + short_description: "Velocity effect on EG release time." + alias: + - name: "fil_vel2release" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + + - name: "fileg_start" + short_description: "Envelope start level, in percentage." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "%" + modulation: + envelope: "✓" + midi_cc: + - name: "fileg_start_onccN" + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + alias: + - name: "fileg_startccN" + - name: "fileg_start_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + + - name: "fileg_sustain" + short_description: "EG sustain level, in percentage." + version: "SFZ v1" + alias: + - name: "fil_sustain" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "%" + modulation: + midi_cc: + - name: "fileg_sustain_onccN" + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "%" + alias: + - name: "fileg_sustainccN" + - name: "fileg_sustain_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "fileg_vel2sustain" + short_description: "Velocity effect on EG sustain level, in percentage." + alias: + - name: "fil_vel2sustain" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "%" + + - name: "pitcheg_attack" + short_description: "EG attack time." + version: "SFZ v1" + alias: + - name: "pitch_attack" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + modulation: + midi_cc: + - name: "pitcheg_attack_onccN" + version: "ARIA" + - name: "pitcheg_attack_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "pitcheg_vel2attack" + short_description: "Velocity effect on EG attack time." + alias: + - name: "pitch_vel2attack" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + + - name: "pitcheg_decay" + short_description: "EG decay time." + version: "SFZ v1" + alias: + - name: "pitch_decay" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + modulation: + midi_cc: + - name: "pitcheg_decay_onccN" + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + - name: "pitcheg_decay_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "pitcheg_vel2decay" + short_description: "Velocity effect on EG decay time." + alias: + - name: "pitch_vel2decay" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + + - name: "pitcheg_delay" + short_description: "EG delay time." + version: "SFZ v1" + alias: + - name: "pitch_delay" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + modulation: + envelope: "✓" + midi_cc: + - name: "pitcheg_delay_onccN" + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + - name: "pitcheg_delay_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "pitcheg_vel2delay" + short_description: "Velocity effect on EG delay time." + alias: + - name: "pitch_vel2delay" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + + - name: "pitcheg_depth" + short_description: "Envelope depth." + version: "SFZ v1" + alias: + - name: "pitch_depth" + version: "SFZ v2" + deprecated: true + value: + type_name: "integer" + default: 0 + min: -12000 + max: 12000 + unit: "cents" + modulation: + midi_cc: + - name: "pitcheg_depth_onccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: -12000 + max: 12000 + unit: "cents" + alias: + - name: "pitcheg_depthccN" + - name: "pitcheg_depth_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "pitcheg_vel2depth" + short_description: + "Velocity effect on EG depth, in cents for pitch or filter cutoff." + alias: + - name: "pitch_vel2depth" + version: "SFZ v2" + deprecated: true + value: + type_name: "integer" + default: 0 + min: -12000 + max: 12000 + unit: "cents" + + - name: "pitcheg_hold" + short_description: "EG hold time." + version: "SFZ v1" + alias: + - name: "pitch_hold" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + modulation: + envelope: "✓" + midi_cc: + - name: "pitcheg_hold_onccN" + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + - name: "pitcheg_hold_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "pitcheg_vel2hold" + short_description: "Velocity effect on EG hold time." + alias: + - name: "pitch_vel2hold" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + + - name: "pitcheg_release" + version: "SFZ v1" + short_description: "EG release time (after note release)." + alias: + - name: "pitch_release" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + modulation: + midi_cc: + - name: "pitcheg_release_onccN" + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + - name: "pitcheg_release_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "pitcheg_vel2release" + short_description: "Velocity effect on EG release time." + alias: + - name: "pitch_vel2release" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "seconds" + + - name: "pitcheg_start" + short_description: "Envelope start level, in percentage." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "%" + modulation: + envelope: "✓" + midi_cc: + - name: "pitcheg_start_onccN" + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "%" + - name: "pitcheg_start_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + + - name: "pitcheg_sustain" + short_description: "EG sustain level, in percentage." + version: "SFZ v1" + alias: + - name: "pitch_sustain" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "%" + modulation: + midi_cc: + - name: "pitcheg_sustain_onccN" + version: "ARIA" + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "%" + - name: "pitcheg_sustain_curveccN" + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + velocity: + - name: "pitcheg_vel2sustain" + short_description: "Velocity effect on EG sustain level, in percentage." + alias: + - name: "pitch_vel2sustain" + version: "SFZ v2" + deprecated: true + value: + type_name: "float" + default: 0 + min: -100 + max: 100 + unit: "%" + + - name: "egN_points" + short_description: "" + version: "SFZ v2" + + - name: "egN_timeX" + short_description: "" + version: "SFZ v2" + value: + type_name: "float" + unit: "seconds" + modulation: + midi_cc: + - name: "egN_timeX_onccY" + value: + type_name: "float" + unit: "seconds" + + - name: "egN_levelX" + short_description: + "Sets the envelope level at a specific point in envelope number N." + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: -1 + max: 1 + modulation: + midi_cc: + - name: "egN_levelX_onccY" + value: + type_name: "float" + default: 0 + min: -1 + max: 1 + + - name: "egN_ampeg" + short_description: "" + version: "ARIA" + + - name: "egN_dynamic" + short_description: "Specifies when envelope durations are recalculated." + version: "ARIA" + value: + type_name: "integer" + default: 0 + min: 0 + max: 1 + + - name: "egN_shapeX" + short_description: "" + version: "SFZ v2" + value: + type_name: "float" + default: 0 + + - name: "egN_curveX" + short_description: + "Instructs the player to use a curve shape defined under a curve header + for the specified envelope segment." + version: "SFZ v2" + + - name: "egN_sustain" + short_description: "" + version: "SFZ v2" + + - name: "egN_loop" + short_description: "" + version: "SFZ v2" + + - name: "egN_loop_count" + short_description: "" + version: "SFZ v2" + + - name: "egN_volume" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_volume_onccX" + + - name: "egN_amplitude" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_amplitude_onccX" + + - name: "egN_pan" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_pan_onccX" + + - name: "egN_width" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_width_onccX" + + - name: "egN_pan_curve" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_pan_curveccX" + short_description: + "Specifies the <curve> number + which MIDI CC X uses to modulate egN_pan." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + + - name: "egN_freq_lfoX" + short_description: "Allows egN to shape a change to lfoX's frequency" + version: "SFZ v2" + value: + type_name: "float" + default: 0 + unit: "Hz" + + - name: "egN_depth_lfoX" + short_description: "Allows egN to scale lfoX's effect on its targets" + version: "SFZ v2" + value: + type_name: "float" + default: 100 + unit: "%" + + - name: "egN_depthadd_lfoX" + short_description: "" + version: "SFZ v2" + + - name: "egN_pitch" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_pitch_onccX" + + - name: "egN_cutoff" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_cutoff_onccX" + + - name: "egN_cutoff2" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_cutoff2_onccX" + + - name: "egN_resonance" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_resonance_onccX" + + - name: "egN_resonance2" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_resonance2_onccX" + + - name: "egN_eqXfreq" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_eqXfreq_onccY" + + - name: "egN_eqXbw" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_eqXbw_onccY" + + - name: "egN_eqXgain" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_eqXgain_onccY" + + - name: "egN_decim" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_decim_onccX" + + - name: "egN_bitred" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_bitred_onccX" + + - name: "egN_rectify" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_rectify_onccX" + + - name: "egN_ringmod" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_ringmod_onccX" + + - name: "egN_noiselevel" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_noiselevel_onccX" + + - name: "egN_noisestep" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_noisestep_onccX" + + - name: "egN_noisetone" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_noisetone_onccX" + + - name: "egN_driveshape" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "egN_driveshape_onccX" + + - name: "egN_sample_dyn_paramX" + short_description: "ARIA-specific nameless destination for plugin envelope modulations." + version: "ARIA" + modulation: + midi_cc: + - name: "egN_sample_dyn_paramX_onccY" + + - name: "LFO" + id: "lfo" + url: "/modulations/lfo" + short_description: "Low Frequency Oscillator." + opcodes: + - name: "amplfo_delay" + short_description: "The time before the LFO starts oscillating." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + + - name: "amplfo_depth" + short_description: "LFO depth." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: -10 + max: 10 + unit: "dB" + modulation: + midi_cc: + - name: "amplfo_depthccN" + value: + type_name: "float" + default: 0 + min: -10 + max: 10 + unit: "dB" + alias: + - name: "amplfo_depth_onccN" + version: "SFZ v2" + - name: "amplfo_depthchanaft" + short_description: + "LFO depth when channel aftertouch MIDI messages are received." + value: + type_name: "float" + default: 0 + min: -10 + max: 10 + unit: "dB" + - name: "amplfo_depthpolyaft" + short_description: + "LFO depth when polyphonic aftertouch MIDI messages are received." + value: + type_name: "float" + default: 0 + min: -10 + max: 10 + unit: "dB" + + - name: "amplfo_fade" + short_description: "LFO fade-in effect time." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + + - name: "amplfo_freq" + short_description: "LFO frequency, in hertz." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 20 + unit: "Hz" + modulation: + midi_cc: + - name: "amplfo_freqccN" + value: + type_name: "float" + default: 0 + min: -200 + max: 200 + unit: "Hz" + - name: "amplfo_freqchanaft" + short_description: + "LFO frequency change when channel aftertouch + MIDI messages are received, in Hertz." + value: + type_name: "float" + default: 0 + min: -200 + max: 200 + unit: "Hz" + - name: "amplfo_freqpolyaft" + short_description: + "LFO frequency change when polyphonic aftertouch + MIDI messages are received, in Hertz." + value: + type_name: "float" + default: 0 + min: -200 + max: 200 + unit: "Hz" + + - name: "fillfo_delay" + short_description: "The time before the LFO starts oscillating." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + + - name: "fillfo_depth" + short_description: "LFO depth." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: -1200 + max: 1200 + unit: "cents" + modulation: + midi_cc: + - name: "fillfo_depthccN" + value: + type_name: "float" + default: 0 + min: -1200 + max: 1200 + unit: "cents" + alias: + - name: "fillfo_depth_onccN" + version: "SFZ v2" + - name: "fillfo_depthchanaft" + short_description: + "LFO depth when channel aftertouch MIDI messages are received." + value: + type_name: "float" + default: 0 + min: -1200 + max: 1200 + unit: "cents" + - name: "fillfo_depthpolyaft" + short_description: + "LFO depth when polyphonic aftertouch MIDI messages are received." + value: + type_name: "float" + default: 0 + min: -1200 + max: 1200 + unit: "cents" + + - name: "fillfo_fade" + short_description: "LFO fade-in effect time." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + + - name: "fillfo_freq" + short_description: "LFO frequency, in hertz." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 20 + unit: "Hz" + modulation: + midi_cc: + - name: "fillfo_freqccN" + value: + type_name: "float" + default: 0 + min: -200 + max: 200 + unit: "Hz" + - name: "fillfo_freqchanaft" + short_description: + "LFO frequency change when channel aftertouch + MIDI messages are received, in Hertz." + value: + type_name: "float" + default: 0 + min: -200 + max: 200 + unit: "Hz" + - name: "fillfo_freqpolyaft" + short_description: + "LFO frequency change when polyphonic aftertouch + MIDI messages are received, in Hertz." + value: + type_name: "float" + default: 0 + min: -200 + max: 200 + unit: "Hz" + + - name: "pitchlfo_delay" + short_description: "The time before the LFO starts oscillating." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + + - name: "pitchlfo_depth" + short_description: "LFO depth." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: -1200 + max: 1200 + unit: "cents" + modulation: + midi_cc: + - name: "pitchlfo_depthccN" + value: + type_name: "float" + default: 0 + min: -1200 + max: 1200 + unit: "cents" + alias: + - name: "pitchlfo_depth_onccN" + version: "SFZ v2" + - name: "pitchlfo_depthchanaft" + short_description: + "LFO depth when channel aftertouch MIDI messages are received." + value: + type_name: "float" + default: 0 + min: -1200 + max: 1200 + unit: "cents" + - name: "pitchlfo_depthpolyaft" + short_description: + "LFO depth when polyphonic aftertouch MIDI messages are received." + value: + type_name: "float" + default: 0 + min: -1200 + max: 1200 + unit: "cents" + + - name: "pitchlfo_fade" + short_description: "LFO fade-in effect time." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "seconds" + + - name: "pitchlfo_freq" + short_description: "LFO frequency, in hertz." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 20 + unit: "Hz" + modulation: + midi_cc: + - name: "pitchlfo_freqccN" + value: + type_name: "float" + default: 0 + min: -200 + max: 200 + unit: "Hz" + - name: "pitchlfo_freqchanaft" + short_description: + "LFO frequency change when channel aftertouch + MIDI messages are received, in Hertz." + value: + type_name: "float" + default: 0 + min: -200 + max: 200 + unit: "Hz" + - name: "pitchlfo_freqpolyaft" + short_description: + "LFO frequency change when polyphonic aftertouch + MIDI messages are received, in Hertz." + value: + type_name: "float" + default: 0 + min: -200 + max: 200 + unit: "Hz" + + - name: "lfoN_freq" + short_description: "The base frequency of LFO number N, in Hertz." + version: "SFZ v2" + value: + type_name: "float" + unit: "Hz" + modulation: + envelope: "egN_freq_lfoX" + midi_cc: + - name: "lfoN_freq_onccX" + - name: "lfoN_freq_smoothccX" + - name: "lfoN_freq_stepccX" + + - name: "lfoN_delay" + short_description: "Onset delay for LFO number N." + version: "SFZ v2" + value: + type_name: "float" + default: 0 + unit: "seconds" + modulation: + envelope: "egN_freq_lfoX" + midi_cc: + - name: "lfoN_delay_onccX" + + - name: "lfoN_fade" + short_description: "Fade-in time for LFO number N." + version: "SFZ v2" + value: + type_name: "float" + modulation: + midi_cc: + - name: "lfoN_fade_onccX" + value: + type_name: "float" + + - name: "lfoN_phase" + short_description: "Initial phase shift for LFO number N." + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: 0 + max: 1 + modulation: + midi_cc: + - name: "lfoN_phase_onccX" + + - name: "lfoN_count" + short_description: "Number of LFO repetitions for LFO N before the LFO stops." + version: "SFZ v2" + value: + type_name: "integer" + + - name: "lfoN_wave" + short_description: "LFO waveform selection." + version: "SFZ v2" + value: + type_name: "integer" + default: 1 + modulation: + midi_cc: + - name: "lfoN_wave_onccX" + version: "ARIA" + alias: + - name: "lfoN_waveX" + short_description: + "Select the waveform type used for the waveform number X (max 8) + for LFO number N, with the same allowed values as + lfoN_wave normally can use." + version: "ARIA" + + - name: "lfoN_steps" + short_description: "Number of steps in LFO step sequencer." + version: "SFZ v2" + value: + type_name: "integer" + + - name: "lfoN_stepX" + short_description: "Level of the step number X in LFO step sequencer." + version: "SFZ v2" + value: + type_name: "float" + min: -100 + max: 100 + unit: "percent" + modulation: + midi_cc: + - name: "lfoN_stepX_onccY" + + - name: "lfoN_smooth" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_smooth_onccX" + + - name: "lfoN_volume" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_volume_onccX" + - name: "lfoN_volume_smoothccX" + - name: "lfoN_volume_stepccX" + + - name: "lfoN_amplitude" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_amplitude_onccX" + - name: "lfoN_amplitude_smoothccX" + - name: "lfoN_amplitude_stepccX" + + - name: "lfoN_pan" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_pan_onccX" + - name: "lfoN_pan_smoothccX" + - name: "lfoN_pan_stepccX" + + - name: "lfoN_width" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_width_onccX" + - name: "lfoN_width_smoothccX" + - name: "lfoN_width_stepccX" + + - name: "lfoN_freq_lfoX" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_freq_lfoX_onccY" + version: "ARIA" + + - name: "lfoN_depth_lfoX" + short_description: "" + version: "SFZ v2" + + - name: "lfoN_depthadd_lfoX" + short_description: "" + version: "SFZ v2" + + - name: "lfoN_pitch" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_pitch_curveccX" + short_description: + "Specifies the <curve> number + which MIDI CC X uses to modulate lfoN_pitch." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + - name: "lfoN_pitch_onccX" + - name: "lfoN_pitch_smoothccX" + - name: "lfoN_pitch_stepccX" + + - name: "lfoN_cutoff" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_cutoff_onccX" + - name: "lfoN_cutoff_smoothccX" + - name: "lfoN_cutoff_stepccX" + alias: + - name: "lfoN_cutoff2" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_cutoff2_onccX" + - name: "lfoN_cutoff2_smoothccX" + - name: "lfoN_cutoff2_stepccX" + + - name: "lfoN_resonance" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_resonance_onccX" + - name: "lfoN_resonance_smoothccX" + - name: "lfoN_resonance_stepccX" + alias: + - name: "lfoN_resonance2" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_resonance2_onccX" + - name: "lfoN_resonance2_smoothccX" + - name: "lfoN_resonance2_stepccX" + + - name: "lfoN_eqXfreq" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_eqXfreq_onccY" + - name: "lfoN_eqXfreq_smoothccY" + - name: "lfoN_eqXfreq_stepccY" + + - name: "lfoN_eqXbw" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_eqXbw_onccY" + - name: "lfoN_eqXbw_smoothccY" + - name: "lfoN_eqXbw_stepccY" + + - name: "lfoN_eqXgain" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_eqXgain_onccY" + - name: "lfoN_eqXgain_smoothccY" + - name: "lfoN_eqXgain_stepccY" + + - name: "lfoN_decim" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_decim_onccX" + - name: "lfoN_decim_smoothccX" + - name: "lfoN_decim_stepccX" + + - name: "lfoN_bitred" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_bitred_onccX" + - name: "lfoN_bitred_smoothccX" + - name: "lfoN_bitred_stepccX" + + - name: "lfoN_noiselevel" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_noiselevel_onccX" + - name: "lfoN_noiselevel_smoothccX" + - name: "lfoN_noiselevel_stepccX" + + - name: "lfoN_noisestep" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_noisestep_onccX" + - name: "lfoN_noisestep_smoothccX" + - name: "lfoN_noisestep_stepccX" + + - name: "lfoN_noisetone" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_noisetone_onccX" + - name: "lfoN_noisetone_smoothccX" + - name: "lfoN_noisetone_stepccX" + + - name: "lfoN_drive" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "lfoN_drive_onccX" + - name: "lfoN_drive_smoothccX" + - name: "lfoN_drive_stepccX" + + - name: "lfoN_offset" + short_description: + "DC offset - Add to LFO output; not affected by scale." + version: "ARIA" + alias: + - name: "lfoN_offsetX" + value: + type_name: "float" + + - name: "lfoN_ratio" + short_description: + "Sets the ratio between the specified sub waveform and the main waveform." + version: "ARIA" + alias: + - name: "lfoN_ratioX" + value: + type_name: "float" + + - name: "lfoN_scale" + short_description: + "Sets the scaling between the specified sub waveform and the main waveform." + version: "ARIA" + alias: + - name: "lfoN_scaleX" + value: + type_name: "float" + + - name: "lfoN_sample_dyn_paramX" + short_description: "ARIA-specific nameless destination for plugin LFO modulations." + version: "ARIA" + modulation: + midi_cc: + - name: "lfoN_sample_dyn_paramX_onccY" + +- name: "Curves" + id: "crv" + url: "/headers/curve" + opcodes: + - name: "curve_index" + short_description: "Curve definition ID." + version: "ARIA" + value: + type_name: "integer" + min: 0 + max: 255 + + - name: "vNNN" + short_description: "Defines a point in a custom curve definition." + version: "SFZ v2" + index: + type_name: "integer" + min: 0 + max: 127 + value: + type_name: "float" + min: -1 + max: 1 + +- name: "Effects" + id: "efx" + url: "/headers/effect" + opcodes: + - name: "apan_depth" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "apan_depth_onccN" + + - name: "apan_dry" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "apan_dry_onccN" + + - name: "apan_freq" + short_description: "" + version: "SFZ v2" + value: + type_name: "float" + unit: "Hz" + modulation: + midi_cc: + - name: "apan_freq_onccN" + + - name: "apan_phase" + short_description: "" + version: "SFZ v2" + value: + type_name: "float" + min: 0 + max: 180 + unit: "°" + modulation: + midi_cc: + - name: "apan_phase_onccN" + + - name: "apan_waveform" + short_description: "LFO wave number." + version: "SFZ v2" + + - name: "apan_wet" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "apan_wet_onccN" + + - name: "bitred" + version: "SFZ v2" + short_description: "Bit reduction." + value: + type_name: "" + min: 0 + max: 100 + modulation: + envelope: "✓" + lfo: "✓" + midi_cc: + - name: "bitred_onccN" + - name: "bitred_curveccN" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate bitred." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + - name: "bitred_smoothccN" + - name: "bitred_stepccN" + + - name: "bus" + version: "SFZ v2" + short_description: + "The target bus for the effect." + value: + type_name: "string" + default: "main" + options: + - name: "main" + - name: "aux1" + - name: "aux2" + - name: "aux3" + - name: "aux4" + - name: "aux5" + - name: "aux6" + - name: "aux7" + - name: "aux8" + - name: "fx1" + - name: "fx2" + - name: "fx3" + - name: "fx4" + - name: "midi" + version: "ARIA" + + - name: "bypass_onccN" + short_description: + "Sets up a bypass controller for the effect." + version: "SFZ v2" + value: + type_name: "float" + + - name: "comp_attack" + short_description: "" + version: "SFZ v2" + value: + type_name: "float" + unit: "seconds" + + - name: "comp_gain" + short_description: "" + version: "SFZ v2" + #value: + #type_name: "float" + #unit: "dB" + + - name: "comp_ratio" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + + - name: "comp_release" + short_description: "" + version: "SFZ v2" + value: + type_name: "float" + unit: "seconds" + + - name: "comp_stlink" + short_description: "" + version: "SFZ v2" + value: + type_name: "string" + options: + - name: "on" + - name: "off" + + - name: "comp_threshold" + short_description: "" + version: "SFZ v2" + value: + type_name: "float" + unit: "dB" + + - name: "decim" + version: "SFZ v2" + short_description: "Decimator." + value: + type_name: "" + min: 0 + max: 100 + modulation: + envelope: "✓" + lfo: "✓" + midi_cc: + - name: "decim_onccN" + - name: "decim_curveccN" + short_description: + "Specifies the <curve> number + which MIDI CC N uses to modulate decim." + value: + type_name: "integer" + default: 0 + min: 0 + max: 255 + - name: "decim_smoothccN" + - name: "decim_stepccN" + + - name: "delay_cutoff" + short_description: "" + version: "SFZ v2" + value: + type_name: "float" + unit: "Hz" + modulation: + midi_cc: + - name: "delay_cutoff_onccN" + + - name: "delay_damphi" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "delay_damphi_onccN" + + - name: "delay_damplo" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "delay_damplo_onccN" + + - name: "delay_dry" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "delay_dry_onccN" + + - name: "delay_feedback" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "delay_feedback_onccN" + + - name: "delay_filter" + short_description: "Name of filter type." + version: "SFZ v2" + value: + type_name: "string" + + - name: "delay_input" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "delay_input_onccN" + + - name: "delay_levelc" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + + - name: "delay_levell" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + + - name: "delay_levelr" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + + - name: "delay_lfofreq" + short_description: "" + version: "SFZ v2" + value: + type_name: "float" + unit: "Hz" + modulation: + midi_cc: + - name: "delay_lfofreq_onccN" + + - name: "delay_moddepth" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "delay_moddepth_onccN" + + - name: "delay_mode" + short_description: "" + version: "SFZ v2" + value: + type_name: "string" + options: + - name: "detune" + - name: "chorus" + - name: "cross" + - name: "flanger" + - name: "lrc" + - name: "mod" + - name: "multimod" + - name: "panning" + - name: "ping" + - name: "rlc" + - name: "stereo" + - name: "tlcr" + + - name: "delay_panc" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "delay_panc_onccN" + + - name: "delay_panl" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "delay_panl_onccN" + + - name: "delay_panr" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "delay_panr_onccN" + + - name: "delay_resonance" + short_description: "" + version: "SFZ v2" + #value: + #type_name: "float" + #unit: "dB" + modulation: + midi_cc: + - name: "delay_resonance_onccN" + + - name: "delay_spread" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "delay_spread_onccN" + + - name: "delay_syncc_onccN" + short_description: "" + version: "SFZ v2" + + - name: "delay_syncl_onccN" + short_description: "" + version: "SFZ v2" + + - name: "delay_syncr_onccN" + short_description: "" + version: "SFZ v2" + + - name: "delay_time_tap" + short_description: "" + version: "SFZ v2" + + - name: "delay_timec" + short_description: "" + version: "SFZ v2" + #value: + #type_name: "float" + #unit: "seconds" + modulation: + midi_cc: + - name: "delay_timec_onccN" + + - name: "delay_timel" + short_description: "" + version: "SFZ v2" + #value: + #type_name: "float" + #unit: "seconds" + modulation: + midi_cc: + - name: "delay_timel_onccN" + + - name: "delay_timer" + short_description: "" + version: "SFZ v2" + #value: + #type_name: "float" + #unit: "seconds" + modulation: + midi_cc: + - name: "delay_timer_onccN" + + - name: "delay_wet" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "delay_wet_onccN" + + - name: "directtomain" + short_description: + "Gain of the main bus into the output." + version: "SFZ v2" + value: + type_name: "float" + unit: "%" + default: 100 + min: 0 + max: 100 + + - name: "disto_depth" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "disto_depth_onccN" + + - name: "disto_dry" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "disto_dry_onccN" + + - name: "disto_stages" + short_description: "" + version: "SFZ v2" + + - name: "disto_tone" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "disto_tone_onccN" + + - name: "disto_wet" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "disto_wet_onccN" + + - name: "dsp_order" + short_description: + "Signal flow type in Rapture's DSP block." + version: "SFZ v2" + value: + type_name: "integer" + min: 0 + max: 14 + + - name: "effect1" + short_description: + "Level of effect1 send, in percentage (reverb in Cakewalk sfz)." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "%" + + - name: "effect2" + short_description: + "Level of effect2 send, in percentage (chorus in Cakewalk sfz)." + version: "SFZ v1" + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "%" + + - name: "effect3" + short_description: + "Gain of the region's send into the 3rd effect bus." + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "%" + + - name: "effect4" + short_description: + "Gain of the region's send into the 4th effect bus." + version: "SFZ v2" + value: + type_name: "float" + default: 0 + min: 0 + max: 100 + unit: "%" + + - name: "eq_bw" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "eq_bw_onccN" + + - name: "eq_freq" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "eq_freq_onccN" + + - name: "eq_gain" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "eq_gain_onccN" + + - name: "eq_type" + short_description: "" + version: "SFZ v2" + + - name: "filter_cutoff" + short_description: "" + version: "SFZ v2" + #value: + #type_name: "float" + #unit: "Hz" + modulation: + midi_cc: + - name: "filter_cutoff_onccN" + + - name: "filter_resonance" + short_description: "" + version: "SFZ v2" + #value: + #type_name: "float" + #unit: "dB" + modulation: + midi_cc: + - name: "filter_resonance_onccN" + + - name: "filter_type" + short_description: "Name of filter type." + version: "SFZ v2" + value: + type_name: "string" + + - name: "fxNtomain" + short_description: + "Gain of the Nth effect bus into the output." + version: "SFZ v2" + value: + type_name: "float" + unit: "%" + default: 0 + min: 0 + max: 100 + + - name: "fxNtomix" + short_description: + "Gain of the Nth effect bus into the Mix node." + version: "SFZ v2" + value: + type_name: "float" + unit: "%" + default: 0 + min: 0 + max: 100 + + - name: "gate_onccN" + short_description: "Gate manual control." + version: "SFZ v2" + + - name: "gate_attack" + short_description: "" + version: "SFZ v2" + #value: + #type_name: "float" + #unit: "seconds" + + - name: "gate_release" + short_description: "" + version: "SFZ v2" + #value: + #type_name: "float" + #unit: "seconds" + + - name: "gate_stlink" + short_description: "" + version: "SFZ v2" + value: + type_name: "string" + options: + - name: "on" + - name: "off" + + - name: "gate_threshold" + short_description: "" + version: "SFZ v2" + #value: + #type_name: "float" + #unit: "dB" + + - name: "internal" + short_description: "Cakewalk internal features switch." + version: "SFZ v2" + value: + type_name: "string" + options: + - name: "on" + - name: "off" + default: "off" + + - name: "param_offset" + short_description: + "Adds a number to the parameter numbers of built-in + or vendor-specific effects." + version: "ARIA" + value: + type_name: "integer" + + - name: "phaser_depth" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "phaser_depth_onccN" + + - name: "phaser_feedback" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "phaser_feedback_onccN" + + - name: "phaser_freq" + short_description: "" + version: "SFZ v2" + value: + type_name: "float" + unit: "Hz" + modulation: + midi_cc: + - name: "phaser_freq_onccN" + + - name: "phaser_phase_onccN" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + + - name: "phaser_stages" + short_description: "" + version: "SFZ v2" + + - name: "phaser_waveform" + short_description: "LFO wave number." + version: "SFZ v2" + + - name: "phaser_wet" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "phaser_wet_onccN" + + - name: "reverb_damp" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "reverb_damp_onccN" + + - name: "reverb_dry" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "reverb_dry_onccN" + + - name: "reverb_input" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "reverb_input_onccN" + + - name: "reverb_predelay" + short_description: "" + version: "SFZ v2" + value: + type_name: "float" + unit: "seconds" + modulation: + midi_cc: + - name: "reverb_predelay_onccN" + + - name: "reverb_size" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "reverb_size_onccN" + + - name: "reverb_tone" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "reverb_tone_onccN" + + - name: "reverb_type" + short_description: "" + version: "SFZ v2" + value: + type_name: "string" + options: + - name: "chamber" + - name: "large_hall" + - name: "large_room" + - name: "mid_hall" + - name: "mid_room" + - name: "small_hall" + - name: "small_room" + + - name: "reverb_wet" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "reverb_wet_onccN" + + - name: "static_cyclic_level" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + + - name: "static_cyclic_time" + short_description: "" + version: "SFZ v2" + value: + type_name: "float" + unit: "seconds" + + - name: "static_filter" + short_description: "Name of filter type." + version: "SFZ v2" + value: + type_name: "string" + + - name: "static_level" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "static_level_onccN" + + - name: "static_random_level" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + + - name: "static_random_maxtime" + short_description: "" + version: "SFZ v2" + value: + type_name: "float" + unit: "seconds" + + - name: "static_random_mintime" + short_description: "" + version: "SFZ v2" + value: + type_name: "float" + unit: "seconds" + + - name: "static_stereo" + short_description: "" + version: "SFZ v2" + + - name: "static_tone" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + + - name: "strings_number" + short_description: "Number of synthesized resonant strings." + version: "SFZ v2" + + - name: "strings_wet_onccN" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + + - name: "tdfir_dry" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "tdfir_dry_onccN" + + - name: "tdfir_gain" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + + - name: "tdfir_impulse" + short_description: "" + version: "SFZ v2" + + - name: "tdfir_wet" + short_description: "" + version: "SFZ v2" + value: + type_name: "" + min: 0 + max: 100 + modulation: + midi_cc: + - name: "tdfir_wet_onccN" + + - name: "type" + short_description: + "Effect type or vendor-specific effect name. Varies across SFZ players." + version: "SFZ v2" + value: + type_name: "string" + options: + - name: "apan" + - name: "comp" + - name: "delay" + - name: "disto" + - name: "eq" + - name: "filter" + - name: "fverb" + - name: "gate" + - name: "limiter" + - name: "lofi" + - name: "mverb" + - name: "phaser" + - name: "static" + - name: "strings" + - name: "tdfir" + - name: "com.mda.Limiter" + version: "ARIA" + - name: "com.mda.Overdrive" + version: "ARIA" + - name: "com.mda.Leslie" + version: "ARIA" + - name: "com.mda.RingMod" + version: "ARIA" + - name: "com.mda.Delay" + version: "ARIA" + - name: "com.mda.Bandisto" + version: "ARIA" + - name: "com.mda.Ambience" + version: "ARIA" + - name: "com.mda.DubDelay" + version: "ARIA" + - name: "com.mda.Detune" + version: "ARIA" + - name: "com.mda.Dither" + version: "ARIA" + - name: "com.mda.Combo" + version: "ARIA" + - name: "com.mda.Degrade" + version: "ARIA" + - name: "com.mda.SubSynth" + version: "ARIA" + - name: "com.mda.RezFilter" + version: "ARIA" + + - name: "vendor_specific" + short_description: + "Defines vendor-specific effects, + for example Garritan-specific stage depth effect in ARIA." + version: "ARIA" + value: + type_name: "string" + +- name: "Loading" + id: "ldg" + url: "/opcodes/?c=ldg" + opcodes: + - name: "load_mode" + short_description: "" + version: "SFZ v2" + value: + type_name: "integer" + min: 0 + max: 1 + + - name: "load_start" + short_description: "" + version: "SFZ v2" + value: + type_name: "integer" + + - name: "load_end" + short_description: "" + version: "SFZ v2" + value: + type_name: "integer" + + - name: "sample_quality" + short_description: "Sample playback quality settings." + version: "SFZ v2" + value: + type_name: "integer" + min: 1 + max: 10 + + - name: "image" + short_description: "Sets the background image of the instrument." + version: "SFZ v2" + value: + type_name: "string" + +- name: "Wavetable Oscillator" + id: "wos" + url: "opcodes/?c=wos" + opcodes: + - name: "oscillator" + short_description: "" + version: "SFZ v2" + value: + type_name: "string" + options: + - name: "on" + - name: "off" + + - name: "oscillator_detune" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "oscillator_detune_onccN" + + - name: "oscillator_mode" + short_description: "The modulation type." + version: "SFZ v2" + value: + type_name: "integer" + min: 0 + max: 2 + default: 0 + + - name: "oscillator_mod_depth" + short_description: "" + version: "SFZ v2" + modulation: + midi_cc: + - name: "oscillator_mod_depth_onccN" + - name: "oscillator_mod_smoothccN" + + - name: "oscillator_multi" + short_description: "Configure a region to use more than one oscillator." + version: "SFZ v2" + value: + type_name: "integer" + min: 1 + max: 9 + default: 1 + + - name: "oscillator_phase" + short_description: "Oscillator phase. Negative values for random phase." + version: "SFZ v2" + value: + type_name: "float" + min: -1 + max: 360 + + - name: "oscillator_quality" + short_description: "" + version: "SFZ v2" + value: + type_name: "integer" + min: 0 + max: 3 + + - name: "oscillator_table_size" + short_description: "" + version: "SFZ v2" diff --git a/lex.go b/lex.go new file mode 100644 index 0000000..eae27b0 --- /dev/null +++ b/lex.go @@ -0,0 +1,149 @@ +package sfz + +import ( + "regexp" + "strings" + "unicode/utf8" +) + +var ( + // headerRE reads a header at the start of the text. + headerRE = regexp.MustCompile(`^<([A-Za-z_]+)>`) + // opcodeRE reads an opcode's name and = at the start of the text. + opcodeRE = regexp.MustCompile(`^([A-Za-z0-9_$]+)=`) + // defineRE reads a #define's variable and value, up to the end of its line. + defineRE = regexp.MustCompile(`^#define[ \t]+(\$[A-Za-z0-9_]+)[ \t]+([^\r\n]*)`) + // includeRE reads an #include's quoted path. + includeRE = regexp.MustCompile(`^#include[ \t]+"([^"\r\n]*)"`) + // breakRE finds where an opcode's value ends: at a header, the next + // opcode, a comment, or a directive after whitespace. Without one it runs + // to the end of its line, so it can hold spaces, as a sample's path can. + breakRE = regexp.MustCompile(`<[A-Za-z_]+>|[A-Za-z0-9_$]+=|//|/\*|\s#(?:define|include)\b`) +) + +func isSpace(c byte) bool { return c == ' ' || c == '\t' || c == '\r' || c == '\n' } + +func isNameChar(c byte) bool { + return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || c == '_' || c == '$' +} + +// lexer cuts text into nodes and keeps count of the position. +type lexer struct { + nodes []*Node + line int + // lineStart is the offset where the current line starts. + lineStart int + // pos is the offset the next node starts at. + pos int +} + +// add appends a node for the text from the current position to end. +func (l *lexer) add(src string, end int, n *Node) { + n.Raw = src[l.pos:end] + n.Line, n.Col = l.line, l.pos-l.lineStart+1 + if n.Kind == KindText && len(l.nodes) > 0 { + if last := l.nodes[len(l.nodes)-1]; last.Kind == KindText { + last.Raw += n.Raw + l.advance(src, end) + return + } + } + l.nodes = append(l.nodes, n) + l.advance(src, end) +} + +// advance moves the position to end, counting the lines it passes. +func (l *lexer) advance(src string, end int) { + for i := l.pos; i < end; i++ { + if src[i] == '\n' { + l.line++ + l.lineStart = i + 1 + } + } + l.pos = end +} + +// lex cuts text into nodes whose raw text, joined, is the text. +func lex(src string) []*Node { + l := &lexer{line: 1} + for l.pos < len(src) { + i := l.pos + rest := src[i:] + switch { + case isSpace(src[i]): + j := i + for j < len(src) && isSpace(src[j]) { + j++ + } + l.add(src, j, &Node{Kind: KindSpace}) + case strings.HasPrefix(rest, "//"): + j := len(src) + if e := strings.IndexByte(rest, '\n'); e >= 0 { + j = i + e + } + l.add(src, j, &Node{Kind: KindComment}) + case strings.HasPrefix(rest, "/*"): + j := len(src) + if e := strings.Index(rest[2:], "*/"); e >= 0 { + j = i + 2 + e + 2 + } + l.add(src, j, &Node{Kind: KindComment}) + case src[i] == '<' && headerRE.MatchString(rest): + m := headerRE.FindStringSubmatch(rest) + l.add(src, i+len(m[0]), &Node{Kind: KindHeader, Name: m[1]}) + case src[i] == '#' && (i == 0 || isSpace(src[i-1])) && l.directive(src): + case opcodeRE.MatchString(rest): + m := opcodeRE.FindStringSubmatch(rest) + valueStart := i + len(m[0]) + lineEnd := len(src) + if e := strings.IndexByte(src[valueStart:], '\n'); e >= 0 { + lineEnd = valueStart + e + } + end := lineEnd + if loc := breakRE.FindStringIndex(src[valueStart:lineEnd]); loc != nil { + end = valueStart + loc[0] + } + for end > valueStart && isSpace(src[end-1]) { + end-- + } + l.add(src, end, &Node{Kind: KindOpcode, Name: m[1], Value: strings.TrimSpace(src[valueStart:end])}) + case isNameChar(src[i]): + j := i + for j < len(src) && isNameChar(src[j]) { + j++ + } + l.add(src, j, &Node{Kind: KindText}) + default: + _, size := utf8.DecodeRuneInString(rest) + l.add(src, i+size, &Node{Kind: KindText}) + } + } + return l.nodes +} + +// directive adds a #define or #include at the current position, and reports +// whether it was one that can be read. +func (l *lexer) directive(src string) bool { + rest := src[l.pos:] + if m := defineRE.FindStringSubmatch(rest); m != nil { + length := len(m[0]) + // A comment ends the value. + valueStart := length - len(m[2]) + if loc := commentRE.FindStringIndex(m[2]); loc != nil { + length = valueStart + loc[0] + } + for length > valueStart && isSpace(rest[length-1]) { + length-- + } + l.add(src, l.pos+length, &Node{Kind: KindDefine, Name: m[1], Value: strings.TrimSpace(rest[valueStart:length])}) + return true + } + if m := includeRE.FindStringSubmatch(rest); m != nil { + l.add(src, l.pos+len(m[0]), &Node{Kind: KindInclude, Value: m[1]}) + return true + } + return false +} + +// commentRE finds the start of a comment. +var commentRE = regexp.MustCompile(`//|/\*`) diff --git a/parse.go b/parse.go new file mode 100644 index 0000000..1cb75bc --- /dev/null +++ b/parse.go @@ -0,0 +1,205 @@ +package sfz + +import ( + "fmt" + "io" + "io/fs" + "path" + "regexp" + "strings" +) + +// Resolver returns the contents of an included file. The path is relative to +// the folder of the main file, with forward slashes. +type Resolver func(path string) ([]byte, error) + +// IncludeMode is what [Parse] does with an #include. +type IncludeMode int + +// The include modes. +const ( + // IncludesResolve reads each include. One that can't be read is reported + // as a [Problem] and left unresolved. + IncludesResolve IncludeMode = iota + // IncludesKeep reads no includes, and works out their paths only. + IncludesKeep + // IncludesFail reads each include, and returns [ErrUnresolved] for one + // that can't be read. + IncludesFail +) + +// Limits bound what an instrument may make Parse do. +type Limits struct { + // MaxDepth is how deeply #include may nest. The main file is at depth 0. + MaxDepth int + // MaxBytes is how many bytes all the files together may hold. + MaxBytes int +} + +// DefaultLimits are the limits [Parse] uses unless [WithLimits] says otherwise. +var DefaultLimits = Limits{MaxDepth: 16, MaxBytes: 16 << 20} + +type parseConfig struct { + resolver Resolver + includes IncludeMode + limits Limits +} + +// ParseOption changes how [Parse] works. +type ParseOption func(*parseConfig) + +// WithResolver sets how includes are read. Without one, includes aren't read. +func WithResolver(r Resolver) ParseOption { + return func(c *parseConfig) { c.resolver = r } +} + +// WithIncludes sets what to do with includes. The default is +// [IncludesResolve]. +func WithIncludes(m IncludeMode) ParseOption { + return func(c *parseConfig) { c.includes = m } +} + +// WithLimits sets the limits. A field that is 0 uses its default. +func WithLimits(l Limits) ParseOption { + return func(c *parseConfig) { + if l.MaxDepth > 0 { + c.limits.MaxDepth = l.MaxDepth + } + if l.MaxBytes > 0 { + c.limits.MaxBytes = l.MaxBytes + } + } +} + +// Parse reads an instrument from r, and its includes with the resolver. +func Parse(r io.Reader, opts ...ParseOption) (*Document, error) { + data, err := io.ReadAll(r) + if err != nil { + return nil, err + } + return parse("", data, opts) +} + +// ParseFile reads the instrument whose main file is name in fsys, and its +// includes from the folder of the main file. [WithResolver] overrides how +// includes are read. +func ParseFile(fsys fs.FS, name string, opts ...ParseOption) (*Document, error) { + data, err := fs.ReadFile(fsys, name) + if err != nil { + return nil, err + } + dir := path.Dir(name) + read := func(p string) ([]byte, error) { return fs.ReadFile(fsys, path.Join(dir, p)) } + opts = append([]ParseOption{WithResolver(read)}, opts...) + return parse(path.Base(name), data, opts) +} + +// Includes returns the files that an SFZ file includes directly, with the +// variables it defines itself substituted, in the order they first appear. The +// paths are relative to the folder of the main file. Includes that an +// included file makes aren't followed. +func Includes(text []byte) []string { + doc, err := parse("", text, []ParseOption{WithIncludes(IncludesKeep)}) + if err != nil { + return nil + } + var found []string + seen := map[string]bool{} + for _, n := range doc.Root.Nodes { + if n.Kind == KindInclude && !seen[n.Resolved] { + seen[n.Resolved] = true + found = append(found, n.Resolved) + } + } + return found +} + +// parser reads a document's files, keeping the variables defined so far. +type parser struct { + parseConfig + defines map[string]string + // including holds the files being read, to refuse an include loop. + including []string + bytes int + problems []Problem +} + +func parse(name string, data []byte, opts []ParseOption) (*Document, error) { + p := &parser{parseConfig: parseConfig{limits: DefaultLimits}, defines: map[string]string{}} + for _, o := range opts { + o(&p.parseConfig) + } + root, err := p.file(name, data, 0) + if err != nil { + return nil, err + } + return &Document{Root: root, problems: p.problems}, nil +} + +// file lexes a file and reads the directives in it, in order. +func (p *parser) file(name string, data []byte, depth int) (*File, error) { + if depth > p.limits.MaxDepth { + return nil, fmt.Errorf("%w: includes nest more than %d deep at %s", ErrInvalid, p.limits.MaxDepth, name) + } + for _, f := range p.including { + if f == name { + return nil, fmt.Errorf("%w: %w: %s includes itself", ErrInvalid, ErrIncludeLoop, name) + } + } + p.bytes += len(data) + if p.bytes > p.limits.MaxBytes { + return nil, fmt.Errorf("%w: the instrument's text is longer than %d MB", ErrInvalid, p.limits.MaxBytes>>20) + } + p.including = append(p.including, name) + defer func() { p.including = p.including[:len(p.including)-1] }() + + f := &File{Path: name, Nodes: lex(string(data))} + for _, n := range f.Nodes { + switch n.Kind { + case KindDefine: + p.defines[n.Name] = strings.TrimSpace(substitute(p.defines, n.Value)) + case KindInclude: + n.Resolved = path.Clean(strings.ReplaceAll(substitute(p.defines, n.Value), `\`, "/")) + if p.includes == IncludesKeep || p.resolver == nil { + continue + } + child, err := p.resolver(n.Resolved) + if err != nil { + if p.includes == IncludesFail { + return nil, fmt.Errorf("%w: %s: %w", ErrUnresolved, n.Resolved, err) + } + p.problems = append(p.problems, Problem{ + File: name, Line: n.Line, Col: n.Col, Severity: SeverityWarning, + Code: "include.unresolved", Msg: fmt.Sprintf("can't read %s: %v", n.Resolved, err), + }) + continue + } + if n.File, err = p.file(n.Resolved, child, depth+1); err != nil { + return nil, err + } + } + } + return f, nil +} + +// variableRE finds a $ and the run of name characters after it. Only the start +// of the run may be the name of a variable (see substitute). +var variableRE = regexp.MustCompile(`\$[A-Za-z0-9_]+`) + +// substitute replaces the variables defined so far in text. A variable's name +// ends at the shortest run of characters that is a defined name, so in +// $MIC_$ART the underscore is text between $MIC and $ART, as in ARIA. A +// variable that isn't defined is left as it is. +func substitute(defines map[string]string, text string) string { + if !strings.Contains(text, "$") { + return text + } + return variableRE.ReplaceAllStringFunc(text, func(run string) string { + for end := 2; end <= len(run); end++ { + if value, ok := defines[run[:end]]; ok { + return value + run[end:] + } + } + return run + }) +} diff --git a/registry.go b/registry.go new file mode 100644 index 0000000..bf64aa2 --- /dev/null +++ b/registry.go @@ -0,0 +1,192 @@ +package sfz + +//go:generate go run -C internal/gen . -in syntax.yml -out ../../registry_data.go + +import ( + "iter" + "regexp" + "strings" + "sync" +) + +// ValueType is the kind of value an opcode takes. +type ValueType int + +// The value types. +const ( + // TypeUnspecified is for an opcode whose value the format doesn't describe. + TypeUnspecified ValueType = iota + TypeString + TypeInteger + TypeFloat +) + +// String returns the type's name. +func (t ValueType) String() string { + switch t { + case TypeString: + return "string" + case TypeInteger: + return "integer" + case TypeFloat: + return "float" + } + return "unspecified" +} + +// HeaderInfo describes a header of the format. +type HeaderInfo struct { + // Name is the header's name without its brackets. + Name string + // Version is the first SFZ version or player that has it: "SFZ v1", "SFZ v2", + // "ARIA", and so on. + Version string + Deprecated bool + Description string +} + +// OpcodeInfo describes an opcode of the format. A name that stands for a +// family has uppercase placeholders: N and X stand for a number, as in +// loccN and egN_timeX, and * for any name, as in hint_*. +type OpcodeInfo struct { + // Name is the opcode's own name. + Name string + // Aliases are other names for it. + Aliases []string + // Version is the first SFZ version or player that has it: "SFZ v1", "SFZ + // v2", "ARIA", "sfizz", "Calfbox" or "LinuxSampler". + Version string + Deprecated bool + // Category is where the format lists it, such as "Performance Parameters / + // Amplifier". + Category string + Type ValueType + // Min and Max bound a numeric value, or are nil where the format gives no + // bound it can state as a number. + Min, Max *float64 + // Default is the format's description of the default, which is for + // reading and not always a value. + Default string + // Unit is the value's unit, such as "seconds" or "cents". + Unit string + // Options are the values a string opcode may take, if it has a fixed set. + Options []string + // Note is whether an integer opcode also takes a note name, such as c4. + Note bool + Description string +} + +// matcher finds the registry entry for an opcode name. +type matcher struct { + re *regexp.Regexp + info *OpcodeInfo +} + +var ( + registryOnce sync.Once + byName map[string]*OpcodeInfo + patterns []matcher + headerByName map[string]*HeaderInfo +) + +// patternRE reads a name's placeholders: a run of N and X letters, or a *. +var patternRE = regexp.MustCompile(`[NX]+|\*`) + +// pattern returns the expression that matches the names a family name stands +// for, or nil if the name is a single opcode's. +func pattern(name string) *regexp.Regexp { + locs := patternRE.FindAllStringIndex(name, -1) + if locs == nil { + return nil + } + var b strings.Builder + b.WriteString("^") + last := 0 + for _, loc := range locs { + b.WriteString(regexp.QuoteMeta(name[last:loc[0]])) + if name[loc[0]] == '*' { + b.WriteString("[a-z0-9_]+") + } else { + b.WriteString("[0-9]+") + } + last = loc[1] + } + b.WriteString(regexp.QuoteMeta(name[last:])) + b.WriteString("$") + return regexp.MustCompile(b.String()) +} + +func loadRegistry() { + registryOnce.Do(func() { + byName = map[string]*OpcodeInfo{} + headerByName = map[string]*HeaderInfo{} + for i := range headerData { + headerByName[headerData[i].Name] = &headerData[i] + } + var wild []matcher + for i := range opcodeData { + info := &opcodeData[i] + for _, name := range append([]string{info.Name}, info.Aliases...) { + re := pattern(name) + switch { + case re == nil: + byName[name] = info + case strings.Contains(name, "*"): + wild = append(wild, matcher{re, info}) + default: + patterns = append(patterns, matcher{re, info}) + } + } + } + patterns = append(patterns, wild...) + }) +} + +// Lookup returns what the format says about an opcode, found by its name or +// one of its aliases. The info is the same for each name of the opcode, and +// its Name is the opcode's own. +func Lookup(name string) (OpcodeInfo, bool) { + loadRegistry() + if info, ok := byName[name]; ok { + return *info, true + } + for _, m := range patterns { + if m.re.MatchString(name) { + return *m.info, true + } + } + return OpcodeInfo{}, false +} + +// KnownOpcodes returns every opcode of the format, in the order of its listing. +func KnownOpcodes() iter.Seq[OpcodeInfo] { + return func(yield func(OpcodeInfo) bool) { + for _, info := range opcodeData { + if !yield(info) { + return + } + } + } +} + +// KnownHeaders returns every header of the format. +func KnownHeaders() iter.Seq[HeaderInfo] { + return func(yield func(HeaderInfo) bool) { + for _, h := range headerData { + if !yield(h) { + return + } + } + } +} + +// LookupHeader returns what the format says about a header, given its name +// without brackets, in any case. +func LookupHeader(name string) (HeaderInfo, bool) { + loadRegistry() + h, ok := headerByName[strings.ToLower(name)] + if !ok { + return HeaderInfo{}, false + } + return *h, true +} diff --git a/registry_data.go b/registry_data.go new file mode 100644 index 0000000..2a1e723 --- /dev/null +++ b/registry_data.go @@ -0,0 +1,754 @@ +// Code generated by internal/gen from the SFZ format's syntax data; DO NOT EDIT. + +package sfz + +// headerData are the headers of the format. +var headerData = []HeaderInfo{ + {Name: "region", Version: "SFZ v1", Deprecated: false, Description: "The basic component of an instrument. An instrument is defined by one or more regions."}, + {Name: "group", Version: "SFZ v1", Deprecated: false, Description: "Multiple regions can be arranged in a group. Groups allow entering common parameters for multiple regions."}, + {Name: "control", Version: "SFZ v2", Deprecated: false, Description: ""}, + {Name: "global", Version: "SFZ v2", Deprecated: false, Description: "Allows entering parameters which are common for all regions."}, + {Name: "curve", Version: "SFZ v2", Deprecated: false, Description: "A header for defining curves for MIDI CC controls."}, + {Name: "effect", Version: "SFZ v2", Deprecated: false, Description: "SFZ v2 header for effects controls."}, + {Name: "master", Version: "ARIA", Deprecated: false, Description: "An intermediate level in the header hierarchy, between global and group."}, + {Name: "midi", Version: "ARIA", Deprecated: true, Description: "ARIA extension, was added for MIDI pre-processor effects. From ARIA v1.0.8.0+ an section with a bus=midi can be used instead."}, + {Name: "sample", Version: "SFZ v2", Deprecated: false, Description: "Allows to embed sample data directly in SFZ files (Rapture)."}, +} + +// opcodeData are the opcodes of the format, with their aliases. +var opcodeData = []OpcodeInfo{ + {Name: "script", Aliases: nil, Version: "LinuxSampler", Deprecated: false, Category: "Real-Time Instrument Script", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Allows to load real-time instrument scripts for SFZ instruments."}, + {Name: "count", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(4.294967296e+09)), Default: "", Unit: "", Options: nil, Note: false, Description: "The number of times the sample will be played."}, + {Name: "delay", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Region delay time."}, + {Name: "delay_ccN", Aliases: []string{"delay_onccN"}, Version: "SFZ v1", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Region delay time after MIDI continuous controller N messages are received. If the region receives a note-off message before delay time, the region won't play."}, + {Name: "delay_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate delay."}, + {Name: "delay_random", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Region random delay time."}, + {Name: "delay_samples", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeInteger, Min: nil, Max: nil, Default: "", Unit: "sample units", Options: nil, Note: false, Description: "Allows the region playback to be postponed for the specified time, measured in samples (and therefore dependent on current sample rate)."}, + {Name: "delay_samples_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeInteger, Min: nil, Max: nil, Default: "", Unit: "sample units", Options: nil, Note: false, Description: ""}, + {Name: "end", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(4.294967296e+09)), Default: "unspecified", Unit: "sample units", Options: nil, Note: false, Description: "The endpoint of the sample. If unspecified, the entire sample will play."}, + {Name: "loop_count", Aliases: []string{"loopcount"}, Version: "SFZ v2", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeInteger, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "The number of times a loop will repeat."}, + {Name: "loop_crossfade", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Loop cross fade."}, + {Name: "loop_end", Aliases: []string{"loopend"}, Version: "SFZ v1", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(4.294967296e+09)), Default: "", Unit: "sample units", Options: nil, Note: false, Description: "The loop end point, in samples."}, + {Name: "loop_lengthccN", Aliases: []string{"loop_length_onccN"}, Version: "SFZ v2", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Change of loop end point."}, + {Name: "loop_mode", Aliases: []string{"loopmode"}, Version: "SFZ v1", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeString, Min: nil, Max: nil, Default: "no_loop for samples without a loop defined, loop_continuous for samples with defined loop(s).", Unit: "", Options: []string{"no_loop", "one_shot", "loop_continuous", "loop_sustain"}, Note: false, Description: "Allows playing samples with loops defined in the unlooped mode."}, + {Name: "loop_start", Aliases: []string{"loopstart"}, Version: "SFZ v1", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(4.294967296e+09)), Default: "", Unit: "sample units", Options: nil, Note: false, Description: "The loop start point, in samples."}, + {Name: "loop_startccN", Aliases: []string{"loop_start_onccN"}, Version: "SFZ v2", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Change of loop start point."}, + {Name: "loop_tune", Aliases: []string{"looptune"}, Version: "SFZ v2", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "cents", Options: nil, Note: false, Description: "Tuning for only the loop segment."}, + {Name: "loop_type", Aliases: []string{"looptype"}, Version: "SFZ v2", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeString, Min: nil, Max: nil, Default: "forward", Unit: "", Options: []string{"forward", "backward", "alternate"}, Note: false, Description: "Defines the looping mode."}, + {Name: "offset", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(4.294967296e+09)), Default: "", Unit: "sample units", Options: nil, Note: false, Description: "The offset used to play the sample."}, + {Name: "offset_ccN", Aliases: []string{"offset_onccN"}, Version: "SFZ v1", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(4.294967296e+09)), Default: "", Unit: "sample units", Options: nil, Note: false, Description: "The offset used to play the sample according to last position of MIDI continuous controller N."}, + {Name: "offset_random", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(4.294967296e+09)), Default: "", Unit: "sample units", Options: nil, Note: false, Description: "Random offset added to the region offset."}, + {Name: "offset_mode", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeString, Min: nil, Max: nil, Default: "samples", Unit: "", Options: []string{"samples", "percent"}, Note: false, Description: "Defines whether offset is measured in samples or percentage of sample length."}, + {Name: "sample", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Defines which sample file the region will play."}, + {Name: "sample_fadeout", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Number of seconds before the end of sample playback that the player should begin a realtime fadeout."}, + {Name: "sample_dyn_paramN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "ARIA-specific nameless destination for plugin modulations."}, + {Name: "sample_dyn_paramN_onccX", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "sync_beats", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(32)), Default: "", Unit: "beats", Options: nil, Note: false, Description: "Region playing synchronization to host position."}, + {Name: "sync_offset", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(32)), Default: "", Unit: "beats", Options: nil, Note: false, Description: "Region playing synchronization to host position offset."}, + {Name: "delay_beats", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "beats", Options: nil, Note: false, Description: "Delays the start of the region until a certain amount of musical beats are passed."}, + {Name: "delay_beats_onccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_beats_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate delay_beats."}, + {Name: "delay_beats_random", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "beats", Options: nil, Note: false, Description: "Delays the start of the region after a random amount of musical beats."}, + {Name: "stop_beats", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "beats", Options: nil, Note: false, Description: "Stops a region after a certain amount of beats have played."}, + {Name: "direction", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeString, Min: nil, Max: nil, Default: "forward", Unit: "", Options: []string{"forward", "reverse"}, Note: false, Description: "The direction in which the sample is to be played."}, + {Name: "md5", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeString, Min: nil, Max: nil, Default: "null", Unit: "", Options: nil, Note: false, Description: "Calculates the MD5 digital fingerprint hash of a sample file, represented as a sequence of 32 hexadecimal digits."}, + {Name: "reverse_loccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "If MIDI CC N is between reverse_loccN and reverse_hiccN, the region plays reversed."}, + {Name: "reverse_hiccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "If MIDI CC N is between reverse_loccN and reverse_hiccN, the region plays reversed."}, + {Name: "waveguide", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Sound Source / Sample Playback", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: []string{"on", "off"}, Note: false, Description: "Enables waveguide synthesis for the region."}, + {Name: "default_path", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Instrument Settings", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Default file path."}, + {Name: "note_offset", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Instrument Settings", Type: TypeInteger, Min: ptr(float64(-127)), Max: ptr(float64(127)), Default: "", Unit: "semitones", Options: nil, Note: false, Description: "MIDI note transpose; tells the SFZ player to offset all incoming MIDI notes by the specified number of semitones."}, + {Name: "octave_offset", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Instrument Settings", Type: TypeInteger, Min: ptr(float64(-10)), Max: ptr(float64(10)), Default: "", Unit: "octaves", Options: nil, Note: false, Description: "MIDI octave transpose; tells the SFZ player to offset all incoming MIDI notes by the specified number of octaves."}, + {Name: "label_ccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Instrument Settings", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Creates a label for the MIDI CC."}, + {Name: "label_keyN", Aliases: nil, Version: "sfizz", Deprecated: false, Category: "Instrument Settings", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Creates a label for a key."}, + {Name: "label_outputN", Aliases: nil, Version: "Calfbox", Deprecated: false, Category: "Instrument Settings", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Creates a label for the output N."}, + {Name: "set_ccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Instrument Settings", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Sets a default initial value for MIDI CC number N, when the instrument is initially loaded."}, + {Name: "hint_*", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Instrument Settings", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Its a 'hint' to the ARIA engine, others implementations don't have to follow."}, + {Name: "*_mod", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Instrument Settings", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: []string{"add", "mult"}, Note: false, Description: "Determines whether a parameter is modulated by addition or multiplication."}, + {Name: "set_hdccN", Aliases: []string{"set_realccN"}, Version: "ARIA", Deprecated: false, Category: "Instrument Settings", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Like set_ccN but with floating point MIDI CCs."}, + {Name: "sw_note_offset", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Instrument Settings", Type: TypeInteger, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Follows the same logic as SFZ 2.0’s note_offset but for key switches."}, + {Name: "sw_octave_offset", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Instrument Settings", Type: TypeInteger, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Follows the same logic as SFZ 2.0’s octave_offset but for key switches."}, + {Name: "loop_end_offset", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Instrument Settings", Type: TypeInteger, Min: ptr(float64(-1)), Max: ptr(float64(0)), Default: "", Unit: "", Options: nil, Note: false, Description: "Subtracts 1 from sample numbers in file metadata, as a workaround for incorrectly generated loop points."}, + {Name: "global_label", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Instrument Settings", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "An ARIA extension which sets what is displayed in the default info tab of Sforzando."}, + {Name: "master_label", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Instrument Settings", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "An ARIA extension which sets what is displayed in the default info tab of Sforzando."}, + {Name: "group_label", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Instrument Settings", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "An ARIA extension which sets what is displayed in the default info tab of Sforzando."}, + {Name: "region_label", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Instrument Settings", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "An ARIA extension which sets what is displayed in the default info tab of Sforzando."}, + {Name: "group", Aliases: []string{"polyphony_group"}, Version: "SFZ v1", Deprecated: false, Category: "Instrument Settings / Voice Lifecycle", Type: TypeInteger, Min: ptr(float64(-2.147483648e+09)), Max: ptr(float64(2.147483647e+09)), Default: "", Unit: "", Options: nil, Note: false, Description: "Exclusive group number for this region."}, + {Name: "off_by", Aliases: []string{"offby"}, Version: "SFZ v1", Deprecated: false, Category: "Instrument Settings / Voice Lifecycle", Type: TypeInteger, Min: ptr(float64(-2.147483648e+09)), Max: ptr(float64(2.147483647e+09)), Default: "", Unit: "", Options: nil, Note: false, Description: "Region off group."}, + {Name: "off_mode", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Instrument Settings / Voice Lifecycle", Type: TypeString, Min: nil, Max: nil, Default: "fast", Unit: "", Options: []string{"fast", "normal", "time"}, Note: false, Description: "Region off mode."}, + {Name: "output", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Instrument Settings / Voice Lifecycle", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(1024)), Default: "", Unit: "", Options: nil, Note: false, Description: "The stereo output number for this region."}, + {Name: "polyphony", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Instrument Settings / Voice Lifecycle", Type: TypeInteger, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Polyphony voice limit."}, + {Name: "note_polyphony", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Instrument Settings / Voice Lifecycle", Type: TypeInteger, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Polyphony limit for playing the same note repeatedly."}, + {Name: "polyphony_stealing", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Instrument Settings / Voice Lifecycle", Type: TypeInteger, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "note_selfmask", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Instrument Settings / Voice Lifecycle", Type: TypeString, Min: nil, Max: nil, Default: "on", Unit: "", Options: []string{"on", "off"}, Note: false, Description: "Controls note-stealing behavior for a single pitch, when using note_polyphony."}, + {Name: "rt_dead", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Instrument Settings / Voice Lifecycle", Type: TypeString, Min: nil, Max: nil, Default: "off", Unit: "", Options: []string{"on", "off"}, Note: false, Description: "Controls whether a release sample should play if its sustain sample has ended, or not."}, + {Name: "off_curve", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Instrument Settings / Voice Lifecycle", Type: TypeInteger, Min: ptr(float64(-2)), Max: ptr(float64(10)), Default: "", Unit: "", Options: []string{"-2", "-1", "0", "1", "2", "10"}, Note: false, Description: "When off_mode is set to time, this specifies the math to be used to fade out the regions being muted by voice-stealing."}, + {Name: "off_shape", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Instrument Settings / Voice Lifecycle", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "The coefficient used by off_curve."}, + {Name: "off_time", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Instrument Settings / Voice Lifecycle", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "When off_mode is set to time, this specifies the fadeout time for regions being muted by voice-stealing."}, + {Name: "key", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Key Mapping", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: true, Description: "Equivalent to using lokey, hikey and pitch_keycenter and setting them all to the same note value."}, + {Name: "lokey", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Key Mapping", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: true, Description: "Determine the low boundary of a certain region."}, + {Name: "hikey", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Key Mapping", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: true, Description: "Determine the high boundary of a certain region."}, + {Name: "lovel", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Key Mapping", Type: TypeInteger, Min: ptr(float64(1)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "If a note with velocity value equal to or higher than lovel AND equal to or lower than hivel is played, the region will play."}, + {Name: "hivel", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Key Mapping", Type: TypeInteger, Min: ptr(float64(1)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "If a note with velocity value equal to or higher than lovel AND equal to or lower than hivel is played, the region will play."}, + {Name: "lochan", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(1)), Max: ptr(float64(16)), Default: "", Unit: "", Options: nil, Note: false, Description: "If incoming notes have a MIDI channel between lochan and hichan, the region will play."}, + {Name: "hichan", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(1)), Max: ptr(float64(16)), Default: "", Unit: "", Options: nil, Note: false, Description: "If incoming notes have a MIDI channel between lochan and hichan, the region will play."}, + {Name: "loccN", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Defines the range of the last MIDI controller N required for the region to play."}, + {Name: "hiccN", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Defines the range of the last MIDI controller N required for the region to play."}, + {Name: "lobend", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(-8192)), Max: ptr(float64(8192)), Default: "", Unit: "", Options: nil, Note: false, Description: "Defines the range of the last Pitch Bend message required for the region to play."}, + {Name: "hibend", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(-8192)), Max: ptr(float64(8192)), Default: "", Unit: "", Options: nil, Note: false, Description: "Defines the range of the last Pitch Bend message required for the region to play."}, + {Name: "sostenuto_cc", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Reassigns the sostenuto pedal CC to a non-standard value."}, + {Name: "sostenuto_lo", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Sets the minimum point at which the sostenuto pedal (MIDI CC 66) is considered 'down'."}, + {Name: "sostenuto_sw", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: []string{"on", "off"}, Note: false, Description: "Turns the sostenuto switch on or off."}, + {Name: "sustain_cc", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Reassigns the sustain pedal CC to a non-standard value."}, + {Name: "sustain_lo", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Sets the minimum point at which the sustain pedal (MIDI CC 64) is considered 'down'."}, + {Name: "sustain_sw", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: []string{"on", "off"}, Note: false, Description: "Turns the sustain switch on or off."}, + {Name: "sw_lokey", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: true, Description: "Defines the range of the keyboard to be used as trigger selectors for the sw_last opcode."}, + {Name: "sw_hikey", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: true, Description: "Defines the range of the keyboard to be used as trigger selectors for the sw_last opcode."}, + {Name: "sw_last", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: true, Description: "Enables the region to play if the last key pressed in the range specified by sw_lokey and sw_hikey is equal to the sw_last value."}, + {Name: "sw_down", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: true, Description: "Enables the region to play if the key equal to sw_down value is depressed. Key has to be in the range specified by sw_lokey and sw_hikey."}, + {Name: "sw_up", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: true, Description: "Enables the region to play if the key equal to sw_up value is not depressed."}, + {Name: "sw_previous", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: true, Description: "Previous note value. The region will play if last note-on message was equal to sw_previous value."}, + {Name: "sw_vel", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeString, Min: nil, Max: nil, Default: "current", Unit: "", Options: []string{"current", "previous"}, Note: false, Description: "Allows overriding the velocity for the region with the velocity of the previous note."}, + {Name: "loprog", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "The region plays when the MIDI program number is between loprog and hiprog."}, + {Name: "hiprog", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "The region plays when the MIDI program number is between loprog and hiprog."}, + {Name: "lohdccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Like loccN but with floating point MIDI CCs"}, + {Name: "hihdccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Like hiccN but with floating point MIDI CCs"}, + {Name: "sw_default", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: true, Description: "Define keyswitch 'power on default' so that you hear something when a patch loads."}, + {Name: "sw_label", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Label for activated keyswitch on GUI."}, + {Name: "sw_lolast", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Like sw_last, but allowing a region to be triggered across a range of keyswitches."}, + {Name: "sw_hilast", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Like sw_last, but allowing a region to be triggered across a range of keyswitches."}, + {Name: "varNN_mod", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: []string{"mult", "add"}, Note: false, Description: "Specifies the method used to calculate variable number NN from MIDI CCs."}, + {Name: "varNN_onccX", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the method used to calculate variable number NN from MIDI CCs."}, + {Name: "varNN_curveccX", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC X uses to modulate varNN."}, + {Name: "varNN_*", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Region Logic / MIDI Conditions", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the target for variable NN to modulate."}, + {Name: "lobpm", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Internal Conditions", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(500)), Default: "", Unit: "bpm", Options: nil, Note: false, Description: "Host tempo value."}, + {Name: "hibpm", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Internal Conditions", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(500)), Default: "", Unit: "bpm", Options: nil, Note: false, Description: "Host tempo value."}, + {Name: "lochanaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Internal Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Defines the range of last Channel Aftertouch message required for the region to play."}, + {Name: "hichanaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Internal Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Defines the range of last Channel Aftertouch message required for the region to play."}, + {Name: "lopolyaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Internal Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Defines the range of last Polyphonic Aftertouch message required for the region to play."}, + {Name: "hipolyaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Internal Conditions", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Defines the range of last Polyphonic Aftertouch message required for the region to play."}, + {Name: "lorand", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Internal Conditions", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "The region will play if the random number is equal to or higher than lorand, and lower than hirand."}, + {Name: "hirand", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Internal Conditions", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "The region will play if the random number is equal to or higher than lorand, and lower than hirand."}, + {Name: "seq_length", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Internal Conditions", Type: TypeInteger, Min: ptr(float64(1)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: "Sequence length, used together with seq_position to use samples as round robins."}, + {Name: "seq_position", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Internal Conditions", Type: TypeInteger, Min: ptr(float64(1)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: "Sequence position. The region will play if the internal sequence counter is equal to seq_position."}, + {Name: "lotimer", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Region Logic / Internal Conditions", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Region plays if the time passed since the last sample in the same group played is between lotimer and hitimer."}, + {Name: "hitimer", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Region Logic / Internal Conditions", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Region plays if timer is between lotimer and hitimer."}, + {Name: "trigger", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Triggers", Type: TypeString, Min: nil, Max: nil, Default: "attack", Unit: "", Options: []string{"attack", "release", "first", "legato", "release_key"}, Note: false, Description: "Sets the trigger which will be used for the sample to play."}, + {Name: "on_loccN", Aliases: []string{"start_loccN"}, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Triggers", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "If a MIDI control message with a value between on_loccN and on_hiccN is received, the region will play. Default value is -1, it means unassigned."}, + {Name: "on_hiccN", Aliases: []string{"start_hiccN"}, Version: "SFZ v1", Deprecated: false, Category: "Region Logic / Triggers", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "If a MIDI control message with a value between on_loccN and on_hiccN is received, the region will play. Default value is -1, it means unassigned."}, + {Name: "on_lohdccN", Aliases: []string{"start_lohdccN"}, Version: "ARIA", Deprecated: false, Category: "Region Logic / Triggers", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Like on_loccN but with floating point MIDI CCs."}, + {Name: "on_hihdccN", Aliases: []string{"start_hihdccN"}, Version: "ARIA", Deprecated: false, Category: "Region Logic / Triggers", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Like on_hiccN but with floating point MIDI CCs."}, + {Name: "stop_loccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Region Logic / Triggers", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "If a MIDI control message with a value between stop_loccN and stop_hiccN is received, the region will stop playing. Default value is -1, it means unassigned."}, + {Name: "stop_hiccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Region Logic / Triggers", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "If a MIDI control message with a value between stop_loccN and stop_hiccN is received, the region will stop playing. Default value is -1, it means unassigned."}, + {Name: "stop_lohdccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Region Logic / Triggers", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Like stop_loccN but with floating point MIDI CCs."}, + {Name: "stop_hihdccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Region Logic / Triggers", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Like stop_hiccN but with floating point MIDI CCs."}, + {Name: "pan", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "The panoramic position for the region."}, + {Name: "pan_onccN", Aliases: []string{"pan_ccN"}, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "pan_curveccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate pan."}, + {Name: "pan_smoothccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "pan_stepccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "pan_random", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Random panoramic position for the region."}, + {Name: "position", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Only operational for stereo samples, position defines the position in the stereo field of a stereo signal, after channel mixing as defined in the width opcode."}, + {Name: "position_onccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "position_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate position."}, + {Name: "position_smoothccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "position_stepccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "position_random", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: ""}, + {Name: "position_keycenter", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "position_keytrack", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "position_veltrack", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(-200)), Max: ptr(float64(200)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "volume", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(-144)), Max: ptr(float64(6)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "The volume for the region, in decibels."}, + {Name: "gain_ccN", Aliases: []string{"gain_onccN", "volume_onccN"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(-144)), Max: ptr(float64(48)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "Gain applied on MIDI control N, in decibels."}, + {Name: "volume_curveccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate volume."}, + {Name: "volume_smoothccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "volume_stepccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "width", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Only operational for stereo samples, width defines the amount of channel mixing applied to play the sample."}, + {Name: "width_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "width_curveccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate width."}, + {Name: "width_smoothccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "width_stepccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "amp_keycenter", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Center key for amplifier keyboard tracking. In this key, the amplifier keyboard tracking will have no effect."}, + {Name: "amp_keytrack", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(-96)), Max: ptr(float64(12)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "Amplifier keyboard tracking (change in amplitude per key) in decibels."}, + {Name: "amp_veltrack", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Amplifier velocity tracking, represents how much the amplitude changes with incoming note velocity."}, + {Name: "amp_veltrack_onccN", Aliases: []string{"amp_veltrack_ccN"}, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "amp_veltrack_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate amp_veltrack."}, + {Name: "amp_veltrack_random", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "amp_velcurve_N", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "Standard curve (see amp_veltrack)", Unit: "", Options: nil, Note: false, Description: "User-defined amplifier velocity curve."}, + {Name: "amp_random", Aliases: []string{"gain_random"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(24)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "Random volume for the region, in decibels."}, + {Name: "rt_decay", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(200)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "Applies only to regions that triggered through trigger=release. The volume decrease (in decibels) per seconds after the corresponding attack region was triggered."}, + {Name: "rt_decayN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(200)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "Applies only to regions that triggered through trigger=release. The volume decrease (in decibels) per seconds after the corresponding attack region was triggered, for decrease curve segment number N."}, + {Name: "rt_decayN_time", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "seconds", Options: nil, Note: false, Description: "The duration of release sample volue decrease curve segment number N."}, + {Name: "xf_cccurve", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeString, Min: nil, Max: nil, Default: "power", Unit: "", Options: []string{"gain", "power"}, Note: false, Description: "MIDI controllers crossfade curve for the region."}, + {Name: "xf_keycurve", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeString, Min: nil, Max: nil, Default: "power", Unit: "", Options: []string{"gain", "power"}, Note: false, Description: "Keyboard crossfade curve for the region."}, + {Name: "xf_velcurve", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeString, Min: nil, Max: nil, Default: "power", Unit: "", Options: []string{"gain", "power"}, Note: false, Description: "Velocity crossfade curve for the region."}, + {Name: "xfin_loccN", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Fade in control based on MIDI CC."}, + {Name: "xfin_hiccN", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Fade in control based on MIDI CC."}, + {Name: "xfout_loccN", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Fade out control based on MIDI CC."}, + {Name: "xfout_hiccN", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Fade out control based on MIDI CC."}, + {Name: "xfin_lokey", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: true, Description: "Fade in control based on MIDI note (keyboard position)."}, + {Name: "xfin_hikey", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: true, Description: "Fade in control based on MIDI note (keyboard position)."}, + {Name: "xfout_lokey", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: true, Description: "Fade out control based on MIDI note number (keyboard position)."}, + {Name: "xfout_hikey", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: true, Description: "Fade out control based on MIDI note number (keyboard position)."}, + {Name: "xfin_lovel", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Fade in control based on velocity."}, + {Name: "xfin_hivel", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Fade in control based on velocity."}, + {Name: "xfout_lovel", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Fade out control, based on velocity."}, + {Name: "xfout_hivel", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Fade out control, based on velocity."}, + {Name: "phase", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeString, Min: nil, Max: nil, Default: "normal", Unit: "", Options: []string{"normal", "invert"}, Note: false, Description: "If invert is set, the region is played with inverted phase."}, + {Name: "amplitude", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Amplitude for the specified region in percentage of full amplitude."}, + {Name: "amplitude_onccN", Aliases: []string{"amplitude_ccN"}, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: ""}, + {Name: "amplitude_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate amplitude."}, + {Name: "amplitude_smoothccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "global_amplitude", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "ARIA extension, like amplitude, but affecting everything when set under the header."}, + {Name: "master_amplitude", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "ARIA extension, like amplitude, but affecting everything when set under the header."}, + {Name: "group_amplitude", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "ARIA extension, like amplitude, but affecting everything when set under the header."}, + {Name: "pan_law", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: []string{"mma", "balance"}, Note: false, Description: "Sets the pan law to be used."}, + {Name: "pan_keycenter", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Center key for pan keyboard tracking."}, + {Name: "pan_keytrack", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "The amount by which the panning of a note is shifted with each key."}, + {Name: "pan_veltrack", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "The effect of note velocity on panning."}, + {Name: "global_volume", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(-144)), Max: ptr(float64(6)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "ARIA extension, like volume, but affecting everything when set under the header."}, + {Name: "master_volume", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(-144)), Max: ptr(float64(6)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "ARIA extension, like volume, but affecting everything when set under the header."}, + {Name: "group_volume", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Amplifier", Type: TypeFloat, Min: ptr(float64(-144)), Max: ptr(float64(6)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "ARIA extension, like volume, but affecting everything when set under the header."}, + {Name: "eqN_bw", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / EQ", Type: TypeFloat, Min: ptr(float64(0.001)), Max: ptr(float64(4)), Default: "", Unit: "octaves", Options: nil, Note: false, Description: "Bandwidth of the equalizer band, in octaves."}, + {Name: "eqN_bwccX", Aliases: []string{"eqN_bw_onccX"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / EQ", Type: TypeFloat, Min: ptr(float64(-4)), Max: ptr(float64(4)), Default: "", Unit: "octaves", Options: nil, Note: false, Description: ""}, + {Name: "eqN_freq", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / EQ", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(30000)), Default: "eq1_freq=50eq2_freq=500eq3_freq=5000", Unit: "Hz", Options: nil, Note: false, Description: "Frequency of the equalizer band, in Hertz."}, + {Name: "eqN_freqccX", Aliases: []string{"eqN_freq_onccX"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / EQ", Type: TypeFloat, Min: ptr(float64(-30000)), Max: ptr(float64(30000)), Default: "", Unit: "Hz", Options: nil, Note: false, Description: ""}, + {Name: "eqN_vel2freq", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / EQ", Type: TypeFloat, Min: ptr(float64(-30000)), Max: ptr(float64(30000)), Default: "", Unit: "Hz", Options: nil, Note: false, Description: "Frequency change of the equalizer band with MIDI velocity, in Hertz."}, + {Name: "eqN_gain", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / EQ", Type: TypeFloat, Min: ptr(float64(-96)), Max: ptr(float64(24)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "Gain of the equalizer band, in decibels."}, + {Name: "eqN_gainccX", Aliases: []string{"eqN_gain_onccX"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / EQ", Type: TypeFloat, Min: ptr(float64(-96)), Max: ptr(float64(24)), Default: "", Unit: "dB", Options: nil, Note: false, Description: ""}, + {Name: "eqN_vel2gain", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / EQ", Type: TypeFloat, Min: ptr(float64(-96)), Max: ptr(float64(24)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "Gain change of the equalizer band with MIDI velocity, in decibels."}, + {Name: "eqN_dynamic", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / EQ", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies when EQ is recalculated."}, + {Name: "eqN_mode", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / EQ", Type: TypeString, Min: nil, Max: nil, Default: "hz", Unit: "", Options: nil, Note: false, Description: "Specifies whether EQ frequency modulation is in cents or Hertz. Valid values are hz and cents."}, + {Name: "eqN_type", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / EQ", Type: TypeString, Min: nil, Max: nil, Default: "peak", Unit: "", Options: []string{"peak", "lshelf", "hshelf"}, Note: false, Description: "Sets the type of EQ filter."}, + {Name: "cutoff", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: ptr(float64(0)), Max: nil, Default: "filter disabled", Unit: "Hz", Options: nil, Note: false, Description: "Sets the cutoff frequency (Hz) of the filters."}, + {Name: "cutoff_ccN", Aliases: []string{"cutoff_onccN"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(-9600)), Max: ptr(float64(9600)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "The variation in the cutoff frequency when MIDI continuous controller N is received."}, + {Name: "cutoff_curveccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate cutoff."}, + {Name: "cutoff_smoothccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: ptr(float64(0)), Max: nil, Default: "", Unit: "ms", Options: nil, Note: false, Description: ""}, + {Name: "cutoff_stepccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(0)), Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "cutoff_chanaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(-9600)), Max: ptr(float64(9600)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "The variation in the cutoff frequency when MIDI channel aftertouch messages are received, in cents."}, + {Name: "cutoff_polyaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(-9600)), Max: ptr(float64(9600)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "The variation in the cutoff frequency when MIDI polyphonic aftertouch messages are received, in cents."}, + {Name: "cutoff2", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: ptr(float64(0)), Max: nil, Default: "filter disabled", Unit: "Hz", Options: nil, Note: false, Description: "Sets the cutoff frequency (Hz) of the filters."}, + {Name: "cutoff2_ccN", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(-9600)), Max: ptr(float64(9600)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "The variation in the cutoff frequency when MIDI continuous controller N is received."}, + {Name: "cutoff2_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "cutoff2_curveccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate cutoff2."}, + {Name: "cutoff2_smoothccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: ptr(float64(0)), Max: nil, Default: "", Unit: "ms", Options: nil, Note: false, Description: ""}, + {Name: "cutoff2_stepccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(0)), Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "cutoff2_chanaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(-9600)), Max: ptr(float64(9600)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "The variation in the cutoff frequency when MIDI channel aftertouch messages are received, in cents."}, + {Name: "cutoff2_polyaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(-9600)), Max: ptr(float64(9600)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "The variation in the cutoff frequency when MIDI polyphonic aftertouch messages are received, in cents."}, + {Name: "fil_gain", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "dB", Options: nil, Note: false, Description: "Gain for lsh, hsh and peq filter types."}, + {Name: "fil_gain_onccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "fil2_gain", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "dB", Options: nil, Note: false, Description: "Gain for lsh, hsh and peq filter types."}, + {Name: "fil2_gain_onccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "fil_keycenter", Aliases: []string{"fil2_keycenter"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "Center key for filter keyboard tracking."}, + {Name: "fil_keytrack", Aliases: []string{"fil2_keytrack"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(1200)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "Filter keyboard tracking (change on cutoff for each key) in cents."}, + {Name: "fil_mode", Aliases: []string{"fil2_mode"}, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeString, Min: nil, Max: nil, Default: "cents", Unit: "", Options: nil, Note: false, Description: "Specifies whether filter modulation is in cents or Hertz. Valid values are cents and hz"}, + {Name: "fil_random", Aliases: []string{"cutoff_random", "cutoff2_random"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(9600)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "Random value added to the filter cutoff for the region, in cents."}, + {Name: "fil_type", Aliases: []string{"filtype", "fil2_type"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeString, Min: nil, Max: nil, Default: "lpf_2p", Unit: "", Options: []string{"lpf_1p", "hpf_1p", "lpf_2p", "hpf_2p", "bpf_2p", "brf_2p", "bpf_1p", "brf_1p", "apf_1p", "lpf_2p_sv", "hpf_2p_sv", "bpf_2p_sv", "brf_2p_sv", "pkf_2p", "lpf_4p", "hpf_4p", "lpf_6p", "hpf_6p", "comb", "pink", "lsh", "hsh", "peq"}, Note: false, Description: "Filter type."}, + {Name: "fil_veltrack", Aliases: []string{"fil2_veltrack"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(-9600)), Max: ptr(float64(9600)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "Filter velocity tracking, the amount by which the cutoff changes with incoming note velocity, in cents."}, + {Name: "resonance", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(40)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "The filter cutoff resonance value, in decibels."}, + {Name: "resonance_onccN", Aliases: []string{"resonance_ccN"}, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: ptr(float64(-40)), Max: ptr(float64(40)), Default: "", Unit: "dB", Options: nil, Note: false, Description: ""}, + {Name: "resonance_curveccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate resonance."}, + {Name: "resonance_smoothccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: ptr(float64(0)), Max: nil, Default: "", Unit: "ms", Options: nil, Note: false, Description: ""}, + {Name: "resonance_stepccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(0)), Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "resonance2", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(40)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "The filter cutoff resonance value, in decibels."}, + {Name: "resonance2_onccN", Aliases: []string{"resonance2_ccN"}, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: ptr(float64(-40)), Max: ptr(float64(40)), Default: "", Unit: "dB", Options: nil, Note: false, Description: ""}, + {Name: "resonance2_curveccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate resonance2."}, + {Name: "resonance2_smoothccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: ptr(float64(0)), Max: nil, Default: "", Unit: "ms", Options: nil, Note: false, Description: ""}, + {Name: "resonance2_stepccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(0)), Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "resonance_random", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(40)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "Filter cutoff resonance random value, in decibels."}, + {Name: "resonance2_random", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(40)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "Filter#2 cutoff resonance random value, in decibels."}, + {Name: "noise_filter", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: []string{"on", "off", "lpf_1p", "hpf_1p", "bpf_1p", "brf_1p", "apf_1p", "lpf_2p", "hpf_2p", "bpf_2p", "brf_2p", "pkf_2p", "lpf_4p", "hpf_4p", "lpf_6p", "hpf_6p", "comb", "pink"}, Note: false, Description: ""}, + {Name: "noise_stereo", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: []string{"on", "off"}, Note: false, Description: ""}, + {Name: "noise_level", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: ptr(float64(-96)), Max: ptr(float64(24)), Default: "", Unit: "dB", Options: nil, Note: false, Description: ""}, + {Name: "noise_level_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: ptr(float64(-96)), Max: ptr(float64(24)), Default: "", Unit: "dB", Options: nil, Note: false, Description: ""}, + {Name: "noise_level_smoothccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeFloat, Min: ptr(float64(0)), Max: nil, Default: "", Unit: "ms", Options: nil, Note: false, Description: ""}, + {Name: "noise_step", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "noise_step_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "noise_tone", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "noise_tone_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Filter", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "bend_up", Aliases: []string{"bendup"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeInteger, Min: ptr(float64(-9600)), Max: ptr(float64(9600)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "Pitch bend range when Bend Wheel or Joystick is moved up, in cents."}, + {Name: "bend_down", Aliases: []string{"benddown"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeInteger, Min: ptr(float64(-9600)), Max: ptr(float64(9600)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "Pitch bend range when Bend Wheel or Joystick is moved down, in cents."}, + {Name: "bend_smooth", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeFloat, Min: ptr(float64(0)), Max: nil, Default: "", Unit: "ms", Options: nil, Note: false, Description: "Pitch bend smoothness. Adds “inertia” to pitch bends, so fast movements of the pitch bend wheel will have a delayed effect on the pitch change."}, + {Name: "bend_step", Aliases: []string{"bendstep"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeInteger, Min: ptr(float64(1)), Max: ptr(float64(1200)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "Pitch bend step, in cents."}, + {Name: "tune", Aliases: []string{"pitch"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeInteger, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "The fine tuning for the sample, in cents."}, + {Name: "pitch_onccN", Aliases: []string{"tune_ccN", "tune_onccN"}, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeUnspecified, Min: ptr(float64(-9600)), Max: ptr(float64(9600)), Default: "", Unit: "cents", Options: nil, Note: false, Description: ""}, + {Name: "pitch_curveccN", Aliases: []string{"tune_curveccN"}, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate pitch."}, + {Name: "pitch_smoothccN", Aliases: []string{"tune_smoothccN"}, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeFloat, Min: ptr(float64(0)), Max: nil, Default: "", Unit: "ms", Options: nil, Note: false, Description: ""}, + {Name: "pitch_stepccN", Aliases: []string{"tune_stepccN"}, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeUnspecified, Min: ptr(float64(0)), Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "group_tune", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeInteger, Min: ptr(float64(-9600)), Max: ptr(float64(9600)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "ARIA extension, like tune, but affecting everything when set under the header."}, + {Name: "master_tune", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeInteger, Min: ptr(float64(-9600)), Max: ptr(float64(9600)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "ARIA extension, like tune, but affecting everything when set under the header."}, + {Name: "global_tune", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeInteger, Min: ptr(float64(-9600)), Max: ptr(float64(9600)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "ARIA extension, like tune, but affecting everything when set under the header."}, + {Name: "pitch_keycenter", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: true, Description: "Root key for the sample."}, + {Name: "pitch_keytrack", Aliases: []string{"tune_keytrack"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeInteger, Min: ptr(float64(-1200)), Max: ptr(float64(1200)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "Within the region, this value defines how much the pitch changes with every note."}, + {Name: "pitch_random", Aliases: []string{"tune_random"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(9600)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "Random tuning for the region, in cents."}, + {Name: "pitch_veltrack", Aliases: []string{"tune_veltrack"}, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeInteger, Min: ptr(float64(-9600)), Max: ptr(float64(9600)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "Pitch velocity tracking, represents how much the pitch changes with incoming note velocity, in cents."}, + {Name: "transpose", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeInteger, Min: ptr(float64(-127)), Max: ptr(float64(127)), Default: "", Unit: "", Options: nil, Note: false, Description: "The transposition value for this region which will be applied to the sample."}, + {Name: "bend_stepup", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeInteger, Min: ptr(float64(1)), Max: ptr(float64(1200)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "Pitch bend step, in cents, applied to upwards bends only."}, + {Name: "bend_stepdown", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Performance Parameters / Pitch", Type: TypeInteger, Min: ptr(float64(1)), Max: ptr(float64(1200)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "Pitch bend step, in cents, for downward pitch bends."}, + {Name: "ampeg_attack", Aliases: []string{"amp_attack"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "EG attack time."}, + {Name: "ampeg_attackccN", Aliases: []string{"ampeg_attack_onccN"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: ""}, + {Name: "ampeg_attack_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "ampeg_vel2attack", Aliases: []string{"amp_vel2attack"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Velocity effect on EG attack time."}, + {Name: "ampeg_decay", Aliases: []string{"amp_decay"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "EG decay time."}, + {Name: "ampeg_decayccN", Aliases: []string{"ampeg_decay_onccN"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "ampeg_decay_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate ampeg_decay."}, + {Name: "ampeg_vel2decay", Aliases: []string{"amp_vel2decay"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Velocity effect on EG decay time."}, + {Name: "ampeg_delay", Aliases: []string{"amp_delay"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "EG delay time."}, + {Name: "ampeg_delayccN", Aliases: []string{"ampeg_delay_onccN"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "ampeg_delay_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "ampeg_vel2delay", Aliases: []string{"amp_vel2delay"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Velocity effect on EG delay time."}, + {Name: "ampeg_hold", Aliases: []string{"amp_hold"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "EG hold time."}, + {Name: "ampeg_holdccN", Aliases: []string{"ampeg_hold_onccN"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "ampeg_hold_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate ampeg_hold."}, + {Name: "ampeg_vel2hold", Aliases: []string{"amp_vel2hold"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Velocity effect on EG hold time."}, + {Name: "ampeg_release", Aliases: []string{"amp_release"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "EG release time (after note release)."}, + {Name: "ampeg_releaseccN", Aliases: []string{"ampeg_release_onccN"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: ""}, + {Name: "ampeg_release_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "ampeg_vel2release", Aliases: []string{"amp_vel2release"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Velocity effect on EG release time."}, + {Name: "ampeg_sustain", Aliases: []string{"amp_sustain"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "EG sustain level, in percentage."}, + {Name: "ampeg_sustainccN", Aliases: []string{"ampeg_sustain_onccN"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: ""}, + {Name: "ampeg_sustain_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate ampeg_sustain."}, + {Name: "ampeg_vel2sustain", Aliases: []string{"amp_vel2sustain"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Velocity effect on EG sustain level, in percentage."}, + {Name: "ampeg_start", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Envelope start level, in percentage."}, + {Name: "ampeg_startccN", Aliases: []string{"ampeg_start_onccN"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: ""}, + {Name: "ampeg_start_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "ampeg_attack_shape", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the curvature of attack stage of the envelope."}, + {Name: "ampeg_decay_shape", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the curvature of decay stage of the envelope."}, + {Name: "ampeg_decay_zero", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies how decay time is calculated."}, + {Name: "ampeg_dynamic", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies when envelope durations are recalculated."}, + {Name: "ampeg_release_shape", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the curvature of release stage of the envelope."}, + {Name: "ampeg_release_zero", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies how release time is calculated."}, + {Name: "fileg_attack_shape", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the curvature of attack stage of the envelope."}, + {Name: "fileg_decay_shape", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the curvature of decay stage of the envelope."}, + {Name: "fileg_decay_zero", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies how decay time is calculated."}, + {Name: "fileg_release_shape", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the curvature of release stage of the envelope."}, + {Name: "fileg_release_zero", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies how release time is calculated."}, + {Name: "fileg_dynamic", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies when envelope durations are recalculated."}, + {Name: "pitcheg_attack_shape", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the curvature of attack stage of the envelope."}, + {Name: "pitcheg_decay_shape", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the curvature of decay stage of the envelope."}, + {Name: "pitcheg_decay_zero", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies how decay time is calculated."}, + {Name: "pitcheg_release_shape", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the curvature of release stage of the envelope."}, + {Name: "pitcheg_release_zero", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies how release time is calculated."}, + {Name: "pitcheg_dynamic", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies when envelope durations are recalculated."}, + {Name: "fileg_attack", Aliases: []string{"fil_attack"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "EG attack time."}, + {Name: "fileg_attack_onccN", Aliases: []string{"fileg_attackccN"}, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: ""}, + {Name: "fileg_attack_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "fileg_vel2attack", Aliases: []string{"fil_vel2attack"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Velocity effect on EG attack time."}, + {Name: "fileg_decay", Aliases: []string{"fil_decay"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "EG decay time."}, + {Name: "fileg_decay_onccN", Aliases: []string{"fileg_decayccN"}, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "fileg_decay_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "fileg_vel2decay", Aliases: []string{"fil_vel2decay"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Velocity effect on filter EG decay time."}, + {Name: "fileg_delay", Aliases: []string{"fil_delay"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "EG delay time."}, + {Name: "fileg_delay_onccN", Aliases: []string{"fileg_delayccN"}, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "fileg_delay_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "fileg_vel2delay", Aliases: []string{"fil_vel2delay"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Velocity effect on filter EG delay time."}, + {Name: "fileg_depth", Aliases: []string{"fil_depth"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(-12000)), Max: ptr(float64(12000)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "Envelope depth."}, + {Name: "fileg_depth_onccN", Aliases: []string{"fileg_depthccN"}, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(-12000)), Max: ptr(float64(12000)), Default: "", Unit: "cents", Options: nil, Note: false, Description: ""}, + {Name: "fileg_depth_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "fileg_vel2depth", Aliases: []string{"fil_vel2depth"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(-12000)), Max: ptr(float64(12000)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "Velocity effect on EG depth, in cents for pitch or filter cutoff."}, + {Name: "fileg_hold", Aliases: []string{"fil_hold"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "EG hold time."}, + {Name: "fileg_hold_onccN", Aliases: []string{"fileg_holdccN"}, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "fileg_hold_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "fileg_vel2hold", Aliases: []string{"fil_vel2hold"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Velocity effect on EG hold time."}, + {Name: "fileg_release", Aliases: []string{"fil_release"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "EG release time (after note release)."}, + {Name: "fileg_release_onccN", Aliases: []string{"fileg_releaseccN"}, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: ""}, + {Name: "fileg_release_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "fileg_vel2release", Aliases: []string{"fil_vel2release"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Velocity effect on EG release time."}, + {Name: "fileg_start", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Envelope start level, in percentage."}, + {Name: "fileg_start_onccN", Aliases: []string{"fileg_startccN"}, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: ""}, + {Name: "fileg_start_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "fileg_sustain", Aliases: []string{"fil_sustain"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "EG sustain level, in percentage."}, + {Name: "fileg_sustain_onccN", Aliases: []string{"fileg_sustainccN"}, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: ""}, + {Name: "fileg_sustain_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "fileg_vel2sustain", Aliases: []string{"fil_vel2sustain"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Velocity effect on EG sustain level, in percentage."}, + {Name: "pitcheg_attack", Aliases: []string{"pitch_attack"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "EG attack time."}, + {Name: "pitcheg_attack_onccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "pitcheg_attack_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "pitcheg_vel2attack", Aliases: []string{"pitch_vel2attack"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Velocity effect on EG attack time."}, + {Name: "pitcheg_decay", Aliases: []string{"pitch_decay"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "EG decay time."}, + {Name: "pitcheg_decay_onccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "pitcheg_decay_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "pitcheg_vel2decay", Aliases: []string{"pitch_vel2decay"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Velocity effect on EG decay time."}, + {Name: "pitcheg_delay", Aliases: []string{"pitch_delay"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "EG delay time."}, + {Name: "pitcheg_delay_onccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "pitcheg_delay_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "pitcheg_vel2delay", Aliases: []string{"pitch_vel2delay"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Velocity effect on EG delay time."}, + {Name: "pitcheg_depth", Aliases: []string{"pitch_depth"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(-12000)), Max: ptr(float64(12000)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "Envelope depth."}, + {Name: "pitcheg_depth_onccN", Aliases: []string{"pitcheg_depthccN"}, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(-12000)), Max: ptr(float64(12000)), Default: "", Unit: "cents", Options: nil, Note: false, Description: ""}, + {Name: "pitcheg_depth_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "pitcheg_vel2depth", Aliases: []string{"pitch_vel2depth"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(-12000)), Max: ptr(float64(12000)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "Velocity effect on EG depth, in cents for pitch or filter cutoff."}, + {Name: "pitcheg_hold", Aliases: []string{"pitch_hold"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "EG hold time."}, + {Name: "pitcheg_hold_onccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "pitcheg_hold_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "pitcheg_vel2hold", Aliases: []string{"pitch_vel2hold"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Velocity effect on EG hold time."}, + {Name: "pitcheg_release", Aliases: []string{"pitch_release"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "EG release time (after note release)."}, + {Name: "pitcheg_release_onccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: ""}, + {Name: "pitcheg_release_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "pitcheg_vel2release", Aliases: []string{"pitch_vel2release"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Velocity effect on EG release time."}, + {Name: "pitcheg_start", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Envelope start level, in percentage."}, + {Name: "pitcheg_start_onccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: ""}, + {Name: "pitcheg_start_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "pitcheg_sustain", Aliases: []string{"pitch_sustain"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "EG sustain level, in percentage."}, + {Name: "pitcheg_sustain_onccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: ""}, + {Name: "pitcheg_sustain_curveccN", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "pitcheg_vel2sustain", Aliases: []string{"pitch_vel2sustain"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Velocity effect on EG sustain level, in percentage."}, + {Name: "egN_points", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_timeX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "seconds", Options: nil, Note: false, Description: ""}, + {Name: "egN_timeX_onccY", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "seconds", Options: nil, Note: false, Description: ""}, + {Name: "egN_levelX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-1)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Sets the envelope level at a specific point in envelope number N."}, + {Name: "egN_levelX_onccY", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: ptr(float64(-1)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_ampeg", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_dynamic", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies when envelope durations are recalculated."}, + {Name: "egN_shapeX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_curveX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Instructs the player to use a curve shape defined under a curve header for the specified envelope segment."}, + {Name: "egN_sustain", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_loop", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_loop_count", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_volume", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_volume_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_amplitude", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_amplitude_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_pan", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_pan_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_width", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_width_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_pan_curve", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_pan_curveccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC X uses to modulate egN_pan."}, + {Name: "egN_freq_lfoX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "Hz", Options: nil, Note: false, Description: "Allows egN to shape a change to lfoX's frequency"}, + {Name: "egN_depth_lfoX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "%", Options: nil, Note: false, Description: "Allows egN to scale lfoX's effect on its targets"}, + {Name: "egN_depthadd_lfoX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_pitch", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_pitch_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_cutoff", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_cutoff_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_cutoff2", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_cutoff2_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_resonance", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_resonance_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_resonance2", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_resonance2_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_eqXfreq", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_eqXfreq_onccY", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_eqXbw", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_eqXbw_onccY", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_eqXgain", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_eqXgain_onccY", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_decim", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_decim_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_bitred", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_bitred_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_rectify", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_rectify_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_ringmod", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_ringmod_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_noiselevel", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_noiselevel_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_noisestep", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_noisestep_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_noisetone", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_noisetone_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_driveshape", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_driveshape_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "egN_sample_dyn_paramX", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "ARIA-specific nameless destination for plugin envelope modulations."}, + {Name: "egN_sample_dyn_paramX_onccY", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / Envelope Generators", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "amplfo_delay", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "The time before the LFO starts oscillating."}, + {Name: "amplfo_depth", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-10)), Max: ptr(float64(10)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "LFO depth."}, + {Name: "amplfo_depthccN", Aliases: []string{"amplfo_depth_onccN"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-10)), Max: ptr(float64(10)), Default: "", Unit: "dB", Options: nil, Note: false, Description: ""}, + {Name: "amplfo_depthchanaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-10)), Max: ptr(float64(10)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "LFO depth when channel aftertouch MIDI messages are received."}, + {Name: "amplfo_depthpolyaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-10)), Max: ptr(float64(10)), Default: "", Unit: "dB", Options: nil, Note: false, Description: "LFO depth when polyphonic aftertouch MIDI messages are received."}, + {Name: "amplfo_fade", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "LFO fade-in effect time."}, + {Name: "amplfo_freq", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(20)), Default: "", Unit: "Hz", Options: nil, Note: false, Description: "LFO frequency, in hertz."}, + {Name: "amplfo_freqccN", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-200)), Max: ptr(float64(200)), Default: "", Unit: "Hz", Options: nil, Note: false, Description: ""}, + {Name: "amplfo_freqchanaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-200)), Max: ptr(float64(200)), Default: "", Unit: "Hz", Options: nil, Note: false, Description: "LFO frequency change when channel aftertouch MIDI messages are received, in Hertz."}, + {Name: "amplfo_freqpolyaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-200)), Max: ptr(float64(200)), Default: "", Unit: "Hz", Options: nil, Note: false, Description: "LFO frequency change when polyphonic aftertouch MIDI messages are received, in Hertz."}, + {Name: "fillfo_delay", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "The time before the LFO starts oscillating."}, + {Name: "fillfo_depth", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-1200)), Max: ptr(float64(1200)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "LFO depth."}, + {Name: "fillfo_depthccN", Aliases: []string{"fillfo_depth_onccN"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-1200)), Max: ptr(float64(1200)), Default: "", Unit: "cents", Options: nil, Note: false, Description: ""}, + {Name: "fillfo_depthchanaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-1200)), Max: ptr(float64(1200)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "LFO depth when channel aftertouch MIDI messages are received."}, + {Name: "fillfo_depthpolyaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-1200)), Max: ptr(float64(1200)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "LFO depth when polyphonic aftertouch MIDI messages are received."}, + {Name: "fillfo_fade", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "LFO fade-in effect time."}, + {Name: "fillfo_freq", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(20)), Default: "", Unit: "Hz", Options: nil, Note: false, Description: "LFO frequency, in hertz."}, + {Name: "fillfo_freqccN", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-200)), Max: ptr(float64(200)), Default: "", Unit: "Hz", Options: nil, Note: false, Description: ""}, + {Name: "fillfo_freqchanaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-200)), Max: ptr(float64(200)), Default: "", Unit: "Hz", Options: nil, Note: false, Description: "LFO frequency change when channel aftertouch MIDI messages are received, in Hertz."}, + {Name: "fillfo_freqpolyaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-200)), Max: ptr(float64(200)), Default: "", Unit: "Hz", Options: nil, Note: false, Description: "LFO frequency change when polyphonic aftertouch MIDI messages are received, in Hertz."}, + {Name: "pitchlfo_delay", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "The time before the LFO starts oscillating."}, + {Name: "pitchlfo_depth", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-1200)), Max: ptr(float64(1200)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "LFO depth."}, + {Name: "pitchlfo_depthccN", Aliases: []string{"pitchlfo_depth_onccN"}, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-1200)), Max: ptr(float64(1200)), Default: "", Unit: "cents", Options: nil, Note: false, Description: ""}, + {Name: "pitchlfo_depthchanaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-1200)), Max: ptr(float64(1200)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "LFO depth when channel aftertouch MIDI messages are received."}, + {Name: "pitchlfo_depthpolyaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-1200)), Max: ptr(float64(1200)), Default: "", Unit: "cents", Options: nil, Note: false, Description: "LFO depth when polyphonic aftertouch MIDI messages are received."}, + {Name: "pitchlfo_fade", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "seconds", Options: nil, Note: false, Description: "LFO fade-in effect time."}, + {Name: "pitchlfo_freq", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(20)), Default: "", Unit: "Hz", Options: nil, Note: false, Description: "LFO frequency, in hertz."}, + {Name: "pitchlfo_freqccN", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-200)), Max: ptr(float64(200)), Default: "", Unit: "Hz", Options: nil, Note: false, Description: ""}, + {Name: "pitchlfo_freqchanaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-200)), Max: ptr(float64(200)), Default: "", Unit: "Hz", Options: nil, Note: false, Description: "LFO frequency change when channel aftertouch MIDI messages are received, in Hertz."}, + {Name: "pitchlfo_freqpolyaft", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-200)), Max: ptr(float64(200)), Default: "", Unit: "Hz", Options: nil, Note: false, Description: "LFO frequency change when polyphonic aftertouch MIDI messages are received, in Hertz."}, + {Name: "lfoN_freq", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "Hz", Options: nil, Note: false, Description: "The base frequency of LFO number N, in Hertz."}, + {Name: "lfoN_freq_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_freq_smoothccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_freq_stepccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_delay", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "seconds", Options: nil, Note: false, Description: "Onset delay for LFO number N."}, + {Name: "lfoN_delay_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_fade", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Fade-in time for LFO number N."}, + {Name: "lfoN_fade_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_phase", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Initial phase shift for LFO number N."}, + {Name: "lfoN_phase_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_count", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeInteger, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Number of LFO repetitions for LFO N before the LFO stops."}, + {Name: "lfoN_wave", Aliases: []string{"lfoN_waveX"}, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeInteger, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "LFO waveform selection."}, + {Name: "lfoN_wave_onccX", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_steps", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeInteger, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Number of steps in LFO step sequencer."}, + {Name: "lfoN_stepX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: ptr(float64(-100)), Max: ptr(float64(100)), Default: "", Unit: "percent", Options: nil, Note: false, Description: "Level of the step number X in LFO step sequencer."}, + {Name: "lfoN_stepX_onccY", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_smooth", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_smooth_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_volume", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_volume_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_volume_smoothccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_volume_stepccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_amplitude", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_amplitude_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_amplitude_smoothccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_amplitude_stepccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_pan", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_pan_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_pan_smoothccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_pan_stepccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_width", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_width_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_width_smoothccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_width_stepccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_freq_lfoX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_freq_lfoX_onccY", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_depth_lfoX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_depthadd_lfoX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_pitch", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_pitch_curveccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC X uses to modulate lfoN_pitch."}, + {Name: "lfoN_pitch_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_pitch_smoothccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_pitch_stepccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_cutoff", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_cutoff_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_cutoff_smoothccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_cutoff_stepccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_cutoff2", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_cutoff2_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_cutoff2_smoothccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_cutoff2_stepccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_resonance", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_resonance_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_resonance_smoothccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_resonance_stepccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_resonance2", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_resonance2_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_resonance2_smoothccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_resonance2_stepccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_eqXfreq", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_eqXfreq_onccY", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_eqXfreq_smoothccY", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_eqXfreq_stepccY", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_eqXbw", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_eqXbw_onccY", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_eqXbw_smoothccY", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_eqXbw_stepccY", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_eqXgain", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_eqXgain_onccY", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_eqXgain_smoothccY", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_eqXgain_stepccY", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_decim", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_decim_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_decim_smoothccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_decim_stepccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_bitred", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_bitred_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_bitred_smoothccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_bitred_stepccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_noiselevel", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_noiselevel_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_noiselevel_smoothccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_noiselevel_stepccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_noisestep", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_noisestep_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_noisestep_smoothccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_noisestep_stepccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_noisetone", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_noisetone_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_noisetone_smoothccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_noisetone_stepccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_drive", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_drive_onccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_drive_smoothccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_drive_stepccX", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "lfoN_offset", Aliases: []string{"lfoN_offsetX"}, Version: "ARIA", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "DC offset - Add to LFO output; not affected by scale."}, + {Name: "lfoN_ratio", Aliases: []string{"lfoN_ratioX"}, Version: "ARIA", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Sets the ratio between the specified sub waveform and the main waveform."}, + {Name: "lfoN_scale", Aliases: []string{"lfoN_scaleX"}, Version: "ARIA", Deprecated: false, Category: "Modulation / LFO", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Sets the scaling between the specified sub waveform and the main waveform."}, + {Name: "lfoN_sample_dyn_paramX", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "ARIA-specific nameless destination for plugin LFO modulations."}, + {Name: "lfoN_sample_dyn_paramX_onccY", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Modulation / LFO", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "curve_index", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Curves", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Curve definition ID."}, + {Name: "vNNN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Curves", Type: TypeFloat, Min: ptr(float64(-1)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: "Defines a point in a custom curve definition."}, + {Name: "apan_depth", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "apan_depth_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "apan_dry", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "apan_dry_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "apan_freq", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "Hz", Options: nil, Note: false, Description: ""}, + {Name: "apan_freq_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "apan_phase", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(180)), Default: "", Unit: "°", Options: nil, Note: false, Description: ""}, + {Name: "apan_phase_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "apan_waveform", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "LFO wave number."}, + {Name: "apan_wet", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "apan_wet_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "bitred", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: "Bit reduction."}, + {Name: "bitred_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "bitred_curveccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate bitred."}, + {Name: "bitred_smoothccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "bitred_stepccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "bus", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeString, Min: nil, Max: nil, Default: "main", Unit: "", Options: []string{"main", "aux1", "aux2", "aux3", "aux4", "aux5", "aux6", "aux7", "aux8", "fx1", "fx2", "fx3", "fx4", "midi"}, Note: false, Description: "The target bus for the effect."}, + {Name: "bypass_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Sets up a bypass controller for the effect."}, + {Name: "comp_attack", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "seconds", Options: nil, Note: false, Description: ""}, + {Name: "comp_gain", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "comp_ratio", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "comp_release", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "seconds", Options: nil, Note: false, Description: ""}, + {Name: "comp_stlink", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: []string{"on", "off"}, Note: false, Description: ""}, + {Name: "comp_threshold", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "dB", Options: nil, Note: false, Description: ""}, + {Name: "decim", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: "Decimator."}, + {Name: "decim_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "decim_curveccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(255)), Default: "", Unit: "", Options: nil, Note: false, Description: "Specifies the number which MIDI CC N uses to modulate decim."}, + {Name: "decim_smoothccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "decim_stepccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_cutoff", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "Hz", Options: nil, Note: false, Description: ""}, + {Name: "delay_cutoff_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_damphi", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_damphi_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_damplo", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_damplo_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_dry", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_dry_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_feedback", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_feedback_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_filter", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Name of filter type."}, + {Name: "delay_input", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_input_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_levelc", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_levell", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_levelr", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_lfofreq", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "Hz", Options: nil, Note: false, Description: ""}, + {Name: "delay_lfofreq_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_moddepth", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_moddepth_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_mode", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: []string{"detune", "chorus", "cross", "flanger", "lrc", "mod", "multimod", "panning", "ping", "rlc", "stereo", "tlcr"}, Note: false, Description: ""}, + {Name: "delay_panc", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_panc_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_panl", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_panl_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_panr", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_panr_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_resonance", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_resonance_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_spread", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_spread_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_syncc_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_syncl_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_syncr_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_time_tap", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_timec", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_timec_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_timel", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_timel_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_timer", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_timer_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_wet", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "delay_wet_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "directtomain", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Gain of the main bus into the output."}, + {Name: "disto_depth", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "disto_depth_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "disto_dry", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "disto_dry_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "disto_stages", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "disto_tone", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "disto_tone_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "disto_wet", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "disto_wet_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "dsp_order", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(14)), Default: "", Unit: "", Options: nil, Note: false, Description: "Signal flow type in Rapture's DSP block."}, + {Name: "effect1", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Level of effect1 send, in percentage (reverb in Cakewalk sfz)."}, + {Name: "effect2", Aliases: nil, Version: "SFZ v1", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Level of effect2 send, in percentage (chorus in Cakewalk sfz)."}, + {Name: "effect3", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Gain of the region's send into the 3rd effect bus."}, + {Name: "effect4", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Gain of the region's send into the 4th effect bus."}, + {Name: "eq_bw", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "eq_bw_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "eq_freq", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "eq_freq_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "eq_gain", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "eq_gain_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "eq_type", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "filter_cutoff", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "filter_cutoff_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "filter_resonance", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "filter_resonance_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "filter_type", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Name of filter type."}, + {Name: "fxNtomain", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Gain of the Nth effect bus into the output."}, + {Name: "fxNtomix", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "%", Options: nil, Note: false, Description: "Gain of the Nth effect bus into the Mix node."}, + {Name: "gate_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Gate manual control."}, + {Name: "gate_attack", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "gate_release", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "gate_stlink", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: []string{"on", "off"}, Note: false, Description: ""}, + {Name: "gate_threshold", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "internal", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeString, Min: nil, Max: nil, Default: "off", Unit: "", Options: []string{"on", "off"}, Note: false, Description: "Cakewalk internal features switch."}, + {Name: "param_offset", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Effects", Type: TypeInteger, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Adds a number to the parameter numbers of built-in or vendor-specific effects."}, + {Name: "phaser_depth", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "phaser_depth_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "phaser_feedback", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "phaser_feedback_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "phaser_freq", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "Hz", Options: nil, Note: false, Description: ""}, + {Name: "phaser_freq_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "phaser_phase_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "phaser_stages", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "phaser_waveform", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "LFO wave number."}, + {Name: "phaser_wet", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "phaser_wet_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "reverb_damp", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "reverb_damp_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "reverb_dry", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "reverb_dry_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "reverb_input", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "reverb_input_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "reverb_predelay", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "seconds", Options: nil, Note: false, Description: ""}, + {Name: "reverb_predelay_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "reverb_size", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "reverb_size_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "reverb_tone", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "reverb_tone_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "reverb_type", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: []string{"chamber", "large_hall", "large_room", "mid_hall", "mid_room", "small_hall", "small_room"}, Note: false, Description: ""}, + {Name: "reverb_wet", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "reverb_wet_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "static_cyclic_level", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "static_cyclic_time", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "seconds", Options: nil, Note: false, Description: ""}, + {Name: "static_filter", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Name of filter type."}, + {Name: "static_level", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "static_level_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "static_random_level", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "static_random_maxtime", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "seconds", Options: nil, Note: false, Description: ""}, + {Name: "static_random_mintime", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeFloat, Min: nil, Max: nil, Default: "", Unit: "seconds", Options: nil, Note: false, Description: ""}, + {Name: "static_stereo", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "static_tone", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "strings_number", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Number of synthesized resonant strings."}, + {Name: "strings_wet_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "tdfir_dry", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "tdfir_dry_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "tdfir_gain", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "tdfir_impulse", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "tdfir_wet", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: ptr(float64(0)), Max: ptr(float64(100)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "tdfir_wet_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "type", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Effects", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: []string{"apan", "comp", "delay", "disto", "eq", "filter", "fverb", "gate", "limiter", "lofi", "mverb", "phaser", "static", "strings", "tdfir", "com.mda.Limiter", "com.mda.Overdrive", "com.mda.Leslie", "com.mda.RingMod", "com.mda.Delay", "com.mda.Bandisto", "com.mda.Ambience", "com.mda.DubDelay", "com.mda.Detune", "com.mda.Dither", "com.mda.Combo", "com.mda.Degrade", "com.mda.SubSynth", "com.mda.RezFilter"}, Note: false, Description: "Effect type or vendor-specific effect name. Varies across SFZ players."}, + {Name: "vendor_specific", Aliases: nil, Version: "ARIA", Deprecated: false, Category: "Effects", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Defines vendor-specific effects, for example Garritan-specific stage depth effect in ARIA."}, + {Name: "load_mode", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Loading", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(1)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "load_start", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Loading", Type: TypeInteger, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "load_end", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Loading", Type: TypeInteger, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "sample_quality", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Loading", Type: TypeInteger, Min: ptr(float64(1)), Max: ptr(float64(10)), Default: "", Unit: "", Options: nil, Note: false, Description: "Sample playback quality settings."}, + {Name: "image", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Loading", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: "Sets the background image of the instrument."}, + {Name: "oscillator", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Wavetable Oscillator", Type: TypeString, Min: nil, Max: nil, Default: "", Unit: "", Options: []string{"on", "off"}, Note: false, Description: ""}, + {Name: "oscillator_detune", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Wavetable Oscillator", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "oscillator_detune_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Wavetable Oscillator", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "oscillator_mode", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Wavetable Oscillator", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(2)), Default: "", Unit: "", Options: nil, Note: false, Description: "The modulation type."}, + {Name: "oscillator_mod_depth", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Wavetable Oscillator", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "oscillator_mod_depth_onccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Wavetable Oscillator", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "oscillator_mod_smoothccN", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Wavetable Oscillator", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "oscillator_multi", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Wavetable Oscillator", Type: TypeInteger, Min: ptr(float64(1)), Max: ptr(float64(9)), Default: "", Unit: "", Options: nil, Note: false, Description: "Configure a region to use more than one oscillator."}, + {Name: "oscillator_phase", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Wavetable Oscillator", Type: TypeFloat, Min: ptr(float64(-1)), Max: ptr(float64(360)), Default: "", Unit: "", Options: nil, Note: false, Description: "Oscillator phase. Negative values for random phase."}, + {Name: "oscillator_quality", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Wavetable Oscillator", Type: TypeInteger, Min: ptr(float64(0)), Max: ptr(float64(3)), Default: "", Unit: "", Options: nil, Note: false, Description: ""}, + {Name: "oscillator_table_size", Aliases: nil, Version: "SFZ v2", Deprecated: false, Category: "Wavetable Oscillator", Type: TypeUnspecified, Min: nil, Max: nil, Default: "", Unit: "", Options: nil, Note: false, Description: ""}, +} diff --git a/registry_test.go b/registry_test.go new file mode 100644 index 0000000..f32f3b6 --- /dev/null +++ b/registry_test.go @@ -0,0 +1,204 @@ +package sfz + +import ( + "flag" + "fmt" + "os" + "strings" + "testing" +) + +var update = flag.Bool("update", false, "rewrite docs/opcodes.md") + +func TestLookup(t *testing.T) { + for _, tc := range []struct { + name, canonical string + }{ + {"lokey", "lokey"}, + {"loopmode", "loop_mode"}, + {"loop_mode", "loop_mode"}, + {"locc64", "loccN"}, + {"amp_velcurve_127", "amp_velcurve_N"}, + {"eg02_time3", "egN_timeX"}, + {"ampeg_attack_oncc12", "ampeg_attackccN"}, + {"v064", "vNNN"}, + {"hint_anything_here", "hint_*"}, + {"cutoff2_cc5", "cutoff2_ccN"}, + } { + info, ok := Lookup(tc.name) + if !ok || info.Name != tc.canonical { + t.Errorf("Lookup(%q) = %q, %v; want %q", tc.name, info.Name, ok, tc.canonical) + } + } + for _, name := range []string{"", "zampler_gain", "lokey2", "loccN7x", "lokey "} { + if info, ok := Lookup(name); ok { + t.Errorf("Lookup(%q) = %q", name, info.Name) + } + } + info, _ := Lookup("lokey") + if info.Type != TypeInteger || !info.Note || *info.Min != 0 || *info.Max != 127 { + t.Errorf("lokey %+v", info) + } + if h, ok := LookupHeader("REGION"); !ok || h.Name != "region" { + t.Errorf("header %+v", h) + } +} + +// TestRegistryComplete checks the registry holds what the spec lists, each +// name once, and that every name reads back as the opcode it belongs to. +func TestRegistryComplete(t *testing.T) { + count := 0 + for info := range KnownOpcodes() { + count++ + for _, name := range append([]string{info.Name}, info.Aliases...) { + if strings.ContainsAny(name, "*") || placeholders.MatchString(name) { + continue + } + got, ok := Lookup(name) + if !ok || got.Name != info.Name { + t.Errorf("%s is %q", name, got.Name) + } + } + } + if count < 700 { + t.Errorf("%d opcodes", count) + } + for _, h := range []string{"region", "group", "master", "global", "control", "curve", "effect", "midi", "sample"} { + if _, ok := LookupHeader(h); !ok { + t.Errorf("no header %s", h) + } + } +} + +func TestGetAs(t *testing.T) { + ops := Opcodes{"lokey": "c4", "hikey": " 72 ", "loopmode": "one_shot", "volume": "-3.5", "offset": "12", "bad": "x"} + if n, ok := GetAs[int](ops, "lokey"); !ok || n != 60 { + t.Errorf("lokey %d %v", n, ok) + } + if n, ok := GetAs[int64](ops, "hikey"); !ok || n != 72 { + t.Errorf("hikey %d %v", n, ok) + } + if s, ok := GetAs[string](ops, "loop_mode"); !ok || s != "one_shot" { + t.Errorf("loop_mode %q %v", s, ok) + } + if f, ok := GetAs[float64](ops, "volume"); !ok || f != -3.5 { + t.Errorf("volume %v %v", f, ok) + } + if n, ok := GetAs[int](ops, "offset"); !ok || n != 12 { + t.Errorf("offset %d %v", n, ok) + } + if _, ok := GetAs[int](ops, "bad"); ok { + t.Error("bad is an int") + } + if _, ok := GetAs[int](ops, "missing"); ok { + t.Error("missing is set") + } +} + +func TestValidateValues(t *testing.T) { + text := " sample=a.wav lokey=c4 hikey=60 lovel=100 hivel=20 volume=loud pan=300 loop_mode=sideways\n" + + " zampler_gain=3 locc7=1 pitch_keycenter=sample key=$K \n" + + " lokey=10 hikey=9 amp_veltrack=1.5 ampeg_attack=$A\n" + doc, err := Parse(strings.NewReader(text)) + if err != nil { + t.Fatal(err) + } + var got []string + for _, p := range doc.Validate() { + got = append(got, fmt.Sprintf("%d:%s", p.Line, p.Code)) + } + want := []string{ + "1:value.type", // volume=loud + "1:value.range", // pan=300 + "1:value.option", // loop_mode=sideways + "1:range.inverted", // lovel above hivel + "2:opcode.unknown", // zampler_gain + "2:define.undefined", + "2:header.unknown", // + "3:range.inverted", // lokey above hikey + "3:define.undefined", // $A + } + for _, w := range want { + found := false + for _, g := range got { + if g == w { + found = true + } + } + if !found { + t.Errorf("no %s in %v", w, got) + } + } + if len(got) != len(want) { + t.Errorf("problems %v", got) + } +} + +// TestOpcodeDoc checks docs/opcodes.md is the table the registry makes. Run +// the tests with -update to rewrite it. +func TestOpcodeDoc(t *testing.T) { + var b strings.Builder + b.WriteString("# Opcodes\n\n" + + "Every opcode the library knows, from [sfzformat.com](https://sfzformat.com/)'s data. " + + "**Typed** opcodes are read into the [`Instrument`](../instrument.go) model; the rest are known, so the " + + "library validates them, and reads and writes them as text. This file is generated by `go test -update`.\n\n" + + "| Opcode | Version | Value | Typed |\n|---|---|---|---|\n") + for info := range KnownOpcodes() { + value := info.Type.String() + if info.Unit != "" { + value += " (" + info.Unit + ")" + } + names := "`" + info.Name + "`" + for _, a := range info.Aliases { + names += ", `" + a + "`" + } + typed := "" + if isTyped(info) { + typed = "yes" + } + deprecated := "" + if info.Deprecated { + deprecated = ", deprecated" + } + fmt.Fprintf(&b, "| %s | %s%s | %s | %s |\n", names, info.Version, deprecated, value, typed) + } + if *update { + if err := os.WriteFile("docs/opcodes.md", []byte(b.String()), 0o644); err != nil { + t.Fatal(err) + } + return + } + got, err := os.ReadFile("docs/opcodes.md") + if err != nil { + t.Fatal(err) + } + if string(got) != b.String() { + t.Error("docs/opcodes.md is out of date; run go test -update") + } +} + +// placeholders finds the placeholders in a family's name. +var placeholders = patternRE + +// isTyped reports whether the typed model reads any name of an opcode. +func isTyped(info OpcodeInfo) bool { + for _, name := range append([]string{info.Name}, info.Aliases...) { + if strings.Contains(name, "*") { + continue + } + if handled(placeholders.ReplaceAllString(name, "1")) { + return true + } + } + return false +} + +// TestTypedOpcodesKnown checks that the registry knows every opcode the typed +// model reads by name. +func TestTypedOpcodesKnown(t *testing.T) { + for name := range handledNames { + if _, ok := Lookup(name); !ok { + t.Errorf("%s isn't in the registry", name) + } + } +} diff --git a/roundtrip_test.go b/roundtrip_test.go new file mode 100644 index 0000000..62dff33 --- /dev/null +++ b/roundtrip_test.go @@ -0,0 +1,122 @@ +package sfz + +import ( + "io/fs" + "os" + "path/filepath" + "strings" + "testing" +) + +// roundTripTexts are texts that are awkward to read: comments in odd places, +// CRLF and tabs, directives in the middle of lines, unknown headers and text +// that isn't SFZ. +var roundTripTexts = map[string]string{ + "empty": "", + "spaces": " \n\t\n", + "comments": "// top\r\n/* a\r\nblock */\tsample=a b.wav // end\r\nlokey=c#4 /* x */ hikey=60\r\n/* open", + "crlf": "\r\nvolume=1\r\n sample=a.wav\r\n", + "include": "#define $D Data\n #include \"$D/a.txt\" lovel=1 #include \"b.txt\"\n#include broken\n#define $X\n", + "unknown": " type=reverb\nfoo bar=1 baz\n<>\n sample=ü.wav\n\x00\xff=1 =2 x==3\n", + "no final": " sample=a.wav", + "variable": "#define $A 1\n$A $B=2 label_cc$A=x\n", +} + +func TestRoundTrip(t *testing.T) { + for name, text := range roundTripTexts { + doc, err := Parse(strings.NewReader(text)) + if err != nil { + t.Errorf("%s: %v", name, err) + continue + } + if got := doc.String(); got != text { + t.Errorf("%s: wrote %q, want %q", name, got, text) + } + var b strings.Builder + if n, err := doc.WriteTo(&b); err != nil || n != int64(len(text)) || b.String() != text { + t.Errorf("%s: WriteTo %d %v %q", name, n, err, b.String()) + } + } +} + +// TestRoundTripFiles checks that every file of the fixtures, and every file +// they include, is written back as it was read. +func TestRoundTripFiles(t *testing.T) { + dir := filepath.Join("testdata", "splendid") + doc, err := ParseFile(os.DirFS(dir), "Splendid Grand Piano.sfz") + if err != nil { + t.Fatal(err) + } + files := doc.Files() + if len(files) != 1+1+5 { + t.Errorf("%d files", len(files)) + } + for _, f := range files { + want, err := os.ReadFile(filepath.Join(dir, f.Path)) + if err != nil { + t.Fatal(err) + } + if f.String() != string(want) { + t.Errorf("%s isn't written back as it was read", f.Path) + } + } + // The fixture's amplitude_oncc70=200 is past the 100 the format gives as + // the most, and is the only problem. + problems := doc.Validate() + if len(problems) != 1 || problems[0].Code != "value.range" || problems[0].Line != 82 { + t.Errorf("problems %+v", problems) + } +} + +// TestIncludedTwice checks that a file included twice is two files of the +// document, each with the variables it was read with. +func TestIncludedTwice(t *testing.T) { + m := map[string]string{ + "main.sfz": "#define $S a\n#include \"x.txt\"\n#define $S b\n#include \"x.txt\"\n", + "x.txt": " sample=$S.wav\n", + } + doc := parseFiles(t, m) + if len(doc.Files()) != 3 { + t.Errorf("%d files", len(doc.Files())) + } + regions := doc.Flatten().Regions + if len(regions) != 2 || regions[0].Opcodes["sample"] != "a.wav" || regions[1].Opcodes["sample"] != "b.wav" { + t.Errorf("regions %+v", regions) + } +} + +func TestValidate(t *testing.T) { + doc, err := Parse(strings.NewReader("lokey=1\n sample=$GONE.wav\n#define $A 1\n %%% sample=$A.wav\n")) + if err != nil { + t.Fatal(err) + } + var codes []string + for _, p := range doc.Validate() { + codes = append(codes, p.Code) + } + want := "opcode.no-header define.undefined text.unreadable" + if got := strings.Join(codes, " "); got != want { + t.Errorf("got %q, want %q", got, want) + } +} + +// FuzzRoundTrip checks that any text is written back as it was read, and that +// flattening and validating it don't panic. +func FuzzRoundTrip(f *testing.F) { + for _, text := range roundTripTexts { + f.Add(text) + } + f.Fuzz(func(t *testing.T, text string) { + resolver := func(string) ([]byte, error) { return nil, fs.ErrNotExist } + doc, err := Parse(strings.NewReader(text), WithResolver(resolver)) + if err != nil { + t.Skip() + } + if got := doc.String(); got != text { + t.Fatalf("wrote %q, want %q", got, text) + } + doc.Flatten().Instrument() + doc.Validate() + }) +} diff --git a/sfz_test.go b/sfz_test.go new file mode 100644 index 0000000..295bf6f --- /dev/null +++ b/sfz_test.go @@ -0,0 +1,709 @@ +package sfz + +import ( + "errors" + "io/fs" + "math" + "os" + "path/filepath" + "reflect" + "slices" + "strings" + "testing" +) + +// The tests mark where their expected values come from: "spec" is +// sfzformat.com, "sfizz" is the sfizz player's source, which the spec leaves +// open points to, and "choice" is Zampler's own where neither settles it. + +// files returns a Resolver that reads from a map of paths to contents. +func files(m map[string]string) Resolver { + return func(p string) ([]byte, error) { + if s, ok := m[p]; ok { + return []byte(s), nil + } + return nil, fs.ErrNotExist + } +} + +// parseFiles parses the main file of a map of files. +func parseFiles(t *testing.T, m map[string]string, opts ...ParseOption) *Document { + t.Helper() + doc, err := Parse(strings.NewReader(m["main.sfz"]), append([]ParseOption{WithResolver(files(m))}, opts...)...) + if err != nil { + t.Fatal(err) + } + return doc +} + +// parseText parses a one-file instrument. +func parseText(t *testing.T, text string) *Instrument { + t.Helper() + return parseFiles(t, map[string]string{"main.sfz": text}).Flatten().Instrument() +} + +func near(a, b float64) bool { return math.Abs(a-b) < 1e-9 } + +// TestVariableNames checks that a variable's name ends at the shortest +// defined name, so an underscore after it is text (ARIA), and that a name with +// an underscore is found when no shorter name is defined. +func TestVariableNames(t *testing.T) { + doc := parseFiles(t, map[string]string{ + "main.sfz": "#define $MIC Far\n#define $VEL1 10\n#define $CODE_01 AB\n" + + " sample=$MIC_$VEL1_one-$CODE_01.flac $NOPE_x\n", + }) + ops := doc.Flatten().Regions[0].Opcodes + // An undefined variable is left as it is. + if ops["sample"] != "Far_10_one-AB.flac $NOPE_x" { + t.Errorf("sample %q", ops["sample"]) + } +} + +func TestFlatten(t *testing.T) { + doc := parseFiles(t, map[string]string{ + "main.sfz": "#define $DIR Data // the folder\n" + + "#define $V soft\n" + + " #include \"$DIR/a.txt\" lovel=1 #include \"Data/b.txt\"\n" + + "#define $V loud\n" + + "/* a\nblock */ sample=$V C#4.wav $UNDEFINED=1\n", + "Data/a.txt": "#define $X 7\nhivel=$X", + "Data/b.txt": " sample=$V.wav", + }) + flat := doc.Flatten() + if len(flat.Regions) != 2 { + t.Fatalf("regions %v", flat.Regions) + } + // Variables take the value they had where they are used (sfizz), an + // include is read where it was written (spec), comments are dropped, and a + // # in a note name isn't a directive. + first, second := flat.Regions[0].Opcodes, flat.Regions[1].Opcodes + if first["sample"] != "soft.wav" || first["hivel"] != "7" || first["lovel"] != "1" { + t.Errorf("first region %v", first) + } + if second["sample"] != "loud C#4.wav" || second["$UNDEFINED"] != "1" || second["hivel"] != "7" { + t.Errorf("second region %v", second) + } + if flat.Regions[0].File != "Data/b.txt" || flat.Regions[1].Line != 6 { + t.Errorf("positions %+v %+v", flat.Regions[0], flat.Regions[1]) + } +} + +// TestVariableOpcodes checks that a variable can stand for opcodes and +// headers, and for part of an opcode's name. +func TestVariableOpcodes(t *testing.T) { + doc := parseFiles(t, map[string]string{ + "main.sfz": "#define $RANGE lokey=36 hikey=40\n#define $CC 70\n#define $HEAD \n" + + "$HEAD sample=a.wav $RANGE locc$CC=5\n", + }) + ops := doc.Flatten().Regions[0].Opcodes + if ops["lokey"] != "36" || ops["hikey"] != "40" || ops["locc70"] != "5" || ops["sample"] != "a.wav" { + t.Errorf("%v", ops) + } +} + +func TestParseErrors(t *testing.T) { + // An include loop and an include nested too deeply are refused (spec: + // "recursion must be avoided"; sfizz limits the depth). + loop := map[string]string{"a": `#include "b"`, "b": `#include "a"`} + if _, err := Parse(strings.NewReader(loop["a"]), WithResolver(files(loop))); err != nil { + // The main file has no name, so b includes a, which includes b. + if !errors.Is(err, ErrIncludeLoop) || !errors.Is(err, ErrInvalid) { + t.Errorf("loop: %v", err) + } + } else { + t.Errorf("loop: no error") + } + deep := map[string]string{} + for i := 0; i <= DefaultLimits.MaxDepth+1; i++ { + deep[string(rune('a'+i))] = `#include "` + string(rune('b'+i)) + `"` + } + if _, err := Parse(strings.NewReader(deep["a"]), WithResolver(files(deep))); !errors.Is(err, ErrInvalid) { + t.Errorf("deep includes: %v", err) + } + + // A missing include is reported and left unresolved, unless asked to fail. + missing := ` sample=a.wav #include "missing.sfz"` + doc, err := Parse(strings.NewReader(missing), WithResolver(files(nil))) + if err != nil { + t.Fatal(err) + } + problems := doc.Validate() + if len(problems) != 1 || problems[0].Code != "include.unresolved" || problems[0].Col != 23 { + t.Errorf("problems %+v", problems) + } + if len(doc.Flatten().Regions) != 1 { + t.Errorf("regions %v", doc.Flatten().Regions) + } + _, err = Parse(strings.NewReader(missing), WithResolver(files(nil)), WithIncludes(IncludesFail)) + if !errors.Is(err, ErrUnresolved) || !errors.Is(err, fs.ErrNotExist) { + t.Errorf("fail mode: %v", err) + } +} + +func TestIncludes(t *testing.T) { + // A file's includes are listed once each, in order, with its own + // variables substituted, backslashes read as slashes and paths cleaned. + // An include in a comment isn't one, and an undefined variable is kept. + text := "#define $KIT kick\n" + + "#include \"mappings/$KIT/a.sfz\"\n" + + "// #include \"commented.sfz\"\n" + + " #include \"mappings\\$KIT\\.\\b.sfz\"\n" + + "#include \"mappings/$KIT/a.sfz\"\n" + + "#include \"$UNSET/c.sfz\"\n" + want := []string{"mappings/kick/a.sfz", "mappings/kick/b.sfz", "$UNSET/c.sfz"} + if got := Includes([]byte(text)); !reflect.DeepEqual(got, want) { + t.Errorf("got %q, want %q", got, want) + } + + // A file with no includes has none. + if got := Includes([]byte(" sample=a.wav")); len(got) != 0 { + t.Errorf("got %q, want none", got) + } +} + +func TestInheritance(t *testing.T) { + inst := parseText(t, ` + default_path=One/ + pan=10 + lovel=64 tune=5 + sample=a b.wav tune=7 + sample=c.wav + default_path=Two/ + hivel=90 + sample=d.wav + type=reverb + pan=-20 + sample=e.wav + + sample=f.wav +`) + got := map[string]Region{} + for _, r := range inst.Regions { + got[r.Sample] = r + } + // A region has the opcodes of the headers above it, its own winning + // (spec); a new starts without the last group's opcodes (choice: + // the spec doesn't say); and default_path is the one set before the + // region. + if r := got["One/a b.wav"]; r.Tune != 7 || r.LowVelocity != 64 || r.Pan != 10 { + t.Errorf("first region %+v", r) + } + if r := got["One/c.wav"]; r.Tune != 5 || r.LowVelocity != 64 { + t.Errorf("second region %+v", r) + } + if r := got["Two/d.wav"]; r.Tune != 0 || r.LowVelocity != 1 || r.HighVelocity != 90 || r.Pan != 10 { + t.Errorf("third region %+v", r) + } + // A clears the group, and a clears everything (choice: + // the spec says a global applies until the next one). + if r := got["Two/e.wav"]; r.HighVelocity != 127 || r.Pan != -20 { + t.Errorf("fourth region %+v", r) + } + if r := got["Two/f.wav"]; r.Pan != 0 || r.Volume != 0 { + t.Errorf("fifth region %+v", r) + } + if inst.Unread[""] != 1 || inst.Unread["type"] != 0 { + t.Errorf("unread %v", inst.Unread) + } + + // Opcodes before any header apply to every region (choice: the spec + // doesn't say). + if r := parseText(t, "volume=-1\n sample=a.wav").Regions[0]; r.Volume != -1 { + t.Errorf("opcode before any header %+v", r) + } + + // A new resets default_path but keeps the other control + // settings (spec, describing ARIA; Cakewalk keeps it). + reset := parseText(t, " default_path=A/ note_offset=12\n\n sample=x.wav key=60") + if r := reset.Regions[0]; r.Sample != "x.wav" || r.LowKey != 72 { + t.Errorf("after a second %+v", r) + } +} + +func TestDefaults(t *testing.T) { + r := parseText(t, " sample=a.wav").Regions[0] + // Spec: lovel 1, hivel 127, pitch_keycenter 60, pitch_keytrack 100, + // amp_veltrack 100, ampeg_release 0.001, ampeg_sustain 100, every other + // envelope stage 0, seq_length and seq_position 1, lorand 0 and hirand 1, + // group 0 and no off_by, and no voice limits. (sfizz starts lovel at 0; velocity 0 is a + // note-off, so it makes no difference.) + want := Region{ + Sample: "a.wav", LowKey: 0, HighKey: 127, RootKey: 60, LowVelocity: 1, HighVelocity: 127, + KeyTrack: 100, VelocityTracking: 100, Envelope: Envelope{Sustain: 100, Release: 0.001}, Trigger: "attack", + SequenceLength: 1, SequencePosition: 1, HighRandom: 1, OffMode: "fast", OffTime: 0.006, + } + if !reflect.DeepEqual(r, want) { + t.Errorf("defaults\n got %+v\nwant %+v", r, want) + } +} + +func TestKeysAndNotes(t *testing.T) { + inst := parseText(t, ` + note_offset=1 octave_offset=-1 + sample=a.wav key=c4 + sample=b.wav lokey=21 hikey=c#2 pitch_keycenter=eb2 + sample=c.wav lokey=-1 hikey=-1 + sample=d.wav pitch_keycenter=sample + sample=*sine + lokey=1 +`) + if len(inst.Regions) != 3 { + t.Fatalf("regions %+v", inst.Regions) + } + // Note names count from c-1, so c4 is 60 (spec), and the control's + // offsets move every key (spec). + if r := inst.Regions[0]; r.LowKey != 49 || r.HighKey != 49 || r.RootKey != 49 { + t.Errorf("key=c4 %+v", r) + } + if r := inst.Regions[1]; r.LowKey != 10 || r.HighKey != 26 || r.RootKey != 28 { + t.Errorf("ranges %+v", r) + } + // A root note that is the sample file's (spec: allowed in v2) is the + // importer's to read, so the region says so, and not the file's note + // before it is read; sfizz keeps the file's root over key, which only sets + // the keys (sfztest). + if r := inst.Regions[2]; !r.RootFromSample || r.Sample != "d.wav" { + t.Errorf("pitch_keycenter=sample %+v", r) + } + if inst.Regions[0].RootFromSample || inst.Regions[1].RootFromSample { + t.Errorf("a root note was taken from the sample: %+v", inst.Regions) + } + if r := parseText(t, " sample=e.wav key=c4 pitch_keycenter=sample").Regions[0]; !r.RootFromSample || r.LowKey != 60 || r.HighKey != 60 { + t.Errorf("key with a root note from the sample %+v", r) + } + want := map[string]int{SkippedNotKeys: 1, SkippedGenerated: 1, SkippedNoSample: 1} + for reason, n := range want { + if inst.Skipped[reason] != n { + t.Errorf("skipped %v", inst.Skipped) + } + } +} + +func TestControllers(t *testing.T) { + inst := parseText(t, ` + set_cc7=127 set_hdcc20=0.25 set_cc64=0 label_cc20=Mic mix + curve_index=9 v000=0 v064=1 v127=1 + sw_default=c0 sw_lokey=c0 sw_hikey=d0 + sample=natural.wav sw_last=c0 amplitude_oncc7=50 volume_oncc20=-8 pan_oncc20=100 pan_curvecc20=1 + sample=retuned.wav sw_last=c#0 + sample=pedal.wav locc64=64 + sample=no-pedal.wav hicc64=63 ampeg_releasecc20=4 ampeg_release_curvecc20=9 + sample=switched.wav on_locc64=127 + sample=first.wav lorand=0 hirand=0.5 + sample=second.wav lorand=0.5 hirand=1 + sample=rr2.wav seq_position=2 seq_length=2 + sample=hold.wav ampeg_hold=8 ampeg_hold_oncc133=-6 key=127 + sample=vel.wav tune_oncc20=50 tune_oncc134=7 +`) + got := map[string]Region{} + for _, r := range inst.Regions { + got[r.Sample] = r + } + // A region that a controller or a keyswitch only sometimes plays is kept, + // with what it needs, and only one that a controller starts is skipped. + if len(got) != 9 || !reflect.DeepEqual(inst.Skipped, map[string]int{SkippedByCC: 1}) { + t.Fatalf("regions %v, skipped %v", got, inst.Skipped) + } + + // Modulation by a controller is kept as it is, to be applied as notes + // play: the setting has only its own value (spec: _onccN adds), with + // pan's curve 1 and the others' straight one, in the settings' own + // units, and the depth of an amplitude as a percentage. + r := got["natural.wav"] + want := []Modulation{ + {Target: TargetAmplitude, Controller: 7, Depth: 50}, + {Target: TargetVolume, Controller: 20, Depth: -8}, + {Target: TargetPan, Controller: 20, Depth: 100, Curve: 1}, + } + if !reflect.DeepEqual(r.Modulations, want) || r.Volume != 0 || r.Pan != 0 { + t.Errorf("natural %+v", r) + } + if !reflect.DeepEqual(r.Keyswitch, &Keyswitch{Last: ptr(12)}) { + t.Errorf("natural's keyswitch %+v", r.Keyswitch) + } + + // A custom curve is kept with its points, and is applied when the note + // plays; the opcodes that aren't among the settings that controllers move + // as notes play are taken at the starting values: a quarter of the way + // is about half of the way to v064, and the release adds to its 0.001 s + // default (spec). + if r := got["no-pedal.wav"]; !near(r.Envelope.Release, 0.001+4*(0.25*127/64)) { + t.Errorf("custom curve %+v", r) + } + // Controller 133 is the note number (spec), taken at the region's root + // note (choice), so the hold shortens towards the top key. + if r := got["hold.wav"]; !near(r.Envelope.Hold, 2) { + t.Errorf("key-dependent hold %+v", r) + } + // A controller above 127 belongs to the note, so a modulation by it is + // taken at once: tune_oncc134 is the gate, 1 while a note is held. + if r := got["vel.wav"]; !near(r.Tune, 7) || len(r.Modulations) != 1 || r.Modulations[0].Controller != 20 { + t.Errorf("a note's controller %+v", r) + } + + // The conditions are kept, and the switch for a keyswitch that none sets. + if r := got["pedal.wav"]; !reflect.DeepEqual(r.Conditions, []Condition{{Source: SourceController, Controller: 64, Low: 64.0 / 127, High: 1}}) { + t.Errorf("pedal %+v", r.Conditions) + } + if r := got["no-pedal.wav"]; len(r.Conditions) != 1 || r.Conditions[0].High >= 64.0/127 || r.Conditions[0].High < 63.0/127 { + t.Errorf("no-pedal %+v", r.Conditions) + } + if got["retuned.wav"].Keyswitch == nil || *got["retuned.wav"].Keyswitch.Last != 13 { + t.Errorf("retuned %+v", got["retuned.wav"].Keyswitch) + } + // Random and round-robin variants are all kept, to be chosen as they play. + for _, name := range []string{"first.wav", "second.wav", "rr2.wav"} { + if _, ok := got[name]; !ok { + t.Errorf("the variant %s isn't kept", name) + } + } + + // The instrument names the controllers it uses, with the starting values + // that set_cc and set_hdcc give. + wantControls := []Control{ + {Controller: 7, Value: 1}, + {Controller: 20, Label: "Mic mix", Value: 0.25}, + {Controller: 64, Value: 0}, + } + if !reflect.DeepEqual(inst.Controls, wantControls) { + t.Errorf("controls %+v, want %+v", inst.Controls, wantControls) + } + if k := inst.Keyswitches; k == nil || k.Low != 12 || k.High != 14 || k.Default == nil || *k.Default != 12 { + t.Errorf("keyswitches %+v", k) + } +} + +func TestVariantsAndChokes(t *testing.T) { + inst := parseText(t, ` + sample=plain.wav + sample=v2.wav polyphony_group=7 off_by=0 + seq_length=3 group=2 off_by=2 + sample=rr1.wav seq_position=1 + sample=rr2.wav seq_position=2 lorand=0.25 hirand=0.75 + sample=zero.wav seq_position=0 seq_length=0 lorand=-1 hirand=2 +`) + got := map[string]Region{} + for _, r := range inst.Regions { + got[r.Sample] = r + } + // A region is in a round robin of 1 at position 1, takes every random + // value, is in group 0 and is stopped by no group (spec). + if r := got["plain.wav"]; r.SequenceLength != 1 || r.SequencePosition != 1 || r.LowRandom != 0 || r.HighRandom != 1 || r.Group != 0 || r.OffBy != nil { + t.Errorf("defaults %+v", r) + } + // The group's settings reach its regions (spec). + if r := got["rr2.wav"]; r.SequenceLength != 3 || r.SequencePosition != 2 || r.LowRandom != 0.25 || r.HighRandom != 0.75 || r.Group != 2 || r.OffBy == nil || *r.OffBy != 2 { + t.Errorf("round robin, random and choke %+v", r) + } + // A length or position below 1 plays as 1 (sfizz), and random values are + // from 0 to 1 (spec). + if r := got["zero.wav"]; r.SequenceLength != 1 || r.SequencePosition != 1 || r.LowRandom != 0 || r.HighRandom != 1 { + t.Errorf("out of range %+v", r) + } + // polyphony_group is v2's name for group (spec), and off_by may name group + // 0 (spec). + if r := got["v2.wav"]; r.Group != 7 || r.OffBy == nil || *r.OffBy != 0 { + t.Errorf("polyphony_group %+v", r) + } + // None of these opcodes is counted as unread. + if len(inst.Unread) != 0 { + t.Errorf("unread %v", inst.Unread) + } +} + +func TestStartingControllers(t *testing.T) { + // Without set_cc, volume starts at 100, pan in the middle and expression + // at full (sfizz); other controllers start at 0 (sfizz). The controllers + // are named with their starting values, and the modulation by them is kept. + inst := parseText(t, ` + sample=a.wav amplitude_oncc7=100 pan_oncc10=100 pan_curvecc10=1 volume_oncc11=-10 volume_oncc1=-10 +`) + r := inst.Regions[0] + if len(r.Modulations) != 4 || r.Volume != 0 || r.Pan != 0 { + t.Errorf("a region %+v", r) + } + want := []Control{{Controller: 1, Value: 0}, {Controller: 7, Value: 100.0 / 127}, {Controller: 10, Value: 0.5}, {Controller: 11, Value: 1}} + if !reflect.DeepEqual(inst.Controls, want) { + t.Errorf("controls %+v, want %+v", inst.Controls, want) + } +} + +func TestControllerConditions(t *testing.T) { + // locc and hicc include both ends, and hiccN includes all of value N + // (sfizz), so a controller at 0.5, which is 63.5 of 127, is within hicc63 + // but not locc64. A region keeps the ranges it needs. + inst := parseText(t, ` + sample=hicc63.wav hicc20=63 + sample=locc64.wav locc20=64 + sample=hd.wav lohdcc20=0.25 hihdcc20=0.75 + sample=top.wav locc21=10 hicc21=127 + sample=other.wav lochan=2 hichan=3 lobend=0 hibend=8192 lochanaft=127 lopolyaft=64 locc200=1 + sample=none.wav +`) + got := map[string][]Condition{} + for _, r := range inst.Regions { + got[r.Sample] = r.Conditions + } + within := func(c Condition, v float64) bool { return v >= c.Low && v <= c.High } + hicc63, locc64 := got["hicc63.wav"][0], got["locc64.wav"][0] + if !within(hicc63, 0.5) || within(locc64, 0.5) || !within(locc64, 64.0/127) || within(hicc63, 64.0/127) { + t.Errorf("hicc63 %+v, locc64 %+v", hicc63, locc64) + } + if hd := got["hd.wav"]; len(hd) != 1 || hd[0].Low != 0.25 || hd[0].High != 0.75 { + t.Errorf("hd %+v", hd) + } + if top := got["top.wav"]; len(top) != 1 || top[0].Low != 10.0/127 || top[0].High != 1 { + t.Errorf("top %+v", top) + } + want := []Condition{ + {Source: SourceChannel, Low: 2, High: 3}, + {Source: SourceBend, Low: 0, High: 1}, + {Source: SourceAftertouch, Low: 1, High: 1}, + {Source: SourcePolyAftertouch, Low: 64.0 / 127, High: 1}, + } + if !reflect.DeepEqual(got["other.wav"], want) { + t.Errorf("channel, bend and aftertouch %+v, want %+v", got["other.wav"], want) + } + if got["none.wav"] != nil { + t.Errorf("a region with none %+v", got["none.wav"]) + } + if len(inst.Unread) != 1 || inst.Unread["locc200"] != 0 { + t.Logf("unread %v", inst.Unread) + } +} + +func TestKeyswitches(t *testing.T) { + // Every region is kept with the keyswitches it needs, and the first + // articulation is the one down at the start unless sw_default says + // otherwise, as an SFZ player has none until a keyswitch is pressed + // (spec, sfizz) and Zampler starts with one (choice). + inst := parseText(t, ` + sample=first.wav sw_last=24 + sample=second.wav sw_last=25 sw_previous=24 + sample=held.wav sw_down=26 sw_up=27 + sample=always.wav +`) + got := map[string]*Keyswitch{} + for _, r := range inst.Regions { + got[r.Sample] = r.Keyswitch + } + if len(inst.Regions) != 4 || len(inst.Skipped) != 0 { + t.Fatalf("regions %v, skipped %v", got, inst.Skipped) + } + if k := got["first.wav"]; k == nil || *k.Last != 24 || k.Previous != nil { + t.Errorf("first %+v", k) + } + if k := got["second.wav"]; k == nil || *k.Last != 25 || *k.Previous != 24 { + t.Errorf("second %+v", k) + } + if k := got["held.wav"]; k == nil || *k.Down != 26 || *k.Up != 27 || k.Last != nil { + t.Errorf("held %+v", k) + } + if got["always.wav"] != nil { + t.Errorf("always %+v", got["always.wav"]) + } + // With no sw_lokey and sw_hikey, the keys are those that regions name. + if k := inst.Keyswitches; k == nil || k.Low != 24 || k.High != 27 || k.Default == nil || *k.Default != 24 { + t.Errorf("keyswitch range %+v", k) + } + if parseText(t, " sample=a.wav").Keyswitches != nil { + t.Error("an instrument with no keyswitches has some") + } + // A seq_position of 0 plays as 1 (sfizz). + if r := parseText(t, " sample=a.wav seq_position=0"); len(r.Regions) != 1 { + t.Errorf("seq_position=0 skipped: %v", r.Skipped) + } +} + +func TestModulationsAndBend(t *testing.T) { + inst := parseText(t, ` + sample=a.wav width=50 width_oncc3=-25 gain_oncc4=3 pitch_oncc5=100 bend_up=1200 bend_down=-100 bend_step=100 + sample=b.wav +`) + a, b := inst.Regions[0], inst.Regions[1] + if a.Width == nil || *a.Width != 50 { + t.Errorf("width %v", a.Width) + } + want := []Modulation{ + {Target: TargetVolume, Controller: 4, Depth: 3}, + {Target: TargetWidth, Controller: 3, Depth: -25}, + {Target: TargetTune, Controller: 5, Depth: 100}, + } + if !reflect.DeepEqual(a.Modulations, want) { + t.Errorf("modulations %+v, want %+v", a.Modulations, want) + } + if a.BendUp == nil || *a.BendUp != 1200 || *a.BendDown != -100 || *a.BendStep != 100 { + t.Errorf("bend %v %v %v", a.BendUp, a.BendDown, a.BendStep) + } + if b.Width != nil || b.BendUp != nil || b.Modulations != nil || b.Conditions != nil { + t.Errorf("a region with none %+v", b) + } + if len(inst.Unread) != 0 { + t.Errorf("unread %v", inst.Unread) + } +} + +func TestOtherOpcodes(t *testing.T) { + inst := parseText(t, ` + sample=a.wav tune=-20 transpose=1 pitch_keytrack=0 offset=100 amp_veltrack=40 group_volume=-3 +trigger=release rt_decay=6 loop_mode=loop_continuous loopstart=10 loop_end=20 ampeg_sustain=150 cutoff=500 +`) + r := inst.Regions[0] + if r.Tune != 80 || r.KeyTrack != 0 || r.Offset != 100 || r.VelocityTracking != 40 || r.Volume != -3 { + t.Errorf("settings %+v", r) + } + if r.Trigger != "release" || r.ReleaseDecay != 6 || r.LoopMode != "loop_continuous" || *r.LoopStart != 10 || *r.LoopEnd != 20 || r.Envelope.Sustain != 100 { + t.Errorf("trigger, loop and envelope %+v", r) + } + // An opcode that isn't read is counted, and the region still plays + // (choice). ampeg_sustain is at most 100 (spec). + if inst.Unread["cutoff"] != 1 || len(inst.Unread) != 1 { + t.Errorf("unread %v", inst.Unread) + } +} + +func TestSplendid(t *testing.T) { + doc, err := ParseFile(os.DirFS(filepath.Join("testdata", "splendid")), "Splendid Grand Piano.sfz") + if err != nil { + t.Fatal(err) + } + inst := doc.Flatten().Instrument() + // Five velocity layers of about 60 regions each, and the string resonance, + // which needs the sustain pedal down, is kept with its conditions. + if len(inst.Regions) != 360 || len(inst.Skipped) != 0 { + t.Errorf("%d regions, skipped %v", len(inst.Regions), inst.Skipped) + } + layers := map[[2]int]int{} + resonance := 0 + for _, r := range inst.Regions { + if len(r.Conditions) > 0 { + resonance++ + continue + } + layers[[2]int{r.LowVelocity, r.HighVelocity}]++ + } + if resonance != 57 { + t.Errorf("%d regions have conditions", resonance) + } + if len(layers) != 5 || layers[[2]int{1, 40}] != 61 || layers[[2]int{101, 127}] == 0 { + t.Errorf("velocity layers %v", layers) + } + + // The lowest region that always plays: its own release plus 0.7 s from the + // Release control at 0.35 × 2 (spec: _onccN adds), and a hold and decay + // shortened by its key. Its level comes from the volume control at 100 + // through curve 4, x² (sfizz), multiplied (sfizz), which is kept to be + // applied as notes play. + var r Region + for _, candidate := range inst.Regions { + if len(candidate.Conditions) == 0 { + r = candidate + break + } + } + if r.Sample != "Samples/PP B-1.flac" || r.LowKey != 21 || r.HighKey != 24 || r.RootKey != 23 { + t.Errorf("first region %+v", r) + } + if !near(r.Envelope.Release, 1.3) || !near(r.Envelope.Hold, 8-6*23.0/127) || !near(r.Envelope.Decay, 80-60*23.0/127) || r.Envelope.Sustain != 0 { + t.Errorf("first region's envelope %+v", r.Envelope) + } + volume := Modulation{Target: TargetAmplitude, Controller: 7, Depth: 100, Curve: 4} + if !slices.ContainsFunc(r.Modulations, func(m Modulation) bool { + return m.Target == volume.Target && m.Controller == 7 && m.Depth == 100 && m.Curve == 4 + }) || r.VelocityTracking != 100 { + t.Errorf("first region's level %+v", r) + } + + // What isn't read is listed: the filter on the softest layer, and the + // pedal settings. + for _, name := range []string{"cutoff", "sustain_cc", "ampeg_dynamic", "ampeg_release_shape"} { + if inst.Unread[name] == 0 { + t.Errorf("%s isn't listed as unread: %v", name, inst.Unread) + } + } + if inst.Unread["cutoff"] != 61 { + t.Errorf("cutoff on %d regions", inst.Unread["cutoff"]) + } +} + +// A region's velocity curve passes through its amp_velcurve_N points, and +// starts at 0 and ends at 1 unless it says otherwise (sfizz). +func TestVelocityCurve(t *testing.T) { + inst := parseText(t, ` sample=a.wav amp_velcurve_127=0.8 amp_velcurve_32=0.1 amp_velcurve_64=0.5 + sample=b.wav amp_velcurve_0=0.2 + sample=c.wav`) + want := []CurvePoint{{0, 0}, {32, 0.1}, {64, 0.5}, {127, 0.8}} + if !reflect.DeepEqual(inst.Regions[0].VelocityCurve, want) { + t.Errorf("curve %v, want %v", inst.Regions[0].VelocityCurve, want) + } + if got := inst.Regions[1].VelocityCurve; !reflect.DeepEqual(got, []CurvePoint{{0, 0.2}, {127, 1}}) { + t.Errorf("curve ends %v", got) + } + if inst.Regions[2].VelocityCurve != nil { + t.Errorf("a region with no points has the curve %v", inst.Regions[2].VelocityCurve) + } + if len(inst.Unread) != 0 { + t.Errorf("unread %v", inst.Unread) + } +} + +// Crossfades are over keys, which note names and the control header's +// offsets move, or velocities, and are power curves unless gain is asked for +// (spec). +func TestCrossfades(t *testing.T) { + inst := parseText(t, ` note_offset=2 + sample=a.wav xfin_lokey=c4 xfin_hikey=64 xfout_lokey=70 xfout_hikey=80 xfin_lovel=10 xfin_hivel=40 xf_velcurve=gain + sample=b.wav xfout_lovel=100 xfout_hivel=127 + sample=c.wav`) + a := inst.Regions[0] + wantKeys := &Crossfade{FadeInLow: 62, FadeInHigh: 66, FadeOutLow: 72, FadeOutHigh: 82, Curve: "power"} + if !reflect.DeepEqual(a.KeyCrossfade, wantKeys) { + t.Errorf("key crossfade %+v, want %+v", a.KeyCrossfade, wantKeys) + } + wantVel := &Crossfade{FadeInLow: 10, FadeInHigh: 40, FadeOutLow: 127, FadeOutHigh: 127, Curve: "gain"} + if !reflect.DeepEqual(a.VelocityCrossfade, wantVel) { + t.Errorf("velocity crossfade %+v, want %+v", a.VelocityCrossfade, wantVel) + } + b := inst.Regions[1] + if b.KeyCrossfade != nil || b.VelocityCrossfade == nil || b.VelocityCrossfade.FadeInHigh != 0 || b.VelocityCrossfade.FadeOutLow != 100 { + t.Errorf("b: %+v, %+v", b.KeyCrossfade, b.VelocityCrossfade) + } + if c := inst.Regions[2]; c.KeyCrossfade != nil || c.VelocityCrossfade != nil { + t.Errorf("c: %+v, %+v", c.KeyCrossfade, c.VelocityCrossfade) + } + if len(inst.Unread) != 0 { + t.Errorf("unread %v", inst.Unread) + } +} + +// polyphony limits the voices of a region's group, note_polyphony those of one +// key, and off_mode and off_time say how a stopped region fades (spec). A +// limit below 1 isn't one, and the mode is fast, taking 6 ms, unless said +// (sfizz). +func TestVoiceLimits(t *testing.T) { + inst := parseText(t, ` polyphony=4 note_polyphony=2 off_mode=normal + sample=a.wav + sample=b.wav off_mode=time off_time=0.25 polyphony=1 + sample=c.wav polyphony=0 note_polyphony=-3 off_mode=bogus off_time=-1 + sample=d.wav`) + a, b, c, d := inst.Regions[0], inst.Regions[1], inst.Regions[2], inst.Regions[3] + if a.Polyphony == nil || *a.Polyphony != 4 || a.NotePolyphony == nil || *a.NotePolyphony != 2 || a.OffMode != "normal" || a.OffTime != 0.006 { + t.Errorf("a %+v", a) + } + if b.Polyphony == nil || *b.Polyphony != 1 || b.OffMode != "time" || b.OffTime != 0.25 { + t.Errorf("b %+v", b) + } + if c.Polyphony != nil || c.NotePolyphony != nil || c.OffMode != "fast" || c.OffTime != 0.006 { + t.Errorf("c %+v", c) + } + if d.Polyphony == nil || *d.Polyphony != 4 { + t.Errorf("d %+v", d) + } + plain := parseText(t, ` sample=a.wav`).Regions[0] + if plain.Polyphony != nil || plain.NotePolyphony != nil || plain.OffMode != "fast" || plain.OffTime != 0.006 { + t.Errorf("a region with none %+v", plain) + } + if len(inst.Unread) != 0 { + t.Errorf("unread %v", inst.Unread) + } +} diff --git a/testdata/splendid/Data/FF.txt b/testdata/splendid/Data/FF.txt new file mode 100644 index 0000000..e6cca54 --- /dev/null +++ b/testdata/splendid/Data/FF.txt @@ -0,0 +1,57 @@ + region_label=01 lokey=021 hikey=024 pitch_keycenter=023 ampeg_release=0.6 sample=FF B-1.$EXT + region_label=02 lokey=025 hikey=027 pitch_keycenter=027 ampeg_release=0.5 sample=FF D#0.$EXT + region_label=03 lokey=028 hikey=030 pitch_keycenter=029 ampeg_release=0.4 sample=FF F0.$EXT + region_label=04 lokey=031 hikey=032 pitch_keycenter=031 ampeg_release=0.3 sample=FF G0.$EXT + region_label=05 lokey=033 hikey=034 pitch_keycenter=033 ampeg_release=0.2 sample=FF A0.$EXT + region_label=06 lokey=035 hikey=035 pitch_keycenter=035 ampeg_release=0.1 sample=FF B0.$EXT + region_label=07 lokey=036 hikey=037 pitch_keycenter=037 sample=FF C#1.$EXT + region_label=08 lokey=038 hikey=039 pitch_keycenter=038 sample=FF D1.$EXT + region_label=09 lokey=040 hikey=040 pitch_keycenter=040 sample=FF E1.$EXT + region_label=10 lokey=041 hikey=041 pitch_keycenter=041 sample=FF F1.$EXT + region_label=11 lokey=042 hikey=044 pitch_keycenter=043 sample=FF G1.$EXT offset=100 + region_label=12 lokey=045 hikey=046 pitch_keycenter=045 sample=FF A1.$EXT + region_label=13 lokey=047 hikey=047 pitch_keycenter=047 sample=FF B1.$EXT + region_label=14 lokey=048 hikey=049 pitch_keycenter=048 sample=FF C2.$EXT + region_label=15 lokey=050 hikey=050 pitch_keycenter=050 sample=FF D2.$EXT + region_label=16 lokey=051 hikey=052 pitch_keycenter=052 sample=FF E2.$EXT + region_label=17 lokey=053 hikey=054 pitch_keycenter=053 sample=FF F2.$EXT + region_label=18 lokey=055 hikey=055 pitch_keycenter=055 sample=FF G2.$EXT + region_label=19 lokey=056 hikey=056 pitch_keycenter=056 sample=FF G#2.$EXT + region_label=20 lokey=057 hikey=057 pitch_keycenter=057 sample=FF A2.$EXT + region_label=21 lokey=058 hikey=058 pitch_keycenter=058 sample=FF A#2.$EXT + region_label=22 lokey=059 hikey=059 pitch_keycenter=059 sample=FF B2.$EXT + region_label=23 lokey=060 hikey=061 pitch_keycenter=060 sample=FF C3.$EXT offset=325 + region_label=24 lokey=062 hikey=063 pitch_keycenter=062 sample=FF D3.$EXT + region_label=25 lokey=064 hikey=064 pitch_keycenter=064 sample=FF E3.$EXT + region_label=26 lokey=065 hikey=066 pitch_keycenter=065 sample=FF F3.$EXT + region_label=27 lokey=067 hikey=068 pitch_keycenter=067 sample=FF G3.$EXT + region_label=28 lokey=069 hikey=069 pitch_keycenter=069 sample=FF A3.$EXT + region_label=29 lokey=070 hikey=071 pitch_keycenter=071 sample=FF B3.$EXT + region_label=30 lokey=072 hikey=073 pitch_keycenter=072 sample=FF C4.$EXT + region_label=31 lokey=074 hikey=075 pitch_keycenter=074 sample=FF D4.$EXT + region_label=32 lokey=076 hikey=076 pitch_keycenter=076 sample=FF E4.$EXT + region_label=33 lokey=077 hikey=078 pitch_keycenter=077 sample=FF F4.$EXT + region_label=34 lokey=079 hikey=079 pitch_keycenter=079 sample=FF G4.$EXT + region_label=35 lokey=080 hikey=080 pitch_keycenter=080 sample=FF G#4.$EXT + region_label=36 lokey=081 hikey=081 pitch_keycenter=081 sample=FF A4.$EXT + region_label=37 lokey=082 hikey=082 pitch_keycenter=082 sample=FF A#4.$EXT + region_label=38 lokey=083 hikey=083 pitch_keycenter=083 sample=FF B4.$EXT + region_label=39 lokey=084 hikey=085 pitch_keycenter=085 ampeg_release=0.2 sample=FF C#5.$EXT + region_label=40 lokey=086 hikey=087 pitch_keycenter=086 ampeg_release=0.4 sample=FF D5.$EXT + region_label=41 lokey=088 hikey=088 pitch_keycenter=088 ampeg_release=0.5 sample=FF E5.$EXT + region_label=42 lokey=089 hikey=090 pitch_keycenter=089 ampeg_release=0.6 sample=FF F5.$EXT + region_label=43 lokey=091 hikey=092 pitch_keycenter=091 ampeg_release=10 sample=FF G5.$EXT + region_label=44 lokey=093 hikey=094 pitch_keycenter=093 ampeg_release=10 sample=FF A5.$EXT + region_label=45 lokey=095 hikey=095 pitch_keycenter=095 ampeg_release=10 sample=Mf B5.$EXT + region_label=46 lokey=096 hikey=097 pitch_keycenter=096 ampeg_release=10 sample=Mf C6.$EXT + region_label=47 lokey=098 hikey=098 pitch_keycenter=097 ampeg_release=10 sample=Mf C#6.$EXT + region_label=48 lokey=099 hikey=099 pitch_keycenter=098 ampeg_release=10 sample=Mf D6.$EXT + region_label=49 lokey=100 hikey=100 pitch_keycenter=099 ampeg_release=10 sample=Mf D#6.$EXT + region_label=50 lokey=101 hikey=101 pitch_keycenter=100 ampeg_release=10 sample=Mf E6.$EXT + region_label=51 lokey=102 hikey=102 pitch_keycenter=102 ampeg_release=10 sample=Mf F#6.$EXT + region_label=52 lokey=103 hikey=103 pitch_keycenter=103 ampeg_release=10 sample=Mf G6.$EXT + region_label=53 lokey=104 hikey=104 pitch_keycenter=104 ampeg_release=10 sample=Mf G#6.$EXT + region_label=54 lokey=105 hikey=105 pitch_keycenter=105 ampeg_release=10 sample=Mf A6.$EXT + region_label=55 lokey=106 hikey=106 pitch_keycenter=106 ampeg_release=10 sample=Mf A#6.$EXT + region_label=56 lokey=107 hikey=107 pitch_keycenter=107 ampeg_release=10 sample=Mf B6.$EXT + region_label=57 lokey=108 hikey=108 pitch_keycenter=108 ampeg_release=10 sample=Mf C7.$EXT diff --git a/testdata/splendid/Data/MF.txt b/testdata/splendid/Data/MF.txt new file mode 100644 index 0000000..25f4c56 --- /dev/null +++ b/testdata/splendid/Data/MF.txt @@ -0,0 +1,62 @@ + region_label=01 lokey=021 hikey=024 pitch_keycenter=023 ampeg_release=0.6 sample=Mf B-1.$EXT + region_label=02 lokey=025 hikey=027 pitch_keycenter=027 ampeg_release=0.5 sample=Mf D#0.$EXT + region_label=03 lokey=028 hikey=030 pitch_keycenter=029 ampeg_release=0.4 sample=Mf F0.$EXT + region_label=04 lokey=031 hikey=032 pitch_keycenter=031 ampeg_release=0.3 sample=Mf G0.$EXT + region_label=05 lokey=033 hikey=034 pitch_keycenter=033 ampeg_release=0.2 sample=Mf A0.$EXT + region_label=06 lokey=035 hikey=035 pitch_keycenter=035 ampeg_release=0.1 sample=Mf B0.$EXT + region_label=07 lokey=036 hikey=037 pitch_keycenter=037 sample=MF C#1.$EXT + region_label=08 lokey=038 hikey=039 pitch_keycenter=038 sample=MF D1.$EXT + region_label=09 lokey=040 hikey=040 pitch_keycenter=040 sample=MF E1.$EXT + region_label=10 lokey=041 hikey=041 pitch_keycenter=041 sample=MF F1.$EXT + region_label=11 lokey=042 hikey=044 pitch_keycenter=043 sample=MF G1.$EXT + region_label=12 lokey=045 hikey=046 pitch_keycenter=045 sample=MF A1.$EXT + region_label=13 lokey=047 hikey=047 pitch_keycenter=047 sample=MF B1.$EXT + region_label=14 lokey=048 hikey=049 pitch_keycenter=048 sample=MF C2.$EXT + region_label=15 lokey=050 hikey=050 pitch_keycenter=050 sample=MF D2.$EXT + region_label=16 lokey=051 hikey=052 pitch_keycenter=052 sample=MF E2.$EXT + region_label=17 lokey=053 hikey=054 pitch_keycenter=053 sample=MF F2.$EXT + region_label=18 lokey=055 hikey=055 pitch_keycenter=055 sample=MF G2.$EXT + region_label=19 lokey=056 hikey=056 pitch_keycenter=056 sample=MF G#2.$EXT + region_label=20 lokey=057 hikey=057 pitch_keycenter=057 sample=MF A2.$EXT + region_label=21 lokey=058 hikey=058 pitch_keycenter=058 sample=MF A#2.$EXT + region_label=22 lokey=059 hikey=059 pitch_keycenter=059 sample=MF B2.$EXT + region_label=23 lokey=060 hikey=061 pitch_keycenter=060 sample=MF C3.$EXT + region_label=24 lokey=062 hikey=063 pitch_keycenter=062 sample=MF D3.$EXT + region_label=25 lokey=064 hikey=064 pitch_keycenter=064 sample=MF E3.$EXT + region_label=26 lokey=065 hikey=066 pitch_keycenter=065 sample=MF F3.$EXT + region_label=27 lokey=067 hikey=068 pitch_keycenter=067 sample=MF G3.$EXT + region_label=28 lokey=069 hikey=069 pitch_keycenter=069 sample=MF A3.$EXT + region_label=29 lokey=070 hikey=071 pitch_keycenter=071 sample=MF B3.$EXT + region_label=30 lokey=072 hikey=073 pitch_keycenter=072 sample=MF C4.$EXT + region_label=31 lokey=074 hikey=075 pitch_keycenter=074 sample=Mf D4.$EXT + region_label=32 lokey=076 hikey=076 pitch_keycenter=076 sample=Mf E4.$EXT + region_label=33 lokey=077 hikey=078 pitch_keycenter=077 sample=Mf F4.$EXT + region_label=34 lokey=079 hikey=079 pitch_keycenter=079 sample=Mf G4.$EXT + region_label=35 lokey=080 hikey=080 pitch_keycenter=080 sample=Mf G#4.$EXT + region_label=36 lokey=081 hikey=081 pitch_keycenter=081 sample=Mf A4.$EXT + region_label=37 lokey=082 hikey=082 pitch_keycenter=082 sample=Mf A#4.$EXT + region_label=38 lokey=083 hikey=083 pitch_keycenter=083 sample=Mf B4.$EXT + region_label=39 lokey=084 hikey=085 pitch_keycenter=085 ampeg_release=0.1 sample=Mf C#5.$EXT + region_label=40 lokey=086 hikey=086 pitch_keycenter=086 ampeg_release=0.2 sample=Mf D5.$EXT + region_label=41 lokey=087 hikey=087 pitch_keycenter=087 ampeg_release=0.3 sample=Mf D#5.$EXT + region_label=42 lokey=088 hikey=088 pitch_keycenter=088 ampeg_release=0.4 sample=Mf E5.$EXT + region_label=43 lokey=089 hikey=089 pitch_keycenter=089 ampeg_release=0.5 sample=Mf F5.$EXT + region_label=44 lokey=090 hikey=090 pitch_keycenter=090 ampeg_release=0.6 sample=Mf F#5.$EXT + region_label=45 lokey=091 hikey=091 pitch_keycenter=091 ampeg_release=10 sample=Mf G5.$EXT + region_label=46 lokey=092 hikey=092 pitch_keycenter=092 ampeg_release=10 sample=Mf G#5.$EXT + region_label=47 lokey=093 hikey=093 pitch_keycenter=093 ampeg_release=10 sample=Mf A5.$EXT + region_label=48 lokey=094 hikey=094 pitch_keycenter=094 ampeg_release=10 sample=Mf A#5.$EXT + region_label=49 lokey=095 hikey=095 pitch_keycenter=095 ampeg_release=10 sample=Mf B5.$EXT + region_label=50 lokey=096 hikey=096 pitch_keycenter=096 ampeg_release=10 sample=Mf C6.$EXT + region_label=51 lokey=097 hikey=097 pitch_keycenter=097 ampeg_release=10 sample=Mf C#6.$EXT + region_label=52 lokey=098 hikey=098 pitch_keycenter=098 ampeg_release=10 sample=Mf D6.$EXT + region_label=53 lokey=099 hikey=099 pitch_keycenter=099 ampeg_release=10 sample=Mf D#6.$EXT + region_label=54 lokey=100 hikey=100 pitch_keycenter=100 ampeg_release=10 sample=Mf E6.$EXT + region_label=55 lokey=101 hikey=101 pitch_keycenter=101 ampeg_release=10 sample=Mf F6.$EXT + region_label=56 lokey=102 hikey=102 pitch_keycenter=102 ampeg_release=10 sample=Mf F#6.$EXT + region_label=57 lokey=103 hikey=103 pitch_keycenter=103 ampeg_release=10 sample=Mf G6.$EXT + region_label=58 lokey=104 hikey=104 pitch_keycenter=104 ampeg_release=10 sample=Mf G#6.$EXT + region_label=59 lokey=105 hikey=105 pitch_keycenter=105 ampeg_release=10 sample=Mf A6.$EXT + region_label=60 lokey=106 hikey=106 pitch_keycenter=106 ampeg_release=10 sample=Mf A#6.$EXT + region_label=61 lokey=107 hikey=107 pitch_keycenter=107 ampeg_release=10 sample=Mf B6.$EXT + region_label=62 lokey=108 hikey=108 pitch_keycenter=108 ampeg_release=10 sample=Mf C7.$EXT diff --git a/testdata/splendid/Data/MP.txt b/testdata/splendid/Data/MP.txt new file mode 100644 index 0000000..12622c0 --- /dev/null +++ b/testdata/splendid/Data/MP.txt @@ -0,0 +1,62 @@ + region_label=01 lokey=021 hikey=024 pitch_keycenter=023 ampeg_release=0.6 sample=Mp B-1.$EXT + region_label=02 lokey=025 hikey=027 pitch_keycenter=027 ampeg_release=0.5 sample=Mp D#0.$EXT + region_label=03 lokey=028 hikey=030 pitch_keycenter=029 ampeg_release=0.4 sample=Mp F0.$EXT + region_label=04 lokey=031 hikey=032 pitch_keycenter=031 ampeg_release=0.3 sample=Mp G0.$EXT + region_label=05 lokey=033 hikey=034 pitch_keycenter=033 ampeg_release=0.2 sample=Mp A0.$EXT + region_label=06 lokey=035 hikey=035 pitch_keycenter=035 ampeg_release=0.1 sample=Mp B0.$EXT + region_label=07 lokey=036 hikey=037 pitch_keycenter=037 sample=Mp C#1.$EXT + region_label=08 lokey=038 hikey=039 pitch_keycenter=038 sample=Mp D1.$EXT + region_label=09 lokey=040 hikey=040 pitch_keycenter=040 sample=Mp E1.$EXT + region_label=10 lokey=041 hikey=041 pitch_keycenter=041 sample=Mp F1.$EXT + region_label=11 lokey=042 hikey=044 pitch_keycenter=043 sample=Mp G1.$EXT + region_label=12 lokey=045 hikey=046 pitch_keycenter=045 sample=Mp A1.$EXT + region_label=13 lokey=047 hikey=047 pitch_keycenter=047 sample=Mp B1.$EXT + region_label=14 lokey=048 hikey=049 pitch_keycenter=048 sample=Mp C2.$EXT + region_label=15 lokey=050 hikey=050 pitch_keycenter=050 sample=Mp D2.$EXT + region_label=16 lokey=051 hikey=052 pitch_keycenter=052 sample=Mp E2.$EXT + region_label=17 lokey=053 hikey=054 pitch_keycenter=053 sample=Mp F2.$EXT + region_label=18 lokey=055 hikey=055 pitch_keycenter=055 sample=Mp G2.$EXT + region_label=19 lokey=056 hikey=056 pitch_keycenter=056 sample=Mp G#2.$EXT + region_label=20 lokey=057 hikey=057 pitch_keycenter=057 sample=Mp A2.$EXT + region_label=21 lokey=058 hikey=058 pitch_keycenter=058 sample=Mp A#2.$EXT + region_label=22 lokey=059 hikey=059 pitch_keycenter=059 sample=Mp B2.$EXT + region_label=23 lokey=060 hikey=061 pitch_keycenter=060 sample=Mp C3.$EXT + region_label=24 lokey=062 hikey=063 pitch_keycenter=062 sample=Mp D3.$EXT offset=11 + region_label=25 lokey=064 hikey=064 pitch_keycenter=064 sample=Mp E3.$EXT + region_label=26 lokey=065 hikey=066 pitch_keycenter=065 sample=Mp F3.$EXT + region_label=27 lokey=067 hikey=068 pitch_keycenter=067 sample=Mp G3.$EXT + region_label=28 lokey=069 hikey=069 pitch_keycenter=069 sample=Mp A3.$EXT + region_label=29 lokey=070 hikey=071 pitch_keycenter=071 sample=Mp B3.$EXT + region_label=30 lokey=072 hikey=073 pitch_keycenter=072 sample=Mp C4.$EXT + region_label=31 lokey=074 hikey=075 pitch_keycenter=074 sample=Mp D4.$EXT + region_label=32 lokey=076 hikey=076 pitch_keycenter=076 sample=Mp E4.$EXT + region_label=33 lokey=077 hikey=078 pitch_keycenter=077 sample=Mp F4.$EXT + region_label=34 lokey=079 hikey=079 pitch_keycenter=079 sample=Mp G4.$EXT + region_label=35 lokey=080 hikey=080 pitch_keycenter=080 sample=Mp G#4.$EXT + region_label=36 lokey=081 hikey=081 pitch_keycenter=081 sample=Mp A4.$EXT + region_label=37 lokey=082 hikey=082 pitch_keycenter=082 sample=Mp A#4.$EXT + region_label=38 lokey=083 hikey=083 pitch_keycenter=083 sample=Mp B4.$EXT + region_label=39 lokey=084 hikey=085 pitch_keycenter=085 ampeg_release=0.1 sample=Mp C#5.$EXT + region_label=40 lokey=086 hikey=086 pitch_keycenter=086 ampeg_release=0.2 sample=Mp D5.$EXT + region_label=41 lokey=087 hikey=087 pitch_keycenter=087 ampeg_release=0.3 sample=Mp D#5.$EXT + region_label=42 lokey=088 hikey=088 pitch_keycenter=088 ampeg_release=0.4 sample=Mp E5.$EXT + region_label=43 lokey=089 hikey=089 pitch_keycenter=089 ampeg_release=0.5 sample=Mp F5.$EXT + region_label=44 lokey=090 hikey=090 pitch_keycenter=090 ampeg_release=0.6 sample=Mp F#5.$EXT + region_label=45 lokey=091 hikey=091 pitch_keycenter=091 ampeg_release=10 sample=Mp G5.$EXT + region_label=46 lokey=092 hikey=092 pitch_keycenter=092 ampeg_release=10 sample=Mp G#5.$EXT + region_label=47 lokey=093 hikey=093 pitch_keycenter=093 ampeg_release=10 sample=Mp A5.$EXT + region_label=48 lokey=094 hikey=094 pitch_keycenter=094 ampeg_release=10 sample=Mp A#5.$EXT + region_label=49 lokey=095 hikey=095 pitch_keycenter=095 ampeg_release=10 sample=Mp B5.$EXT + region_label=50 lokey=096 hikey=096 pitch_keycenter=096 ampeg_release=10 sample=Mp C6.$EXT + region_label=51 lokey=097 hikey=097 pitch_keycenter=097 ampeg_release=10 sample=Mp C#6.$EXT + region_label=52 lokey=098 hikey=098 pitch_keycenter=098 ampeg_release=10 sample=Mp D6.$EXT + region_label=53 lokey=099 hikey=099 pitch_keycenter=099 ampeg_release=10 sample=Mp D#6.$EXT + region_label=54 lokey=100 hikey=100 pitch_keycenter=100 ampeg_release=10 sample=PP E6.$EXT + region_label=55 lokey=101 hikey=101 pitch_keycenter=101 ampeg_release=10 sample=Mp F6.$EXT + region_label=56 lokey=102 hikey=102 pitch_keycenter=102 ampeg_release=10 sample=Mp F#6.$EXT + region_label=57 lokey=103 hikey=103 pitch_keycenter=103 ampeg_release=10 sample=Mp G6.$EXT + region_label=58 lokey=104 hikey=104 pitch_keycenter=104 ampeg_release=10 sample=Mp G#6.$EXT + region_label=59 lokey=105 hikey=105 pitch_keycenter=105 ampeg_release=10 sample=Mp A6.$EXT + region_label=60 lokey=106 hikey=106 pitch_keycenter=106 ampeg_release=10 sample=Mp A#6.$EXT + region_label=61 lokey=107 hikey=107 pitch_keycenter=107 ampeg_release=10 sample=PP B6.$EXT + region_label=62 lokey=108 hikey=108 pitch_keycenter=108 ampeg_release=10 sample=PP C7.$EXT diff --git a/testdata/splendid/Data/PP.txt b/testdata/splendid/Data/PP.txt new file mode 100644 index 0000000..cea7f57 --- /dev/null +++ b/testdata/splendid/Data/PP.txt @@ -0,0 +1,61 @@ + region_label=01 lokey=021 hikey=024 pitch_keycenter=023 ampeg_release=0.6 sample=PP B-1.$EXT + region_label=02 lokey=025 hikey=027 pitch_keycenter=027 ampeg_release=0.5 sample=PP D#0.$EXT + region_label=03 lokey=028 hikey=030 pitch_keycenter=029 ampeg_release=0.4 sample=PP F0.$EXT + region_label=04 lokey=031 hikey=032 pitch_keycenter=031 ampeg_release=0.3 sample=PP G0.$EXT + region_label=05 lokey=033 hikey=034 pitch_keycenter=033 ampeg_release=0.2 sample=PP A0.$EXT + region_label=06 lokey=035 hikey=035 pitch_keycenter=035 ampeg_release=0.1 sample=PP B0.$EXT offset=618 + region_label=07 lokey=036 hikey=037 pitch_keycenter=037 sample=PP C#1.$EXT volume=1 + region_label=08 lokey=038 hikey=039 pitch_keycenter=038 sample=PP D1.$EXT offset=1046 + region_label=09 lokey=040 hikey=040 pitch_keycenter=040 sample=PP E1.$EXT + region_label=10 lokey=041 hikey=041 pitch_keycenter=041 sample=PP F1.$EXT + region_label=11 lokey=042 hikey=044 pitch_keycenter=043 sample=PP G1.$EXT + region_label=12 lokey=045 hikey=046 pitch_keycenter=045 sample=PP A1.$EXT + region_label=13 lokey=047 hikey=047 pitch_keycenter=047 sample=PP B1.$EXT + region_label=14 lokey=048 hikey=049 pitch_keycenter=048 sample=PP C2.$EXT + region_label=15 lokey=050 hikey=050 pitch_keycenter=050 sample=PP D2.$EXT + region_label=16 lokey=051 hikey=052 pitch_keycenter=052 sample=PP E2.$EXT + region_label=17 lokey=053 hikey=054 pitch_keycenter=053 sample=PP F2.$EXT + region_label=18 lokey=055 hikey=055 pitch_keycenter=055 sample=PP G2.$EXT + region_label=19 lokey=056 hikey=056 pitch_keycenter=056 sample=PP G#2.$EXT + region_label=20 lokey=057 hikey=057 pitch_keycenter=057 sample=PP A2.$EXT + region_label=21 lokey=058 hikey=058 pitch_keycenter=058 sample=PP A#2.$EXT + region_label=22 lokey=059 hikey=059 pitch_keycenter=059 sample=PP B2.$EXT + region_label=23 lokey=060 hikey=061 pitch_keycenter=060 sample=PP C3.$EXT + region_label=24 lokey=062 hikey=063 pitch_keycenter=062 sample=PP D3.$EXT + region_label=25 lokey=064 hikey=064 pitch_keycenter=064 sample=PP E3.$EXT + region_label=26 lokey=065 hikey=066 pitch_keycenter=065 sample=PP F3.$EXT + region_label=27 lokey=067 hikey=068 pitch_keycenter=067 sample=PP G3.$EXT + region_label=28 lokey=069 hikey=069 pitch_keycenter=069 sample=PP A3.$EXT + region_label=29 lokey=070 hikey=071 pitch_keycenter=071 sample=PP B3.$EXT + region_label=30 lokey=072 hikey=073 pitch_keycenter=072 sample=PP C4.$EXT + region_label=31 lokey=074 hikey=075 pitch_keycenter=074 sample=PP D4.$EXT + region_label=32 lokey=076 hikey=076 pitch_keycenter=076 sample=PP E4.$EXT + region_label=33 lokey=077 hikey=078 pitch_keycenter=077 sample=PP F4.$EXT + region_label=34 lokey=079 hikey=079 pitch_keycenter=079 sample=PP G4.$EXT + region_label=35 lokey=080 hikey=080 pitch_keycenter=080 sample=PP G#4.$EXT + region_label=36 lokey=081 hikey=081 pitch_keycenter=081 sample=PP A4.$EXT + region_label=37 lokey=082 hikey=082 pitch_keycenter=082 sample=PP A#4.$EXT + region_label=38 lokey=083 hikey=083 pitch_keycenter=083 sample=PP B4.$EXT + region_label=39 lokey=084 hikey=085 pitch_keycenter=085 ampeg_release=0.1 sample=PP C#5.$EXT + region_label=40 lokey=086 hikey=086 pitch_keycenter=086 ampeg_release=0.2 sample=PP D5.$EXT + region_label=41 lokey=087 hikey=087 pitch_keycenter=087 ampeg_release=0.3 sample=PP D#5.$EXT + region_label=42 lokey=088 hikey=089 pitch_keycenter=089 ampeg_release=0.4 sample=PP F5.$EXT + region_label=43 lokey=090 hikey=090 pitch_keycenter=090 ampeg_release=0.6 sample=PP F#5.$EXT pan=-40 + region_label=44 lokey=091 hikey=091 pitch_keycenter=091 ampeg_release=10 sample=PP G5.$EXT pan=-30 offset=135 + region_label=45 lokey=092 hikey=092 pitch_keycenter=092 ampeg_release=10 sample=PP G#5.$EXT pan=-30 + region_label=46 lokey=093 hikey=093 pitch_keycenter=093 ampeg_release=10 sample=PP A5.$EXT pan=-45 + region_label=47 lokey=094 hikey=094 pitch_keycenter=094 ampeg_release=10 sample=PP A#5.$EXT pan=-45 + region_label=48 lokey=095 hikey=095 pitch_keycenter=095 ampeg_release=10 sample=PP B5.$EXT offset=324 + region_label=49 lokey=096 hikey=096 pitch_keycenter=096 ampeg_release=10 sample=PP C6.$EXT offset=57 + region_label=50 lokey=097 hikey=097 pitch_keycenter=097 ampeg_release=10 sample=PP C#6.$EXT offset=265 + region_label=51 lokey=098 hikey=098 pitch_keycenter=098 ampeg_release=10 sample=PP D6.$EXT + region_label=52 lokey=099 hikey=099 pitch_keycenter=099 ampeg_release=10 sample=PP D#6.$EXT + region_label=53 lokey=100 hikey=100 pitch_keycenter=100 ampeg_release=10 sample=PP E6.$EXT + region_label=54 lokey=101 hikey=101 pitch_keycenter=101 ampeg_release=10 sample=PP F6.$EXT + region_label=55 lokey=102 hikey=102 pitch_keycenter=102 ampeg_release=10 sample=PP F#6.$EXT + region_label=56 lokey=103 hikey=103 pitch_keycenter=103 ampeg_release=10 sample=PP G6.$EXT + region_label=57 lokey=104 hikey=104 pitch_keycenter=104 ampeg_release=10 sample=PP G#6.$EXT + region_label=58 lokey=105 hikey=105 pitch_keycenter=105 ampeg_release=10 sample=PP A6.$EXT offset=146 + region_label=59 lokey=106 hikey=106 pitch_keycenter=106 ampeg_release=10 sample=PP A#6.$EXT + region_label=60 lokey=107 hikey=107 pitch_keycenter=107 ampeg_release=10 sample=PP B6.$EXT + region_label=61 lokey=108 hikey=108 pitch_keycenter=108 ampeg_release=10 sample=PP C7.$EXT diff --git a/testdata/splendid/Data/Res.txt b/testdata/splendid/Data/Res.txt new file mode 100644 index 0000000..a7845f1 --- /dev/null +++ b/testdata/splendid/Data/Res.txt @@ -0,0 +1,60 @@ +group_volume=-11 +ampeg_attack=0.1 + + lokey=021 hikey=022 pitch_keycenter=033 sample=PP A0.$EXT + lokey=023 hikey=023 pitch_keycenter=035 sample=PP B0.$EXT offset=618 + lokey=024 hikey=025 pitch_keycenter=037 sample=PP C#1.$EXT + lokey=026 hikey=027 pitch_keycenter=038 sample=PP D1.$EXT offset=1046 + lokey=028 hikey=028 pitch_keycenter=040 sample=PP E1.$EXT + lokey=029 hikey=029 pitch_keycenter=041 sample=PP F1.$EXT + lokey=030 hikey=032 pitch_keycenter=043 sample=PP G1.$EXT + lokey=033 hikey=034 pitch_keycenter=045 sample=PP A1.$EXT + lokey=035 hikey=035 pitch_keycenter=047 sample=PP B1.$EXT + lokey=036 hikey=037 pitch_keycenter=048 sample=PP C2.$EXT + lokey=038 hikey=038 pitch_keycenter=050 sample=PP D2.$EXT + lokey=039 hikey=040 pitch_keycenter=052 sample=PP E2.$EXT + lokey=041 hikey=042 pitch_keycenter=053 sample=PP F2.$EXT + lokey=043 hikey=043 pitch_keycenter=055 sample=PP G2.$EXT + lokey=044 hikey=044 pitch_keycenter=056 sample=PP G#2.$EXT + lokey=045 hikey=045 pitch_keycenter=057 sample=PP A2.$EXT + lokey=046 hikey=046 pitch_keycenter=058 sample=PP A#2.$EXT + lokey=047 hikey=047 pitch_keycenter=059 sample=PP B2.$EXT + lokey=048 hikey=049 pitch_keycenter=060 sample=PP C3.$EXT + lokey=050 hikey=051 pitch_keycenter=062 sample=PP D3.$EXT + lokey=052 hikey=052 pitch_keycenter=064 sample=PP E3.$EXT + lokey=053 hikey=054 pitch_keycenter=065 sample=PP F3.$EXT + lokey=055 hikey=056 pitch_keycenter=067 sample=PP G3.$EXT + lokey=057 hikey=057 pitch_keycenter=069 sample=PP A3.$EXT + lokey=058 hikey=059 pitch_keycenter=071 sample=PP B3.$EXT + lokey=060 hikey=061 pitch_keycenter=072 sample=PP C4.$EXT + lokey=062 hikey=063 pitch_keycenter=074 sample=PP D4.$EXT + lokey=064 hikey=064 pitch_keycenter=076 sample=PP E4.$EXT + lokey=065 hikey=066 pitch_keycenter=077 sample=PP F4.$EXT + lokey=067 hikey=067 pitch_keycenter=079 sample=PP G4.$EXT + lokey=068 hikey=068 pitch_keycenter=080 sample=PP G#4.$EXT + lokey=069 hikey=069 pitch_keycenter=081 sample=PP A4.$EXT + lokey=070 hikey=070 pitch_keycenter=082 sample=PP A#4.$EXT + lokey=071 hikey=071 pitch_keycenter=083 sample=PP B4.$EXT + lokey=072 hikey=073 pitch_keycenter=085 sample=PP C#5.$EXT + lokey=074 hikey=074 pitch_keycenter=086 sample=PP D5.$EXT + lokey=075 hikey=075 pitch_keycenter=087 sample=PP D#5.$EXT + lokey=076 hikey=077 pitch_keycenter=089 sample=PP F5.$EXT + lokey=078 hikey=078 pitch_keycenter=090 sample=PP F#5.$EXT pan=-40 + lokey=079 hikey=079 pitch_keycenter=091 sample=PP G5.$EXT pan=-30 offset=135 + lokey=080 hikey=080 pitch_keycenter=092 sample=PP G#5.$EXT pan=-30 + lokey=081 hikey=081 pitch_keycenter=093 sample=PP A5.$EXT pan=-45 + lokey=082 hikey=082 pitch_keycenter=094 sample=PP A#5.$EXT pan=-45 + lokey=083 hikey=083 pitch_keycenter=095 sample=PP B5.$EXT offset=324 + lokey=084 hikey=084 pitch_keycenter=096 sample=PP C6.$EXT offset=57 tune=-5 + lokey=085 hikey=085 pitch_keycenter=097 sample=PP C#6.$EXT offset=265 tune=-5 + lokey=086 hikey=086 pitch_keycenter=098 sample=PP D6.$EXT tune=-10 + lokey=087 hikey=087 pitch_keycenter=099 sample=PP D#6.$EXT tune=-5 + lokey=088 hikey=088 pitch_keycenter=100 sample=PP E6.$EXT tune=-10 + lokey=089 hikey=089 pitch_keycenter=101 sample=PP F6.$EXT tune=-10 + lokey=090 hikey=090 pitch_keycenter=102 sample=PP F#6.$EXT tune=-20 + lokey=091 hikey=091 pitch_keycenter=103 sample=PP G6.$EXT tune=-20 + lokey=092 hikey=092 pitch_keycenter=104 sample=PP G#6.$EXT tune=-25 + lokey=093 hikey=093 pitch_keycenter=105 sample=PP A6.$EXT offset=146 tune=-20 + lokey=094 hikey=094 pitch_keycenter=106 sample=PP A#6.$EXT tune=-25 + lokey=095 hikey=095 pitch_keycenter=107 sample=PP B6.$EXT tune=-25 + lokey=096 hikey=096 pitch_keycenter=108 sample=PP C7.$EXT tune=-20 \ No newline at end of file diff --git a/testdata/splendid/README.md b/testdata/splendid/README.md new file mode 100644 index 0000000..f1ba65e --- /dev/null +++ b/testdata/splendid/README.md @@ -0,0 +1,9 @@ +# Splendid Grand Piano (SFZ text only) + +These files are the SFZ mapping of the Splendid Grand Piano, used as a test +fixture for the SFZ parser. The samples are not included. + +- Source: [sfzinstruments/SplendidGrandPiano](https://github.com/sfzinstruments/SplendidGrandPiano), + commit `1c595d827b7fd7f0be3134aaed0f90b3662a09cf` (6 May 2024), unchanged. +- Samples: public domain, released by AKAI. +- SFZ mapping: kinwie. String resonance and half-pedalling: Peter Eastman. diff --git a/testdata/splendid/Splendid Grand Piano.sfz b/testdata/splendid/Splendid Grand Piano.sfz new file mode 100644 index 0000000..71b52a9 --- /dev/null +++ b/testdata/splendid/Splendid Grand Piano.sfz @@ -0,0 +1,124 @@ +// -------------------------------------- +// SFZ format v2 with ARIA extensions +// -------------------------------------- +// Splendid Grand Piano +// Public Domain by AKAI +// -------------------------------------- +// converted by kinwie +// string resonance by P.Eastman +// half-pedalling added by P.Eastman +// -------------------------------------- + + +//midi cc +#define $RES 70 +#define $RELEASE 72 +#define $VELTRACK 99 + +//file-folder +#define $EXT flac +#define $DIR Data + + +////////////////////////////////////////////////////////// + +default_path=Samples/ + +label_cc7=Vol +label_cc10=Pan +label_cc64=Sus.Pedal +label_cc$RES=Resonance +label_cc$RELEASE=Release +label_cc$VELTRACK=Veltrack + +set_cc7=100 +set_hdcc10=0.5 +set_hdcc$RES=0.5 +set_hdcc$RELEASE=0.35 +set_hdcc$VELTRACK=1 + + +//******************************************************* + +amplitude_oncc7=100 +amplitude_curvecc7=4 +pan_oncc10=100 +pan_curvecc10=1 +ampeg_attack=0.0005 +ampeg_hold=8 +ampeg_hold_oncc133=-6 +ampeg_decay=80 +ampeg_decay_oncc133=-60 +ampeg_sustain=0 +ampeg_release_oncc$RELEASE=2 +amp_veltrack_oncc$VELTRACK=-100 +amp_veltrack_curvecc$VELTRACK=2 +note_polyphony=1 +off_time=0.5 +// The following are to implement half pedaling. +// Adapted from https://vi-control.net/community/threads/sfz-half-pedaling.116007/#post-4943326 +sustain_cc=90 //re-route default sustain pedal to CC90 +ampeg_dynamic=1 //allow envelope to update on CC64 change +ampeg_release_shape=-6 //set the sustain curve dropoff curvature +ampeg_releasecc64=15 //make maximum release time 15 seconds +ampeg_release_curvecc64=11 //use the curve_index 11 + +// Curve for half pedal +curve_index=11 +v000=0 +v032=0 +v042=.1 +v064=.3 +v072=.4 +v073=1 +v127=1 + +//=================================== + + +group=1 +locc64=65 +locc$RES=1 +amplitude_oncc$RES=200 +#include "$DIR/Res.txt" + + +lovel=1 +hivel=40 +cutoff=1000 +group_volume=0 +#define $DYN PP +group_label=P$DYN +#include "$DIR/$DYN.txt" + + +lovel=41 +hivel=67 +group_volume=0 +#define $DYN PP +group_label=$DYN +#include "$DIR/$DYN.txt" + + +lovel=68 +hivel=84 +group_volume=0 +#define $DYN MP +group_label=$DYN +#include "$DIR/$DYN.txt" + + +lovel=85 +hivel=100 +group_volume=0 +#define $DYN MF +group_label=$DYN +#include "$DIR/$DYN.txt" + + +lovel=101 +hivel=127 +group_volume=0 +#define $DYN FF +group_label=$DYN +#include "$DIR/$DYN.txt" diff --git a/validate.go b/validate.go new file mode 100644 index 0000000..4da36c9 --- /dev/null +++ b/validate.go @@ -0,0 +1,197 @@ +package sfz + +import ( + "fmt" + "slices" + "strings" +) + +// Validate returns the problems in the document, in the order the files are +// read. It reports what is wrong with the text and with values the format +// describes, and never fails on an opcode it doesn't know. +func (d *Document) Validate() []Problem { + v := &validator{defines: map[string]string{}} + v.problems = append(v.problems, d.problems...) + v.file(d.Root) + v.endHeader() + return v.problems +} + +// opcodeAt is an opcode read in a header. +type opcodeAt struct { + value float64 + at *Node + file string +} + +type validator struct { + defines map[string]string + problems []Problem + // inHeader is whether a header has been read. + inHeader bool + // numbers are the numeric values of the opcodes of the header being read, + // by name. + numbers map[string]opcodeAt +} + +func (v *validator) add(file string, n *Node, sev Severity, code, msg string) { + v.problems = append(v.problems, Problem{File: file, Line: n.Line, Col: n.Col, Severity: sev, Code: code, Msg: msg}) +} + +func (v *validator) file(f *File) { + for _, n := range f.Nodes { + switch n.Kind { + case KindDefine: + v.undefined(f, n, n.Value) + v.defines[n.Name] = strings.TrimSpace(substitute(v.defines, n.Value)) + case KindInclude: + v.undefined(f, n, n.Value) + if n.File != nil { + v.file(n.File) + } + case KindHeader: + v.header(f, n, n.Name) + case KindOpcode, KindText: + v.undefined(f, n, n.Raw) + text := n.Raw + if strings.Contains(text, "$") { + // A variable's value can hold opcodes and headers, so the + // text it makes is read again. + text = substitute(v.defines, text) + } + v.read(f, n, text) + } + } +} + +// read checks the headers and opcodes that text holds, which stands where n +// does. +func (v *validator) read(f *File, n *Node, text string) { + for _, m := range lex(text) { + switch m.Kind { + case KindHeader: + v.header(f, n, m.Name) + case KindOpcode: + v.opcode(f, n, m.Name, m.Value) + case KindText: + if strings.Contains(m.Raw, "$") { + continue + } + v.add(f.Path, n, SeverityWarning, "text.unreadable", fmt.Sprintf("can't read %q", strings.TrimSpace(m.Raw))) + } + } +} + +func (v *validator) header(f *File, n *Node, name string) { + v.endHeader() + v.inHeader = true + v.numbers = map[string]opcodeAt{} + if _, ok := LookupHeader(name); !ok { + v.add(f.Path, n, SeverityInfo, "header.unknown", fmt.Sprintf("<%s> isn't a header of the format", name)) + } +} + +// endHeader checks the ranges of the header that has just ended: a lo opcode +// above its hi opcode. +func (v *validator) endHeader() { + names := make([]string, 0, len(v.numbers)) + for name := range v.numbers { + names = append(names, name) + } + slices.Sort(names) + for _, name := range names { + rest, ok := strings.CutPrefix(name, "lo") + if !ok { + continue + } + hi, ok := v.numbers["hi"+rest] + if lo := v.numbers[name]; ok && lo.value > hi.value { + v.add(lo.file, lo.at, SeverityWarning, "range.inverted", fmt.Sprintf("%s is above hi%s", name, rest)) + } + } + v.numbers = nil +} + +func (v *validator) opcode(f *File, n *Node, name, value string) { + if !v.inHeader { + v.add(f.Path, n, SeverityInfo, "opcode.no-header", fmt.Sprintf("%s is before any header", name)) + v.inHeader = true + v.numbers = map[string]opcodeAt{} + } + if strings.Contains(name, "$") { + return + } + info, ok := Lookup(name) + if !ok { + v.add(f.Path, n, SeverityInfo, "opcode.unknown", fmt.Sprintf("%s isn't an opcode of the format", name)) + return + } + if info.Deprecated { + v.add(f.Path, n, SeverityInfo, "opcode.deprecated", fmt.Sprintf("%s is deprecated", name)) + } + if strings.Contains(value, "$") { + return + } + v.value(f, n, name, value, info) +} + +// value checks a value against what the format says about its opcode. +func (v *validator) value(f *File, n *Node, name, value string, info OpcodeInfo) { + switch info.Type { + case TypeInteger, TypeFloat: + var x float64 + var ok bool + if info.Note { + var note int + note, ok = parseNote(value) + x = float64(note) + if strings.EqualFold(value, "sample") && name == "pitch_keycenter" { + return + } + } else { + x, ok = parseNumber(value) + } + if !ok { + v.add(f.Path, n, SeverityWarning, "value.type", fmt.Sprintf("%s=%s isn't a number", name, value)) + return + } + if info.Type == TypeInteger && !info.Note && x != float64(int64(x)) { + v.add(f.Path, n, SeverityInfo, "value.type", fmt.Sprintf("%s=%s isn't a whole number", name, value)) + } + if info.Min != nil && x < *info.Min || info.Max != nil && x > *info.Max { + v.add(f.Path, n, SeverityWarning, "value.range", fmt.Sprintf("%s=%s is outside %s", name, value, bounds(info))) + } + v.numbers[name] = opcodeAt{value: x, at: n, file: f.Path} + case TypeString: + if len(info.Options) == 0 { + return + } + for _, o := range info.Options { + if strings.EqualFold(o, strings.TrimSpace(value)) { + return + } + } + v.add(f.Path, n, SeverityWarning, "value.option", fmt.Sprintf("%s=%s isn't one of %s", name, value, strings.Join(info.Options, ", "))) + } +} + +// bounds describes the range an opcode's value may take. +func bounds(info OpcodeInfo) string { + lo, hi := "-∞", "∞" + if info.Min != nil { + lo = fmt.Sprint(*info.Min) + } + if info.Max != nil { + hi = fmt.Sprint(*info.Max) + } + return lo + " to " + hi +} + +// undefined reports the variables in text that haven't been defined. +func (v *validator) undefined(f *File, n *Node, text string) { + for _, run := range variableRE.FindAllString(text, -1) { + if substitute(v.defines, run) == run { + v.add(f.Path, n, SeverityWarning, "define.undefined", fmt.Sprintf("%s isn't defined", run)) + } + } +} diff --git a/values.go b/values.go new file mode 100644 index 0000000..e292544 --- /dev/null +++ b/values.go @@ -0,0 +1,115 @@ +package sfz + +import ( + "math" + "regexp" + "sort" + "strconv" + "strings" +) + +// noteRE reads a note name such as c4, C#0 or eb-1. Middle C is c4, MIDI +// note 60. +var noteRE = regexp.MustCompile(`^([A-Ga-g])([#b]?)(-?[0-9]+)$`) + +// semitones are the notes' places in the octave from C. +var semitones = map[byte]int{'c': 0, 'd': 2, 'e': 4, 'f': 5, 'g': 7, 'a': 9, 'b': 11} + +// parseNote reads a MIDI note number or a note name. It reports false if the +// value is neither. +func parseNote(v string) (int, bool) { + v = strings.TrimSpace(v) + if n, err := strconv.Atoi(v); err == nil { + return n, true + } + m := noteRE.FindStringSubmatch(v) + if m == nil { + return 0, false + } + octave, _ := strconv.Atoi(m[3]) + n := (octave+1)*12 + semitones[strings.ToLower(m[1])[0]] + switch m[2] { + case "#": + n++ + case "b": + n-- + } + return n, true +} + +// parseNumber reads a number, and reports false if the value isn't one. +func parseNumber(v string) (float64, bool) { + f, err := strconv.ParseFloat(strings.TrimSpace(v), 64) + if err != nil || math.IsNaN(f) || math.IsInf(f, 0) { + return 0, false + } + return f, true +} + +// curve maps a controller's value, from 0 to 1, to how much of a +// modulation's depth applies. +type curve func(x float64) float64 + +// builtinCurves are the curves SFZ players define, by index. +var builtinCurves = map[int]curve{ + 0: func(x float64) float64 { return x }, + 1: func(x float64) float64 { return 2*x - 1 }, + 2: func(x float64) float64 { return 1 - x }, + 3: func(x float64) float64 { return 1 - 2*x }, + 4: func(x float64) float64 { return x * x }, + 5: func(x float64) float64 { return math.Sqrt(x) }, + 6: func(x float64) float64 { return math.Sqrt(1 - x) }, +} + +// pointRE reads a point, such as v064, whose number is the +// controller value from 0 to 127. +var pointRE = regexp.MustCompile(`^v([0-9]{1,3})$`) + +// readCurves returns the instrument's curves: the built-in ones, and those of +// its headers, which pass through their points in straight lines, and +// the points of the custom ones. +// A curve that doesn't set v000 or v127 starts at 0 or ends at 1. +func readCurves(defs []Opcodes) (map[int]curve, map[int][]CurveStop) { + curves := make(map[int]curve, len(builtinCurves)+len(defs)) + stops := map[int][]CurveStop{} + for i, c := range builtinCurves { + curves[i] = c + } + for _, def := range defs { + index, err := strconv.Atoi(def["curve_index"]) + if err != nil { + continue + } + points := map[int]float64{0: 0, 127: 1} + for name, v := range def { + m := pointRE.FindStringSubmatch(name) + if m == nil { + continue + } + at, _ := strconv.Atoi(m[1]) + if y, ok := parseNumber(v); ok && at <= 127 { + points[at] = y + } + } + xs := make([]int, 0, len(points)) + for x := range points { + xs = append(xs, x) + } + sort.Ints(xs) + for _, x := range xs { + stops[index] = append(stops[index], CurveStop{At: x, Value: points[x]}) + } + curves[index] = func(x float64) float64 { + at := x * 127 + for i := 1; i < len(xs); i++ { + if at <= float64(xs[i]) { + x0, x1 := float64(xs[i-1]), float64(xs[i]) + y0, y1 := points[xs[i-1]], points[xs[i]] + return y0 + (y1-y0)*(at-x0)/(x1-x0) + } + } + return points[xs[len(xs)-1]] + } + } + return curves, stops +}