[sdiy] Bunching of MIDI clock messages
Tom Wiltshire
tom at electricdruid.net
Wed Sep 11 21:36:56 CEST 2013
When I've done this, I've counted MIDI clocks coming in, direct in the MIDI receive interrupt. Since MIDI clock is 24ppqn, the code counts 24 clocks before it toggles a timer. The time on the timer is then used to work out the quarter-note clock frequency (AKA "the beat", for you musical types ;-0). This gives me a method which is the same for synchronisation to an external analogue clock ( a "sync to this frequency" square wave input on the beat) and MIDI clock. As a side-effect, any variations within 24 clocks are ignored. It works well, until you start waving the "Rate/Tempo" control all over the place, when it gets a bit laggy, as is to be expected.
Tom
On 11 Sep 2013, at 12:32, rburnett at richieburnett.co.uk wrote:
> How common is "bunching up" of MIDI clock messages due to erratic transmission out of sequencers?
>
> For example, if I check for the reception of a MIDI clock message every 2 millisconds in a receiving instrument is that sufficient? (In theory 2ms polling rate should be sufficient to support tempo up to 1250 BPM provided the clock events arrive with even spacing!) Or do you think I should cater for the possibility of receiving as many as seven MIDI clock events transmitted "nut to butt" over my 2 millisecond polling period!?!?
>
> I know the MIDI specifications says that MIDI clock messages are to be transmitted with even spacing at the average tempo rate, but I don't think i've ever seen a maximum jitter specification anywhere? (I can just imagine sequencer software getting preempted in a Windows environment, and later transmitting all of the overdue MIDI data in an intense burst.)
>
> Any thoughts/experience on this?
>
> Cheers,
>
> -Richie,
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
More information about the Synth-diy
mailing list