XML Feeds

.

[maxmsp] Accurate LCD timer?

Stefan Tiedje Stefan-Tiedje at addcom.de
Sat Sep 8 15:15:16 MDT 2007


Rodrigo Constanzo schrieb:
> I cobbled together something from examples in archives for an LCD based timer.
> 
> I got it working alright, but it isn't accurate at all. The period
> between seconds is irregular, it sometimes skips numbers, if I set the
> milliseconds to work, it lags behind if I have other things
> running(making sure all the millisecond counts go through?)

I first wanted to point you to my St.opwatch abstraction, to find out 
you seem to have found an older version of it in the archives... ;-)

To make it working for you, you just need to make the metro bang faster. 
Then it wouldn't skip seconds. use something like 100 ms...

Then I'd just take a prepend set and a maximized message box instead of 
the LCD, way easier...

There is one advantage over the audiorate example. It doesn't need a 
snapshot (very expensive) and it would count correct if you switch off 
audio, and even would survive and keep the correct time if you set the 
computer to sleep... ;-)

Stefan

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P hidden newex 212 225 26 196617 t 1;
#P hidden newex 212 109 79 196617 sel 1;
#P hidden toggle 212 88 15 0;
#P newex 226 304 85 196617 prepend set;
#P window setfont "Sans Serif" 192.;
#P message 226 328 591 196800 00:00;
#P window setfont "Sans Serif" 9.;
#P hidden newex 212 66 38 196617 sel 32;
#P hidden newex 212 45 40 196617 key;
#P button 246 264 15 0;
#P hidden newex 212 203 61 196617 delay 1000;
#P hidden newex 212 180 61 196617 delay 1000;
#P hidden newex 212 157 61 196617 delay 1000;
#P hidden newex 212 134 61 196617 delay 1000;
#P button 102 114 100 0;
#P toggle 142 263 15 0;
#N vpatcher 37 161 772 816;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 190 337 55 196617 delay 500;
#N comlet bang to reset;
#P inlet 541 62 15 0;
#P newex 189 359 113 196617 t 0 0 0 0;
#P button 378 371 15 0;
#P toggle 509 281 15 0;
#P newex 509 302 58 196617 metro 100;
#P message 344 411 56 196617 0 \, 9 1000;
#P newex 344 431 40 196617 line;
#P newex 189 433 112 196617 sprintf %s%s:%s%s;
#P outlet 162 468 15 0;
#P newex 450 195 30 196617 sel 1;
#P toggle 450 174 15 0;
#P message 417 153 35 196617 set \$1;
#P newex 256 106 24 196617 0;
#P number 80 255 61 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 80 232 34 196617 set \$1;
#P newex 144 280 22 196617 +;
#P newex 444 411 37 196617 change;
#P newex 238 253 13 196617 0;
#P newex 238 231 40 196617 delay 5;
#P newex 187 153 38 196617 sel 1 0;
#P newex 307 180 44 196617 split 0 0;
#P newex 129 313 25 196617 gate;
#P newex 301 60 45 196617 loadbang;
#P newex 223 231 14 196617 0;
#P newex 271 202 46 196617 gate;
#P newex 271 180 31 196617 != 0;
#P button 363 83 15 0;
#P newex 406 411 35 196617 change;
#P newex 320 383 39 196617 <;
#P outlet 444 468 15 0;
#P window linecount 2;
#P newex 349 106 78 196617 expr $i1*3600 + $i2*60 + $i3;
#P window linecount 1;
#P comment 350 38 44 196617 Stop at:;
#N comlet seconds;
#P inlet 417 62 15 0;
#N comlet minutes;
#P inlet 383 62 15 0;
#N comlet stop at hours;
#P inlet 349 62 15 0;
#P outlet 189 468 15 0;
#P newex 47 360 38 196617 change;
#P button 172 417 15 0;
#P newex 291 411 31 196617 % 10;
#P newex 257 411 31 196617 / 10;
#P newex 223 411 31 196617 % 10;
#P newex 189 411 31 196617 / 10;
#P newex 129 360 35 196617 change;
#P newex 47 337 31 196617 / 60;
#P newex 88 384 31 196617 % 60;
#P newex 182 231 22 196617 1;
#P newex 88 337 31 196617 / 60;
#P newex 129 384 31 196617 % 60;
#P newex 129 337 31 196617 / 60;
#P outlet 129 468 15 0;
#P outlet 88 468 15 0;
#P outlet 47 468 15 0;
#P newex 182 192 40 196617 delay 5;
#P newex 156 231 22 196617 int;
#P newex 144 254 22 196617 -;
#P newex 190 106 24 196617 0;
#P newex 157 106 24 196617 1;
#P comment 37 494 32 196617 Hours;
#P message 124 174 34 196617 ticks;
#P toggle 124 131 15 0;
#P newex 124 153 61 196617 metro 100;
#P newex 124 192 55 196617 date;
#P comment 115 494 42 196617 Seconds;
#P comment 74 494 40 196617 Minutes;
#P newex 124 84 213 196617 route bang start stop continue 1 0;
#N comlet bang start stop continue 1 0;
#P inlet 124 61 15 0;
#P newex 88 360 35 196617 change;
#P window linecount 3;
#P comment 465 467 100 196617 1 for running \, 0 when stoptime reached;
#P window linecount 2;
#P comment 187 493 138 196617 connect this to a message box;
#P window linecount 1;
#P comment 156 494 27 196617 ticks;
#P fasten 3 0 26 0 93 380 86 380 86 334 52 334;
#P connect 26 0 33 0;
#P connect 33 0 18 0;
#P fasten 54 0 55 0 149 302 71 302 71 224 85 224;
#P fasten 5 3 56 0 228 103 219 103 118 103 118 250 85 250;
#P fasten 57 0 56 0 261 250 85 250;
#P connect 55 0 56 0;
#P fasten 27 0 23 0 134 380 127 380 127 334 93 334;
#P connect 23 0 3 0;
#P connect 3 0 25 0;
#P connect 25 0 19 0;
#P connect 4 0 5 0;
#P connect 5 0 10 0;
#P fasten 45 0 10 0 276 223 250 223 250 127 129 127;
#P fasten 13 0 10 0 162 127 129 127;
#P fasten 14 0 10 0 195 127 129 127;
#P connect 10 0 9 0;
#P connect 9 0 11 0;
#P connect 11 0 8 0;
#P fasten 24 0 48 0 187 308 134 308;
#P fasten 46 0 48 0 228 308 134 308;
#P connect 48 0 21 0;
#P fasten 57 0 21 0 261 333 134 333;
#P connect 21 0 27 0;
#P connect 27 0 22 0;
#P connect 27 0 20 0;
#P fasten 8 2 15 0 173 218 149 218;
#P connect 15 0 54 0;
#P connect 54 0 48 1;
#P fasten 17 0 16 0 187 224 161 224;
#P connect 16 0 15 1;
#P fasten 56 0 54 1 85 276 161 276;
#P fasten 5 4 13 0 261 103 162 103;
#P connect 5 1 13 0;
#P fasten 5 3 13 0 228 103 162 103;
#P fasten 48 0 61 0 134 333 167 333;
#P connect 8 2 16 1;
#P fasten 22 0 32 0 134 405 177 405;
#P fasten 25 0 32 0 93 405 177 405;
#P connect 65 0 32 0;
#P fasten 50 0 17 0 192 179 187 179;
#P connect 17 0 24 0;
#P fasten 10 0 50 0 129 149 192 149;
#P connect 69 0 68 0;
#P connect 70 0 68 0;
#P fasten 25 0 28 0 93 405 194 405;
#P connect 32 0 62 0;
#P connect 28 0 62 0;
#P connect 68 0 62 0;
#P connect 62 0 34 0;
#P fasten 5 5 14 0 294 103 195 103;
#P connect 5 2 14 0;
#P connect 47 0 70 0;
#P fasten 50 1 46 0 206 179 228 179;
#P fasten 25 0 29 0 93 405 228 405;
#P connect 29 0 62 1;
#P connect 68 1 62 1;
#P fasten 50 1 51 0 206 179 243 179;
#P connect 51 0 52 0;
#P connect 5 4 57 0;
#P fasten 60 0 57 0 455 218 484 218 484 103 261 103;
#P fasten 5 1 57 0 162 103 261 103;
#P fasten 22 0 30 0 134 405 262 405;
#P connect 30 0 62 2;
#P connect 68 2 62 2;
#P fasten 39 0 44 0 354 167 276 167;
#P connect 44 0 45 0;
#P fasten 22 0 31 0 134 405 296 405;
#P connect 31 0 62 3;
#P connect 68 3 62 3;
#P fasten 42 0 49 0 411 433 442 433 442 175 312 175;
#P connect 49 0 45 1;
#P fasten 52 0 41 0 243 286 325 286;
#P fasten 27 0 41 0 134 380 325 380;
#P connect 64 0 63 0;
#P connect 35 0 39 0;
#P fasten 43 0 39 0 368 101 354 101;
#P connect 39 0 41 1;
#P fasten 37 0 43 0 422 80 368 80;
#P fasten 36 0 43 0 388 80 368 80;
#P fasten 47 0 43 0 307 80 368 80;
#P connect 22 0 67 0;
#P connect 36 0 39 1;
#P fasten 41 0 42 0 325 402 411 402;
#P connect 37 0 39 2;
#P fasten 10 0 58 0 129 149 422 149;
#P fasten 52 0 53 0 243 286 449 286;
#P fasten 24 0 53 0 187 286 449 286;
#P connect 53 0 40 0;
#P connect 58 0 59 0;
#P fasten 5 0 59 0 129 103 455 103;
#P connect 59 0 60 0;
#P connect 66 0 65 0;
#P pop;
#P newobj 142 283 117 196617 p clock;
#P comment 115 219 80 196617 visual count off;
#P hidden connect 7 0 3 0;
#P hidden connect 7 0 15 0;
#P hidden fasten 15 0 2 0 217 257 147 257;
#P hidden connect 14 0 3 0;
#P hidden connect 14 0 4 0;
#P hidden connect 6 0 3 0;
#P hidden connect 6 0 7 0;
#P hidden connect 5 0 3 0;
#P hidden connect 5 0 6 0;
#P hidden connect 4 0 3 0;
#P hidden connect 4 0 5 0;
#P hidden fasten 14 1 2 0 286 257 147 257;
#P hidden fasten 14 1 8 0 286 257 251 257;
#P hidden connect 13 0 14 0;
#P hidden connect 10 0 13 0;
#P connect 12 0 11 0;
#P connect 1 4 12 0;
#P connect 8 0 1 4;
#P hidden connect 9 0 10 0;
#P connect 2 0 1 0;
#P window clipboard copycount 16;

-- 
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|\-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com




More information about the maxmsp mailing list