pub enum SourceLine {
Show 18 variants
Bpm(u32),
Sig(u8, u8),
Phrase(u32),
Scale(PitchRoot, ScaleMode),
Load(String),
Arrange(Vec<ArrangeItem>),
Tail(f64),
Seed(u64),
Meta(String, String),
Include(String),
Def(Box<InstrumentDef>),
Pattern(PatternDef),
GroupStart {
muted: bool,
name: String,
},
GroupEnd(Vec<Transform>),
SectionStart {
muted: bool,
name: String,
cycles: u32,
},
SectionEnd,
Comment(String),
Blank,
}Expand description
A single parsed line from the source.
Variants§
Bpm(u32)
bpm <integer>
Sig(u8, u8)
sig <num>/<den>
Phrase(u32)
phrase <cycles> — how many cycles a musical phrase spans.
Scale(PitchRoot, ScaleMode)
scale <root> <mode>
Load(String)
load "<path>"
Arrange(Vec<ArrangeItem>)
arrange <name> [<name> …] — the order the sections play in (§8.4).
Tail(f64)
tail <seconds> — how long a render rings out past the last cycle (§8.7).
Seed(u64)
seed <integer> — salts the generative constructs (§8.8).
Meta(String, String)
meta <key> "<value>" — a free-form tag travelling with the piece (§8.10).
Include(String)
include <instrument> — explicitly make a registry instrument available.
Def(Box<InstrumentDef>)
A def <name> { … } instrument definition (§6).
Boxed because a definition is several times the size of any other line,
and every SourceLine would otherwise pay for it.
Pattern(PatternDef)
A pattern line (possibly muted).
GroupStart
[;] group <name> { — opens an instrument group (§7). The member
pattern lines stay ordinary SourceLine::Patterns so line-based
editing keeps working; parse_program
tags each member’s PatternDef::group.
GroupEnd(Vec<Transform>)
} closing a group, optionally with | transform shared filters.
SectionStart
[;] section <name> <cycles> { — opens a section (§8.2). Like a group,
the members stay ordinary SourceLines so line-based editing keeps
working; parse_program tags each
member’s PatternDef::section.
SectionEnd
} closing a section. Unlike a group’s, it takes no pipeline — a
section is a span of time, not a bus.
Comment(String)
A comment (kept for round-tripping, not evaluated).
Blank
An empty/blank line.