Maybe the attatched patch will help?
derek
et wrote:
hello,
I have an array in a patch that I need to use multiple times,
[table $0-array]
... I want to resize that array
[56]
|
[;$0-array resize $1]
doesn't work because the $0-array is not interpreted as an array name.... is
there a workable way to resize an array named with $0 ?
Etienne
--
derek holzer :::
http://www.umatic.nl
---Oblique Strategy # 36:
"Consult other sources
-promising
-unpromising"
#N canvas 189 180 813 482 10;
#N canvas 174 17 547 348 loader 0;
#X obj 68 36 inlet bang_to_load_file;
#X obj 68 285 outlet file_length_in_samples;
#X obj 68 63 openpanel;
#X obj 68 253 soundfiler;
#X msg 90 141 0;
#X msg 90 193 add $1;
#X msg 68 88 set read -resize $1;
#X text 250 117 this is a little trick;
#X text 251 131 to make a compound message;
#X text 252 144 with two $-n arguments!;
#X msg 68 222 read -resize /home/derek/workshop_patches/magic_loop.wav
1002-sound ;;
#X obj 68 114 t b b a;
#X obj 90 167 makefilename $0-sound;
#X obj 203 63 table $0-sound;
#X connect 0 0 2 0;
#X connect 2 0 6 0;
#X connect 3 0 1 0;
#X connect 4 0 12 0;
#X connect 5 0 10 0;
#X connect 6 0 11 0;
#X connect 10 0 3 0;
#X connect 11 0 10 0;
#X connect 11 1 4 0;
#X connect 11 2 10 0;
#X connect 12 0 5 0;
#X restore 107 70 pd loader;
#X obj 107 44 inlet bang_to_load_file;
#X text 200 69 <---output is file length in samples;
#X obj 8 248 line~;
#X obj 8 221 pack 0 0;
#X obj 137 164 / 44.1;
#X obj 8 184 f;
#X obj 107 141 t f f;
#X text 233 185 <---remember to change to 48 for 48KHz sampling rate!
;
#X obj 8 100 t b b;
#X msg 38 141 0;
#X obj 9 329 outlet~ audio_out;
#X obj 8 13 inlet 1_or_0_to_start_and_stop;
#X obj 8 44 select 1;
#X text 93 101 <---first set [line~] to zero , then send target;
#X text 118 220 <---tell [line~] to go to x-sample in y-miliseconds
;
#X text 184 142 <---first gives time , then target , for [line~]
object;
#X text 490 375 derek@x-i.net;
#X obj 9 275 +~ 1;
#X obj 9 302 tabread4~ $0-sound;
#X connect 0 0 7 0;
#X connect 1 0 0 0;
#X connect 3 0 18 0;
#X connect 4 0 3 0;
#X connect 5 0 4 1;
#X connect 6 0 4 0;
#X connect 7 0 6 1;
#X connect 7 1 5 0;
#X connect 9 0 6 0;
#X connect 9 1 10 0;
#X connect 10 0 3 0;
#X connect 12 0 13 0;
#X connect 13 0 9 0;
#X connect 13 1 10 0;
#X connect 18 0 19 0;
#X connect 19 0 11 0;