Hi all,
I've been looking for an object or abstraction which gives the highest and lowest value from a stream of numbers. If anyone has any suggestions it would be great to hear from you.
Many thanks Alex
Alex Lucas wrote:
Hi all,
I've been looking for an object or abstraction which gives the highest and lowest value from a stream of numbers. If anyone has any suggestions it would be great to hear from you.
[max] and [min] are your friends here. just feed the output of the object back to its right input. the only remaining problem is how to initialize the objects. a fool-proof approach is the first element of the stream.
when you are using lists instead of streams, there are also specialised objects (if you don't want to serialize the list into single atoms), e.g. [minmax] in zexy, but i am sure there is an internal-only solution in the list-abs by fbar.
fmgasdr IOhannes
Hallo, IOhannes m zmoelnig hat gesagt: // IOhannes m zmoelnig wrote:
when you are using lists instead of streams, there are also specialised objects (if you don't want to serialize the list into single atoms), e.g. [minmax] in zexy, but i am sure there is an internal-only solution in the list-abs by fbar.
[list-minmax]. ;)
You can rip the internals to get a minmax-finder for streams of numbers: All that list-minmax.pd does, is serialize the list, find min and max with [min] and [max] and a [spigot]-based "once" and send the results to the outlets.
Frank Barknecht _ ______footils.org_ __goto10.org__
attached min_max.pd Merry patching Steffen Leve Poulsen
IOhannes m zmoelnig skrev:
Alex Lucas wrote:
Hi all,
I've been looking for an object or abstraction which gives the highest and lowest value from a stream of numbers. If anyone has any suggestions it would be great to hear from you.
[max] and [min] are your friends here. just feed the output of the object back to its right input. the only remaining problem is how to initialize the objects. a fool-proof approach is the first element of the stream.
when you are using lists instead of streams, there are also specialised objects (if you don't want to serialize the list into single atoms), e.g. [minmax] in zexy, but i am sure there is an internal-only solution in the list-abs by fbar.
fmgasdr IOhannes
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
#N canvas 455 155 592 509 10; #X obj 125 47 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1; #X obj 64 104 random 567; #X obj 119 129 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 64 77 metro 23; #X text 139 127 <- reset; #X floatatom 64 220 5 0 0 0 - - -; #X floatatom 119 222 5 0 0 0 - - -; #X floatatom 304 377 5 0 0 0 - - -; #X floatatom 384 380 5 0 0 0 - - -; #X obj 334 127 t l b; #X obj 310 212 t l; #X msg 334 91 4 7 34 46 1 45 103 2 26; #X obj 254 242 list split 1; #X msg 312 57 63 44 21 56 81 4 27 15 111; #X obj 290 310 cnv 15 100 60 empty empty empty 20 12 0 14 -233017 -66577 0; #N canvas 0 0 462 312 min_max 0; #X obj 111 60 inlet; #X obj 258 89 inlet; #X obj 111 264 outlet; #X obj 191 261 outlet; #X obj 111 214 min; #X obj 147 212 f; #N canvas 0 0 458 308 first 0; #X obj 181 8 inlet; #X obj 181 255 outlet; #X obj 181 149 spigot 1; #X obj 226 126 1; #X obj 181 46 route float bang; #X obj 181 181 t f b; #X obj 251 150 0; #X connect 0 0 4 0; #X connect 2 0 5 0; #X connect 3 0 2 1; #X connect 4 0 2 0; #X connect 4 1 3 0; #X connect 5 0 1 0; #X connect 5 1 6 0; #X connect 6 0 2 1; #X restore 258 117 pd first; #X obj 222 215 f; #X obj 191 214 max; #X obj 111 100 t f f; #X connect 0 0 9 0; #X connect 1 0 6 0; #X connect 4 0 5 0; #X connect 4 0 2 0; #X connect 5 0 4 1; #X connect 6 0 4 1; #X connect 6 0 8 1; #X connect 7 0 8 1; #X connect 8 0 7 0; #X connect 8 0 3 0; #X connect 9 0 4 0; #X connect 9 0 8 0; #X connect 9 1 6 0; #X restore 304 332 pd min_max; #X obj 47 153 cnv 15 100 60 empty empty empty 20 12 0 14 -233017 -66577 0; #N canvas 0 0 458 308 min_max 0; #X obj 111 60 inlet; #X obj 258 89 inlet; #X obj 111 264 outlet; #X obj 191 261 outlet; #X obj 111 214 min; #X obj 147 212 f; #N canvas 0 0 466 316 first 0; #X obj 181 8 inlet; #X obj 181 255 outlet; #X obj 181 149 spigot 1; #X obj 226 126 1; #X obj 181 46 route float bang; #X obj 181 181 t f b; #X obj 251 150 0; #X connect 0 0 4 0; #X connect 2 0 5 0; #X connect 3 0 2 1; #X connect 4 0 2 0; #X connect 4 1 3 0; #X connect 5 0 1 0; #X connect 5 1 6 0; #X connect 6 0 2 1; #X restore 258 117 pd first; #X obj 222 215 f; #X obj 191 214 max; #X obj 111 100 t f f; #X connect 0 0 9 0; #X connect 1 0 6 0; #X connect 4 0 5 0; #X connect 4 0 2 0; #X connect 5 0 4 1; #X connect 6 0 4 1; #X connect 6 0 8 1; #X connect 7 0 8 1; #X connect 8 0 7 0; #X connect 8 0 3 0; #X connect 9 0 4 0; #X connect 9 0 8 0; #X connect 9 1 6 0; #X restore 64 172 pd min_max; #X connect 0 0 3 0; #X connect 1 0 17 0; #X connect 2 0 17 1; #X connect 3 0 1 0; #X connect 9 0 12 0; #X connect 9 1 15 1; #X connect 10 0 12 0; #X connect 11 0 9 0; #X connect 12 0 15 0; #X connect 12 1 10 0; #X connect 13 0 9 0; #X connect 15 0 7 0; #X connect 15 1 8 0; #X connect 17 0 5 0; #X connect 17 1 6 0;