Clox… a healthy ticker…

How to sync to Live’s clock for step sequencing:

Last time we spoke I said I would show a good clock that would stick to Live’s transport. Well, here it is:

This is a utility version of the Adlais 1.3.4 clock.

Of course, that picture doesn’t quite tell the whole story, but, the plugsync~ object is what makes this clock tick (thanks to Daniel from http://ldmdesign.org for explaining this to me). Plugsync~ reports what Live’s transport is doing, reporting Start/stop, bars, beats and stuff. The important outlet (for our needs) is outlet 7, which reports clock ticks.

1nd – Dotted whole note – 2880 ticks
1n – Whole note – 1920 ticks
1nt – Whole note triplet – 1280 ticks
2nd – Dotted half note – 1440 ticks
2n – Half note – 960 ticks
2nt – Half note triplet – 640 ticks
4nd – Dotted quarter note – 720 ticks
4n – Quarter note – 480 ticks
4nt – Quarter note triplet – 320 ticks
8nd – Dotted eighth note – 360 ticks
8n – Eighth note – 240 ticks
8nt – Eighth note triplet – 160 ticks
16nd – Dotted sixteenth note – 180 ticks
16n – Sixteenth note – 120 ticks
16nt – Sixteenth note triplet – 80 ticks
32nd – Dotted thirty-second note – 90 ticks
32n – thirty-second note – 60 ticks
32nt – thirty-second-note triplet – 40 ticks
64nd – Dotted sixty-fourth note – 45 ticks
64n – Sixty-fourth note – 30 ticks
128n – One-hundred-twenty-eighth note – 15 ticks

Knowing that there are 1920 ticks/whole note or 480 ticks/quarter note makes translating ticks to note values easy as:

All I needed to do was divide or multiply outlet 7 to get my clock ticking nicely:

This shows inside the p Maffs patcher…

The clock sel input takes the note value selected on the UI translated to multiplier values. I also used them to flip the switch so that values above 4n (which = 1) divide the ticks instead of multiply. This gives a count that always reflects Live’s transport, starting at zero when Live restarts. The modulo (%) divides this clock by the number of steps – although the high number is always 0 which needs fixing later…

I could have had one of these algorithms for each clock division but I can’t stand the mess… although I can see it being useful for seriously messing with the clock outputs (more on that another time).

The only other bits are adding a shift integer for (you guessed it) shifting the step sequencer, and a / object for a clock multiplier, so you can get some very long steps…

After all that there is a patcher for all the direction stuff which I’ll save for now (there are some unusual, randomish variants in Adlais, and I going to explore those some more in the future) and a swing patcher which is probably the most stupid way of implementing swing imaginable – but it works…

Later….