Substitute a diminished chord for another diminished chord. 'dim' and 'dim7' suffixes recognized, and 'VI' if there is no suffix. Example: >>> substitute_diminished_for_diminished(['VII'], 0) ['IIdim', 'bIVdim', 'bbVIdim']
(
progression, substitute_index, ignore_suffix=False
)
| 361 | |
| 362 | |
| 363 | def substitute_diminished_for_diminished( |
| 364 | progression, substitute_index, ignore_suffix=False |
| 365 | ): |
| 366 | """Substitute a diminished chord for another diminished chord. |
| 367 | |
| 368 | 'dim' and 'dim7' suffixes recognized, and 'VI' if there is no suffix. |
| 369 | |
| 370 | Example: |
| 371 | >>> substitute_diminished_for_diminished(['VII'], 0) |
| 372 | ['IIdim', 'bIVdim', 'bbVIdim'] |
| 373 | """ |
| 374 | (roman, acc, suff) = parse_string(progression[substitute_index]) |
| 375 | res = [] |
| 376 | |
| 377 | # Diminished progressions |
| 378 | if ( |
| 379 | suff == "dim7" |
| 380 | or suff == "dim" |
| 381 | or suff == "" |
| 382 | and roman in ["VII"] |
| 383 | or ignore_suffix |
| 384 | ): |
| 385 | if suff == "": |
| 386 | suff = "dim" |
| 387 | |
| 388 | # Add diminished chord |
| 389 | last = roman |
| 390 | for x in range(3): |
| 391 | next = skip(last, 2) |
| 392 | acc += interval_diff(last, next, 3) |
| 393 | res.append(tuple_to_string((next, acc, suff))) |
| 394 | last = next |
| 395 | return res |
| 396 | |
| 397 | |
| 398 | def substitute_diminished_for_dominant( |
nothing calls this directly
no test coverage detected