-
Notifications
You must be signed in to change notification settings - Fork 1
/
blocks-help.pd
442 lines (442 loc) · 11.8 KB
/
blocks-help.pd
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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
#N canvas 353 218 744 434 10;
#X obj 34 15 tgl 15 0 empty empty empty 17 7 0 10 -260818 -1 -1 1 1
;
#X obj 34 60 blocks;
#X floatatom 67 82 5 0 0 0 - - -, f 5;
#X msg 265 16 count;
#X obj 67 103 bng 15 250 50 0 empty empty empty 17 7 0 10 -260818 -1
-1;
#X msg 316 16 info;
#X text 113 81 gives number of blocks;
#X floatatom 34 146 5 0 0 0 - - -, f 5;
#X floatatom 10 337 5 0 0 0 - - -, f 5;
#X floatatom 55 337 5 0 0 0 - - -, f 5;
#X floatatom 140 337 5 0 0 0 - - -, f 5;
#X obj 95 338 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 118 338 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X symbolatom 301 337 0 0 0 0 - - -;
#X symbolatom 401 337 0 0 0 0 - - -;
#X symbolatom 465 337 0 0 0 0 - - -;
#X symbolatom 571 337 0 0 0 0 - - -;
#X symbolatom 623 337 0 0 0 0 - - -;
#X text 464 358 serial number;
#X text 570 358 version;
#X text 622 358 uid;
#X text 400 358 type id;
#X text 300 358 description;
#X text 55 358 type;
#X text 139 358 battery;
#X text 8 358 number;
#X text 93 358 flags;
#X obj 360 16 hradio 15 1 0 8 empty empty empty 0 -8 0 10 -262144 -1
-1 0;
#X msg 360 37 info \$1;
#X obj 80 146 t a a;
#X obj 10 305 print info;
#X text 427 37 click here for info about a block;
#X obj 360 59 s msg;
#X text 63 13 click here to start/stop;
#X obj 63 35 r msg;
#X msg 482 123 save 0;
#X obj 395 255 s msg;
#X obj 482 174 hradio 15 1 0 8 empty empty empty 0 -8 0 10 -262144
-1 -1 0;
#X obj 482 216 hradio 15 1 0 8 empty empty empty 0 -8 0 10 -262144
-1 -1 0;
#X msg 482 194 reset \$1;
#X msg 482 236 factoryreset \$1;
#X text 482 152 Restart a block / factory reset;
#X text 541 122 NOTE : 0 = master block;
#X obj 361 173 openpanel;
#X obj 361 130 bng 15 250 50 0 empty empty empty 0 -6 0 8 -260818 -1
-1;
#X msg 361 196 load 0 \$1;
#X msg 361 150 symbol examples;
#X text 14 171 count reply;
#X msg 482 100 load 0 examples/XYZPad.littlefoot;
#N canvas 666 205 451 324 msgout 0;
#X floatatom 15 69 5 0 255 0 r - -, f 5;
#X floatatom 67 69 5 0 255 0 g - -, f 5;
#X floatatom 147 69 5 0 255 0 b - -, f 5;
#X obj 67 90 t b f;
#X obj 147 90 t b f;
#X obj 15 164 s msg;
#X obj 15 120 expr ($f1<<16)|($f2<<8)|$f3;
#X floatatom 215 69 5 0 255 0 r - -, f 5;
#X floatatom 267 69 5 0 255 0 g - -, f 5;
#X floatatom 347 69 5 0 255 0 b - -, f 5;
#X obj 267 90 t b f;
#X obj 347 90 t b f;
#X obj 215 164 s msg;
#X obj 215 120 expr ($f1<<16)|($f2<<8)|$f3;
#X msg 15 142 msg 0 0 \$1;
#X msg 215 142 msg 0 1 \$1;
#X text 15 24 messaging example: set colors in the XYZPad example by
sending messages directly to the main block (#0), f 63;
#X text 16 212 this illustrates how to send a message to a blocks object
, f 60;
#X text 15 234 the general format for sending a message is: msg n p1
p2 p3 \, where n denotes the block number \, and p1 \, p2 \, p3 are
(up to) 3 parameters (must be int values);
#X text 15 188 set background color (rgb);
#X text 213 188 set touch trail color (rgb);
#X connect 0 0 6 0;
#X connect 1 0 3 0;
#X connect 2 0 4 0;
#X connect 3 0 6 0;
#X connect 3 1 6 1;
#X connect 4 0 6 0;
#X connect 4 1 6 2;
#X connect 6 0 14 0;
#X connect 7 0 13 0;
#X connect 8 0 10 0;
#X connect 9 0 11 0;
#X connect 10 0 13 0;
#X connect 10 1 13 1;
#X connect 11 0 13 0;
#X connect 11 1 13 2;
#X connect 13 0 15 0;
#X connect 14 0 5 0;
#X connect 15 0 12 0;
#X restore 127 213 pd msgout;
#N canvas 683 316 514 303 msgin 0;
#X obj 22 29 inlet;
#X obj 22 51 route msg button;
#X obj 22 131 unpack f f f f;
#X floatatom 22 153 5 0 0 0 - - -, f 5;
#X floatatom 69 153 5 0 0 0 - - -, f 5;
#X floatatom 106 153 5 0 0 0 - - -, f 5;
#X floatatom 143 153 5 0 0 0 - - -, f 5;
#X text 17 174 block#;
#X text 96 174 message;
#X floatatom 167 103 5 0 0 0 - - -, f 5;
#X floatatom 204 103 5 0 0 0 - - -, f 5;
#X floatatom 372 103 5 0 0 0 - - -, f 5;
#X text 162 124 block#;
#X symbolatom 241 103 0 0 0 0 - - -;
#X text 33 96 program message;
#X obj 167 81 unpack f f s f f;
#X obj 415 103 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X text 204 124 but#;
#X text 241 124 name;
#X text 414 124 press/release;
#X text 372 124 type;
#X text 201 57 button (control blocks);
#X obj 270 226 pack f f s;
#X obj 327 154 sel 0 1;
#X msg 327 176 white;
#X msg 375 176 magenta;
#X obj 270 248 s button;
#X text 222 273 button feedback (cf. butout);
#X obj 327 198 symbol;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 1 1 15 0;
#X connect 2 0 3 0;
#X connect 2 1 4 0;
#X connect 2 2 5 0;
#X connect 2 3 6 0;
#X connect 9 0 22 0;
#X connect 10 0 22 1;
#X connect 15 0 9 0;
#X connect 15 1 10 0;
#X connect 15 2 13 0;
#X connect 15 3 11 0;
#X connect 15 4 16 0;
#X connect 16 0 23 0;
#X connect 22 0 26 0;
#X connect 23 0 24 0;
#X connect 23 1 25 0;
#X connect 24 0 28 0;
#X connect 25 0 28 0;
#X connect 28 0 22 2;
#X restore 127 187 pd msgin;
#X obj 34 124 route float info;
#X text 190 213 <-- message output;
#X floatatom 192 337 5 0 0 0 - - -, f 5;
#X text 191 358 #buttons;
#N canvas 550 367 457 328 butout 0;
#X obj 16 212 s msg;
#X msg 16 46 black;
#X msg 59 46 red;
#X msg 90 46 green;
#X msg 182 46 blue;
#X msg 133 46 yellow;
#X msg 219 46 magenta;
#X msg 274 46 cyan;
#X msg 311 46 white;
#N canvas 501 330 451 349 colors 0;
#X obj 10 22 inlet;
#X obj 10 74 sel black red green yellow blue magenta cyan white;
#X msg 10 96 0 0 0;
#X msg 47 119 255 0 0;
#X msg 84 96 0 255 0;
#X msg 121 119 255 255 0;
#X msg 158 96 0 0 255;
#X msg 195 119 255 0 255;
#X msg 232 96 0 255 255;
#X msg 269 119 255 255 255;
#X obj 10 148 unpack f f f;
#X obj 10 44 symbol;
#X floatatom 10 173 5 0 255 0 r - -, f 5;
#X floatatom 62 173 5 0 255 0 g - -, f 5;
#X floatatom 142 173 5 0 255 0 b - -, f 5;
#X obj 62 194 t b f;
#X obj 142 194 t b f;
#X obj 10 224 expr ($f1<<16)|($f2<<8)|$f3;
#X obj 10 246 outlet;
#X connect 0 0 11 0;
#X connect 1 0 2 0;
#X connect 1 1 3 0;
#X connect 1 2 4 0;
#X connect 1 3 5 0;
#X connect 1 4 6 0;
#X connect 1 5 7 0;
#X connect 1 6 8 0;
#X connect 1 7 9 0;
#X connect 2 0 10 0;
#X connect 3 0 10 0;
#X connect 4 0 10 0;
#X connect 5 0 10 0;
#X connect 6 0 10 0;
#X connect 7 0 10 0;
#X connect 8 0 10 0;
#X connect 9 0 10 0;
#X connect 10 0 12 0;
#X connect 10 1 13 0;
#X connect 10 2 14 0;
#X connect 11 0 1 0;
#X connect 12 0 17 0;
#X connect 13 0 15 0;
#X connect 14 0 16 0;
#X connect 15 0 17 0;
#X connect 15 1 17 1;
#X connect 16 0 17 0;
#X connect 16 1 17 2;
#X connect 17 0 18 0;
#X restore 16 78 pd colors;
#X text 16 239 the format of the message is: button n m c \, where
n is the block number (must be a control block) \, m is the button
number (0-9) and c is the rgb color;
#X text 14 12 this example illustrates how to set the button LED color
;
#X obj 134 87 r button;
#N canvas 501 330 451 349 colors 0;
#X obj 10 22 inlet;
#X obj 10 74 sel black red green yellow blue magenta cyan white;
#X msg 10 96 0 0 0;
#X msg 47 119 255 0 0;
#X msg 84 96 0 255 0;
#X msg 121 119 255 255 0;
#X msg 158 96 0 0 255;
#X msg 195 119 255 0 255;
#X msg 232 96 0 255 255;
#X msg 269 119 255 255 255;
#X obj 10 148 unpack f f f;
#X obj 10 44 symbol;
#X floatatom 10 173 5 0 255 0 r - -, f 5;
#X floatatom 62 173 5 0 255 0 g - -, f 5;
#X floatatom 142 173 5 0 255 0 b - -, f 5;
#X obj 62 194 t b f;
#X obj 142 194 t b f;
#X obj 10 224 expr ($f1<<16)|($f2<<8)|$f3;
#X obj 10 246 outlet;
#X connect 0 0 11 0;
#X connect 1 0 2 0;
#X connect 1 1 3 0;
#X connect 1 2 4 0;
#X connect 1 3 5 0;
#X connect 1 4 6 0;
#X connect 1 5 7 0;
#X connect 1 6 8 0;
#X connect 1 7 9 0;
#X connect 2 0 10 0;
#X connect 3 0 10 0;
#X connect 4 0 10 0;
#X connect 5 0 10 0;
#X connect 6 0 10 0;
#X connect 7 0 10 0;
#X connect 8 0 10 0;
#X connect 9 0 10 0;
#X connect 10 0 12 0;
#X connect 10 1 13 0;
#X connect 10 2 14 0;
#X connect 11 0 1 0;
#X connect 12 0 17 0;
#X connect 13 0 15 0;
#X connect 14 0 16 0;
#X connect 15 0 17 0;
#X connect 15 1 17 1;
#X connect 16 0 17 0;
#X connect 16 1 17 2;
#X connect 17 0 18 0;
#X restore 203 134 pd colors;
#X obj 134 109 unpack f f s;
#X obj 134 158 pack f f f;
#X msg 134 183 button \$1 \$2 \$3;
#X text 233 93 button feedback (cf. msgin);
#X obj 16 100 t b f;
#X msg 16 122 0 \, 1 \, 2 \, 3 \, 4 \, 5 \, 6 \, 7 \, 8 \, 9, f 16
;
#X obj 16 157 pack f f;
#X msg 16 183 button 1 \$1 \$2;
#X connect 1 0 9 0;
#X connect 2 0 9 0;
#X connect 3 0 9 0;
#X connect 4 0 9 0;
#X connect 5 0 9 0;
#X connect 6 0 9 0;
#X connect 7 0 9 0;
#X connect 8 0 9 0;
#X connect 9 0 18 0;
#X connect 12 0 14 0;
#X connect 13 0 15 2;
#X connect 14 0 15 0;
#X connect 14 1 15 1;
#X connect 14 2 13 0;
#X connect 15 0 16 0;
#X connect 16 0 0 0;
#X connect 18 0 19 0;
#X connect 18 1 20 1;
#X connect 19 0 20 0;
#X connect 20 0 21 0;
#X connect 21 0 0 0;
#X restore 127 240 pd butout;
#X text 190 240 <-- button output;
#X text 190 187 <-- message + button input;
#X text 334 100 Load and save programs;
#X text 113 102 bang when the topology changes;
#X text 42 387 info reply: block info (flag #1 = master block \, flag
#2 = battery is charging), f 79;
#X text 140 148 Open the subpatches below for various input/output
items, f 32;
#N canvas 493 295 458 329 ledout 0;
#X obj 16 232 s msg;
#X msg 16 46 black;
#X msg 59 46 red;
#X msg 90 46 green;
#X msg 182 46 blue;
#X msg 133 46 yellow;
#X msg 219 46 magenta;
#X msg 274 46 cyan;
#X msg 311 46 white;
#N canvas 501 330 451 349 colors 0;
#X obj 10 22 inlet;
#X obj 10 74 sel black red green yellow blue magenta cyan white;
#X msg 10 96 0 0 0;
#X msg 47 119 255 0 0;
#X msg 84 96 0 255 0;
#X msg 121 119 255 255 0;
#X msg 158 96 0 0 255;
#X msg 195 119 255 0 255;
#X msg 232 96 0 255 255;
#X msg 269 119 255 255 255;
#X obj 10 148 unpack f f f;
#X obj 10 44 symbol;
#X floatatom 10 173 5 0 255 0 r - -, f 5;
#X floatatom 62 173 5 0 255 0 g - -, f 5;
#X floatatom 142 173 5 0 255 0 b - -, f 5;
#X obj 62 194 t b f;
#X obj 142 194 t b f;
#X obj 10 224 expr ($f1<<16)|($f2<<8)|$f3;
#X obj 10 246 outlet;
#X connect 0 0 11 0;
#X connect 1 0 2 0;
#X connect 1 1 3 0;
#X connect 1 2 4 0;
#X connect 1 3 5 0;
#X connect 1 4 6 0;
#X connect 1 5 7 0;
#X connect 1 6 8 0;
#X connect 1 7 9 0;
#X connect 2 0 10 0;
#X connect 3 0 10 0;
#X connect 4 0 10 0;
#X connect 5 0 10 0;
#X connect 6 0 10 0;
#X connect 7 0 10 0;
#X connect 8 0 10 0;
#X connect 9 0 10 0;
#X connect 10 0 12 0;
#X connect 10 1 13 0;
#X connect 10 2 14 0;
#X connect 11 0 1 0;
#X connect 12 0 17 0;
#X connect 13 0 15 0;
#X connect 14 0 16 0;
#X connect 15 0 17 0;
#X connect 15 1 17 1;
#X connect 16 0 17 0;
#X connect 16 1 17 2;
#X connect 17 0 18 0;
#X restore 16 78 pd colors;
#X obj 16 177 pack f f;
#X text 14 12 this example illustrates how to set the LED strip color
;
#X obj 60 104 hsl 128 15 0 15 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 0 1;
#X obj 60 124 int;
#X text 16 259 the format of the message is: leds n m c \, where n
is the block number (must be a control block) \, m is the number of
leds to be lit (0-15) and c is the rgb color;
#X obj 60 146 t b f;
#X msg 16 203 leds 1 \$2 \$1;
#X connect 1 0 9 0;
#X connect 2 0 9 0;
#X connect 3 0 9 0;
#X connect 4 0 9 0;
#X connect 5 0 9 0;
#X connect 6 0 9 0;
#X connect 7 0 9 0;
#X connect 8 0 9 0;
#X connect 9 0 10 0;
#X connect 10 0 16 0;
#X connect 12 0 13 0;
#X connect 13 0 15 0;
#X connect 15 0 10 0;
#X connect 15 1 10 1;
#X connect 16 0 0 0;
#X restore 127 268 pd ledout;
#X text 190 268 <-- led output;
#X floatatom 255 337 5 0 0 0 - - -, f 5;
#X obj 80 305 unpack f f f f f f f s s s s s;
#X text 254 358 #leds;
#X connect 0 0 1 0;
#X connect 1 0 51 0;
#X connect 1 1 2 0;
#X connect 2 0 4 0;
#X connect 3 0 32 0;
#X connect 5 0 32 0;
#X connect 27 0 28 0;
#X connect 28 0 32 0;
#X connect 29 0 65 0;
#X connect 29 1 30 0;
#X connect 34 0 1 0;
#X connect 35 0 36 0;
#X connect 37 0 39 0;
#X connect 38 0 40 0;
#X connect 39 0 36 0;
#X connect 40 0 36 0;
#X connect 43 0 45 0;
#X connect 44 0 46 0;
#X connect 45 0 36 0;
#X connect 46 0 43 0;
#X connect 48 0 36 0;
#X connect 51 0 7 0;
#X connect 51 1 29 0;
#X connect 51 2 50 0;
#X connect 65 0 8 0;
#X connect 65 1 9 0;
#X connect 65 2 11 0;
#X connect 65 3 12 0;
#X connect 65 4 10 0;
#X connect 65 5 53 0;
#X connect 65 6 64 0;
#X connect 65 7 13 0;
#X connect 65 8 14 0;
#X connect 65 9 15 0;
#X connect 65 10 16 0;
#X connect 65 11 17 0;