[PD] list-apply

Frank Barknecht fbar at footils.org
Sun Apr 2 16:08:30 CEST 2006


Hallo,

attached is a general list-apply object (formerly known as list-op to
readers of pd-dev).  It will become part of [list]-abs as soon as
Sourceforge lets me in again. Internally the [list-drip] abstraction
is used instead of a subpatch to serialize the list. (Once any only
once, you know.)

Attached is the version to go into CVS. The help file now has many
more interesting examples. 

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 0 0 554 590 10;
#X obj 77 499 list;
#X obj 100 385 list prepend;
#X obj 78 150 t b a b;
#X text 260 177 clear result list;
#X text 175 242 "Drip" (serialize) the list;
#X text 124 496 Final result is built here;
#X obj 78 81 inlet;
#X obj 210 271 inlet;
#X obj 77 530 outlet;
#X obj 100 307 \$1 \$2;
#X text 164 307 do \$1 \$2 with each element;
#X text 258 389 Repack the list;
#X obj 196 386 t a;
#X obj 163 270 inlet;
#X text 276 272 two inlets for the apply-operation;
#X obj 100 242 list-drip;
#X connect 0 0 8 0;
#X connect 1 0 0 1;
#X connect 1 0 12 0;
#X connect 2 0 0 0;
#X connect 2 1 15 0;
#X connect 2 2 1 1;
#X connect 6 0 2 0;
#X connect 7 0 9 1;
#X connect 9 0 1 0;
#X connect 12 0 1 1;
#X connect 13 0 9 0;
#X connect 15 0 9 0;
-------------- next part --------------
#N canvas 156 126 802 626 10;
#X obj 78 317 list-apply + 1;
#X msg 78 285 1 2 3 4;
#X obj 78 344 print;
#X msg 233 285 1 2 3 4;
#X obj 233 347 print;
#X text 29 23 list-apply: apply the object created by [arg1 arg2] on
every list element and return the modified list.;
#X floatatom 171 287 5 0 0 2 add_x - -;
#X msg 360 264 set /synth%d/freq;
#X text 129 126 Inlets:;
#X text 165 168 2) inlet connected to the apply-operation's first inlet.
;
#X text 164 191 3) inlet connected to the apply-operation's second
inlet \, if possible. (Not connected if there is no second inlet as
is the case with for example makefilename.;
#X msg 360 285 set count_%d...;
#X msg 487 286 not used with makefilename;
#X msg 77 396 1 2 3 4;
#X obj 77 438 print;
#X msg 288 397 1 2 3 4;
#X obj 288 439 print;
#X obj 388 379 hradio 15 1 0 4 empty empty empty 0 -6 0 8 -262144 -1
-1 3;
#X obj 388 396 + 1;
#X floatatom 198 398 5 0 0 2 moses-arg - -;
#X text 128 74 Arguments:;
#X text 163 92 Arg1 and arg2 are used to create the object whose operation
is applied to the list elements.;
#X text 164 148 1) the list to modify.;
#X text 24 248 EXAMPLES:;
#X obj 503 446 print;
#X msg 503 366 1 2 3 3 3 4;
#X msg 560 392 set 1;
#X obj 645 447 print;
#X msg 645 387 45 57 69;
#X obj 79 551 print;
#X msg 79 507 1 2 3 4;
#X text 286 530 prepent is part of list-abs;
#X obj 233 317 list-apply makefilename /synth%d/freq;
#X obj 77 417 list-apply moses 3;
#X obj 288 418 list-apply == 4;
#X obj 503 418 list-apply change;
#X obj 645 418 list-apply mtof;
#X obj 79 528 list-apply prepent whatever;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 3 0 32 0;
#X connect 6 0 0 2;
#X connect 7 0 32 1;
#X connect 11 0 32 1;
#X connect 12 0 32 2;
#X connect 13 0 33 0;
#X connect 15 0 34 0;
#X connect 17 0 18 0;
#X connect 18 0 34 2;
#X connect 19 0 33 2;
#X connect 25 0 35 0;
#X connect 26 0 35 1;
#X connect 28 0 36 0;
#X connect 30 0 37 0;
#X connect 32 0 4 0;
#X connect 33 0 14 0;
#X connect 34 0 16 0;
#X connect 35 0 24 0;
#X connect 36 0 27 0;
#X connect 37 0 29 0;


More information about the Pd-list mailing list