MIDI timing
Clemens Ladisch
clemens at ladisch.de
Sat May 18 14:30:54 UTC 2019
Goran Mekić wrote:
> I have a simple MIDI file:
> https://github.com/mekanix/libmaolan/blob/feature/midi-example/data/example.mid
>
> Acording to http://www.ccarh.org/courses/253/handout/smf/
The official SMF specification can be downloaded from www.midi.org.
> there is the info of divisions per beat. For the example.mid I get that
> divisions are 19200
00000000: 4d 54 68 64 00 00 00 06 00 00 00 01 4b 00 4d 54 MThd........K.MT
Correct.
> so I assume if I have 100BPM song
This file does not contain any tempo events, so you have to assume 120 BPM.
> this would translate to 192000 divisions per second.
19200 * 100 = 1920000
"Division" is the name of the field in the header, but not of the unit of
time specified by it. This field specified _ticks_ per beat.
With 120 BPM, you actually have 2304000 ticks per second.
(And the tempo event would not specify BPM, but microseconds per beat.)
Regards,
Clemens
More information about the freebsd-multimedia
mailing list