This project was always intended to be a piece of a larger project. It has now been incorporated into my digital piano with any changes being made there.
There are already JavaScript MIDI parsers out there (and they are probably better than this one will ever be) but I haven't ever dealt directly with binary formats before so that's why I'm writing this.
And protobuf doesn't count because they do all the heavy lifting for you.
References and resources used:
https://midimusic.github.io/tech/midispec.html
https://michd.me/jottings/midi-message-format-reference/
http://midi.teragonaudio.com/tech/midispec/run.htm
http://midi.teragonaudio.com/tech/midifile/vari.htm
https://www.ccarh.org/courses/253/handout/vlv/
https://nickfever.com/music/midi-cc-list
https://anotherproducer.com/online-tools-for-musicians/midi-cc-list/
https://www.personal.kent.edu/~sbirch/Music_Production/MP-II/MIDI/midi_file_format.htm
http://www.somascape.org/midi/tech/mfile.html
https://ccrma.stanford.edu/~craig/14q/midifile/MidiFileFormat.html
https://inspiredacoustics.com/en/MIDI_note_numbers_and_center_frequencies
https://www.recordingblogs.com/wiki/midi-key-signature-meta-message
https://en.wikipedia.org/wiki/Circle_of_fifths
https://stackoverflow.com/questions/42689052/unrecognized-status-byte-in-midi-file