Open josephernest opened 6 years ago
I noticed that tick is the time difference between each event, and not absolute timing.
Thus, this works:
import midi
for track in midi.read_midifile("song.mid"):
t = 0
for e in track:
if e.__class__.__name__ not in ["NoteOnEvent", "NoteOffEvent"]:
continue
t += e.tick
print t * alpha, "Note", e.data[0], "on" if e.data[1] == 110 else "off"
I am using this library to do something similar. What is the value of 'alpha' on your last line?
see make_ticks_abs()
I have this error module 'midi' has no attribute 'read_midifile' . I don't understand why my midi has this problem can you please help me.
Joseph if possible can you please share your midi Library from Anaconda3>Lib>site-packages
When doing:
we get a list of events like this:
but obviously the
tick
is not enough to get the timing of the note: in the song, there isn't many so many notes at time 0.Question: how to properly extract the timing? (no matter the unit, I could do the conversion later by * 10000 or 100000 if needed)