Expand description
music21’s midi.base: MIDI as bytes, below any score.
The numbers MIDI writes (big-endian and seven bits to a byte), the kinds of message, one event read off the front of a track’s data or written back, a track’s chunk, and a file’s header. What an event holds is kept as music21 keeps it: a type, a channel counted from one, and two parameters, the first of which may be bytes.
Structs§
- File
Header - A file’s header: its format, how many tracks follow, how it counts time.
- Read
Event - What reading an event sets on it: its type always, its channel and
second parameter where the message has them, and its first parameter
(music21’s
data). - Track
Event - One event of a track as read: the ticks since the one before, the
running status it was read under and left, and what it set,
Nonewhere too few bytes were left to read one.
Enums§
- Division
- How a file counts time.
- Event
Type - What kind of message an event is, with its value in music21’s enum.
- Midi
Data Error - What goes wrong with MIDI’s bytes, in music21’s words.
- Param
- What an event’s parameter or data holds.
Constants§
- CHANNEL_
MODE_ MESSAGES - The controller numbers that set a channel’s mode.
- CHANNEL_
VOICE_ MESSAGES - The messages of a channel, by music21’s names: the high nibble of the status byte.
- FILE_
HEADER - A file header’s tag.
- METAEVENT_
MARKER - The byte a meta event starts with.
- META_
EVENTS - The meta events, by the byte after
METAEVENT_MARKER;UNKNOWNstands for any other. - SYSEX_
EVENTS - The two system exclusive events.
- TRACK_
HEADER - A track chunk’s tag.
Functions§
- event_
bytes - An event as MIDI writes it, from its type, its channel counted from one
and its two parameters: music21’s
MidiEvent.getBytes. - file_
header_ bytes - A file’s header, for a format, a count of tracks and ticks to a quarter note.
- get_
number - The first
lengthbytes as one big-endian number, and what follows. - get_
variable_ length_ number - A number written seven bits to a byte, high bit set on all but the last, and what follows it.
- is_
note_ off - Whether an event ends a note: a note-off, or a note-on of no velocity.
- is_
note_ on - Whether an event sounds a note: a note-on of some velocity.
- name_of
- The name a table gives a value.
- parse_
channel_ voice - A channel message off the front of
bytes, and how many bytes it took: music21’sMidiEvent.parseChannelVoiceMessage. - pitch_
bend - A pitch bend of so many cents, within a range of so many semitones, as the event’s two parameters, least significant first; beyond the range it is the range’s end.
- put_
number - A number as
lengthbig-endian bytes, only its low bytes kept where it is longer. - put_
numbers_ as_ list - Numbers as one byte each, a negative one counted down from 256.
- put_
variable_ length_ number - The fewest bytes MIDI writes a number in, seven bits to a byte.
- read_
event - One event off the front of
bytes, and how many of them it took: music21’sMidiEvent.read. A data byte first is read under the running statuslast, or a note-on’s where there is none. Fewer than two bytes are no event, andNone. - read_
file_ header - A file’s header off the front of
bytes, and what follows it. A format past 1 is refused, after it is read: the error carries it. - read_
track - A track’s chunk off the front of
bytes: its data, its events and what follows it. An event music21 cannot read is skipped, as music21 skips it. - sort_
order - Where an event goes among those at one time: a note-off first, then a pitch bend, then the rest.
- split_
number - A number’s low
lengthbytes, and the rest of it with those taken away: music21’sgetNumbergiven a number. - status_
after - The running status after an event whose first byte is
first: a status byte other than a meta event’s replaces it. - track_
bytes - A track’s chunk around its data.
- track_
events - A track’s data read into events.
Type Aliases§
- Midi
Result - Shorthand for this module’s results.