[PD] Buffering numbers

Frank Barknecht fbar at footils.org
Fri Oct 21 19:20:00 CEST 2005


Hallo,
Sylvain hat gesagt: // Sylvain wrote:

> Here it is : I am trying to retrieve the n last numbers of a float 
> stream in order to sum them, and I want the n numbers to be refreshed 
> every time a new value is coming (Like a hardware register does with bits)

Ah, this is another job for the mighty power that has come to pd-0.39
with the [list] object family.

It only taketh two (2!) objects to solve this fine riddle. 

I also added a dynamic setter for the register's size, however summing
is left as an exercise for the reader.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 417 318 723 395 10;
#X obj 153 175 cnv 15 150 80 empty empty empty 20 12 0 14 -233017 -66577
0;
#X floatatom 180 150 5 0 0 0 - - -;
#X floatatom 326 65 5 0 0 2 change-size - -;
#X obj 326 112 t f b;
#X text 378 110 first reset (b) \, then set new length (f).;
#X obj 104 313 print last_x;
#X obj 326 89 - 1;
#X msg 82 110 0 \, 1 \, 2 \, 3 \, 4 \, 5 \, 6 \, 7 \, 8 \, 9 \,;
#X floatatom 360 91 5 0 0 1 - - -;
#X text 311 195 Right outlet is responsible to first fill the list
;
#X text 312 211 Left outlet then only lets the smaller list pass.;
#X obj 180 183 list;
#X obj 180 228 list split 4;
#X connect 1 0 11 0;
#X connect 2 0 6 0;
#X connect 3 0 12 1;
#X connect 3 1 11 1;
#X connect 6 0 3 0;
#X connect 7 0 11 0;
#X connect 8 0 3 0;
#X connect 11 0 5 0;
#X connect 11 0 12 0;
#X connect 12 0 11 1;
#X connect 12 2 11 1;


More information about the Pd-list mailing list