I understand the note/pitch and the velocity components of a message. However, I am having difficulty understanding the time attribute. According to the documentation of mido
, a library that I am using to read MIDI files, the time attribute denotes the delta time that has elapsed since the last message.
Firstly, how is this delta time measured? As in, in what units is time discretised?
For example, take the following piece by Liszt. I find that sometimes the time attribute is 0
. Does this imply the previous note and the current are being played together?
The ultimate aim is to convert a MIDI file into a Piano-roll in Python. When read in Python, this is a small part of the message:
Track 0: Rhapsodie Nr. 10
<meta message track_name name='Rhapsodie Nr. 10' time=0>
<meta message copyright text='Copyright © 2005 von Bernd Krüger. ' time=0>
<meta message text text='Franz Liszt' time=0>
<meta message text text='Fertiggestellt am 28.5.2005\n' time=0>
<meta message text text='Update am 9.4.2011\n' time=0>
<meta message text text='Update am 8.3.2014\n' time=0>
<meta message text text='Dauer: 4:39 Minuten\n' time=0>
<meta message text text='Notation im 4/4 statt im 2/4 Takt.\n' time=0>
<meta message time_signature numerator=5 denominator=4 clocks_per_click=24 notated_32nd_notes_per_beat=8 time=0>
<meta message key_signature key='E' time=0>
<meta message set_tempo tempo=525394 time=0>
<meta message marker text='Preludio' time=0>
program_change channel=0 program=0 time=0
control_change channel=0 control=7 value=100 time=0
control_change channel=0 control=10 value=64 time=0
note_on channel=0 note=47 velocity=77 time=0
control_change channel=0 control=91 value=127 time=0
<meta message text text='bdca426d104a26ac9dcb070447587523' time=0>
program_change channel=0 program=0 time=0
control_change channel=0 control=7 value=100 time=0
control_change channel=0 control=10 value=64 time=0
control_change channel=0 control=91 value=127 time=0
<meta message text text='bdca426d104a26ac9dcb070447587523' time=0>
note_on channel=0 note=35 velocity=61 time=0
program_change channel=0 program=0 time=0
control_change channel=0 control=64 value=127 time=0
note_on channel=0 note=35 velocity=0 time=90
note_on channel=0 note=47 velocity=0 time=0