zzril / aula

Audio programming language and interpreter
MIT License
0 stars 0 forks source link

Add language support for notes of different length #10

Closed zzril closed 1 day ago

zzril commented 3 days ago

Similar to #9 , we want to change the language to allow specifying a length (as currently, only quarter notes are possible).

Sticking to powers of 2 is good for now, but eventually we also want to allow for dotted notes of course.

zzril commented 2 days ago

Blocked by #13

zzril commented 2 days ago

I currently have something like this in mind:

<non-empty-piece> ::= <track-end> <bar> <piece>
<bar>             ::= <note> <bar> | ""
<piece>           ::= <barline> <bar> <piece> | <track-end>
<note>            ::= <pitch> <semitone> <length-modifier> | <pause> <length-modifier>
<length-modifier> ::= <length-raise> <dot> | <length-lower> <dot>
<length-raise>    ::= <circle> <length-raise> | ""
<length-lower>    ::= <flag> <length-lower> | ""

<track-end>       ::= "|"
<barline>         ::= "|"
<pitch>           ::= "C" | "D" | "E" | "F" | "G" | "A" | "B"
<semitone>        ::= "#" | "b" | ""
<pause>           ::= "-"
<dot>             ::= "." | ""
<circle           ::= "o"
<flag>            ::= "^"

Example

|| D A B F# | G D G A ||