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

Function determine

mingus/core/chords.py:920–942  ·  view source on GitHub ↗

Name a chord. This function can determine almost every chord, from a simple triad to a fourteen note polychord.

(chord, shorthand=False, no_inversions=False, no_polychords=False)

Source from the content-addressed store, hash-verified

918
919
920def determine(chord, shorthand=False, no_inversions=False, no_polychords=False):
921 """Name a chord.
922
923 This function can determine almost every chord, from a simple triad to a
924 fourteen note polychord."""
925 if chord == []:
926 return []
927 elif len(chord) == 1:
928 return chord
929 elif len(chord) == 2:
930 return [intervals.determine(chord[0], chord[1])]
931 elif len(chord) == 3:
932 return determine_triad(chord, shorthand, no_inversions, no_polychords)
933 elif len(chord) == 4:
934 return determine_seventh(chord, shorthand, no_inversions, no_polychords)
935 elif len(chord) == 5:
936 return determine_extended_chord5(chord, shorthand, no_inversions, no_polychords)
937 elif len(chord) == 6:
938 return determine_extended_chord6(chord, shorthand, no_inversions, no_polychords)
939 elif len(chord) == 7:
940 return determine_extended_chord7(chord, shorthand, no_inversions, no_polychords)
941 else:
942 return determine_polychords(chord, shorthand)
943
944
945def determine_triad(triad, shorthand=False, no_inversions=False, placeholder=None):

Callers

nothing calls this directly

Calls 7

determine_triadFunction · 0.85
determine_seventhFunction · 0.85
determine_polychordsFunction · 0.85
determineMethod · 0.80

Tested by

no test coverage detected