When I open a simple midi file containing only four NOTE ON’s and no NOTE OFFs, the getNumEvents() function returns more events than I see using a hex editor (17). Using the getEventPointer() function to read events from the file then returns pointers to four unexpected NOTE OFF’s as well as the expected four NOTE ONs. The hex editor clearly shows only the four NOTE ONs and no NOTE OFFs. Is JUCE adding NOTE OFF’s for some reason? The file contains the following midi messages when using a hex editor:
MThd, MTrk, Set Tempo Command, 8 NOTE ONs, End Of Track
On further examination, I found the NOTE OFF’s are being “added” just before a NOTE ON is to be played if there is no NOTE OFF for that same note number. In other words, it looks like JUCE is enforcing monophonic playback of the midi file.