-
Notifications
You must be signed in to change notification settings - Fork 1
/
array-map-help.pd
36 lines (36 loc) · 1.3 KB
/
array-map-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
#N canvas 537 60 702 479 12;
#N canvas 0 22 450 278 (subpatch) 0;
#X array maphelp 100 float 2;
#X coords 0 1 100 -1 200 140 1 0 0;
#X restore 46 24 graph;
#X obj 37 256 bng 15 250 50 0 empty empty 1_sequence 17 7 0 10 -262144
-1 -1;
#X text 148 196 used to modify the contents of the array \, iterates
through all indices in an array and puts out index and value \, expects
the value for the current index in the right inlet;
#X obj 180 282 * 0.005;
#X text 247 270 <- there are a hundred indices in maphelp \, this will
ramp from 0 to 0.5 based on multiplying the index #;
#X obj 36 328 bng 15 250 50 0 empty empty 2_subtract_quarter 17 7 0
10 -262144 -1 -1;
#X obj 169 353 - 0.25;
#X text 231 358 subtract 0.25 from each value in the array;
#X obj 36 400 bng 15 250 50 0 empty empty 3_multiply_by_4 17 7 0 10
-262144 -1 -1;
#X text 238 427 multiply each value by 4;
#X obj 174 425 * 4;
#X text 279 42 argument: array name 1st inlet: bang or "set" array
message 2nd inlet: value from map 1st outlet: value at index 2nd outlet:
index;
#X obj 38 284 ./array-map maphelp;
#X obj 24 363 ./array-map maphelp;
#X obj 34 427 ./array-map maphelp;
#X connect 1 0 12 0;
#X connect 3 0 12 1;
#X connect 5 0 13 0;
#X connect 6 0 13 1;
#X connect 8 0 14 0;
#X connect 10 0 14 1;
#X connect 12 1 3 0;
#X connect 13 0 6 0;
#X connect 14 0 10 0;