From 4535492e26a8db5e68c4a28002a897aea44a92c0 Mon Sep 17 00:00:00 2001 From: Nathan Fradet <56734983+Natooz@users.noreply.github.com> Date: Mon, 10 Jun 2024 12:41:33 +0200 Subject: [PATCH] lint fix --- miditoolkit/constants.py | 27 ++++++++++++++++++++++++--- miditoolkit/midi/parser.py | 6 +++++- 2 files changed, 29 insertions(+), 4 deletions(-) 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