-
-
Notifications
You must be signed in to change notification settings - Fork 123
/
chords.py
258 lines (249 loc) · 6.38 KB
/
chords.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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
#!/usr/bin/env python3
# Copyright (c) 2019-2023 Ludovic Drolez
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Major progressions
prog_maj = [
"I I IM-5 IM-5 IV IV V Vsus2",
"I I IV iii",
"I iii IV vi",
"I iii vi Isus4",
"I iii vi IV",
"I IV ii V",
"I IV Isus2 IV",
"I IV V IV",
"I IV V V",
"I IV vi V",
"I IV vii iii vi ii V I",
"I V I IV",
"I V IV vi",
"I V vi ii",
"I V vi iii IV I IV V",
"I V vi iii IV",
"I V vi IV",
"I V vi V",
"I vi I IV",
"I vi ii IV",
"I vi ii V",
"I vi IV iii",
"I vi IV V",
"I7 V7 viadd9 IV7",
"ii IV V V",
"ii IV vi V",
"ii V I I",
"ii V I IV",
"ii7 Vadd9 I7 I7",
"iii vi IV I",
"iim7 V7 iiim7 vi7 iim7 V7",
"Isus2 I vi7 visus4",
"IV I ii vi",
"IV I iii IV",
"IV I V vi",
"IV IV I V",
"IV vi I V",
"IV vi iii I",
"IV vi IV vi",
"V I vi V",
"V IV vi I",
"V vi IV I",
"vi ii V I",
"vi IV I V",
"vi V IV V ii V I I",
"vi V IV V",
]
# minor progressions
prog_min = [
"i i iv iv v7 ii5 v v7",
"i ii v i",
"i III iv VI",
"i III VII VI",
"i ii v III i ii v VII",
"i iv III VI",
"i iv v iv",
"i iv v v",
"i iv VI v",
"i iv VII i",
"i iv VII v i i ii V",
"i v iv VII",
"i vdim iv VI",
"i VI III VII i VI69 III7 VII",
"i VI III VII",
"i VI iv ii",
"i VI iv III",
"i VI iv v",
"i VI VII iv",
"i VI VII v",
"i VI VII VII",
"i VII i v III VII i v i",
"i VII i v",
"i VII III VI",
"i VII v VI",
"i VII VI III iv VI VII i",
"i VII VI III",
"i VII VI iv",
"i VII VI VII",
"i7 VI III7 VII6 i i7 III7 iv7",
"ii v i i",
"ii v i iv",
"ii VI i iv",
"im7 ivsus4 v7 isus4",
"iv i v VI",
"iv III VII i",
"iv III vsus4 VI iv i III VI",
"iv v VI VII",
"iv VI v VII",
"iv VI VII i",
"v i iv VII",
"v iv i i",
"v VI III i",
"v VI v i",
"VI i v III",
"VI i v v",
"VI III i v",
"VI iv i v",
"VI VI i VII",
"VI VII i III",
"VI VII v III",
"VII iv v i",
"VII iv VII i",
]
# No. Mode
# 1 Ionian (major) I ii iii IV V vi viio
# 2 Dorian i ii ♭III IV v vio ♭VII
# 3 Phrygian i ♭II ♭III iv vo ♭VI ♭vii
# 4 Lydian I II iii ♯ivo V vi vii
# 5 Mixolydian I ii iiio IV v vi ♭VII
# 6 Aeolian (n.min) i iio ♭III iv v ♭VI ♭VII
# 7 Locrian io ♭II ♭iii iv ♭V ♭VI ♭vii
# Modal progressions
# Major and minor suffixes often need to be added to get the right chord
prog_modal = [
"bIIIM ii bIIM I",
"bIIM bVIM biii bviim",
"bIIM ivm biii im",
"bVIIM bIIM bIIIM im",
"bVIM bIIIM bVIIM IV I",
"bVIM bVIIm im bIIM",
"bVIM vi im bVIIM",
"bVIM7 ivmadd9 I I",
"I bIIIM bVIIM I",
"I bIIIM bVIIM IV",
"I bIIIM bVIM bVIIM",
"I bIIIM IV I",
"I bIIM I iii",
"I bIIM7 bIIIM6 bIIM7 I im bVIIM bIIM",
"I bVIIM bVIM bIIM",
"I bVIIM bVIM IV IVsus4 IV",
"I bVIIM I I bVIM V",
"I bVIIM IV V",
"I bVIM I bIIM",
"I bVIM IV bIIIM bVIIM",
"I IIIM vi V",
"I IIM iii V6",
"I IIM IV I",
"I IV bIIIM bVIM",
"I IV bVIIM IV",
"I IV V bVIIM",
"I ivm bIIIM bVIIM",
"I V bVIIM IV",
"I V ivm bVIM",
"I5 iii II5 #IVm IV5 vi V5 viim",
"ii bIIM I bVIIM",
"ii bVIIM7 I",
"ii IVM vm bVIIM",
"IIIM V VIsus4 VIM I IIM",
"im bIIIM bVIIM IV",
"im bIIIM bVIM V",
"im bIIIM IV bVIM",
"im bIIM bIIIM bIIM",
"im bIIM biim6 ivm",
"im bIIM im7 bviim",
"im bIIM ivm IIIM bIIM ivm IIIM IIIM",
"im bIIM vm im7",
"im bVIIM bIIM vm",
"im bviim bVIM bIIM",
"im bVIM ivm V",
"im ii vm IV",
"im ivm9 bIIM im vm ivm7 bIIM im7",
"im ivm9 bIIM im",
"im V bVIIM IV bVIM bIIIM ivm V",
"im VIM bi V",
"im VIM IIIM bIIM",
"im vm bVIM bIIM",
"im vm ivm bIIM7",
"IV V ii im bIIIM IV",
"ivm bIIIM iim7 V",
"ivm im bviim bVIM",
"vdim vdim ivm bIIIM",
"vi bVIM bVIIM I",
"vi vii V vi #IVdim V",
"VIM bVIM im bVIIM",
# cadences
"bIIIM V7 I",
"bVIIM V7 I",
"im bVIIM IV im",
"ivm bIIIM bIIM I",
"ivm IIIM bIIM I",
"ivm bIIIM bVIM I",
]
# Chord Types
# with major third
chord_types_maj = [
'sus2', # 0, 2, 7
'sus4', # 0, 5, 7
'6', # 0, 4, 7, 9
'7', # 0, 4, 7, 10
'7-5', # 0, 4, 6, 10
'7+5', # 0, 4, 8, 10
'7sus4', # 0, 5, 7, 10
'maj7', # 0, 4, 7, 11
'M7+5', # 0, 4, 8, 11
'add4', # 0, 4, 5, 7
'add9', # 0, 4, 7, 14
'sus4add9', # 0, 5, 7, 14
'2', # 0, 4, 7, 14
'add11', # 0, 4, 7, 17
'69', # 0, 4, 7, 9, 14
'9', # 0, 4, 7, 10, 14
'maj9', # 0, 4, 7, 11, 14
'9sus4', # 0, 5, 7, 10, 14
'7-9', # 0, 4, 7, 10, 13
'7+11' # 0, 4, 7, 10, 18
]
# with minor third
chord_types_min = [
'sus2', # 0, 2, 7
'sus4', # 0, 5, 7
'7sus4', # 0, 5, 7, 10
'm6', # 0, 3, 7, 9
'm7', # 0, 3, 7, 10
'm7-5', # 0, 3, 6, 10
'm7+5', # 0, 3, 8, 10
'dim6', # 0, 3, 6, 9
'dim7', # 0, 3, 6, 9
'mM7', # 0, 3, 7, 11
'madd4', # 0, 3, 5, 7
'madd9', # 0, 3, 7, 14
'sus4add9', # 0, 5, 7, 14
'm69', # 0, 3, 7, 9, 14
'm9', # 0, 3, 7, 10, 14
'9sus4', # 0, 5, 7, 10, 14
'm7b9b5', # 0, 3, 6, 10, 13
'm7add11', # 0, 3, 7, 10, 17
'mM7add11' # 0, 3, 7, 11, 17
]