celtera / libremidi

A modern C++ MIDI 1 / MIDI 2 real-time & file I/O library. Supports Windows, macOS, Linux and WebMIDI.
Other
463 stars 52 forks source link

Writing multiple tracks to file is broken #63

Closed tmwsnrx closed 1 year ago

tmwsnrx commented 1 year ago

Attempting to write multiple tracks to a single MIDI file results in broken files that get rejected by most software. The reason is that the writer states it uses N tracks but puts the messages of all those tracks into a single MTrk, effectively omitting the other N-1 MTrks entries.