Highest one from a b or c float


    Nov 06 2009 | 5:49 pm
    Hello,
    I wonder whether there is an object that can show which of its inlets has the highest value?
    Any help appreciated.
    Krisztian
    code:

    • Nov 06 2009 | 10:11 pm
      Your code doesn't show much of a starting point!
      3 numbers >> pak 0. 0. 0. >> maximum 0. >> voila
      one of several ways.
      David
    • Nov 06 2009 | 10:44 pm
      hi David, thanks for the reply, yes my start is not the best, sorry.
      with the use of maximum, I only get the value, not the sender, not the index/inlet number. Sorry if I was a bit unclear.
      any help appreciated.
      K
    • Nov 06 2009 | 11:08 pm
      no max on this computer but i will try it blind.
      step 1 is to find the highest value:
      [pak 0. 0. 0.]
      [maximum]
      step 2 then ... comparing all input numbers versus the mean output:
      [t l l]
      [zl iter 1] [zl len]
      [== 0.] (right inlet from maximum)
      [zl group]
      this will end up with a list "0 1 0", which can now be decoded
      to three outlets using [unpack] and [select 1] or whatever you
      want the output to be.
      when i am back at max i can make you a better version for sure.
    • Nov 06 2009 | 11:21 pm
      Maximum does give you the index of it's current highest input number. Maybe I'm misunderstanding what you need.
      edit---- just read your post properly, don't mind me! ----
    • Nov 06 2009 | 11:38 pm
      did you look at the help file for maximum? Take a look at the second outlet.
      David
    • Nov 06 2009 | 11:56 pm
      hi, only the Max5 object does the second outlet, unfortunately.
      My EEG patch seems to work faster on Max4
      I will try what Roman Thilenius suggested.
      thank you all.
      Krisztian
    • Nov 07 2009 | 11:29 am
      dear Roman
      sMaRt !!!
      thank very much.
      Krisztian
    • Nov 13 2009 | 3:53 pm
      with zl sub it would be even easier, feed the output of maximum into the right inlet of zl sub, but pay attention on float types (your example had an int maximum but float pak...)
      I am too lazy to fire up Max 4 to create the patch...;-)
    • Nov 13 2009 | 4:26 pm
      hello Stefan, yes you are right, it is easier, thanks a lot.
      Krisztian
    • Nov 13 2009 | 4:52 pm
      If you got only 3 inlets, you could use expr quite easily as well :
      Charles
    • Nov 14 2009 | 10:44 pm
      hello Charles
      thanks, good to know that there are many ways..
      best, K
    • Nov 20 2009 | 4:21 pm
      Hello,
      I wonder whether there is a way to make the following code a bit quicker (CPU friendlier) in Max 4.6.
      I have 6 constantly changing inlets, where I look for the maximum. As a result I get a list with 0s and 1s. 1 is the maximum. The list is bang even if it doesn't change.
      In the subpatch I would like to use channel that is on the maximum to trigger a sound, but only if it can keep being the maximum for a certain amount of time (3sec).
      Is there a way to make this easier or smarter perhaps?
      Any help appreciated,
      all the best
      Krisztian