[PD] Arrays of arrays?

Frank Barknecht barknech at ph-cip.uni-koeln.de
Sun Dec 23 13:13:32 CET 2001


Joseph Zitt hat gesagt: // Joseph Zitt wrote:

> Another newbie question... I'm trying to figure out how to make an
> array of arrays, or at least I think I am. What I'd like to do is to
> sample sounds from adc~ into a table or array (and I remain a bit
> confiused over whether they're the same thing, and the necessary
> relation of the visual array diagram to them), and them append each of
> them into an array of those, from which I can pick them out and play
> them as needed or randomly.

(table and array are basically the same except that tables live in
their own object windows and that you can give them $-names which is
nice in subpatches. All array documentation is valid for tables, too)

You could make an index table that indexes the sample-tables you would
like to play, and then "tabread" through this table. I attached an example
patch, that works like this. Then you can either random play through this
sequence or play through the sequence in order with a simple counter. The
nice thing about this is that tables can easily be saved to textfiles if you
send them "save to.txt" messages and you can reload them  with "read" messages.
See also the help patch "42.PART6.analog.sequencer.pd".

> Part of this seems to require creating templates, but from going
> through all the docs that I can find and playing around with them, I
> remain unclear on the whole template thing. I have a feeling that the
> documentation is assuming some paradigm that I haven't gotten yet.
Me neither, unfortunatly. Maybe I'll dive into this in the christmas
holidays...

bye,
-- 
                                                 __    __
 Frank Barknecht       ____ ______   ____ __ trip\ \  / /wire ______
                      / __// __  /__/ __// // __  \ \/ /  __ \\  ___\	
                     / /  / ____/  / /  / // ____// /\ \\  ___\\____ \	
                    /_/  /_____/  /_/  /_//_____// /  \ \\_____\\_____\
                                                /_/    \_\ 
-------------- next part --------------
#N canvas 347 225 761 549 10;
#X obj 60 138 table 1-samp;
#X obj 285 138 table 2-samp;
#X obj 579 138 table 3-samp;
#X obj 415 375 tabplay~;
#X msg 415 346 set \$1-samp;
#X obj 408 405 dac~;
#X obj 60 99 soundfiler;
#X obj 60 53 openpanel;
#X msg 60 28 bang;
#X obj 285 100 soundfiler;
#X obj 285 54 openpanel;
#X msg 285 29 bang;
#X obj 579 103 soundfiler;
#X obj 579 57 openpanel;
#X msg 579 32 bang;
#X obj 569 303 table which_samp 8;
#X obj 385 322 t b f;
#X obj 569 239 loadbang;
#X obj 307 269 tabread which_samp;
#X floatatom 307 244 5 0 0;
#X msg 60 76 read -resize \$1 1-samp;
#X msg 285 77 read -resize \$1 2-samp;
#X msg 579 80 read -resize \$1 3-samp;
#X obj 137 369 s sample;
#X obj 307 194 r sample;
#X obj 307 219 spigot;
#X obj 357 220 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 0
1;
#X floatatom 307 292 5 0 0;
#X obj 307 314 select 0;
#N canvas 278 210 600 400 next 0;
#X obj 166 111 inlet;
#X obj 166 316 outlet;
#X obj 166 170 f 0;
#X obj 206 170 + 1;
#X obj 166 140 t b;
#X msg 112 152 0;
#X floatatom 166 289 5 0 0;
#X obj 166 261 + 1;
#X obj 166 228 mod 8;
#X connect 0 0 4 0;
#X connect 2 0 3 0;
#X connect 2 0 8 0;
#X connect 3 0 2 1;
#X connect 4 0 2 0;
#X connect 5 0 2 1;
#X connect 6 0 1 0;
#X connect 7 0 6 0;
#X connect 8 0 7 0;
#X restore 137 341 pd next;
#X msg 569 270 0 1 0 2 1 1 3 1 3 0;
#N canvas 0 0 600 400 random 0;
#X obj 222 103 inlet;
#X obj 222 237 outlet;
#X obj 222 170 random 8;
#X obj 222 134 t b;
#X obj 222 203 + 1;
#X connect 0 0 3 0;
#X connect 2 0 4 0;
#X connect 3 0 2 0;
#X connect 4 0 1 0;
#X restore 49 339 pd random;
#X obj 139 316 spigot;
#X obj 188 318 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 1
1;
#X obj 49 369 s sample;
#X obj 49 316 spigot;
#X obj 98 317 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 0 1
;
#X msg 149 218 0 1;
#X obj 127 260 unpack 0 0;
#X msg 86 217 1 0;
#X text 79 194 random;
#X text 138 195 ordered;
#X obj 466 400 s next;
#X obj 307 339 s next;
#X obj 71 259 r next;
#X connect 3 0 5 0;
#X connect 3 0 5 1;
#X connect 3 1 42 0;
#X connect 4 0 3 0;
#X connect 7 0 20 0;
#X connect 8 0 7 0;
#X connect 10 0 21 0;
#X connect 11 0 10 0;
#X connect 13 0 22 0;
#X connect 14 0 13 0;
#X connect 16 0 3 0;
#X connect 16 1 4 0;
#X connect 17 0 30 0;
#X connect 18 0 27 0;
#X connect 19 0 18 0;
#X connect 20 0 6 0;
#X connect 21 0 9 0;
#X connect 22 0 12 0;
#X connect 24 0 25 0;
#X connect 25 0 19 0;
#X connect 26 0 25 1;
#X connect 27 0 28 0;
#X connect 28 0 43 0;
#X connect 28 1 16 0;
#X connect 29 0 23 0;
#X connect 30 0 15 0;
#X connect 31 0 34 0;
#X connect 32 0 29 0;
#X connect 33 0 32 1;
#X connect 35 0 31 0;
#X connect 36 0 35 1;
#X connect 37 0 38 0;
#X connect 38 0 36 0;
#X connect 38 1 33 0;
#X connect 39 0 38 0;
#X connect 44 0 35 0;
#X connect 44 0 32 0;


More information about the Pd-list mailing list