|
27 | 27 |
|
28 | 28 | import os |
29 | 29 | import mingus.core.scales as scales |
| 30 | +import sys |
30 | 31 |
|
31 | 32 | from src.chords2midi import c2m |
32 | 33 | from chords import * |
|
53 | 54 | # ('Cb', 'ab'), # 7 b |
54 | 55 | ] |
55 | 56 |
|
| 57 | +# Chords in Major and minor scales |
56 | 58 | deg_maj = ['I', 'ii', 'iii', 'IV', 'V', 'vi', 'vii'] |
57 | 59 | deg_min = ['i', 'ii', 'III', 'iv', 'v', 'VI', 'VII'] |
58 | 60 |
|
| 61 | +# progressions styles |
| 62 | +styles = [ '', 'basic4', 'alt4', 'hiphop' ] |
| 63 | + |
| 64 | +# Test mode |
| 65 | +if len(sys.argv) > 1 and sys.argv[1] == '--test': |
| 66 | + keys = [ ('C', 'A') ] |
| 67 | + styles = [ '' ] |
| 68 | + |
59 | 69 | # |
60 | 70 | # Generate a single chord |
61 | 71 | # |
@@ -144,17 +154,17 @@ def genprog(dir, key, chords, prefix, style = ''): |
144 | 154 | i = i + 1 |
145 | 155 |
|
146 | 156 | # Major progressions |
147 | | - for style in [ '', 'basic4', 'alt4', 'hiphop' ]: |
| 157 | + for style in styles: |
148 | 158 | for n in prog_maj: |
149 | 159 | genprog(f'{base}/4 Progression/Major', root_maj, n, root_maj, style) |
150 | 160 |
|
151 | 161 | # Minor progressions |
152 | | - for style in [ '', 'basic4', 'alt4', 'hiphop' ]: |
| 162 | + for style in styles: |
153 | 163 | for n in prog_min: |
154 | 164 | genprog(f'{base}/4 Progression/Minor', root_min.lower(), n, root_min, style) |
155 | 165 |
|
156 | 166 | # Modal progressions |
157 | | - for style in [ '', 'basic4', 'alt4', 'hiphop' ]: |
| 167 | + for style in styles: |
158 | 168 | for n in prog_modal: |
159 | 169 | genprog(f'{base}/4 Progression/Modal', root_maj, n, root_maj, style) |
160 | 170 |
|
|
0 commit comments