python-mingus
python-mingus copied to clipboard
Errors when trying to identify a 11th or 13th chord
Mingus version 0.6.1 To reproduce:
from mingus.containers.note_container import NoteContainer
chord9 = NoteContainer()
for note in ["C", "E", "G", "B", "D-5"]:
chord9.add_note(note)
print(chord9.determine()) # Succeeds
chord11 = NoteContainer()
try:
for note in ["C", "E", "G", "B", "D-5", "F-5"]:
chord11.add_note(note)
print(chord11.determine()) # Fails: KeyError: "M11"
except Exception as e:
print(f"Exception: {type(e)}: {e}")
try:
chord13 = NoteContainer()
for note in ["C", "E", "G", "B", "D-5", "F-5", "A-5"]:
chord13.add_note(note)
print(chord13.determine()) # Fails: TypeError: can only concatenate str (not "NoneType") to str
except Exception as e:
print(f"Exception: {type(e)}: {e}")
9, 11, and 13 chords have a b7, not a natural 7.
And, when playing the 13 chord you usually don't want to add that 11th because of the dissonance with the 3rd. So it shouldn't have the 11th if we were talking about C13 for example.
On the other side, on the 11 chord, the 3rd is usually ommited, but not necessarily.
So:
C9: C, E, G, bB, D
C11: C, (E), G, bB, D, F
C13: C, E, G; bB, D, A
If you keep the B natural, we're talking about Cmaj9, not C9
Not sure what your point is, regardless of how you want to categorize chords, the bug is that mingus should not blow up just by asking what chord it is.