You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Standard MIDI Files (SMF) can specify their time base division in two formats:
ticks per quarter-note (aka notation-based)
negative SMPTE format + ticks per frame (aka time-based)
Currently, mido only supports the first format and creates invalid data when the second is present.
Spec
This information is stored in the Header Chunk of the SMF in the division field:
b'MThd'# Header chunk magic (4 bytes)<length># Length of the following data. At least 6 bytes. (1 byte)<ff># Format type (2 bytes representing a 16-bit word MSB first aka big-endian)<ntrks># Number of tracks (2 bytes representing a 16-bit word MSB first aka big-endian)<division># Time base division (2 bytes representing a 16-bit word MSB first aka big-endian)
The data is a 16-bit word (2 bytes big-endian).
The most significat bit represents the time base division format:
0: ticks-per quarter note.
The value is stored in the 15 other bits in big-endian form.
1: SMPTE.
Negative SMPTE format encodes the framerate onto the remaining 7 bits of the most significant byte.
The least significant byte encodes the tick per frames.
Challenges
mido always expects ticks_per_beat (sic) for the moment.
A thorough review of the implications is required before implementation.
Including, but not limited to:
Tempo determination
Time units conversions
Message time property
The text was updated successfully, but these errors were encountered:
Standard MIDI Files (SMF) can specify their time base division in two formats:
Currently,
mido
only supports the first format and creates invalid data when the second is present.Spec
This information is stored in the
Header Chunk
of the SMF in thedivision
field:The data is a 16-bit word (2 bytes big-endian).
The most significat bit represents the time base division format:
The value is stored in the 15 other bits in big-endian form.
Negative SMPTE format encodes the framerate onto the remaining 7 bits of the most significant byte.
The least significant byte encodes the
tick per frames
.Challenges
mido
always expectsticks_per_beat
(sic) for the moment.A thorough review of the implications is required before implementation.
Including, but not limited to:
Message
time propertyThe text was updated successfully, but these errors were encountered: