identical elements in a list

studio7hz's icon

hi,

i have a list which looks like 70 70 43 70 43 22 43 70 22
i simply want to gather all the elements in the list that are identical to each other, and have them sent as a list. so as to have three lists with the identical elements groups:

list1: 70 70 70 70
list2: 43 43 43
list3: 22 22

i tried to work it out with the Match object, but the output of Match is a data stream and not a sequential list.

what shall i do? is there an object which can gather all the identical elements in a list and isolate them into a new one?

all the best,
Spk.

tommy's icon

maybe the zl object library
can help u...
i dont remember if it is in ma/msp,
by the way u can find it on
maxobjects.com

Lê Quan Ninh's icon
Emmanuel Jourdan's icon

Hi,

the version bellow use only zl objects.

HTH,
ej

Max Patch
Copy patch and select New From Clipboard in Max.

studio7hz's icon

cheers