yuma-m / pychord

Python library to handle musical chords.
https://pypi.python.org/pypi/pychord
MIT License
248 stars 46 forks source link

Support multiple variation of a chord #58

Closed yuma-m closed 3 years ago

yuma-m commented 3 years ago

As discussed in #54, some notes of a chord can be omitted as customary.

>>> note_to_chord(["C", "E", "G", "Bb", "D", "F"])
[<Chord: C11>]

# omit thrid
>>> note_to_chord(["C", "G", "Bb", "D", "F"])
[<Chord: C11>]

However, a quality can have only one combination of notes in the current implementation. It should support multiple combinations or omittable notes.

'11', [(0, 4, 7, 10, 14, 17), (0, 7, 10, 14, 17)]),

'11', Quality((0, 4, 7, 10, 14, 17), omittable=[4])),
koto-wheel commented 3 years ago

Theoricallly you cannot say aht 0, 7, 10, 14, 17 is a 11th chord since it depend on what scale you are playing. If in your scale 3rd is minor 0, 7, 10, 14, 17 is in fact a m11 chord.

You can also choose to omit the 5th degree if it is neither diminished nor augmented. Omit some notes is just a choice of the player or the composer. Anyway, on a 11th chord you must play the 11th degree.

I would like to implement some classes related to all these aspect of the music theory in pychord. We can discuss on these subject while implementing these aspect if you are ok with that.

koto-wheel commented 3 years ago

Anyway there is another problem to know in which scale you are playing. Let's say that by default, you are playing in the same scale that the time before the current time. If you want to change the scale or tone you must play the notes or one note which do not belong to the previous tone (or scale). But there is no mandatory rule, the composer or general the musician is free to do everything he wants. It may be very clever or interesting not use play immediately these notes (which do not belong to the previous scale) in order to make the transition more seamless/natural

koto-wheel commented 3 years ago

Omittable notes

So I'm not sure it's really possible to implement something consistent about omittable notes

koto-wheel commented 3 years ago

Your example:

koto-wheel commented 3 years ago

If you plan to be able to change QUALITY_DICT and/or other constants structure later, it is wise to implement them as a class as soon as possible in order to make future changes as seamless as possible

yuma-m commented 3 years ago

@koto-wheel I'm very sorry to take a long time to respond to this issue. I created pull-request #59 to provide a way to modify the default quality components.