On 11/3/11 7:37 AM, Mathieu Bouchard wrote:
Symbols are never freed, so, it's better to use several separate
[text2d] to reduce the total number of symbols created.
Otherwise, as tens of thousands of symbols are created, not only it
takes RAM, but it also slows down the symbol table (this means it
slows down any uses of gensym).
Good point, Mathieu. Attached is a "stopwatch" I made a few years ago
that practices symbol conservation. It could easily be modified to do
timecode.
Phil Stone
pkstonemusic.com
#N canvas 651 43 543 587 10;
#X obj 0 1 cnv 15 150 30 empty empty empty 20 12 0 14 -228856 -66577
0;
#X obj 41 2 cnv 15 12 28 empty \$0-hour_colon : 0 13 0 24 -1 -241291
0;
#X obj 82 2 cnv 15 12 28 empty \$0-minute_colon : 0 13 0 24 -1 -241291
0;
#X obj 2 2 cnv 15 14 28 empty empty empty 0 15 0 24 -1 -241291 0;
#X obj 163 7 loadbang;
#X obj 11 125 f 0;
#X msg 98 527 label \$1;
#X obj 98 548 s \$0-hours;
#X msg 263 527 label \$1;
#X obj 263 548 s \$0-minutes;
#X msg 453 527 label \$1;
#X obj 453 548 s \$0-seconds;
#X obj 10 258 f 0;
#X obj 10 284 mod 60;
#X obj 10 340 f 0;
#X obj 40 340 + 1;
#X obj 10 361 mod 60;
#X obj 10 316 select 0;
#X obj 10 446 f 0;
#X obj 40 446 + 1;
#X obj 10 390 select 0;
#X obj 10 467 mod 99;
#X obj 10 490 makefilename %2d;
#X msg 47 125 0;
#X obj 176 29 r \$0-reset;
#X msg 130 202 0;
#X obj 10 232 spigot 0;
#X msg 78 184 0;
#X obj 11 185 t b a;
#X msg 11 208 1;
#X obj 261 346 symbol 0;
#X obj 257 255 spigot 0;
#X obj 163 54 t b b b b b b;
#X msg 313 227 0;
#X msg 283 227 1;
#X obj 236 228 sel 1;
#X text 278 53 seconds between restarts;
#X obj 383 306 s \$0-r-onoff;
#X msg 383 281 color \$1 0;
#X msg 383 257 13;
#X msg 413 257 16;
#X obj 10 37 r \$0-onoff;
#X obj 77 124 sel 0;
#X obj 10 60 t f f f;
#X obj 10 85 s \$0-color;
#X obj 383 210 r \$0-color;
#X obj 383 233 sel 0 1;
#X text 35 206 skip 1st bang;
#X obj 114 319 makefilename %02d;
#X obj 53 2 cnv 15 30 28 empty \$0-minutes -- 2 15 0 24 -1 -241291
0;
#X obj 95 2 cnv 15 54 28 empty \$0-seconds -- 2 15 0 24 -1 -241291
0;
#X obj 3 18 bng 10 250 50 0 \$0-reset empty empty 17 7 0 10 -262144
-1 -1;
#X obj 128 8 tgl 17 0 \$0-onoff \$0-r-onoff empty 17 7 0 10 -258699
-1 -262144 0 1;
#N canvas 0 22 336 383 resetDisplay 0;
#X obj 31 25 inlet;
#X msg 30 308 label \$1;
#X obj 30 335 s \$0-hours;
#X msg 101 308 label \$1;
#X obj 101 335 s \$0-minutes;
#X msg 182 308 label \$1;
#X obj 182 335 s \$0-seconds;
#X obj 30 67 symbol --;
#X obj 101 66 symbol --;
#X msg 174 204 label \$1;
#X msg 185 134 label \$1;
#X obj 185 161 s \$0-hour_colon;
#X obj 174 231 s \$0-minute_colon;
#X obj 172 65 symbol :;
#X connect 0 0 8 0;
#X connect 0 0 7 0;
#X connect 0 0 13 0;
#X connect 1 0 2 0;
#X connect 3 0 4 0;
#X connect 5 0 6 0;
#X connect 7 0 1 0;
#X connect 8 0 5 0;
#X connect 8 0 3 0;
#X connect 9 0 12 0;
#X connect 10 0 11 0;
#X connect 13 0 10 0;
#X connect 13 0 9 0;
#X restore 160 167 pd resetDisplay;
#X msg 165 527 label \$1;
#X obj 165 548 s \$0-hour_colon;
#X msg 343 527 label \$1;
#X obj 164 504 symbol :;
#X obj 341 424 symbol :;
#X obj 343 548 s \$0-minute_colon;
#X obj 10 415 t a b;
#X msg 416 424 0;
#X obj 257 279 t b b b b;
#X obj 416 453 makefilename %02d;
#X obj 88 389 makefilename %02d;
#X obj 14 2 cnv 15 27 28 empty \$0-hours -- 0 15 0 24 -1 -241291 0
;
#X obj 40 258 + 1;
#X obj 11 166 metro 1000;
#X text 265 16 - wraps to zero at 100 hours;
#X text 265 39 - doesn't remember partial;
#X text 265 75 - doesn't leak symbol table memory;
#X connect 4 0 32 0;
#X connect 5 0 35 0;
#X connect 5 0 67 0;
#X connect 6 0 7 0;
#X connect 8 0 9 0;
#X connect 10 0 11 0;
#X connect 12 0 13 0;
#X connect 13 0 17 0;
#X connect 13 0 48 0;
#X connect 13 0 66 0;
#X connect 14 0 16 0;
#X connect 15 0 14 1;
#X connect 16 0 15 0;
#X connect 16 0 20 0;
#X connect 16 0 64 0;
#X connect 17 0 14 0;
#X connect 18 0 21 0;
#X connect 19 0 18 1;
#X connect 20 0 60 0;
#X connect 21 0 19 0;
#X connect 21 0 22 0;
#X connect 22 0 6 0;
#X connect 23 0 67 0;
#X connect 24 0 32 0;
#X connect 25 0 15 0;
#X connect 25 0 19 0;
#X connect 25 0 66 0;
#X connect 26 0 12 0;
#X connect 27 0 26 1;
#X connect 28 0 29 0;
#X connect 28 1 26 0;
#X connect 29 0 26 1;
#X connect 30 0 6 0;
#X connect 30 0 8 0;
#X connect 30 0 54 0;
#X connect 31 0 62 0;
#X connect 32 0 5 0;
#X connect 32 1 25 0;
#X connect 32 2 53 0;
#X connect 32 3 27 0;
#X connect 32 4 34 0;
#X connect 32 5 23 0;
#X connect 33 0 31 1;
#X connect 34 0 31 1;
#X connect 35 0 31 0;
#X connect 38 0 37 0;
#X connect 39 0 38 0;
#X connect 40 0 38 0;
#X connect 41 0 43 0;
#X connect 42 0 27 0;
#X connect 43 0 44 0;
#X connect 43 1 42 0;
#X connect 43 2 5 0;
#X connect 45 0 46 0;
#X connect 46 0 39 0;
#X connect 46 1 40 0;
#X connect 48 0 10 0;
#X connect 54 0 55 0;
#X connect 56 0 59 0;
#X connect 57 0 54 0;
#X connect 58 0 56 0;
#X connect 60 0 18 0;
#X connect 60 1 57 0;
#X connect 61 0 63 0;
#X connect 62 0 33 0;
#X connect 62 1 30 0;
#X connect 62 2 58 0;
#X connect 62 3 61 0;
#X connect 63 0 10 0;
#X connect 64 0 8 0;
#X connect 66 0 12 1;
#X connect 67 0 28 0;
#X coords 0 -1 1 30 150 32 1 0 0;
_______________________________________________
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list