Skip to main content

from_midi

Function from_midi 

Source
pub fn from_midi(bytes: &[u8]) -> Result<Stream>
Expand description

Reads a standard MIDI file into a score: music21’s converter.parse of one.

Every track with notes is a part. Notes are moved onto the nearest sixteenth or triplet eighth, gathered into chords and voices, cut into measures by the meters the file states (4/4 where it states none), tied across barlines and filled out with rests. Channel 10 is read as unpitched percussion, each key the instrument General MIDI gives it. A file timed in frames a second is refused, as is a format 2 file.

The bytes are the file’s own; the library opens no file.