Forums > MaxMSP

variable timer

March 11, 2008 | 11:34 am

hi,

i need to build a variable metronome or clocker, which sends out its bangs with a random variable time interval of e.g. 390 to 470 ms.
is that possible? has anyone an idea how to do it?
i thought of using the setclock object – would that work?

thanks a lot and kind regards!

lena


March 11, 2008 | 12:04 pm

You mean like this?

#P button 116 311 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 143 277 84 196617 lp.tata 390 470;
#P toggle 116 198 30 0;
#P newex 116 249 60 196617 metro 470;
#P connect 0 0 3 0;
#P fasten 0 0 2 0 121 272 148 272;
#P fasten 2 0 0 1 148 298 236 298 236 237 171 237;
#P connect 1 0 0 0;
#P window clipboard copycount 4;

Lp.tata is in the Litter Starter Pack. The Litter Extras folder also has examples (in the X-amples subfolder) of doing this with more sophisticated (and appropriate) RNGs.

As always, URL below.

Best — Peter


March 11, 2008 | 12:14 pm

On 11 Mar 2008, at 12:34, Lena wrote:

>
> hi,
>
> i need to build a variable metronome or clocker, which sends out
> its bangs with a random variable time interval of e.g. 390 to 470 ms.
> is that possible? has anyone an idea how to do it?
> i thought of using the setclock object – would that work?
>

like this?

#P toggle 111 141 15 0;
#P window setfont "Sans Serif" 9.;
#P number 159 140 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 111 255 22 0;
#P window linecount 1;
#P newex 129 210 37 196617 + 390;
#P newex 129 186 58 196617 random 80;
#P newex 111 163 58 196617 metro 500;
#P connect 5 0 0 0;
#P fasten 2 0 4 0 134 233 199 233 199 129 164 129;
#P connect 4 0 0 1;
#P connect 0 0 3 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P window clipboard copycount 6;


March 11, 2008 | 4:57 pm

On Mar 11, 2008, at 4:34 AM, Lena wrote:
> i need to build a variable metronome or clocker, which sends out its
> bangs with a random variable time interval of e.g. 390 to 470 ms.

Here’s a solution using only standard objects:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P hidden newex 507 141 48 196617 loadbang;
#P hidden message 540 164 26 196617 470;
#P hidden message 507 164 26 196617 390;
#P comment 470 173 26 196617 High;
#P comment 425 173 26 196617 Low;
#P number 376 305 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 734 387 1042 696;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 61 137 27 196617 + 1;
#P comment 221 26 56 196617 High bound;
#N comlet TIme;
#P outlet 28 252 15 0;
#P newex 61 117 23 196617 abs;
#P newex 41 197 27 196617 t b i;
#P newex 28 221 27 196617 +;
#P newex 74 72 27 196617 t b i;
#P newex 61 96 27 196617 -;
#P newex 28 158 43 196617 random;
#N comlet High bound;
#P inlet 124 26 15 0;
#N comlet new Random;
#P inlet 28 26 15 0;
#N comlet High bound;
#P inlet 204 26 15 0;
#P window linecount 0;
#P comment 45 26 65 196617 new Random;
#P comment 141 26 56 196617 Low bound;
#P connect 3 0 5 0;
#P connect 5 0 8 0;
#P connect 9 0 8 0;
#P connect 8 0 11 0;
#P fasten 4 0 9 0 129 190 46 190;
#P connect 9 1 8 1;
#P fasten 4 0 6 0 129 46 66 46;
#P connect 7 0 6 0;
#P connect 6 0 10 0;
#P connect 10 0 13 0;
#P connect 13 0 5 1;
#P fasten 2 0 7 0 209 56 79 56;
#P connect 7 1 6 1;
#P pop;
#P newobj 376 267 105 196617 p rangeRandom;
#P number 470 188 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 423 188 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 361 347 15 0;
#P toggle 361 198 15 0;
#P newex 361 239 60 196617 metro 470;
#P comment 429 161 64 196617 -= Range =-;
#P hidden connect 12 0 10 0;
#P hidden connect 12 0 11 0;
#P hidden connect 11 0 5 0;
#P hidden connect 10 0 4 0;
#P connect 6 0 7 0;
#P fasten 6 0 1 1 381 294 494 294 494 231 416 231;
#P connect 1 0 3 0;
#P connect 1 0 6 0;
#P connect 4 0 6 1;
#P connect 5 0 6 2;
#P connect 2 0 1 0;
#P window clipboard copycount 13;

Chris Muir
cbm@well.com


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