[PD] Pd convention, the best way to build a patch ?

Frank Barknecht fbar at footils.org
Sun Aug 29 15:47:13 CEST 2004


Hallo,
abel.jerome at free.fr hat gesagt: // abel.jerome at free.fr wrote:

> But it can't answer to my present problem : I want to make a kind of array of
> routing with two parameters (x and y) which could be changed (it would be the
> best).
> At the beginning, without reflexions, it looks like this :
> http://giair.music.free.fr/images/pd/ouaou_PUREDATA.jpg

Quick remark: If you use the delay object to order the data flow, you
should better use a [t b a] object there. 

> In my new patch, I'm using the object matrix (Zexy lib) which allow to edit in
> the array independantly the two parameters.
> 
> 
> My questions are :
> 1. Is it possible, an array of three parameters changeable ?

I don't see why it shouldn't be.

> What is the best way for a big numbers of parameters (here, my x values are
> about 29 elements, my y values are 7 or plus) :

I would recommend to stay with matrix, it's great for this stuff.

> 2. Do you privilege the direct connections with threads. So, with 29 * 7, its
> like a forest of threads, it's impossible to update, and not clear at all. And,
> it could generate some digital artefacts (**#!!!CLICKS !!). aNd sharing patchs,
> how it could be possible if after three days we can't understand the patch. And
> make threads, it's not my favorite job!
> 
> 3.Do you privilege to creat send and receive objects. It's more clear, but it's
> 29 * 7, alias 203 objects more in the patchs. In the pd convention, they don't
> advise this objects (WHY ?)
> 
> 4. Or create unit abstraction which group for this example the 7 parameters.
> It's more clear, and more updatable. But it's 29 objects more again !
> 
> 5. And create abstraction of abstraction ?

I favour 4 and 5, but in a slightly different way. Abstractions are
there to make often used functionality into a module you can reuse.
Attached is a cleaned up version of your first patch which shows this:
The selection of (i,j) pairs is abstracted out into an abstraction,
xymatch.pd, there. I show how to use this as well in xymatch-help.pd

You will see how this could be adapted to select from a lot of
objects. In fact, it's just a quick start to illustrate the approach.

You should try to deeply understand argument passing into abstractions
($1, $2,...) it's a great way to reuse the same abstractions with 
different variable values.

Ciao
-- 
 Frank Barknecht                               _ ______footils.org__
-------------- next part --------------
#N canvas 403 420 515 474 10;
#X obj 181 145 pack 0 0;
#X obj 166 292 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#X obj 166 346 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 164 400 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 275 293 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 273 343 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 273 401 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 166 271 r ch00;
#X obj 166 325 r ch01;
#X obj 164 379 r ch02;
#X obj 275 272 r ch10;
#X obj 273 320 r ch11;
#X obj 273 380 r ch12;
#X obj 218 114 t b f;
#X obj 181 95 hradio 15 1 0 2 empty empty empty 0 -6 0 8 -262144 -1
-1 0;
#X obj 218 52 vradio 15 1 0 3 empty empty empty 0 -6 0 8 -262144 -1
-1 0;
#X obj 181 170 xymatch 0 0;
#X obj 276 175 xymatch 1 0;
#X obj 276 225 xymatch 1 2;
#X obj 276 200 xymatch 1 1;
#X obj 181 220 xymatch 0 2;
#X obj 181 195 xymatch 0 1;
#X connect 0 0 16 0;
#X connect 7 0 1 0;
#X connect 8 0 2 0;
#X connect 9 0 3 0;
#X connect 10 0 4 0;
#X connect 11 0 5 0;
#X connect 12 0 6 0;
#X connect 13 0 0 0;
#X connect 13 1 0 1;
#X connect 14 0 0 0;
#X connect 15 0 13 0;
#X connect 16 0 21 0;
#X connect 17 0 19 0;
#X connect 19 0 18 0;
#X connect 20 0 17 0;
#X connect 21 0 20 0;
-------------- next part --------------
#N canvas 0 0 656 454 10;
#X obj 73 48 inlet;
#X obj 73 79 route \$1;
#X obj 27 135 outlet;
#X obj 73 135 select \$2;
#X text 404 92 Args;
#X text 414 116 1: i;
#X text 413 134 2: j;
#X text 389 172 inlet: accepts list of two ints \, i and j;
#X obj 229 154 makefilename ch%d;
#X msg 227 175 set \$1%d;
#X obj 229 200 makefilename ch%d;
#X obj 176 84 t b b;
#X obj 229 123 f \$1;
#X obj 176 156 f \$2;
#X obj 176 62 loadbang;
#X obj 73 266 symbol;
#X msg 73 301 \; \$1 1;
#X text 109 15 will send a 1 to a send called "chij" (i ad j taken
from arguments \, when match.;
#X obj 192 277 symbol;
#X msg 192 312 \; \$1 0;
#X msg 192 252 bang;
#X text 389 194 outlet: sendlist further along.;
#X connect 0 0 1 0;
#X connect 0 0 2 0;
#X connect 1 0 3 0;
#X connect 1 1 20 0;
#X connect 3 0 15 0;
#X connect 3 1 20 0;
#X connect 8 0 9 0;
#X connect 9 0 10 0;
#X connect 10 0 15 1;
#X connect 10 0 18 1;
#X connect 11 0 13 0;
#X connect 11 1 12 0;
#X connect 12 0 8 0;
#X connect 13 0 10 0;
#X connect 14 0 11 0;
#X connect 15 0 16 0;
#X connect 18 0 19 0;
#X connect 20 0 18 0;


More information about the Pd-list mailing list