1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
|
#N canvas 515 28 564 659 10;
#X obj 4 289 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 5 615 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 309 cnv 15 75 15 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 14 534 cnv 15 75 15 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 4 477 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 4 512 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 565 cnv 15 550 20 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 5 585 cnv 15 550 30 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 12 76 Examples:;
#X text 9 289 Inlets:;
#X text 19 308 - Left:;
#X text 10 476 Arguments:;
#X text 11 512 Outlets:;
#X text 19 567 See Also:;
#X text 74 48 Full Name:;
#N canvas 58 22 262 70 Related_Objects 0;
#X obj 3 10 cnv 15 250 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 3 30 cnv 15 250 30 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 5 10 Externals and libraries;
#X obj 44 37 pmpd;
#X obj 141 39 pmpd3d;
#X restore 122 623 pd Related_Objects;
#X text 101 308 Bang - A bang at the left inlet compute the new model
state based on previous instant.;
#X text 188 376 To create the model masses and links.;
#X text 188 430 To get the model parameters;
#X text 103 492 None;
#X text 18 533 - Left:;
#X text 101 534 Outputs the model parameters asked with the attributes
messages.;
#X text 101 340 Messages - Different messages are used to control the
pmpd object. They are of three types :;
#X text 9 589 CATEGORY: control;
#X text 9 599 KEYWORDS: physical model mass spring damper link;
#X text 135 98 Sorry \, you need GEM for this example...;
#X text 265 619 - Cyrille Henry 2011;
#X text 265 631 based on MSD by Nicolas Montgermont \, 2005;
#X text 12 8 HELP: pmpd3d;
#X text 11 19 DESCRIPTION: Physical modeling for Pd in 3d;
#X obj 157 48 pmpd3d;
#N canvas 426 263 759 345 init 0;
#X obj 89 215 t a;
#X obj 89 33 loadbang;
#X obj 89 241 s \$0-in;
#X obj 89 59 t b b b b b;
#X msg 161 80 reset;
#X obj 44 13 inlet;
#X msg 107 161 link souple mob mob 10 10;
#X msg 89 187 Xmax 4 \, Xmin -4 \, Ymax 4 \, Ymin -4 \, Zmax 1 \, Zmin
-4;
#X msg 125 110 mass mob 1 100 0 1 0 \, mass mob 1 100 1 0 0 \, mass
mob 1 100 0 0 0 \, mass mob 1 100 1 1 0 \, mass mob 1 100 0 1 -1 \,
mass mob 1 100 1 0 -1 \, mass mob 1 100 0 0 -1 \, mass mob 1 100 1
1 -1;
#X connect 0 0 2 0;
#X connect 1 0 3 0;
#X connect 3 0 7 0;
#X connect 3 1 6 0;
#X connect 3 2 8 0;
#X connect 3 4 4 0;
#X connect 4 0 0 0;
#X connect 5 0 3 0;
#X connect 6 0 0 0;
#X connect 7 0 0 0;
#X connect 8 0 0 0;
#X restore 17 156 pd init;
#X obj 17 251 s \$0-out;
#X obj 17 202 r \$0-in;
#X obj 318 257 s \$0-in;
#N canvas 565 515 355 193 compute 0;
#X obj 27 127 s \$0-in;
#X obj 27 66 gemhead;
#X msg 27 96 bang \, massPos \, linkEnd;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X restore 17 179 pd compute;
#X obj 102 205 r \$0-out;
#N canvas 363 318 550 319 gemrender 0;
#X obj 48 203 translateXYZ;
#X obj 48 229 sphere 0.1;
#X obj 127 24 inlet;
#X obj 390 13 inlet;
#X obj 303 213 curve 2;
#X msg 390 58 \$2 \$3 \$4;
#X msg 462 62 \$5 \$6 \$7;
#X obj 48 167 gemhead;
#X msg 48 143 0;
#X obj 48 115 loadbang;
#X obj 303 147 gemhead;
#X msg 303 123 0;
#X obj 303 95 loadbang;
#X obj 390 86 t b l;
#X obj 127 62 unpack s f f f f;
#X obj 119 109 t b;
#X connect 0 0 1 0;
#X connect 2 0 14 0;
#X connect 3 0 6 0;
#X connect 3 0 5 0;
#X connect 5 0 13 0;
#X connect 6 0 4 2;
#X connect 7 0 0 0;
#X connect 8 0 7 0;
#X connect 9 0 8 0;
#X connect 10 0 4 0;
#X connect 11 0 10 0;
#X connect 12 0 11 0;
#X connect 13 0 10 0;
#X connect 13 1 4 1;
#X connect 14 1 15 0;
#X connect 14 2 0 1;
#X connect 14 3 0 2;
#X connect 14 4 0 3;
#X connect 15 0 7 0;
#X restore 102 256 pd gemrender;
#X obj 17 226 pmpd3d;
#X text 417 226 2 Send forces;
#X text 112 568 01_pmpd3dtest.pd;
#N canvas 556 79 967 626 creation____________ 0;
#X obj 5 75 cnv 15 450 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 5 3 cnv 15 450 15 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 7 2 CREATION Messages;
#X obj 4 137 cnv 15 450 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 3 351 cnv 15 450 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X msg 32 104 reset;
#X text 202 167 Add a mass;
#X text 57 191 \$1 : Id (symbol);
#X text 57 211 \$2 : fixed or mobile (0/1);
#X text 57 229 \$3 : mass;
#X text 7 137 Masses :;
#X text 7 74 Reset :;
#X text 129 105 Delete all masses \, links and internal variables;
#X text 6 351 Links :;
#X text 49 406 \$1 : Id (symbol);
#X text 49 459 \$4 : rigidity;
#X text 49 406 \$1 : Id (symbol);
#X text 49 459 \$4 : rigidity;
#X text 49 424 \$2 : creation No/Id of mass1;
#X text 49 442 \$3 : creation No/Id of mass2;
#X text 266 384 Add link(s);
#X text 49 477 \$5 : damping;
#X text 10 28 Creation messages are used to define the structure of
the model. Messages create links and masses or destroy them.;
#X msg 30 384 link \$1 \$2 \$3 \$4 \$5 (\$6 \$7 \$8);
#X text 46 495 (\$6) : Power of the rigidity distance;
#X text 46 514 (\$7) : minimum lenght of link;
#X text 46 531 (\$8) : maximum lenght of link;
#X obj 471 75 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 501 75 cnv 15 450 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 471 578 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X text 527 180 \$1 : Id (symbol);
#X text 527 233 \$4 : rigidity;
#X text 527 180 \$1 : Id (symbol);
#X text 527 233 \$4 : rigidity;
#X text 527 198 \$2 : creation No/Id of mass1;
#X text 527 216 \$3 : creation No/Id of mass2;
#X text 527 251 \$5 : damping;
#X text 812 154 Add tangential link(s);
#X text 506 102 In 2D (and 3D) there are two specials links : oriented
links. They works as general links excepts their calculation is made
following a vector.;
#X text 504 75 Oriented links :;
#X msg 502 406 tabLink \$1 \$2 \$3 \$4 \$5 \$6 \$7;
#X text 532 453 \$1 : Id (symbol);
#X text 532 453 \$1 : Id (symbol);
#X text 532 471 \$2 : creation No/Id of mass1;
#X text 532 489 \$3 : creation No/Id of mass2;
#X text 527 434 Add non linear link(s);
#X text 530 506 \$4 : table name for the rigidity;
#X text 530 524 \$5 : length of the table;
#X text 530 542 \$6 : table name for the damping;
#X text 529 561 \$7 : length of the table;
#X obj 494 351 cnv 15 450 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 497 351 Table links :;
#X msg 32 167 mass \$1 \$2 \$3 \$4 \$5 \$6;
#X text 58 247 \$4 \, \$5 \, \$6 : initial position;
#X msg 507 153 tLink \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8 (\$9 \$10 \$11)
;
#X text 526 270 \$6 \, \$7 \, \$8 : tangential vector (x \, y);
#X text 524 289 (\$9) : Power of the rigidity distance;
#X text 524 308 (\$10) : minimum lenght of link;
#X text 524 325 (\$11) : maximum lenght of link;
#X connect 27 0 29 0;
#X restore 12 377 pd creation____________;
#N canvas 541 24 1078 872 dynamic 0;
#X obj 5 3 cnv 15 550 15 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 10 85 cnv 15 150 750 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 4 62 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 574 86 cnv 15 130 350 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 567 62 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 7 62 Masses :;
#X text 570 62 Links :;
#X text 7 2 DYNAMIC SETTINGS Messages;
#X msg 31 115 posX \$1 \$2;
#X text 191 178 Add force on mass(es);
#X msg 30 191 forceX \$1 \$2;
#X text 190 114 \$1 : Id (symbol) or No;
#X text 193 195 \$1 : Id (symbol) or No;
#X msg 31 288 Xmin \$1;
#X msg 90 288 Xmax \$1;
#X msg 29 347 setMobile \$1;
#X msg 29 368 setFixed \$1;
#X text 190 96 Set position of fixed mass(es);
#X text 177 272 Set minimimum and maximum position of all masses;
#X text 188 347 Set mass to mobile or fixed;
#X msg 593 150 setD \$1 \$2;
#X text 748 136 \$2 : New value;
#X msg 593 99 setK \$1 \$2;
#X text 748 192 \$2 : New value;
#X text 748 245 \$2 : New value;
#X text 742 100 Set rigidity of link(s);
#X text 742 156 Set damping of link(s);
#X msg 593 205 setL \$1 \$2;
#X text 742 209 Set initial lenght of link(s);
#X text 748 118 \$1 : Id (symbol) or No;
#X text 748 174 \$1 : Id (symbol) or No;
#X text 748 227 \$1 : Id (symbol) or No;
#X text 191 364 \$1 : Id (symbol) or No;
#X text 10 25 Dynamic settings messages allows the user to redefine
internal parameters of links and masses.;
#X msg 29 391 grabMass \$1 \$2 \$3;
#X text 186 391 Grab nearest mass;
#X text 191 407 \$1 \, \$2 : position;
#X text 190 424 \$3 : grab or not (0/1);
#X msg 31 134 posY \$1 \$2;
#X msg 30 210 forceY \$1 \$2;
#X msg 31 307 Ymin \$1;
#X msg 90 307 Ymax \$1;
#X text 191 476 \$2 : New Id;
#X msg 29 444 setMassId \$1 \$2;
#X text 191 442 Change the Id of a mass;
#X text 192 459 \$1 : mass (number or Id);
#X msg 24 564 setSpeed \$1 \$2;
#X text 186 518 \$1 : Id (symbol) or No;
#X text 183 501 set force on mass(es);
#X text 185 585 \$1 : Id (symbol) or No;
#X text 182 568 set speed of a mass(es);
#X text 178 664 \$1 : Id (symbol) or No;
#X text 175 647 add pos of a mass(es);
#X msg 27 734 grabMass \$1 \$2 \$3;
#X text 183 703 grab a mass \, and move it;
#X text 185 725 \$1 : mass number;
#X text 185 741 \$2 : position;
#X text 185 757 \$3 : grab or not (0 or 1);
#X msg 24 484 setForce \$1 \$2 \$3;
#X text 186 536 \$2 / \$3 : Value;
#X msg 24 503 setForceX \$1 \$2;
#X msg 24 522 setForceY \$1 \$2;
#X msg 31 96 pos \$1 \$2 \$3;
#X text 190 132 \$2 / \$3 : Value;
#X msg 30 172 force \$1 \$2 \$3;
#X text 191 213 \$2 / \$3 : Value;
#X text 178 781 Change environement damping;
#X msg 24 583 setSpeedX \$1 \$2;
#X msg 24 602 setSpeedY \$1 \$2;
#X text 185 602 \$2 / \$3 : Value;
#X text 179 682 \$2 / \$3 : Value;
#X msg 24 645 addPos \$1 \$2 \$3;
#X msg 588 280 setLinkId \$1 \$2;
#X text 742 281 Change the Id of a link;
#X text 743 298 \$1 : link (number or Id);
#X text 746 315 \$2 : New Id;
#X msg 591 353 setLKTab \$1 \$2;
#X text 750 353 change the table (K) size of a non linear link;
#X text 751 373 \$1 : link (number or Id);
#X text 752 390 \$2 : New KL;
#X text 751 435 \$1 : link (number or Id);
#X msg 591 415 setLDTab \$1 \$2;
#X text 750 415 change the table (D) size of a non linear link;
#X text 752 452 \$2 : New DL;
#X msg 31 153 posZ \$1 \$2;
#X msg 30 229 forceZ \$1 \$2;
#X msg 31 249 min \$1 \$2;
#X msg 31 269 max \$1 \$2;
#X text 180 288 \$1 / \$2 / \$3 : Value;
#X msg 31 326 Zmin \$1;
#X msg 90 326 Zmax \$1;
#X msg 24 541 setForceZ \$1 \$2;
#X msg 24 621 setSpeedZ \$1 \$2;
#X msg 24 664 addPosX \$1 \$2;
#X msg 24 683 addPosY \$1 \$2;
#X msg 25 702 addPosZ \$1 \$2;
#X msg 29 781 setDEnv \$1 \$2;
#X text 190 812 \$2 : damping;
#X text 189 797 \$1 : Id (symbol) or No;
#X text 571 580 if only 1 argument is previded \, message generally
used this argument as the value applayed to all masses (or link);
#X text 191 855 \$2 : damping;
#X text 190 840 \$1 : Id (symbol) or No;
#X msg 30 824 setDEnvOffset \$1 \$2;
#X text 179 824 Change environement damping offset;
#X restore 12 398 pd dynamic settings ___;
#X text 188 398 To set the model parameters after creation.;
#N canvas 0 22 1224 756 masses_attributes 0;
#X obj 11 115 cnv 15 100 35 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 5 95 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 5 3 cnv 15 590 15 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 10 178 cnv 15 150 110 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 4 157 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 616 422 cnv 15 110 330 empty empty empty 20 12 0 14 -233017
-66577 0;
#X obj 610 398 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 7 94 General :;
#X text 7 2 ATTRIBUTES Messages;
#X text 7 157 Lists :;
#X text 136 124 Get infos on all masses and links on right outlet;
#X text 170 190 Output all masses positions in a list on outlet No
1;
#X text 746 438 Get specific attribute on specific element;
#X msg 626 436 get \$1 (\$2);
#X text 613 398 Specific :;
#X text 746 533 The get message return the asked attribute preceded
by an identifier and the creation No of the element. The identifier
is made of the asked parameter and the way you asked for it.;
#X text 747 609 message;
#X text 987 609 response;
#X text 746 590 Examples with 3 masses numbered 0 \, 1 and 2 and named
mas:;
#X text 172 419 Output all forces applied on masses in a list on outlet
No 1;
#X text 746 500 (\$2) : - If not defined all the attributes are send
for all the elements. - Ids or/and creations No;
#X text 170 222 Output all masses x or y in a list on outlet No 1;
#X msg 33 124 print;
#X text 170 250 Output all norm of position vector (sqrt(x*x+y*y))
in a list on outlet No 1;
#X obj 11 292 cnv 15 150 110 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 171 304 Output all masses speeds in a list on outlet No 1;
#X text 172 336 Output all masses speeds in x or y in a list on outlet
No 1;
#X text 179 373 Output all norm of speed vector (sqrt(x*x+y*y)) in
a list on outlet No 1;
#X obj 11 405 cnv 15 150 110 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 175 449 Output all masses forces in x or y in a list on outlet
No 1;
#X text 175 483 Output all norm of forces vector (sqrt(x*x+y*y)) in
a list on outlet No 1;
#X text 745 457 \$1 : Attribute type ( massesPos / massesPosName /
massesSpeeds / massesSpeedsName / massesForces / massesForcesName /
linksPos / linksPosName );
#X obj 611 26 cnv 15 150 110 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 605 5 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 796 264 Output all forces applied on masses in a list on outlet
No 1;
#X obj 612 140 cnv 15 150 110 empty empty empty 20 12 0 14 -233017
-66577 0;
#X text 795 149 Output all masses speeds in a list on outlet No 1;
#X text 796 181 Output all masses speeds in x or y in a list on outlet
No 1;
#X text 801 209 Output all norm of speed vector (sqrt(x*x+y*y)) in
a list on outlet No 1;
#X obj 612 253 cnv 15 150 110 empty empty empty 20 12 0 14 -233017
-66577 0;
#X text 799 294 Output all masses forces in x or y in a list on outlet
No 1;
#X text 804 322 Output all norm of forces vector (sqrt(x*x+y*y)) in
a list on outlet No 1;
#X msg 12 189 massesPosL (\$1);
#X msg 12 208 massesPosXL (\$1);
#X msg 12 227 massesPosYL (\$1);
#X msg 12 265 massesPosNormL (\$1);
#X msg 13 299 massesSpeedsL (\$1);
#X msg 14 375 massesSpeedsNormL (\$1);
#X msg 15 412 massesForcesL (\$1);
#X msg 12 189 massesPosL (\$1);
#X msg 14 488 massesSpeedsNormL (\$1);
#X msg 615 38 massesPosT \$1 (\$2);
#X msg 615 57 massesPosXT \$1 (\$2);
#X msg 615 76 massesPosYT \$1 (\$2);
#X msg 614 114 massesPosNormT \$1 (\$2);
#X msg 616 152 massesSpeedsT \$1 (\$2);
#X msg 616 228 massesSpeedsNormT \$1 (\$2);
#X msg 616 335 massesSpeedsNormT \$1 (\$2);
#X text 794 35 Output all masses positions in a table (\$1);
#X text 794 67 Output all masses x or y in a table (\$1);
#X text 794 95 Output all norm of position vector (sqrt(x*x+y*y)) in
a table (\$1);
#X text 174 518 \$1 (optional): Masses Id;
#X text 815 376 \$2 (optional): Masses Id;
#X text 814 363 \$1 : table name;
#X obj 17 564 cnv 15 150 270 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 11 544 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 14 544 statistics :;
#X msg 22 577 massesPosMean;
#X text 177 593 \$1 : none or Id;
#X msg 23 615 massesPosStd \$1;
#X text 179 630 \$1 : none or Id;
#X text 173 577 output the average position of masses;
#X text 174 614 output the standard deviation of masses position;
#X text 177 680 \$1 : none or Id;
#X text 179 717 \$1 : none or Id;
#X text 173 664 output the average position of masses;
#X text 174 701 output the standard deviation of masses position;
#X text 177 765 \$1 : none or Id;
#X text 178 802 \$1 : none or Id;
#X text 173 749 output the average position of masses;
#X text 173 786 output the standard deviation of masses position;
#X msg 22 702 massesForcesStd \$1;
#X msg 22 664 massesForcesMean;
#X msg 23 751 massesSpeedsMean;
#X msg 22 787 massesSpeedsStd \$1;
#X text 608 5 tables :;
#X msg 12 246 massesPosZL (\$1);
#X msg 14 318 massesSpeedsXL (\$1);
#X msg 13 337 massesSpeedsYL (\$1);
#X msg 14 356 massesSpeedsZL (\$1);
#X msg 15 431 massesForcesXL (\$1);
#X msg 15 450 massesForcesYL (\$1);
#X msg 14 469 massesForcesZL (\$1);
#X text 780 629 [get massesPos( -----> [massesPos 0 x0 y0 z0(;
#X text 940 641 [massesPos 1 x1 y1 z1(;
#X text 940 656 [massesPos 2 x2 y2 z2(;
#X text 765 678 [get massesPos 1( -----> [massesPosNo 1 x1 y1 z1(;
#X text 752 698 [get massesPos mas( -----> [massesPosId 0 x0 y0 z0(
;
#X text 941 714 [massesPosId 1 x1 y1 z1(;
#X text 941 729 [massesPosId 2 x2 y2 z2(;
#X text 753 750 [get massesPosName( -----> [massesPosName mas x0 y0
z0(;
#X text 942 765 [massesPosName mas x1 y1 z1(;
#X text 941 780 [massesPosName mas x2 y2 z2(;
#X msg 615 95 massesPosZT \$1 (\$2);
#X msg 616 171 massesSpeedsXT \$1 (\$2);
#X msg 616 190 massesSpeedsYT \$1 (\$2);
#X msg 616 209 massesSpeedsZT \$1 (\$2);
#X msg 616 259 massesForcesT \$1 (\$2);
#X msg 616 278 massesForcesXT \$1 (\$2);
#X msg 616 297 massesForcesYT \$1 (\$2);
#X msg 616 316 massesForcesZT \$1 (\$2);
#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 \, or directly send value to a table.;
#X obj 621 827 cnv 15 150 95 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 615 807 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 781 855 output the closest mass;
#X text 618 807 others :;
#X text 780 869 \$1 : x -position;
#X text 780 884 \$2 : y -position;
#X text 780 899 \$3 : z -position;
#X text 780 911 \$4 : none or Id;
#X msg 626 855 closestMass \$1 \$2 \$3 (\$4);
#X restore 12 419 pd masses_attributes __;
#N canvas 44 22 1236 814 links_attributes 0;
#X obj 5 3 cnv 15 590 15 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 10 108 cnv 15 150 110 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 4 87 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 7 2 ATTRIBUTES Messages;
#X text 7 87 Lists :;
#X text 170 180 Output all norm of position vector (sqrt(x*x+y*y))
in a list on outlet No 1;
#X obj 11 222 cnv 15 150 110 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 11 335 cnv 15 150 110 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 611 26 cnv 15 150 110 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 605 5 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 612 140 cnv 15 150 110 empty empty empty 20 12 0 14 -233017
-66577 0;
#X obj 612 253 cnv 15 150 110 empty empty empty 20 12 0 14 -233017
-66577 0;
#X msg 14 305 massesSpeedsNormL (\$1);
#X text 402 546 \$1 (optional): Masses Id;
#X text 833 502 \$2 (optional): Masses Id;
#X text 832 489 \$1 : table name;
#X obj 17 584 cnv 15 150 220 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 11 564 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X msg 22 597 massesPosMean;
#X text 177 613 \$1 : none or Id;
#X msg 23 629 massesPosStd \$1;
#X text 179 644 \$1 : none or Id;
#X text 173 597 output the average position of masses;
#X text 174 628 output the standard deviation of masses position;
#X text 177 674 \$1 : none or Id;
#X text 179 711 \$1 : none or Id;
#X text 173 658 output the average position of masses;
#X text 174 695 output the standard deviation of masses position;
#X text 177 749 \$1 : none or Id;
#X text 178 786 \$1 : none or Id;
#X text 173 733 output the average position of masses;
#X text 173 770 output the standard deviation of masses position;
#X msg 22 696 massesForcesStd \$1;
#X msg 22 658 massesForcesMean;
#X msg 23 735 massesSpeedsMean;
#X msg 22 771 massesSpeedsStd \$1;
#X text 608 5 tables :;
#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 links;
#X text 14 564 statistics (not implemented yet) :;
#X msg 11 119 linksPosL (\$1);
#X text 170 120 Output all links center positions in a list on outlet
No 1;
#X msg 11 138 linksPosXL (\$1);
#X msg 12 157 linksPosYL (\$1);
#X msg 12 176 linksPosZL (\$1);
#X msg 12 195 linksPosNormL (\$1);
#X msg 13 229 linksLengthL (\$1);
#X msg 13 248 linksLengthXL (\$1);
#X msg 13 267 linksLengthYL (\$1);
#X msg 14 286 linksLengthZL (\$1);
#X text 170 152 Output all links x or y in a list on outlet No 1;
#X obj 12 451 cnv 15 150 110 empty empty empty 20 12 0 14 -233017 -66577
0;
#X msg 14 458 linksLengthSpeedL (\$1);
#X msg 14 477 linksLengthSpeedXL (\$1);
#X msg 14 496 linksLengthSpeedYL (\$1);
#X msg 15 515 linksLengthSpeedZL (\$1);
#X msg 15 534 massesSpeedsSpeedNormL (\$1);
#X text 184 459 Output all link lenght deformation speed in a list
on outlet No 1;
#X text 184 495 Output all link lenght deformation speed in x or y
in a list on outlet No 1;
#X text 214 523 Output all norm of link lenght deformation speed vector
(sqrt(x*x+y*y)) in a list on outlet No 1;
#X msg 615 38 linksPosT \$1 (\$2);
#X msg 616 57 linksPosXT \$1 (\$2);
#X msg 615 76 linksPosYT \$1 (\$2);
#X msg 615 95 linksPosZT \$1 (\$2);
#X msg 614 114 linksPosNormT \$1 (\$2);
#X msg 616 152 linksLengthT \$1 (\$2);
#X msg 615 228 linksLengthNormT \$1 (\$2);
#X obj 612 369 cnv 15 150 110 empty empty empty 20 12 0 14 -233017
-66577 0;
#X text 808 377 Output all link lenght deformation speed in a list
on outlet No 1;
#X text 808 413 Output all link lenght deformation speed in x or y
in a list on outlet No 1;
#X text 838 441 Output all norm of link lenght deformation speed vector
(sqrt(x*x+y*y)) in a list on outlet No 1;
#X msg 614 376 linksLengthSpeedT \$1 (\$2);
#X msg 613 395 linksLengthSpeedXT \$1 (\$2);
#X msg 614 414 linksLengthSpeedYT \$1 (\$2);
#X msg 615 433 linksLengthSpeedZT \$1 (\$2);
#X msg 615 452 massesSpeedsSpeedNormT \$1 (\$2);
#X text 794 35 Output all links center positions in a table (\$1);
#X text 794 67 Output all links center positions x or y in a table
(\$1);
#X text 793 105 Output all norm of links center positions vector (sqrt(x*x+y*y))
in a table (\$1);
#X text 170 233 Output all link lenght in a list on outlet No 1;
#X text 172 266 Output all link lenght in x or y in a list on outlet
No 1;
#X text 181 294 Output all norm of link lenght vector (sqrt(x*x+y*y))
in a list on outlet No 1;
#X text 171 349 Output all link center speed in a list on outlet No
1;
#X text 175 379 Output all link center speed in x or y in a list on
outlet No 1;
#X text 194 415 Output all norm of link center speed vector (sqrt(x*x+y*y))
in a list on outlet No 1;
#X text 797 154 Output all link length in a list on outlet No 1;
#X text 796 181 Output all link length in x or y in a list on outlet
No 1;
#X text 799 218 Output all norm of link length vector (sqrt(x*x+y*y))
in a list on outlet No 1;
#X msg 16 342 linksPosSpeedL (\$1);
#X msg 16 361 linksPosSpeedXL (\$1);
#X msg 15 380 linksPosSpeedYL (\$1);
#X msg 15 399 linksPosSpeedsZL (\$1);
#X msg 14 418 linksPosSpeedNormL (\$1);
#X msg 616 259 linksPosSpeedT \$1 (\$2);
#X msg 616 335 linksPosSpeedNormT \$1 (\$2);
#X text 795 264 Output all link center speed in a list on outlet No
1;
#X text 799 294 Output all link center speed in x or y in a list on
outlet No 1;
#X text 815 326 Output all norm of link center speed vector (sqrt(x*x+y*y))
in a list on outlet No 1;
#X msg 616 171 linksLengthXT \$1 (\$2);
#X msg 616 190 linksLengthYT \$1 (\$2);
#X msg 616 209 linksLengthZT \$1 (\$2);
#X msg 616 278 linksPosSpeedXT \$1 (\$2);
#X msg 616 297 linksPosSpeedYT \$1 (\$2);
#X msg 616 316 linksPosSpeedZT \$1 (\$2);
#X restore 12 439 pd links_attributes ___;
#N canvas 0 22 901 640 More_Info 0;
#X text 96 12 pmpd : mass - spring - damper model;
#X text 27 155 Be careful : if masses are deleted \, lists messages
won't work;
#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
pmpd 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 426 -5 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 426 294 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#N canvas 0 22 450 300 (subpatch) 0;
#X array rigidity1 4 float 1;
#A 0 -1 0 1 2;
#X array - 4 float 1;
#A 0 0 0 0 0;
#X coords 0 3 3 -3 200 150 1;
#X restore 31 428 graph;
#X text 89 585 L0;
#N canvas 324 73 956 727 figure 0;
#X obj 284 53 loadbang;
#X msg 293 125 \; 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 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 181 235 t b b;
#X obj 620 552 f;
#X obj 620 522 t b f;
#X obj 620 623 tabwrite rigidity2;
#X msg 763 574 0;
#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 obj 631 315 f;
#X obj 648 394 + 1;
#X obj 632 367 t f f;
#X obj 375 333 f;
#X obj 375 360 moses 50.5;
#X obj 392 411 + 1;
#X obj 376 384 t f f;
#X obj 176 141 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X msg 371 310 0;
#X msg 627 286 0;
#X obj 631 343 moses 100.5;
#X connect 0 0 1 0;
#X connect 0 0 22 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 14 0;
#X connect 12 0 21 0;
#X connect 13 0 12 0;
#X connect 13 1 21 1;
#X connect 14 0 15 0;
#X connect 14 1 19 0;
#X connect 15 0 20 0;
#X connect 16 0 12 1;
#X connect 17 0 12 1;
#X connect 18 0 16 0;
#X connect 19 0 17 0;
#X connect 19 1 17 1;
#X connect 20 0 18 0;
#X connect 20 1 18 1;
#X connect 22 0 42 0;
#X connect 22 1 33 0;
#X connect 22 1 43 0;
#X connect 23 0 30 0;
#X connect 24 0 23 0;
#X connect 24 1 25 1;
#X connect 26 0 23 1;
#X connect 27 0 31 0;
#X connect 28 0 23 1;
#X connect 28 1 26 0;
#X connect 29 0 26 0;
#X connect 29 1 23 1;
#X connect 30 0 25 0;
#X connect 31 0 32 0;
#X connect 31 1 28 0;
#X connect 32 0 29 0;
#X connect 32 1 26 0;
#X connect 34 0 44 0;
#X connect 35 0 34 0;
#X connect 36 0 35 0;
#X connect 36 1 27 0;
#X connect 36 1 24 0;
#X connect 37 0 38 0;
#X connect 38 0 40 0;
#X connect 39 0 37 0;
#X connect 40 0 39 0;
#X connect 40 1 4 0;
#X connect 40 1 6 0;
#X connect 40 1 13 0;
#X connect 40 1 11 0;
#X connect 41 0 22 0;
#X connect 42 0 37 0;
#X connect 43 0 34 0;
#X connect 44 0 36 0;
#X restore 27 304 pd figure;
#X text 105 375 Rigidity;
#N canvas 0 22 450 300 (subpatch) 0;
#X array rigidity2 101 float 1;
#A 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 0;
#X array - 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 100 100 -100 200 150 1;
#X restore 449 428 graph;
#X text 547 583 L0;
#X text 466 374 Rigidity with Lmin and Lmax;
#X text 563 583 Lmin;
#X text 625 582 Lmax;
#N canvas 0 22 450 300 (subpatch) 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 - 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 241 428 graph;
#X text 314 581 L0;
#X text 257 375 Rigidity with power = 1/2;
#N canvas 0 22 450 300 (subpatch) 0;
#X array rigidity4 51 float 1;
#A 0 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;
#X array - 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 657 428 graph;
#X text 730 582 L0;
#X text 688 373 Rigidity with power = 2;
#X text 571 12 The equations are :;
#X text 497 36 if Lmin<|L[n]-L[0]|<Lmax;
#X text 496 75 else;
#X text 496 95 F[n] = D(L[n]-L[n-1]);
#X text 496 54 F[n] = K(L[n] - L[0])^P + D(L[n] - L[n-1]);
#X text 28 187 Links connect masses two by two. They got 4 physicals
parameters : length \, rigidity \, damping and power.;
#X text 27 216 Rigidity \, damping and power are defined by the creation
message. The lenght is initialised to the distance between the two
masses at the creation.;
#X text 495 124 For oriented links \, the force F[n] is projected onto
a vector which is given during the creation of the link using x1y1
coordinates.;
#X text 495 169 For normal vector \, the direction is calculated using
the scalar product :;
#X text 495 248 You can build specific links using different links
messages defining the characteristic step by step.;
#X text 496 206 x1x2 + y1y2 = 0;
#X text 27 257 Links can be created in one shot between mutiples masses
\, instead of creation number \, the masses linked are defined with
their Id.;
#X text 28 41 pmpd is the 2D object of the pmpd objects collection.
;
#X connect 3 0 4 0;
#X restore 14 622 pd More_Info;
#X obj 225 254 print;
#X obj 102 229 route massPos linkEnd;
#X obj 318 186 loadbang;
#N canvas 780 280 450 300 gemwin 0;
#X obj 144 24 inlet;
#X obj 144 46 sel 1 0;
#X obj 144 128 gemwin;
#X msg 164 96 0 \, destroy;
#X msg 144 71 reset \, create \, 1;
#X connect 0 0 1 0;
#X connect 1 0 4 0;
#X connect 1 1 3 0;
#X connect 3 0 2 0;
#X connect 4 0 2 0;
#X restore 317 157 pd gemwin;
#X obj 317 134 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X obj 17 133 bng 15 250 50 0 empty empty reset 17 7 0 10 -262144 -1
-1;
#X text 416 133 1 Create window;
#X msg 318 211 forceZ 1 30;
#X msg 318 233 forceX mob 10;
#X connect 35 0 40 0;
#X connect 38 0 50 0;
#X connect 40 0 34 0;
#X connect 50 0 39 0;
#X connect 50 1 39 1;
#X connect 50 2 49 0;
#X connect 51 0 56 0;
#X connect 53 0 52 0;
#X connect 54 0 33 0;
#X connect 56 0 36 0;
#X connect 57 0 36 0;
|