Expand description
Standard MIDI Files as a table of events. A hand-written parser (MThd/MTrk
chunks, variable-length deltas, running status, sysex, meta events) checks every
stated length against the remaining bytes, so a hostile file errors rather than
panics or over-allocates. Rows are a small eager frame made lazy; the header, track
names and tempo range go to a MidiSummary for Info’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§
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 a RIFF
RMIDwrapper). Strict where leniency would fake a whole table: an overrunning track, a cut event, a data byte without status, or fewer tracks than the header says are errors. Non-MTrkchunks and anything after the promised tracks are skipped; a missing End of Track is fine. - read_
midi - Read
pathsas one events table (with afilecolumn for several). One unreadable file is an error; among several, unreadable ones are skipped and named in the summary unless all fail. One file’s bytes are held at a time.