this is my first post here, so first of all - Juce is great, after 8 years coding Java it helps make coming back to C++ a pleasure (mostly!).
I’ve found with MidiOutput that when using sendBlockOfMessages() the outcome is not always as I would expect. I could be my expectations that are off, not the code.
What I do is this - I queue up a NoteOn and a NoteOff, then if I use sendBlockOfMessages again for another pair of NoteOn/Off it works as long as the On message is scheduled for later than the previous Off. Otherwise it gets delayed until after the previous Off has finished, then generally ignored - the result is an output sequence of Note On, Off, Off.
I.e. sendBlockOfMessages won’t put a message at the head of the queue if another message is already scheduled, even if that message has a later dispatch time than the new one.
At least part of the problem is here:
while (mm->next != 0 && mm->next->message.getTimeStamp() <= eventTime)
mm = mm->next;
the queue insertion code looks ahead one step, ignoring the timestamp of the first message.
I have a fix, let me know if you want it posted. Likewise if I’m just using the code wrong.