Expand description
MIDI Time Code (MTC) — quarter-frame encode/decode of an hh:mm:ss:ff
timecode.
A full SMPTE timecode is streamed as eight quarter-frame messages, each a
0xF1 status byte followed by one data byte of the form 0iiidddd: the
upper three bits iii select which of the eight nibbles (piece 0..=7) is
carried in the lower four bits dddd. Reassembling all eight pieces yields
the frame; the top piece also carries the high hour bit and a 2-bit frame-rate
code. This module encodes a Timecode to the eight data bytes and decodes
them back, allocation-free.
Structs§
Enums§
- Frame
Rate - SMPTE frame rate, encoded in the 2-bit rate field of MTC piece 7.
Functions§
- decode_
quarter_ frames - Decode eight MTC quarter-frame data bytes back into a
Timecode. - encode_
quarter_ frames - Encode a timecode into the eight MTC quarter-frame data bytes (the byte
that follows each
0xF1status). Elementihas the form(i << 4) | nibble.