[maxmsp] Accurate LCD timer?
Rodrigo Constanzo
rodrigo.constanzo at gmail.com
Fri Sep 7 13:32:02 MDT 2007
- Previous message: [maxmsp] OSC problem. I need advice
- Next message: [maxmsp] Re: Accurate LCD timer?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I've been trying to build a 'control' patch for a composition I wrote some years ago. 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?) Also, sometimes the numbers in the LCD seem to draw on the edge, or off the LCD itself, with no way to get them back. (The patch worked fine at first, now all the numbers are off the LCD screen) There has to be an easier way to get a large, accurate, effecient timer going in max. I'm surprised there isn't a default object for this, since stopwatches are pretty standard in contemporary music. Also, I was going to use the time produced from the stopwatch to mute/unmute audio running through the patch as well. I looked at timeline, but decided it'd be simpler to use a long select object(select 0 28 32 45 58 112 etc..) being fed by the raw seconds of the timer. Is there a more effecient way to do this? Basically I'd like to get the structural part of the patch as effecient as possible, to leave CPU free for audio based concerns. And of course the timer needs to be airtight, since everything else is based on it. heres the patch(the numbers are drawing off the LCD screen at the moment) max v2; #N vpatcher 208 95 1403 788; #P window setfont "Sans Serif" 9.; #P hidden comment 41 610 100 196617 cound down by lcd?; #P hidden newex 253 129 44 196617 togedge; #P hidden newex 253 108 38 196617 sel 32; #P hidden newex 253 87 40 196617 key; #P button 287 264 15 0; #N vpatcher 777 370 1761 990; #P outlet 245 529 15 0; #P inlet 325 33 15 0; #P window setfont "Sans Serif" 9.; #P message 82 123 34 196617 0 0 0; #P message 40 101 70 196617 255 255 255; #P newex 40 61 45 196617 loadbang; #P newex 462 397 27 196617 i; #P message 223 188 72 196617 frgb \$1 \$2 \$3; #P message 143 189 73 196617 brgb \$1 \$2 \$3; #P button 462 378 15 0; #P newex 362 387 71 196617 prepend write; #P message 462 418 95 196617 clear \, moveto 3 \$1; #P message 298 402 58 196617 font 1 215; #P newex 324 63 98 196617 route size frgb brgb; #P connect 8 0 9 0; #P fasten 8 0 10 0 45 94 87 94; #P fasten 9 0 5 0 45 164 148 164; #P fasten 0 2 5 0 387 131 148 131; #P fasten 10 0 6 0 87 150 228 150; #P fasten 0 1 6 0 358 106 228 106; #P connect 5 0 12 0; #P connect 2 0 12 0; #P connect 3 0 12 0; #P connect 1 0 12 0; #P connect 6 0 12 0; #P fasten 0 0 1 0 329 291 303 291; #P connect 11 0 0 0; #P fasten 0 3 3 0 416 241 367 241; #P fasten 0 3 4 0 416 274 467 274; #P fasten 5 0 4 0 148 371 467 371; #P connect 4 0 7 0; #P connect 7 0 2 0; #P fasten 0 0 7 1 329 188 484 188; #P pop; #P newobj 267 305 73 196617 p format_text; #P user lcd 267 326 636 243 1 1 0 0 0; #N vpatcher 186 266 824 779; #P window setfont "Sans Serif" 9.; #P window linecount 0; #P newex 162 89 63 196617 loadmess 0.5; #P window linecount 1; #P message 168 191 37 196617 \$1 50; #P newex 168 213 32 196617 line~; #P newex 151 237 27 196617 *~; #P window linecount 0; #P message 120 191 37 196617 \$1 50; #N comlet right; #P outlet 151 265 15 0; #N comlet left; #P outlet 103 265 15 0; #P newex 120 213 32 196617 line~; #P newex 103 237 27 196617 *~; #N comlet pan control (0. = left \, 1. = right); #P inlet 120 69 15 0; #N comlet audio in; #P inlet 103 69 15 0; #P flonum 120 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P window linecount 1; #P newex 120 144 37 196617 abs 0.; #P flonum 168 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 120 122 27 196617 - 1.; #P flonum 120 89 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0; #P connect 5 0 7 0; #P connect 7 0 9 0; #P connect 6 0 0 0; #P connect 0 0 1 0; #P connect 1 0 3 0; #P connect 15 0 4 0; #P connect 3 0 4 0; #P connect 4 0 11 0; #P connect 11 0 8 0; #P connect 8 0 7 1; #P connect 5 0 12 0; #P connect 12 0 10 0; #P connect 0 0 2 0; #P connect 15 0 2 0; #P connect 2 0 14 0; #P connect 14 0 13 0; #P connect 13 0 12 1; #P pop; #P hidden newobj 1102 344 33 196617 p pan; #N vpatcher 186 266 824 779; #P window setfont "Sans Serif" 9.; #P window linecount 0; #P newex 162 89 63 196617 loadmess 0.5; #P window linecount 1; #P message 168 191 37 196617 \$1 50; #P newex 168 213 32 196617 line~; #P newex 151 237 27 196617 *~; #P window linecount 0; #P message 120 191 37 196617 \$1 50; #N comlet right; #P outlet 151 265 15 0; #N comlet left; #P outlet 103 265 15 0; #P newex 120 213 32 196617 line~; #P newex 103 237 27 196617 *~; #N comlet pan control (0. = left \, 1. = right); #P inlet 120 69 15 0; #N comlet audio in; #P inlet 103 69 15 0; #P flonum 120 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P window linecount 1; #P newex 120 144 37 196617 abs 0.; #P flonum 168 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 120 122 27 196617 - 1.; #P flonum 120 89 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0; #P connect 5 0 7 0; #P connect 7 0 9 0; #P connect 6 0 0 0; #P connect 0 0 1 0; #P connect 1 0 3 0; #P connect 15 0 4 0; #P connect 3 0 4 0; #P connect 4 0 11 0; #P connect 11 0 8 0; #P connect 8 0 7 1; #P connect 5 0 12 0; #P connect 12 0 10 0; #P connect 15 0 2 0; #P connect 0 0 2 0; #P connect 2 0 14 0; #P connect 14 0 13 0; #P connect 13 0 12 1; #P pop; #P hidden newobj 1055 344 33 196617 p pan; #N vpatcher 186 266 824 779; #P window setfont "Sans Serif" 9.; #P window linecount 0; #P newex 162 89 63 196617 loadmess 0.5; #P window linecount 1; #P message 168 191 37 196617 \$1 50; #P newex 168 213 32 196617 line~; #P newex 151 237 27 196617 *~; #P window linecount 0; #P message 120 191 37 196617 \$1 50; #N comlet right; #P outlet 151 265 15 0; #N comlet left; #P outlet 103 265 15 0; #P newex 120 213 32 196617 line~; #P newex 103 237 27 196617 *~; #N comlet pan control (0. = left \, 1. = right); #P inlet 120 69 15 0; #N comlet audio in; #P inlet 103 69 15 0; #P flonum 120 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P window linecount 1; #P newex 120 144 37 196617 abs 0.; #P flonum 168 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 120 122 27 196617 - 1.; #P flonum 120 89 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0; #P connect 5 0 7 0; #P connect 7 0 9 0; #P connect 6 0 0 0; #P connect 0 0 1 0; #P connect 1 0 3 0; #P connect 15 0 4 0; #P connect 3 0 4 0; #P connect 4 0 11 0; #P connect 11 0 8 0; #P connect 8 0 7 1; #P connect 5 0 12 0; #P connect 12 0 10 0; #P connect 0 0 2 0; #P connect 15 0 2 0; #P connect 2 0 14 0; #P connect 14 0 13 0; #P connect 13 0 12 1; #P pop; #P hidden newobj 1008 344 33 196617 p pan; #P hidden newex 1010 62 78 196617 loadmess 1 1 1; #P window linecount 2; #P hidden newex 1015 38 63 196617 loadmess 0.5; #P user multiSlider 1089 90 32 15 0. 1. 1 2936 15 0 0 2 0 0 0; #M frgb 0 0 0; #M brgb 255 255 255; #M rgb2 127 127 127; #M rgb3 0 0 0; #M rgb4 37 52 91; #M rgb5 74 105 182; #M rgb6 112 158 18; #M rgb7 149 211 110; #M rgb8 187 9 201; #M rgb9 224 62 37; #M rgb10 7 114 128; #P user multiSlider 1052 90 32 15 0. 1. 1 2936 15 0 0 2 0 0 0; #M frgb 0 0 0; #M brgb 255 255 255; #M rgb2 127 127 127; #M rgb3 0 0 0; #M rgb4 37 52 91; #M rgb5 74 105 182; #M rgb6 112 158 18; #M rgb7 149 211 110; #M rgb8 187 9 201; #M rgb9 224 62 37; #M rgb10 7 114 128; #P user multiSlider 1015 90 32 15 0. 1. 1 2936 15 0 0 2 0 0 0; #M frgb 0 0 0; #M brgb 255 255 255; #M rgb2 127 127 127; #M rgb3 0 0 0; #M rgb4 37 52 91; #M rgb5 74 105 182; #M rgb6 112 158 18; #M rgb7 149 211 110; #M rgb8 187 9 201; #M rgb9 224 62 37; #M rgb10 7 114 128; #P window linecount 1; #P hidden newex 1102 318 35 196617 *~ 1.; #P hidden newex 1055 318 35 196617 *~ 1.; #P hidden newex 1009 263 76 196617 unpack 0. 0. 0.; #P hidden newex 1008 318 35 196617 *~ 1.; #P user multiSlider 1009 110 118 138 0. 1. 3 2937 3 0 5 2 0 0 0; #M frgb 0 0 0; #M brgb 255 255 255; #M rgb2 127 127 127; #M rgb3 0 0 0; #M rgb4 37 52 91; #M rgb5 74 105 182; #M rgb6 112 158 18; #M rgb7 149 211 110; #M rgb8 187 9 201; #M rgb9 224 62 37; #M rgb10 7 114 128; #N vpatcher 133 217 1060 518; #N comlet audio out; #P outlet 28 204 15 0; #P window setfont "Sans Serif" 9.; #P window linecount 1; #P newex 28 179 27 196617 *~; #P window linecount 0; #P newex 45 155 32 196617 line~; #P message 45 133 37 196617 \$1 20; #P window linecount 1; #P message 68 109 14 196617 0; #P window linecount 0; #P message 45 109 14 196617 1; #N comlet audio in; #P inlet 28 48 15 0; #P newex 49 68 53 196617 sel 5 6 7; #N comlet time input; #P inlet 49 48 15 0; #P connect 2 0 7 0; #P connect 7 0 8 0; #P connect 3 0 5 0; #P fasten 4 0 5 0 73 128 50 128; #P connect 5 0 6 0; #P connect 6 0 7 1; #P connect 0 0 1 0; #P pop; #P hidden newobj 1102 291 43 196617 p part3; #N vpatcher 133 217 1001 512; #N comlet audio out; #P outlet 28 204 15 0; #P window setfont "Sans Serif" 9.; #P window linecount 1; #P newex 28 179 27 196617 *~; #P window linecount 0; #P newex 45 155 32 196617 line~; #P message 45 133 37 196617 \$1 20; #P window linecount 1; #P message 68 109 14 196617 0; #P window linecount 0; #P message 45 109 14 196617 1; #N comlet audio in; #P inlet 28 48 15 0; #P newex 49 68 53 196617 sel 5 6 7; #N comlet time input; #P inlet 49 48 15 0; #P connect 2 0 7 0; #P connect 7 0 8 0; #P fasten 4 0 5 0 73 128 50 128; #P connect 3 0 5 0; #P connect 5 0 6 0; #P connect 6 0 7 1; #P connect 0 0 1 0; #P pop; #P hidden newobj 1055 291 43 196617 p part2; #P hidden toggle 988 377 15 0; #P hidden newex 1008 377 33 196617 dac~; #N vpatcher 133 217 945 502; #N comlet audio out; #P outlet 28 204 15 0; #P window setfont "Sans Serif" 9.; #P window linecount 1; #P newex 28 179 27 196617 *~; #P window linecount 0; #P newex 45 155 32 196617 line~; #P message 45 133 37 196617 \$1 20; #P window linecount 1; #P message 68 109 14 196617 0; #P window linecount 0; #P message 45 109 14 196617 1; #N comlet audio in; #P inlet 28 48 15 0; #P newex 49 68 53 196617 sel 5 6 7; #N comlet time input; #P inlet 49 48 15 0; #P connect 2 0 7 0; #P connect 7 0 8 0; #P connect 3 0 5 0; #P fasten 4 0 5 0 73 128 50 128; #P connect 5 0 6 0; #P connect 6 0 7 1; #P connect 0 0 1 0; #P pop; #P hidden newobj 1008 291 43 196617 p part1; #P hidden newex 253 221 61 196617 delay 1000; #P hidden newex 253 198 61 196617 delay 1000; #P hidden newex 253 175 61 196617 delay 1000; #P hidden newex 253 152 61 196617 delay 1000; #P button 143 114 100 0; #P toggle 183 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 1000; #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 14 0 10 0 195 127 129 127; #P fasten 13 0 10 0 162 127 129 127; #P fasten 45 0 10 0 276 223 250 223 250 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 connect 5 1 13 0; #P fasten 5 4 13 0 261 103 162 103; #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 70 0 68 0; #P connect 69 0 68 0; #P fasten 25 0 28 0 93 405 194 405; #P connect 68 0 62 0; #P connect 28 0 62 0; #P connect 32 0 62 0; #P connect 62 0 34 0; #P connect 5 2 14 0; #P fasten 5 5 14 0 294 103 195 103; #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 68 1 62 1; #P connect 29 0 62 1; #P fasten 50 1 51 0 206 179 243 179; #P connect 51 0 52 0; #P fasten 5 1 57 0 162 103 261 103; #P fasten 60 0 57 0 455 218 484 218 484 103 261 103; #P connect 5 4 57 0; #P fasten 22 0 30 0 134 405 262 405; #P connect 68 2 62 2; #P connect 30 0 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 68 3 62 3; #P connect 31 0 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 fasten 43 0 39 0 368 101 354 101; #P connect 35 0 39 0; #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 24 0 53 0 187 286 449 286; #P fasten 52 0 53 0 243 286 449 286; #P connect 53 0 40 0; #P fasten 5 0 59 0 129 103 455 103; #P connect 58 0 59 0; #P connect 59 0 60 0; #P connect 66 0 65 0; #P pop; #P newobj 183 283 117 196617 p clock; #P user panel 1009 84 118 170; #X brgb 255 255 255; #X frgb 0 0 0; #X border 1; #X rounded 0; #X shadow 0; #X done; #P hidden comment 936 152 61 196617 volume/pan; #P hidden comment 935 294 67 196617 mute/unmute; #P comment 156 219 80 196617 visual count off; #P hidden comment 41 592 100 196617 add timeline?; #P hidden connect 35 0 7 0; #P hidden connect 10 0 7 0; #P hidden connect 9 0 7 0; #P hidden connect 8 0 7 0; #P hidden fasten 35 1 6 0 321 146 321 255 188 255; #P hidden fasten 11 0 6 0 258 255 188 255; #P connect 6 0 5 0; #P hidden connect 33 0 34 0; #P hidden connect 34 0 35 0; #P hidden connect 35 0 8 0; #P hidden connect 8 0 9 0; #P hidden connect 9 0 10 0; #P hidden connect 10 0 11 0; #P connect 5 4 31 0; #P connect 31 0 30 0; #P hidden fasten 35 1 32 0 321 146 321 255 292 255; #P connect 32 0 5 4; #P hidden connect 12 0 18 0; #P hidden connect 18 0 27 0; #P hidden fasten 14 0 13 0 993 395 1005 395 1005 374 1013 374; #P hidden connect 27 0 13 0; #P hidden fasten 28 0 13 0 1060 368 1013 368; #P hidden fasten 29 0 13 0 1107 368 1013 368; #P hidden connect 26 0 17 0; #P hidden connect 17 0 19 0; #P hidden connect 25 0 22 0; #P hidden fasten 22 0 27 1 1020 107 1004 107 1004 338 1036 338; #P hidden connect 27 1 13 1; #P hidden fasten 28 1 13 1 1083 368 1036 368; #P hidden fasten 29 1 13 1 1130 368 1036 368; #P hidden fasten 19 0 18 1 1014 285 1052 285 1052 312 1038 312; #P hidden fasten 25 0 23 0 1020 58 1094 58 1094 80 1057 80; #P hidden connect 15 0 20 0; #P hidden connect 20 0 28 0; #P hidden fasten 23 0 28 1 1057 107 1004 107 1004 338 1083 338; #P hidden fasten 19 1 20 1 1047 285 1099 285 1099 312 1085 312; #P hidden fasten 25 0 24 0 1020 58 1094 58 1094 80 1094 80; #P hidden connect 16 0 21 0; #P hidden connect 21 0 29 0; #P hidden fasten 24 0 29 1 1094 107 1004 107 1004 338 1130 338; #P hidden fasten 19 2 21 1 1080 285 1147 285 1147 312 1132 312; #P pop;
- Previous message: [maxmsp] OSC problem. I need advice
- Next message: [maxmsp] Re: Accurate LCD timer?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
