staff-rs / staff

Music theory and score rendering library with midi, notes, chords, scales, and more.
https://staff-rs.github.io
MIT License
258 stars 11 forks source link

Replace Accidental enum with trait #4

Closed matthunz closed 2 years ago

matthunz commented 2 years ago

Currently scales starting at a root Note with a sharp or flat will use that notation but naturals will use whatever's easier. For example it's impossible to specify using sharps with a G major scale

I'm thinking a Flat and Sharp struct with a common Accidental trait could make this type safe but we'd lose easy FromStr implementations