Substitute minor chords for its major equivalent. 'm' and 'm7' suffixes recognized, and ['II', 'III', 'VI'] if there is no suffix. Examples: >>> substitute_minor_for_major(['VI'], 0) ['I'] >>> substitute_minor_for_major(['Vm'], 0) ['bVIIM'] >>> substitute_minor_for_
(progression, substitute_index, ignore_suffix=False)
| 291 | |
| 292 | |
| 293 | def substitute_minor_for_major(progression, substitute_index, ignore_suffix=False): |
| 294 | """Substitute minor chords for its major equivalent. |
| 295 | |
| 296 | 'm' and 'm7' suffixes recognized, and ['II', 'III', 'VI'] if there is no |
| 297 | suffix. |
| 298 | |
| 299 | Examples: |
| 300 | >>> substitute_minor_for_major(['VI'], 0) |
| 301 | ['I'] |
| 302 | >>> substitute_minor_for_major(['Vm'], 0) |
| 303 | ['bVIIM'] |
| 304 | >>> substitute_minor_for_major(['VIm7'], 0) |
| 305 | ['IM7'] |
| 306 | """ |
| 307 | (roman, acc, suff) = parse_string(progression[substitute_index]) |
| 308 | res = [] |
| 309 | |
| 310 | # Minor to major substitution |
| 311 | if ( |
| 312 | suff == "m" |
| 313 | or suff == "m7" |
| 314 | or suff == "" |
| 315 | and roman in ["II", "III", "VI"] |
| 316 | or ignore_suffix |
| 317 | ): |
| 318 | n = skip(roman, 2) |
| 319 | a = interval_diff(roman, n, 3) + acc |
| 320 | if suff == "m" or ignore_suffix: |
| 321 | res.append(tuple_to_string((n, a, "M"))) |
| 322 | elif suff == "m7" or ignore_suffix: |
| 323 | res.append(tuple_to_string((n, a, "M7"))) |
| 324 | elif suff == "" or ignore_suffix: |
| 325 | res.append(tuple_to_string((n, a, ""))) |
| 326 | return res |
| 327 | |
| 328 | |
| 329 | def substitute_major_for_minor(progression, substitute_index, ignore_suffix=False): |
nothing calls this directly
no test coverage detected