Subject: MAX Digest - 22 Jul 1999 to 23 Jul 1999 (#1999-220)
Date: Sat, 24 Jul 1999 00:00:15 -0400
From:
Automatic digest processor <LISTSERV@LISTS.MCGILL.CA>
Reply-To: chris@MUSIC.MCGILL.CA
To: Recipients of MAX digests <MAX@LISTS.MCGILL.CA>


There are 4 messages totalling 192 lines in this issue.

Topics of the day:

  1. Three smallest of 165 (2)
  2. MAX Digest - 21 Jul 1999 to 22 Jul 1999 (#1999-219)
  3. Belated thanks

----------------------------------------------------------------------

Date:Fri, 23 Jul 1999 10:48:45 +0000
From:Trond Lossius <lossius@IAFRICA.COM.NA>
Subject: Re: Three smallest of 165

Jocelyn Robert wrote:

> I have series of 165 numbers. They are indexed (from 1 to 165) and their
> values are between 0 and 20,000. I need to find the 3 smallest ones and be
> able to say : ok, number #12, #67 and #101. The process has to be redone
> every 2 seconds. Any idea how to identify these 3 ?

Here's a solution using Lobjects. Lobjects can take lists of up to 256 items.

Trond L.

max v2;
#N vpatcher 387 174 787 474;
#P newex 185 160 75 196617 Lcomp 100000;
#P message 258 240 56 196617;
#P newex 258 215 60 196617 prepend set;
#P message 95 241 50 196617;
#P newex 95 216 60 196617 prepend set;
#P message 160 70 124 196617 1 2 3 4 5 6 7 8 9 0 -5 99;
#P newex 160 138 35 196617 Ltop 3;
#P newex 160 115 75 196617 Lcomp 100000;
#P comment 68 259 128 196617 Index (first list item is 0!);
#P comment 258 259 35 196617 Values;
#P connect 3 0 5 0;
#P connect 5 0 6 0;
#P connect 4 0 2 0;
#P connect 2 0 3 0;
#P connect 3 1 9 0;
#P connect 9 0 7 0;
#P connect 7 0 8 0;
#P pop;

------------------------------

Date:Fri, 23 Jul 1999 12:09:59 +0200
From:Jeffrey Burns <jeff@BERLIN.SNAFU.DE>
Subject: Re: MAX Digest - 21 Jul 1999 to 22 Jul 1999 (#1999-219)

>I have series of 165 numbers. They are indexed (from 1 to 165) and their
>values are between 0 and 20,000. I need to find the 3 smallest ones and be
>able to say : ok, number #12, #67 and #101. The process has to be redone
>every 2 seconds. Any idea how to identify these 3 ?

Here's the solution. (This patch indexes the numbers for you.)


Cheers,

Jeff Burns

max v2;
#N vpatcher 50 40 463 409;
#P button 60 22 15 0;
#P newex 80 148 25 196617 + 1;
#P newex 80 117 37 196617 t i b;
#P newex 60 64 50 196617 t b l b;
#P number 217 298 35 9 0 0 0 3;
#P number 159 298 35 9 0 0 0 3;
#P number 101 298 35 9 0 0 0 3;
#P newex 80 206 31 196617 t i b;
#P newex 101 268 185 196617 gate 4;
#P newex 101 239 92 196617 counter;
#P newex 22 117 53 196617 Uzi 20000;
#P newex 151 117 29 196617 1;
#P newex 107 148 99 196617 counter;
#P newex 80 178 37 196617 offer;
#P newex 80 95 33 196617 iter;
#P message 60 42 312 196617 23 100 46 57 68 20 80 90 52 647 756 54 123 0
4567 15437;
#P connect 15 0 0 0;
#P connect 1 0 13 0;
#P connect 0 0 12 0;
#P connect 2 0 8 0;
#P connect 3 0 2 1;
#P connect 6 0 7 0;
#P connect 13 1 3 0;
#P connect 13 0 14 0;
#P fasten 4 0 6 2 156 140 146 140;
#P connect 4 0 3 2;
#P fasten 5 2 2 0 69 172 85 172;
#P fasten 12 0 5 0 65 99 27 99;
#P connect 12 1 1 0;
#P connect 7 0 9 0;
#P fasten 12 2 4 0 105 88 156 88;
#P connect 7 1 10 0;
#P connect 7 2 11 0;
#P connect 8 1 6 0;
#P fasten 8 0 7 1 85 229 281 229;
#P connect 14 0 2 0;
#P pop;

http://www.snafu.de/~jeff

------------------------------

Date:Thu, 22 Jul 1999 18:47:11 -0400
From:Eric Singer <eric@ERICSINGER.COM>
Subject: Re: Three smallest of 165

Put them into a coll and use the "sort" message. See example patch below.

Eric


At 9:17 AM -0400 7/22/99, Jocelyn Robert wrote:
>Hello all
>
>I have series of 165 numbers. They are indexed (from 1 to 165) and their
>values are between 0 and 20,000. I need to find the 3 smallest ones and be
>able to say : ok, number #12, #67 and #101. The process has to be redone
>every 2 seconds. Any idea how to identify these 3 ?
>
>Jocelyn Robert


>
>Avatar
>541 Saint-Vallier Est #4
>Quebec, Qc
>Canada
G1K 3P9
>tel (418) 522-8918
>fax (418) 522-6412
>avatar@meduse.org
>http://www.meduse.org/avatar


max v2;
#N vpatcher 156 112 563 506;
#P newex 182 338 85 196617 print value/index;
#P comment 11 46 175 196617 by Eric Singer (eric@ericsinger.com);
#P button 167 85 15 0;
#P newex 167 110 40 196617 b 3;
#P newex 182 313 40 196617 pack i i;
#P message 293 243 31 196617 clear;
#P message 38 243 131 196617 sort -1 0 \, bang \, bang \, bang;
#P newex 182 192 85 196617 t b i;
#P newex 182 243 85 196617 pack i i;
#P newex 182 216 72 196617 counter 1 165;
#P newex 182 143 43 196617 Uzi 165;
#P newex 182 167 74 196617 random 20001;
#N coll ;
#P newobj 182 280 70 196617 coll;
#P comment 11 28 235 196617 Sort list and output 3 lowest numbers with indices;
#P connect 1 1 9 1;
#P connect 1 0 9 0;
#P connect 2 0 6 0;
#P connect 3 0 2 0;
#P connect 11 0 10 0;
#P connect 4 0 5 0;
#P connect 5 0 1 0;
#P connect 6 0 4 0;
#P connect 6 1 5 1;
#P connect 7 0 1 0;
#P connect 8 0 1 0;
#P connect 9 0 13 0;
#P fasten 10 0 7 0 172 133 43 133;
#P connect 10 1 3 0;
#P fasten 10 2 8 0 202 133 298 133;
#P pop;

------------------------------

Date:Fri, 23 Jul 1999 17:06:29 +0000
From:Robb Drinkwater <rdrink@ARTIC.EDU>
Subject: Belated thanks

I was w/o email the last week so sorry this is late:

A big thanks to *everyone* who responded with information & insite to my
inquiry about the Winkler book. It's things like this that demonstrate
the strength & purpose of this list.

--
~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
Robb Drinkwater
SAIC Sound Department
312 345 3573
~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^

------------------------------

End of MAX Digest - 22 Jul 1999 to 23 Jul 1999 (#1999-220)


**********************************************************