how to create one list out of many numbers received?

Jun 11, 2008 at 1:07pm

how to create one list out of many numbers received?

Hello,

I am trying to make a list out of the numbers outputted from the left outlet of function but can’t find the object to do it. Can someone point me in the right direction? Much appreciated.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 452 248 92 9109513 print MakeIntoaList?;
#P newex 452 90 44 9109513 line 0. 1.;
#P message 452 65 55 9109513 0 , 512. 512;
#P flonum 452 228 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P user function 452 117 652 217 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. 0. 0;
#X add 78.978722 0.573333 0;
#X add 95.319145 0.36 0;
#X add 114.382973 -0.653333 0;
#X add 163.404251 -0.546667 0;
#X add 223.319138 1. 0;
#X add 239.659561 0.893333 0;
#X add 250.553177 0.626667 0;
#X add 277.787231 -0.813333 0;
#X add 285.957428 -1. 0;
#X add 305.021271 -0.866667 0;
#X add 321.361694 -0.733333 0;
#X add 332.25531 -0.52 0;
#X add 348.595734 -0.04 0;
#X add 364.936157 0.653333 0;
#X add 403.063812 0.866667 0;
#X add 435.744659 1. 0;
#X add 452.085083 0.68 0;
#X add 471.148926 -0.306667 0;
#X add 512. 0. 0;
#X domain 512.;
#X range -1. 1.;
#X done;
#P connect 3 0 0 0;
#P connect 2 0 3 0;
#P connect 1 0 4 0;
#P connect 0 0 1 0;
#P window clipboard copycount 5;

#38335
Jun 11, 2008 at 1:31pm

On 11 juin 08, at 15:07, Jay Bodley wrote:

>
> Hello,
>
> I am trying to make a list out of the numbers outputted from the
> left outlet of function but can’t find the object to do it. Can
> someone point me in the right direction? Much appreciated.

If you know in advance how many items will go in thelist, you can use
[zl group]
If you don’t, you can use [thresh]. Beware, lists have a limited size.

p

_____________________________
Patrick Delges

Centre de Recherches et de Formation Musicales de Wallonie asbl

http://www.crfmw.be/max

#133435
Jun 11, 2008 at 1:32pm

it depends on what u are trying to do with this list… there are different approaches to achieve this task, some of which will be be better than others.

here is a very fast way of getting xy data from function into a list format:

#P window setfont “Sans Serif” 9.;
#P window linecount 10;
#P message 490 239 217 196617 0. 0. 78.978722 0.573333 95.319145 0.36 114.382973 -0.653333 163.404251 -0.546667 223.319138 1. 239.659561 0.893333 250.553177 0.626667 277.787231 -0.813333 285.957428 -1. 305.021271 -0.866667 321.361694 -0.733333 332.25531 -0.52 348.595734 -0.04 364.936157 0.653333 403.063812 0.866667 435.744659 1. 452.085083 0.68 471.148926 -0.306667 512. 0.;
#P window linecount 1;
#P newex 490 217 62 196617 prepend set;
#P newex 490 197 54 196617 thresh 50;
#P newex 578 165 32 196617 print;
#P message 452 21 33 196617 dump;
#P user function 452 50 652 150 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. 0. 0;
#X add 78.978722 0.573333 0;
#X add 95.319145 0.36 0;
#X add 114.382973 -0.653333 0;
#X add 163.404251 -0.546667 0;
#X add 223.319138 1. 0;
#X add 239.659561 0.893333 0;
#X add 250.553177 0.626667 0;
#X add 277.787231 -0.813333 0;
#X add 285.957428 -1. 0;
#X add 305.021271 -0.866667 0;
#X add 321.361694 -0.733333 0;
#X add 332.25531 -0.52 0;
#X add 348.595734 -0.04 0;
#X add 364.936157 0.653333 0;
#X add 403.063812 0.866667 0;
#X add 435.744659 1. 0;
#X add 452.085083 0.68 0;
#X add 471.148926 -0.306667 0;
#X add 512. 0. 0;
#X domain 512.;
#X range -1. 1.;
#X done;
#P connect 4 0 5 0;
#P connect 3 0 4 0;
#P connect 0 2 3 0;
#P connect 0 2 2 0;
#P connect 1 0 0 0;
#P window clipboard copycount 6;

#133436
Jun 11, 2008 at 1:38pm

Here’s a good way, using mxj list.Queue (gets around the smaller size limit of lists in Max Land.

#P window setfont “Sans Serif” 9.;
#P window linecount 10;
#P message 490 239 217 196617 0. 0. 78.978722 0.573333 95.319145 0.36 114.382973 -0.653333 163.404251 -0.546667 223.319138 1. 239.659561 0.893333 250.553177 0.626667 277.787231 -0.813333 285.957428 -1. 305.021271 -0.866667 321.361694 -0.733333 332.25531 -0.52 348.595734 -0.04 364.936157 0.653333 403.063812 0.866667 435.744659 1. 452.085083 0.68 471.148926 -0.306667 512. 0.;
#P window linecount 1;
#P newex 490 217 62 196617 prepend set;
#P newex 490 197 54 196617 thresh 50;
#P newex 578 165 32 196617 print;
#P message 452 21 33 196617 dump;
#P user function 452 50 652 150 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. 0. 0;
#X add 78.978722 0.573333 0;
#X add 95.319145 0.36 0;
#X add 114.382973 -0.653333 0;
#X add 163.404251 -0.546667 0;
#X add 223.319138 1. 0;
#X add 239.659561 0.893333 0;
#X add 250.553177 0.626667 0;
#X add 277.787231 -0.813333 0;
#X add 285.957428 -1. 0;
#X add 305.021271 -0.866667 0;
#X add 321.361694 -0.733333 0;
#X add 332.25531 -0.52 0;
#X add 348.595734 -0.04 0;
#X add 364.936157 0.653333 0;
#X add 403.063812 0.866667 0;
#X add 435.744659 1. 0;
#X add 452.085083 0.68 0;
#X add 471.148926 -0.306667 0;
#X add 512. 0. 0;
#X domain 512.;
#X range -1. 1.;
#X done;
#P connect 4 0 5 0;
#P connect 3 0 4 0;
#P connect 0 2 3 0;
#P connect 0 2 2 0;
#P connect 1 0 0 0;
#P window clipboard copycount 6;

#133437
Jun 11, 2008 at 1:40pm

Sorry, quick correction (pack had i instead of l)

max v2;
#N vpatcher 325 70 749 504;
#P window setfont “Sans Serif” 9.;
#P newex 168 191 40 196617 t dump;
#P button 41 328 15 0;
#P newex 56 380 32 196617 print;
#P newex 120 116 47 196617 t l reset;
#P newex 56 353 75 196617 mxj list.Queue;
#P number 198 66 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 159 66 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 120 66 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 120 90 88 196617 pack 0 512 512;
#P newex 120 168 58 196617 line 0. 1.;
#P message 120 143 56 196617 $1 , $2 $3;
#P flonum 120 326 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user function 120 215 320 315 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. 0. 0;
#X add 78.978722 0.573333 0;
#X add 95.319145 0.36 0;
#X add 114.382973 -0.653333 0;
#X add 163.404251 -0.546667 0;
#X add 223.319138 1. 0;
#X add 239.659561 0.893333 0;
#X add 250.553177 0.626667 0;
#X add 277.787231 -0.813333 0;
#X add 285.957428 -1. 0;
#X add 305.021271 -0.866667 0;
#X add 321.361694 -0.733333 0;
#X add 332.25531 -0.52 0;
#X add 348.595734 -0.04 0;
#X add 364.936157 0.653333 0;
#X add 403.063812 0.866667 0;
#X add 435.744659 1. 0;
#X add 452.085083 0.68 0;
#X add 471.148926 -0.306667 0;
#X add 512. 0. 0;
#X domain 512.;
#X range -1. 1.;
#X done;
#P window setfont “Sans Serif” 14.;
#P comment 146 31 135 196622 FUNCTION TO LIST;
#P fasten 10 1 9 0 162 138 61 138;
#P connect 12 0 9 0;
#P fasten 13 0 9 0 173 211 61 211;
#P connect 9 0 11 0;
#P fasten 9 2 11 0 125 375 61 375;
#P connect 6 0 5 0;
#P connect 5 0 10 0;
#P connect 10 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 9 2;
#P connect 7 0 5 1;
#P connect 4 1 13 0;
#P connect 8 0 5 2;
#P pop;

#133438

You must be logged in to reply to this topic.