how to decide what input provides the biggest number?

anamaria's icon

Hi,

I have four streams of data, and I want to do realtime analysis of which data stream that provides the biggest numbers.

So far I have made a really clumpsy solution with an if-statement: if$i1>$i2 && $i3 then bang

The problem is that I have to bang the if-statement for input 2 and 3 aso. It soon becomes a pain to deal with more than 2 3 datas treams.

I wonder if there is a list object that can tell at what position in a list the highest value is ...

Thanks,

Ana

MIB's icon
Max Patch
Copy patch and select New From Clipboard in Max.

have a look at [zl sort] and [zl slice]

Chris Muir's icon

Lpeak from the Lobjects does this.

anamaria's icon

Thanks, yes, I know how to find the biggest number, but what I want to do is to find out from which inlet the biggest number came from (at which position in the list is the biggest number) ...

anamaria's icon

Thanks for Lpeak, this is just what I was looking for;-)

MIB's icon

use the right outlet from [zl sort] to get the index...

Emmanuel Jourdan's icon

FWIW, maximum object outputs the highest value and it's index.

MIB's icon

I always forget that you can send lists to [maximum]... thanks for that one