MIDI messages

A channel number is an integer in the range [1, 16].

A channel index is one less than its corresponding channel number.

PrefixMessageTypeFollowed by
9.note_onchannel_index:u4, piano_key:u8, key_on_velocity:u8`
8.note_offchannel_index:u4, piano_key:u8, release_velocity:u8 (e.g. 64)
A.poly_key_pressurechannel_index:u4, ...
B.control_changechannel_index:u4, ...
C.program_changechannel_index:u4, ...
D.channel_pressurechannel_index:u4, ...
E.pitch_bendchannel_index:u4, ...

TODO

TODO

TODO

TODO

PrefixMessageTypeFollowed by
F10.timecode_quarter_1_of_8SMPTE frame number, lower nibble : u4
F11.timecode_quarter_2_of_8SMPTE frame number, upper nibble : u4
F12.timecode_quarter_3_of_8SMPTE second, lower nibble: u4
F13.timecode_quarter_4_of_8SMPTE second, upper nibble: u4
F14.timecode_quarter_5_of_8SMPTE minute, lower nibble: u4
F15.timecode_quarter_6_of_8SMPTE minute, upper nibble: u4
F16.timecode_quarter_7_of_8SMPTE hour, lower nibble: u4
F17.timecode_quarter_8_of_8SMPTE hour, upper nibble: u4
F07F.timecode_fullrecipient:u8 (0x7F for "all"), ...full SMPTE time code (TODO)...

PrefixMessageTypeFollowed byNotes
FF00.sequence_numberTODO
FF01.textlength + texte.g. "asdf"
FF02.copyright_noticelength + text
FF03.sequence_or_track_namelength + text
FF04.instrument_namelength + text
FF05.lyriclength + text
FF05.markerlength + texte.g. "where the beat drops"
FF07.cue_pointlength + texte.g. "Exeunt."
FF2001.midi_channel_prefixTODO
FF2F00.end_of_track
FF5103.set_tempomicroseconds per quarter note
FF5405.smpte_offsetu8 u8 u8 u8 u8(hour, minute, second, frame, frame_100th). This defines the SMPTE timecode at the start of the track chunk, and must occur (if at all) before any non-zero timestamps within the chunk.
FF5804.time_signaturenum, denom_exp, ticks per quarter note, notated_32nd_notes_per_quarter_note
FF5902.key_signatureTODO
FF7F.sequencer_specific_meta_eventlength + data

HexDecGMSoundSet
000.acoustic_grand_piano
...
0C12.marimba
...
7F127.gunshot

Channel 10 uses these instead of the sound set above:

HexDecGMPrecussionMap
2234.acoustic_bass_drum
...
5080.open_triangle

See midi.TimeSignature (TODO).

See music.KeySignature (TODO).

TODO