staff icon indicating copy to clipboard operation
staff copied to clipboard

Added church modes and note constants

Open vortexofdoom opened this issue 1 year ago • 0 comments

Just added the rest of the diatonic scale modes, as well as constructors for scales. Also added associated constants for all the natural notes like Note::C because I think the ergonomics of always typing Note::from(Natural::C) leave something to be desired. I changed many of the functions to be const since I needed at least new() to be const to make the constants, and for the rest there wasn't much reason not to. From can't be const at the moment unfortunately, but I figured this was a fine start.

After implementing the constants, I also had the idea of making functions flatten() and sharpen() that take a &self and then return a changed version like so: Note::C.sharpen(). This could even work for notes that already have accidentals. My original thought was to change flat() and sharp() but that would both be a breaking change and not entirely clear what would happen when used multiple times. I thought that was a bit out of the scope of a pretty routine PR, but I'd be happy to implement those as well.

vortexofdoom avatar Feb 18 '24 18:02 vortexofdoom