[PD] newbie: get average

Maurizio Umberto Puxeddu umbpux at tin.it
Sun Mar 9 05:16:25 CET 2003


Aren't they "history" and other averaging objects in MaxLib or Zexy? Did
you searched Pure Data Base?

Ok, if it's in zexy, it's a zexy suggestion and not a sexy one, so it
could not work for you.

Maurizio Umberto Puxeddu.

On Sun, 2003-03-09 at 05:03, Marc Lavallée wrote:
> The sexiest solution would be to use the fifo object from the MaxLib
> library, but it doesn't work as expected. So here's my "pure" solution.
> It's ugly but it works. 
> --
> Marc
> 
> Le sam 08/03/2003 à 20:19, Christoph Schwarz a écrit :
> > hi there,
> > 
> > here's a simple pd problem which
> > i can't solve right now. 
> > 
> > I want to calculate an average of 
> > the last 4 numbers received
> > by an object. 
> > 
> > any sexy suggestions?
> > 
> 
> ----
> 

> #N canvas 413 248 253 209 10;
> #N canvas 290 48 328 507 fifo_4 0;
> #X obj 241 187 f;
> #X floatatom 241 139 5 0 0 0 - - -;
> #X obj 242 236 f;
> #X obj 243 287 f;
> #X obj 134 372 pack 0 0 0 0 0;
> #X obj 86 88 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
> -1;
> #X msg 134 400 \$5 \$4 \$3 \$2;
> #X obj 86 62 inlet;
> #X obj 241 116 inlet;
> #X obj 134 437 outlet;
> #X text 240 97 fifo in;
> #X obj 241 210 t f b;
> #X obj 242 261 t f b;
> #X obj 243 311 t f b;
> #X obj 68 222 +;
> #X msg 84 199 0;
> #X floatatom 68 244 5 0 0 0 - - -;
> #X obj 52 264 int;
> #X obj 52 313 outlet;
> #X obj 52 289 / 4;
> #X text 51 332 average;
> #X text 133 456 last 4;
> #X obj 241 160 t f b b;
> #X obj 227 344 f;
> #X obj 203 309 f;
> #X obj 180 280 f;
> #X obj 157 250 f;
> #X text 84 41 dump fifo;
> #X obj 86 112 t b b b b b b b;
> #X connect 0 0 11 0;
> #X connect 1 0 22 0;
> #X connect 2 0 12 0;
> #X connect 3 0 13 0;
> #X connect 4 0 6 0;
> #X connect 5 0 28 0;
> #X connect 6 0 9 0;
> #X connect 7 0 5 0;
> #X connect 8 0 1 0;
> #X connect 11 0 2 1;
> #X connect 11 0 25 1;
> #X connect 11 1 2 0;
> #X connect 12 0 3 1;
> #X connect 12 0 24 1;
> #X connect 12 1 3 0;
> #X connect 13 0 23 1;
> #X connect 14 0 16 0;
> #X connect 15 0 14 1;
> #X connect 16 0 14 1;
> #X connect 16 0 17 1;
> #X connect 17 0 19 0;
> #X connect 19 0 18 0;
> #X connect 22 0 0 1;
> #X connect 22 0 26 1;
> #X connect 22 1 0 0;
> #X connect 23 0 4 4;
> #X connect 23 0 14 0;
> #X connect 24 0 4 3;
> #X connect 24 0 14 0;
> #X connect 25 0 4 2;
> #X connect 25 0 14 0;
> #X connect 26 0 4 1;
> #X connect 26 0 14 0;
> #X connect 28 0 17 0;
> #X connect 28 1 4 0;
> #X connect 28 2 26 0;
> #X connect 28 3 25 0;
> #X connect 28 4 24 0;
> #X connect 28 5 23 0;
> #X connect 28 6 15 0;
> #X restore 45 116 pd fifo_4;
> #X text 34 21 4 numbers fifo with average;
> #X obj 45 160 print average;
> #X obj 103 138 print last;
> #X obj 103 74 random 100;
> #X floatatom 103 97 5 0 0 0 - - -;
> #X obj 45 45 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
> -1;
> #X text 46 62;
> #X connect 0 0 2 0;
> #X connect 0 1 3 0;
> #X connect 4 0 5 0;
> #X connect 5 0 0 1;
> #X connect 6 0 4 0;
> #X connect 6 0 0 0;






More information about the Pd-list mailing list