MCPcopy Create free account
hub / github.com/bspaans/python-mingus / substitute_diminished_for_dominant

Function substitute_diminished_for_dominant

mingus/core/progressions.py:398–423  ·  view source on GitHub ↗
(
    progression, substitute_index, ignore_suffix=False
)

Source from the content-addressed store, hash-verified

396
397
398def 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
426def substitute(progression, substitute_index, depth=0):

Callers

nothing calls this directly

Calls 4

parse_stringFunction · 0.85
skipFunction · 0.85
interval_diffFunction · 0.85
tuple_to_stringFunction · 0.85

Tested by

no test coverage detected