Forums > Max For Live

Simple, yet accurate Transport based counter

February 7, 2010 | 5:38 pm

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), Live.observer viewing transport state (resetting counter when transport is off), but nothing is perfectly accurate. "Live.observer 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.


February 7, 2010 | 8:04 pm

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.


February 8, 2010 | 12:18 am

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


February 8, 2010 | 8:21 pm

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

– Pasted Max Patch, click to expand. –

February 8, 2010 | 9:48 pm

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.


February 1, 2012 | 7:26 pm

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


May 31, 2013 | 3:56 pm

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 | 6:37 pm

…listen for scene changes using the live api?


June 1, 2013 | 2:23 am

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 ?

<code>

– Pasted Max Patch, click to expand. –

</code>


June 1, 2013 | 5:54 am

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


June 1, 2013 | 8:53 am

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.)

<code>

– Pasted Max Patch, click to expand. –

</code>


June 1, 2013 | 2:05 pm

…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:)


Viewing 12 posts - 1 through 12 (of 12 total)