Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quality aliases #34

Closed
eyaler opened this issue Sep 20, 2019 · 8 comments · Fixed by #59
Closed

quality aliases #34

eyaler opened this issue Sep 20, 2019 · 8 comments · Fixed by #59

Comments

@eyaler
Copy link

eyaler commented Sep 20, 2019

some common notation that is missing:

Xsus = X5

Xmaj7 = XM7

Xmaj9 = XM9

Xm6 = (0, 3, 7, 9)

Xmadd9 = (0, 3, 7, 14)

also is there a general way to add quality for aliases?

@yuma-m
Copy link
Owner

yuma-m commented Sep 29, 2019

You want to use chords like below.

>>> Chord("Cmaj9")
<Chord: Cmaj9>
>>> Chord("Cmaj9") == Chord("CM9")
True

You can define new qualities in constants/qualities.py, but you also have to update Quality.__eq__ method to compare qualities not by its name but by its components.

@eyaler
Copy link
Author

eyaler commented Sep 29, 2019

i have more cases. i put them below. the thing is that there will always be more or different conventions (e.g. your 11th drops the third, but other use 6 notes). so i guess the best approach would be: a. get some statistics for the common qualities and use some official reference to decode them (i have some statistics from this project i can share: https://github.com/eyaler/uku3le). b. allow user to easily add/change aliases without need to modify the pycharm code. thanks for doing a great job!

add2 -> (0, 2, 4, 7)
madd2 -> (0, 2, 3, 7)
add4 -> (0, 4, 5, 7)
madd -> (0, 3, 5, 7)
m6 -> (0, 3, 7, 9)
7sus2 -> (0, 2, 7, 10)
madd9 -> (0, 3, 7, 14)
6sus2 -> (0, 2, 7, 9)
6sus4 -> (0, 5, 7, 9)
7b -> 7-
7# -> 7+
dim7 -> dim6
maj7 -> M7
maj9 -> M9
m11 -> 11 (for your case where you drop the third)
B# -> C
E# -> F
Cb -> B
Fb -> E
endswith('sus7') -> replace('sus7', '7sus4')
endswith('7sus') -> replace('7sus', '7sus4')
else: endswith('sus') -> replace('sus','5')

@mateuszdorobek
Copy link

mateuszdorobek commented Nov 5, 2019

I'm working with IRealBook data set they have lot more qualities, I have added degrees to them, maybe you want to merge them later, or discuss the jazz harmony rules on them.

   ('5', (0, 7)), 
   ('2', (0, 2, 7)), 
   ('+', (0, 4, 8)),
   ('', (0, 4, 7)), 
   ('o', (0, 3, 6)),
   ('h', (0, 3, 6)), 
   ('sus', (0, 5, 7)), 
   ('^', (0, 4, 7)), 
   ('-', (0, 3, 7)),
   ('add9', (0, 4, 7, 14)), 
   ('^7', (0, 4, 7, 11)), 
   ('-7', (0, 3, 7, 10)),
   ('7', (0, 4, 7, 10)), 
   ('7sus', (0, 5, 7, 10)), 
   ('h7', (0, 3, 6, 10)),
   ('o7', (0, 3, 6, 9)), 
   ('^7#5', (0, 4, 8, 11)), 
   ('6', (0, 4, 7, 9)), 
   ('-6', (0, 3, 7, 9)),
   ('-7b5', (0, 3, 6, 10)), 
   ('-b6', (0, 3, 7, 8)), 
   ('-#5', (0, 3, 7, 8)),
   ('7b5', (0, 4, 6, 10)), 
   ('7#5', (0, 4, 8, 10)), 
   ('-^7', (0, 3, 7, 11)), 
   ('-^9', (0, 3, 7, 11, 14)),
   ('^9', (0, 4, 7, 11, 14)), 
   ('-69', (0, 3, 7, 9, 14)), 
   ('-9', (0, 3, 7, 10, 14)),
   ('69', (0, 4, 7, 9, 14)), 
   ('^7#11', (0, 4, 7, 11, 18)), 
   ('h9', (0, 3, 6, 10, 14)),
   ('7b9sus', (0, 5, 7, 10, 13)), 
   ('7susadd3', (0, 5, 7, 10, 16)),
   ('9', (0, 4, 7, 10, 14)), 
   ('7b9', (0, 4, 7, 10, 13)), 
   ('7#9', (0, 4, 7, 10, 15)),
   ('9b5', (0, 4, 6, 10, 14)), 
   ('9#5', (0, 4, 8, 10, 14)), 
   ('7#9#5', (0, 4, 8, 10, 15)),
   ('7#9b5', (0, 4, 6, 10, 15)), 
   ('7b9b5', (0, 4, 6, 10, 13)),
   ('7b9#5', (0, 4, 8, 10, 13)), 
   ('7alt', (0, 4, 8, 10, 15)),
   ('^13', (0, 4, 7, 11, 14, 21)), 
   ('^9#11', (0, 4, 7, 11, 14, 18)), 
   ('-11', (0, 3, 7, 10, 14, 17)),
   ('7#11', (0, 4, 7, 10, 14, 18)), 
   ('9#11', (0, 4, 7, 10, 14, 18)), 
   ('7#9#11', (0, 4, 7, 10, 15, 18)), 
   ('7b9#11', (0, 4, 7, 10, 13, 18)),
   ('7b9#9', (0, 4, 7, 10, 13, 15)), 
   ('9sus', (0, 5, 7, 10, 14, 16)), 
   ('11', (0, 4, 7, 10, 14, 17)), 
   ('7b9b13', (0, 4, 7, 10, 13, 17, 20)),
   ('7b13', (0, 4, 7, 10, 14, 17, 21)), 
   ('13', (0, 4, 7, 10, 14, 17, 21)), 
   ('13#11', (0, 4, 7, 10, 18, 17, 21)), 
   ('13b9', (0, 4, 7, 10, 13, 17, 21)),
   ('13#9', (0, 4, 7, 10, 15, 17, 21)), 
   ('13sus', (0, 5, 7, 10, 14, 17, 21)), 
   ('7b13sus', (0, 5, 7, 10, 14, 17, 20))

yuma-m added a commit that referenced this issue Nov 9, 2019
Add qualities and support quality alias comparison #34
@yuma-m yuma-m mentioned this issue Nov 9, 2019
@yuma-m
Copy link
Owner

yuma-m commented Nov 9, 2019

Thank you for introducing the qualities.
I'm not familiar with jazz harmony rules, but I added some qualities which I have ever seen before in pull request #36.

I think tension chords like 7#9#13 should be parsed instead of hard-coded because they have many combinations.

@yuma-m
Copy link
Owner

yuma-m commented Nov 9, 2019

allow user to easily add/change aliases without need to modify the pycharm code.

This idea is great.
I think some users use Pychord to parse scores which may have various chord formats like CM7 == Cmaj7 == C△7. It may be helpful if users can add or change some aliases to normalize their chord.

yuma-m added a commit that referenced this issue Nov 24, 2019
@ecotetsu
Copy link

ecotetsu commented Jan 8, 2020

in QUALITY_DICT
at 5 notes, '6/9' dose not work.

It seems to be conflicting with '/' means 'on Base'.

('69', (0, 4, 7, 9, 14))

and I need 'm69'.
('m69', (0, 3, 7, 9, 14))

yuma-m added a commit that referenced this issue Jan 26, 2020
yuma-m added a commit that referenced this issue Jan 26, 2020
@yuma-m yuma-m linked a pull request Apr 3, 2021 that will close this issue
@personalnadir
Copy link

I recently wrote a script to sanity check some guitar chords I found online. These are the chord recipes whose interval I had to manually define:

   'm11': 'R m3 P5 m7 M9 P11',
    'm13': 'R m3 p5 m7 M9 M13',
    'maj9/13': 'R M3 P5 M7 M9 P6',
    '5add9': 'R M2 M3 P5 M7',
    '7sus2':'R M2 P5 m7',
    'maj9/11': 'R M3 P5 M7 M9',
    'maj9#5': 'R M3 A5 M7 M9',
    'dim7': 'R m3 d5 d7',
    'm7#5': 'R m3 A5 m7',
    'mMaj11': 'R m3 P4 P5 M7',
    'mMaj9':'R m3 P5 M7 M9',
    'add4': 'R M3 P4 P5',
    'madd4': 'R m3 P4 P5'

As I am new to music theory, there might be some mistakes in there, but how would I go about translating them into the integer values required by the QualityManager? At the moment I am using the Interval class from the Musthe project to generate the set of chords from the string.

@yuma-m yuma-m closed this as completed in #59 Apr 8, 2021
@yuma-m
Copy link
Owner

yuma-m commented Apr 8, 2021

@personalnadir
You may refer DEFAULT_QUALITIES in https://github.com/yuma-m/pychord/blob/master/pychord/constants/qualities.py

For example, 'm11': 'R m3 P5 m7 M9 P11' will be ('m11', (0, 3, 7, 10, 14, 17)),.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants