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

Function get_key

mingus/core/keys.py:66–75  ·  view source on GitHub ↗

Return the key corrisponding to accidentals. Return the tuple containing the major key corrensponding to the accidentals put as input, and his relative minor; negative numbers for flats, positive numbers for sharps.

(accidentals=0)

Source from the content-addressed store, hash-verified

64
65
66def get_key(accidentals=0):
67 """Return the key corrisponding to accidentals.
68
69 Return the tuple containing the major key corrensponding to the
70 accidentals put as input, and his relative minor; negative numbers for
71 flats, positive numbers for sharps.
72 """
73 if accidentals not in range(-7, 8):
74 raise RangeError("integer not in range (-7)-(+7).")
75 return keys[accidentals + 7]
76
77
78def get_key_signature(key="C"):

Callers

nothing calls this directly

Calls 1

RangeErrorClass · 0.90

Tested by

no test coverage detected