diff options
author | Frank Barknecht <fbar@users.sourceforge.net> | 2005-05-05 15:12:45 +0000 |
---|---|---|
committer | Frank Barknecht <fbar@users.sourceforge.net> | 2005-05-05 15:12:45 +0000 |
commit | 275614eb0e6c96f384368d33bb6998628b4d9bb4 (patch) | |
tree | f37ea4a0cc18555d48bb0c020c8e74f6fd015057 | |
parent | e19b14107792b7a88b85f64a61320272b4650ece (diff) |
Added scaling between Data Structure coordinates and MSD coords.
Data structure animation and polling can now be toggled.
svn path=/trunk/externals/nusmuk/; revision=2900
-rw-r--r-- | msd2D/editor/gem_links.pd | 14 | ||||
-rw-r--r-- | msd2D/editor/gem_masses.pd | 7 | ||||
-rw-r--r-- | msd2D/editor/link-set.pd | 13 | ||||
-rw-r--r-- | msd2D/editor/mass-set.pd | 13 | ||||
-rw-r--r-- | msd2D/editor/msd2d-editor.pd | 525 | ||||
-rw-r--r-- | msd2D/editor/scale-ds2msd.pd | 42 | ||||
-rw-r--r-- | msd2D/editor/scale-msd2ds.pd | 42 |
7 files changed, 445 insertions, 211 deletions
diff --git a/msd2D/editor/gem_links.pd b/msd2D/editor/gem_links.pd index cc25124..99a138c 100644 --- a/msd2D/editor/gem_links.pd +++ b/msd2D/editor/gem_links.pd @@ -12,8 +12,6 @@ #X obj 109 364 spigot; #X msg 247 300 1; #X obj 247 275 loadbang; -#X obj 161 111 scale4gem; -#X obj 255 140 scale4gem; #X connect 0 0 8 0; #X connect 1 0 3 1; #X connect 2 0 5 0; @@ -22,15 +20,11 @@ #X connect 4 1 6 0; #X connect 6 0 5 1; #X connect 7 0 5 2; -#X connect 8 1 13 0; -#X connect 8 2 13 1; -#X connect 8 3 14 0; -#X connect 8 4 14 1; +#X connect 8 1 4 0; +#X connect 8 2 6 1; +#X connect 8 3 7 0; +#X connect 8 4 7 1; #X connect 9 0 10 1; #X connect 10 0 2 0; #X connect 11 0 10 1; #X connect 12 0 11 0; -#X connect 13 0 4 0; -#X connect 13 1 6 1; -#X connect 14 0 7 0; -#X connect 14 1 7 1; diff --git a/msd2D/editor/gem_masses.pd b/msd2D/editor/gem_masses.pd index e10d136..bd0c3d3 100644 --- a/msd2D/editor/gem_masses.pd +++ b/msd2D/editor/gem_masses.pd @@ -13,7 +13,6 @@ #X obj 150 362 spigot; #X msg 239 289 1; #X obj 239 264 loadbang; -#X obj 181 126 scale4gem; #X connect 0 0 8 0; #X connect 1 0 9 0; #X connect 2 0 4 1; @@ -23,11 +22,9 @@ #X connect 5 1 1 1; #X connect 6 0 9 0; #X connect 7 0 6 0; -#X connect 8 1 14 0; -#X connect 8 2 14 1; +#X connect 8 1 5 0; +#X connect 8 2 1 2; #X connect 10 0 11 1; #X connect 11 0 3 0; #X connect 12 0 11 1; #X connect 13 0 12 0; -#X connect 14 0 5 0; -#X connect 14 1 1 2; diff --git a/msd2D/editor/link-set.pd b/msd2D/editor/link-set.pd index 26d65ec..3e9646f 100644 --- a/msd2D/editor/link-set.pd +++ b/msd2D/editor/link-set.pd @@ -14,6 +14,9 @@ #X text 261 220 Select pointer with lid matching \$1; #X obj 90 349 set liaison x1 y1 x2 y2; #X obj 251 73 r myliapointer; +#X obj 90 292 unpack 0 0 0 0; +#X obj 92 320 scale-msd2ds; +#X obj 183 319 scale-msd2ds; #X connect 0 0 1 0; #X connect 1 0 5 0; #X connect 2 0 10 0; @@ -23,7 +26,15 @@ #X connect 4 0 7 0; #X connect 5 0 4 0; #X connect 5 1 12 4; -#X connect 6 0 12 0; +#X connect 6 0 14 0; #X connect 8 0 3 0; #X connect 10 0 0 0; #X connect 13 0 2 0; +#X connect 14 0 15 0; +#X connect 14 1 15 1; +#X connect 14 2 16 0; +#X connect 14 3 16 1; +#X connect 15 0 12 0; +#X connect 15 1 12 1; +#X connect 16 0 12 2; +#X connect 16 1 12 3; diff --git a/msd2D/editor/mass-set.pd b/msd2D/editor/mass-set.pd index d03a1d3..1f036b3 100644 --- a/msd2D/editor/mass-set.pd +++ b/msd2D/editor/mass-set.pd @@ -15,7 +15,7 @@ 1; #X obj 251 73 r mypointer; #X obj 263 348 pointer; -#X obj 307 585 s pointer2msd; +#X obj 307 651 s pointer2msd; #X obj 91 261 t b a; #X obj 263 320 spigot; #X msg 305 294 1; @@ -29,6 +29,8 @@ ; #X msg 307 536 posX \$2 \$3; #X msg 327 562 posY \$2 \$4; +#X obj 51 319 scale-msd2ds; +#X obj 337 422 scale-ds2msd; #X connect 0 0 1 0; #X connect 1 0 8 0; #X connect 3 0 4 0; @@ -42,7 +44,7 @@ #X connect 8 1 2 2; #X connect 8 1 14 1; #X connect 9 0 6 0; -#X connect 11 0 2 0; +#X connect 11 0 27 2; #X connect 13 0 3 0; #X connect 14 0 22 0; #X connect 16 1 11 0; @@ -53,9 +55,12 @@ #X connect 21 0 23 0; #X connect 22 0 21 0; #X connect 22 1 21 1; -#X connect 22 2 21 2; -#X connect 22 3 21 3; +#X connect 22 2 28 0; +#X connect 22 3 28 1; #X connect 23 1 25 0; #X connect 23 1 26 0; #X connect 25 0 15 0; #X connect 26 0 15 0; +#X connect 27 2 2 0; +#X connect 28 0 21 2; +#X connect 28 1 21 3; diff --git a/msd2D/editor/msd2d-editor.pd b/msd2D/editor/msd2d-editor.pd index 6e9de5a..fb07b54 100644 --- a/msd2D/editor/msd2d-editor.pd +++ b/msd2D/editor/msd2d-editor.pd @@ -1,10 +1,10 @@ -#N canvas 84 270 866 562 10; -#N canvas 610 84 617 552 data 0; -#X restore 735 71 pd data; -#X obj 56 517 structures; -#X obj 62 308 bng 24 250 50 0 empty \$0-generate generate 0 -6 0 8 +#N canvas 34 224 866 562 10; +#N canvas 0 0 1222 870 data 0; +#X restore 719 51 pd data; +#X obj 24 523 structures; +#X obj 30 314 bng 24 250 50 0 empty \$0-generate generate 0 -6 0 8 -24198 -1 -1; -#X text 57 493 Data Struct Definitions; +#X text 25 499 Data Struct Definitions; #N canvas 460 399 104 45 save 0; #X obj 2 3 cnv 15 100 40 empty empty empty 20 12 0 14 -228992 -66577 0; @@ -34,8 +34,8 @@ #X connect 10 0 11 0; #X connect 11 0 5 0; #X coords 0 0 1 1 102 44 1; -#X restore 723 150 pd save; -#X text 728 46 Edit here:; +#X restore 703 158 pd save; +#X text 712 26 Edit here:; #N canvas 257 131 781 748 generator 0; #N canvas 311 93 877 551 getter 0; #X obj 244 89 inlet; @@ -137,6 +137,7 @@ #X obj 214 362 get mass x y mid mob M; #X obj 214 444 pack 0 0 0 0 0; #X obj 184 255 t b p; +#X obj 214 402 scale-ds2msd; #X connect 0 5 1 0; #X connect 0 6 7 0; #X connect 0 6 8 0; @@ -152,14 +153,16 @@ #X connect 8 0 9 0; #X connect 8 0 10 0; #X connect 12 0 0 0; -#X connect 15 0 16 0; -#X connect 15 1 16 1; +#X connect 15 0 18 0; +#X connect 15 1 18 1; #X connect 15 2 16 2; #X connect 15 3 4 0; #X connect 15 4 16 4; #X connect 16 0 13 0; #X connect 17 0 2 0; #X connect 17 1 15 0; +#X connect 18 0 16 0; +#X connect 18 1 16 1; #X restore 244 115 pd get-masses; #N canvas 0 0 768 708 make-links 0; #X obj 316 252 pointer liaison; @@ -248,31 +251,34 @@ from the #define in msd sources.; #X connect 7 1 3 0; #X restore 131 221 pd getter; #X obj 131 369 s \$0-msd; -#X msg 175 154 reset; -#X obj 175 200 s \$0-msd; +#X msg 170 159 reset; +#X obj 170 184 s \$0-msd; #X obj 112 132 t b b b b; -#N canvas 376 279 682 601 make-setters 0; -#X obj 236 443 s pd-setter; -#X msg 206 213 traverse pd-data \, next; -#X obj 168 109 t b b b b; -#X obj 236 329 get mass x y mid; -#X msg 236 396 obj \$1 \$2 mass-set \$3; -#X obj 236 352 pack 0 0 0; -#X msg 151 239 next; -#X obj 145 327 s mypointer; -#X obj 206 272 t p p; -#X msg 226 135 clear; -#X obj 226 160 s pd-setter; -#X obj 168 68 inlet; -#X obj 206 240 pointer mass liaison; -#X obj 480 365 pack 0 0 0; -#X obj 389 294 t p p; -#X obj 480 342 get liaison x1 y1 lid; -#X msg 480 409 obj \$1 \$2 link-set \$3; -#X obj 480 454 s pd-lsetter; -#X obj 226 186 s pd-lsetter; -#X obj 373 342 s myliapointer; +#N canvas 338 182 781 563 make-setters 0; +#X obj 204 443 s pd-setter; +#X msg 174 213 traverse pd-data \, next; +#X obj 136 109 t b b b b; +#X obj 204 329 get mass x y mid; +#X msg 204 396 obj \$1 \$2 mass-set \$3; +#X obj 204 352 pack 0 0 0; +#X msg 119 239 next; +#X obj 113 327 s mypointer; +#X obj 174 272 t p p; +#X msg 194 135 clear; +#X obj 194 160 s pd-setter; +#X obj 136 68 inlet; +#X obj 174 240 pointer mass liaison; +#X obj 448 365 pack 0 0 0; +#X obj 357 294 t p p; +#X obj 448 342 get liaison x1 y1 lid; +#X msg 448 409 obj \$1 \$2 link-set \$3; +#X obj 448 454 s pd-lsetter; +#X obj 194 186 s pd-lsetter; +#X obj 341 342 s myliapointer; +#X obj 155 487 outlet; +#X text 215 487 Post-Actions; #X connect 1 0 12 0; +#X connect 2 1 20 0; #X connect 2 2 1 0; #X connect 2 3 9 0; #X connect 3 0 5 0; @@ -303,64 +309,122 @@ from the #define in msd sources.; #X obj 112 91 inlet; #X msg 131 324 link ml \$1 \$2 \$3 \$4 \$5; #X msg 189 275 mass id \$4 \$5 \$1 \$2; -#X msg 175 177 Xmin 0 \, Xmax 1200 \, Ymin 0 \, Ymax 800; +#N canvas 382 305 870 520 set-min-max 0; +#X obj 98 80 r \$0-min-DS; +#X obj 240 84 r \$0-max-DS; +#X obj 468 80 r \$0-min-MSD; +#X obj 605 108 r \$0-max-MSD; +#X obj 98 131 s DS-xmin; +#X obj 240 145 s DS-xmax; +#X obj 98 111 f; +#X obj 240 113 f; +#X obj 468 109 f; +#X obj 605 143 f; +#X obj 340 13 inlet; +#X obj 339 41 t b b; +#X text 252 195 reverse!; +#X text 95 177 reverse!; +#X obj 241 176 s DS-ymin; +#X obj 98 158 s DS-ymax; +#X obj 468 135 s MSD-xmin; +#X obj 605 174 s MSD-xmax; +#X obj 469 157 s MSD-ymin; +#X obj 605 198 s MSD-ymax; +#X msg 339 306 Xmin \$1 \, Xmax \$2 \, Ymin \$1 \, Ymax \$2; +#X obj 339 207 t b b; +#X obj 339 344 s \$0-msd; +#X obj 339 280 pack 0 0; +#X obj 339 239 f -3; +#X obj 376 245 f 3; +#X connect 0 0 6 0; +#X connect 1 0 7 0; +#X connect 2 0 8 0; +#X connect 3 0 9 0; +#X connect 6 0 4 0; +#X connect 6 0 15 0; +#X connect 7 0 5 0; +#X connect 7 0 14 0; +#X connect 8 0 16 0; +#X connect 8 0 18 0; +#X connect 8 0 24 1; +#X connect 9 0 17 0; +#X connect 9 0 19 0; +#X connect 9 0 25 1; +#X connect 10 0 11 0; +#X connect 11 0 21 0; +#X connect 11 1 6 0; +#X connect 11 1 7 0; +#X connect 11 1 8 0; +#X connect 11 1 9 0; +#X connect 20 0 22 0; +#X connect 21 0 24 0; +#X connect 21 1 25 0; +#X connect 23 0 20 0; +#X connect 24 0 23 0; +#X connect 25 0 23 1; +#X restore 112 441 pd set-min-max; +#X text 283 344 <== messages coming from the data structure setters +; #X connect 0 0 8 0; #X connect 0 1 9 0; #X connect 2 0 3 0; #X connect 4 0 5 0; #X connect 4 1 0 0; -#X connect 4 2 10 0; #X connect 4 3 2 0; +#X connect 5 0 10 0; #X connect 6 0 1 0; #X connect 7 0 4 0; #X connect 8 0 1 0; #X connect 9 0 1 0; -#X connect 10 0 3 0; -#X restore 62 337 pd generator; +#X restore 30 343 pd generator; #N canvas 0 0 718 819 activate 0; -#X obj 233 284 msd2D; -#X obj 233 215 r \$0-msd; -#X msg 317 213 infosL; -#X msg 300 256 get linksPos; +#X obj 233 307 msd2D; +#X obj 233 238 r \$0-msd; +#X msg 317 236 infosL; +#X msg 300 279 get linksPos; #X obj 233 449 gem_masses; #X obj 313 445 gem_links; -#X msg 167 193 bang \, get massesPos \, get linksPos; +#X msg 167 216 bang \, get massesPos \, get linksPos; #X obj 177 125 gemhead; #X obj 233 396 route massesPos linksPos; -#X obj 139 498 gemwin; -#X msg 139 471 0 \, destroy; -#X msg 315 233 forceX id 200; +#X obj 99 496 gemwin; +#X msg 99 469 0 \, destroy; +#X msg 315 256 forceX id 200; #X obj 249 354 s \$0-msd-out; -#X obj 139 425 select 1 0; -#X obj 139 397 tgl 24 0 empty empty GEM 0 -6 0 8 -262144 -1 -1 0 1 -; -#X obj 279 301 s \$0-msd-attr; -#X obj 233 510 s masspositions; -#X obj 313 488 s linkspositions; +#X obj 99 423 select 1 0; +#X obj 99 395 tgl 24 0 empty empty GEM 0 -6 0 8 -262144 -1 -1 0 1; +#X obj 279 324 s \$0-msd-attr; +#X obj 211 541 s masspositions; +#X obj 313 515 s linkspositions; #X obj 167 69 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 233 421 spigot; #X obj 313 421 spigot; -#X text 238 532 sent to the data struct pointers; +#X text 238 559 sent to the data struct pointers; #X obj 167 149 t b b; -#X obj 197 172 s pollpos; +#X obj 197 193 s pollpos; #X obj 167 44 inlet data_only; -#X obj 81 316 inlet GEM; +#X obj 41 314 inlet GEM; #X obj 341 40 inlet speed; -#X obj 62 378 select 1; -#X msg 62 403 0; -#X obj 80 340 t f f; +#X obj 22 376 select 1; +#X msg 22 401 0; +#X obj 40 338 t f f; #X obj 54 90 select 1; #X msg 54 115 0; #X obj 72 52 t f f; -#X msg 225 622 set \$1; -#X msg 56 467 set \$1; -#X obj 231 648 outlet; -#X obj 57 493 outlet; +#X msg 124 585 set \$1; +#X msg 16 465 set \$1; +#X obj 130 611 outlet; +#X obj 17 491 outlet; #X obj 167 92 metro 20; #X obj 413 395 r \$0-gem-masses-on; #X obj 413 417 r \$0-gem-links-on; -#X msg 139 447 reset \, create \, 1; +#X msg 99 445 reset \, create \, 1; +#X obj 197 174 spigot 1; +#X obj 248 150 r \$0-poll-ds; +#X obj 346 469 r \$0-set-ds; +#X obj 233 516 spigot 1; +#X obj 313 496 spigot 1; #X connect 0 0 8 0; #X connect 0 0 12 0; #X connect 0 1 15 0; @@ -369,10 +433,10 @@ from the #define in msd sources.; #X connect 3 0 0 0; #X connect 6 0 0 0; #X connect 7 0 22 0; -#X connect 8 0 16 0; #X connect 8 0 19 0; -#X connect 8 1 17 0; +#X connect 8 0 44 0; #X connect 8 1 20 0; +#X connect 8 1 45 0; #X connect 10 0 9 0; #X connect 11 0 0 0; #X connect 13 0 40 0; @@ -386,7 +450,7 @@ from the #define in msd sources.; #X connect 19 0 4 0; #X connect 20 0 5 0; #X connect 22 0 6 0; -#X connect 22 1 23 0; +#X connect 22 1 41 0; #X connect 24 0 32 0; #X connect 25 0 29 0; #X connect 26 0 37 1; @@ -404,97 +468,109 @@ from the #define in msd sources.; #X connect 38 0 4 1; #X connect 39 0 5 1; #X connect 40 0 9 0; -#X restore 61 414 pd activate; -#X obj 61 378 tgl 24 0 empty empty GEM 0 -6 0 8 -233017 -1 -1 0 1; -#X obj 97 378 tgl 24 0 empty empty Graphical_Datastructures 0 -6 0 +#X connect 41 0 23 0; +#X connect 42 0 41 1; +#X connect 43 0 45 1; +#X connect 43 0 44 1; +#X connect 44 0 16 0; +#X connect 45 0 17 0; +#X restore 29 420 pd activate; +#X obj 29 384 tgl 24 0 empty empty GEM 0 -6 0 8 -233017 -1 -1 0 1; +#X obj 65 384 tgl 24 0 empty empty Graphical_Datastructures 0 -6 0 8 -1 -262144 -1 0 1; -#X text 275 306 Press "generate" to generate messages to msd2D and +#X text 243 312 Press "generate" to generate messages to msd2D and create the physical model inside.; #N canvas 334 329 751 433 ignore 0; #X obj 46 264 print ToMSD; #X obj 46 234 spigot; -#X obj 83 181 tgl 15 0 empty empty debug 0 -6 0 8 -262144 -1 -1 0 1 -; +#X obj 83 181 tgl 15 0 empty empty debug_ToMSD 0 -6 0 8 -262144 -1 +-1 0 1; #X obj 46 207 r \$0-msd; #X obj 147 237 spigot; -#X obj 184 184 tgl 15 0 empty empty debug 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 184 184 tgl 15 0 empty empty debug_FromMSD 0 -6 0 8 -262144 +-1 -1 0 1; #X obj 147 265 print FromMSD; #X obj 147 210 r \$0-msd-out; #N canvas 0 0 578 686 setter 0; -#X obj 61 100 mass-set 10; -#X obj 103 72 mass-set 9; -#X obj 77 103 mass-set 8; -#X obj 69 38 mass-set 7; -#X obj 39 30 mass-set 6; -#X obj 57 40 mass-set 5; -#X obj 57 66 mass-set 4; -#X obj 26 38 mass-set 3; -#X obj 52 99 mass-set 2; -#X obj 47 118 mass-set 1; -#X obj 158 166 mass-set 0; -#X restore 305 122 pd setter; +#X obj 930 500 mass-set 31; +#X obj 900 500 mass-set 30; +#X obj 870 500 mass-set 29; +#X obj 840 500 mass-set 28; +#X obj 810 500 mass-set 27; +#X obj 780 500 mass-set 26; +#X obj 750 500 mass-set 25; +#X obj 720 500 mass-set 24; +#X obj 690 500 mass-set 23; +#X obj 660 500 mass-set 22; +#X obj 630 500 mass-set 21; +#X obj 600 500 mass-set 20; +#X obj 570 500 mass-set 19; +#X obj 540 500 mass-set 18; +#X obj 510 500 mass-set 17; +#X obj 480 500 mass-set 16; +#X obj 450 500 mass-set 15; +#X obj 420 500 mass-set 14; +#X obj 390 500 mass-set 13; +#X obj 360 500 mass-set 12; +#X obj 330 500 mass-set 11; +#X obj 300 500 mass-set 10; +#X obj 270 500 mass-set 9; +#X obj 240 500 mass-set 8; +#X obj 210 500 mass-set 7; +#X obj 180 500 mass-set 6; +#X obj 150 500 mass-set 5; +#X obj 120 500 mass-set 4; +#X obj 90 500 mass-set 3; +#X obj 60 500 mass-set 2; +#X obj 30 500 mass-set 1; +#X obj 0 500 mass-set 0; +#X restore 521 67 pd setter; #N canvas 0 0 822 675 lsetter 0; -#X obj 47 118 link-set 31; -#X obj 47 118 link-set 15; -#X obj 47 118 link-set 23; -#X obj 47 118 link-set 39; -#X obj 47 118 link-set 7; -#X obj 47 118 link-set 27; -#X obj 47 118 link-set 43; -#X obj 47 118 link-set 11; -#X obj 47 118 link-set 19; -#X obj 52 99 link-set 35; -#X obj 52 99 link-set 3; -#X obj 52 99 link-set 29; -#X obj 52 99 link-set 45; -#X obj 52 99 link-set 13; -#X obj 52 99 link-set 21; -#X obj 52 99 link-set 37; -#X obj 52 99 link-set 5; -#X obj 26 38 link-set 25; -#X obj 26 38 link-set 41; -#X obj 26 38 link-set 9; -#X obj 26 38 link-set 17; -#X obj 26 38 link-set 33; -#X obj 26 38 link-set 1; -#X obj 26 38 link-set 30; -#X obj 57 66 link-set 14; -#X obj 57 66 link-set 22; -#X obj 57 66 link-set 38; -#X obj 57 66 link-set 6; -#X obj 57 66 link-set 26; -#X obj 57 66 link-set 42; -#X obj 57 40 link-set 10; -#X obj 57 40 link-set 18; -#X obj 57 40 link-set 34; -#X obj 57 40 link-set 2; -#X obj 57 40 link-set 28; -#X obj 39 30 link-set 44; -#X obj 39 30 link-set 12; -#X obj 39 30 link-set 20; -#X obj 39 30 link-set 36; -#X obj 69 38 link-set 4; -#X obj 69 38 link-set 24; -#X obj 69 38 link-set 40; -#X obj 77 103 link-set 8; -#X obj 77 103 link-set 16; -#X obj 103 72 link-set 32; -#X obj 158 166 link-set 0; -#X restore 304 145 pd lsetter; -#X text 288 98 Automatic scripting targets; -#X text 65 66 You can ignore this stuff here \, unless something goes +#X obj 0 500 link-set 15; +#X obj 30 500 link-set 23; +#X obj 60 500 link-set 7; +#X obj 90 500 link-set 27; +#X obj 120 500 link-set 11; +#X obj 150 500 link-set 19; +#X obj 180 500 link-set 3; +#X obj 210 500 link-set 29; +#X obj 240 500 link-set 13; +#X obj 270 500 link-set 21; +#X obj 300 500 link-set 5; +#X obj 330 500 link-set 25; +#X obj 360 500 link-set 9; +#X obj 390 500 link-set 17; +#X obj 420 500 link-set 1; +#X obj 450 500 link-set 30; +#X obj 480 500 link-set 14; +#X obj 510 500 link-set 22; +#X obj 540 500 link-set 6; +#X obj 570 500 link-set 26; +#X obj 600 500 link-set 10; +#X obj 630 500 link-set 18; +#X obj 660 500 link-set 2; +#X obj 690 500 link-set 28; +#X obj 720 500 link-set 12; +#X obj 750 500 link-set 20; +#X obj 780 500 link-set 4; +#X obj 810 500 link-set 24; +#X obj 840 500 link-set 8; +#X obj 870 500 link-set 16; +#X obj 900 500 link-set 0; +#X restore 520 90 pd lsetter; +#X text 504 43 Automatic scripting targets; +#X text 23 46 You can ignore this stuff here \, unless something goes wrong.; #X obj 269 233 spigot; -#X obj 306 180 tgl 15 0 empty empty debug 0 -6 0 8 -262144 -1 -1 0 -1; +#X obj 306 180 tgl 15 0 empty empty debug_AttrMSD 0 -6 0 8 -262144 +-1 -1 0 1; #X obj 269 206 r \$0-msd-attr; #X obj 269 264 print AttrMSD; #X obj 532 270 s \$0-msd; -#X msg 532 249 infosL; +#X msg 544 247 infosL; #X obj 143 363 spigot; #X obj 180 310 tgl 15 0 empty empty global-send 0 -6 0 8 -262144 -1 --1 0 1; +-1 1 1; #X obj 143 336 r \$0-msd-out; #X obj 143 391 s MSD-OUT-GLOBAL; #X msg 532 223 massesPosL; @@ -507,6 +583,21 @@ wrong.; -1 -1 0 1; #X obj 280 338 r MSD-IN-GLOBAL; #X obj 280 393 s \$0-msd; +#X obj 630 201 metro 40; +#X obj 630 179 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 +1; +#X floatatom 683 180 5 0 0 0 - - -; +#X obj 630 273 s \$0-msd; +#X obj 531 322 metro 40; +#X obj 531 300 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 +1; +#X floatatom 584 301 5 0 0 0 - - -; +#X obj 531 394 s \$0-msd; +#X msg 625 70 clear; +#X obj 625 97 s pd-setter; +#X obj 625 117 s pd-lsetter; +#X msg 531 346 massesForcesL; +#X msg 630 225 massesPosYL; #X connect 1 0 0 0; #X connect 2 0 1 1; #X connect 3 0 1 0; @@ -527,25 +618,34 @@ wrong.; #X connect 26 0 29 0; #X connect 27 0 26 1; #X connect 28 0 26 0; -#X restore 149 517 pd ignore this; -#X floatatom 133 385 5 10 1000 1 frequency - -; -#X text 272 364 Visualization is done using either a GEM OpenGL window +#X connect 30 0 42 0; +#X connect 31 0 30 0; +#X connect 32 0 30 1; +#X connect 34 0 41 0; +#X connect 35 0 34 0; +#X connect 36 0 34 1; +#X connect 38 0 39 0; +#X connect 38 0 40 0; +#X connect 41 0 37 0; +#X connect 42 0 33 0; +#X restore 117 523 pd ignore this; +#X floatatom 101 391 5 10 1000 1 frequency - -; +#X text 240 370 Visualization is done using either a GEM OpenGL window \, or just animate the data structure alone. Better don't use both at the same time. In GDS-mode you can set the frequency of the internal metro \, to accelerate or slow down the simulation.; -#X text 273 110 Links are created by selecting at least two masses +#X text 241 116 Links are created by selecting at least two masses in edit mode \, then press "L" to connect those with a link. If you select more than two masses \, then all possible links between those masses will get created. Use this to mass-connect masses. :); -#N canvas 705 166 576 613 forces 0; +#N canvas 630 176 576 613 forces 0; #X obj 295 415 s \$0-msd; -#X obj 394 355 hsl 128 24 -500 500 0 1 empty empty empty -2 -6 0 8 --262144 -1 -1 6350 1; -#X obj 295 230 vsl 24 128 -500 500 0 1 empty empty empty 0 -8 0 8 -262144 +#X obj 394 355 hsl 128 24 -5 5 0 1 empty empty empty -2 -6 0 8 -262144 -1 -1 6350 1; +#X obj 295 230 vsl 24 128 -5 5 0 1 empty empty empty 0 -8 0 8 -262144 +-1 -1 7550 1; #X msg 295 388 forceY id \$1; #X msg 391 388 forceX id \$1; -#X obj 295 366 * -1; #X obj 295 174 tgl 24 0 empty empty constant? 0 -6 0 8 -262144 -1 -1 0 1; #X obj 391 295 tgl 24 0 empty empty constant? 0 -6 0 8 -262144 -1 -1 @@ -575,37 +675,36 @@ masses will get created. Use this to mass-connect masses. :); #X msg 63 381 posX \$2 \$1; #X text 31 74 Modify one mass:; #X connect 1 0 4 0; -#X connect 2 0 5 0; +#X connect 2 0 3 0; #X connect 3 0 0 0; #X connect 4 0 0 0; -#X connect 5 0 3 0; +#X connect 5 0 7 0; #X connect 6 0 8 0; -#X connect 7 0 9 0; -#X connect 8 0 2 0; +#X connect 7 0 2 0; +#X connect 8 0 1 0; #X connect 9 0 1 0; -#X connect 10 0 1 0; -#X connect 11 0 2 0; -#X connect 13 0 21 0; -#X connect 14 0 20 0; -#X connect 15 0 13 0; -#X connect 16 0 15 1; -#X connect 16 0 17 1; -#X connect 16 0 23 1; -#X connect 16 0 27 1; +#X connect 10 0 2 0; +#X connect 12 0 20 0; +#X connect 13 0 19 0; +#X connect 14 0 12 0; +#X connect 15 0 14 1; +#X connect 15 0 16 1; +#X connect 15 0 22 1; +#X connect 15 0 26 1; +#X connect 16 0 13 0; #X connect 17 0 14 0; -#X connect 18 0 15 0; -#X connect 19 0 22 0; -#X connect 22 0 17 0; -#X connect 23 0 26 0; -#X connect 24 0 23 0; -#X connect 26 0 25 0; -#X connect 27 0 30 0; -#X connect 28 0 27 0; -#X connect 30 0 29 0; -#X restore 60 457 pd forces; -#X obj 286 518 tgl 15 0 \$0-gem-masses-on empty gem_m 0 -6 0 8 -233017 +#X connect 18 0 21 0; +#X connect 21 0 16 0; +#X connect 22 0 25 0; +#X connect 23 0 22 0; +#X connect 25 0 24 0; +#X connect 26 0 29 0; +#X connect 27 0 26 0; +#X connect 29 0 28 0; +#X restore 28 463 pd forces; +#X obj 254 524 tgl 15 0 \$0-gem-masses-on empty gem_m 0 -6 0 8 -233017 -1 -1 0 1; -#X obj 328 518 tgl 15 0 \$0-gem-links-on empty gem_l 0 -6 0 8 -233017 +#X obj 296 524 tgl 15 0 \$0-gem-links-on empty gem_l 0 -6 0 8 -233017 -1 -1 0 1; #N canvas 557 667 450 300 props 0; #X obj 117 204 s \$0-msd; @@ -625,33 +724,77 @@ masses will get created. Use this to mass-connect masses. :); #X connect 4 0 0 0; #X connect 5 0 0 0; #X connect 6 0 0 0; -#X restore 134 458 pd props; -#X text 369 515 Toggle display of masses and links in GEM.; -#X text 273 445 In edit mode and while visualization is active \, you +#X restore 102 464 pd props; +#X text 337 521 Toggle display of masses and links in GEM.; +#X text 241 451 In edit mode and while visualization is active \, you can move around the masses. The red masses will not receive any other forces from the model. Use the "forces" and "props" subpatches to change parameters of links and send forces.; -#X text 271 219 More ways to create links: left-to-right connects masses -from left to right. one2many will connect one mass to many others. -First select the first mass \, the set the toggle to 1 \, after that -select the other masses and set toggle to 0; -#X text 270 181 "L" is only active \, if the green toggle "Key:L" is -set to on. Otherwise use the yellow "link" bang.; -#X text 705 123 Save network to disk:; -#X obj 56 114 morelinks; -#X obj 57 8 msd_append; -#X text 274 23 First create structure inside [pd data] using msd_append. +#X text 685 131 Save network to disk:; +#X obj 24 120 morelinks; +#X obj 25 14 msd_append; +#X text 242 29 First create structure inside [pd data] using msd_append. Add mobile masses with black bang \, add fixed masses with the red bang. Set weight of mass with the "M" number box.; -#X obj 152 86 s pd-data; -#X msg 152 46 clear; -#X msg 152 66 sort; -#X text 150 21 Clear or sort:; +#X obj 120 92 s pd-data; +#X msg 120 52 clear; +#X msg 120 72 sort; +#X text 118 27 Clear or sort:; +#N canvas 702 626 136 139 minmax 0; +#X obj 2 15 cnv 15 130 120 empty empty Min/Max 10 10 0 10 -195568 -1 +0; +#X obj 6 37 nbx 5 14 -1e+37 1e+37 0 0 \$0-min-DS \$0-min-DS Min-DS +60 8 0 10 -225271 -1 -1 0 256; +#X obj 6 57 nbx 5 14 -1e+37 1e+37 0 0 \$0-max-DS \$0-max-DS Max-DS +60 8 0 10 -225271 -1 -1 1000 256; +#X obj 6 85 nbx 5 14 -1e+37 1e+37 0 0 \$0-min-MSD \$0-min-MSD Min-MSD +60 8 0 10 -262131 -1 -1 -3 256; +#X obj 6 105 nbx 5 14 -1e+37 1e+37 0 0 \$0-max-MSD \$0-max-MSD Max-MSD +60 8 0 10 -262131 -1 -1 3 256; +#N canvas 0 0 450 300 l 0; +#X msg 35 78 0; +#X msg 128 75 1000; +#X obj 35 41 loadbang; +#X obj 36 136 loadbang; +#X msg 129 170 3; +#X msg 36 173 -3; +#X obj 35 100 s \$0-min-DS; +#X obj 128 101 s \$0-max-DS; +#X obj 36 195 s \$0-min-MSD; +#X obj 129 196 s \$0-max-MSD; +#X connect 0 0 6 0; +#X connect 1 0 7 0; +#X connect 2 0 0 0; +#X connect 2 0 1 0; +#X connect 3 0 5 0; +#X connect 3 0 4 0; +#X connect 4 0 9 0; +#X connect 5 0 8 0; +#X restore 82 19 pd l; +#X coords 0 0 1 1 132 135 1; +#X restore 701 227 pd minmax; +#X text 694 377 Data structs and; +#X text 694 391 GEM like different; +#X text 694 405 coordinate systems.; +#X text 694 429 Set the mapping; +#X text 694 443 between both here.; +#X text 238 187 The keyboard shortcut "L" is only active \, if the +green toggle "Key:L" is set to on. Otherwise use the yellow "link" +bang.; +#X text 239 235 More ways to create links: left-to-right connects masses +from left to right. one2many will connect one mass to many others. +First select the first mass \, then set the toggle to 1 \, after that +select the other masses and set toggle to 0; +#X obj 707 106 tgl 15 0 \$0-poll-ds \$0-poll-ds poll-ds 0 -6 0 8 -225280 +-1 -1 0 1; +#X obj 765 106 tgl 15 0 \$0-set-ds \$0-set-ds set-ds 0 -6 0 8 -225271 +-1 -1 0 1; +#X text 669 75 Data struct anim ON/OFF:; #X connect 2 0 6 0; #X connect 7 0 8 0; #X connect 7 1 9 0; #X connect 8 0 7 0; #X connect 9 0 7 1; #X connect 12 0 7 2; -#X connect 28 0 27 0; -#X connect 29 0 27 0; +#X connect 26 0 25 0; +#X connect 27 0 25 0; diff --git a/msd2D/editor/scale-ds2msd.pd b/msd2D/editor/scale-ds2msd.pd new file mode 100644 index 0000000..df103aa --- /dev/null +++ b/msd2D/editor/scale-ds2msd.pd @@ -0,0 +1,42 @@ +#N canvas 257 161 999 516 10; +#X obj 43 52 inlet; +#X text 87 52 X-coord. as in DS; +#X obj 43 255 outlet; +#X obj 338 50 inlet; +#X obj 338 253 outlet; +#X text 382 50 Y-coord. as in DS; +#X text 99 255 X-coord. as in MSD; +#X text 398 253 Y-coord. as in MSD; +#X obj 688 336 pack 0 0; +#X obj 688 367 outlet; +#X obj 689 55 unpack 0 0; +#X obj 689 30 inlet; +#X text 725 148 Or use lists: (x \, y); +#X obj 78 101 r DS-xmin; +#X obj 149 166 r MSD-xmin; +#X obj 373 99 r DS-ymin; +#X obj 444 164 r MSD-ymin; +#X obj 114 128 r DS-xmax; +#X obj 185 191 r MSD-xmax; +#X obj 409 126 r DS-ymax; +#X obj 480 189 r MSD-ymax; +#X obj 43 218 expr_scale 0 600 -2 2; +#X obj 338 216 expr_scale 600 0 -2 2; +#X connect 0 0 21 0; +#X connect 3 0 22 0; +#X connect 8 0 9 0; +#X connect 10 0 21 0; +#X connect 10 1 22 1; +#X connect 11 0 10 0; +#X connect 13 0 21 1; +#X connect 14 0 21 3; +#X connect 15 0 22 1; +#X connect 16 0 22 3; +#X connect 17 0 21 2; +#X connect 18 0 21 4; +#X connect 19 0 22 2; +#X connect 20 0 22 4; +#X connect 21 0 2 0; +#X connect 21 0 8 0; +#X connect 22 0 4 0; +#X connect 22 0 8 1; diff --git a/msd2D/editor/scale-msd2ds.pd b/msd2D/editor/scale-msd2ds.pd new file mode 100644 index 0000000..d90c3c2 --- /dev/null +++ b/msd2D/editor/scale-msd2ds.pd @@ -0,0 +1,42 @@ +#N canvas 9 170 970 485 10; +#X obj 43 52 inlet; +#X obj 43 255 outlet; +#X obj 338 50 inlet; +#X obj 338 253 outlet; +#X text 382 50 Y-coord. as in MSD; +#X text 87 52 X-coord. as in MSD; +#X text 99 255 X-coord. as in DS; +#X text 398 253 Y-coord. as in DS; +#X obj 688 336 pack 0 0; +#X obj 688 367 outlet; +#X obj 689 55 unpack 0 0; +#X obj 689 30 inlet; +#X text 725 148 Or use lists: (x \, y); +#X obj 78 164 r MSD-xmin; +#X obj 114 189 r MSD-xmax; +#X obj 149 111 r DS-xmin; +#X obj 185 138 r DS-xmax; +#X obj 444 99 r DS-ymin; +#X obj 480 126 r DS-ymax; +#X obj 373 164 r MSD-ymin; +#X obj 409 189 r MSD-ymax; +#X obj 338 216 expr_scale -2 2 600 0; +#X obj 43 218 expr_scale -2 2 0 600; +#X connect 0 0 22 0; +#X connect 2 0 21 0; +#X connect 8 0 9 0; +#X connect 10 0 22 0; +#X connect 10 1 21 0; +#X connect 11 0 10 0; +#X connect 13 0 22 1; +#X connect 14 0 22 2; +#X connect 15 0 22 3; +#X connect 16 0 22 4; +#X connect 17 0 21 3; +#X connect 18 0 21 4; +#X connect 19 0 21 1; +#X connect 20 0 21 2; +#X connect 21 0 3 0; +#X connect 21 0 8 1; +#X connect 22 0 1 0; +#X connect 22 0 8 0; |