Expand description
Standard MIDI Files, read as a table of their events.
The parser is written by hand over the file’s bytes: MThd and MTrk chunks,
variable-length deltas, running status, sysex and meta events. Every length the
file states is checked against the bytes that remain before it is used, so a
corrupt or hostile file is an error rather than a panic or an allocation sized by
a number the file made up.
The rows are an eager DataFrame (one per event) made lazy, as ORC and Excel are:
MIDI files are kilobytes. What is not a row — the header, the tracks’ names, the
tempo range — is a MidiSummary, carried to the dataset for the Info panel’s
MIDI tab.
Structs§
- Event
- One event as the file has it, its bytes borrowed from the file.
- Midi
Summary - What a MIDI file says besides its events, for the Info panel’s MIDI tab.
- Smf
- A Standard MIDI File, parsed.
- Track
Summary - One track, as the Info panel lists it.
Enums§
Constants§
- MAX_
EVENTS - The most events read, across every file of one open. Each is a row of a dozen columns held in memory.
- MAX_
FILE_ BYTES - The largest file read. MIDI files are kilobytes; a song with a dense controller stream is a few megabytes.
Functions§
- build
- The table and the summary for parsed files;
namesare their files, written to afilecolumn when there is more than one. - detail
- The MIDI tab: the header, timing and tempo, then the tracks; for a directory of songs, the totals, then the files that could not be read.
- looks_
like_ midi - Whether
headstarts like a MIDI file:MThdwith its length of 6, or a RIFFRMIDwrapper. - note_
name - A note number as a name, middle C (60) as
C4. - notes
- What the open has to say about the events: notes that never end, and files that could not be read.
- parse
- Parse a Standard MIDI File (or one in a RIFF
RMIDwrapper). - read_
midi - Read
pathsas one table of events, with afilecolumn when there is more than one.