-
Notifications
You must be signed in to change notification settings - Fork 3
/
dicts.py
196 lines (159 loc) · 6.59 KB
/
dicts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
###############################################################################
###############################################################################
## ##
## THATCHORD BY TOM CONTI-LESLIE dicts.py ##
## ##
## "notes" converts letters to note numbers. ##
## ##
## "qualities" is a large list of possible chord qualities. The default is ##
## to map each quality to the corresponding chord with root C. The notes ##
## are then shifted in interpret.py. Qualities with parentheses need not ##
## be entered (bar a few exceptions which are not picked up by the regex) ##
## since altered notes are handled in interpret.py. ##
## There are so many chord qualities! Feel free to suggest more! ##
## Formatting: enter the "most important" notes first. Usually only the ##
## root matters but I would recommend the first two entries being 0, 7 on ##
## most chords. In some cases, the algorithm will try to match these to ##
## lower strings. ##
## ##
## "alterations" converts each degree into a 2-tuple. The first element is ##
## the 'flat' element to be sharpened if the alteration is > 0. The second ##
## is the 'sharp' element to be flattened if the alt is < 0. ##
## ##
## ##
## License: CC BY-SA 4.0 ##
## ##
## Contact: tom (dot) contileslie (at) gmail (dot) com ##
## ##
###############################################################################
###############################################################################
notes = {
"C" : 0,
"D" : 2,
"E" : 4,
"F" : 5,
"G" : 7,
"A" : 9,
"B" : 11,
"c" : 0,
"d" : 2,
"e" : 4,
"f" : 5,
"g" : 7,
"a" : 9,
"b" : 11,
}
qualities = {
None : [0, 7, 4],
"" : [0, 7, 4],
"M" : [0, 7, 4],
"maj" : [0, 7, 4],
"Maj" : [0, 7, 4],
"m" : [0, 7, 3],
"Min" : [0, 7, 3],
"min" : [0, 7, 3],
"-" : [0, 7, 3],
"sus2" : [0, 2, 7],
"Sus2" : [0, 2, 7],
"sus4" : [0, 5, 7],
"sus" : [0, 5, 7],
"Sus4" : [0, 5, 7],
"Sus" : [0, 5, 7],
"5" : [0, 7],
"mb6" : [0, 7, 3, 8],
"minb6" : [0, 7, 3, 8],
"m6" : [0, 7, 3, 9],
"min6" : [0, 7, 3, 9],
"Min6" : [0, 7, 3, 9],
"6" : [0, 7, 4, 9],
"add6" : [0, 7, 4, 9],
"Add6" : [0, 7, 4, 9],
"add13" : [0, 7, 4, 9],
"Add13" : [0, 7, 4, 9],
"m7" : [0, 7, 3, 10],
"min7" : [0, 7, 3, 10],
"Min7" : [0, 7, 3, 10],
"7" : [0, 7, 10, 4],
"M7" : [0, 7, 4, 11],
"maj7" : [0, 7, 4, 11],
"Maj7" : [0, 7, 4, 11],
"delta" : [0, 7, 4, 11],
"Delta" : [0, 7, 4, 11],
"9" : [0, 2, 7, 4, 10],
"M9" : [0, 2, 7, 4, 11],
"Maj9" : [0, 2, 7, 4, 11],
"maj9" : [0, 2, 7, 4, 11],
"add9" : [0, 7, 2, 4],
"Add9" : [0, 7, 2, 4],
"Madd9" : [0, 7, 2, 4],
"MAdd9" : [0, 7, 2, 4],
"madd9" : [0, 2, 7, 3],
"mAdd9" : [0, 2, 7, 3],
"11" : [0, 5, 7, 10, 2, 4],
"M11" : [0, 2, 7, 5, 4, 11],
"maj11" : [0, 2, 7, 5, 4, 11],
"Maj11" : [0, 2, 7, 5, 4, 11],
"mMaj11" : [0, 2, 7, 5, 3, 11],
"-M11" : [0, 2, 7, 5, 3, 11],
"mM11" : [0, 2, 7, 5, 3, 11],
"m11" : [0, 2, 7, 5, 3, 10],
"-11" : [0, 2, 7, 5, 3, 10],
"min11" : [0, 2, 7, 5, 3, 10],
"add11" : [0, 7, 5, 4],
"Add11" : [0, 7, 5, 4],
"13" : [0, 9, 7, 4, 10, 2, 5],
"m13" : [0, 9, 7, 3, 10, 2, 5],
"min13" : [0, 9, 7, 3, 10, 2, 5],
"Min13" : [0, 9, 7, 3, 10, 2, 5],
"M13" : [0, 9, 7, 3, 11, 2, 5],
"maj13" : [0, 9, 7, 3, 11, 2, 5],
"Maj13" : [0, 9, 7, 3, 11, 2, 5],
"dim" : [0, 3, 6],
"Dim" : [0, 3, 6],
"dim7" : [0, 3, 6, 9],
"Dim7" : [0, 3, 6, 9],
"aug" : [0, 4, 8],
"Aug" : [0, 4, 8],
"+" : [0, 4, 8],
"7sus4" : [0, 5, 7, 10],
"7Sus4" : [0, 5, 7, 10],
"7sus" : [0, 5, 7, 10],
"7Sus" : [0, 5, 7, 10],
"7sus2" : [0, 2, 7, 10],
"7Sus2" : [0, 2, 7, 10],
"aug7" : [0, 4, 8, 10],
"Aug7" : [0, 4, 8, 10],
"+7" : [0, 4, 8, 10],
"7aug" : [0, 4, 8, 10],
"7Aug" : [0, 4, 8, 10],
"7+" : [0, 4, 8, 10],
"mM7" : [0, 7, 3, 11],
"minM7" : [0, 7, 3, 11],
"mm7" : [0, 7, 3, 11],
"augmaj7" : [0, 4, 8, 11],
"Augmaj7" : [0, 4, 8, 11],
"augMaj7" : [0, 4, 8, 11],
"AugMaj7" : [0, 4, 8, 11],
"augM7" : [0, 4, 8, 11],
"AugM7" : [0, 4, 8, 11],
"M7#5" : [0, 4, 8, 11],
"M7+5" : [0, 4, 8, 11],
"+M7" : [0, 4, 8, 11],
"+maj7" : [0, 4, 8, 11],
"+Maj7" : [0, 4, 8, 11],
"add#9" : [0, 7, 4, 3],
"Madd#9" : [0, 7, 4, 3],
"13sus4" : [0, 7, 9, 5, 10, 2]
}
alterations = {
1 : (0, 0),
2 : (2, 2),
3 : (3, 4),
4 : (5, 5),
5 : (7, 7),
6 : (9, 9),
7 : (10, 11),
9 : (2, 2),
11 : (5, 5),
13 : (9, 9)
}