GP as MIDI Clock Master

So hopefully this is the final version but feel free to play. The last resync version was crude after a bit more getting used to Pure Data, I have refined the patch and provided a clean phase lock to the Ableton Link timing so the lock to beats is now synchronised every beat and the sub-beat drift is imperceptible. The internal timing of PD turned out to be very good.

ableton-link-sync2-midi-slave.zip (755 Bytes) This has been updated see posts below.

In addition I have done some jitter measurements. This is running on an old G4 Mac Pro that has not been optimised for any audio work as it is a development machine and has browser, anti-virus and screen savers running. I only have Roland USB 2.0 MIDI interfaces on this machine.

The scope trace is looking at the end of the MIDI cable. In the top trace ‘T’ in the top left, is the trigger point and the trigger is compound, so that it only triggers on clocks and not the active sense messages. To the left of the trigger are the partial triggers from active sense. In the magnified section, the lower trace, the dashed vertical line is exactly one MIDI clock from the trigger point (rising edge after start bit). To the left of the dashed line is previous clock late jitter and to the right is this clock late jitter. Up to 1mS of jitter can be accounted for in the USB driver interface. There will be some small amount of jitter from the USB-MIDI interface, but this will be very small. The remainder of the jitter comes from the OS. It is fairly consistant with just one oddity, all remaining jitter is <2.38mS @ 120 BPM. This trace was running for about 10 minutes and every clock is in this trace.

I found no difference between connected and unconnected AL peers.

Using pd -nogui -realtime ableton-link-sync2-midi-slave.pd from a command line (or shortcut) will start PD without a GUI, this improves performance. The MIDI port may also be specified on the command line with the option -midiaddoutdev “your midi device”