file = { soi ~ (attribute ~ "\n")* ~ "%%\n" ~ (syllable | "\n")* ~ "\n"* ~ eoi }
attribute = { attribute_key ~ ":" ~ attribute_value ~ ";"}
attribute_key = { (!(":"|";") ~ any)* }
attribute_value = { (!(":"|";") ~ any)* }
clef = { ("c" | "f") ~ ('1'..'4') }
barline = { ( ";" ~ ('1'..'6') | ";" | "::" | ":?" | ":'" | ":" | ",_" | ",0" | "," | "'" | "`" ) }
spacer = { ( "!" | "@" | "/" | "//" | "/0" | "/[" ~ "-"? ~ ('0'..'9') ~ "]" | " " ) }
note = { prefix* ~ position ~ suffix* }
prefix = { "-" }
position = { ('a'..'m') | ('A'..'M') }
suffix = { ("~" | ">" | "<" | "v" | "V" | "o~" | "o<" | "o" | "w" | "s<" | "s" | "x" | "y" | "#" | ".." | "." | "'" | "_" ) }
syllable = { string ~ "(" ~ (clef | note | barline | spacer)* ~ ")" }
string = { (!("(") ~ any)* }