Appendix
Compact index of top-level statements, lexical rules, and reserved words as implemented by the Peggy grammar in @beatbax/engine.
Statement index
| Statement | Doc |
|---|---|
chip | Global directives |
bpm | Global directives |
volume | Global directives |
stepsPerBar | Global directives |
scale | Global directives |
song | Global directives |
play | Global directives |
time | Deprecated — aliases stepsPerBar; prefer stepsPerBar |
ticksPerStep | Deprecated — parsed, warns, no effect |
import | Imports |
inst | Instruments |
subpat | Instrument macros |
effect | Effects |
pat / shorthand name = … | Patterns |
seq | Sequences |
channel | Channels |
export | Deprecated — prefer CLI / Desktop / web; see Export |
Not in the current grammar (do not use): alias, section, form, include, cat.
Lexical notes
| Kind | Form |
|---|---|
| Identifiers | [A-Za-z_][A-Za-z0-9_\-]* |
| Strings | "…", '…', or """…""" (multiline) |
| Comments | # … or // … to end of line |
| Integers / floats | Decimal digits; floats allow a fractional part |
Reserved words
These cannot start a pattern-shorthand statement (name = … without pat):
chip, bpm, scale, time, stepsPerBar, ticksPerStep, song, inst, subpat, pat, seq, channel, effect, play, export
(volume and import are statement keywords but are not in the shorthand reserved list — prefer explicit pat when in doubt.)
Comments
Line comments with # or // are allowed anywhere whitespace is. Avoid # inside unquoted values such as note= — see Instrument note mapping.