File: list-map-help.pd

package info (click to toggle)
pd-list-abs 0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 756 kB
  • sloc: makefile: 289
file content (277 lines) | stat: -rw-r--r-- 7,282 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
#N canvas 0 31 612 654 10;
#X obj 67 280 list-map;
#X text 65 22 [list-map] - the swiss army knife of list-operations
;
#X obj 135 280 spigot;
#X obj 171 263 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X msg 67 236 0 1 2 3;
#X obj 118 317 print SERIALIZED;
#X obj 67 346 print MAIN;
#X msg 313 238 0 1 2 3;
#X obj 364 319 print SERIALIZED;
#X obj 313 348 print MAIN;
#X floatatom 404 262 5 0 0 0 - - -;
#X msg 67 215 bang;
#X msg 145 235 a b c;
#X msg 145 215 bang;
#X obj 381 282 * 10;
#X msg 313 214 bang;
#X msg 72 417 0 1 2 3;
#X obj 72 506 list trim;
#X obj 72 486 list prepend set;
#X msg 72 528;
#X obj 138 441 list append -|-;
#X msg 227 511 set;
#X text 304 534 A more complex example:;
#N canvas 164 99 846 438 filters 0;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-in 64 float 0;
#X coords 0 1 63 -1 128 60 1;
#X restore 503 222 graph;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-out 64 float 0;
#X coords 0 1 63 -1 128 60 1;
#X restore 645 222 graph;
#X obj 110 316 s \$0-out;
#N canvas 414 307 437 371 tabdump-in 0;
#X obj 147 152 tabread \$0-in;
#X obj 147 205 list prepend;
#X obj 238 205 t a;
#X obj 125 254 list;
#X obj 125 23 inlet;
#X obj 125 279 outlet;
#X obj 125 46 t b b b;
#X msg 147 104 64;
#N canvas 0 0 450 300 countto 0;
#X obj 163 151 f 0;
#X obj 190 151 + 1;
#X obj 163 109 until;
#X msg 205 111 0;
#X obj 163 180 outlet;
#X obj 163 39 inlet;
#X obj 163 87 t a b;
#X connect 0 0 1 0;
#X connect 0 0 4 0;
#X connect 1 0 0 1;
#X connect 2 0 0 0;
#X connect 3 0 0 1;
#X connect 5 0 6 0;
#X connect 6 0 2 0;
#X connect 6 1 3 0;
#X restore 147 126 pd countto;
#X connect 0 0 1 0;
#X connect 1 0 3 1;
#X connect 1 0 2 0;
#X connect 2 0 1 1;
#X connect 3 0 5 0;
#X connect 4 0 6 0;
#X connect 6 0 3 0;
#X connect 6 1 7 0;
#X connect 6 2 1 1;
#X connect 7 0 8 0;
#X connect 8 0 0 0;
#X restore 110 206 pd tabdump-in;
#X msg 110 155 bang;
#X obj 110 294 list prepend 0;
#N canvas 0 0 297 272 pole 0;
#X obj 71 140 +;
#X obj 71 172 t a a;
#X obj 117 173 * 0.9;
#X obj 71 54 inlet;
#X obj 147 51 inlet;
#X obj 71 230 outlet;
#X text 72 17 one-pole filter;
#X obj 147 74 t b a;
#X msg 87 118 0;
#X connect 0 0 1 0;
#X connect 1 0 5 0;
#X connect 1 1 2 0;
#X connect 2 0 0 1;
#X connect 3 0 0 0;
#X connect 4 0 7 0;
#X connect 7 0 8 0;
#X connect 7 1 2 1;
#X connect 8 0 0 1;
#X restore 297 269 pd pole;
#X obj 269 117 hsl 64 15 0 0.99 0 0 empty empty filter-coeff -2 -8
1 10 -262144 -1 -1 0 1;
#N canvas 0 0 297 272 zero 0;
#X obj 71 142 t a a;
#X obj 71 44 inlet;
#X obj 124 41 inlet;
#X obj 71 230 outlet;
#X text 71 20 one-zero filter;
#X obj 71 204 +;
#X obj 154 112 * -1;
#X obj 71 168 * -0.5;
#X obj 124 66 t b a;
#X msg 87 113 0;
#X connect 0 0 7 0;
#X connect 0 1 5 0;
#X connect 1 0 0 0;
#X connect 2 0 8 0;
#X connect 5 0 3 0;
#X connect 6 0 7 1;
#X connect 7 0 5 1;
#X connect 8 0 9 0;
#X connect 8 1 6 0;
#X connect 9 0 5 1;
#X restore 244 269 pd zero;
#N canvas 0 0 341 267 split 0;
#X obj 11 193 outlet;
#X obj 68 194 outlet;
#X obj 11 143 list prepend 0;
#X obj 11 169 route 0 1;
#X obj 104 110 hradio 12 1 0 2 empty empty zero 28 3 1 10 -262144 -1
-1 0;
#X obj 11 68 inlet;
#X obj 180 33 select 0 1;
#X msg 180 62 label zero;
#X msg 211 87 label pole;
#X obj 104 38 loadbang;
#X msg 104 64 0;
#X connect 2 0 3 0;
#X connect 3 0 0 0;
#X connect 3 1 1 0;
#X connect 4 0 2 1;
#X connect 4 0 6 0;
#X connect 5 0 2 0;
#X connect 6 0 7 0;
#X connect 6 1 8 0;
#X connect 7 0 4 0;
#X connect 8 0 4 0;
#X connect 9 0 10 0;
#X connect 10 0 4 0;
#X coords 0 -1 1 1 60 30 2 100 100;
#X restore 244 217 pd split;
#X floatatom 266 139 5 0 0 0 - - -;
#N canvas 0 0 297 280 noise 0;
#X obj 33 115 random 1000;
#X obj 33 88 t b a;
#X obj 33 194 tabwrite \$0-in;
#X obj 33 143 / 500;
#X obj 33 163 - 1;
#X msg 33 44 64;
#N canvas 0 0 450 300 countto 0;
#X obj 163 151 f 0;
#X obj 190 151 + 1;
#X obj 163 109 until;
#X msg 205 111 0;
#X obj 163 180 outlet;
#X obj 163 39 inlet;
#X obj 163 87 t a b;
#X connect 0 0 1 0;
#X connect 0 0 4 0;
#X connect 1 0 0 1;
#X connect 2 0 0 0;
#X connect 3 0 0 1;
#X connect 5 0 6 0;
#X connect 6 0 2 0;
#X connect 6 1 3 0;
#X restore 33 66 pd countto;
#X obj 33 21 inlet;
#X connect 0 0 3 0;
#X connect 1 0 0 0;
#X connect 1 1 2 1;
#X connect 3 0 4 0;
#X connect 4 0 2 0;
#X connect 5 0 6 0;
#X connect 6 0 1 0;
#X connect 7 0 5 0;
#X restore 504 184 pd noise;
#X msg 504 160 make noise;
#X obj 266 158 t b a a;
#X msg 439 324 const 0;
#X obj 439 365 s \$0-in;
#X obj 440 390 s \$0-out;
#X msg 500 324 const 0 \, 16 1;
#X text 498 308 impulse;
#X text 112 34 This is a more complex example showing how to apply
a set of elementary filters on a list of floats. Try playing with the
coeff-slider and switch between pole and zero operation.;
#X obj 110 236 list-map;
#X connect 3 0 20 0;
#X connect 4 0 3 0;
#X connect 5 0 2 0;
#X connect 6 0 20 1;
#X connect 7 0 10 0;
#X connect 8 0 20 1;
#X connect 9 0 8 0;
#X connect 9 1 6 0;
#X connect 10 0 13 0;
#X connect 12 0 11 0;
#X connect 13 0 3 0;
#X connect 13 1 8 1;
#X connect 13 2 6 1;
#X connect 14 0 15 0;
#X connect 14 0 16 0;
#X connect 17 0 15 0;
#X connect 20 0 5 0;
#X connect 20 1 9 0;
#X restore 330 556 pd filters;
#X text 67 596 2007 Frank Barknecht \, original idea by IOhannes m
zmoelnig and Thomas Musil.;
#X obj 313 282 list-map;
#X obj 72 441 list-map;
#X msg 71 391 bang;
#X text 64 52 Calls a user-defined operation for each of the incoming
list's items and returns a list of the return values.;
#X text 64 90 [list-map] is a helper abstraction to make element-wise
operations on lists easy to patch. The basic idea is to bundle a list-serializer
and a list-repacker into one object. Then you connect whatever operation
should be applied on every list item to the right outlet and send the
modified items back to the right inlet. Here the modified elements
get packed into a list again and sent to the left outlet of [list-map].
;
#X obj 315 430 list-map;
#X obj 315 472 list trim;
#X obj 315 452 list prepend set;
#X obj 387 430 pow 3;
#X floatatom 417 407 5 0 0 0 - - -;
#X msg 315 405 1 2 3 4 5;
#X msg 315 494;
#N canvas 510 66 494 396 META 0;
#X text 12 25 LICENSE SIBSD;
#X text 12 155 AUTHOR Frank Barknecht;
#X text 12 175 HELP_PATCH_AUTHORS Frank Barknecht. "pd meta" information
added by Jonathan Wilkes for Pd version 0.42.;
#X text 12 75 INLET_0 anything;
#X text 12 5 KEYWORDS control list_op;
#X text 12 45 DESCRIPTION call a user-defined operation for each of
the incoming list's items and return a list of the return values;
#X text 12 95 INLET_1 anything;
#X text 12 115 OUTLET_0 list;
#X text 12 135 OUTLET_1 float symbol pointer;
#X restore 533 611 pd META;
#X connect 0 0 6 0;
#X connect 0 1 2 0;
#X connect 0 1 5 0;
#X connect 2 0 0 1;
#X connect 3 0 2 1;
#X connect 4 0 0 0;
#X connect 7 0 25 0;
#X connect 10 0 14 1;
#X connect 11 0 0 0;
#X connect 12 0 0 1;
#X connect 13 0 0 1;
#X connect 14 0 25 1;
#X connect 15 0 25 0;
#X connect 16 0 26 0;
#X connect 17 0 19 0;
#X connect 18 0 17 0;
#X connect 20 0 26 1;
#X connect 21 0 19 0;
#X connect 25 0 9 0;
#X connect 25 1 8 0;
#X connect 25 1 14 0;
#X connect 26 0 18 0;
#X connect 26 1 20 0;
#X connect 27 0 26 0;
#X connect 30 0 32 0;
#X connect 30 1 33 0;
#X connect 31 0 36 0;
#X connect 32 0 31 0;
#X connect 33 0 30 1;
#X connect 34 0 33 1;
#X connect 35 0 30 0;