python-midi
python-midi copied to clipboard
When I generate midi with my script, the notes slow down exponentially when played
I wrote a script to generate drum patterns that I use frequently, but when I try to play the midi files I generated, they slow down instead of keeping the same pace. I can't find out if I made an error or if I just don't understand the way midi is in encoded and it's very frustrating.
This is my code: mid.txt
It sounds like you have your tick counts in absolute when they need to be relative. I'll take a look at the code in a bit, but that's my guess for the moment.
On Sep 21, 2016 16:23, "Loden Rietveld" [email protected] wrote:
I wrote a script to generate drum patterns that I use frequently, but when I try to play the midi files I generated, they slow down instead of keeping the same pace. I can't find out if I made an error or if I just don't understand the way midi is in encoded and it's very frustrating.
This is my code: mid.txt https://github.com/vishnubob/python-midi/files/485982/mid.txt
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vishnubob/python-midi/issues/96, or mute the thread https://github.com/notifications/unsubscribe-auth/AOVJr9oFMuvz_oP-WGKTBW0dR1YEo_7Oks5qsZJPgaJpZM4KDPPo .
seconded
yeah I changed it too, but it still happens with pattern/track.make_ticks_rel()
Try creating the tracks using
track = midi.Track(tick_relative=False)
and remember that pattern.make_ticks_rel()
has to be used after you added every
event, including EndOfTrack events.