; This file documents the custom formal grammar used for the sheet. ; ; This grammar is subject to changes in the future, by the way. ; The sheet consists of a sequence of blocks, or if there is only one ; block, a sequence of groups. sheet = 1*block / 1* group ; A block consists of a sequence of groups enclosed in curly braces. block = "{" 1*group "}" ; A group either has several units enclosed in patentheses or one unit ; alone. group = "(" 1*unit ")" cram-repetition / unit ; A unit is either an instruction or a note. unit = instruction / note ; An instruction is either a volume changing one, a bpm changing one, ; or an instrument changing one. instruction = "i" ( volume / bpm / instrument ) ; A volume changing instruction follows "v" volume = "v" 1*DIGIT *1("." 1*DIGIT) ; A bpm changing instruction is similar to a volume changing ; instruction. bpm = "b" 1*DIGIT ; An instrument changing instruction follows "i" instrument = "i" ( "piano" / "violin" ) ; A note has three parts: octave, tone, and duration. note = *1octave tone *1duration octave = "o" 1*DIGIT tone = ( "a" / "b" / "c" / "d" "e" / "f" / "g" ) *tone-shift ; Shifts the tone by some number of semitones tone-shift = "+" / "-" ; A duration is either in the standard sheet notation or a precise ; duration. ; ; There are no overlaps between the two variants. duration = 1*DIGIT *"." / "p" 1*DIGIT *1("." 1* DIGIT) cram-repetition = *1cram *1repetition cram = duration repetition = "*" 1*DIGIT