Sign in to follow this  
themadme

Midi, Tempo and Notes

Recommended Posts

themadme    122
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 ([url="http://www.lastrayofhope.com/2009/12/23/midi-delta-time-ticks-to-seconds/2/"]Midi Delta time convering[/url]) 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.

Share this post


Link to post
Share on other sites
BuffaloJ    145
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

Share this post


Link to post
Share on other sites
themadme    122
Hidden
[quote name='BuffaloJ' timestamp='1306976561' post='4818484']
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
[/quote]

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][/color]


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]
[color="#303030"][font="Verdana, Tahoma, Arial, sans-serif"]
[/font][/color]
[color="#303030"][font="Verdana, Tahoma, Arial, sans-serif"]Kind Regards[/font][/color]
[font="Verdana, Tahoma, Arial, sans-serif"] [/font]
[font="Verdana, Tahoma, Arial, sans-serif"] [/font]

Share this post


Link to post
themadme    122
[quote name='BuffaloJ' timestamp='1306976561' post='4818484']
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
[/quote]

thanks for the reply

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this