Midi clock in midimessagesequence?


#1

Do I adjust thread priority (or adjust anything else) for creating clock messages with reliable 1ms resolution via
midimessagesequence::addEvent() ?


#2

You could use Juce’s Time::getMillisecondCounterHiRes which, at least on Windows, which gives close to microsecond resolution. I’m sure it’s at least that accurate on the other platforms. The MidiMessageCollector uses getMillisecondCounterHiRes to timestamp incoming messages.


#3

Well that’s helpful information, thank you! A couple more questions:

Is there an example of using the same timer for outgoing messages?

Has the timing been tested on Windows 7? As far as I know Windows 7 has the same driver architecture as XP/2000 for MIDI, but I don’t know the details.


#4

I’ve not explicitly tested it, but if it wasn’t working properly on windows 7, I’m sure it would have been obvious by now because other code wouldn’t work properly.