The win32 midiIn callback timestamps the events with Time::getMillisecondCounter() , but MidiMessageCollector uses Time::getMillisecondCounterHiRes()
The problem is that those two counters are quite different here, their values differ by approximately 0.3 second ! As a consequence the sampleNumber of incoming midi messages is not correctly evaluated.
Should the win32 midi code use the HiRes counter or should the MidiMessageCollector use the normal counter ? It seems that the coremidi version uses getMillisecondCounterHiRes , and the linux ALSA version uses getMillisecondCounter
Just wanted to mention two warnings after a change:
1>c:\devel\juce\modules\juce_audio_devices\native/juce_win32_Midi.cpp(202): warning C4244: '+=' : conversion from 'double' to 'juce::uint32', possible loss of data
1>c:\devel\juce\modules\juce_audio_devices\native/juce_win32_Midi.cpp(210): warning C4244: '=' : conversion from 'const double' to 'juce::uint32', possible loss of data