User Forum    :: Powered by YaBB
  « MIDI-OX User Forum - MIDI clock timing accuracy test »
Welcome, Guest. Please Login or Register.
May 30th, 2020, 2:02pm

Home Home Help Help Search Search Members Members Login Login Register Register

   MIDI-OX User Forum
   Questions and Discussion
(Moderator: Jamie OConnell)
   MIDI clock timing accuracy test
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: MIDI clock timing accuracy test  (Read 374 times)
New Member

MIDI-OX Rules!


Posts: 2
MIDI clock timing accuracy test
« on: Dec 31st, 2019, 12:20pm »
Quote Quote Modify Modify

hi as a new user, I was wondering if it's possible to use MIDIOX to show timing accuracy of clock devices. I can seen the clock messages in the monitor window but not sure if I can measure accuracy
thanks and best regards
IP Logged


Gender: male
Posts: 807
Re: MIDI clock timing accuracy test
« Reply #1 on: Dec 31st, 2019, 8:56pm »
Quote Quote Modify Modify

You will find an accuracy for transmission in the View / MTC Transport (default 5mS) for MTC.  
The Midi Clock (View / Midi Transport) you can see the tempo wavering with clock from an external sequencer/ drum machine.
But I don't know of anything in MidiOx to calculate the clock accuracy
You can log the in comming messages and copy it to a spread sheet. Or even just copy it from the input monitor window.
Use is to calc the tempo by clock interval and plot that to determine the variance.
- timing is driver dependent as the data is passed to the application with a timestamp and I think Jamie uses this to display on Midiox
I believe the driver timing stamps are when the status byte arrives and therefore should be sequential (larger number than the previous line) in MidiOx.
Midi timing clock's single byte message can insert itself into a system exclusive message.
I'm not sure it can insert  itself into a small message like note on or CC, but as all messages are either status alone or status then data and data is < 0x80 it should be possible.
I guess a driver could give the timing when the message is completely received which would make the clock come before the sysex.
If not, the difference in the timing mark of a Midi clock after a sysex could be less than the time for all the sysex to arrive.  
If you were just receiving clock by itself you should be able to see if there was drift.
Midi 1 is relatively slow protocol. Midi 2 , when they start making gear, is faster
Theoretical Midi 1 resolution is ...
baud rate 31250
8bits + 1start bit + 1 stop bit  
1/31250  x 10 = 0.00032 seconds per byte or 3125 clock messages per second
So best possible timing resolution is 1/3 ms and the time stamp resolution in MidiOx is mS
My understanding (and the way I have coded it over the years) is that midi clock is used as an averaging clock.  
That is, the application clock is internal and a number of midi clocks pull the sync into line.
Tempo change is not a problem as the expected midi clock error is only very small and any gross change is immediately seen as tempo change and the application follows it like a conductor (the human variety don't even come close).
Midi time code on the other hand will insert itself and the precision was always considered greater especially when syncing to vision.
These things are not meant for absolute time but to keep things lock together.
- video is 24 frames per second for film, 25 fps for here is Oz and all the weird  stuff in the US 30 fps, 30 drop frame etc
24 fps is 40mS per frame
So even with the slightly rough Midi clock, it has hardly been a problem as computers have sped up.
But with digital audio using a much higher clock, Midi 2 is here.
It sounds like you have a special problem. What precision do you need for the application?  
All the best.
« Last Edit: Jan 15th, 2020, 8:25pm by Breath » IP Logged
New Member

MIDI-OX Rules!


Posts: 2
Re: MIDI clock timing accuracy test
« Reply #2 on: Jan 1st, 2020, 10:56am »
Quote Quote Modify Modify

hi Thanks very much for such a detailed answer.  
I was working on some code to drive a simple MIDI clock generator for my studio and just wanted to test the accuracy of the output.  
I was having a look at the MIDI clock in the transport windows as you suggested and there was no tempo drift on incoming MIDI which was encouraging. It's just straight clock output at this stage.
Very interesting on the timing resolution of MIDI1. I was not sure how that was worked out so your calculkation explains it nicely
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

MIDI-OX User Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.