<meta message time_signature numerator=4 denominator=4 clocks_per_click=24 notated_32nd_notes_per_beat=8 time=0>
<meta message time_signature numerator=4 denominator=4 clocks_per_click=24 notated_32nd_notes_per_beat=32 time=0>
Time Signature(Off-topic note: Although a time signature denominator of 4 is actually stored as hex 02 in the MIDI file, the Python mido library, like most MIDI file software, does this conversion for you, so when you specify a denominator of 4, the MIDI file will get a hex 02 in that spot.)
FF 58 04 nn dd cc bb
The time signature is expressed as four numbers. nn and dd represent the numerator and denominator of the time signature as it would be notated. The denominator is a negative power of two: 2 represents a quarter-note, 3 represents an eighth-note, etc. The cc parameter expresses the number of MIDI clocks in a metronome click. The bb parameter expresses the number of notated 32nd-notes in what MIDI thinks of as a quarter-note (24 MIDI Clocks). This was added because there are already multiple programs which allow the user to specify that what MIDI thinks of as a quarter-note (24 clocks) is to be notated as, or related to in terms of, something else.
Here is my understanding:
A "MIDI quarter note" is 24 MIDI clocks. ("MIDI clocks" are small MIDI messages sent at a steady rate that help indicate the current tempo to other MIDI devices.)
A "notated quarter note" is presumably how your MIDI software displays quarter notes on the screen.
In a Time Signature event, the bb value supposedly lets you change the relationship between a "MIDI quarter note" and a "notated quarter note". However, in the MIDI software I have used, my tests changing the bb value had no effect on how the software displayed quarter notes. And in every MIDI file I have encountered, the bb value is always set as 8 indicating a "MIDI quarter note" and a "notated quarter note" are the same.
Does the MIDI Manufacturers Association or any other users here know of any MIDI software that uses the Time Signature bb value in any way?
If you were to set the bb value to something other than 8, then you have to carefully understand which items are defined in terms of "MIDI quarter notes" and which items are defined in terms of "notated quarter notes":
Tempo meta event: The specification says "Another way of putting 'microseconds per quarter note' is '24ths of a microsecond per MIDI clock'", indicating the tempo meta event value is defined in terms of "MIDI quarter notes".
Time signature denominator: The specification says "nn and dd represent the numerator and denominator of the time signature as it would be notated", suggesting the time signature denominator is defined in terms of "notated quarter notes".
Ticks per quarter note: When the quarter-note based division is used, is the "division" value in the header in terms of "MIDI quarter notes" or "notated quarter notes"? I guess it's "MIDI quarter notes", but the specification only says "ticks per quarter note".
As you can see, I have also wondered about the exact meaning and usage of the Time Signature bb value, but since I haven't found software that uses the bb value for anything, and the specification could be clearer about which items are defined in terms of "MIDI quarter notes" or "notated quarter notes", my current suggestion is to always set the bb value to 8 to specify "MIDI quarter notes" and "notated quarter notes" are the same.