Is it possible to synchronize two metro objects in Max/MSP without drift?
Hi everyone,
I’m experimenting with polyritmic in my patch and I’m having a problem synchronizing metro objects.
I have two separate metro objects connected to the transport. I start them simultaneously with the same toggle.
The first time everything seems fine, the bangs coincide.
If I change the BPM of one to create polyrhythms, or if I stop and restart both metros, the bangs no longer coincide and are slightly off.
The two metros are connected to a global transport. When I stop them together and restart them together, they are always slightly misaligned. The only way I’ve found to make them stay in time is to start the second metro with the first bang from the first metro… but obviously I’d like to avoid that.
I’ve tried the different attributes of metro, but I can’t figure it out.
My question is: is there a way to have two metro objects perfectly synchronized, sample-accurate, when starting them together or stopping and restarting them?
I know it’s generally recommended to use a single master clock with a counter, maybe, but I’d like to understand if this is an intrinsic limitation of the metro objects or if I’m doing something wrong in my patch...
Thanks so much to everyone!
>> The two metros are connected to a global transport
why? that makes things unneccesarily complicated imho. if you really need transport, link only one metro and the other ones to the first or main metro.
we don´t know what exactly you are doing, but to resync two free running #whatever you need to reset both (as opposed to having a pause/continue function). are you changing the speed of some of the metros while they run?
the best way to do what you want
regardless if you want to do it this way
is use ONE phasor
and [rate]
sample accurate and easy to reset/resync with one phasor
you can have as many polyrhythms as you want!!
//
and if you want to go down the rabbit hole..
What Wil said.
[phasor] with [rate] also allows for smooth tempo drift with perfect resync anytime you want.
we first should find out why this does not work for him, because normally things like that work out of the box, since longer than audio exists in max. :)
"My question is: is there a way to have two metro objects perfectly synchronized, sample-accurate, when starting them together or stopping and restarting them?"

sub-sampleaccurate, that is.
Thanks a lot for the suggestions. I’m currently trying the method proposed by
WIL using phasor~ and rate~, but I’m still having trouble keeping them synchronized.
When I change the value of rate~ via its right inlet and then set it back to 1, it ends up phase-shifted relative to the phasor~.
So even when both are nominally back to the same rate, they are no longer aligned.
Am I missing something about how rate~ handles phase or synchronization?
Thanks a lot in advance!
[rate] has multiple options. Read the "sync" section in the documentation:
https://docs.cycling74.com/reference/rate~/
I have altered your patch accordingly, Livingston.
sub-sampleaccurate, that is.
I think the question was how to resynchronize metros properly when you change some of their intervals while running.
EDIT:
Nevermind, OP indeed mentioned a sync issue even when restarting metros.
This works for me for the metro resync:

Also this is relevant:
https://docs.cycling74.com/userguide/sample_accurate_messages/
Am I missing something about how rate~ handles phase or synchronization?Try rate sync lock:1
rebang click after setting poly rate
yeah!
"how to resynchronize metros properly when you change some of their intervals while running."
yeah, that was a common math problem and can only be solved if you know how the time value has been changed while running (for example by a linear ramp from interval 1 to interval 2).
otherwise turning it off and on again should properly restart things of course.
patch by baek above shows how easy it also works for a possible "main" metro during operation.