Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Natooz committed Jun 10, 2024
1 parent 45703bc commit 4535492
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
27 changes: 24 additions & 3 deletions miditoolkit/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion miditoolkit/midi/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4535492

Please sign in to comment.