Expand description
MIDI files read into scores and scores written as MIDI: midi::from_midi
and midi::to_midi.
Modules§
- base
- music21’s
midi.base: MIDI as bytes, below any score. - translate
- music21’s
midi.translatebelow any score object: what a note, a chord, an instrument, a meter, a key or a tempo is as MIDI events, and what such events say back, timed in ticks.
Structs§
- Export
Options - How
to_midiwrites a score: music21’sstreamToMidiFilekeywords. - Midi
Note - A note event in quarter-length time.
Constants§
- DEFAULT_
TICKS_ PER_ QUARTER - Default MIDI pulses per quarter note used by the byte import/export helpers.
Functions§
- from_
midi - Reads a standard MIDI file into a score: music21’s
converter.parseof one. - from_
tracks - Reads tracks’ data, each after its chunk’s tag and length, as a score,
as
from_midireads a file of them: music21’smidiTracksToStreams. - midi_
notes_ from_ stream - Extracts MIDI note events from a stream.
- part_
from_ track - Reads one track’s data as a part, alone, with no conductor before it:
music21’s
midiTrackToStream. A track with no notes comes back as a part holding its meters, keys, tempos and instruments, in no measures. - read_
midi_ bytes - Reads note events from a Standard MIDI File.
- read_
midi_ bytes_ with_ tempo - Reads note events and the first tempo marking from a Standard MIDI File.
- stream_
from_ midi_ notes - Builds a stream from MIDI note events.
- to_midi
- Writes a stream as a standard MIDI file, as music21’s
streamToMidiFile(...).writestr()writes it. - write_
midi_ bytes - Writes a minimal format-0 Standard MIDI File.