File: list-mean-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 (196 lines) | stat: -rw-r--r-- 5,076 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
#N struct 1114-dial float y;
#N canvas 0 31 534 466 10;
#X obj 98 306 list-mean;
#N canvas 0 0 450 300 randlist 0;
#X obj 134 129 until;
#X msg 246 151 set;
#X msg 134 193 add2 \$1;
#X obj 112 101 t b f b;
#X obj 135 249 outlet;
#X obj 112 31 inlet;
#X obj 112 73 + 1;
#X obj 112 53 random 10;
#X obj 134 151 random 10;
#X obj 134 171 - 5;
#X connect 0 0 8 0;
#X connect 1 0 4 0;
#X connect 2 0 4 0;
#X connect 3 0 4 0;
#X connect 3 1 0 0;
#X connect 3 2 1 0;
#X connect 5 0 7 0;
#X connect 6 0 3 0;
#X connect 7 0 6 0;
#X connect 8 0 9 0;
#X connect 9 0 2 0;
#X restore 153 236 pd randlist;
#X msg 153 214 bang;
#X floatatom 98 340 5 0 0 1 arithmetric_mean - -;
#X text 86 22 [list-mean];
#X msg 153 262 4 -3 -4 1 2 -3;
#X msg 98 159 1 2 3 4;
#X msg 98 185 any symbols 1 2 3 4 are ignored;
#X text 96 117 Non-floats in a list are silently dropped.;
#X text 114 82 mean = sum(f[i]) / total number of floats;
#X text 96 42 Calculates the arithmetric mean of a list (of floats)
according to:;
#N canvas 318 53 648 574 graphical-mean 0;
#N canvas 0 0 450 300 randlist 0;
#X obj 134 129 until;
#X msg 246 151 set;
#X msg 134 213 add2 \$1;
#X obj 112 101 t b f b;
#X obj 135 249 outlet;
#X obj 112 31 inlet;
#X obj 134 151 random 100;
#X msg 112 59 10;
#X obj 134 191 / 10;
#X obj 134 170 + 1;
#X connect 0 0 6 0;
#X connect 1 0 4 0;
#X connect 2 0 4 0;
#X connect 3 0 4 0;
#X connect 3 1 0 0;
#X connect 3 2 1 0;
#X connect 5 0 7 0;
#X connect 6 0 9 0;
#X connect 7 0 3 0;
#X connect 8 0 2 0;
#X connect 9 0 8 0;
#X restore 79 388 pd randlist;
#X msg 79 366 bang;
#X obj 79 447 list prepend 0;
#X obj 79 500 s \$0-tab;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-tab 10 float 0;
#X coords 0 10 9 0 200 140 1;
#X restore 75 152 graph;
#N canvas 0 0 916 918 \$0-c 0;
#X scalar 1114-dial 0 \;;
#X coords 0 0 200 140 200 140 1;
#X restore 75 152 pd \$0-c;
#N canvas 0 0 503 429 create 0;
#X msg 242 258 traverse pd-\$1 \, bang;
#X obj 242 238 symbol \$0-c;
#X msg 107 79 0;
#X obj 242 278 pointer;
#X msg 243 178 clear;
#X obj 243 205 s pd-\$0-c;
#X obj 107 114 t a b b;
#X obj 107 50 loadbang;
#X obj 107 326 outlet;
#X obj 107 302 append \$0-dial y;
#X connect 0 0 3 0;
#X connect 1 0 0 0;
#X connect 2 0 6 0;
#X connect 3 0 9 1;
#X connect 4 0 5 0;
#X connect 6 0 9 0;
#X connect 6 1 1 0;
#X connect 6 2 4 0;
#X connect 7 0 2 0;
#X connect 9 0 8 0;
#X restore 468 339 pd create;
#X obj 339 127 metro 50;
#X obj 339 102 tgl 15 0 empty empty show-mean 17 7 1 10 -258699 -262144
-1 0 1;
#N canvas 473 338 450 300 countto 0;
#X obj 131 154 f 0;
#X obj 156 153 + 1;
#X msg 174 113 0;
#X obj 131 183 outlet;
#X obj 131 59 inlet;
#X obj 131 116 until;
#X obj 131 96 t a b;
#X connect 0 0 1 0;
#X connect 0 0 3 0;
#X connect 1 0 0 1;
#X connect 2 0 0 1;
#X connect 4 0 6 0;
#X connect 5 0 0 0;
#X connect 6 0 5 0;
#X connect 6 1 2 0;
#X restore 362 195 pd countto;
#X obj 362 219 tabread \$0-tab;
#X obj 362 249 list prepend;
#X obj 452 249 t a;
#X msg 362 175 10;
#X obj 339 148 t b b b;
#X obj 339 274 list;
#X obj 79 344 loadbang;
#X msg 79 414 0.6 6.9 3.6 5.6 0.7 3.8 3.9 5.3 9.2 9.2;
#X text 77 30 Switch on the "show"-metro and play with the values in
the array.;
#N canvas 336 319 712 355 \$0-dial 0;
#X obj 19 119 outlet;
#X obj 19 86 route change;
#X obj 19 62 struct \$0-dial float y;
#X obj 229 62 drawpolygon 900 2 0 y 200 y;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X restore 453 315 pd \$0-dial;
#X msg 213 469 bounds 0 10 9 0;
#X obj 213 449 loadbang;
#X obj 339 313 list-mean;
#X obj 339 388 set \$0-dial y;
#X floatatom 339 339 5 0 0 0 - - -;
#X msg 92 469 const 5;
#N canvas 0 0 299 354 scale 0;
#X msg 74 83 10 \$1;
#X obj 74 107 -;
#X obj 74 158 * 140;
#X obj 74 134 / 20;
#X obj 74 49 inlet;
#X obj 74 182 outlet;
#X connect 0 0 1 0;
#X connect 1 0 3 0;
#X connect 2 0 5 0;
#X connect 3 0 2 0;
#X connect 4 0 0 0;
#X restore 339 363 pd scale;
#X connect 0 0 17 0;
#X connect 1 0 0 0;
#X connect 2 0 3 0;
#X connect 6 0 23 1;
#X connect 7 0 14 0;
#X connect 8 0 7 0;
#X connect 9 0 10 0;
#X connect 10 0 11 0;
#X connect 11 0 12 0;
#X connect 11 0 15 1;
#X connect 12 0 11 1;
#X connect 13 0 9 0;
#X connect 14 0 15 0;
#X connect 14 1 13 0;
#X connect 14 2 11 1;
#X connect 15 0 22 0;
#X connect 16 0 1 0;
#X connect 17 0 2 0;
#X connect 19 0 23 1;
#X connect 20 0 3 0;
#X connect 21 0 20 0;
#X connect 22 0 24 0;
#X connect 24 0 26 0;
#X connect 25 0 3 0;
#X connect 26 0 23 0;
#X restore 97 363 pd graphical-mean;
#X text 101 394 More means:;
#X obj 192 394 list-geometric-mean;
#X obj 192 415 list-harmonic-mean;
#N canvas 510 66 494 396 META 0;
#X text 12 25 LICENSE SIBSD;
#X text 12 115 AUTHOR Frank Barknecht;
#X text 12 135 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 calculate the arithmetric mean of a list
of floats;
#X text 12 95 OUTLET_0 float;
#X restore 466 421 pd META;
#X connect 0 0 3 0;
#X connect 1 0 5 0;
#X connect 2 0 1 0;
#X connect 5 0 0 0;
#X connect 6 0 0 0;
#X connect 7 0 0 0;