Forums > MaxMSP

selecting the output from a coll list

January 29, 2008 | 11:30 pm

I have a coll object that gets different numbers fromn the internet. Sometimes this list contains the same number many times in a row. To avoid the music I make becoming oring, I would like to output only the different numbers that are received. How do I do that?


January 30, 2008 | 12:23 am

On 30 janv. 08, at 00:30, Samuel Van Ransbeeck wrote:

> I have a coll object that gets different numbers fromn the internet.
> Sometimes this list contains the same number many times in a row. To
> avoid the music I make becoming oring, I would like to output only
> the different numbers that are received. How do I do that?

Why not using a [coll] for that too ;-) As indexes are unique, if you
fill the coll with your data, and you dump it and recollect the things
together you’ll get only the unique items.

ej

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 323 150 79 196617 3 2 9 9 2 3 3 2;
#P message 255 336 50 196617 3 2 9;
#P newex 255 313 62 196617 prepend set;
#P newex 241 178 82 196617 t dump l clear;
#P newex 255 286 46 196617 zl group;
#N coll ;
#P newobj 241 261 53 196617 coll;
#P newex 277 225 49 196617 append 0;
#P newex 277 202 47 196617 zl iter 1;
#P message 241 150 70 196617 1 2 2 4 1 1 4;
#P fasten 5 2 3 0 318 200 336 200 336 252;
#P connect 0 0 5 0;
#P connect 5 1 1 0;
#P connect 5 0 3 0;
#P connect 8 0 5 0;
#P connect 6 0 7 0;
#P connect 4 0 6 0;
#P connect 2 0 3 0;
#P connect 1 0 2 0;
#P connect 3 1 4 0;
#P connect 3 3 4 0;
#P window clipboard copycount 9;


January 30, 2008 | 5:52 pm

There is nothing necessarily boring about repeated notes. ‘Jingle Bells’ is one of the most popular songs of all time.

But if you want to filter out repeats, how about [change]?


January 30, 2008 | 6:05 pm

On 30 janv. 08, at 18:52, Peter Castine wrote:

> There is nothing necessarily boring about repeated notes. ‘Jingle
> Bells’ is one of the most popular songs of all time.
>
> But if you want to filter out repeats, how about [change]?

Sure but you have to reorder the list first, if the elements are not
consecutive. /* Rumors: in Max 5, zl might have a new mode to filter
duplicates in a list */

ej

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 417 363 109 196617 1 2 4;
#P newex 417 340 62 196617 prepend set;
#P message 489 256 92 196617 set -2147483648;
#P newex 434 280 40 196617 change;
#P newex 417 192 44 196617 t b l b;
#P newex 417 309 46 196617 zl group;
#P newex 434 248 47 196617 zl iter 1;
#P newex 434 220 40 196617 zl sort;
#P message 323 150 79 196617 3 2 9 9 2 3 3 2;
#P message 255 363 50 196617 1 2 4;
#P newex 255 340 62 196617 prepend set;
#P newex 241 178 82 196617 t dump l clear;
#P newex 255 286 46 196617 zl group;
#N coll ;
#P newobj 241 261 53 196617 coll;
#P newex 277 225 49 196617 append 0;
#P newex 277 202 47 196617 zl iter 1;
#P message 241 150 70 196617 1 2 2 4 1 1 4;
#P connect 8 0 5 0;
#P connect 8 0 12 0;
#P connect 0 0 5 0;
#P connect 0 0 12 0;
#P connect 14 0 13 0;
#P fasten 12 2 14 0 456 216 494 216;
#P connect 12 0 11 0;
#P connect 12 1 9 0;
#P connect 11 0 15 0;
#P connect 15 0 16 0;
#P connect 13 0 11 0;
#P connect 10 0 13 0;
#P connect 9 0 10 0;
#P connect 3 3 4 0;
#P connect 3 1 4 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P connect 4 0 6 0;
#P connect 6 0 7 0;
#P connect 5 0 3 0;
#P connect 5 1 1 0;
#P fasten 5 2 3 0 318 200 336 200 336 252;
#P window clipboard copycount 17;


January 30, 2008 | 7:40 pm

Lunique?

On 1/30/08 1:05 PM, "Emmanuel Jourdan" wrote:

> On 30 janv. 08, at 18:52, Peter Castine wrote:
>
>> There is nothing necessarily boring about repeated notes. ‘Jingle
>> Bells’ is one of the most popular songs of all time.
>>
>> But if you want to filter out repeats, how about [change]?
>
> Sure but you have to reorder the list first, if the elements are not
> consecutive. /* Rumors: in Max 5, zl might have a new mode to filter
> duplicates in a list */
>
> ej
>
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P message 417 363 109 196617 1 2 4;
> #P newex 417 340 62 196617 prepend set;
> #P message 489 256 92 196617 set -2147483648;
> #P newex 434 280 40 196617 change;
> #P newex 417 192 44 196617 t b l b;
> #P newex 417 309 46 196617 zl group;
> #P newex 434 248 47 196617 zl iter 1;
> #P newex 434 220 40 196617 zl sort;
> #P message 323 150 79 196617 3 2 9 9 2 3 3 2;
> #P message 255 363 50 196617 1 2 4;
> #P newex 255 340 62 196617 prepend set;
> #P newex 241 178 82 196617 t dump l clear;
> #P newex 255 286 46 196617 zl group;
> #N coll ;
> #P newobj 241 261 53 196617 coll;
> #P newex 277 225 49 196617 append 0;
> #P newex 277 202 47 196617 zl iter 1;
> #P message 241 150 70 196617 1 2 2 4 1 1 4;
> #P connect 8 0 5 0;
> #P connect 8 0 12 0;
> #P connect 0 0 5 0;
> #P connect 0 0 12 0;
> #P connect 14 0 13 0;
> #P fasten 12 2 14 0 456 216 494 216;
> #P connect 12 0 11 0;
> #P connect 12 1 9 0;
> #P connect 11 0 15 0;
> #P connect 15 0 16 0;
> #P connect 13 0 11 0;
> #P connect 10 0 13 0;
> #P connect 9 0 10 0;
> #P connect 3 3 4 0;
> #P connect 3 1 4 0;
> #P connect 1 0 2 0;
> #P connect 2 0 3 0;
> #P connect 4 0 6 0;
> #P connect 6 0 7 0;
> #P connect 5 0 3 0;
> #P connect 5 1 1 0;
> #P fasten 5 2 3 0 318 200 336 200 336 252;
> #P window clipboard copycount 17;
>

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


January 30, 2008 | 10:34 pm

On 30 janv. 08, at 20:40, Gary Lee Nelson wrote:

> Lunique?

wait and see ;-)

ej


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