From 991bda5c95d9fd019b9f7e001cf3357710dac086 Mon Sep 17 00:00:00 2001 From: big bg Date: Wed, 1 Dec 2021 02:52:11 +0100 Subject: [PATCH] /a fonctionne ! --- main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index ed2630e..7c3bca7 100644 --- a/main.py +++ b/main.py @@ -87,9 +87,10 @@ async def main(): for msg in MidiFile('new_song_1.mid'): d = msg.dict() print(msg, d) - if "note" in d: - s += d['time'] * 1000 - notes.append(Note(s, {"duration": 400, "color": default_color, "key": midi_key_my_key(d["note"])})) + s += d['time'] * 1000 + if d["type"] == "note_on": + print(s) + notes.append(Note(s, {"duration": 470, "color": default_color, "key": midi_key_my_key(d["note"])})) p = Partition("test", notes @@ -125,4 +126,4 @@ async def main(): if __name__ == "__main__": - sys.exit(asyncio.run(main())) \ No newline at end of file + sys.exit(asyncio.run(main()))