File: list-equalize-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 (59 lines) | stat: -rw-r--r-- 1,859 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
#N canvas 0 26 562 531 10;
#X obj 93 283 list-equalize;
#X obj 93 71 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X obj 93 248 pack 0 0 0;
#X obj 115 209 t b f;
#X obj 161 212 t b f;
#X obj 93 310 unpack 0 0 0;
#X obj 128 71 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X obj 161 71 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X floatatom 93 341 5 0 0 0 - - -;
#X floatatom 132 341 5 0 0 0 - - -;
#X floatatom 172 341 5 0 0 0 - - -;
#X obj 93 367 vsl 15 128 0 1 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X obj 132 367 vsl 15 128 0 1 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X obj 172 367 vsl 15 128 0 1 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X text 207 34 list-equalize:;
#X text 227 53 scale a list so that all float elements sum up to 1
;
#X text 227 77 L_result = L_input / sum(L_input);
#X obj 306 253 list-equalize;
#X obj 306 280 print;
#X text 258 177 Also handles non-float elements gracefully.;
#X msg 306 226 90 plus 10 is 100;
#X text 40 138 0-127;
#X text 42 427 0-1;
#N canvas 416 170 494 396 META 0;
#X text 12 25 LICENSE SIBSD;
#X text 12 115 AUTHOR Frank Barknecht;
#X text 12 95 OUTLET_0 list;
#X text 12 135 HELP_PATCH_AUTHORS Frank Barknecht. "pd meta" information
added by Jonathan Wilkes for Pd version 0.42.;
#X text 12 45 DESCRIPTION scale a list so that all float elements sum
up to 1;
#X text 12 5 KEYWORDS control list_op;
#X text 12 75 INLET_0 anything;
#X restore 500 502 pd META;
#X connect 0 0 5 0;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X connect 3 0 2 0;
#X connect 3 1 2 1;
#X connect 4 0 2 0;
#X connect 4 1 2 2;
#X connect 5 0 8 0;
#X connect 5 1 9 0;
#X connect 5 2 10 0;
#X connect 6 0 3 0;
#X connect 7 0 4 0;
#X connect 8 0 11 0;
#X connect 9 0 12 0;
#X connect 10 0 13 0;
#X connect 17 0 18 0;
#X connect 20 0 17 0;