Simple, yet accurate Transport based counter

Feb 7, 2010 at 5:38pm

Simple, yet accurate Transport based counter

I have a bunch of sequencers and drum machines running off a clock which sends out the numbers 1-16, where each number represents a 16th note. Right now I am using “metro 16n @quantize 16n @active 1 @autostart 1 @autostarttime 0.” This works perfectly for the quantization of bangs on beat with Live’s transport, but my problem is restarting my 1-16 counter every time I start/stop the transport. I have been semi-successful with using things such as the timepoint object (resetting counter when the transport is turned on), viewing transport state (resetting counter when transport is off), but nothing is perfectly accurate. “ is_playing” sends out more than simply a zero when the transport is off, and a 1 when it is on, it doubles the values and usually sends me a zero then a one when I turn it on and vice versa. Therefore all my resetting techniques result in intermittent numbers being skipped and sometimes the 2 starts on the 1 beat. I find myself stopping and restarting the transport about once every 3 or 4 times. I also have tried transport object and using the value output for my 16th note bangs, with no success. This needs to be as accurate as possible not just for the restart, but the bangs trigger many different musical events. Maybe i need to look into a phasor~ 16n???
I feel this should be fairly easy to get working 100% accurately. Any help/feedback would be appreciated, thanks.

Feb 7, 2010 at 8:04pm

I’ve also found that transport based counters are problematic.

So I’m using instead the ‘Raw Ticks’ from transport and apply following operations

[/ 120] -> [% 16] -> [+ 1]

This gives repeated numbers 1-16 exactly like a counter.
But with the crucial benefit of automatic reset at stop/restart.

Feb 8, 2010 at 12:18am

works great, I ended up putting the equation into an expr object and it worked like a charm! thanks for the help!

Feb 8, 2010 at 8:21pm

After some studying of MSP I found this BeatSync device the best timer yet:

– Pasted Max Patch, click to expand. –
Feb 8, 2010 at 9:48pm

Thanks for mentioning the plugsync~ object. As it provides a sample count (not shown in your patch) it’s obviously the most accurate timer regarding resolution. But in contrast to transport it does not provide an integer tick count which is useful for beat oriented midi timing in conjunction with the modulus operator.

Feb 1, 2012 at 7:26pm

Thanks for your solution broc, was just what I was looking for :)

May 31, 2013 at 3:56pm

I really like using the Raw Ticks method but the problem is you can’t restart to 0 from launching a scene. Any methods for that?

May 31, 2013 at 6:37pm

…listen for scene changes using the live api?

Jun 1, 2013 at 2:23am

Tried to do this in max with global transport but no ticks out the metro. Where am I wrong ? I know I’m a bit rusty with internal sync, or maybe that’s the hangover syndrome ?


– Pasted Max Patch, click to expand. –


Jun 1, 2013 at 5:54am

you still need the [transport] object for this, Stephane – metro->transport->/120 etc…

Jun 1, 2013 at 8:53am

This should reliably give you the correct count regardless of the starting time of the transport. (This is only designed for 4/4 meter. You’d need to do a bit more to make it work for different time signatures.)


– Pasted Max Patch, click to expand. –


Jun 1, 2013 at 2:05pm

…listen for scene changes using the live api?

Hm….I have a device that is listening to scene changes, but it’s also listening to clip_slot changes, perhaps I got the 2 mixed up.

Edit: Ah yes, the clip_slot_playing is what I was using, not scenes, cool.
That’ll cut down on some trouble:)


You must be logged in to reply to this topic.