Hi there people.
Writing midi parser and i have came across a problem with turning the midi delta time into milliseconds. I know how to convert to delta time to milliseconds thanks to (Midi Delta time convering) but the real problem is I dont know which tempo to use for each note.
The file format is 1 and the tempos are all in the first track (track 0) after the track header and I dont completely understand how these will match up the the notes that are stored in the second track (track 1).
Can some one please kindly explain how this works? currently I'm just taking the average of all the tempos.
Really really appreciate if someone could explain this
Thank you.
Midi, Tempo and Notes
I wrote a MIDI parser/player a while back...I took the timing info from the first track and use that as a default timing info for the additional tracks. Most (multitrack)files I tested with would have a first track that contains the timing info and no notes. That timing info would be used for all the other tracks. I used the timing info from the first track to init additional tracks as I loaded them. That way if the additional track happens to have it's own timing info, then that would be used instead of the first track info...
hth
hth
I wrote a MIDI parser/player a while back...I took the timing info from the first track and use that as a default timing info for the additional tracks. Most (multitrack)files I tested with would have a first track that contains the timing info and no notes. That timing info would be used for all the other tracks. I used the timing info from the first track to init additional tracks as I loaded them. That way if the additional track happens to have it's own timing info, then that would be used instead of the first track info...
hth
Thanks for the reply but forgive as I did not understand what was meant by the timing info from the first track? Each tempo has a time stamp (well i think they are timestamps), did you means by these, even if though these time stamps are completely different from the time stamps for the notes in the second track.
In the first tempo, for example 00 FF 51 03 0F 85 A0 8F 00, as you can see the timestamp is 0 (00), we know that FF represents a meta data, the 51 and 03 tells us its a tempo type event. 0F 85 A0 tells us the t[color="#303030"][font="Verdana, Tahoma, Arial, sans-serif"]empo in microseconds per quarter note is 1017248. Then finally 8F 00 tells us the time stamp for the next event?[/font]
I only have one track of notes because its representing the vocals.
The first note in second track starts of with a time stamp of BA 7A FF which is roughly 15.9 seconds, when using the average tempo for calculations
[color="#303030"][font="Verdana, Tahoma, Arial, sans-serif"]So is this tempo event related to the first note? and if so how long for the rest of the notes. I know the time signature is 4/2 if that helps?[/font]
[color="#303030"][font="Verdana, Tahoma, Arial, sans-serif"]
[/font]
[color="#303030"][font="Verdana, Tahoma, Arial, sans-serif"]Kind Regards[/font]
[font="Verdana, Tahoma, Arial, sans-serif"] [/font]
[font="Verdana, Tahoma, Arial, sans-serif"] [/font]
my Portfolio
I wrote a MIDI parser/player a while back...I took the timing info from the first track and use that as a default timing info for the additional tracks. Most (multitrack)files I tested with would have a first track that contains the timing info and no notes. That timing info would be used for all the other tracks. I used the timing info from the first track to init additional tracks as I loaded them. That way if the additional track happens to have it's own timing info, then that would be used instead of the first track info...
hth
thanks for the reply
my Portfolio
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement