Hi everybody,
Ever since I first started programming with Pd, I have had a vague anxiety about symbols, or to be more exact, symbol table growth. Now, I've never run into a problem in real life, but the worry is still there, nagging at me, ever since I read on a Pd-list thread that each symbol takes up permanent, un-reclaimable space in a symbol table. So, I've always been wary about employing many symbols, or having some dynamic process that creates many symbols on the fly.
Attached is [maketime], a lovely little timer/stopwatch. I've long since lost track of who made it, so I'm sorry can't give you well-deserved credit here. At any rate, it creates *at least* one symbol per second (probably more, I'm not sure if each [makefilename] generates a new symbol, but I'm guessing it does). This makes me nervous, as I have no idea what the symbol table capacity is, or how to see how "full" it is. It seems likely that this abstraction would crash eventually.
A) Is it true that [maketime] would continually grow the symbol table?
B) Is it possible to tell how full the symbol table is? How much memory is allocated to it in the first place?
C) Wouldn't it be nice to have some truly transient symbols, that could be abstraction-local, or at least, re-usable?
Cheers,
Phil Stone
#N canvas 300 22 311 311 12; #X obj 36 10 cnv 15 220 40 empty *time-display-cnv-in* 0:00:00 20 18 0 36 -1 -241291 0; #X msg 35 235 ; *time-display-cnv-in* label $1; #X obj 69 155 + 1; #X obj 35 154 f; #X obj 35 111 metro 1000; #X msg 133 111 0; #X obj 35 83 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X floatatom 35 182 5 0 0 0 - - -; #X obj 133 85 loadbang; #N canvas 0 22 450 459 sec-to-time-symbol 0; #X obj 24 17 inlet; #X obj 50 337 outlet; #X msg 84 258 set $1; #X obj 50 312 makefilename not-set-yet; #X floatatom 50 258 0 0 0 0 - - -; #X msg 171 177 set $1; #X obj 84 205 makefilename not-set-yet; #N canvas 0 22 450 300 format 0; #X obj 24 20 inlet; #X obj 24 224 outlet; #X obj 91 105 + 1; #X obj 24 47 t f f; #X obj 24 171 makefilename 0%d; #X obj 176 171 makefilename %d; #X obj 91 80 >= 10; #N canvas 0 22 450 300 gate2 0; #X obj 44 237 spigot; #X obj 44 262 outlet; #X obj 123 238 spigot; #X obj 123 263 outlet; #X obj 21 30 inlet; #X obj 288 38 inlet; #X obj 359 129 loadbang; #X obj 93 194 unpack 0 0; #X obj 288 62 route 0 1 2; #X msg 350 95 0 1; #X msg 319 127 1 0; #X msg 288 166 0 0; #X connect 0 0 1 0; #X connect 2 0 3 0; #X connect 4 0 0 0; #X connect 4 0 2 0; #X connect 5 0 8 0; #X connect 6 0 11 0; #X connect 7 0 0 1; #X connect 7 1 2 1; #X connect 8 0 11 0; #X connect 8 1 10 0; #X connect 8 2 9 0; #X connect 9 0 7 0; #X connect 10 0 7 0; #X connect 11 0 7 0; #X restore 24 133 pd gate2; #X connect 0 0 3 0; #X connect 2 0 7 1; #X connect 3 0 7 0; #X connect 3 1 6 0; #X connect 4 0 1 0; #X connect 5 0 1 0; #X connect 6 0 2 0; #X connect 7 0 4 0; #X connect 7 1 5 0; #X restore 84 177 pd format; #X obj 171 84 % 60; #X obj 85 82 / 60; #X obj 85 115 int; #X obj 84 142 % 60; #X obj 24 115 int; #X obj 24 82 / 3600; #X obj 24 44 t f f f; #X obj 84 234 makefilename %%d:%s; #X obj 171 153 makefilename %%s:%s; #N canvas 0 22 450 300 format 0; #X obj 24 20 inlet; #X obj 24 224 outlet; #X obj 91 105 + 1; #X obj 24 47 t f f; #X obj 24 171 makefilename 0%d; #X obj 176 171 makefilename %d; #X obj 91 80 >= 10; #N canvas 0 22 450 300 gate2 0; #X obj 44 237 spigot; #X obj 44 262 outlet; #X obj 123 238 spigot; #X obj 123 263 outlet; #X obj 21 30 inlet; #X obj 288 38 inlet; #X obj 359 129 loadbang; #X obj 93 194 unpack 0 0; #X obj 288 62 route 0 1 2; #X msg 350 95 0 1; #X msg 319 127 1 0; #X msg 288 166 0 0; #X connect 0 0 1 0; #X connect 2 0 3 0; #X connect 4 0 0 0; #X connect 4 0 2 0; #X connect 5 0 8 0; #X connect 6 0 11 0; #X connect 7 0 0 1; #X connect 7 1 2 1; #X connect 8 0 11 0; #X connect 8 1 10 0; #X connect 8 2 9 0; #X connect 9 0 7 0; #X connect 10 0 7 0; #X connect 11 0 7 0; #X restore 24 133 pd gate2; #X connect 0 0 3 0; #X connect 2 0 7 1; #X connect 3 0 7 0; #X connect 3 1 6 0; #X connect 4 0 1 0; #X connect 5 0 1 0; #X connect 6 0 2 0; #X connect 7 0 4 0; #X connect 7 1 5 0; #X restore 171 116 pd format; #X connect 0 0 14 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 3 0; #X connect 5 0 6 0; #X connect 6 0 15 0; #X connect 7 0 6 0; #X connect 8 0 17 0; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 7 0; #X connect 12 0 4 0; #X connect 13 0 12 0; #X connect 14 0 13 0; #X connect 14 1 9 0; #X connect 14 2 8 0; #X connect 15 0 2 0; #X connect 16 0 5 0; #X connect 17 0 16 0; #X restore 35 208 pd sec-to-time-symbol; #X text 176 111 reset time; #X text 57 83 start; #X connect 2 0 3 1; #X connect 3 0 2 0; #X connect 3 0 7 0; #X connect 4 0 3 0; #X connect 5 0 7 0; #X connect 5 0 3 1; #X connect 6 0 4 0; #X connect 7 0 9 0; #X connect 8 0 5 0; #X connect 9 0 1 0;