detect match between two lists with non specific order

Oct 22, 2006 at 1:42pm

detect match between two lists with non specific order

hi all,
i am trying to detect match between two lists with non specific order.
also routing the match and nonmatch to diffrent outlets.
so “1 2 3″==”3 2 1″

this patch works for init but i am looking for a solution for all data
types.is there something around?
max v2;
#N vpatcher 413 420 682 651;
#P origin -24 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#N vpatcher 15 55 315 286;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 104 102 50 9109513 remove $1;
#P newex 186 72 65 9109513 pack i i;
#P newex 118 74 21 9109513 iter;
#P newex 84 157 50 9109513 gate 2 1;
#P newex 50 51 112 9109513 t b 2 l 1;
#P window linecount 2;
#P message 50 91 42 9109513 dump , clear;
#P window linecount 1;
#P newex 186 50 50 9109513 iter;
#N coll ;
#P newobj 117 131 50 9109513 coll;
#P inlet 50 31 15 0;
#P inlet 186 30 15 0;
#P outlet 84 181 15 0;
#P outlet 124 181 15 0;
#P connect 3 0 7 0;
#P connect 7 0 6 0;
#P connect 7 1 8 0;
#P connect 7 3 8 0;
#P connect 8 0 1 0;
#P connect 9 0 11 0;
#P connect 6 0 4 0;
#P connect 10 0 4 0;
#P connect 11 0 4 0;
#P connect 9 0 4 0;
#P connect 7 2 9 0;
#P connect 4 0 8 1;
#P connect 8 1 0 0;
#P connect 2 0 5 0;
#P connect 5 0 10 0;
#P connect 5 0 10 1;
#P pop 1;
#P newobj 34 49 60 9109513 p match_list;
#P newex 85 77 42 9109513 print not;
#P message 42 24 21 9109513 3 2;
#P newex 29 77 55 9109513 print match;
#P message 84 23 29 9109513 3 2 1;
#P message 11 24 29 9109513 1 2 3;
#P connect 5 0 2 0;
#P connect 0 0 5 0;
#P connect 3 0 5 0;
#P connect 1 0 5 1;
#P connect 5 1 4 0;
#P pop;

#28298
Oct 22, 2006 at 1:52pm

Hey Yair,
Can you use zl sect for this? It compares the content of two lists.
Zax
—– Original Message —–
From: yair reshef
To: maxmsp@cycling74.com
Sent: Sunday, October 22, 2006 3:42 PM
Subject: [maxmsp] detect match between two lists with non specific order

hi all,
i am trying to detect match between two lists with non specific order.
also routing the match and nonmatch to diffrent outlets.
so “1 2 3″==”3 2 1″

this patch works for init but i am looking for a solution for all data types.is there something around?
max v2;
#N vpatcher 413 420 682 651;
#P origin -24 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#N vpatcher 15 55 315 286;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 104 102 50 9109513 remove $1;
#P newex 186 72 65 9109513 pack i i;
#P newex 118 74 21 9109513 iter;
#P newex 84 157 50 9109513 gate 2 1;
#P newex 50 51 112 9109513 t b 2 l 1;
#P window linecount 2;
#P message 50 91 42 9109513 dump , clear;
#P window linecount 1;
#P newex 186 50 50 9109513 iter;
#N coll ;
#P newobj 117 131 50 9109513 coll;
#P inlet 50 31 15 0;
#P inlet 186 30 15 0;
#P outlet 84 181 15 0;
#P outlet 124 181 15 0;
#P connect 3 0 7 0;
#P connect 7 0 6 0;
#P connect 7 1 8 0;
#P connect 7 3 8 0;
#P connect 8 0 1 0;
#P connect 9 0 11 0;
#P connect 6 0 4 0;
#P connect 10 0 4 0;
#P connect 11 0 4 0;
#P connect 9 0 4 0;
#P connect 7 2 9 0;
#P connect 4 0 8 1;
#P connect 8 1 0 0;
#P connect 2 0 5 0;
#P connect 5 0 10 0;
#P connect 5 0 10 1;
#P pop 1;
#P newobj 34 49 60 9109513 p match_list;
#P newex 85 77 42 9109513 print not;
#P message 42 24 21 9109513 3 2;
#P newex 29 77 55 9109513 print match;
#P message 84 23 29 9109513 3 2 1;
#P message 11 24 29 9109513 1 2 3;
#P connect 5 0 2 0;
#P connect 0 0 5 0;
#P connect 3 0 5 0;
#P connect 1 0 5 1;
#P connect 5 1 4 0;
#P pop;

——————————————————————————

#86738
Oct 22, 2006 at 2:36pm

zl sect does the first part of the patch, i missed it…
unique (RTL) took care of the second.

On 10/22/06, Eran Sachs wrote:
>
> Hey Yair,
> Can you use zl sect for this? It compares the content of two lists.
> Zax
>
> —– Original Message —–
> *From:* yair reshef
> *Sent:* Sunday, October 22, 2006 3:42 PM
> *Subject:* [maxmsp] detect match between two lists with non specific order
>
> hi all,
> i am trying to detect match between two lists with non specific order.
> also routing the match and nonmatch to diffrent outlets.
> so “1 2 3″==”3 2 1″
>
> this patch works for init but i am looking for a solution for all data
> types.is there something around?
> max v2;
> #N vpatcher 413 420 682 651;
> #P origin -24 0;
> #P window setfont “Sans Serif” 9.;
> #P window linecount 1;
> #N vpatcher 15 55 315 286;
> #P window setfont “Sans Serif” 9.;
> #P window linecount 1;
> #P message 104 102 50 9109513 remove $1;
> #P newex 186 72 65 9109513 pack i i;
> #P newex 118 74 21 9109513 iter;
> #P newex 84 157 50 9109513 gate 2 1;
> #P newex 50 51 112 9109513 t b 2 l 1;
> #P window linecount 2;
> #P message 50 91 42 9109513 dump , clear;
> #P window linecount 1;
> #P newex 186 50 50 9109513 iter;
> #N coll ;
> #P newobj 117 131 50 9109513 coll;
> #P inlet 50 31 15 0;
> #P inlet 186 30 15 0;
> #P outlet 84 181 15 0;
> #P outlet 124 181 15 0;
> #P connect 3 0 7 0;
> #P connect 7 0 6 0;
> #P connect 7 1 8 0;
> #P connect 7 3 8 0;
> #P connect 8 0 1 0;
> #P connect 9 0 11 0;
> #P connect 6 0 4 0;
> #P connect 10 0 4 0;
> #P connect 11 0 4 0;
> #P connect 9 0 4 0;
> #P connect 7 2 9 0;
> #P connect 4 0 8 1;
> #P connect 8 1 0 0;
> #P connect 2 0 5 0;
> #P connect 5 0 10 0;
> #P connect 5 0 10 1;
> #P pop 1;
> #P newobj 34 49 60 9109513 p match_list;
> #P newex 85 77 42 9109513 print not;
> #P message 42 24 21 9109513 3 2;
> #P newex 29 77 55 9109513 print match;
> #P message 84 23 29 9109513 3 2 1;
> #P message 11 24 29 9109513 1 2 3;
> #P connect 5 0 2 0;
> #P connect 0 0 5 0;
> #P connect 3 0 5 0;
> #P connect 1 0 5 1;
> #P connect 5 1 4 0;
> #P pop;
>
> ——————————
>
>
>
>
>
>

#86739

You must be logged in to reply to this topic.