Thoughts on jitter and midi clocks

I’m a noob to this subject so I can ask some of obvious questions as user. Like what good is a midi clock?

I did some experiments to look at jitter at the received end, sending midi and osc signals in various ways. In a nutshell on my setup I got jitter values typically around 4ms, sometimes quite a lot more. Different routes gave different kinds of results - osc over a crossover cable was typical stable in long runs then patches of jitter. Over wifi, similar. I’d expect that. Surprisingly a usb-midi-midi-usb cable was worse with constant jitter up to 25ms. Makes me think the quaility of the cable matters.

My point is this - a 4ms jitter on a single note is not a problem. Or even 25ms once in a while. So if were using SPi to drive another synth with midi notes (I don’t want to, but imagine) that would work for me. Or triggering a secondary clock or sequence, that’s fine.

But thinking of the midi clock, that’s 24 pulses every beat i.e. about 42ms each. A 4ms jitter on that is significant. Can a software clock ever do this job? Not just thinking SPi here - it’s all the links in the chain.

But then I’m not sure what the midi clock is actually for. I’m quite interested in getting a hardware synth just to try it - those Volca’s look good - but if they rely on a midi clock for integration then it could spell trouble.

If it were me designing the hardware, I’d assume some jitter as it looks like a gravity issue, and in consuming a clock pulse do some moving window average to get to a ‘true’ value.

Can you point me in the right direction? Thanks.

If you are doing this on a Windows 10 PC, and have not stripped
out everything not needed to run SP, I’d consider doing it…

Mainly this would be in ‘Settings - Startup’, though you may
be able to disable some other stuff through ‘Control Panel - Services’

It is also possible to change the Priority given to the Sonic Pi executable.

This usually runs as a normal level task, but it can be bumped up to
‘above normal’, ‘high’ or ‘realtime’, with obvious penalty to other progs
in use… in case of lock-ups, a cold restart should return priorites to defaults.

https://www.tenforums.com/tutorials/89548-set-cpu-process-priority-applications-windows-10-a.html

I’m not a Guru, so I cant say this will solve or improve anything… and you may already have done all
this, in which case, sorry for ‘teaching granny to suck eggs’. :slight_smile:

Eli…

Thanks @Eli all advice is welcome. I don’t think this is a SPi issue, I get similar results using a DAW to send notes and clock. I suspect it’s a about the chain - and could be a cumulatave result or one element. Not easy to work out.

I feel it’s analogous to the latency issue with audio on computers. You can try to deal with that by trying to make it as low possible, which involves a lot of frustration and techie fuss, and often buying more things. Or like SPi, accept it and have an elegant model that works with it.

As I say, I understand what sending midi notes or osc messages is for, and it’s working fine, musically. But I don’t know what the midi clock (24 pulses per beat) is used for.

In VCV Rack, you can in principle use it to set a clock tempo, but the jitter makes it unstable (again not a SPi problem). That’s why I’m saying some kind of moving average would make it stable. There’s no drift in the timing, it averages out. E.g. at 100s the total error is still only a few ms.