Indexing of events in MidiMessageSequence

I’m creating an app involving MIDI processing. The documentation of MidiMessageSequence::getIndexOf() states that this function simply returns the index of an event in the sequence, so I assumed that the events are sequenced in order from 0 to getNumEvents - 1. However, upon debugging I have discovered that the index of the first event in the sequence is 2040594432. Am I doing something wrong, or are these events not indexed as I had expected?

unless there are 2040594432 messages in the sequence, then there is something wrong. Looking at the internals of MidiMessageSequence::getIndexOf() we can see it just uses OwnedArray::indexOf() for the lookup, and according to the docs:

Returns: the index at which the object was found, or -1 if it's not found

But the value you are seeing doesn’t seem to be an unsigned -1 value of any type… one of the great things about JUCE is that you can step into the code to diagnose things. I suggest doing that.