slurmulon / bach

:musical_score: Semantic music notation
http://codebach.tech
MIT License
8 stars 0 forks source link

[Bug] Time signature values are being reduced #6

Closed slurmulon closed 6 years ago

slurmulon commented 6 years ago

For instance, 6/8 will be reduced to 3/4 (undesired).

This stems from Clojure's core logic around ratios. It will always to reduce them to their simplest form.

If you do (numerator 6/8) the result will be 3 because it reduces 6/8 to 3/4 before returning the function.

To fix this, the use of ratios should be removed entirely (if possible) and replaced with a fixed-sized vector (i.e. 6/8 should instead become [6 8]).

slurmulon commented 6 years ago

Resolved by introducing the :meter grammar construct.

Avoided the need to remove the use of ratios.

https://github.com/slurmulon/warble/commit/bd9f42f7de2c586b30171ed20fb07a0af8e9bc6e