pinobatch / pently

Scalable music engine for NES games
zlib License
72 stars 4 forks source link

Add bar checks to patterns #26

Closed pinobatch closed 6 years ago

pinobatch commented 6 years ago

LilyPond has a rhythm error detection feature called bar check. Its | command emits a diagnostic if the musical time so far is not a multiple of one measure as defined in a song's time signature.

Like a song (see pickup command), a pattern in Pently may have a pickup, or part that starts unaligned with a bar line. Thus a pattern's first bar check would establish the amount of pickup instead of emitting a diagnostic.

Because a pattern can be defined outside a song, test cases will need to verify that setting a time signature outside a song works:

pinobatch commented 6 years ago

I decided against the "pattern's first bar check sets pickup" rule, instead overloading the pickup keyword to apply to an open pattern.