Forums > Jitter

Text through Matrix

June 11, 2007 | 4:06 pm

I made a patch that should be able to direct typings into a jit.window and creates a new line on each "enter". I’m sending the text through a jit.matrix to make jit.gl.text3d recognize the multilines; the patch is working correctly with OSX but the problem is that I need to use it on a Windows computer. On windows XP: the matrix creates some unwanted noise, like a grid. Is there a way to eleminate the noise?

Regards, Olger

The Patch:

max v2;
#N vpatcher 1305 22 2396 1002;
#P origin 0 -82;
#P button 265 553 32 0;
#P window setfont "Sans Serif" 9.;
#P message 265 597 30 196617 open;
#P newex 264 615 51 196617 pcontrol;
#B color 5;
#P message 479 191 31 196617 0.33;
#P message 450 190 23 196617 0.1;
#P newex 487 155 48 196617 loadbang;
#P comment 336 224 71 196617 scale (xyz);
#P flonum 342 140 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 360 180 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 324 200 107 196617 pak scale 1. 1. 1.;
#P flonum 324 180 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 334 301 71 196617 position (xyz);
#P flonum 358 257 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 322 277 107 196617 pak position 0. 0. 0.;
#P flonum 322 257 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 1437 237 2540 1026;
#P window setfont "Sans Serif" 9.;
#P message 173 387 77 196617 drawto fawaka;
#P button 450 353 15 0;
#P button 464 239 15 0;
#P message 442 238 14 196617 0;
#P message 404 238 14 196617 1;
#P user gswitch2 418 261 39 32 1 0;
#P newex 377 212 46 196617 select 1;
#P newex 432 212 51 196617 route set;
#N vpatcher 1606 130 2780 1013;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 247 711 43 196617 route 0;
#P button 474 77 26 0;
#P newex 899 121 30 196617 t b b;
#P message 787 147 14 196617 0;
#P message 767 147 14 196617 1;
#P inlet 868 33 15 0;
#P outlet 457 733 15 0;
#P outlet 427 734 15 0;
#P outlet 395 734 15 0;
#P message 508 354 22 196617 set;
#P message 212 559 39 196617 set $1;
#P number 219 590 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 218 612 91 196617 sprintf delete %ld;
#P newex 291 559 30 196617 t b b;
#P newex 773 42 48 196617 loadbang;
#P inlet 134 40 15 0;
#P newex 426 410 49 196617 delay 80;
#P button 412 385 15 0;
#P button 463 370 15 0;
#P message 313 581 22 196617 set;
#P message 286 508 20 196617 56;
#P message 447 342 14 196617 0;
#P newex 297 390 31 196617 t 1 b;
#P user gswitch2 347 417 39 32 0 0;
#P newex 858 803 51 196617 tosymbol;
#P newex 898 716 30 196617 t s s;
#P button 1047 731 15 0;
#P message 875 782 127 196617 ;
#P newex 921 741 62 196617 prepend set;
#P newex 10 172 49 196617 delay 50;
#P newex 848 739 69 196617 route symbol;
#P newex 849 759 62 196617 prepend set;
#P newex 803 688 29 196617 gate;
#P message 797 670 14 196617 1;
#P message 816 671 17 196617 0;
#P newex 590 523 40 196617 t b i i;
#P newex 794 649 37 196617 select;
#P newex 776 87 53 196617 t b b b b;
#P message 774 66 34 196617 reset;
#P newex 738 123 30 196617 t b b;
#P newex 827 105 48 196617 loadbang;
#P message 238 538 33 196617 dump;
#P button 11 396 15 0;
#P newex 81 123 29 196617 t b i;
#P newex 734 602 30 196617 t b b;
#P message 748 624 41 196617 wclose;
#P message 699 618 30 196617 open;
#P newex 814 208 40 196617 t i i i;
#P message 633 405 14 196617 1;
#P message 600 405 14 196617 0;
#P newex 599 384 46 196617 select 1;
#P toggle 616 429 15 0;
#P user gswitch2 572 214 39 32 0 0;
#P number 738 237 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 735 276 42 196617 max $1;
#P message 827 135 14 196617 1;
#P number 749 201 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N counter;
#X flags 0 0;
#P newobj 754 169 118 196617 counter;
#P message 689 402 14 196617 1;
#P message 656 402 14 196617 0;
#P newex 655 381 46 196617 select 1;
#P toggle 672 426 15 0;
#P user gswitch2 657 214 39 32 0 0;
#P newex 617 289 48 196617 loadbang;
#P message 617 314 14 196617 1;
#P newex 699 550 48 196617 pack 0 0;
#P newex 618 683 91 196617 t dump s clear;
#P newex 648 735 34 196617 atoi;
#P newex 709 707 69 196617 route symbol;
#P message 381 547 33 196617 clear;
#P number 573 487 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 537 383 40 196617 t i i i;
#P message 485 441 39 196617 set $1;
#P number 541 361 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 585 261 15 0;
#P button 549 258 15 0;
#P newex 584 282 30 196617 t b b;
#P newex 539 282 40 196617 t b b b;
#P message 600 309 14 196617 1;
#P message 566 311 14 196617 0;
#N counter 1 4;
#X flags 0 0;
#P newobj 541 340 111 196617 counter 1 4;
#P newex 420 474 40 196617 itoa;
#P number 419 547 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 419 496 51 196617 tosymbol;
#P newex 419 519 94 196617 t b l;
#P newex 420 565 93 196617 sprintf %ld %s;
#N coll ;
#P newobj 418 645 53 196617 coll;
#P message 203 326 14 196617 0;
#P toggle 383 365 15 0;
#P message 410 341 14 196617 1;
#P message 372 340 17 196617 0;
#P user gswitch2 209 393 39 32 1 0;
#P newex 101 352 60 196617 split 1 300;
#P message 305 176 14 196617 1;
#P newex 374 313 46 196617 select 1;
#P number 309 337 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 308 310 34 196617 zl len;
#P window linecount 1;
#P newex 189 220 40 196617 t b b b;
#P message 172 250 33 196617 dump;
#P button 201 139 15 0;
#P message 209 250 33 196617 clear;
#P inlet 244 36 15 0;
#P message 255 252 33 196617 dump;
#P newex 264 227 40 196617 t b l b;
#P message 183 461 534 196617;
#P newex 67 421 62 196617 prepend set;
#P button 250 344 15 0;
#P newex 266 203 51 196617 zl ecils 1;
#P newex 43 281 46 196617 t dump i;
#P newex 86 161 115 196617 select 8 13 30 31 9 27;
#P message 293 253 33 196617 clear;
#P newex 132 381 39 196617 thresh;
#P newex 118 325 44 196617 capture;
#P comment 855 366 86 196617 regel_nummer;
#P connect 70 0 84 0;
#P connect 84 0 71 0;
#P connect 4 6 5 0;
#P fasten 2 0 8 0 137 402 72 402;
#P connect 98 0 70 0;
#P connect 70 1 4 0;
#P fasten 1 0 21 0 123 346 106 346;
#P connect 47 0 1 0;
#P connect 47 2 1 0;
#P connect 46 0 1 0;
#P connect 3 0 1 0;
#P fasten 5 0 1 0 48 314 123 314;
#P fasten 5 1 1 0 84 314 123 314;
#P connect 10 1 1 0;
#P connect 11 0 1 0;
#P connect 13 0 1 0;
#P connect 15 0 1 0;
#P fasten 26 0 2 0 208 372 137 372;
#P fasten 21 0 2 0 106 372 137 372;
#P connect 16 1 15 0;
#P fasten 22 1 9 0 243 432 188 432;
#P fasten 8 0 9 0 72 445 188 445;
#P connect 104 0 9 0;
#P connect 14 0 16 0;
#P connect 12 0 14 0;
#P connect 90 0 14 0;
#P connect 16 0 26 0;
#P connect 16 2 13 0;
#P connect 76 0 13 0;
#P fasten 25 0 22 0 388 383 214 383;
#P fasten 42 2 103 0 572 442 217 442;
#P connect 102 0 101 0;
#P connect 103 0 102 0;
#P fasten 100 0 102 0 296 579 224 579;
#P fasten 7 0 22 1 255 390 243 390;
#P connect 71 0 72 0;
#P connect 27 0 113 0;
#P fasten 4 0 7 0 91 301 255 301;
#P connect 10 0 11 0;
#P connect 6 0 10 0;
#P fasten 9 0 6 0 188 488 39 488 39 82 271 82;
#P connect 97 0 100 0;
#P connect 10 2 3 0;
#P connect 22 0 91 0;
#P connect 20 0 6 1;
#P fasten 2 0 17 0 137 402 193 402 193 376 292 376 292 302 313 302;
#P connect 17 0 18 0;
#P connect 100 1 94 0;
#P connect 91 0 90 0;
#P connect 92 0 90 0;
#P connect 19 0 23 0;
#P fasten 18 0 19 0 314 358 352 358 352 307 379 307;
#P connect 91 1 90 1;
#P connect 76 1 44 0;
#P connect 24 0 25 0;
#P connect 23 0 25 0;
#P connect 113 1 105 0;
#P connect 19 1 24 0;
#P connect 22 0 96 0;
#P fasten 101 0 27 0 223 634 423 634;
#P connect 72 0 27 0;
#P connect 28 0 27 0;
#P connect 44 0 27 0;
#P connect 48 0 27 0;
#P connect 67 0 27 0;
#P connect 68 0 27 0;
#P connect 78 1 27 0;
#P connect 32 0 30 0;
#P connect 30 0 29 0;
#P fasten 41 0 31 0 490 543 424 543;
#P connect 29 0 31 0;
#P fasten 2 0 32 0 137 432 425 432;
#P connect 93 0 32 0;
#P connect 31 0 28 0;
#P connect 96 0 97 0;
#P connect 27 1 106 0;
#P connect 19 1 92 0;
#P fasten 94 0 107 0 318 706 462 706;
#P connect 19 1 95 0;
#P connect 90 1 112 0;
#P fasten 42 0 41 0 542 406 490 406;
#P connect 29 1 28 1;
#P connect 36 2 104 0;
#P connect 40 0 42 0;
#P connect 38 0 36 0;
#P fasten 37 0 33 0 589 331 546 331;
#P fasten 59 0 33 0 740 335 546 335;
#P fasten 36 0 33 0 544 332 546 332;
#P connect 33 0 40 0;
#P fasten 4 1 38 0 109 208 554 208;
#P fasten 61 1 38 0 606 251 554 251;
#P fasten 36 1 34 0 575 308 571 308;
#P fasten 34 0 33 1 571 332 571 332;
#P fasten 35 0 33 1 605 332 571 332;
#P fasten 62 0 61 0 621 449 724 449 724 169 577 169;
#P fasten 42 1 43 0 559 404 578 404;
#P connect 39 0 37 0;
#P fasten 51 1 39 0 691 256 590 256;
#P connect 43 0 78 0;
#P fasten 40 0 63 0 546 378 604 378;
#P connect 37 1 35 0;
#P connect 63 0 64 0;
#P fasten 4 3 61 1 145 190 606 190;
#P connect 49 0 33 3;
#P fasten 64 0 62 0 605 425 621 425;
#P fasten 65 0 62 0 638 425 621 425;
#P connect 50 0 49 0;
#P connect 76 2 49 0;
#P connect 89 0 47 0;
#P connect 63 1 65 0;
#P fasten 66 1 63 1 834 357 640 357;
#P connect 45 0 46 0;
#P connect 47 1 46 0;
#P fasten 40 0 53 0 546 378 660 378;
#P connect 53 0 54 0;
#P fasten 52 0 51 0 677 447 720 447 720 176 662 176;
#P fasten 55 0 52 0 694 422 677 422;
#P fasten 54 0 52 0 661 422 677 422;
#P fasten 90 1 51 1 381 453 439 453 439 151 691 151;
#P fasten 4 2 51 1 127 200 691 200;
#P connect 53 1 55 0;
#P fasten 66 0 48 0 819 532 704 532;
#P connect 69 0 67 0;
#P connect 4 5 69 0;
#P connect 60 0 59 0;
#P connect 4 1 74 0;
#P fasten 66 2 60 0 849 231 743 231;
#P connect 69 1 68 0;
#P fasten 56 0 57 0 759 191 754 191;
#P connect 74 0 56 0;
#P connect 111 0 56 0;
#P connect 111 1 109 0;
#P connect 99 0 75 0;
#P connect 75 0 76 0;
#P fasten 108 0 76 0 873 64 845 64 845 79 781 79;
#P connect 110 0 56 1;
#P connect 109 0 56 1;
#P connect 74 1 110 0;
#P connect 27 1 77 0;
#P connect 77 0 80 0;
#P connect 80 0 81 0;
#P connect 79 0 81 0;
#P fasten 56 0 66 0 759 192 819 192;
#P connect 77 1 79 0;
#P connect 78 2 77 1;
#P connect 27 0 81 1;
#P connect 73 0 58 0;
#P connect 76 3 58 0;
#P fasten 58 0 56 3 832 160 840 160;
#P connect 88 0 83 0;
#P connect 83 0 82 0;
#P connect 86 0 89 0;
#P connect 85 0 86 0;
#P connect 82 0 86 0;
#P connect 87 0 86 0;
#P connect 81 0 88 0;
#P connect 112 0 111 0;
#P connect 88 1 85 0;
#P connect 78 0 87 0;
#P pop;
#P newobj 281 189 151 196617 p textgroup;
#P newex 293 329 72 196617 pak offset 0 0;
#P newex 278 386 182 196617 jit.matrix bam 1 char 30 20 @adapt 0;
#P newex 271 296 27 196617 atoi;
#P newex 277 356 67 196617 jit.fill bam 0;
#P newex 275 416 65 196617 jit.gl.text3d;
#B color 5;
#P inlet 701 387 15 0;
#P inlet 627 351 15 0;
#P inlet 383 81 15 0;
#P inlet 262 84 15 0;
#P fasten 1 0 17 0 394 179 178 179;
#P connect 9 0 6 0;
#P hidden connect 7 0 4 0;
#P connect 3 0 4 0;
#P connect 17 0 4 0;
#P connect 6 0 5 0;
#P connect 8 0 5 0;
#P connect 16 0 7 0;
#P connect 2 0 7 0;
#P connect 5 0 7 0;
#P connect 0 0 9 0;
#P connect 9 1 8 2;
#P connect 9 1 11 0;
#P connect 11 0 13 0;
#P connect 13 0 12 0;
#P connect 14 0 12 0;
#P connect 1 0 9 2;
#P connect 9 2 10 0;
#P connect 11 1 14 0;
#P connect 15 0 12 1;
#P connect 12 1 16 0;
#P connect 10 0 15 0;
#P pop;
#P newobj 148 470 84 196617 p text generator;
#P newex 359 350 60 196617 loadmess 1;
#P toggle 361 374 15 0;
#P newex 363 396 57 196617 qmetro 20;
#P newex 214 310 48 196617 loadbang;
#P newex 214 401 30 196617 t b b;
#P button 214 342 31 0;
#P user jit.fpsgui 356 482 60 196617 0;
#P newex 472 387 48 196617 loadbang;
#P button 473 411 15 0;
#P newex 473 433 88 196617 pak size 512 512;
#P newex 470 455 93 196617 jit.window fawaka;
#P newex 357 430 95 196617 t b erase b b clear;
#P newex 358 455 100 196617 jit.gl.render fawaka;
#P newex 146 434 40 196617 key;
#P comment 216 282 56 196617 refresh;
#P window linecount 4;
#P comment 76 345 100 196617 Type anything ; return = next line backspace = backspace;
#P window linecount 1;
#P comment 115 563 145 196617 The probleem should be here:;
#P fasten 30 0 17 0 269 641 250 641 250 462 153 462;
#P connect 3 0 17 0;
#P connect 12 1 17 1;
#P connect 5 4 17 2;
#P connect 12 0 17 2;
#P connect 13 0 11 0;
#P connect 11 0 12 0;
#P connect 19 0 17 3;
#P connect 23 0 17 3;
#P connect 5 3 17 3;
#P connect 31 0 30 0;
#P connect 32 0 31 0;
#P connect 25 0 22 0;
#P connect 28 0 25 0;
#P fasten 18 0 19 1 327 274 359 274;
#P fasten 22 0 23 1 329 197 361 197;
#P connect 4 0 10 0;
#P connect 14 0 5 0;
#P connect 29 0 20 0;
#P connect 5 1 4 0;
#P connect 5 0 4 0;
#P connect 25 0 24 0;
#P connect 16 0 15 0;
#P connect 15 0 14 0;
#P fasten 20 0 19 2 363 274 391 274;
#P fasten 24 0 23 2 365 197 393 197;
#P connect 27 0 28 0;
#P connect 7 0 6 0;
#P connect 9 0 8 0;
#P connect 8 0 7 0;
#P connect 27 0 29 0;
#P pop;


June 11, 2007 | 7:12 pm

Olger Star skrev:
> I made a patch that should be able to direct typings into a jit.window and creates a new line on each "enter". I’m sending the text through a jit.matrix to make jit.gl.text3d recognize the multilines; the patch is working correctly with OSX but the problem is that I need to use it on a Windows computer. On windows XP: the matrix creates some unwanted noise, like a grid. Is there a way to eleminate the noise?
>
> Regards, Olger
>
> The Patch:
>
Sorry Olger, I would really love to help you out, but I think you need
to clean up your [p textgroup] patcher before I can make any sense of
it… I can imagine also, that cleaning it up would reveal the problem
sooner?

Best,
Andreas.


June 12, 2007 | 10:58 am

Hi Andreas,

Here’s the stripped version,

Regards, Olger

max v2;
#N vpatcher 1305 22 2396 1002;
#P origin 0 -82;
#P window setfont "Sans Serif" 9.;
#P newex 633 389 53 196617 b 4;
#P newex 633 355 48 196617 loadbang;
#P message 594 438 33 196617 dump;
#P message 771 438 44 196617 3 line 3;
#P message 711 438 44 196617 2 line 2;
#P message 650 437 44 196617 1 line 1;
#N coll ;
#P newobj 703 487 53 196617 coll;
#P message 451 379 77 196617 drawto fawaka;
#P newex 685 586 72 196617 pak offset 0 0;
#P newex 647 659 182 196617 jit.matrix bam 1 char 30 20 @adapt 0;
#P newex 644 575 27 196617 atoi;
#P newex 656 617 67 196617 jit.fill bam 0;
#P newex 608 702 65 196617 jit.gl.text3d;
#B color 5;
#P message 410 379 31 196617 0.33;
#P message 381 378 23 196617 0.1;
#P newex 418 343 48 196617 loadbang;
#P flonum 321 429 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 339 469 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 303 489 107 196617 pak scale 1. 1. 1.;
#P flonum 303 469 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 337 546 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 301 566 107 196617 pak position 0. 0. 0.;
#P flonum 301 546 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 775 79 60 196617 loadmess 1;
#P toggle 777 103 15 0;
#P newex 779 125 57 196617 qmetro 20;
#P user jit.fpsgui 772 211 60 196617 0;
#P newex 888 116 48 196617 loadbang;
#P button 889 140 15 0;
#P newex 889 162 88 196617 pak size 512 512;
#P newex 886 184 93 196617 jit.window fawaka;
#P newex 773 159 95 196617 t b erase b b clear;
#P newex 774 184 100 196617 jit.gl.render fawaka;
#P comment 675 641 145 196617 The probleem should be here;
#P connect 17 0 14 0;
#P fasten 19 0 17 0 386 400 326 400;
#P fasten 11 0 12 1 306 563 338 563;
#P fasten 14 0 15 1 308 486 340 486;
#P fasten 20 0 13 0 415 535 342 535;
#P connect 17 0 16 0;
#P fasten 13 0 12 2 342 563 370 563;
#P fasten 16 0 15 2 344 486 372 486;
#P connect 18 0 19 0;
#P connect 18 0 20 0;
#P connect 18 0 26 0;
#P connect 33 0 31 0;
#P connect 24 0 21 0;
#P fasten 26 0 21 0 456 686 613 686;
#P fasten 15 0 21 0 308 511 613 511;
#P fasten 12 0 21 0 306 590 613 590;
#P connect 32 0 33 0;
#P connect 27 0 23 0;
#P connect 22 0 24 0;
#P connect 33 1 28 0;
#P connect 25 0 22 0;
#P connect 23 0 22 0;
#P connect 30 0 27 0;
#P connect 29 0 27 0;
#P connect 28 0 27 0;
#P connect 31 0 27 0;
#P connect 33 2 29 0;
#P connect 27 1 25 2;
#P connect 33 3 30 0;
#P connect 1 0 7 0;
#P connect 8 0 2 0;
#P connect 2 1 1 0;
#P connect 2 0 1 0;
#P connect 10 0 9 0;
#P connect 9 0 8 0;
#P connect 4 0 3 0;
#P connect 6 0 5 0;
#P connect 5 0 4 0;
#P pop;


August 23, 2007 | 4:12 pm

I have the same problem on Windows XP.

I can’t remove this kind of "grid" on the screen.

Can anybody give an explanation ?

Thanks


August 23, 2007 | 4:58 pm

I think this fixes it. I don’t have my XP machine alive at the moment to be certain i implemented this right in your patch, but the problem is that windows renders ascii character 0 as a rectangle. The "fill with spaces" subpatch in the below patch fills up the rest of the line with 32 (ascii for space), instead of 0. It’s basically a keying operation. You could probably do something clever with jit.op that does the same thing.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 708 334 370 196617 this essentially amounts to a keying operation.;
#P window linecount 2;
#P comment 707 306 370 196617 the problem is that windows renders ascii character 0 as a rectangle. This "fill with spaces" subpatch fills up the rest of the line with ascii 32 , instead of 0.;
#P window linecount 1;
#P message 336 82 14 196617 1;
#P message 303 83 20 196617 30;
#P comment 626 242 100 196617 Try this:;
#P number 666 258 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont Arial 9.;
#N vpatcher 30 89 430 389;
#P outlet 59 218 15 0;
#N comlet # chars in line;
#P inlet 81 35 15 0;
#N comlet list;
#P inlet 59 34 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 60 192 45 196617 zl group;
#P newex 60 169 27 196617 t 32;
#P newex 60 123 40 196617 t b i i;
#P newex 60 147 40 196617 uzi 30;
#P newex 60 103 23 196617 abs;
#P newex 60 81 29 196617 – 30;
#P newex 60 60 33 196617 zl len;
#P connect 6 0 9 0;
#P connect 7 0 0 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 3 0;
#P connect 3 0 5 0;
#P connect 5 0 6 0;
#P connect 8 0 1 1;
#P connect 4 1 3 1;
#P connect 4 2 6 1;
#P pop;
#P hidden newobj 665 285 73 131137545 p fillwithspaces;
#P hidden newex 628 287 27 131137545 t l l;
#P hidden newex 628 307 35 131137545 zl join;
#P hidden newex 617 373 188 131137545 jit.matrix texty 1 char 30 20 @adapt 0;
#P hidden newex 628 328 73 131137545 jit.fill texty 0;
#P window setfont "Sans Serif" 9.;
#P comment 702 258 100 196617 max chars width;
#P newex 430 113 53 196617 b 4;
#P message 367 142 33 196617 dump;
#P message 544 142 44 196617 3 line 3;
#P message 484 142 44 196617 2 line 2;
#P message 423 141 44 196617 1 line 1;
#N coll ;
#P newobj 476 191 53 196617 coll;
#P message 224 83 77 196617 drawto fawaka;
#P newex 458 247 72 196617 pak offset 0 0;
#P newex 420 363 182 196617 jit.matrix bam 1 char 30 20 @adapt 0;
#P newex 417 236 40 196617 atoi;
#P newex 429 321 67 196617 jit.fill bam 0;
#P newex 381 406 65 196617 jit.gl.text3d;
#B color 5;
#P message 183 83 31 196617 0.33;
#P message 154 82 23 196617 0.1;
#P newex 191 47 48 196617 loadbang;
#P flonum 94 133 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 112 173 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 76 193 107 196617 pak scale 1. 1. 1.;
#P flonum 76 173 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 110 250 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 74 270 107 196617 pak position 0. 0. 0.;
#P flonum 74 250 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 659 79 15 0;
#P newex 661 101 57 196617 qmetro 20;
#P user jit.fpsgui 654 187 60 196617 0;
#P newex 771 138 88 196617 pak size 512 512;
#P newex 768 160 93 196617 jit.window fawaka;
#P newex 655 135 95 196617 t b erase b b clear;
#P newex 656 160 100 196617 jit.gl.render fawaka;
#P comment 448 345 145 196617 The probleem should be here;
#P connect 22 0 19 0;
#P connect 22 0 31 0;
#P connect 20 0 19 0;
#P connect 20 0 34 0;
#P connect 15 0 16 0;
#P connect 15 0 17 0;
#P connect 15 0 23 0;
#P connect 15 0 38 0;
#P connect 15 0 39 0;
#P connect 15 0 29 0;
#P connect 15 0 4 0;
#P connect 39 0 7 0;
#P connect 38 0 36 0;
#P connect 32 0 18 0;
#P hidden connect 34 1 35 0;
#P hidden connect 35 0 33 1;
#P hidden connect 33 0 31 0;
#P hidden connect 34 0 33 0;
#P hidden connect 31 0 32 0;
#P connect 36 0 35 1;
#P connect 14 0 11 0;
#P connect 14 0 13 0;
#P connect 4 0 3 0;
#P connect 7 0 6 0;
#P connect 2 0 1 0;
#P connect 2 1 1 0;
#P connect 6 0 2 0;
#P connect 1 0 5 0;
#P connect 29 3 27 0;
#P connect 24 1 22 2;
#P connect 29 2 26 0;
#P connect 28 0 24 0;
#P connect 25 0 24 0;
#P connect 26 0 24 0;
#P connect 27 0 24 0;
#P connect 29 1 25 0;
#P connect 19 0 21 0;
#P connect 24 0 20 0;
#P fasten 9 0 18 0 79 294 386 294;
#P fasten 12 0 18 0 81 215 386 215;
#P fasten 23 0 18 0 229 390 386 390;
#P connect 29 0 28 0;
#P fasten 13 0 12 2 117 190 145 190;
#P fasten 10 0 9 2 115 267 143 267;
#P fasten 17 0 10 0 188 239 115 239;
#P fasten 11 0 12 1 81 190 113 190;
#P fasten 8 0 9 1 79 267 111 267;
#P fasten 16 0 14 0 159 104 99 104;
#P window clipboard copycount 42;


August 26, 2007 | 11:40 am

Thanks, pnyboer, it works fine. It was impossible for me to find this alone.

It seems to be fine to fill the whole matrix with spaces before entering the text. Your patch is very useful to insert a new line of text.

Following, a new patch with these modifications.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 78 409 117 9109513 INSERTING A NEW LINE;
#P comment 37 447 59 9109513 the new line;
#P newex 198 535 27 9109513 – 1;
#P newex 290 329 37 9109513 r to_fill;
#P newex 36 485 48 9109513 route text;
#P user textedit 36 463 226 479 32896 139 9 happy new year;
#P number 198 439 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 124 537 45 9109513 r MaxCol;
#P newex 36 611 39 9109513 s to_fill;
#N vpatcher 30 89 430 389;
#P outlet 59 218 15 0;
#N comlet # chars in line;
#P inlet 81 35 15 0;
#N comlet list;
#P inlet 59 34 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 60 192 45 9109513 zl group;
#P newex 60 169 27 9109513 t 32;
#P newex 60 123 40 9109513 t b i i;
#P newex 60 147 40 9109513 uzi 30;
#P newex 60 103 23 9109513 abs;
#P newex 60 81 29 9109513 – 30;
#P newex 60 60 33 9109513 zl len;
#P connect 6 0 9 0;
#P connect 7 0 0 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 3 0;
#P connect 3 0 5 0;
#P connect 5 0 6 0;
#P connect 8 0 1 1;
#P connect 4 1 3 1;
#P connect 4 2 6 1;
#P pop;
#P newobj 61 560 73 9109513 p fillwithspaces;
#P newex 36 531 27 9109513 t l l;
#P newex 36 585 35 9109513 zl join;
#P newex 136 559 72 9109513 pak offset 0 0;
#P newex 36 509 40 9109513 atoi;
#P window linecount 2;
#P comment 600 490 316 9109513 It seems to be a good solution to fill the whole matrix with spaces (ascii 32) before "inserting" the text.;
#P window linecount 1;
#P message 292 356 54 9109513 clear , bang;
#P comment 430 275 82 9109513 Fill a blank matrix;
#P comment 453 249 112 9109513 The first matrix row is 0.;
#P button 311 133 15 0;
#P comment 432 419 85 9109513 Matrix Dimensions;
#P newex 417 195 49 9109513 r MaxRow;
#P newex 481 521 51 9109513 s MaxRow;
#P newex 455 541 47 9109513 s MaxCol;
#P newex 428 356 55 9109513 r dimmatrix;
#P newex 448 480 57 9109513 s dimmatrix;
#P number 475 437 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 439 437 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 429 500 62 9109513 unpack s 0 0;
#P newex 429 457 57 9109513 pak dim 0 0;
#P newex 380 274 48 9109513 s fillblank;
#P newex 424 247 27 9109513 – 1;
#P newex 380 219 47 9109513 uzi 20;
#P toggle 785 106 15 0;
#P message 785 129 52 9109513 floating $1;
#P message 528 382 64 9109513 leadscale $1;
#P flonum 539 359 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 593 340 370 9109513 this essentially amounts to a keying operation.;
#P window linecount 2;
#P comment 592 313 370 9109513 the problem is that windows renders ascii character 0 as a rectangle. This "fill with spaces" subpatch fills up the rest of the line with ascii 32 , instead of 0.;
#P window linecount 1;
#P message 263 82 14 9109513 1;
#N vpatcher 51 94 451 394;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 103 146 45 9109513 r MaxCol;
#P newex 60 122 46 9109513 r fillblank;
#P outlet 60 264 15 0;
#P window linecount 0;
#P newex 60 236 53 9109513 zl group 30;
#P newex 60 198 27 9109513 t 32;
#P newex 60 176 40 9109513 uzi 30;
#P connect 4 0 0 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P fasten 5 0 0 1 108 170 95 170;
#P connect 5 0 2 1;
#P pop;
#P newobj 377 329 48 9109513 p fillblank;
#P newex 350 382 167 9109513 jit.matrix texty 1 char 30 20 @adapt 0;
#P newex 350 356 73 9109513 jit.fill texty 0;
#P newex 330 133 208 9109513 t dump b 2.18;
#N coll ;
#T flags 1 0;
#T 1 line 1;
#T 2 line 2;
#T 3 line 3;
#P newobj 330 158 53 9109513 coll;
#P message 151 83 77 9109513 drawto fawaka;
#P newex 366 301 68 9109513 pak offset 0 0;
#P newex 330 329 40 9109513 atoi;
#P newex 282 418 65 9109513 jit.gl.text3d;
#B color 5;
#P message 110 83 31 9109513 0.33;
#P message 81 82 23 9109513 0.1;
#P newex 118 30 48 9109513 loadbang;
#P flonum 21 133 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 39 173 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 3 193 107 9109513 pak scale 1. 1. 1.;
#P flonum 3 173 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 37 250 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 1 270 107 9109513 pak position 0. 0. 0.;
#P flonum 1 250 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 585 130 15 0;
#P newex 585 152 57 9109513 qmetro 20;
#P user jit.fpsgui 585 238 60 9109513 0;
#P newex 698 138 88 9109513 pak size 512 512;
#P newex 698 163 93 9109513 jit.window fawaka;
#P newex 585 186 95 9109513 t b erase b b clear;
#P newex 585 211 100 9109513 jit.gl.render fawaka;
#P user panel 400 414 160 149;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 594 482 331 46;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P comment 188 427 59 9109513 Line number;
#P user panel 24 402 229 235;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 17 0 14 0;
#P fasten 19 0 17 0 86 104 26 104;
#P fasten 11 0 12 1 6 267 38 267;
#P fasten 14 0 15 1 8 190 40 190;
#P connect 63 0 64 0;
#P connect 64 0 55 0;
#P connect 55 0 58 0;
#P connect 58 0 57 0;
#P fasten 56 0 60 0 141 607 41 607;
#P connect 57 0 60 0;
#P fasten 20 0 13 0 115 239 42 239;
#P connect 17 0 16 0;
#P fasten 58 1 59 0 58 554 66 554;
#P connect 59 0 57 1;
#P fasten 13 0 12 2 42 267 70 267;
#P fasten 16 0 15 2 44 190 72 190;
#P connect 18 0 19 0;
#P connect 18 0 20 0;
#P connect 61 0 59 1;
#P connect 18 0 24 0;
#P fasten 62 0 66 0 203 458 230 458 230 528 203 528;
#P connect 66 0 56 2;
#P connect 18 0 30 0;
#P fasten 28 0 21 0 355 406 287 406;
#P fasten 34 0 21 0 533 407 287 407;
#P fasten 24 0 21 0 156 216 287 216;
#P fasten 15 0 21 0 8 216 287 216;
#P fasten 12 0 21 0 6 294 287 294;
#P fasten 18 0 26 0 123 127 335 127;
#P connect 50 0 26 0;
#P connect 26 0 25 0;
#P connect 25 0 22 0;
#P fasten 23 0 27 0 371 350 355 350;
#P fasten 29 0 27 0 382 350 355 350;
#P fasten 22 0 27 0 335 350 355 350;
#P fasten 65 0 27 0 295 350 355 350;
#P fasten 53 0 28 0 297 379 355 379;
#P fasten 45 0 28 0 433 378 355 378;
#P connect 27 0 28 0;
#P connect 26 1 37 0;
#P connect 37 0 39 0;
#P connect 48 0 37 1;
#P fasten 25 1 38 0 349 182 429 182;
#P fasten 37 2 38 0 421 242 429 242;
#P connect 38 0 23 2;
#P connect 40 0 41 0;
#P fasten 40 0 44 0 434 477 453 477;
#P fasten 42 0 40 1 444 454 457 454;
#P connect 41 1 46 0;
#P connect 43 0 40 2;
#P connect 41 2 47 0;
#P fasten 33 0 34 0 544 376 533 376;
#P connect 26 2 34 0;
#P fasten 30 0 10 0 268 114 590 114;
#P connect 10 0 9 0;
#P connect 9 0 5 0;
#P connect 5 1 4 0;
#P connect 5 0 4 0;
#P connect 4 0 8 0;
#P fasten 18 0 7 0 123 52 703 52;
#P fasten 35 0 6 0 790 159 703 159;
#P connect 7 0 6 0;
#P connect 36 0 35 0;
#P window clipboard copycount 69;


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