How does the Midi TEMPO message relate to other tracks?

Quite a simple question for which I have an assumption, but I can not find the final answer anywhere.

Background: I have a multi-track midi file with TEMPO controls on the first track. I need to transfer the ABSOLUTE_TICK account to other tracks to "Seconds" (fractional seconds are offset from the beginning of the midi file).

I have a formula linking ABSOLUTE_TICK to seconds based on PulsePerQuarterNote (PPQN) for a file at tempo (MS per quarter note).

The question arises: are the TEMPO changes in the first track (track 0) applied to all other tracks?

If so, then when I parse other tracks (for example, track 4, in which I am interested in the messages NOTE_ON and NOTE_OFF), I will need to hold a finger indicating changes in TEMPO in track 0 in parallel. Is it correct?

Thanks,

Mark

+5
source share
1 answer

In short, yes. The first track contains time information that will be applied to the entire composition, so you apply these messages to each of the tracks with the same absolute time. Since all events use an offset in ticks, you first need to extract messages about the tempo change, convert them to absolute time, and then when you read on other tracks, you will apply these messages based on this timeline.

MIDI- " " :

0 MTrk. 1 MTrk ( ), , " ". MIDI- MTrk. 2 MTrk ( ).

, MIDI- , . , , , MIDI , .

+6

All Articles