This has been a topic for a while and there are some interesting threads on the matter, notably these Using GP as Midi Clock Master and MIDI clock questions - #8 by JeremyUnoMusic.
So I decided to have a go at improving the proposition of GP as clock master. Clearly the way to go is Ableton link for distribution, but when it comes to hardware MIDI is still king. The objective was to provide a MIDI clock output with Ableton Link so that it can be easily controlled via GP (or any other Ableton Link capable software).
@pianopaul did a patch for MAX that looked interesting. As i did not want to get the editor locked out after the trial, I looked at Pure Data , this was also mentioned in the thread above. It was free and open source. After a bit of digging I found Plug Data which is Pure Data in a VST wrapper, this looked perfect as it could be dropped into the wiring view. Unfortunately Plug Data does not work with external extensions like Pure Data . As I was going to use the Ableton Link extension in Pure Data, Plug Data was a non-starter.
As well as the clock, start and stop messages should be sent and it seemed like a good idea to send MIDI Active Sense when an Ableton link is present. This is the Pure Data patch (it is my first ever patch so may not be optimum) âŚ
ableton-link-midi-slave.zip (633 Bytes) This has been updated see the solution.
The abl_link~ object connects to an existing Ableton Link peer if present. The tempo is extracted and converted to mS for the PD internal clock (metro). The clock divides the mS interval by 24 to get the timing for the MIDI clock. Each clock bang will then send MIDI Clock (F8). The run state from Ableton Link is converted to MIDI Start (FA) and MIDI Stop (FC) and finally when the number of peers is not zero MIDI Active Sense messages are sent.
So to get this working with any Ableton Link peer, first install the required version of Pure Data. The funky part about this is that is can be installed on any machine on the local LAN, it does not need to be on your GP machine. Once installed you will need to add the Ableton Link Extension. Click the Help / Find Externals Menu in Pure Data. Search for abl* this should find the extension. Select the extension and click the Install button.
Load the ableton-link-midi-slave patch into Pure Data and configure the MIDI and audio, under the Media Menu dropdown. I have turned off the audio channels (not required) and selected the MIDI output I want to use. For testing I used good old loopMIDI, but any MIDI port visible to the OS can be selected. Donât forget to apply the settings.
If you now look at the output end of the MIDI cable (or virtual MIDI cable) you should now have a MIDI clock at 120BPM, this is the default clock for the abl_lnk~ object. Note that the Active Sense message is not in the trace.
Next start GP I am using an empty gig for this (no scripts). Then click the LINK button in the transport bar. If everything is working you will see a [1] in the link button this is the number of discovered peers.
Check the MIDI monitor and you should now have active sense messages in with the clock. These are sent every 250mS (the MIDI spec requires faster than 300mS).
If you have got this far, then adjusting the BPM in GP will change the MIDI clock out. This can be viewed in the Pure Data patch. So when setting the tempo in a rackspace or songs the PD MIDI slave will follow the changes.
This also works if you are setting the global tempo via a widget and the system actions block.
One final check is the GP Transport. Make sure that Sync Start/Stop with Ableton Link is enabled in the General Options tab, then clicking the Play button produces the following messages (clock and active sense filtered from the monitor).
Footnotes:
This produces a MIDI clock/sync stream and in its current form no additional MIDI data is in the stream. Additional data would need to be merged into the stream. It could easily be added to the Pure Data patch.
The Plug Data wrapper for Pure Data can include additional extensions but it must be recompiled to include the extensions, so could be made to work. However the libraries included by default in Plug Data may allow a plugin that uses the internal GP clock control, this would then allow a VST in GP to become a clock master. I have checked and you can get MIDI clocks thru GP MIDI Out blocks. Maybe another dayâŚ
Hardware MIDI Out Only final PD code GP as MIDI Clock Master - #18 by Spav