In terms of the data, each MIDI clock message is just a single number. There are four possibilities, depending on the state of the transport of a sequencer that is sending MIDI clock data.
MIDI Real Time Bytes:
248 = pulse
250 = sequencer start
251 = sequencer continue
252 = sequencer stop
We also need to set up our sequencer to send transport signals in the MIDI clock format. For Ableton Live, our MIDI preferences panel should look like the screenshot below in order to send MIDI clock on IAC Bus 1. For Logic / ProTools etc, the preferences will be similar.
Then, we can use the midirealtimein object in to intercept the MIDI clock bytes from the IAC Bus 1. When the play button is pressed in Live, the midirealtimein object will output 250. During playback, the value 248 will be sent 24 times per quarter note. When the stop button is pressed, the object will output 252. This information can be used to sync a PD patch to a MIDI clock source.
For example, this patch triggers at a rate of 16th notes: