Forums > MaxMSP

Change tempo of metro immediately?

November 2, 2012 | 2:09 pm

This seems like a classic in the forums, but I have yet to find a definitive answer: Is there a way to make the metro object change its tempo (almost) immediately upon receiving a new tempo value?

As it is now, it waits until the next "tick" before changing tempo, which is kind of long if you have a tempo of, say, 1000. Some suggested the tempo object would react immediately upon a new tempo value, but as far as I can tell, it also waits until the next value.

November 2, 2012 | 2:30 pm

If you send a bang to tempo right after you change its speed, then it will restart with the right tempo.


November 2, 2012 | 2:32 pm

I tried that, but that becomes very messy when you are changing the tempo with a slider. I’d rather avoid the re-trig, but it seems that might be difficult.

November 2, 2012 | 2:48 pm

sorry not to be more help but I recall that someone (?) recently posted a patch in relation to a ‘bang’ timing/quantizing issue, which used the delay object in a novel/unique way; kind of like a sample-and-hold effect. Maybe you could trawl the forum for that? You could use the delay object to quantize bangs from your slider+trigger.


November 2, 2012 | 4:41 pm

If you are willing to go into the signal domain, train~ has the behavior that you search for.

November 2, 2012 | 11:11 pm

to change the speed immediately you simply need to stop and restart it.

i´d use a [t 1 f 0] for that job.


November 3, 2012 | 12:00 am

Here’s an absurdly hard way:

– Pasted Max Patch, click to expand. –

November 3, 2012 | 3:02 pm

Thanks for the suggestions, Roman and mzed, but Roman – your example still means there will be an extra trigger every time the slider slides from one tempo to another (resulting in lots "extra triggers"), and mzed, you are definitely the closest to getting this to work, but it seems there are some inconsistencies, resulting in the trigger not always immediately catching on to the tempo change.

November 3, 2012 | 3:10 pm

With the metro object, you are going to have either one problem or the other. You need to "debounce" the slider input in some way, which will inevitably introduce some latency.

I wrote an elaborate solution called tempo~ that is in the cnmat downloads: It uses phasor~ as the timing mechanism. As jvkr says, train~ will also work.

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