Midi files do not start at time 0 #619
-
I've been generating some midi files by randomly picking rhythms and pitches. I append the messages with note_on signals where time is specified as the length of the note to be played in ticks. I then save the file and view the created midi file in Ableton, or listen to it on my media player. The files never start at the 0, and the entire pattern always seems to be shifted in time over by this same amount, which is different in every file I've created and which also doesn't seem to match any tick value I'm using. I've printed the midi tracks from the generated file in another python file and it seems like the first message is note_on, so I don't understand why the start time is not 0. |
Beta 8000 Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
MIDI File messages |
Beta Was this translation helpful? Give feedback.
MIDI File messages
time
holds a delta time value not a length. Delta time is the time in ticks before playing the next message.In your example your first
note_on
message is set to start120
ticks after theset_tempo
meta. You want this value at 0.