Mercurial > hg > libxtract
view examples/puredata/simple-example.pd @ 214:f28f66faa016
Add "stateful" feature type with initial feature "last n"
Stateful feature extraction functions are functions that require state to be maintained between successive calls. This is necessary, for example when an accumulation of values is required, or changes need to be measured over time.
The initial xtract_last_n() function accumulates the last N (single) values from *data and writes them to *result
author | Jamie Bullock <jamie@jamiebullock.com> |
---|---|
date | Tue, 03 Jun 2014 21:17:07 +0100 |
parents | ca40a0dc29d6 |
children |
line wrap: on
line source
#N canvas 5 48 450 300 10; #X obj 154 42 osc~ 440; #X floatatom 154 180 8 0 0 0 - - -; #N canvas 619 86 450 300 spectral_mean 1; #X obj 144 80 xtract~ spectrum; #X obj 346 21 block~ 1024; #X obj 145 47 inlet~; #X obj 145 190 outlet; #X obj 145 129 xtract~ spectral_centroid; #X msg 269 57 list \$1; #X msg 270 11 44100; #X obj 270 33 / 1024; #X obj 67 130 print~; #X obj 73 104 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X connect 0 0 4 0; #X connect 0 0 8 0; #X connect 2 0 0 0; #X connect 4 0 3 0; #X connect 5 0 0 1; #X connect 6 0 7 0; #X connect 7 0 5 0; #X connect 9 0 8 0; #X restore 154 115 pd spectral_mean; #X connect 0 0 2 0; #X connect 2 0 1 0;