pack

Feb 11, 2006 at 6:44pm

pack

hello I am trying to pack my numbers into a list with pack object but
I am confused at this point since I cannot send this packed numbers
for example to a print message to print in my max window. Here is my
patch that is a variant of the reference pack patch. So what am I
missing here?

Thanks in advance
ilteris.

#P window setfont “Sans Serif” 9.;
#P number 98 254 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 195 301 15 0;
#P button 171 300 15 0;
#P button 140 300 15 0;
#P window linecount 1;
#P newex 139 203 70 196617 unpack 0 0 0.;
#P button 199 98 14 0;
#P message 43 218 32 196617 print;
#P newex 52 173 66 196617 pack 1 2 6.4;
#P slider 27 55 13 50 0 1;
#P slider 117 55 13 50 0 1;
#P slider 70 55 13 50 0 1;
#P number 117 136 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 70 136 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 27 136 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P connect 13 0 10 0;
#P connect 9 0 13 0;
#P connect 6 0 7 0;
#P connect 6 0 9 0;
#P connect 9 2 12 0;
#P connect 9 1 11 0;
#P fasten 8 0 6 0 204 167 57 167;
#P connect 5 0 0 0;
#P connect 3 0 1 0;
#P connect 4 0 2 0;
#P connect 2 0 6 2;
#P connect 1 0 6 1;
#P connect 0 0 6 0;
#P window clipboard copycount 14;

#24384
Feb 11, 2006 at 6:51pm

Try using an object box instead. Maybe, it’s time to start with the
tutorials…

Best,
ej

#70414
Feb 11, 2006 at 7:00pm

I am stupid my print box was a message box doh!

so out of my stupidity I want to ask you another question about
setcell, I am again following the tutorials and now I have this patch
below which I am trying to change the values of the x and y on the
pwindow, but it is just acting weird… isnt it supposed to be
displayin a value between 0-255 to the assigned x-y point by sending
bang to the window?

TIA
ilteris

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 288 67 33 196617 clear;
#P comment 111 108 100 196617 value;
#P comment 60 108 100 196617 y;
#P newex 35 173 60 196617 pack 0 0 0.;
#P button 185 87 15 0;
#P newex 182 357 46 196617 jit.print;
#P number 110 129 35 9 0 255 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 63 129 36 9 0 12 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 20 129 35 9 0 15 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 219 77 15 0;
#P message 334 137 102 196617 setcell $1 $2 val $3;
#P user jit.pwindow 267 238 162 122 0 1 0 0 1 0;
#P newex 268 193 117 196617 jit.matrix 1 char 16 12;
#P comment 22 108 100 196617 x;
#P fasten 13 0 1 0 293 142 273 142;
#P connect 7 0 10 2;
#P connect 6 0 10 1;
#P connect 5 0 10 0;
#P fasten 10 0 3 0 40 200 163 200 163 108 339 108;
#P fasten 4 0 1 0 224 179 273 179;
#P fasten 1 0 8 0 187 206;
#P connect 1 0 2 0;
#P connect 3 0 1 0;
#P window clipboard copycount 14;

On Feb 11, at 1:44 PM, ilteris kaplan wrote:

> hello I am trying to pack my numbers into a list with pack object
> but I am confused at this point since I cannot send this packed
> numbers for example to a print message to print in my max window.
> Here is my patch that is a variant of the reference pack patch. So
> what am I missing here?
>
> Thanks in advance
> ilteris.
>
>
> #P window setfont “Sans Serif” 9.;
> #P number 98 254 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P button 195 301 15 0;
> #P button 171 300 15 0;
> #P button 140 300 15 0;
> #P window linecount 1;
> #P newex 139 203 70 196617 unpack 0 0 0.;
> #P button 199 98 14 0;
> #P message 43 218 32 196617 print;
> #P newex 52 173 66 196617 pack 1 2 6.4;
> #P slider 27 55 13 50 0 1;
> #P slider 117 55 13 50 0 1;
> #P slider 70 55 13 50 0 1;
> #P number 117 136 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P number 70 136 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P number 27 136 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P connect 13 0 10 0;
> #P connect 9 0 13 0;
> #P connect 6 0 7 0;
> #P connect 6 0 9 0;
> #P connect 9 2 12 0;
> #P connect 9 1 11 0;
> #P fasten 8 0 6 0 204 167 57 167;
> #P connect 5 0 0 0;
> #P connect 3 0 1 0;
> #P connect 4 0 2 0;
> #P connect 2 0 6 2;
> #P connect 1 0 6 1;
> #P connect 0 0 6 0;
> #P window clipboard copycount 14;
>

#70415
Feb 11, 2006 at 7:14pm

#70416
Feb 11, 2006 at 7:21pm

try pak instead of pack with pack it only draws when you give a new x
something like this

max v2;
#N vpatcher 120 111 1138 664;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 653 163 27 196617 t b l;
#P comment 729 75 100 196617 value;
#P comment 678 75 100 196617 y;
#P newex 653 140 69 196617 pack 0 0 255;
#P number 728 96 35 9 0 255 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 681 96 36 9 0 12 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 638 96 35 9 0 15 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 640 75 100 196617 x;
#P toggle 211 331 15 0;
#P user gswitch2 211 362 39 32 0 0;
#P newex 443 160 27 196617 t b l;
#P message 269 54 33 196617 clear;
#P comment 518 70 100 196617 value;
#P comment 467 70 100 196617 y;
#P newex 442 135 64 196617 pak 0 0 255;
#P newex 191 437 46 196617 jit.print;
#P number 517 91 35 9 0 255 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 470 91 36 9 0 12 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 427 91 35 9 0 15 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 309 219 15 0;
#P message 329 220 102 196617 setcell $1 $2 val $3;
#P user jit.pwindow 275 387 162 122 0 1 0 0 1 0;
#P newex 276 334 117 196617 jit.matrix 1 char 16 12;
#P comment 429 70 100 196617 x;
#P fasten 14 1 8 0 245 422 196 422;
#P connect 15 0 14 0;
#P fasten 1 0 14 1 281 357 245 357;
#P fasten 3 0 1 0 334 265 281 265;
#P fasten 4 0 1 0 314 255 281 255;
#P fasten 12 0 1 0 274 149 281 149;
#P connect 1 0 2 0;
#P fasten 23 0 4 0 658 200 314 200;
#P fasten 13 0 4 0 448 187 314 187;
#P fasten 23 1 3 0 675 209 334 209;
#P fasten 13 1 3 0 465 196 334 196;
#P connect 5 0 9 0;
#P connect 9 0 13 0;
#P connect 6 0 9 1;
#P connect 7 0 9 2;
#P connect 17 0 20 0;
#P connect 20 0 23 0;
#P connect 18 0 20 1;
#P connect 19 0 20 2;
#P pop;

#70417
Feb 11, 2006 at 7:35pm

first of all thanks for giving your time guys. pak is really handy, I
am going to definitely dig it, other than that it makes sense that it
is going between on and off 0-1 but that rises another question :
how am I going to change the value from float to integer?

Thanks!
ilteris.

#70418
Feb 11, 2006 at 8:13pm

float -> int multiply by 1 int-> float multiply by 1.
or use float or int objects you can even store numbers in them

float-int-mania:

max v2;
#N vpatcher 20 74 699 640;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 443 352 63 196617 5.;
#P newex 443 324 63 196617 prepend set;
#P newex 443 281 63 196617 float;
#P message 437 249 50 196617 5;
#P newex 437 221 62 196617 prepend set;
#P newex 439 185 63 196617 int;
#P message 290 64 31 196617 89.3;
#P message 248 64 20 196617 89;
#P message 62 441 50 196617 5.3;
#P newex 60 413 62 196617 prepend set;
#P newex 144 365 41 196617 + 0.3;
#P message 77 285 50 196617 5.;
#P newex 75 257 62 196617 prepend set;
#P message 78 352 50 196617 5;
#P newex 76 324 62 196617 prepend set;
#P message 77 213 50 196617 5;
#P newex 75 185 62 196617 prepend set;
#P message 256 202 50 196617 5;
#P newex 254 174 62 196617 prepend set;
#P message 361 200 50 196617 5;
#P newex 361 172 62 196617 prepend set;
#P message 317 434 50 196617 5.;
#P newex 317 406 62 196617 prepend set;
#P message 214 433 50 196617 5.;
#P newex 214 405 62 196617 prepend set;
#P flonum 336 333 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 231 345 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 317 302 27 196617 + 0.;
#P newex 214 309 29 196617 * 1.;
#P number 317 261 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 214 262 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 168 263 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 317 213 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 317 146 27 196617 + 0;
#P flonum 214 221 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 214 151 27 196617 * 1;
#P message 194 60 23 196617 5.3;
#P message 136 64 14 196617 5;
#P flonum 168 223 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 168 153 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 168 110 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P connect 30 0 31 0;
#P connect 31 0 32 0;
#P connect 1 0 24 0;
#P connect 2 0 28 0;
#P connect 9 0 26 0;
#P connect 24 0 25 0;
#P connect 28 0 29 0;
#P connect 26 0 27 0;
#P connect 9 0 30 0;
#P connect 4 0 0 0;
#P connect 3 0 0 0;
#P connect 33 0 0 0;
#P connect 34 0 0 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 9 0;
#P connect 0 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 16 0;
#P connect 16 0 17 0;
#P connect 12 0 14 0;
#P connect 5 0 22 0;
#P connect 22 0 23 0;
#P connect 0 0 7 0;
#P connect 7 0 8 0;
#P connect 8 0 11 0;
#P connect 11 0 13 0;
#P connect 13 0 18 0;
#P connect 18 0 19 0;
#P connect 13 0 15 0;
#P connect 7 0 20 0;
#P connect 20 0 21 0;
#P connect 35 0 36 0;
#P connect 36 0 37 0;
#P fasten 0 0 35 0 173 132 444 132;
#P fasten 7 0 38 0 322 198 354 198 354 271 448 271;
#P connect 38 0 39 0;
#P connect 39 0 40 0;
#P pop;

#70419
Feb 12, 2006 at 2:48am

hrm. Yeah, do the tutorials, and then, when you’re done with them.. do them again.

#70420
Feb 12, 2006 at 10:40am

> is going between on and off 0-1 but that rises another question :
> how am I going to change the value from float to integer?

in your case, you scale the range and change to
int at the same time by

[* 250]

otherwise it is

float -> [+ 0.5]-[number] -> integer

#70421

You must be logged in to reply to this topic.