... and more list ops [was: Re: [PD] list-math: do math on lists]

Frank Barknecht fbar at footils.org
Sat Sep 10 13:18:05 CEST 2005


Hallo,
Frank Barknecht hat gesagt: // Frank Barknecht wrote:

> I figured, attached abstraction could be useful to someone else, too,
> even though it's very simple. 

Oh, and here are some more: [list-makefilename] will change the
symbols in a list instead and apply [makefilename $1] to it, whereas
[OSCprepend] does the same as the [OSCprepend] in Memento, however
using only pd-0.39 builtins instead of Cyclone or Zexy. 

I will replace Memento's OSCprepend with attached one in the future
(when Pd's GOP on GOP bug is fixed and RRADical moves to require less
externals, but pd-0.39).

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 424 89 624 640 10;
#X msg 119 113 1 2 3 4 a b c;
#X text 251 117 <- click to test;
#X obj 196 386 list;
#X obj 77 499 list;
#X obj 100 385 list prepend;
#N canvas 0 0 533 407 drip 0;
#X obj 64 206 list split 1;
#X obj 64 123 until;
#X obj 64 181 list append;
#X obj 194 206 bang;
#X text 146 90 First store list \, then start the loop;
#X text 163 118 "until" bangs its output until told to stop by a "bang"
to its right inlet.;
#X text 182 160 Store the remaining list.;
#X text 239 205 third outlet of "split" tells us to stop.;
#X obj 64 243 outlet;
#X obj 64 57 inlet;
#X obj 64 86 t b l;
#X text 237 44 From list-help.pd;
#X connect 0 0 8 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 9 0 10 0;
#X connect 10 0 1 0;
#X connect 10 1 2 1;
#X restore 100 202 pd drip;
#X obj 78 150 t b a b;
#X obj 122 178 s \$0-reset-result;
#X obj 179 357 r \$0-reset-result;
#X text 260 177 clear result list;
#X text 181 204 "Drip" (serialize) the list;
#X text 258 389 Repack the list (think of the counter);
#X text 124 496 Final result is built here;
#X obj 78 81 inlet;
#X obj 223 248 inlet;
#X obj 77 530 outlet;
#X text 182 32 Use as "list-math operator" where operator is some binary
operator \, expr can understand.;
#X obj 100 231 route symbol;
#X obj 100 334 makefilename \$1;
#X text 202 228 only work on symbols;
#X obj 223 272 symbol;
#X msg 223 293 set \$1;
#X connect 0 0 6 0;
#X connect 2 0 4 1;
#X connect 3 0 15 0;
#X connect 4 0 2 0;
#X connect 4 0 3 1;
#X connect 5 0 17 0;
#X connect 6 0 3 0;
#X connect 6 1 5 0;
#X connect 6 2 7 0;
#X connect 8 0 4 1;
#X connect 13 0 6 0;
#X connect 14 0 20 0;
#X connect 17 0 18 0;
#X connect 17 1 4 0;
#X connect 18 0 4 0;
#X connect 20 0 21 0;
#X connect 21 0 18 0;
-------------- next part --------------
#N canvas 510 222 590 494 10;
#X obj 83 371 print M;
#X obj 83 334 list-makefilename %s-blabla;
#X obj 82 33 cnv 15 220 30 empty empty list-makefilename 20 12 0 14
-233017 -66577 0;
#X text 80 115 Use as "list-makefilename makefilename-arg". Right inlet
can be used to change the arg to makefilename. Please only use a symbol
placeholder (== "%s");
#X msg 267 220 xyz-%s-abc;
#X msg 267 200 /help/%s;
#X text 80 76 Change symbols in a list \, pass floats unchanged.;
#X msg 83 200 1 2 3 4 SYMBOL;
#X msg 83 222 list FREQ 440 AMP 1;
#X msg 267 287 const;
#X msg 314 286 You-probably-%don't-want-this;
#X msg 267 249 %s;
#X text 301 250 pass unchanged;
#X connect 1 0 0 0;
#X connect 4 0 1 1;
#X connect 5 0 1 1;
#X connect 7 0 1 0;
#X connect 8 0 1 0;
#X connect 9 0 1 1;
#X connect 10 0 1 1;
#X connect 11 0 1 1;
-------------- next part --------------
#N canvas 511 144 636 444 10;
#X obj 45 131 list split 1;
#X msg 94 90 /a 1 2 3;
#X obj 45 276 list append;
#X obj 45 299 list trim;
#X obj 45 239 makefilename \$1%s;
#X obj 45 188 route symbol;
#X obj 45 89 inlet;
#X obj 45 319 outlet;
#X text 215 99 "Prepends" first argument to an OSC message list.;
#X text 221 126 Example: with \$1 being "/synth" the message "/set
x 1 2" will become "/synth/set x 1 2".;
#X text 223 163 Right inlet lets you change the prepended argument
;
#X msg 146 209 set \$1%s;
#X obj 146 185 symbol;
#X obj 146 163 inlet;
#X text 224 189 Lists not starting with a symbol are filtered out!
;
#X connect 0 0 5 0;
#X connect 0 1 2 1;
#X connect 1 0 0 0;
#X connect 2 0 3 0;
#X connect 3 0 7 0;
#X connect 4 0 2 0;
#X connect 5 0 4 0;
#X connect 6 0 0 0;
#X connect 11 0 4 0;
#X connect 12 0 11 0;
#X connect 13 0 12 0;
-------------- next part --------------
#N canvas 417 189 565 469 10;
#X msg 121 238 /a 1 c 3;
#X obj 121 350 print OSC;
#X text 52 262 ignored:;
#X text 72 238 okay:;
#X obj 121 323 OSCprepend /synth/ha;
#X msg 256 231 /osc;
#X text 304 230 change OSC-messages;
#X msg 256 257 /freq/1;
#X obj 104 31 cnv 15 220 30 empty empty OSCprepend 20 12 0 14 -233017
-66577 0;
#X text 98 76 "Prepends" first argument to an OSC message list.;
#X text 106 140 Right inlet lets you change the prepended argument
;
#X msg 121 262 900 2 3 4 a b c;
#X text 104 103 Example: with ARG_1 being "/synth" the message "/set
x 1 2" will become "/synth/set x 1 2".;
#X text 107 166 Lists not starting with a symbol are filtered out.
;
#X msg 269 285 1;
#X text 303 287 oops...;
#X connect 0 0 4 0;
#X connect 4 0 1 0;
#X connect 5 0 4 1;
#X connect 7 0 4 1;
#X connect 11 0 4 0;
#X connect 14 0 4 1;


More information about the Pd-list mailing list