Skip to content

Commit

Permalink
improve performance of scope1d and scope2d
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-wes committed Jun 23, 2024
1 parent 2941a41 commit 9c2d5b3
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 116 deletions.
94 changes: 37 additions & 57 deletions x/scope1d.pd
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
#N canvas 463 27 859 611 10;
#X obj 387 319 bang~;
#X obj 100 347 inlet~;
#X obj 100 368 tabsend~ \$0-data-y;
#X obj 577 332 pointer;
#X msg 616 263 clear;
#X msg 543 312 0 0;
#X obj 387 382 until;
#X obj 387 361 t f b;
#X obj 387 403 f;
#X obj 414 403 + 1;
#X msg 425 382 0;
#X obj 387 424 t f f f;
#X obj 543 95 loadbang;
#X obj 570 138 f \$1;
#X obj 570 159 sel 0;
#X obj 387 340 f;
#X obj 510 312 f;
#X obj 99 506 array define \$0-data-y 64;
#X obj 99 478 array define \$0-data-y 64;
#X obj 543 116 t b b;
#X obj 570 201 s \$0-blocksize;
#X obj 385 95 r \$0-blocksize;
#X obj 452 215 r \$0-blocksize;
#X obj 387 241 array size \$0-data-y;
#X obj 307 281 array size \$0-data-y;
#X obj 543 241 t b b b b;
#N canvas 647 566 604 202 \$0-path-template 0;
#X obj 67 105 struct \$0-path-template float x float y array \$0-data \$0-data-template, f 70;
#X obj 68 135 plot -e 0 \$0-data 0 1 0 0;
#X restore 100 428 pd \$0-path-template;
#X obj 68 135 plot -e 0 \$0-data 0 1 0 0 1;
#X restore 100 420 pd \$0-path-template;
#N canvas 706 152 450 300 \$0-data-template 0;
#X obj 60 46 struct \$0-data-template float x float y;
#X restore 99 449 pd \$0-data-template;
#X obj 387 508 set \$0-data-template x y;
#X obj 60 46 struct \$0-data-template float y;
#X restore 99 441 pd \$0-data-template;
#X obj 543 363 append \$0-path-template x y;
#N canvas 92 117 513 497 \$0-display 0;
#X coords 0 1 1 -1 140 140 2 100 100;
Expand All @@ -39,51 +30,40 @@
#X obj 577 284 f \$0;
#X msg 577 311 traverse pd-\$1-display \, bang;
#X obj 510 439 setsize \$0-path-template \$0-data;
#X obj 528 487 element \$0-path-template \$0-data;
#X obj 387 467 /;
#X obj 385 137 block~;
#X msg 385 116 set \$1 1 0.25;
#X msg 570 180 256;
#X obj 457 466 array get \$0-data-y 0 1;
#X connect 0 0 15 0;
#X connect 1 0 2 0;
#X connect 3 0 27 2;
#X connect 4 0 29 0;
#X connect 5 0 27 0;
#X connect 6 0 8 0;
#X connect 7 0 6 0;
#X connect 7 1 10 0;
#X connect 8 0 9 0;
#X connect 8 0 11 0;
#X connect 9 0 8 1;
#X connect 10 0 8 1;
#X connect 11 0 34 0;
#X connect 11 1 38 0;
#X connect 11 2 33 0;
#X connect 12 0 18 0;
#X obj 307 417 bang~;
#X obj 307 477 array set -s \$0-path-template \$0-data -f \$0-data-template y;
#X obj 307 456 array get \$0-data-y;
#X obj 306 334 s pd-\$0-display;
#X msg 306 313 coords 0 -1 \$1 1 200 200 -1;
#X connect 0 0 1 0;
#X connect 2 0 18 2;
#X connect 3 0 20 0;
#X connect 4 0 18 0;
#X connect 5 0 10 0;
#X connect 6 0 7 0;
#X connect 7 0 26 0;
#X connect 7 1 11 0;
#X connect 8 0 23 0;
#X connect 10 0 15 0;
#X connect 10 1 6 0;
#X connect 12 0 25 0;
#X connect 13 0 8 1;
#X connect 13 0 14 0;
#X connect 14 0 37 0;
#X connect 14 1 19 0;
#X connect 15 0 7 0;
#X connect 16 0 32 0;
#X connect 18 0 23 0;
#X connect 18 1 13 0;
#X connect 20 0 36 0;
#X connect 21 0 16 1;
#X connect 21 0 15 1;
#X connect 13 0 31 0;
#X connect 15 0 8 0;
#X connect 15 1 4 0;
#X connect 15 2 21 0;
#X connect 15 3 3 0;
#X connect 18 0 23 1;
#X connect 18 0 28 2;
#X connect 21 0 22 0;
#X connect 21 0 34 1;
#X connect 23 0 16 0;
#X connect 23 1 5 0;
#X connect 23 2 30 0;
#X connect 23 3 4 0;
#X connect 27 0 32 1;
#X connect 27 0 33 1;
#X connect 30 0 31 0;
#X connect 31 0 3 0;
#X connect 33 0 26 2;
#X connect 34 0 26 0;
#X connect 36 0 35 0;
#X connect 37 0 19 0;
#X connect 38 0 26 1;
#X connect 22 0 2 0;
#X connect 25 0 24 0;
#X connect 26 0 11 0;
#X connect 27 0 29 0;
#X connect 29 0 28 0;
#X connect 31 0 30 0;
#X coords 0 -1 1 1 140 140 1 100 100;
100 changes: 41 additions & 59 deletions x/scope2d.pd
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
#N canvas 815 104 852 631 10;
#X obj 367 319 bang~;
#N canvas 815 104 852 618 10;
#X obj 100 347 inlet~;
#X obj 547 332 pointer;
#X msg 586 263 clear;
#X msg 513 312 0 0;
#X obj 367 382 until;
#X obj 367 361 t f b;
#X obj 367 403 f;
#X obj 394 403 + 1;
#X msg 405 382 0;
#X obj 367 424 t f f f;
#X obj 513 95 loadbang;
#X obj 540 138 f \$1;
#X obj 540 159 sel 0;
#X obj 367 340 f;
#X obj 482 312 f;
#X obj 99 515 array define \$0-data-x 64;
#X obj 99 536 array define \$0-data-y 64;
#X obj 99 481 array define \$0-data-x 64;
#X obj 99 502 array define \$0-data-y 64;
#X obj 513 116 t b b;
#X obj 540 201 s \$0-blocksize;
#X obj 682 95 r \$0-blocksize;
Expand All @@ -28,64 +20,54 @@
#N canvas 647 566 604 202 \$0-path-template 0;
#X obj 67 105 struct \$0-path-template float x float y array \$0-data \$0-data-template, f 70;
#X obj 68 135 plot -e 0 \$0-data 0 1 0 0;
#X restore 100 458 pd \$0-path-template;
#X restore 100 424 pd \$0-path-template;
#N canvas 706 152 450 300 \$0-data-template 0;
#X obj 60 46 struct \$0-data-template float x float y;
#X restore 99 479 pd \$0-data-template;
#X obj 367 538 set \$0-data-template x y;
#X restore 99 445 pd \$0-data-template;
#X obj 513 363 append \$0-path-template x y;
#N canvas 92 117 513 497 \$0-display 0;
#X coords -1 1 1 -1 140 140 2 100 100;
#X restore 100 100 pd \$0-display;
#X obj 586 284 s pd-\$0-display;
#X obj 547 284 f \$0;
#X msg 547 311 traverse pd-\$1-display \, bang;
#X obj 482 402 setsize \$0-path-template \$0-data;
#X obj 508 517 element \$0-path-template \$0-data;
#X obj 482 396 setsize \$0-path-template \$0-data;
#X msg 682 116 set \$1 1 0.25;
#X msg 540 180 256;
#X obj 367 475 array get \$0-data-x 0 1;
#X obj 437 496 array get \$0-data-y 0 1;
#X obj 100 368 tabsend~ \$0-data-x \$0-data-y;
#X connect 0 0 14 0;
#X connect 1 0 40 0;
#X connect 2 0 29 2;
#X connect 3 0 31 0;
#X connect 4 0 29 0;
#X connect 5 0 7 0;
#X connect 6 0 5 0;
#X connect 6 1 9 0;
#X connect 7 0 8 0;
#X connect 7 0 10 0;
#X connect 8 0 7 1;
#X connect 9 0 7 1;
#X connect 10 0 38 0;
#X connect 10 1 39 0;
#X connect 10 2 35 0;
#X connect 11 0 18 0;
#X connect 12 0 13 0;
#X connect 13 0 37 0;
#X connect 13 1 19 0;
#X connect 14 0 6 0;
#X connect 15 0 34 0;
#X connect 18 0 25 0;
#X connect 18 1 12 0;
#X connect 20 0 36 0;
#X connect 21 0 15 1;
#X connect 21 0 14 1;
#X connect 21 0 22 0;
#X connect 21 0 23 0;
#X connect 25 0 15 0;
#X connect 25 1 4 0;
#X connect 25 2 32 0;
#X connect 25 3 3 0;
#X connect 29 0 34 1;
#X connect 29 0 35 1;
#X connect 32 0 33 0;
#X connect 33 0 2 0;
#X connect 35 0 28 2;
#X connect 36 0 24 0;
#X connect 37 0 19 0;
#X connect 38 0 28 0;
#X connect 39 0 28 1;
#X obj 347 436 array get \$0-data-x;
#X obj 366 457 array get \$0-data-y;
#X obj 366 478 array set -s \$0-path-template \$0-data -f \$0-data-template y;
#X obj 347 499 array set -s \$0-path-template \$0-data -f \$0-data-template x;
#X obj 366 379 bang~;
#X connect 0 0 28 0;
#X connect 1 0 20 2;
#X connect 2 0 22 0;
#X connect 3 0 20 0;
#X connect 4 0 10 0;
#X connect 5 0 6 0;
#X connect 6 0 27 0;
#X connect 6 1 11 0;
#X connect 7 0 25 0;
#X connect 10 0 17 0;
#X connect 10 1 5 0;
#X connect 12 0 26 0;
#X connect 13 0 7 1;
#X connect 13 0 14 0;
#X connect 13 0 15 0;
#X connect 17 0 7 0;
#X connect 17 1 3 0;
#X connect 17 2 23 0;
#X connect 17 3 2 0;
#X connect 20 0 25 1;
#X connect 20 0 31 2;
#X connect 20 0 32 2;
#X connect 23 0 24 0;
#X connect 24 0 1 0;
#X connect 26 0 16 0;
#X connect 27 0 11 0;
#X connect 29 0 32 0;
#X connect 30 0 31 0;
#X connect 33 0 29 0;
#X connect 33 0 30 0;
#X coords 0 -1 1 1 140 140 1 100 100;

0 comments on commit 9c2d5b3

Please sign in to comment.