Substitute major chords for their minor equivalent. 'M' and 'M7' suffixes recognized, and ['I', 'IV', 'V'] if there is no suffix. Examples: >>> substitute_major_for_minor(['I'], 0) ['VI'] >>> substitute_major_for_minor(['VM7'], 0) ['IIIm7']
(progression, substitute_index, ignore_suffix=False)
| 327 | |
| 328 | |
| 329 | def substitute_major_for_minor(progression, substitute_index, ignore_suffix=False): |
| 330 | """Substitute major chords for their minor equivalent. |
| 331 | |
| 332 | 'M' and 'M7' suffixes recognized, and ['I', 'IV', 'V'] if there is no |
| 333 | suffix. |
| 334 | |
| 335 | Examples: |
| 336 | >>> substitute_major_for_minor(['I'], 0) |
| 337 | ['VI'] |
| 338 | >>> substitute_major_for_minor(['VM7'], 0) |
| 339 | ['IIIm7'] |
| 340 | """ |
| 341 | (roman, acc, suff) = parse_string(progression[substitute_index]) |
| 342 | res = [] |
| 343 | |
| 344 | # Major to minor substitution |
| 345 | if ( |
| 346 | suff == "M" |
| 347 | or suff == "M7" |
| 348 | or suff == "" |
| 349 | and roman in ["I", "IV", "V"] |
| 350 | or ignore_suffix |
| 351 | ): |
| 352 | n = skip(roman, 5) |
| 353 | a = interval_diff(roman, n, 9) + acc |
| 354 | if suff == "M" or ignore_suffix: |
| 355 | res.append(tuple_to_string((n, a, "m"))) |
| 356 | elif suff == "M7" or ignore_suffix: |
| 357 | res.append(tuple_to_string((n, a, "m7"))) |
| 358 | elif suff == "" or ignore_suffix: |
| 359 | res.append(tuple_to_string((n, a, ""))) |
| 360 | return res |
| 361 | |
| 362 | |
| 363 | def substitute_diminished_for_diminished( |
nothing calls this directly
no test coverage detected