The MIDI time signature meta message defines the musical time signature of a MIDI sequence.
This message belongs to the category of MIDI meta messages. Since this is a meta message, it may exist in MIDI files, but it is never sent over MIDI ports to a MIDI device.
This message consists of seven bytes of data. The first byte is the status byte and has a hexadecimal value of 0xFF, which means that this is a meta message. The second byte is the meta message type 0x58 and shows that this is a time signature meta message. The third byte is 0x04 and shows that there are four remaining bytes. The fourth byte is the numerator of the time signature and has values between 0x00 and 0xFF (0 and 255). The fifth byte is the power to which the number 2 must be raised to obtain the time signature denominator. Thus, if the fifth byte is 0, the denominator is 20 = 1, denoting whole notes. If the fifth byte is 1, the denominator is 21=2 denoting half notes, and so on. The sixth byte of the message defines a metronome pulse in terms of the number of MIDI clock ticks per click. Assuming 24 MIDI clocks per quarter note, if the value of the sixth byte is 48, the metronome will click every two quarter notes, or in other words, every half-note. The seventh byte defines the number of 32nd notes per beat. This byte is usually 8 as there is usually one quarter note per beat and one quarter note contains eight 32nd notes.
The following is an example of a MIDI time signature meta message.
0xFF 0x58 0x04 0x04 0x02 0x18 0x08
The status byte 0xFF shows that this is a meta message. The second byte is the meta type 0x58 and signifies that this is a time signature meta message. The third byte is 4, which means that there are four remaining bytes. The fourth byte is 0x04, which means that the time signature numerator is 4. The fifth byte is 0x02, which means that the time signature denominator is 2^2 = 4. The sixth byte is 0x18, which is 24 decimal, and means that the metronome will click once every 24 MIDI clocks. The seventh byte is 8, which means that there are eight 32nd notes per beat.
If a time signature message is not present in a MIDI sequence, 4/4 signature is assumed.
Comments
So if the signature is 6/8
So if the signature is 6/8 what would be the fifth byte? Square root from 8 isn't a whole number.
Not roots, but power of 2
If the denominator is 8, then the fifth byte will be 3, which means 2^3 = 8. It is not about roots, but about powers of 2.
What is the purpose of the
What is the purpose of the seventh byte?
Wouldn't the 32 notes per beat always be defined by the denominator?
i.e. 1 quarter note per beat = 8 32nd notes per beat
1 half = 16
1 eighth = 4
It is about displaying a music score
The seventh byte of the time signature message is not related to the time signature and does not affect playback. It helps in figuring out whether a note should be displayed as a quarter note, half note, etc.
The MIDI header chunk tells you how many ticks there are per beat and the MIDI set tempo message tells you how long a beat is. So, with these two, you can compute how long a tick is. Events are sent at times defined by number of ticks and so, with these two, you can play events. However, what you cannot do is to display the events. For example, if you have a note on message and then a note off message that are 60 ticks apart, you don't know whether these 60 ticks are a quarter note or whether these 60 ticks are a half note. The seventh byte of the time signature message helps you do that.
The seventh byte is not related to the time signature (e.g., 4/4 or 8/8). It provides a link between beats / ticks and note types. If that byte tells you that there are 8 32nd notes (one quarter note) per beat and, from the header chunk, you know that one beat is 60 ticks, and if you find a note off that follows a note on by 60 ticks, then that note on and note off make one quarter note. You can show that one quarter note on a score. If you change the seventh byte to be 16 32nd notes per beat, then the same note on and note off should be displayed as a half note.
Is it actually ticks per beat
Is it actually ticks per beat in the header, or is it ticks per quarter?
I assume given this byte exists, it is ticks per beat, as if it were really PPQ there would be no need for it.
Im sorry ref my previous
Im sorry ref my previous message, on thinking about it for more than 5 seconds; it makes no difference whether the header chunk is ticks per beat or ticks per quarter (although it would be good to clarify which it actually should be, beat and quarter note being used interchangeably causes undue confusion).
If the purpose of the seventh byte is to determine the ticks per note, then its completely redundant, as this can be derived from the denominator and the ticks per beat.
The way I interpret it is: A
The way I interpret it is: A quarter note and a beat are not the same thing. The seventh byte tells you if a beat is a quarter note or something else. Because of that, the seventh byte is not redundant (but it is not necessary for playback; it is only needed for the music score).
Yes it is unclear, I see
Yes it is unclear, I see conflicting information regarding it but i am inclined to agree with you.
Thanks for the information provided here it is an excellent resource.
Add new comment