audio

@audio/midi-parse1.0.3

Standard MIDI file parser

Standard MIDI file parser — tracks, tempo map, note events

Status
calibrated
Updated
Family
midi, 5 packages under it
Category
codecs
Licence
MIT
Dependencies
none
Downloads
1,171 last month
Tests
6 in audiojs/midi's CI, passed at f69aeb0,

SMF 0/1 reader: header, tracks, running status, variable-length deltas, tempo map (all set-tempo events applied across tracks), and a flattened note list with absolute seconds.

import parse from '@audio/midi-parse'

let { tracks, tempos, notes, duration } = parse(smfBytes)

parse(buf: ArrayBuffer|Uint8Array) → { format, division, tracks, tempos, notes, duration }

Each note: { time, duration, midi, velocity, channel, track } — time/duration in seconds, velocity normalized 0..1. tempos: [{ tick, time, usPerBeat }].

Install