COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

MIDI Ticks to Milliseconds?

• Follow

```Hi,

I'm trying to figure out how to convert MIDI
"ticks" to milliseconds.

For example, say I notes occuring at these MIDI ticks:

0
24
48
72
96
120
144
168
192
216
240
264
288
312
336
360
384

How can I figure out how many milliseconds have passed
between the first(0) and second(24) ticks?

Thank you,

Andrew

```
 0

```Andrew wrote:

>Hi,
>
>I'm trying to figure out how to convert MIDI
>"ticks" to milliseconds.
>
>For example, say I notes occuring at these MIDI ticks:
>
>0
>24
>48
>72
>96
>120
>144
>168
>192
>216
>240
>264
>288
>312
>336
>360
>384
>
>How can I figure out how many milliseconds have passed
>between the first(0) and second(24) ticks?

You don't yet have enough information to figure it out.  You need to know
the tempo, typically expressed as beats per minute (BPM), and the resolution,
typically expressed as ticks per beat (TPB).  Once you know these parameters
and the number of ticks (#ofTicks) the conversion is straightforward algebra.

1     1    60 seconds   1000 milliseconds
milliseconds = #ofTicks X --- X --- X ---------- X -----------------
TPB   BPM     minute           second

#ofTicks X 60000
= ----------------
TPB X BPM

>Thank you,

Yep.

>Andrew

--
========================================================================
Michael Kesti            |  "And like, one and one don't make
|   two, one and one make one."
mkesti@gv.net            |          - The Who, Bargain
```
 0

```> You don't yet have enough information to figure it out.  You need to know
> the tempo, typically expressed as beats per minute (BPM), and the resolution,
> typically expressed as ticks per beat (TPB).  Once you know these parameters
> and the number of ticks (#ofTicks) the conversion is straightforward algebra.

OK, I was able to extract this info from the MIDI file:

resolution: 96 ticks per beat
tick 0, Set Tempo (us/quarter note): 342857

I believe the number 342857 is the number I need
to determine the BMP, but I'm not sure how to
convert it to BPM.

Can you tell me how?

Regards,

Andrew

```
 0

```Andrew wrote:

>> You don't yet have enough information to figure it out.  You need to know
>> the tempo, typically expressed as beats per minute (BPM), and the resolution,
>> typically expressed as ticks per beat (TPB).  Once you know these parameters
>> and the number of ticks (#ofTicks) the conversion is straightforward algebra.
>
>OK, I was able to extract this info from the MIDI file:
>
>resolution: 96 ticks per beat

Good.

>tick 0, Set Tempo (us/quarter note): 342857
>
>I believe the number 342857 is the number I need
>to determine the BMP, but I'm not sure how to
>convert it to BPM.

342875 micoseconds is 0.342875 second or a bit more than a third of a second
so there are a bit less than three quarter notes per second.  There will
therefore be a bit less than 180 (3 times 60) quarter notes per minute.

>Can you tell me how?

It turns out that you're again short some information.  You need to know
the time signature to determine whether a quarter note is one beat.  If
we assume the time signature's denominator is 4, as in 2/4, 3/4, and 4/4
time, then a quarter note is, in fact, one beat and we can compute the
tempo.

1 beat        60 seconds
tempo(BPM) = --------------- X ---------- = 175 BPM
0.342875 second     minute

If the time signature's denominator is instead 8 then there are two beats per
quarter note and the calculation becomes.

2 beats       60 seconds
tempo(BPM) = --------------- X ---------- = 350 BPM
0.342875 second     minute

>Regards,
>
>Andrew

--
========================================================================
Michael Kesti            |  "And like, one and one don't make
|   two, one and one make one."
mkesti@gv.net            |          - The Who, Bargain
```
 0

```Michael R. Kesti wrote:

> It turns out that you're again short some information.  You need to know
> the time signature to determine whether a quarter note is one beat.  If
> we assume the time signature's denominator is 4, as in 2/4, 3/4, and 4/4
> time, then a quarter note is, in fact, one beat and we can compute the
> tempo.

Excellent.  Thank you!

I've got a few other MIDI math problems to work out but
I'll see if I can figure them out on my own.

Andrew

```
 0

4 Replies
1666 Views