[PD] permutations

Orm Finnendahl finnendahl at folkwang-hochschule.de
Wed Jan 23 17:09:57 CET 2002


Hi Thomas,

I wrote an object for max/msp, which does exactly that. I'm planning
to port all these objects to pd after I've finished the csound~ and
markov object. That might be too late, but I could send you the
sources, if you know how to write a code external in pd. Let me know
if that's the case. In the meantime, you could use a hardwired system
like the one down here. It is capable to deal with lists of up to 12
elements (but of course is extensible). The permutation has to be
given in the lower message box in the subpatch, given the element
reordering with a '$' sign before the numbers indicating the
position. Note that you can use it even with shorter lists by
specifying less elements in the message box.

#N canvas 404 220 450 406 10;
#X msg 175 216 1 2 3 4 5;
#N canvas 0 85 378 356 permute 1;
#X obj 8 189 f;
#X obj 39 189 f;
#X obj 67 189 f;
#X obj 97 188 f;
#X obj 127 189 f;
#X obj 195 37 inlet;
#X obj 195 94 t b b;
#X obj 76 333 outlet;
#X obj 152 37 inlet;
#X obj 195 61 t b l;
#X obj 156 189 f;
#X obj 187 189 f;
#X obj 215 189 f;
#X obj 245 188 f;
#X obj 275 189 f;
#X obj 301 189 f;
#X obj 331 190 f;
#X obj 69 132 unpack 0 0 0 0 0 0 0 0 0 0 0 0;
#X obj 76 278 pack 0 0 0 0 0 0 0 0 0 0 0 0;
#X msg 76 304 \$2 \$5 \$4 \$3 \$1;
#X connect 0 0 18 0;
#X connect 1 0 18 1;
#X connect 2 0 18 2;
#X connect 3 0 18 3;
#X connect 4 0 18 4;
#X connect 5 0 9 0;
#X connect 6 0 0 0;
#X connect 6 1 1 0;
#X connect 6 1 2 0;
#X connect 6 1 3 0;
#X connect 6 1 4 0;
#X connect 6 1 10 0;
#X connect 6 1 10 0;
#X connect 6 1 11 0;
#X connect 6 1 12 0;
#X connect 6 1 13 0;
#X connect 6 1 14 0;
#X connect 6 1 15 0;
#X connect 6 1 16 0;
#X connect 8 0 6 0;
#X connect 9 0 6 0;
#X connect 9 1 17 0;
#X connect 10 0 18 5;
#X connect 11 0 18 6;
#X connect 12 0 18 7;
#X connect 13 0 18 8;
#X connect 14 0 18 9;
#X connect 15 0 18 10;
#X connect 16 0 18 11;
#X connect 17 0 0 1;
#X connect 17 1 1 1;
#X connect 17 2 2 1;
#X connect 17 3 3 1;
#X connect 17 4 4 1;
#X connect 17 5 10 1;
#X connect 17 6 11 1;
#X connect 17 7 12 1;
#X connect 17 8 13 1;
#X connect 17 9 14 1;
#X connect 17 10 15 1;
#X connect 17 11 16 1;
#X connect 18 0 19 0;
#X connect 19 0 7 0;
#X connect 19 0 17 0;
#X restore 110 246 pd permute;
#X obj 175 189 loadbang;
#X obj 110 220 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
-1;
#X obj 110 274 print outlet_permutation;
#X connect 0 0 1 1;
#X connect 1 0 4 0;
#X connect 2 0 0 0;
#X connect 3 0 1 0;


The inlets work as follows: right inlet is for lists to be
permutated. The left inlet triggers new permutation, storing the
altered list for the next permutation intenally.

Yours,
Orm

Am Mittwoch, den 23. Januar 2002 um 13:53:14 Uhr (+0100) schrieb thomas gorbach:
> Thank you for information about the ringmodulation. It's perfect now.
> Other question:
> Is there an external that can do permutations of numbers.
> like:  1 2 3 4 
>         2 3 4 1 
>         3 4 1 2   and so on;
> and     1 2 3 4 5
>            2 4 3 5 1
>            4 5 3 1 2 
>            5 1 3 2 4 and so on;
> 
> i would like to comput controlldata from permutations.
> 
> Thanks for help
> 
> Greetns
> Thomas
> 
> 



More information about the Pd-list mailing list