Skip to content

v0.58.1: Spelling that survives octaves and numerals

Choose a tag to compare

@kennethreitz kennethreitz released this 09 Nov 09:36
· 3 commits to master since this release

What's fixed

  • Octave shifts keep the written note. Eb4 + 12 is Eb5, and Db4 + 0 stays Db4. Inverting Eb major is still Eb major, not D# major. Drop voicings and transpose(0) keep the flats too.
  • Roman numerals spell by letter. Key("C#").progression("I") is C# E# G#. In F major, ii is G Bb D, not G A# D. V/IV in Bb is Bb7.
  • analyze() round-trips. Cmaj7 in C is Imaj7, not I7 (that one builds a dominant seventh). Half-diminished chords are iiø7. Ninths are V9 and Imaj9. F# major in C is #IV; Gb major is bV.
  • Key signatures count every sharp. D# major is 9 sharps, including F## and C##. Key.all_keys() uses the ordinary names: Bb major and Eb minor, not A# and D#.
  • Enharmonics go both ways. Tone("Db4").enharmonic is C#, and E# is F. A flat MIDI note keeps the sharp spelling as an alias, and the two compare equal.
  • Helmholtz matches the staff. Middle C is c', the one-line octave. C3 is c, C2 is C, C1 is CC.
  • Solfege follows the pitch. E# is Fa, with F. B#, Fb, Cb, and double accidentals use the syllable of the note they sound.
  • C6/9 is a sixth-ninth chord. The 9 is not a bass note. sus, -, -7, °, and Δ7 parse as the qualities musicians write.

Heptatonic Scale.transpose re-spells one letter per degree and prefers the key with fewer accidentals, so C major up a semitone is Db major.

Integer steps that are not whole octaves stay chromatic: C4 + 3 is still D#4.

Full Changelog: v0.58.0...v0.58.1