[PD] Abstractions with arrays?

Frank Barknecht fbar at footils.org
Thu Dec 9 16:58:12 CET 2004


Hallo,
derek holzer hat gesagt: // derek holzer wrote:

> Besides using $0, there are some other tricks, epsc if you want to be 
> able to use [soundfiler] to load different files to each, in the case of 
> an audio array. I had trouble using two different $n variables in one 
> message, so I cooked up the following patch as an example of how to do 
> it. Call it as an abstraction, and you shold be able to load diffreent 
> sounds to each array.

Hhm, what troubles did you have with various $n's? I changed your
patch a bit and here the [read -resize $1 $2( message gets filled and
executed correctly.

Ciao
-- 
 Frank Barknecht                               _ ______footils.org__
-------------- next part --------------
#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 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 obj 203 63 table \$0-sound;
#X obj 119 169 symbol \$0-sound;
#X obj 68 197 pack s s;
#X obj 68 114 t a b;
#X msg 68 219 read -resize \$1 \$2;
#X connect 0 0 2 0;
#X connect 2 0 10 0;
#X connect 3 0 1 0;
#X connect 8 0 9 1;
#X connect 9 0 11 0;
#X connect 10 0 9 0;
#X connect 10 1 8 0;
#X connect 11 0 3 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 152 184 / 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 at x-i.net;
#X obj 9 275 +~ 1;
#X obj 9 302 tabread4~ \$0-sound;
#X obj 292 45 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#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;
#X connect 20 0 0 0;


More information about the Pd-list mailing list