Forums > MaxMSP

### A "Largest Number" object?

Sep 26 2006 | 4:44 am

Hi guys,

I’m learning how to use MaxMSP for a tech elective at uni. It’s pretty fun. Anyway I was wondering if there was an object that can recieve a list of numbers and only output the largest one, or the 2 largest, or the three largest. I’d appreciate any help or advice.

The assignment I’m doing is a patch that can guess, relatively accurately, the key of the song you play into it, thru MIDI.

Sep 26 2006 | 5:12 am

maximum will give you the highest value of the list, but only one. If
you work on lists the Lobjects by Peter Elsea are also well worth
checking out. He has got an object named Ltop that reports the one or
more top values and their position in the list. Check http://www.maxobjects.com

While you are at it, and depending on how much time you have, you might
also want to take a look at one of the tutorials about Fuzzy logics that
Peter Elsea is offering.

Best,
Trond

Casey wrote:
> Hi guys,
>
> I’m learning how to use MaxMSP for a tech elective at uni. It’s pretty fun. Anyway I was wondering if there was an object that can recieve a list of numbers and only output the largest one, or the 2 largest, or the three largest. I’d appreciate any help or advice.
>
> The assignment I’m doing is a patch that can guess, relatively accurately, the key of the song you play into it, thru MIDI.

Sep 26 2006 | 10:01 am

On 26 sept. 06, at 07:12, Trond Lossius wrote:

> maximum will give you the highest value of the list, but only one.
> If you work on lists the Lobjects by Peter Elsea are also well
> worth checking out. He has got an object named Ltop that reports
> the one or more top values and their position in the list. Check

You can also achieve that with standart objects : sort the list,
select the first n elements.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 246 225 60 196617 loadmess 5;
#P comment 38 294 85 196617 extract the first;
#P window linecount 3;
#P comment 58 240 59 196617 sort in descending order;
#P window linecount 1;
#P comment 202 182 59 196617 make a list;
#P message 131 355 150 196617 1988 1983 1976 1976 1951;
#P newex 131 320 62 196617 prepend set;
#P number 246 250 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 114 73 15 0;
#P newex 131 291 125 196617 zl slice;
#P newex 131 253 54 196617 zl sort -1;
#P newex 131 179 67 196617 zl group 256;
#P newex 114 105 44 196617 uzi 150;
#P newex 114 138 70 196617 random 2000;
#P comment 131 75 126 196617 generate random numbers;
#P connect 13 0 7 0;
#P connect 3 0 4 0;
#P connect 8 0 9 0;
#P connect 5 0 8 0;
#P connect 7 0 5 1;
#P connect 6 0 2 0;
#P connect 4 0 5 0;
#P connect 1 0 3 0;
#P connect 2 1 3 0;
#P connect 2 0 1 0;
#P window clipboard copycount 14;

Best,
ej

Sep 26 2006 | 2:53 pm

[peak]
[maximum]
[maximum~]
[>]-(prepend set)-[i]

Jul 19 2016 | 3:12 pm

Hi, everyone.
…but what if I want not only know which is the highest number, but also from where does it come?
I have 5 floats that represent 5 different streams of data (in the following example every stream has a different color). I want to know the highest value, but also which is its own stream color (for example if the highest value comes from red stream, then the final message could become red, otherwise if the highest value comes from green stream, then the final message could become green, etc.)

Thanks

Example:

``````
-- Pasted Max  Patch, click to expand. --

```
```
Jul 19 2016 | 3:22 pm

Sorry guys, I’ve yet found the answer: maximum right outlet!
Thanks anyway.

Viewing 6 posts - 1 through 6 (of 6 total)

Forums > MaxMSP