MIDI (and MIDI Like) File Timing by snakemeat at 4:12 PM EST on February 25, 2009
I'm looking into timing a MIDI like format (PS2 SQ). I am able to get the tempo of the file from the set tempo command, which seems to be stored in (microseconds/quarter note) units. Now I'm wondering how exactly to count these "quarter notes" so I can do the appropriate math and get the time of the entire track. Am I oversimplifying this by thinking that a total count of notes will be all I need? I understand that I'll need to account for loops, I just don't know how to count notes.

Can anyone explain to me which MIDI commands get counted as quarter notes? I had pondered counting Note On events, but what about times where there is silence? Thanks in advance.

edited 4:13 PM EST February 25, 2009
by kingshriek at 2:39 PM EST on February 26, 2009
For MIDI and MIDI-based sequences, just about each command has a tick value associated with it that essentially determines timing. Combining this with tempo change events (typically given in microseconds/quarter-note) and resolution (480 ticks/quarter-note is the common default value if it not specified) will allow you to get the time in seconds.

Basically, just do time = sum(ticks*tempo/resolution), summing over every MIDI command to get the timing.
by snakemeat at 3:23 PM EST on February 26, 2009
For MIDI and MIDI-based sequences, just about each command has a tick value associated with it that essentially determines timing.

Thanks for all the info, it really helps and makes sense of some values I didn't understand (specifically what this 480 value I found represents). Regarding the tick value described above, are you referring to the delta-time value (which I've read a bit about here) or is there a reference somewhere describing how many ticks each command uses? Thanks again, I really appreciate it.

edited 3:24 PM EST February 26, 2009
by kingshriek at 4:14 PM EST on February 26, 2009
The tick value is the same as the delta-time.


Go to Page 0

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=http://www.google.com]Link[/url]

[img=https://www.hcs64.com/images/mm1.png]
Password
Subject
Message

HCS Forum Index
Halley's Comet Software
forum source