The MIDI Forum

  1. chekad
  2. MIDI Specifications
  3. Saturday, 18 April 2020
  4.  Subscribe via email
I am working on a MIDI project using mido library in Python.
I see in the manual a meta message for time signature with value: notated_32nd_notes_per_beat which has a default value of 8.


<meta message time_signature numerator=4 denominator=4 clocks_per_click=24 notated_32nd_notes_per_beat=8 time=0>


Which makes sense. However, can I define it like:


<meta message time_signature numerator=4 denominator=4 clocks_per_click=24 notated_32nd_notes_per_beat=32 time=0>

Does this increase the display resolution when shown in a score/typesetting software? What is the usage of this please?
Comment
There are no comments made yet.
Accepted Answer Pending Moderation
0
Votes
Undo
Hello,

Don't know.

I've looked at the midi file spec, and it refers to this value, says the default value is 8, but doesn't really say what would happen if it was set as something else.

I've looked at a number of different midi files, and this value is always 8. I could look at a LOT more files, but .....

The 'resolution' of the midi file, as regards midi data, is set by the 'Division' parameter in the midi file header, and I looked at files with this set as 120 ticks per quarter note and also 480 ticks per quarter note, and both of these still had the 32nd notes per beat set as 8.

If you're really concerned about this, you might try changing an existing file from 8 to, say, 32, and see what happens?

However, if a quarter note is 120 ticks, then an 8th note is 60 ticks, a 16th will be 30 ticks, a 32nd note 15 ticks and a 64th note (is there such a thing ?) would be 7 or 8 ticks (would you notice the difference ?) and I assume this could still be resolved from normal midi data. If the 'division' setting was 480 (commonly used) then the note resolution could be even finer

Geoff
Comment
There are no comments made yet.
  1. more than a month ago
  2. MIDI Specifications
  3. # 1
Accepted Answer Pending Moderation
0
Votes
Undo
Strictly from a logical perspective, I would surmise that 4/4 time uses a quarter note for a beat. And eight (8) 32nd notes are the equivalent of that. And for notation, it is saying to print all eight (8) of the 32nd notes to represent the time duration of that one beat. So I would guess that the only meaningful variation would be to use some number less than eight as a sort of shorthand. So one could print one (1), two (2), or four (4) 32nd notes instead of the full eight (8).

Anybody who knows care to verify or correct?
Comment
There are no comments made yet.
  1. more than a month ago
  2. MIDI Specifications
  3. # 2
Accepted Answer Pending Moderation
0
Votes
Undo
It's unclear exactly how the "notated 32nd notes per MIDI quarter note" value was intended to behave. I haven't yet found any software that uses it for anything. I suggest you always set it to 8.


Details

Although the Python mido library calls it "notated 32nd notes per beat", be aware it is really "notated 32nd notes per MIDI quarter note (24 MIDI clocks)".

The MIDI File Specification says the following (from the Complete MIDI 1.0 Detailed Specification Document (1996), PDF page 139):

Time Signature

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.
(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.)

In a previous reply in thread "SMF time signature confusion", I wrote:

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.
Comment
There are no comments made yet.
  1. more than a month ago
  2. MIDI Specifications
  3. # 3
Accepted Answer Pending Moderation
0
Votes
Undo
I think this is to reference the MIDI clocks as a tempo. Tempo is most often the number of quarter notes in a minute. Then in standard notation of a 4/4 song, there are 8 x 1/32 notes in a beat. The same is usually true for 3/4 time. But in 6/8 notation (going against normal math) there are 3 x 1/8 notes in a 1/4 note. So there are then 12 x 1/32 notes in a beat if a tempo/beat has 3 x 1/8 note triplets. There are numerous, other variations of time in traditional music notation that can be described by this property (Cut-Time, 9/8, 12/8, 4/2, etc.).
Comment
There are no comments made yet.
  1. more than a month ago
  2. MIDI Specifications
  3. # 4
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!