yuma-m / pychord

Python library to handle musical chords.

Home Page:https://pypi.python.org/pypi/pychord

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Edge case bug in Chord.components()

hindman opened this issue · comments

An example:

In [12]: Chord('Abm').components()
Out[12]: ['Ab', 'B', 'Eb']          # Should be ['Ab', 'Cb', 'Eb']

I might be mistaken (not an expert in music theory), but I believe Cb is more correct, from a strict perspective.

Chord construction starts with note names: an A triad of any flavor must contain some flavor of A, C, and E. From there, you apply the sharps, flats, double-flats, or double-sharps as needed to achieve the desired chord root and quality. So, in our example, we start with an A triad (A, C, E), flatten everything because we want root of Ab (Ab, Cb, Eb). Since the
A-to-C distance is already minor, we're done.

Another example:

In [13]: Chord('Cbm').components()
Out[13]: ['B', 'D', 'Gb']          # Should be ['Cb', 'Ebb', 'Gb']

Start with C, E, G. Flatten everything to Cb, Eb, Gb. The C-to-E distance is major, so double-flatten it to get Cb, Ebb, Gb.

Thanks for taking a look and working on this project.

Hi @hindman,

Thank you for your feedback. Yes, I think your comment is correct and pychord doesn't support double flat or double sharp currently. I can't fix this right now but let me tag this as an enhancement.

I don't think that's the correct construction. A minor chord has root, minor third, and perfect fifth. Ab minor has a root Ab, a minor third Cb, and a P5 in Eb for Ab Cb Eb. Here's confirmation of Abm: https://pianochord.com/ab-minor

Cbb would be a correct notation for a diminished third in Ab (because we already have a Bb and the convention is to avoid two of the same letters in notation). I am also not an expert in music theory, but I think the only chord with a diminished third -- baring arbitrary triads -- would be an Italian augmented sixth (when in first inversion). See this discussion on Stack Exchange Music: https://music.stackexchange.com/questions/31189/what-is-a-chord-with-a-diminished-third-called

@philipmat You are correct. I fixed my comment and added a better double-flat example.