Forums > MaxMSP

timer?

May 26, 2006 | 10:12 pm

I have been searching for an object which would give bang if it receives no activity from the source in specified time, is there any?
My situation is this: I have webcam giving numbers and playing soundfiles, i would like to have it so that when the webcam detects no movement (no number changes) it would start fade out on sound.
Only thing what I found was by using delay object, so that when there is 0 it would start the delay object and then there is another bang for lets say in 1, so if there is movement it bangs the stop parameter in delay. but this is not very nice way to do it and there is lot of bangs happenings so I was wondering if there would be nicer way to do it?
Thanks!
And sorry for my n00bie questions, I just havent found out anything from the net or from max.

If you want to have look at the patch you can have it from here: http://tomi.dufva.fidisk.fi/vouvoucam.zip


May 26, 2006 | 10:24 pm

I had to make something like this once. Works like delay, but for much
longer intervals… Set delay time in seconds.
-lcc

max v2;
#N vpatcher 161 163 771 659;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 408 74 152 196617 arg 1 = delay time in seconds.;
#P comment 118 108 105 196617 start and reset count;
#P comment 151 194 124 196617 count 10ths of a second;
#P comment 152 138 100 196617 10th of a second;
#P comment 134 256 100 196617 10th of a second;
#P comment 115 332 100 196617 compair;
#P comment 116 371 100 196617 bang when true;
#N comlet delayed bang;
#P outlet 82 462 15 0;
#N comlet bang to delay;
#P inlet 82 35 15 0;
#P newex 290 106 35 196617 sel 0.;
#N comlet delay (seconds);
#P inlet 293 72 15 0;
#P newex 336 72 67 196617 loadmess $1;
#P newex 82 392 31 196617 t b 0;
#P button 82 433 15 0;
#P newex 82 368 32 196617 sel 1;
#P newex 82 330 27 196617 > 1.;
#P flonum 82 291 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 82 254 34 196617 / 10.;
#P number 82 226 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 82 134 58 196617 metro 100;
#N counter;
#X flags 0 0;
#P newobj 82 189 66 196617 counter;
#P newex 82 105 32 196617 t 1 0;
#P button 82 58 15 0;
#P comment 115 393 108 196617 output and stop metro;
#P connect 15 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 4 0;
#P fasten 11 1 4 0 108 422 266 422 266 126 87 126;
#P connect 4 0 3 0;
#P connect 3 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 8 0;
#P connect 8 0 9 0;
#P connect 9 0 11 0;
#P fasten 11 0 10 0 90 410;
#P connect 10 0 16 0;
#P fasten 14 1 8 1 320 317 104 317;
#P connect 2 1 3 2;
#P connect 13 0 14 0;
#P connect 12 0 14 0;
#P pop;


May 27, 2006 | 1:46 am

Delay does this. Each new bang starts the delay over again. With the metro
on below no bang will come out at the bottom. Turn the metro off and a bang
emerges 5 seconds after the most recent bang.

#P toggle 272 92 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 273 119 64 196617 metro 4000;
#P button 273 150 15 0;
#P button 271 204 15 0;
#P newex 272 176 61 196617 delay 5000;
#P connect 4 0 3 0;
#P connect 3 0 2 0;
#P connect 2 0 0 0;
#P connect 0 0 1 0;
#P window clipboard copycount 5;

Cheers,
Gary Lee Nelson
TIMARA Department
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


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