[PD] Patchmatrix Execution Order Issues

Frank Barknecht fbar at footils.org
Thu Jan 18 16:25:37 CET 2007


Hallo,
Luke Iannini (pd) hat gesagt: // Luke Iannini (pd) wrote:

> I am aware of the stack overflow possibility, and I'll probably block
> out routings that would cause that.
> 
> The intent is for the input to reach all outputs before any new input
> is processed (i.e. before any new input changes the routing
> configuration of the spigots).  I see my mistake more clearly now, but
> the solution has not reached me yet.  I could buffer the inputs with
> [f] or [fifo]s, but that seems like it will become untenable; I'll
> keep trying.

Hm, I'm still not clear about how the routing should look like. Maybe
you can give a kind of more formal specification: Assuming you have a
(m,n)-matrix with m rows and n columns. With m=4 and n=3 this will be
printed through mtx_print as: 
  
 matrix:
  0 0 0
  0 0 0
  0 0 0
  0 0 0

A signal~ matrix [mtx_*~] will have m=4 outputs and n=3 inputs then,
that could be selected with the above message matrix. Setting element
(i,j) to 1 will open outlet~ i for inlet~ j then. 

Back to the message patchbay: How should this behave, if you set
element (i, j) to 1? Using the signal analogy I would assume, that all
messages "sent to inlet j" (that is, [list prepend]'ed with j) should
be "sent to outlet i" (that is: the first element of the new list,
which was j, will be set to i so that you can [route] it), but from
your patch it seems you want to achieve something different?

Anyways I attached a message-patchbay which works like I proposed to
illustrate what I mean.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 254 101 924 639 10;
#X obj 262 171 mtx 4 3;
#X msg 160 166 bang;
#X obj 355 50 + 1;
#X obj 355 26 hradio 15 1 0 4 empty empty empty 0 -8 0 10 -262144 -1
-1 3;
#X floatatom 262 29 5 0 0 0 - - -;
#X obj 262 107 list split 1;
#N canvas 0 0 450 300 drip 0;
#X obj 39 229 list split 1;
#X obj 39 146 until;
#X obj 39 184 list append;
#X obj 169 229 bang;
#X text 121 113 First store list \, then start the loop;
#X text 138 141 "until" bangs its output until told to stop by a "bang"
to its right inlet.;
#X text 157 183 Store the remaining list.;
#X obj 67 76 inlet;
#X obj 65 113 t b a;
#X obj 40 258 outlet;
#X connect 0 0 9 0;
#X connect 0 1 2 1;
#X connect 0 2 3 0;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X connect 3 0 1 1;
#X connect 7 0 8 0;
#X connect 8 0 1 0;
#X connect 8 1 2 1;
#X restore 341 302 pd drip;
#X msg 262 146 row \$1;
#X msg 147 90 element 2 1 1;
#N canvas 0 0 450 300 count 0;
#X obj 85 145 f 0;
#X obj 113 145 + 1;
#X obj 85 181 outlet;
#X obj 85 89 inlet;
#X obj 128 89 inlet;
#X msg 128 118 0;
#X obj 85 113 b;
#X connect 0 0 1 0;
#X connect 0 0 2 0;
#X connect 1 0 0 1;
#X connect 3 0 6 0;
#X connect 4 0 5 0;
#X connect 5 0 0 1;
#X connect 6 0 0 0;
#X restore 371 353 pd count;
#X obj 341 387 select 1;
#X obj 341 410 f;
#X obj 341 275 t a b;
#X obj 341 437 list append;
#X obj 341 323 t a b;
#X obj 357 462 print RESULT;
#X floatatom 341 597 5 0 0 0 - - -;
#X floatatom 365 579 5 0 0 0 - - -;
#X floatatom 389 559 5 0 0 0 - - -;
#X obj 262 196 route matrix;
#X obj 100 307 list prepend matrix;
#X obj 100 328 list trim;
#X obj 100 352 mtx_print;
#X msg 54 92 ones 4 3;
#X msg 55 116 zeros 4 3;
#X msg 56 67 eye 4 3;
#X msg 147 64 element 4 3 1;
#X msg 147 113 element 2 2 1;
#X obj 262 74 list prepend 1;
#X text 496 489 reset;
#X obj 413 143 t a;
#X text 451 144 store actual message below;
#X text 380 71 prepend intended row-index.;
#X text 316 147 get row.;
#X text 454 358 look up indices of the ones (zero-based!);
#X text 441 398 prepend column index in front of message \, if a one
was found there.;
#X obj 476 250 print ROW;
#X obj 341 516 route 0 1 2;
#X msg 356 487 0 0 \, 1 0 \, 2 0;
#X obj 413 538 print huh?;
#X connect 0 0 19 0;
#X connect 1 0 0 0;
#X connect 2 0 28 1;
#X connect 3 0 2 0;
#X connect 4 0 28 0;
#X connect 5 0 7 0;
#X connect 5 1 30 0;
#X connect 6 0 14 0;
#X connect 7 0 0 0;
#X connect 8 0 0 0;
#X connect 9 0 11 1;
#X connect 10 0 11 0;
#X connect 11 0 13 0;
#X connect 12 0 6 0;
#X connect 12 1 9 1;
#X connect 13 0 15 0;
#X connect 13 0 37 0;
#X connect 14 0 10 0;
#X connect 14 1 9 0;
#X connect 19 0 20 0;
#X connect 19 1 12 0;
#X connect 19 1 36 0;
#X connect 20 0 21 0;
#X connect 21 0 22 0;
#X connect 23 0 0 0;
#X connect 24 0 0 0;
#X connect 25 0 0 0;
#X connect 26 0 0 0;
#X connect 27 0 0 0;
#X connect 28 0 5 0;
#X connect 30 0 13 1;
#X connect 37 0 16 0;
#X connect 37 1 17 0;
#X connect 37 2 18 0;
#X connect 37 3 39 0;
#X connect 38 0 37 0;


More information about the Pd-list mailing list