From 12c64f4506f0e00c07ffd08c4322c1cad4716190 Mon Sep 17 00:00:00 2001 From: "N.N." Date: Tue, 17 May 2005 15:37:43 +0000 Subject: MSD Version 0.07 svn path=/trunk/externals/nusmuk/; revision=2995 --- msd2D/help-msd2D.pd | 756 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 572 insertions(+), 184 deletions(-) (limited to 'msd2D/help-msd2D.pd') diff --git a/msd2D/help-msd2D.pd b/msd2D/help-msd2D.pd index b8cba2f..560ce0e 100644 --- a/msd2D/help-msd2D.pd +++ b/msd2D/help-msd2D.pd @@ -1,188 +1,576 @@ -#N canvas 0 0 478 397 10; -#N canvas 289 25 787 879 masses 0; -#X obj 62 154 cnv 15 610 180 empty empty CREATION 20 12 0 14 -262131 --66577 0; -#X msg 79 183 reset; -#X text 249 214 Add a mass; -#X text 335 215 \$1 : Id (symbol); -#X text 334 235 \$2 : fixed or mobile (0/1); -#X text 334 253 \$3 : mass; -#X text 251 184 Delete all masses and links; -#X obj 62 338 cnv 15 610 60 empty empty COMPUTATION 20 12 0 14 -261689 --66577 0; -#X msg 82 367 bang; -#X text 235 367 Compute new masses positions; -#X obj 61 403 cnv 15 610 210 empty empty DYNAMIC_SETTING 20 12 0 14 --262131 -66577 0; -#X text 350 467 \$2 : New value; -#X text 348 521 \$2 : New value; -#X msg 87 429 posX \$1 \$2; -#X text 350 431 Set position of mass(es); -#X text 347 486 Add force on mass(es); -#X msg 85 485 forceX \$1 \$2; -#X obj 61 617 cnv 15 610 260 empty empty GET_ATTRIBUTES 20 12 0 14 --261689 -66577 0; -#X text 248 644 output all masses positions in a list on outlet No -1; -#X text 247 695 output all masses forces in a list on outlet No 1; -#X msg 146 732 get \$1 \$2; -#X text 249 733 Get specific attribute; -#X text 249 758 \$1 : Attribute type ( massesPos / massesSpeeds / massesForces -/ linksPos ); -#X text 249 795 \$2 : Id (symbol or creations numbers); -#X msg 79 290 deleteMass \$1; -#X text 248 292 Delete a mass and associated links; -#X text 338 309 \$1 : Creation No of mass; -#X msg 144 813 infosL; -#X text 247 815 Get infos on all masses and links on outlet No 2; -#X text 347 555 \$1 : Value; -#X text 73 22 MASSES :; -#X text 66 69 They got only one physical parameter \, the value of -their; -#X text 67 83 mass. They can be mobile or fixed \, in this case forces -; -#X text 67 54 The msd masses are the principals objects of the model. -; -#X text 66 97 applied on them automatically \, by links \, or manually -\, by; -#X text 67 112 messages \, don't do anything.; -#X msg 81 578 setMobile \$1 \, setFixed \$1; -#X text 345 578 Change mobile parameter; -#X text 345 594 \$1 : Creation No of mass; -#X msg 79 214 mass \$1 \$2 \$3 \$4 \$5; -#X msg 188 430 posY \$1 \$2; -#X msg 186 486 forceY \$1 \$2; -#X obj 33 821 msd2D; -#X text 347 538 Set minimimum and maximum X \, Y of masses; -#X msg 84 538 Xmin \$1 \, Xmax \$1 \, Ymin \$1 \, Ymax \$1; -#X text 334 271 \$4 \, \$5 : initial position; -#X text 350 449 \$1 : Id (symbol) or No; -#X text 348 503 \$1 : Id (symbol) or No; -#X text 248 669 output all masses x/y position in a list on outlet -No 1; -#X msg 112 838 grabMass \$1 \$2 \$3; -#X text 247 838 Get nearest mass and grab it; -#X text 112 857 \$1 \, \$2 : X \, Y position of mouse; -#X text 357 857 \$3 : grab or not (left click); -#X msg 147 644 massesPosL; -#X msg 147 669 massesPosYL; -#X msg 147 694 massesForcesL; -#X msg 68 669 massesPosXL; -#X text 66 131 Be careful: if masses are deleted \, lists messages +#N canvas 595 54 563 818 10; +#X obj 4 369 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 779 cnv 15 550 30 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 8 6 cnv 15 550 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 14 389 cnv 15 75 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 14 584 cnv 15 75 15 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X obj 4 527 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 4 562 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 7 76 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 729 cnv 15 550 20 empty empty empty 20 12 0 14 -158509 -66577 +0; +#X obj 5 749 cnv 15 550 30 empty empty empty 20 12 0 14 -233017 -66577 +0; +#N canvas 76 31 921 714 More_Info 0; +#X text 96 12 MSD : mass - spring - damper model; +#X text 27 155 Be careful : if masses are deleted \, lists messages won't work; -#X connect 1 0 42 0; -#X connect 8 0 42 0; -#X connect 13 0 42 0; -#X connect 16 0 42 0; -#X connect 20 0 42 0; -#X connect 24 0 42 0; -#X connect 27 0 42 0; -#X connect 36 0 42 0; -#X connect 39 0 42 0; -#X connect 44 0 42 0; -#X connect 53 0 42 0; -#X connect 55 0 42 0; -#X connect 56 0 42 0; -#X restore 221 312 pd masses; -#X text 75 312 HELP on masses --->; -#X text 74 343 HELP on links --->; -#X text 13 117 There are 4 types of messages for msd :; -#X text 14 81 It is designed to implement particules physical model -in PD.The model is based on two elements type : mass and link.; -#X obj 13 132 cnv 15 420 30 empty empty empty 20 12 0 14 -262131 -66577 -0; -#X obj 13 165 cnv 15 420 30 empty empty empty 20 12 0 14 -261689 -66577 -0; -#X obj 13 198 cnv 15 420 30 empty empty empty 20 12 0 14 -262131 -66577 -0; -#X obj 13 231 cnv 15 420 30 empty empty empty 20 12 0 14 -261689 -66577 -0; -#X text 16 139 CREATION : To create the model masses and links.; -#X text 16 204 DYNAMIC SETTING : To set the model parameters dynamically. -; -#X text 16 237 ATTRIBUTES : To get the model parameters.; -#X text 16 166 COMPUTATION : To compute the new model state based on -previous instant.; -#X text 94 23 MSD2D : mass - spring - damper model; -#X text 15 68 MSD2D is the 2D object of the msd objects collection. +#X text 27 60 It is designed to implement particules physical model +in PD.The model is based on two elements type : mass and link. The +msd masses are the principals objects of the model. They got only one +physical parameter \, the value of their mass. They can be mobile or +fixed \, in this case forces applied on them automatically \, by links +\, or manually \, by messages \, don't do anything.; +#X obj 456 -5 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 456 294 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#N canvas 0 0 450 300 graph1 0; +#X array rigidity1 4 float 1; +#A 0 -1 0 1 2; +#X array zero 4 float 1; +#A 0 0 0 0 0; +#X coords 0 3 3 -3 200 150 1; +#X restore 121 328 graph; +#X text 179 485 L0; +#N canvas 163 176 956 727 figure 0; +#X obj 182 108 loadbang; +#X msg 191 180 \; rigidity1 resize 1 \; rigidity1 resize 4 \; rigidity1 +bounds 0 3 3 -3 \; rigidity1 0 -1 0 1 2 \; rigidity1 ylabel -0.5 \; +rigidity1 xlabel -3.5 \; rigidity1 xticks 0 1 1 \; rigidity1 yticks +0 0.1 5; +#X obj 388 574 sqrt; +#X obj 316 651 tabwrite rigidity3; +#X obj 343 464 - 20; +#X obj 316 609 f; +#X obj 316 579 t b f; +#X obj 343 494 moses 0; +#X obj 343 517 * -1; +#X obj 343 538 sqrt; +#X obj 343 559 * -1; +#X obj 375 429 counter 0 50; +#X obj 481 479 - 20; +#X obj 453 662 f; +#X obj 453 632 t b f; +#X obj 481 509 moses 0; +#X obj 481 532 * -1; +#X obj 480 612 * -1; +#X obj 528 622 *; +#X obj 480 591 *; +#X obj 525 590 t f f; +#X obj 480 564 t f f; +#X obj 453 683 tabwrite rigidity4; +#X obj 255 350 t b b; +#X obj 374 404 until; +#X obj 620 552 f; +#X obj 620 522 t b f; +#X obj 678 376 until; +#X obj 620 623 tabwrite rigidity2; +#X msg 763 574 0; +#X obj 679 401 counter 0 100; +#X obj 679 437 - 50; +#X obj 751 491 moses 40; +#X obj 681 510 moses -40; +#X obj 620 586 * 1.5; +#X obj 680 462 moses 10; +#X obj 680 488 moses -10; +#X msg 55 419 \; rigidity2 resize 101 \; rigidity2 xticks 1 10 5 \; +rigidity2 yticks 0 5 5 \; rigidity3 resize 51 \; rigidity3 xticks 0 +1 5 \; rigidity3 yticks 0 1 5 \; rigidity4 resize 51 \; rigidity4 xticks +0 1 5 \; rigidity4 yticks 0 100 5; +#X connect 0 0 1 0; +#X connect 0 0 23 0; +#X connect 2 0 5 1; +#X connect 4 0 7 0; +#X connect 5 0 3 0; +#X connect 6 0 5 0; +#X connect 6 1 3 1; +#X connect 7 0 8 0; +#X connect 7 1 2 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X connect 10 0 5 1; +#X connect 11 0 4 0; +#X connect 11 0 6 0; +#X connect 11 0 12 0; +#X connect 11 0 14 0; +#X connect 11 1 24 1; +#X connect 12 0 15 0; +#X connect 13 0 22 0; +#X connect 14 0 13 0; +#X connect 14 1 22 1; +#X connect 15 0 16 0; +#X connect 15 1 20 0; +#X connect 16 0 21 0; +#X connect 17 0 13 1; +#X connect 18 0 13 1; +#X connect 19 0 17 0; +#X connect 20 0 18 0; +#X connect 20 1 18 1; +#X connect 21 0 19 0; +#X connect 21 1 19 1; +#X connect 23 0 24 0; +#X connect 23 1 37 0; +#X connect 23 1 27 0; +#X connect 24 0 11 0; +#X connect 25 0 34 0; +#X connect 26 0 25 0; +#X connect 26 1 28 1; +#X connect 27 0 30 0; +#X connect 29 0 25 1; +#X connect 30 0 26 0; +#X connect 30 0 31 0; +#X connect 30 1 27 1; +#X connect 31 0 35 0; +#X connect 32 0 25 1; +#X connect 32 1 29 0; +#X connect 33 0 29 0; +#X connect 33 1 25 1; +#X connect 34 0 28 0; +#X connect 35 0 36 0; +#X connect 35 1 32 0; +#X connect 36 0 33 0; +#X connect 36 1 29 0; +#X restore 403 659 pd figure; +#X text 125 307 Rigidity; +#N canvas 0 0 450 300 graph1 0; +#X array rigidity2 101 float 1; +#A 0 0 0 0 0 0 0 0 0 0 0 0 -60 -58.5 -57 -55.5 -54 -52.5 -51 -49.5 +-48 -46.5 -45 -43.5 -42 -40.5 -39 -37.5 -36 -34.5 -33 -31.5 -30 -28.5 +-27 -25.5 -24 -22.5 -21 -19.5 -18 -16.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 15 16.5 18 19.5 21 22.5 24 25.5 27 28.5 30 31.5 33 34.5 +36 37.5 39 40.5 42 43.5 45 46.5 48 49.5 51 52.5 54 55.5 57 58.5 0 0 +0 0 0 0 0 0 0 0; +#X array zero 101 float 1; +#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0; +#X coords 0 60 100 -60 200 150 1; +#X restore 565 327 graph; +#X text 657 482 L0; +#X text 569 304 Rigidity with Lmin and Lmax; +#X text 673 482 Lmin; +#X text 735 481 Lmax; +#N canvas 0 0 450 300 graph1 0; +#X array rigidity3 51 float 1; +#A 0 -4.47214 -4.3589 -4.24264 -4.12311 -4 -3.87298 -3.74166 -3.60555 +-3.4641 -3.31662 -3.16228 -3 -2.82843 -2.64575 -2.44949 -2.23607 -2 +-1.73205 -1.41421 -1 0 1 1.41421 1.73205 2 2.23607 2.44949 2.64575 +2.82843 3 3.16228 3.31662 3.4641 3.60555 3.74166 3.87298 4 4.12311 +4.24264 4.3589 4.47214 4.58258 4.69042 4.79583 4.89898 5 5.09902 5.19615 +5.2915 5.38516 5.47723; +#X array zero 51 float 1; +#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; +#X coords 0 6 50 -6 200 150 1; +#X restore 119 526 graph; +#X text 192 679 L0; +#X text 126 505 Rigidity with power = 1/2; +#N canvas 0 0 450 300 graph1 0; +#X array rigidity4 51 float 1; +#A 0 -400 -361 -324 -289 -256 -225 -196 -169 -144 -121 -100 -81 -64 +-49 -36 -25 -16 -9 -4 -1 0 1 4 9 16 25 36 49 64 81 100 121 144 169 +196 225 256 289 324 361 400 441 484 529 576 625 676 729 784 841 900 ; -#N canvas 222 83 808 841 links 0; -#X obj 33 821 msd; -#X obj 62 192 cnv 15 610 360 empty empty CREATION 20 12 0 14 -262131 --66577 0; -#X msg 79 221 reset; -#X text 402 247 \$1 : Id (symbol); -#X text 314 247 Add a link; -#X text 401 267 \$2 : creation No of mass1; -#X text 401 285 \$3 : creation No of mass2; -#X text 400 303 \$4 : rigidity; -#X text 251 222 Delete all masses and links; -#X text 400 321 \$5 : viscosity; -#X text 400 338 \$6 : damping; -#X obj 61 561 cnv 15 610 82 empty empty DYNAMIC_SETTING 20 12 0 14 --262131 -66577 0; -#X msg 172 583 setD \$1 \$2; -#X text 354 601 \$1 : Id (symbol); -#X text 354 619 \$2 : New value; -#X msg 87 583 setK \$1 \$2; -#X msg 255 583 setD2 \$1 \$2; -#X text 354 583 Set rigidity \, viscosity or damping of link(s); -#X obj 60 650 cnv 15 610 140 empty empty GET_ATTRIBUTES 20 12 0 14 --261689 -66577 0; -#X msg 75 679 get \$1 \$2; -#X text 237 680 Get specific attribute; -#X text 237 705 \$1 : Attribute type ( massesPos / massesSpeeds / massesForces +#X array zero 51 float 1; +#A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; +#X coords 0 1000 50 -1000 200 150 1; +#X restore 566 530 graph; +#X text 639 684 L0; +#X text 571 508 Rigidity with power = 2; +#X text 571 12 The equations are :; +#X text 497 36 if Lmin<|L[n]-L[0]| [massesPosId 0 x0(; +#X text 334 597 [massesPosId 2 x2(; +#X text 334 612 [massesPosId 1 x1(; +#X text 173 511 [get massesPos( -----> [massesPos 0 x0(; +#X text 334 525 [massesPos 2 x2(; +#X text 334 539 [massesPos 1 x1(; +#X text 159 561 [get massesPos 1( -----> [massesPosNo 1 x1(; +#X text 15 30 The attributes messages ask the object to output some +of his internal parameters. They can be output by lists for positions +and forces of masses.; +#X text 169 240 Output all forces applied on masses in a list on outlet +No 1; +#X text 139 383 ($2) : - If not defined all the attributes are send +for all the elements. - Ids or/and creations No; +#X msg 32 192 massesPosXL; +#X text 170 202 Output all masses x or y in a list on outlet No 1; +#X msg 32 213 massesPosYL; +#X restore 12 499 pd attributes______; +#X text 9 761 KEYWORDS: physical model mass spring damper link; +#X text 267 786 - Nicolas Montgermont \, May 12 \, 2005; +#X text 12 8 HELP: msd2D; +#X text 12 18 DESCRIPTION: Mass spring damper physical modeling in +2D.; +#X obj 157 48 msd2D; +#X text 257 730 editor/msd2d-editor.pd; +#X text 112 730 01_msd2Dtest.pd; +#X obj 18 296 msd2D; +#X obj 172 294 route massesPos linksPos; +#N canvas 731 296 450 300 gemmouse 0; +#X obj 189 77 gemmouse; +#X obj 189 184 pack f f; +#X obj 189 218 spigot; +#X obj 109 243 outlet; +#X obj 109 36 inlet; +#X obj 109 98 t b; +#X obj 238 131 + 4; +#X obj 109 125 l 0 0; +#X msg 57 182 posX fix \$1; +#X msg 57 203 posY fix \$2; +#X obj 189 108 / 62.5; +#X obj 237 107 / -62.5; +#X obj 189 131 - 4; +#X connect 0 0 10 0; +#X connect 0 1 11 0; +#X connect 0 2 2 1; +#X connect 1 0 2 0; +#X connect 2 0 7 1; +#X connect 4 0 5 0; +#X connect 5 0 7 0; +#X connect 6 0 1 1; +#X connect 7 0 8 0; +#X connect 7 0 9 0; +#X connect 8 0 3 0; +#X connect 9 0 3 0; +#X connect 10 0 12 0; +#X connect 11 0 6 0; +#X connect 12 0 1 0; +#X restore 393 295 pd gemmouse; +#X obj 393 274 gemhead; +#X obj 336 216 gemwin; +#X msg 336 194 0 \, destroy; +#N canvas 472 258 550 319 gemrender 0; +#X obj 48 203 translateXYZ; +#X obj 48 229 sphere 0.1; +#X obj 48 177 separator; +#X obj 48 153 any; +#X obj 64 114 gemhead 45; +#X obj 127 24 inlet; +#X obj 271 51 inlet; +#X obj 192 206 separator; +#X obj 192 182 any; +#X obj 192 251 curve 2; +#X obj 208 143 gemhead 45; +#X msg 348 100 \$4 \$5 0; +#X msg 276 96 \$2 \$3 0; +#X obj 250 170 t b a; +#X obj 127 62 unpack f f f; +#X obj 125 136 t b f; +#X connect 0 0 1 0; #X connect 2 0 0 0; -#X connect 15 0 0 0; -#X connect 19 0 0 0; -#X connect 23 0 0 0; -#X connect 26 0 0 0; -#X connect 55 0 0 0; -#X connect 58 0 0 0; -#X restore 224 340 pd links; +#X connect 3 0 2 0; +#X connect 4 0 3 1; +#X connect 5 0 14 0; +#X connect 6 0 11 0; +#X connect 6 0 12 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 10 0 8 1; +#X connect 11 0 9 2; +#X connect 12 0 13 0; +#X connect 13 0 8 0; +#X connect 13 1 9 1; +#X connect 14 1 15 0; +#X connect 14 2 0 2; +#X connect 15 0 3 0; +#X connect 15 1 0 1; +#X restore 172 320 pd gemrender; +#X msg 336 129 reset \, create \, 1; +#X text 135 98 Sorry \, you need GEM for this example...; +#X text 169 132 1 Create window -->; +#X text 169 163 2 Drag the structure with the mouse; +#X text 169 195 3 Destroy the window -->; +#X connect 21 0 49 0; +#X connect 24 0 23 0; +#X connect 25 0 50 0; +#X connect 26 0 19 0; +#X connect 49 0 20 0; +#X connect 50 0 55 0; +#X connect 50 1 55 1; +#X connect 51 0 22 0; +#X connect 52 0 51 0; +#X connect 54 0 53 0; +#X connect 56 0 53 0; -- cgit v1.2.1