diff --git a/miditoolkit/constants.py b/miditoolkit/constants.py index ddfd1e7..475db91 100644 --- a/miditoolkit/constants.py +++ b/miditoolkit/constants.py @@ -22,9 +22,30 @@ MINOR_NAMES = ["m", "Min", "Minor", "min", "minor"] KEY_NUMBER_TO_MIDO_KEY_NAME = [ - 'C', 'Db', 'D', 'Eb', 'E', 'F', 'F#', 'G', 'Ab', 'A', 'Bb', 'B', - 'Cm', 'C#m', 'Dm', 'D#m', 'Em', 'Fm', 'F#m', 'Gm', 'G#m', 'Am', - 'Bbm', 'Bm' + "C", + "Db", + "D", + "Eb", + "E", + "F", + "F#", + "G", + "Ab", + "A", + "Bb", + "B", + "Cm", + "C#m", + "Dm", + "D#m", + "Em", + "Fm", + "F#m", + "Gm", + "G#m", + "Am", + "Bbm", + "Bm", ] DEFAULT_BPM = 120 diff --git a/miditoolkit/midi/parser.py b/miditoolkit/midi/parser.py index fbe448d..da467f0 100755 --- a/miditoolkit/midi/parser.py +++ b/miditoolkit/midi/parser.py @@ -503,7 +503,11 @@ def event_compare(event1, event2): key_list = [] for ks in self.key_signature_changes: key_list.append( - mido.MetaMessage("key_signature", time=ks.time, key=KEY_NUMBER_TO_MIDO_KEY_NAME[ks.key_number]) + mido.MetaMessage( + "key_signature", + time=ks.time, + key=KEY_NUMBER_TO_MIDO_KEY_NAME[ks.key_number], + ) ) # crop segment