Skip to main content

Appendix

Compact index of top-level statements, lexical rules, and reserved words as implemented by the Peggy grammar in @beatbax/engine.

Statement index​

StatementDoc
chipGlobal directives
bpmGlobal directives
volumeGlobal directives
stepsPerBarGlobal directives
scaleGlobal directives
songGlobal directives
playGlobal directives
timeDeprecated — aliases stepsPerBar; prefer stepsPerBar
ticksPerStepDeprecated — parsed, warns, no effect
importImports
instInstruments
subpatInstrument macros
effectEffects
pat / shorthand name = …Patterns
seqSequences
channelChannels
exportDeprecated — prefer CLI / Desktop / web; see Export

Not in the current grammar (do not use): alias, section, form, include, cat.

Lexical notes​

KindForm
Identifiers[A-Za-z_][A-Za-z0-9_\-]*
Strings"…", '…', or """…""" (multiline)
Comments# … or // … to end of line
Integers / floatsDecimal 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.

See also​