Forums > MaxMSP

Combining two separate lists in the order in which the numbers come out?

March 26, 2008 | 10:10 pm

I thought I was reasonable familiar with the zl objects but I can’t find a way of combining the following two lists matching item 1 from list 1 with item from list two in this case:

max v2;
#N vpatcher 100 100 700 500;
#P window setfont "Sans Serif" 18.;
#P window linecount 3;
#P comment 447 433 320 196626 i.e item 1 from left with item 1 from above followed by item 2 from left with item 2 from above;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 348 327 57 196617 prepend 0.;
#P newex 179 326 57 196617 prepend 0.;
#P newex 348 209 59 196617 random 8;
#P newex 179 205 59 196617 random 8;
#P newex 361 131 27 196617 + 2;
#P newex 192 109 27 196617 t i i;
#P newex 348 362 62 196617 prepend set;
#P message 348 387 443 196617 0. 0.428571 0.714286 0. 0. 0.857143 0.714286 0.714286 0.;
#P message 246 276 39 196617 set $1;
#P newex 348 277 46 196617 zl group;
#P newex 348 301 52 196617 append 0.;
#P newex 348 243 79 196617 scale 0 1 0. 1.;
#P newex 361 152 83 196617 t b i i i i;
#P newex 348 179 41 196617 uzi;
#P comment 397 328 100 196617 y co-ordinates;
#P newex 192 131 27 196617 + 2;
#P button 192 45 15 0;
#P newex 179 276 46 196617 zl group;
#P newex 179 300 52 196617 append 0.;
#P newex 530 177 40 196617 t i i i;
#P newex 179 242 79 196617 scale 0 1 0 1;
#P user function 699 252 899 352 1 1 0 0;
#X frgb 82 82 82;
#X brgb 204 204 204;
#X rgb2 85 85 85;
#X rgb3 255 255 255;
#X rgb4 0 0 0;
#X rgb5 0 0 0;
#X add 0. 392. 0;
#X domain 1000.;
#X range 0. 1.;
#X done;
#P newex 192 151 84 196617 t b i i i i;
#P newex 192 90 52 196617 random 8;
#P newex 179 178 41 196617 uzi;
#P newex 192 67 519 196617 t b b b clear;
#P comment 586 204 100 196617 Note Length first;
#P outlet 560 203 15 0;
#P newex 530 156 31 196617 + 50;
#P newex 530 133 70 196617 random 1000;
#P comment 605 134 100 196617 Length/Domain;
#P comment 92 69 100 196617 Number of points;
#P comment 47 342 100 196617 x co-ordinates;
#P newex 179 404 62 196617 prepend set;
#P message 179 430 230 196617 0. 392 392 313 156 392 0 156 549;
#P window setfont "Sans Serif" 18.;
#P window linecount 6;
#P comment 230 453 213 196626 How do I join this list with the one above but in the groups of 2 in the same order as they appear from left to right??;
#P fasten 13 0 11 0 197 171 184 171;
#P connect 11 0 32 0;
#P connect 32 0 15 0;
#P connect 15 0 18 0;
#P fasten 27 0 17 0 251 298 184 298;
#P connect 18 0 17 0;
#P connect 17 0 34 0;
#P connect 34 0 2 0;
#P connect 2 0 1 0;
#P connect 19 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 30 0;
#P connect 30 0 20 0;
#P connect 20 0 13 0;
#P fasten 13 3 15 2 251 231 210 231;
#P connect 13 1 11 1;
#P fasten 13 4 18 1 269 264 220 264;
#P connect 13 2 32 1;
#P fasten 16 0 15 4 535 235 236 235;
#P fasten 16 1 27 0 550 270 251 270;
#P fasten 23 0 22 0 366 172 353 172;
#P connect 22 0 33 0;
#P connect 33 0 24 0;
#P connect 24 0 26 0;
#P connect 26 0 25 0;
#P connect 25 0 35 0;
#P connect 35 0 29 0;
#P connect 29 0 28 0;
#P fasten 30 1 31 0 214 129 366 129;
#P connect 31 0 23 0;
#P fasten 23 3 24 2 420 232 379 232;
#P connect 23 1 22 1;
#P fasten 23 4 26 1 438 265 389 265;
#P connect 23 2 33 1;
#P connect 10 2 6 0;
#P connect 6 0 7 0;
#P connect 7 0 16 0;
#P connect 16 2 8 0;
#P connect 10 3 14 0;
#P pop;

Thanks for your help in advance,

Rhys


March 26, 2008 | 10:28 pm

mxj list.Multiplex

On Thu, Mar 27, 2008 at 12:10 AM, Rhys Perkins wrote:

>
> I thought I was reasonable familiar with the zl objects but I can’t find a
> way of combining the following two lists matching item 1 from list 1 with
> item from list two in this case:
>
> max v2;
> #N vpatcher 100 100 700 500;
> #P window setfont "Sans Serif" 18.;
> #P window linecount 3;
> #P comment 447 433 320 196626 i.e item 1 from left with item 1 from above
> followed by item 2 from left with item 2 from above;
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P newex 348 327 57 196617 prepend 0.;
> #P newex 179 326 57 196617 prepend 0.;
> #P newex 348 209 59 196617 random 8;
> #P newex 179 205 59 196617 random 8;
> #P newex 361 131 27 196617 + 2;
> #P newex 192 109 27 196617 t i i;
> #P newex 348 362 62 196617 prepend set;
> #P message 348 387 443 196617 0. 0.428571 0.714286 0. 0. 0.857143 0.714286
> 0.714286 0.;
> #P message 246 276 39 196617 set $1;
> #P newex 348 277 46 196617 zl group;
> #P newex 348 301 52 196617 append 0.;
> #P newex 348 243 79 196617 scale 0 1 0. 1.;
> #P newex 361 152 83 196617 t b i i i i;
> #P newex 348 179 41 196617 uzi;
> #P comment 397 328 100 196617 y co-ordinates;
> #P newex 192 131 27 196617 + 2;
> #P button 192 45 15 0;
> #P newex 179 276 46 196617 zl group;
> #P newex 179 300 52 196617 append 0.;
> #P newex 530 177 40 196617 t i i i;
> #P newex 179 242 79 196617 scale 0 1 0 1;
> #P user function 699 252 899 352 1 1 0 0;
> #X frgb 82 82 82;
> #X brgb 204 204 204;
> #X rgb2 85 85 85;
> #X rgb3 255 255 255;
> #X rgb4 0 0 0;
> #X rgb5 0 0 0;
> #X add 0. 392. 0;
> #X domain 1000.;
> #X range 0. 1.;
> #X done;
> #P newex 192 151 84 196617 t b i i i i;
> #P newex 192 90 52 196617 random 8;
> #P newex 179 178 41 196617 uzi;
> #P newex 192 67 519 196617 t b b b clear;
> #P comment 586 204 100 196617 Note Length first;
> #P outlet 560 203 15 0;
> #P newex 530 156 31 196617 + 50;
> #P newex 530 133 70 196617 random 1000;
> #P comment 605 134 100 196617 Length/Domain;
> #P comment 92 69 100 196617 Number of points;
> #P comment 47 342 100 196617 x co-ordinates;
> #P newex 179 404 62 196617 prepend set;
> #P message 179 430 230 196617 0. 392 392 313 156 392 0 156 549;
> #P window setfont "Sans Serif" 18.;
> #P window linecount 6;
> #P comment 230 453 213 196626 How do I join this list with the one above
> but in the groups of 2 in the same order as they appear from left to
> right??;
> #P fasten 13 0 11 0 197 171 184 171;
> #P connect 11 0 32 0;
> #P connect 32 0 15 0;
> #P connect 15 0 18 0;
> #P fasten 27 0 17 0 251 298 184 298;
> #P connect 18 0 17 0;
> #P connect 17 0 34 0;
> #P connect 34 0 2 0;
> #P connect 2 0 1 0;
> #P connect 19 0 10 0;
> #P connect 10 0 12 0;
> #P connect 12 0 30 0;
> #P connect 30 0 20 0;
> #P connect 20 0 13 0;
> #P fasten 13 3 15 2 251 231 210 231;
> #P connect 13 1 11 1;
> #P fasten 13 4 18 1 269 264 220 264;
> #P connect 13 2 32 1;
> #P fasten 16 0 15 4 535 235 236 235;
> #P fasten 16 1 27 0 550 270 251 270;
> #P fasten 23 0 22 0 366 172 353 172;
> #P connect 22 0 33 0;
> #P connect 33 0 24 0;
> #P connect 24 0 26 0;
> #P connect 26 0 25 0;
> #P connect 25 0 35 0;
> #P connect 35 0 29 0;
> #P connect 29 0 28 0;
> #P fasten 30 1 31 0 214 129 366 129;
> #P connect 31 0 23 0;
> #P fasten 23 3 24 2 420 232 379 232;
> #P connect 23 1 22 1;
> #P fasten 23 4 26 1 438 265 389 265;
> #P connect 23 2 33 1;
> #P connect 10 2 6 0;
> #P connect 6 0 7 0;
> #P connect 7 0 16 0;
> #P connect 16 2 8 0;
> #P connect 10 3 14 0;
> #P pop;
>
> Thanks for your help in advance,
>
> Rhys
>


March 26, 2008 | 10:50 pm

Until today I never knew that existed! Thank you very much.

Rhys


March 26, 2008 | 11:08 pm

ye, the mxj list package is under advertised.
if you like lists also be sure to check the Lobject lib. with classics like
Lsum and Llast (among many) see
http://www.cycling74.com/forums/index.php?t=msg&goto=49655 for an overview

On Thu, Mar 27, 2008 at 12:50 AM, Rhys Perkins wrote:

>
> Until today I never knew that existed! Thank you very much.
>
> Rhys
>


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