comma & , data format question

Jul 23, 2007 at 12:49pm

comma & , data format question

Hi list,

I try to format a message for jit.lcd .
This message is [moveto X Y , ascii x].
And I don’t want to give it from a message box .

The problem is jit.lcd doesn’t accept this message created with a [sprintf] or [append] boxes.

Max Window shows such data format (with comma which fragments them) aren’t identical to a message box.

Could someone show me the good way to “tell” max such a message.
Please have a look on my little patch below .

Don’t know if it is a Max Topic or jitter one …

thank you.

max v2;
#N vpatcher 83 44 820 711;
#P origin 0 25;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 450 603 239 196617 jit.lcd doesn’t want this message , see max window;
#B color 14;
#P comment 462 282 239 196617 jit.lcd doesn’t want this message , see max window;
#B color 14;
#P comment 208 150 155 196617 message with message box is ok;
#B color 2;
#P message 248 313 70 196617 size 320 240;
#P newex 140 207 27 196617 i 1;
#P newex 69 171 48 196617 loadbang;
#P newex 69 265 37 196617 s 2lcd;
#B color 5;
#P message 96 207 34 196617 reset;
#P message 53 207 33 196617 clear;
#P message 497 176 40 196617 20 19;
#P message 523 508 40 196617 20 19;
#P newex 563 256 37 196617 s 2lcd;
#B color 5;
#P newex 479 578 37 196617 s 2lcd;
#B color 5;
#P newex 522 382 37 196617 s 2lcd;
#B color 5;
#P newex 69 283 37 196617 r 2lcd;
#B color 5;
#P newex 255 90 37 196617 s 2lcd;
#B color 5;
#P newex 523 552 92 196617 append \, ascii 49;
#P newex 523 531 107 196617 sprintf moveto %i %i;
#P newex 523 580 72 196617 print sprintfB;
#P newex 226 111 73 196617 print message;
#P newex 497 254 65 196617 print append;
#P newex 503 352 165 196617 sprintf moveto %i %i \, ascii 49;
#P message 503 329 40 196617 20 19;
#P newex 503 401 73 196617 print sprintfA;
#P message 226 57 130 196617 moveto 20 19 , ascii 49;
#P newex 497 203 81 196617 prepend moveto;
#P newex 497 224 92 196617 append \, ascii 49;
#P toggle 341 295 15 0;
#P message 341 313 75 196617 idlemouse $1;
#P newex 222 283 79 196617 prepend moveto;
#P newex 222 263 47 196617 pack 0 0;
#P number 259 243 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 222 243 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 222 217 166 196617 unpack 0 0 0 0 0 0 0 0;
#P newex 222 191 110 196617 route mouse mouseidle;
#P user jit.pwindow 100 350 322 242 1 1 1 0 1 0;
#P newex 101 308 111 196617 jit.lcd 4 char 320 240;
#B color 5;
#P flonum 174 238 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 140 238 15 0;
#P newex 140 259 44 196617 metro 2;
#P comment 508 428 131 196617 sprintf doesn’t want the \,;
#B color 14;
#P connect 35 0 32 0;
#P connect 32 0 34 0;
#P connect 33 0 34 0;
#P connect 35 0 33 0;
#P connect 26 0 4 0;
#P connect 1 0 4 0;
#P fasten 11 0 4 0 227 304 106 304;
#P fasten 37 0 5 0 253 339 106 339;
#P fasten 12 0 5 0 346 334 106 334;
#P connect 4 0 5 0;
#P connect 35 0 36 0;
#P connect 36 0 2 0;
#P connect 2 0 1 0;
#P connect 3 0 1 1;
#P fasten 5 1 6 0 416 594 430 594 430 188 227 188;
#P connect 6 0 7 0;
#P fasten 6 1 7 0 277 212 227 212;
#P connect 7 0 8 0;
#P connect 8 0 10 0;
#P connect 10 0 11 0;
#P connect 16 0 21 0;
#P connect 16 0 25 0;
#P fasten 7 1 9 0 249 238 264 238;
#P connect 9 0 10 1;
#P connect 13 0 12 0;
#P connect 24 0 28 0;
#P connect 31 0 15 0;
#P connect 15 0 14 0;
#P connect 14 0 20 0;
#P connect 18 0 19 0;
#P connect 19 0 17 0;
#P connect 19 0 27 0;
#P connect 30 0 23 0;
#P connect 23 0 24 0;
#P connect 24 0 22 0;
#P connect 14 0 29 0;
#P pop;

#33001
Jul 23, 2007 at 1:59pm

> I try to format a message for jit.lcd .
> This message is [moveto X Y , ascii x].
> And I don’t want to give it from a message box .

Hi.
Could you explain me why you don’t want message box ?
This message box: “moveto $1 $2, ascii x” should work (but i don’t own
jitter…)
Best.

#109365
Jul 23, 2007 at 3:19pm

>This message box: “moveto $1 $2, ascii x” should work

Yes it works fine

>Could you explain me why you don’t want message box ?
I isolated the problem from a more complex patch.
I need to “concatenete” several messages.

The question is:
why instructions separated by “,” do not seem to be understood same as a series of messages separated by “,”

#109366
Jul 23, 2007 at 3:53pm

hi derrick,

1. there should be no blank between the 2nd int and the ascii part of
the message.
2. you can use sprintf with “prepend set” and a messagebox which
should be triggered to send the contents to jit.lcd. well, this
doesn’t avoid the message box, but it works.

sprintf only for formats a message, but does not process it like the
message box does.
that is why it outputs a single formatted message and not 2 messages
seperated by a comma.
only the message box processes the data as 2 messages, when seperated
by a comma.

I modified your patch. have look if it is this you’re looking for:

best, bernd

max v2;
#N vpatcher 183 44 951 729;
#P origin 0 25;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 503 398 119 196617 moveto 20 19 , ascii 49;
#P newex 520 365 62 196617 prepend set;
#P newex 503 342 27 196617 t b l;
#P comment 450 603 239 196617 jit.lcd doesn’t want this message ,
see max window;
#B color 14;
#P comment 462 282 239 196617 jit.lcd doesn’t want this message ,
see max window;
#B color 14;
#P comment 208 150 155 196617 message with message box is ok;
#B color 2;
#P message 248 313 70 196617 size 320 240;
#P newex 140 207 27 196617 i 1;
#P newex 69 171 48 196617 loadbang;
#P newex 69 265 37 196617 s 2lcd;
#B color 5;
#P message 96 207 34 196617 reset;
#P message 53 207 33 196617 clear;
#P message 497 176 40 196617 20 19;
#P message 523 508 40 196617 20 19;
#P newex 563 256 37 196617 s 2lcd;
#B color 5;
#P newex 479 578 37 196617 s 2lcd;
#B color 5;
#P newex 495 426 37 196617 s 2lcd;
#B color 5;
#P newex 69 283 37 196617 r 2lcd;
#B color 5;
#P newex 255 90 37 196617 s 2lcd;
#B color 5;
#P newex 523 552 92 196617 append \, ascii 49;
#P newex 523 531 107 196617 sprintf moveto %i %i;
#P newex 523 580 72 196617 print sprintfB;
#P newex 226 111 73 196617 print message;
#P newex 497 254 65 196617 print append;
#P newex 503 321 156 196617 sprintf moveto %i %i\, ascii 49;
#P message 503 298 40 196617 20 19;
#P newex 535 427 73 196617 print sprintfA;
#P message 226 57 130 196617 moveto 20 19 , ascii 49;
#P newex 497 203 81 196617 prepend moveto;
#P newex 497 224 79 196617 append ascii 49;
#P toggle 341 295 15 0;
#P message 341 313 75 196617 idlemouse $1;
#P newex 222 283 79 196617 prepend moveto;
#P newex 222 263 47 196617 pack 0 0;
#P number 259 243 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 222 243 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 222 217 166 196617 unpack 0 0 0 0 0 0 0 0;
#P newex 222 191 110 196617 route mouse mouseidle;
#P user jit.pwindow 100 350 322 242 1 1 1 0 1 0;
#P newex 101 308 111 196617 jit.lcd 4 char 320 240;
#B color 5;
#P flonum 174 238 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 140 238 15 0;
#P newex 140 259 44 196617 metro 2;
#P comment 508 459 131 196617 sprintf doesn’t want the \,;
#B color 14;
#P connect 35 0 32 0;
#P connect 32 0 34 0;
#P connect 33 0 34 0;
#P connect 35 0 33 0;
#P connect 26 0 4 0;
#P connect 1 0 4 0;
#P fasten 11 0 4 0 227 304 106 304;
#P fasten 37 0 5 0 253 339 106 339;
#P fasten 12 0 5 0 346 334 106 334;
#P connect 4 0 5 0;
#P connect 35 0 36 0;
#P connect 36 0 2 0;
#P connect 2 0 1 0;
#P connect 3 0 1 1;
#P fasten 5 1 6 0 416 594 430 594 430 188 227 188;
#P connect 6 0 7 0;
#P fasten 6 1 7 0 277 212 227 212;
#P connect 7 0 8 0;
#P connect 8 0 10 0;
#P connect 10 0 11 0;
#P connect 16 0 21 0;
#P connect 16 0 25 0;
#P fasten 7 1 9 0 249 238 264 238;
#P connect 9 0 10 1;
#P connect 13 0 12 0;
#P connect 24 0 28 0;
#P connect 43 0 27 0;
#P connect 31 0 15 0;
#P connect 15 0 14 0;
#P connect 14 0 20 0;
#P connect 18 0 19 0;
#P connect 19 0 41 0;
#P connect 42 0 43 0;
#P connect 41 0 43 0;
#P connect 41 1 42 0;
#P connect 30 0 23 0;
#P connect 23 0 24 0;
#P connect 24 0 22 0;
#P connect 43 0 17 0;
#P connect 14 0 29 0;
#P pop;

Am 23.07.2007 um 17:19 schrieb derrickgiscloux:

>
>> This message box: “moveto $1 $2, ascii x” should work
>
> Yes it works fine
>
>> Could you explain me why you don’t want message box ?
> I isolated the problem from a more complex patch.
> I need to “concatenete” several messages.
>
> The question is:
> why instructions separated by “,” do not seem to be understood
> same as a series of messages separated by “,”
>

____________________________________
bernd schultheis

komponist | composer | compositeur

tieckstrasse 9
10115 berlin

fon | phone | phone: +49 (0)30 26 55 00 83
mobil | mobile | portable: +49 (0)173 61 91 495

http://www.bernd-schultheis.de
mail@bernd-schultheis.de

#109367
Jul 23, 2007 at 4:59pm

>sprintf only for formats a message, but does not process it like >the
>message box does.
>that is why it outputs a single formatted message and not 2 >messages
>seperated by a comma.
>only the message box processes the data as 2 messages, when >seperated
>by a comma.

So, even with backslash comma in [sprintf] it’s impossible to send a formatted message without a message box ?
.. And the same thing occurs with [append ,] ??

max v2;
#N vpatcher 83 44 902 746;
#P origin 0 11;
#P window setfont “Sans Serif” 9.;
#P newex 497 121 156 196617 sprintf moveto %i %i\, ascii 49;
#P message 497 100 40 196617 20 19;
#P newex 497 146 37 196617 s 2lcd;
#B color 5;
#P message 250 121 119 196617 moveto 20 19 , ascii 49;
#P newex 267 88 62 196617 prepend set;
#P newex 250 65 27 196617 t b l;
#P newex 242 149 37 196617 s 2lcd;
#B color 5;
#P newex 250 44 156 196617 sprintf moveto %i %i\, ascii 49;
#P message 250 21 40 196617 20 19;
#P newex 282 150 73 196617 print sprintfA;
#P comment 471 623 239 196617 jit.lcd doesn’t want this message , see max window;
#P comment 462 296 239 196617 jit.lcd doesn’t want this message , see max window;
#P comment 74 49 155 196617 message with message box is ok;
#B color 2;
#P message 248 327 70 196617 size 320 240;
#P newex 140 221 27 196617 i 1;
#P newex 69 185 48 196617 loadbang;
#P newex 69 279 37 196617 s 2lcd;
#B color 5;
#P message 96 221 34 196617 reset;
#P message 53 221 33 196617 clear;
#P message 497 190 40 196617 20 19;
#P message 523 522 40 196617 20 19;
#P newex 563 270 37 196617 s 2lcd;
#B color 5;
#P newex 479 592 37 196617 s 2lcd;
#B color 5;
#P newex 519 392 37 196617 s 2lcd;
#B color 5;
#P newex 69 297 37 196617 r 2lcd;
#B color 5;
#P newex 106 119 37 196617 s 2lcd;
#B color 5;
#P newex 523 566 92 196617 append \, ascii 49;
#P newex 523 545 107 196617 sprintf moveto %i %i;
#P newex 523 594 72 196617 print sprintfB;
#P newex 77 140 73 196617 print message;
#P newex 497 268 65 196617 print append;
#P newex 500 362 165 196617 sprintf moveto %i %i \, ascii 49;
#P message 500 339 40 196617 20 19;
#P newex 500 411 73 196617 print sprintfA;
#P message 77 86 130 196617 moveto 20 19 , ascii 49;
#P newex 497 217 81 196617 prepend moveto;
#P newex 497 238 92 196617 append \, ascii 49;
#P toggle 341 309 15 0;
#P message 341 327 75 196617 idlemouse $1;
#P newex 222 297 79 196617 prepend moveto;
#P newex 222 277 47 196617 pack 0 0;
#P number 259 257 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 222 257 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 222 231 166 196617 unpack 0 0 0 0 0 0 0 0;
#P newex 222 205 110 196617 route mouse mouseidle;
#P user jit.pwindow 100 364 322 242 1 1 1 0 1 0;
#P newex 101 322 111 196617 jit.lcd 4 char 320 240;
#B color 5;
#P flonum 174 252 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 140 252 15 0;
#P newex 140 273 44 196617 metro 2;
#P comment 505 438 131 196617 sprintf doesn’t want the \,;
#P user panel 46 26 367 155;
#X brgb 3 245 30;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 452 72 276 576;
#X brgb 229 3 51;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 37 0 34 0;
#P connect 35 0 36 0;
#P connect 34 0 36 0;
#P connect 18 0 23 0;
#P connect 37 0 35 0;
#P fasten 13 0 6 0 227 318 106 318;
#P connect 3 0 6 0;
#P connect 28 0 6 0;
#P connect 6 0 7 0;
#P fasten 14 0 7 0 346 348 106 348;
#P fasten 39 0 7 0 253 353 106 353;
#P connect 18 0 27 0;
#P connect 37 0 38 0;
#P connect 38 0 4 0;
#P connect 4 0 3 0;
#P connect 5 0 3 1;
#P fasten 7 1 8 0 416 608 430 608 430 202 227 202;
#P fasten 8 1 9 0 277 226 227 226;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 13 0;
#P connect 49 0 46 0;
#P connect 44 0 45 0;
#P connect 45 0 47 0;
#P connect 48 0 49 0;
#P connect 47 0 49 0;
#P fasten 9 1 11 0 249 252 264 252;
#P connect 11 0 12 1;
#P connect 47 1 48 0;
#P connect 49 0 43 0;
#P connect 15 0 14 0;
#P connect 26 0 30 0;
#P connect 51 0 52 0;
#P connect 52 0 50 0;
#P connect 33 0 17 0;
#P connect 17 0 16 0;
#P connect 16 0 22 0;
#P connect 20 0 21 0;
#P connect 21 0 19 0;
#P connect 21 0 29 0;
#P connect 32 0 25 0;
#P connect 25 0 26 0;
#P connect 26 0 24 0;
#P connect 16 0 31 0;
#P pop;

#109368
Jul 23, 2007 at 5:13pm

So , a single formatted message which includes 2 messages
seperated by a comma can’t work neither sprintf, or append ,
or zl reg ?

look :

max v2;
#N vpatcher 6 44 956 759;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 101 166 31 196617 but :;
#P comment 71 40 100 196617 OK !!!;
#P comment 199 470 100 196617 NO ????;
#P newex 53 338 64 196617 print zl_reg;
#B color 5;
#P newex 227 537 37 196617 s 2lcd;
#B color 5;
#P message 45 629 128 196617 moveto 228 122 , ascii 49;
#P newex 45 607 62 196617 prepend set;
#P newex 53 560 66 196617 print sprintf;
#B color 5;
#P newex 200 507 165 196617 sprintf moveto %i %i \, ascii 49;
#P message 200 484 40 196617 20 19;
#P newex 424 136 48 196617 loadbang;
#P button 424 168 15 0;
#P newex 220 327 37 196617 s 2lcd;
#B color 5;
#P message 595 321 70 196617 size 320 240;
#P newex 487 215 27 196617 i 1;
#P newex 416 269 37 196617 s 2lcd;
#B color 5;
#P message 443 215 34 196617 reset;
#P message 400 215 33 196617 clear;
#P newex 416 291 37 196617 r 2lcd;
#B color 5;
#P newex 71 85 37 196617 s 2lcd;
#B color 5;
#P message 71 64 130 196617 moveto 20 19 , ascii 49;
#P toggle 688 303 15 0;
#P message 688 321 75 196617 idlemouse $1;
#P newex 569 291 79 196617 prepend moveto;
#P newex 569 271 47 196617 pack 0 0;
#P number 606 251 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 569 251 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 569 225 166 196617 unpack 0 0 0 0 0 0 0 0;
#P newex 569 199 110 196617 route mouse mouseidle;
#P user jit.pwindow 447 358 322 242 1 1 1 0 1 0;
#P newex 448 316 111 196617 jit.lcd 4 char 320 240;
#B color 5;
#P flonum 521 246 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 487 246 15 0;
#P newex 487 267 44 196617 metro 2;
#P button 148 234 26 0;
#P message 49 415 128 196617 moveto 20 19 , ascii 49;
#P newex 49 393 62 196617 prepend set;
#P newex 192 294 36 196617 zl reg;
#P message 217 233 40 196617 20 19;
#P newex 217 253 81 196617 prepend moveto;
#P newex 217 274 92 196617 append \, ascii 49;
#P comment 161 213 100 196617 NO ????;
#P fasten 33 0 35 0 205 586 50 586;
#P connect 35 0 36 0;
#P fasten 4 0 5 0 197 371 54 371;
#P connect 5 0 6 0;
#P fasten 4 0 38 0 197 317 58 317;
#P fasten 33 0 34 0 205 533 58 533;
#P connect 21 0 22 0;
#P connect 7 0 4 0;
#P connect 32 0 33 0;
#P connect 3 0 2 0;
#P connect 2 0 1 0;
#P connect 1 0 4 1;
#P connect 4 0 29 0;
#P connect 33 0 37 0;
#P connect 30 0 24 0;
#P connect 25 0 26 0;
#P connect 24 0 26 0;
#P connect 31 0 30 0;
#P connect 30 0 25 0;
#P fasten 18 0 11 0 574 312 453 312;
#P connect 8 0 11 0;
#P connect 23 0 11 0;
#P connect 11 0 12 0;
#P fasten 19 0 12 0 693 342 453 342;
#P fasten 28 0 12 0 600 347 453 347;
#P connect 31 0 27 0;
#P connect 27 0 9 0;
#P connect 9 0 8 0;
#P connect 10 0 8 1;
#P fasten 12 1 13 0 763 602 777 602 777 196 574 196;
#P fasten 13 1 14 0 624 220 574 220;
#P connect 13 0 14 0;
#P connect 14 0 15 0;
#P connect 15 0 17 0;
#P connect 17 0 18 0;
#P fasten 14 1 16 0 596 246 611 246;
#P connect 16 0 17 1;
#P connect 20 0 19 0;
#P pop;

#109369
Jul 24, 2007 at 12:57am

On 7/23/07, derrickgiscloux wrote:
>
>
> So , a single formatted message which includes 2 messages
> seperated by a comma can’t work neither sprintf, or append ,
> or zl reg ?

well, it is said that “a comma (,) divides a message into separate messages
which will be sent out in order” in “message object / arguments” in
MaxReferenceManual.pdf so, I guess it works but with the use of a message
box :)

#P button 52 55 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 55 152 179 9109513 60 60 , 65 60 , 71 60 , 80 60;
#P message 54 80 31 9109513 60 60;
#P newex 70 116 173 9109513 sprintf set %i %i\, 65 60\, 71 60\, 80 60;
#P newex 55 183 40 9109513 noteout;
#P connect 2 0 3 0;
#P connect 2 0 1 0;
#P connect 1 0 3 0;
#P connect 4 0 2 0;
#P connect 3 0 0 0;
#P window clipboard copycount 5;

#109370
Jul 24, 2007 at 2:43pm

Yes, of course it is possible to set messages separated by commas in a message box, formatted with [sprintf] and “,” for example …
but
I hoped to be able to store such datas (multiple messages) in [zl reg] , and it is possible ! but if you bang [zl reg] filled with such datas, these messages can’t be understood by (for example) jit.lcd

Now I understand my error, which is comma-instruction and comma-character (,) can’t have the same signification, even stored in an object. Only message box treats comma as “comma-instruction”.

#109371
Jul 25, 2007 at 3:48pm

derrickgiscloux schrieb:
> Now I understand my error, which is comma-instruction and
> comma-character (,) can’t have the same signification, even stored
> in an object. Only message box treats comma as “comma-instruction”.

Try this, to understand even better:

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 497 169 25 196617 49;
#P newex 497 196 68 196617 prepend ascii;
#P button 537 109 15 0;
#P message 568 169 40 196617 20 19;
#P newex 568 254 37 196617 s 2lcd;
#B color 5;
#P newex 497 254 68 196617 print append;
#P newex 568 196 81 196617 prepend moveto;
#P connect 4 0 6 0;
#P connect 4 0 3 0;
#P connect 5 0 1 0;
#P connect 5 0 2 0;
#P connect 0 0 1 0;
#P connect 0 0 2 0;
#P connect 6 0 5 0;
#P connect 3 0 0 0;
#P window clipboard copycount 7;


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#109372

You must be logged in to reply to this topic.