A more general chunk type, which is essentially a tagged union of HeaderChunk and TrackChunk.
HeaderChunk is the first chunk in a MIDI file. It gives information about the format of the other chunks.
MIDI represents the data of a complete MIDI file.
A MIDI event is any normal channel message or system message (except for system exclusive events).
A meta event is an event that is not regular MIDI message, used to send meta information. Not every meta event has to be supported or acted upon.
A system exclusive event is one unit ("packet") of a system exclusive message, which can be used as an escape to emit any arbitrary bytes.
A track chunk is a chunk that stores the actual data. It contains a number of track events.
A TrackEvent is a delta time coupled with either a MIDI event, a system exclusive event or a meta event.
The implementation (and some of the documentation) is based on this specification: https://www.cs.cmu.edu/~music/cmsip/readings/Standard-MIDI-file-format-updated.pdf