train~ restart

Apr 25, 2006 at 7:30pm

train~ restart

how would you synchronize 2 trains?

max v2;
#N vpatcher 265 862 1212 1160;
#P message 147 34 50 196617 500;
#B color 15;
#P user ezdac~ 133 176 177 209 0;
#P message 301 92 50 196617 600;
#P newex 209 131 84 196617 train~ 600 0.;
#B color 5;
#P message 23 96 50 196617 800;
#P newex 72 131 84 196617 train~ 800 0.;
#B color 5;
#P connect 5 0 0 0;
#P connect 1 0 0 0;
#P connect 0 0 4 0;
#P connect 2 0 4 1;
#P connect 5 0 2 0;
#P connect 3 0 2 0;
#P pop;

#25646
Apr 27, 2006 at 5:04am

#75712
Apr 27, 2006 at 9:39pm

While trying to solve this problem, I made this patch, which entertains the heck out of me.

#P window setfont “Sans Serif” 9.;
#P number 247 407 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 238 382 35 196617 timer;
#B color 5;
#P button 125 340 15 0;
#P newex 148 312 40 196617 change;
#B color 5;
#P user number~ 128 284 167 299 9 3 3 2 0. 0. 0 0. 250 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 126 255 47 196617 >~ 0.5;
#B color 5;
#P newex 128 222 40 196617 sync~;
#B color 5;
#P newex 126 363 37 196617 click~;
#B color 5;
#P user ezdac~ 105 434 149 467 0;
#P connect 4 1 5 0;
#P connect 3 0 4 0;
#P connect 2 0 3 0;
#P connect 5 0 6 0;
#P connect 6 0 7 1;
#P connect 6 0 7 0;
#P connect 6 0 1 0;
#P connect 7 0 8 0;
#P connect 1 0 0 1;
#P fasten 1 0 2 0 109 396 37 265 105 204;
#P connect 1 0 0 0;
#P window clipboard copycount 9;

mzed

#75713
Apr 27, 2006 at 10:09pm

I like this one, too.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 15 28 62 196617 receive~ fb;
#B color 5;
#P newex 96 202 48 196617 send~ fb;
#B color 5;
#P newex 15 105 39 196617 -~ 0.5;
#B color 5;
#P newex 15 79 40 196617 sync~;
#B color 5;
#P newex 15 130 42 196617 zerox~;
#B color 5;
#P user ezdac~ 31 200 75 233 0;
#P connect 1 1 4 0;
#P connect 1 1 0 1;
#P connect 1 1 0 0;
#P connect 3 0 1 0;
#P connect 2 0 3 0;
#P connect 5 0 2 0;
#P window clipboard copycount 6;

mzed

#75714
Apr 28, 2006 at 1:44am

#75715
Apr 28, 2006 at 10:33pm

On Apr 25, 2006, at 3:30 PM, Roman Thilenius wrote:

> how would you synchronize 2 trains?

Funny, it seems like if you set the interval to zero for a short period
of time, they sync, although it’s somewhat disruptive… :

max v2;
#N vpatcher 246 48 439 267;
#P window setfont “Sans Serif” 9.;
#P newex 37 44 43 196617 pipe 20;
#P message 3 97 26 196617 600;
#P message 90 97 26 196617 800;
#P message 90 45 17 196617 0;
#P message 37 23 26 196617 500;
#B color 15;
#P user ezdac~ 56 162 100 195 0;
#P newex 90 117 84 196617 train~ 600 0.;
#B color 5;
#P newex 3 117 84 196617 train~ 800 0.;
#B color 5;
#P connect 4 0 0 0;
#P connect 7 0 0 0;
#P connect 6 0 0 0;
#P connect 3 0 7 0;
#P connect 0 0 2 0;
#P fasten 3 0 4 0 42 41 95 41;
#P connect 4 0 1 0;
#P connect 7 0 1 0;
#P connect 5 0 1 0;
#P connect 1 0 2 1;
#P pop;

#75716
Apr 28, 2006 at 11:26pm

Use phasor~ and < ~ instead of train~ to make a pulse wave. Then it's
really easy to sync them.

Peter McCulloch

#75717
Apr 29, 2006 at 9:57am

Quote: David Stanford wrote on Fri, 28 April 2006 16:33
—————————————————-
> On Apr 25, 2006, at 3:30 PM, Roman Thilenius wrote:
>
> > how would you synchronize 2 trains?
>
> Funny, it seems like if you set the interval to zero for a short period
> of time, they sync, although it’s somewhat disruptive… :

yea well i tried several things like that – like
sending “0, n” to both trains – but the 0 cycle
does not start before the current cycle is over.
so …

#75718
Apr 29, 2006 at 10:00am

Quote: peter.mcculloch@gmail.com wrote on Fri, 28 April 2006 17:26
—————————————————-
> Use phasor~ and < ~ instead of train~ to make a pulse wave. Then it's
> really easy to sync them.
>
> Peter McCulloch

sampleexact? phasor does not take signals for the
phase input ..

#75719
Apr 29, 2006 at 1:09pm

Yeah, so the syncing is slower than you need. I was afraid that might
be the case.

On Apr 29, 2006, at 5:57 AM, Roman Thilenius wrote:

> yea well i tried several things like that – like
> sending “0, n” to both trains – but the 0 cycle
> does not start before the current cycle is over.
> so …

#75720
Apr 29, 2006 at 4:12pm

You don’t need two phasors~, or you can sync them using rate~, and the
“sync cycle” method. While this isn’t sample exact, in terms of
specifying the exact sample when the sync signal happens, rate~ is
generally more than adequate for any kind of sync problem. (try
setting the rate to a multiple of the phasor~, and you’ll see them snap
together)

Peter McCulloch

#P button 334 10 15 0;
#P window setfont “Sans Serif” 9.;
#P flonum 334 30 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 518 50 48 196617 loadbang;
#P newex 140 77 34 196617 +~ 3.;
#P newex 139 53 35 196617 *~ 2.;
#P newex 138 28 58 196617 cycle~ 0.1;
#P message 518 76 55 196617 sync cycle;
#P message 417 76 45 196617 sync off;
#P message 465 76 50 196617 sync lock;
#P flonum 266 39 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 374 59 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user scope~ 372 224 560 418 256 3 128 0. 2. 0 0. 0 0. 102 255 51 135
135 135 0;
#P newex 266 221 62 196617 dac~;
#P newex 318 139 39 196617 < ~ 0.2;
#P newex 318 110 59 196617 rate~ 0.75;
#P newex 266 111 39 196617 < ~ 0.2;
#P newex 266 79 58 196617 phasor~ 1.;
#P comment 372 30 54 196617 hard sync;
#P connect 17 0 16 0;
#P connect 16 0 1 1;
#P connect 16 0 3 0;
#P connect 7 0 3 1;
#P connect 15 0 11 0;
#P connect 1 0 2 0;
#P connect 1 0 3 0;
#P connect 3 0 4 0;
#P connect 10 0 3 0;
#P connect 9 0 3 0;
#P connect 11 0 3 0;
#P connect 14 0 1 0;
#P connect 13 0 14 0;
#P connect 12 0 13 0;
#P connect 8 0 1 0;
#P connect 4 0 5 1;
#P connect 4 0 6 0;
#P connect 2 0 5 0;
#P connect 2 0 6 0;
#P window clipboard copycount 18;

#75721

You must be logged in to reply to this topic.