Forums > MaxMSP

List to big to be processed?

October 8, 2008 | 5:23 pm

Hello,

I am trying to manage a big list.
I want to set this list in a [textedit] object.

Before to set the list in the object I need to "cross" [sprintf]

or multiple lists across
[sprintf]->[mxj list.union].

In the first case, in [textedit] some values appear as 0. instead of their initial values.

In the second case, list with 3 values are given 2.

I’m asking if the list I send is too big for [sprintf] and [mxj list.union] or if there is another problem may be?

At least is there any way to do this?

Thank you.

#P window setfont "Sans Serif" 9.;
#P user textedit 692 580 1192 714 32896 3 9;
#P window linecount 1;
#P newex 1039 172 117 196617 prepend @light_position;
#P newex 1059 197 110 196617 prepend @erase_color;
#P newex 693 535 82 196617 mxj list.Union 5;
#B color 12;
#P newex 1039 150 155 196617 route light_position erase_color;
#P newex 774 377 27 196617 t l l;
#P newex 713 277 27 196617 t l l;
#P newex 693 557 62 196617 prepend set;
#P newex 693 515 82 196617 bondo 5 n;
#P window setfont "Fixedwidth Serif" 10.;
#P window linecount 2;
#P newex 713 438 404 1441802 sprintf @light_specular %f %f %f @light_diffuse %f %f %f %f @light_ambient %f %f %f @global_light_ambient %f %f %f;
#P objectname formatboxArobas[2];
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 731 232 439 196617 route light_specular light_diffuse light_ambient global_light_ambient;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 731 254 405 1441802 pak 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.;
#P objectname formatboxArobas[6];
#P window setfont "Sans Serif" 9.;
#P newex 774 330 391 196617 route auto_material mat_specular shininess mat_diffuse mat_ambient mat_emission;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 774 356 394 1441802 pak 0 0. 0. 0. 0 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.;
#P objectname formatboxArobas[4];
#P window linecount 2;
#P newex 774 477 420 1441802 sprintf @auto_material %i @mat_specular %f %f %f @shininess %i @mat_diffuse %f %f %f %f @mat_ambient %f %f %f @mat_emission %f %f %f;
#P objectname formatboxArobas[5];
#P window linecount 1;
#P newex 693 413 382 1441802 sprintf @scale %f %f %f @rotate %f %f %f %f @position %f %f %f;
#P objectname formatboxArobas[3];
#P window setfont "Sans Serif" 9.;
#P newex 709 191 145 196617 pak 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.;
#P newex 709 168 261 196617 route scale rotate position;
#P message 606 81 33 196617 clear;
#P window setfont "Sans Serif" 12.;
#P window linecount 7;
#P message 22 25 405 196620 scale 1.15 1.2 1.15 , rotate 66.844009 -0.428687 0.841414 0.329018 , position -0.352082 -0.828428 -0.000001 , light_position -0.400406 -0.807717 -0.000001 , erase_color 0.898039 1. 0.141176 0. , light_specular 0.262745 0.670588 0.52549 , light_diffuse 1. 0.74902 0.141176 0.91 , light_ambient 0.643137 0. 0.180392 , global_light_ambient 0. 0.721569 0.517647;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 62 174 32 196617 print;
#P user textedit 22 423 522 557 32896 3 9;
#P newex 22 389 62 196617 prepend set;
#P window setfont "Fixedwidth Serif" 10.;
#P window linecount 7;
#P newex 22 289 351 1441802 sprintf @scale %f %f %f @rotate %f %f %f %f @position %f %f %f @light_position %ld @erase_color %ld @light_specular %f %f %f @light_diffuse %f %f %f %f @light_ambient %f %f %f @global_light_ambient %f %f %f @auto_material %i @mat_specular %f %f %f @shininess %i @mat_diffuse %f %f %f %f @mat_ambient %f %f %f @mat_emission %f %f %f;
#P objectname formatboxArobas[1];
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 22 257 521 196617 pak 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0 0 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0 0. 0. 0. 0 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.;
#P window linecount 2;
#P newex 22 197 572 196617 route scale rotate position light_position erase_color light_specular light_diffuse light_ambient global_light_ambient auto_material mat_specular shininess mat_diffuse mat_ambient mat_emission;
#P window linecount 1;
#P newex 693 214 27 196617 t l l;
#P connect 7 0 1 0;
#P fasten 1 0 2 0 27 227 27 227;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 8 0 5 0;
#P fasten 1 1 2 3 64 227 66 227;
#P connect 7 0 6 0;
#P fasten 1 2 2 7 101 227 118 227;
#P connect 1 3 2 10;
#P connect 1 4 2 11;
#P connect 1 5 2 12;
#P connect 1 6 2 15;
#P connect 1 7 2 19;
#P connect 1 8 2 22;
#P connect 1 9 2 25;
#P connect 1 10 2 26;
#P connect 1 11 2 29;
#P connect 1 12 2 30;
#P connect 1 13 2 34;
#P connect 1 14 2 37;
#P connect 8 0 26 0;
#P connect 19 0 26 0;
#P fasten 10 0 0 0 714 210 698 210;
#P connect 0 0 11 0;
#P connect 11 0 18 0;
#P connect 18 0 23 0;
#P connect 23 0 19 0;
#P fasten 7 0 9 0 27 157 714 157;
#P connect 9 0 10 0;
#P connect 25 0 18 1;
#P connect 18 1 23 1;
#P fasten 15 0 20 0 736 274 718 274;
#P connect 20 0 17 0;
#P connect 24 0 18 2;
#P connect 18 2 23 2;
#P fasten 22 2 16 0 1188 222 736 222;
#P connect 16 0 15 0;
#P connect 17 0 18 3;
#P connect 18 3 23 3;
#P fasten 9 1 10 3 797 188 759 188;
#P fasten 12 0 18 4 779 512 770 512;
#P connect 18 4 23 4;
#P fasten 16 4 14 0 1164 320 779 320;
#P lcolor 9;
#P connect 14 0 13 0;
#P connect 13 0 21 0;
#P connect 21 0 12 0;
#P fasten 14 1 13 1 842 351 806 351;
#P fasten 9 2 10 7 880 188 819 188;
#P fasten 16 1 15 3 843 252 832 252;
#P fasten 14 2 13 4 905 351 887 351;
#P fasten 14 3 13 5 968 351 914 351;
#P fasten 16 2 15 7 950 252 960 252;
#P fasten 14 4 13 9 1031 351 1022 351;
#P connect 9 3 22 0;
#P connect 22 0 25 0;
#P fasten 16 3 15 10 1057 252 1056 252;
#P connect 22 1 24 0;
#P fasten 14 5 13 12 1094 351 1103 351;
#P window clipboard copycount 27;


October 9, 2008 | 12:11 am

The message box you have containing all the data at the beginning of your patch isn’t one list, it is several. In max messages commas are special (some say magical) characters that split messages up into several parts and send them out in order. Send that message to [print] and look in the max window.

You could perhaps turn each message into a symbol [tosymbol] and then add the @ sign using [sprintf @%s] and then group them using [zl group] then [prepend set] them into [textedit].

Let me know how this works out for you.

lh


October 9, 2008 | 9:40 am

Yes, thank you.
But the problem is more how to set several independant lists in one [textedit].
I use [mxj list.Union] but some values are lost. This object seems to have its particuliar behavior.

another attempt, I’m not very good for managing lists.
Really need some advices.

Thank you.

#P toggle 979 279 15 0;
#P window setfont "Sans Serif" 9.;
#P flonum 1003 325 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1046 325 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 1011 346 61 196617 pak 0. 0. 0.;
#P flonum 1084 325 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1000 393 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1043 393 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 1008 414 61 196617 pak 0. 0. 0.;
#P flonum 1081 393 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 607 477 196 196617 bondo 15 n;
#B color 12;
#P newex 854 411 51 196617 tosymbol;
#P newex 854 432 66 196617 sprintf @%s;
#P newex 751 353 51 196617 tosymbol;
#P newex 751 374 66 196617 sprintf @%s;
#P newex 726 310 51 196617 tosymbol;
#P newex 726 331 66 196617 sprintf @%s;
#P newex 701 267 51 196617 tosymbol;
#P newex 701 288 66 196617 sprintf @%s;
#P newex 676 224 51 196617 tosymbol;
#P newex 676 245 66 196617 sprintf @%s;
#P newex 651 181 51 196617 tosymbol;
#P newex 652 203 66 196617 sprintf @%s;
#P newex 626 138 51 196617 tosymbol;
#P newex 626 159 66 196617 sprintf @%s;
#P newex 601 95 51 196617 tosymbol;
#P newex 601 116 66 196617 sprintf @%s;
#P newex 842 355 51 196617 tosymbol;
#P newex 842 376 66 196617 sprintf @%s;
#P newex 817 312 51 196617 tosymbol;
#P newex 817 333 66 196617 sprintf @%s;
#P newex 792 269 51 196617 tosymbol;
#P newex 792 290 66 196617 sprintf @%s;
#P newex 767 226 51 196617 tosymbol;
#P newex 767 247 66 196617 sprintf @%s;
#P newex 742 183 51 196617 tosymbol;
#P newex 742 204 66 196617 sprintf @%s;
#P newex 717 140 51 196617 tosymbol;
#P newex 717 161 66 196617 sprintf @%s;
#P flonum 820 28 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 1051 101 15 0;
#P message 971 437 117 196617 mat_emission $1 $2 $3;
#P message 970 366 113 196617 mat_ambient $1 $2 $3;
#P message 927 303 130 196617 mat_diffuse 0.6 0. 0.3 0.5;
#P message 905 280 66 196617 shininess $1;
#P message 898 259 107 196617 mat_specular 0. 0. 0.;
#P message 884 237 82 196617 auto_material 0;
#P message 869 214 211 196617 global_light_ambient 0. 0.721569 0.517647;
#P message 849 192 179 196617 light_ambient 0.643137 0. 0.180392;
#P message 828 170 193 196617 light_diffuse 1. 0.74902 0.141176 0.91;
#P message 808 150 212 196617 light_specular 0.262745 0.670588 0.52549;
#P message 792 124 73 196617 erase_color 0;
#P message 777 100 80 196617 light_position 0;
#P message 760 76 204 196617 position -0.352082 -0.828428 -0.000001;
#P message 741 54 241 196617 rotate 66.844009 -0.428687 0.841414 0.329018;
#P message 726 29 90 196617 scale 1.15 1.2 $1;
#P newex 607 499 196 196617 mxj list.Union 15;
#B color 12;
#P user textedit 607 542 1107 676 32896 3 9 @scale 1.15 1.2 1. @rotate 66.844002 -0.4287 0.8414 0.329 @position -0.3521 -0.8284 -0. @light_position 0 @erase_color @light_specular 0.2627 0.6706 0.5255 @light_diffuse 0.749 0.1412 0.91 @light_ambient 0.6431 0.1804 @global_light_ambient 0.7216 0.5176 @auto_material @mat_specular @shininess @mat_diffuse 0.6 0.3 0.5 @mat_ambient 0.19 0.03 0.14 @mat_emission -0.01 0.13 0.36;
#P newex 607 520 62 196617 prepend set;
#P newex 692 97 51 196617 tosymbol;
#P newex 692 118 66 196617 sprintf @%s;
#P connect 13 0 35 0;
#P connect 35 0 34 0;
#P connect 0 0 50 0;
#P connect 50 0 4 0;
#P connect 4 0 2 0;
#P connect 2 0 3 0;
#P connect 22 0 50 1;
#P connect 50 1 4 1;
#P connect 14 0 37 0;
#P connect 37 0 36 0;
#P connect 24 0 50 2;
#P connect 50 2 4 2;
#P connect 26 0 50 3;
#P connect 50 3 4 3;
#P connect 15 0 39 0;
#P connect 39 0 38 0;
#P connect 28 0 50 4;
#P connect 50 4 4 4;
#P connect 30 0 50 5;
#P connect 50 5 4 5;
#P connect 16 0 41 0;
#P connect 41 0 40 0;
#P connect 32 0 50 6;
#P connect 50 6 4 6;
#P connect 5 0 1 0;
#P connect 1 0 0 0;
#P connect 48 0 50 7;
#P connect 50 7 4 7;
#P connect 17 0 43 0;
#P connect 43 0 42 0;
#P connect 34 0 50 8;
#P connect 50 8 4 8;
#P connect 6 0 23 0;
#P connect 23 0 22 0;
#P connect 36 0 50 9;
#P connect 50 9 4 9;
#P connect 20 0 5 0;
#P connect 21 0 5 0;
#P connect 18 0 45 0;
#P connect 45 0 44 0;
#P connect 38 0 50 10;
#P connect 50 10 4 10;
#P connect 20 0 6 0;
#P connect 7 0 25 0;
#P connect 25 0 24 0;
#P connect 40 0 50 11;
#P connect 50 11 4 11;
#P connect 19 0 47 0;
#P connect 47 0 46 0;
#P connect 20 0 7 0;
#P connect 42 0 50 12;
#P connect 50 12 4 12;
#P connect 8 0 27 0;
#P connect 27 0 26 0;
#P connect 44 0 50 13;
#P connect 50 13 4 13;
#P connect 20 0 8 0;
#P connect 46 0 50 14;
#P connect 50 14 4 14;
#P connect 20 0 9 0;
#P connect 9 0 29 0;
#P connect 29 0 28 0;
#P connect 20 0 10 0;
#P connect 10 0 31 0;
#P connect 31 0 30 0;
#P connect 20 0 11 0;
#P connect 11 0 33 0;
#P connect 33 0 32 0;
#P connect 20 0 12 0;
#P connect 12 0 49 0;
#P connect 49 0 48 0;
#P connect 20 0 13 0;
#P connect 20 0 14 0;
#P connect 20 0 15 0;
#P connect 20 0 16 0;
#P connect 59 0 16 0;
#P connect 20 0 17 0;
#P connect 20 0 18 0;
#P connect 56 0 18 0;
#P connect 20 0 19 0;
#P connect 52 0 19 0;
#P connect 54 0 52 0;
#P connect 58 0 56 0;
#P connect 53 0 52 1;
#P connect 57 0 56 1;
#P connect 51 0 52 2;
#P connect 55 0 56 2;
#P window clipboard copycount 60;


October 9, 2008 | 12:17 pm

Hopefully the abstraction in the patch below will do what you want, it is not particularly pretty but it seems to work. You can send it any number of lists in the right inlet, it adds the @ sign to the first element of each list and then splits the lists up into individual items and stores in a [coll]. You can then bang the left inlet and it queries the number of items in the [coll] and uses this as the argument to [zl group] to combine everything into one long list which is prepended with "set" ready to go into [textedit].

lh

– Pasted Max Patch, click to expand. –

October 9, 2008 | 1:27 pm

That seems great … could you post a screen capture … I’m under 4.6!

thanks.


October 9, 2008 | 1:43 pm

Here it is.

I went straight to 5 after my student version of 4.6 ran out so I cant translate my patches to earlier versions. I hope you manage to piece it back together.

lh


October 9, 2008 | 2:13 pm

Thank you.

#P outlet 185 432 15 0;
#P window setfont "Sans Serif" 9.;
#P number 130 321 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 185 353 69 196617 route symbol;
#P newex 185 405 62 196617 prepend set;
#P newex 185 383 46 196617 zl group;
#N coll data;
#P newobj 185 318 53 196617 coll data;
#P newex 130 297 30 196617 grab;
#P inlet 37 148 15 0;
#P button 37 167 15 0;
#P newex 37 186 105 196617 t 0 clear dump length;
#P newex 185 292 45 196617 prepend;
#P newex 226 267 62 196617 prepend set;
#P number 226 249 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 226 229 27 196617 + 0;
#P newex 226 198 27 196617 i 1;
#P newex 185 170 27 196617 t l b;
#P newex 246 139 66 196617 sprintf @%s;
#P newex 185 117 73 196617 route float int;
#P newex 185 97 38 196617 zl iter;
#P inlet 185 74 15 0;
#P fasten 13 1 14 0 155 316 190 316;
#P connect 16 0 19 0;
#P connect 10 3 13 0;
#P connect 10 2 14 0;
#P connect 10 1 14 0;
#P connect 9 0 14 0;
#P connect 14 0 17 0;
#P fasten 17 1 15 0 249 373 190 373;
#P connect 17 0 15 0;
#P fasten 18 0 15 1 135 379 226 379;
#P connect 13 0 18 0;
#P connect 15 0 16 0;
#P fasten 10 0 6 1 42 221 248 221;
#P connect 12 0 11 0;
#P connect 11 0 10 0;
#P fasten 8 0 9 0 231 289 190 289;
#P connect 4 0 9 0;
#P connect 7 0 8 0;
#P connect 6 0 7 0;
#P connect 5 0 6 0;
#P fasten 4 1 5 0 207 192 231 192;
#P fasten 3 0 4 0 251 163 190 163;
#P fasten 2 1 4 0 221 152 190 152;
#P connect 2 0 4 0;
#P connect 2 2 3 0;
#P connect 1 0 2 0;
#P connect 0 0 1 0;
#P window clipboard copycount 20;


October 9, 2008 | 2:25 pm

You need to make sure the number box before the [prepend set] goes back into the right inlet of the [+ 0] box above it. It works as a little counter so that each item is preceeded by an index number to store in [coll]

lh


October 9, 2008 | 2:29 pm

Yes sorry I came to fast
This one is good

Thanks again. really.

#P outlet 384 495 15 0;
#P window setfont "Sans Serif" 9.;
#P number 329 384 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 384 416 69 196617 route symbol;
#P newex 384 468 62 196617 prepend set;
#P newex 384 446 46 196617 zl group;
#N coll data;
#P newobj 384 381 53 196617 coll data;
#P newex 329 360 30 196617 grab;
#P inlet 236 211 15 0;
#P button 236 230 15 0;
#P newex 236 249 105 196617 t 0 clear dump length;
#P newex 384 355 45 196617 prepend;
#P newex 425 333 62 196617 prepend set;
#P number 425 312 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 425 292 27 196617 + 0;
#P newex 425 261 27 196617 i 1;
#P newex 384 233 27 196617 t l b;
#P newex 446 202 66 196617 sprintf @%s;
#P newex 384 180 73 196617 route float int;
#P newex 384 160 47 196617 zl iter 1;
#P inlet 384 137 15 0;
#P connect 7 0 8 0;
#P fasten 7 0 6 1 430 331 433 329 466 329 466 287 447 287;
#P connect 4 0 9 0;
#P connect 12 0 11 0;
#P connect 11 0 10 0;
#P connect 10 3 13 0;
#P connect 13 0 18 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P fasten 3 0 4 0 451 226 389 226;
#P fasten 2 1 4 0 420 215 389 215;
#P connect 2 0 4 0;
#P fasten 8 0 9 0 430 352 389 352;
#P fasten 13 1 14 0 354 379 389 379;
#P connect 10 2 14 0;
#P connect 10 1 14 0;
#P connect 9 0 14 0;
#P connect 14 0 17 0;
#P fasten 17 1 15 0 448 436 389 436;
#P connect 17 0 15 0;
#P connect 15 0 16 0;
#P connect 16 0 19 0;
#P fasten 18 0 15 1 334 442 425 442;
#P fasten 4 1 5 0 406 255 430 255;
#P connect 5 0 6 0;
#P connect 6 0 7 0;
#P fasten 10 0 6 1 241 284 447 284;
#P connect 2 2 3 0;
#P window clipboard copycount 20;


October 17, 2008 | 1:14 pm

Just in case you are interested, here is your patch again but now including an abstraction [p endofstream] that sends out a bang only if no input has been received in the previous x milliseconds. You can use it to trigger the processing in [p list] after it has received every message in the message box. It simply removes the need for you to band [p list] manually.

lh

– Pasted Max Patch, click to expand. –

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