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)
| 64 | |
| 65 | |
| 66 | def 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 | |
| 78 | def get_key_signature(key="C"): |