#N canvas 532 40 558 578 10;
#X obj 2 537 cnv 15 552 21 empty empty empty 20 12 0 14 -233017 -33289
0;
#X obj 3 360 cnv 3 550 3 empty empty inlets 8 12 0 13 -228856 -1 0
;
#X obj 3 455 cnv 3 550 3 empty empty outlets 8 12 0 13 -228856 -1 0
;
#X obj 3 489 cnv 3 550 3 empty empty arguments 8 12 0 13 -228856 -1
0;
#X obj 78 464 cnv 17 3 17 empty empty 0 5 9 0 16 -228856 -162280 0
;
#X text 110 369 signal;
#X msg 344 186 rms;
#X msg 344 144 bipolar;
#X msg 344 165 absolute;
#X obj 79 369 cnv 17 3 80 empty empty 0 5 9 0 16 -228856 -162280 0
;
#X text 116 385 float;
#X text 169 369 - the signal to be averaged;
#X text 110 464 signal;
#X text 98 497 1) float;
#X text 98 515 2) symbol;
#X obj 2 4 cnv 15 553 42 empty empty empty 20 12 0 14 -233017 -66577
0;
#N canvas 0 22 450 278 (subpatch) 0;
#X coords 0 1 100 -1 554 42 1 0 0;
#X restore 2 3 graph;
#X obj 305 4 cnv 15 250 40 empty empty empty 12 13 0 18 -128992 -233080
0;
#N canvas 382 141 749 319 (subpatch) 0;
#X coords 0 -1 1 1 252 42 2 100 100;
#X restore 304 3 pd;
#X text 104 402 bipolar;
#X text 98 418 absolute;
#X text 128 434 rms;
#X obj 17 56 cyclone/comment 0 14 DejaVu\ Sans\ Mono empty 0 0 0 0
0 255 255 255 0 0 Signal moving average;
#X obj 16 4 cyclone/comment 0 33 DejaVu\ Sans\ Mono empty 0 0 0 0 0
255 255 255 0 0 average~;
#X obj 322 28 cyclone/comment 0 13 DejaVu\ Sans\ Mono empty 0 224 228
220 0 255 255 255 0 0 Objects cloned from Max/MSP;
#X obj 363 4 cyclone/comment 0 24 DejaVu\ Sans\ Mono empty 0 224 228
220 0 255 255 255 0 0 cyclone;
#X obj 231 240 cyclone/scope~ 165 107 2 3 64 -1 1 300 0 0 0 205 229
232 74 79 77 96 98 102 0 empty;
#X text 169 515 - sets mode: bipolar (default) \, absolute or rms;
#X obj 176 145 hsl 150 15 1 50 1 0 adsfadsg ahhah empty -2 -8 0 10
-228856 -1 -1 0 1;
#X obj 231 170 noise~;
#X text 181 144 'n' samples to average;
#X text 169 464 - the moving average over the last 'n' samples;
#X text 169 497 - maximum and initial 'n' samples (default 100 \, minimum
1);
#X text 169 402 - outputs average over positive and negative values
;
#X text 169 418 - outputs average over absolute values;
#X text 169 434 - outputs 'root mean square' (RMS) values;
#X text 169 385 - 'n': number of last samples to apply the average
to;
#N canvas 685 122 425 509 backwards 0;
#X obj 89 304 cyclone/number~;
#A saved 0 0 100 -inf inf #2a3434 #ffffff #b6fefd;
#X obj 227 274 cyclone/snapshot~ 1;
#X obj 193 344 vsl 15 128 -1 1 0 0 gsgg fdssd empty 0 -9 0 10 -228856
-1 -1 6350 1;
#X obj 227 210 cyclone/rand~ 10;
#X obj 227 242 cyclone/average~ 44100;
#X obj 227 344 vsl 15 128 -1 1 0 0 gsgg fdssd empty 0 -9 0 10 -228856
-1 -1 0 1;
#X text 212 400 0;
#X text 213 336 1;
#X text 208 465 -1;
#X obj 227 304 nbx 9 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
-228856 -1 -1 0 256;
#X text 32 123 For a float output now \, you have to convert the signal
with objects like vanilla's [snapshot~] \, [cyclone/snapshot~] or the
new [cyclone/number~] that also works for only displaying the values.
;
#X text 32 18 [average~] used to have a control number output in Max
4 \, but Max 5 updated it a signal output that provides sample accurate
precision!, f 59;
#X text 32 64 Originally developed in the Max 4 era \, cyclone versions
up to '0.2 beta' include this old behaviour of [average~]. Cyclone
0.3 updates all objects to Max 7 \, and [average~] is the only one
that may require adapting older patches.;
#X connect 0 1 2 0;
#X connect 1 0 9 0;
#X connect 3 0 4 0;
#X connect 4 0 0 0;
#X connect 4 0 1 0;
#X connect 9 0 5 0;
#X restore 459 316 pd backwards \; compatibility;
#N canvas 837 154 467 357 moving 0;
#X obj 157 106 noise~;
#X obj 238 163 cyclone/average~ 8;
#X text 57 24 In the default bipolar mode \, [average~] also acts as
a regular moving average filter \, which is a kind of lowpass filter.
Listen to the difference below.;
#X obj 238 229 ./out~;
#X obj 114 229 ./out~;
#X connect 0 0 1 0;
#X connect 0 0 4 0;
#X connect 0 0 4 1;
#X connect 1 0 3 0;
#X connect 1 0 3 1;
#X restore 453 261 pd moving \; average filter;
#N canvas 915 134 414 521 more 0;
#X obj 94 399 cyclone/scope~ 189 102 2 3 64 -1 1 300 0 0 0 205 229
232 74 79 77 96 98 102 0 empty;
#X obj 94 371 cyclone/average~ 100;
#X obj 94 294 noise~;
#X obj 179 312 nbx 3 14 1 441 0 0 sadgaf ahah empty 0 -8 0 10 -228856
-1 -1 1 256;
#X obj 182 262 hsl 150 15 1 100 1 0 adsfadsg ahhah empty -2 -8 0 10
-228856 -1 -1 0 1;
#X text 185 261 'n' samples to average;
#X obj 179 287 int;
#X text 23 65 The first argument specifies the maximum buffer size
to average the signal. You can change with a float input the number
of samples to average but values gretaer than the argument are clipped
to that maximum value. The minimum average value is "1" \, which makes
it the original signal for the bipolar mode \, or the absolute value
of the original signal (for absolute and rms mode). Values smaller
than "1" are simply ignored.;
#X obj 179 335 change;
#X text 23 177 Each time [average~] receives a number value \, it clears
the samples from the buffer \, even if the number is the same as the
previously set number. So you may have to use the [change] object if
you don't want the same number to clear the buffer., f 60;
#X text 23 16 A moving/running average outputs a mean between a given
number of last samples ('n') for each sample. Only integer values make
sense \, so floats are converted to integers!, f 60;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 3 0 8 0;
#X connect 4 0 6 0;
#X connect 6 0 3 0;
#X connect 8 0 1 0;
#X restore 447 295 pd more details;
#N canvas 271 131 1132 382 average 0;
#X obj 90 125 cyclone/average~ 100 bipolar;
#X obj 90 155 cyclone/scope~ 159 105 2 3 64 -1 1 300 0 0 0 205 229
232 74 79 77 96 98 102 0 empty;
#X obj 461 149 cyclone/scope~ 159 105 2 3 64 -1 1 300 0 0 0 205 229
232 74 79 77 96 98 102 0 empty;
#X obj 833 150 cyclone/scope~ 159 105 2 3 64 -1 1 300 0 0 0 205 229
232 74 79 77 96 98 102 0 empty;
#X text 368 26 Absolute mode: only absolute values are considered (negative
values atre converted to positive) \, then the mean is applied.;
#X text 756 26 Rms mode: average is the root mean square. The arithmetic
mean is performed on the squares of the values \, then the square root
is applied.;
#X text 18 31 Bipolar mode (default): a plain arithmetic mean over
positive and negative values.;
#X obj 461 117 cyclone/average~ 100 absolute;
#X obj 833 119 cyclone/average~ 100 rms;
#X text 28 298 The bipolar mode also acts as a moving average filter
\, as shown in the next subpatch.;
#X text 569 294 RMS values are the usual way to detect and measure
signal levels. The absolute average is often similar to the RMS \,
so it may work fine in some level detection tasks with the advantage
of being more efficient.;
#X obj 90 99 osc~ 500;
#X obj 461 91 osc~ 500;
#X obj 833 95 osc~ 500;
#X connect 0 0 1 0;
#X connect 7 0 2 0;
#X connect 8 0 3 0;
#X connect 11 0 0 0;
#X connect 12 0 7 0;
#X connect 13 0 8 0;
#X restore 441 240 pd average modes;
#X text 53 84 Use [average~] for a signal running/moving average over
the last 'n' given samples. The average is done in 3 modes: bipolar
(default) \, absolute and rms.;
#X text 351 126 modes:;
#X obj 173 170 nbx 2 15 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 12
-228856 -1 -1 0 256;
#X obj 231 212 cyclone/average~ 50;
#X obj 59 240 cyclone/scope~ 165 107 2 3 64 -1 1 300 0 0 0 205 229
232 74 79 77 96 98 102 0 empty;
#X obj 500 69 cyclone/setdsp~;
#X connect 6 0 44 0;
#X connect 7 0 44 0;
#X connect 8 0 44 0;
#X connect 28 0 43 0;
#X connect 29 0 44 0;
#X connect 29 0 45 0;
#X connect 43 0 44 0;
#X connect 44 0 26 0;
