(
progression, substitute_index, ignore_suffix=False
)
| 396 | |
| 397 | |
| 398 | def substitute_diminished_for_dominant( |
| 399 | progression, substitute_index, ignore_suffix=False |
| 400 | ): |
| 401 | (roman, acc, suff) = parse_string(progression[substitute_index]) |
| 402 | res = [] |
| 403 | |
| 404 | # Diminished progressions |
| 405 | if ( |
| 406 | suff == "dim7" |
| 407 | or suff == "dim" |
| 408 | or suff == "" |
| 409 | and roman in ["VII"] |
| 410 | or ignore_suffix |
| 411 | ): |
| 412 | if suff == "": |
| 413 | suff = "dim" |
| 414 | |
| 415 | # Add diminished chord |
| 416 | last = roman |
| 417 | for x in range(4): |
| 418 | next = skip(last, 2) |
| 419 | dom = skip(last, 5) |
| 420 | a = interval_diff(last, dom, 8) + acc |
| 421 | res.append(tuple_to_string((dom, a, "dom7"))) |
| 422 | last = next |
| 423 | return res |
| 424 | |
| 425 | |
| 426 | def substitute(progression, substitute_index, depth=0): |
nothing calls this directly
no test coverage detected