Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 May 2019 16:30:03 +0200
From:      Clemens Ladisch <clemens@ladisch.de>
To:        freebsd-multimedia@freebsd.org
Subject:   Re: MIDI timing
Message-ID:  <399c9c55-d751-3689-b590-e9a1dd81a226@ladisch.de>
In-Reply-To: <20190518124424.aiw4r72zgsedc5sq@hal9000.home.meka.rs>
References:  <20190518124424.aiw4r72zgsedc5sq@hal9000.home.meka.rs>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?399c9c55-d751-3689-b590-e9a1dd81a226>