aboutsummaryrefslogtreecommitdiff
path: root/pmpd-help.pd
blob: 91c22fe5f4179216de4c0473de1be095b1338b80 (plain)
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
#N canvas 165 139 590 764 10;
#X obj 4 369 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 5 709 cnv 15 550 40 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 624 cnv 15 75 15 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 4 567 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 4 602 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 659 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 5 679 cnv 15 550 30 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 12 76 Examples:;
#X text 9 369 Inlets:;
#X text 19 388 - Left:;
#X text 10 566 Arguments:;
#X text 11 602 Outlets:;
#X text 19 659 See Also:;
#X text 74 48 Full Name:;
#N canvas 56 110 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 pmpd2d;
#X obj 140 37 pmpd3d;
#X restore 122 716 pd Related_Objects;
#N canvas 537 397 524 302 init 0;
#X msg 89 187 Xmax 127 \, Xmin 0;
#X obj 89 215 t a;
#X obj 89 33 loadbang;
#X msg 143 100 mass fix 0 10 0;
#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 125 120 mass mob 1 10 0 \, mass mob 1 10 0 \, mass mob 1 10
0;
#X msg 107 143 link souple 1 0 1 0.5 \, link souple 1 2 1 0.5 \, link
souple 3 2 1 0.5;
#X connect 0 0 1 0;
#X connect 1 0 4 0;
#X connect 2 0 5 0;
#X connect 3 0 1 0;
#X connect 5 0 0 0;
#X connect 5 1 9 0;
#X connect 5 2 8 0;
#X connect 5 3 3 0;
#X connect 5 4 6 0;
#X connect 6 0 1 0;
#X connect 7 0 5 0;
#X connect 8 0 1 0;
#X connect 9 0 1 0;
#X restore 17 156 pd init;
#X obj 17 344 s \$0-out;
#X obj 17 295 r \$0-in;
#X obj 261 184 vsl 15 127 0 127 0 0 empty empty Drag-----> -70 60 1
10 -262144 -1 -1 0 1;
#X obj 292 184 vsl 15 127 0 127 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X obj 261 345 s \$0-in;
#X msg 261 322 posX fix \$1;
#N canvas 561 581 355 193 compute 0;
#X obj 159 37 inlet;
#X obj 159 74 metro 20;
#X obj 159 135 s \$0-in;
#X msg 159 104 bang \, massesPosL;
#X connect 0 0 1 0;
#X connect 1 0 3 0;
#X connect 3 0 2 0;
#X restore 17 224 pd compute;
#X obj 17 207 tgl 15 0 empty empty ON/OFF 25 10 1 10 -262144 -1 -1
1 1;
#X obj 261 107 r \$0-out;
#X obj 17 139 bng 15 250 50 0 empty empty reset 25 10 1 10 -262144
-1 -1;
#X obj 261 131 route massesPosL;
#X obj 311 184 vsl 15 127 0 127 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X obj 330 184 vsl 15 127 0 127 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X obj 261 152 unpack f f f f;
#X text 160 477 To set the model parameters after creation.;
#X text 160 458 To create the model masses and links.;
#X text 103 582 None;
#X text 18 623 - Left:;
#X text 101 624 Outputs the model parameters asked with the attributes
messages.;
#X text 101 420 Messages - Different messages are used to control the
msd object. They are of three types :;
#X text 9 680 CATEGORY: control;
#X text 111 659 01_msdtest.pd;
#X obj 157 48 pmpd;
#X text 12 8 HELP: pmpd;
#X text 12 20 DESCRIPTION: physical modeling for pd \, based on msd.
;
#X obj 17 319 pmpd;
#X text 266 716 - Cyrille Henry \, 2011;
#X text 283 732 based on MSD by Nicolas Montgermont;
#X obj 17 187 loadbang;
#N canvas 179 163 607 855 links_attributes 0;
#X obj 5 3 cnv 15 590 15 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 9 221 cnv 15 170 190 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 9 201 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 7 2 ATTRIBUTES Messages;
#X text 12 201 Lists :;
#X obj 11 440 cnv 15 170 200 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 11 419 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 277 391 \$1 (optional): Masses Id;
#X text 284 780 \$2 (optional): Masses Id;
#X text 283 767 \$1 : table name;
#X text 14 419 tables :;
#X text 189 233 Output all links center positions in a list on outlet
No 1;
#X text 183 449 Output all links center positions in a table (\$1)
;
#X obj 8 95 cnv 15 170 100 empty empty empty 20 12 0 14 -233017 -66577
0;
#X msg 16 103 linkPos [\$1];
#X msg 16 138 linkEnd [\$1];
#X obj 8 74 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 11 74 generic :;
#X text 216 116 linkPos symbolId number center;
#X text 219 154 linkEnd symbolId number posX1 posX2;
#X obj 11 644 cnv 15 170 190 empty empty empty 20 12 0 14 -233017 -66577
0;
#X msg 18 652 linkEndT \$1 [\$2];
#X msg 27 672 linkEnd1T \$1 [\$2];
#X msg 27 691 linkEnd2T \$1 [\$2];
#X msg 27 710 linkEndXT \$1 [\$2];
#X msg 27 729 linkEnd1XT \$1 [\$2];
#X msg 27 748 linkEnd2XT \$1 [\$2];
#X msg 27 767 linkEndYT \$1 [\$2];
#X msg 27 786 linkEnd1YT \$1 [\$2];
#X msg 27 805 linkEnd2YT \$1 [\$2];
#X text 216 683 table is posX1 posY1 posX2 posY2 ....;
#X msg 18 231 linkPosL (\$1);
#X msg 18 250 linkPosXL (\$1);
#X msg 19 273 linkLengthL (\$1);
#X msg 19 292 linkLengthXL (\$1);
#X msg 18 316 linkPosSpeedL (\$1);
#X msg 18 335 linkPosSpeedXL (\$1);
#X msg 18 359 linkLengthSpeedL (\$1);
#X msg 18 378 linkLengthSpeedXL (\$1);
#X msg 15 445 linkPosT \$1 (\$2);
#X msg 15 464 linkPosXT \$1 (\$2);
#X msg 16 492 linkLengthT \$1 (\$2);
#X msg 16 511 linkLengthXT \$1 (\$2);
#X msg 16 542 linkPosSpeedT \$1 (\$2);
#X msg 16 561 linkPosSpeedXT \$1 (\$2);
#X msg 16 592 linkLengthSpeedT \$1 (\$2);
#X msg 16 611 linkLengthSpeedXT \$1 (\$2);
#X text 15 30 The attributes messages ask the object to output some
of its internal parameters. They can be output as lists for positions
and forces of links;
#X text 220 175 \$1 : Id float or symbol of masses (nothing for all)
;
#X text 187 99 output a message for every link :;
#X text 187 138 output a message for every link :;
#X text 189 277 Output all links length in a list on outlet No 1;
#X text 191 323 Output all links center speed in a list on outlet No
1;
#X text 191 359 Output all links length deformation speed in a list
on outlet No 1;
#X text 181 495 Output all links length in a list on outlet No 1;
#X text 183 543 Output all links center speed in a list on outlet No
1;
#X text 184 592 Output all links length deformation speed in a list
on outlet No 1;
#X text 187 652 Put position of the 2 link end on a table [\$1] \,
filter on link Id is possible;
#X restore 12 517 pd links_attributes ___;
#N canvas 161 121 997 789 dynamic 0;
#X obj 5 3 cnv 15 900 15 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 10 85 cnv 15 130 650 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 4 62 cnv 15 450 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 465 86 cnv 15 130 650 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 458 62 cnv 15 450 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 20 62 Masses :;
#X text 471 62 Links :;
#X text 17 2 DYNAMIC SETTINGS Messages;
#X text 148 149 Add force on mass(es);
#X msg 21 152 forceX \$1 \$2;
#X text 188 212 \$1 : Value;
#X text 187 109 \$1 : Id (symbol) or No;
#X text 188 164 \$1 : Id (symbol) or No;
#X msg 20 244 setMobile \$1;
#X msg 20 265 setFixed \$1;
#X text 146 94 Set position of fixed mass(es);
#X text 187 125 \$2 : Value;
#X text 188 179 \$2 : Value;
#X text 147 196 Set minimimum and maximum position of all masses;
#X text 147 244 Set mass to mobile or fixed;
#X msg 471 150 setD \$1 \$2;
#X msg 470 99 setK \$1 \$2;
#X text 607 100 Set rigidity of link(s);
#X text 606 156 Set damping of link(s);
#X msg 472 205 setL \$1 \$2;
#X text 639 118 \$1 : Id (symbol) or No;
#X text 639 174 \$1 : Id (symbol) or No;
#X text 639 227 \$1 : Id (symbol) or No;
#X text 189 261 \$1 : Id (symbol) or No;
#X msg 21 610 setDEnv \$1;
#X text 148 612 Change environement damping;
#X msg 472 342 setLinkId \$1 \$2;
#X text 608 343 Change the Id of a link;
#X text 639 360 \$1 : link (number or Id);
#X text 639 377 \$2 : New Id;
#X msg 472 399 setLKTab \$1 \$2;
#X text 606 399 change the table (K) size of a non linear link;
#X text 637 419 \$1 : link (number or Id);
#X text 638 436 \$2 : New KL;
#X text 637 469 \$1 : link (number or Id);
#X msg 472 456 setLDTab \$1 \$2;
#X text 606 456 change the table (D) size of a non linear link;
#X text 638 479 \$2 : New DL;
#X text 190 401 \$2 : New Id;
#X msg 22 367 setMassId \$1 \$2;
#X text 148 367 Change the Id of a mass;
#X text 191 384 \$1 : mass (number or Id);
#X msg 22 428 setForce \$1 \$2;
#X msg 22 496 setSpeed \$1 \$2;
#X msg 21 559 addPos \$1 \$2;
#X text 185 448 \$1 : Id (symbol) or No;
#X text 185 466 \$2 : Value;
#X text 148 431 set force on mass(es);
#X text 184 515 \$1 : Id (symbol) or No;
#X text 184 533 \$2 : Value;
#X text 147 498 set speed of a mass(es);
#X text 183 576 \$1 : Id (symbol) or No;
#X text 183 594 \$2 : Value;
#X text 147 559 add pos of a mass(es);
#X text 147 299 grab a mass \, and move it;
#X text 187 317 \$1 : position;
#X text 187 333 \$2 : grab or not (0 or 1);
#X msg 20 300 grabMass \$1 \$2;
#X msg 22 96 SetPosX \$1 \$2;
#X msg 22 116 SetPos \$1 \$2;
#X msg 21 172 force \$1 \$2;
#X msg 21 195 minX \$1;
#X msg 21 217 maxX \$1;
#X msg 81 195 min \$1;
#X msg 81 217 max \$1;
#X text 182 675 \$1 : Id (symbol) or No;
#X msg 19 659 setDEnvOffset \$1 \$2;
#X text 145 659 Change environement damping offset;
#X msg 22 448 setForceX \$1 \$2;
#X msg 22 516 setSpeedX \$1 \$2;
#X msg 21 579 addPosX \$1 \$2;
#X text 637 284 \$1 : Id (symbol) or No;
#X msg 472 265 setLCurrent \$1 [\$2];
#X text 637 302 \$2 : mix between link size (0) and curent length (1)
;
#X text 636 561 \$1 : link (number or Id);
#X text 635 517 \$1 : link (number or Id);
#X msg 472 541 setActive \$1 \$2;
#X msg 472 497 setInactive \$1 \$2;
#X text 603 541 compute the link at each bang;
#X text 631 628 \$1 : link (number or Id);
#X msg 471 585 setOverdamp \$1 \$2;
#X text 633 685 \$1 : link (number or Id);
#X msg 473 666 setEnd \$1 \$2 \$3;
#X text 632 701 \$2 : mass number for end 1;
#X text 602 668 Change the masses a link is connected to;
#X text 631 717 \$3 : mass number for end 2;
#X msg 493 689 setEnd1 \$1 \$2;
#X msg 493 711 setEnd2 \$1 \$2;
#X text 10 25 Dynamic settings messages allow the user to redefine
internal parameters of links and masses.;
#X text 636 320 if no \$2 arg is provided \, then L is set to curent
length;
#X text 489 750 if only 1 argument is provided \, message generally
uses this argument as the value applayed to all masses (or link);
#X text 604 497 do not compute a link anymore;
#X text 603 586 Change the overdamp of a link. i.e a strange parametter
that amplifies forces that oppose to movment. Use at your own risk.
;
#X text 603 209 Set initial length of link(s);
#X text 611 266 Set initial length of link(s);
#X text 639 136 \$2 : New value (float or table);
#X text 639 192 \$2 : New value (float or table);
#X text 639 245 \$2 : New value (float or table);
#X text 631 642 \$2 : overdamp value (float or table);
#X text 183 690 \$2 : damping (float or table);
#X text 184 629 \$1 : damping (float or table);
#X restore 12 477 pd dynamic settings ___;
#N canvas 573 185 571 697 creation____________ 0;
#X obj 11 95 cnv 15 100 60 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 5 75 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 5 3 cnv 15 550 15 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 7 2 CREATION Messages;
#X obj 9 191 cnv 15 240 140 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 4 167 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X obj 10 361 cnv 15 240 330 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 3 338 cnv 15 550 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X msg 32 104 reset;
#X text 262 197 Add a mass;
#X text 290 220 \$1 : Id (symbol);
#X text 289 240 \$2 : fixed or mobile (0/1);
#X text 289 258 \$3 : mass;
#X msg 23 197 mass \$1 \$2 \$3 \$4;
#X text 289 276 \$4 : initial position;
#X text 7 167 Masses :;
#X text 7 74 Reset :;
#X text 129 105 Delete all masses \, links and internal variables;
#X text 6 338 Links :;
#X text 291 390 \$1 : Id (symbol);
#X text 291 390 \$1 : Id (symbol);
#X text 291 443 \$4 : rigidity;
#X text 291 408 \$2 : creation No/Id of mass1;
#X text 291 426 \$3 : creation No/Id of mass2;
#X text 266 371 Add link(s);
#X text 291 461 \$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 20 549 tabLink \$1 \$2 \$3 \$4 \$5 \$6 \$7;
#X text 292 565 \$1 : Id (symbol);
#X text 292 565 \$1 : Id (symbol);
#X text 292 583 \$2 : creation No/Id of mass1;
#X text 292 601 \$3 : creation No/Id of mass2;
#X text 261 549 Add non linear link(s);
#X text 292 618 \$4 : table name for the rigidity;
#X text 292 636 \$5 : length of the table;
#X text 292 654 \$6 : table name for the damping;
#X text 292 672 \$7 : length of the table;
#X msg 33 130 print;
#X msg 19 371 link \$1 \$2 \$3 \$4 \$5 [\$6 [\$7 [\$8 ]]];
#X text 128 130 post current physical model topology;
#X text 287 498 [\$7] : minimum lenght of link;
#X text 288 515 [\$8] : maximum lenght of link;
#X text 288 479 [\$6] : Power of the rigidity distance;
#X restore 12 457 pd creation____________;
#N canvas 50 82 901 640 More_Info 0;
#X text 96 12 pmpd : mass - spring - damper model;
#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 50 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 113 82 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 50 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 50 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 50 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 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 496 206 x1x2 + y1y2 = 0;
#X text 495 169 For normal vectors \, the direction is calculated using
the scalar product :;
#X text 495 248 You can build specific links using different link messages
defining the characteristic step by step.;
#X text 28 41 pmpd is the 2D object of the pmpd objects collection.
;
#X text 27 155 Be careful : if masses are deleted \, list messages
won't work;
#X text 27 216 Rigidity \, damping and power are defined by the creation
messages. The lenght is initialised to the distance between the two
masses at creation.;
#X text 27 257 Links can be created in one shot between multiple masses
\, instead of creation number \, the masses linked are defined by their
Id.;
#X text 28 187 Links connect masses two by two. They've got 4 physical
parameters : length \, rigidity \, damping and power.;
#X text 27 60 It is designed to implement particle physical models
in PD.The model is based on a two element type : mass and link. The
pmpd masses are the principal objects of the model. They've got only
one physical parameter \, the value of their mass. They can be mobile
or fixed \, in this case forces applied to them automatically \, by
links \, or manually \, by messages \, don't do anything.;
#X connect 1 0 2 0;
#X restore 18 715 pd More_Info;
#N canvas 422 178 607 825 masses_attributes___ 0;
#X obj 5 3 cnv 15 590 15 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 7 307 cnv 15 150 100 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 5 286 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 7 2 ATTRIBUTES Messages;
#X text 8 286 Lists :;
#X text 168 320 Output all masses positions in a list on outlet;
#X text 169 341 Output all forces applied on masses in a list on outlet
;
#X text 170 362 Output all speeds of the masses in a list on outlet
;
#X obj 8 435 cnv 15 150 95 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 8 414 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 206 383 \$1 (optional): Masses Id;
#X obj 9 658 cnv 15 150 150 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 9 637 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 172 666 output the closest mass;
#X text 201 680 \$1 : position;
#X text 12 637 others :;
#X msg 17 666 closestMass \$1 (\$2);
#X text 201 695 \$2 : none or Id;
#X obj 5 75 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 7 74 General :;
#X obj 6 98 cnv 15 150 180 empty empty empty 20 12 0 14 -233017 -66577
0;
#X msg 14 105 massPos [\$1];
#X text 195 123 massPos symbolId number posX posY posZ;
#X text 197 184 massPos symbolId number speedX speedY speedZ;
#X msg 14 224 massForce [\$1];
#X text 201 238 massPos symbolId number forceX forceY forceZ;
#X msg 14 165 massSpeed [\$1];
#X obj 9 538 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 202 592 \$1 : table name;
#X text 201 611 \$2 : masses name;
#X obj 10 559 cnv 15 150 70 empty empty empty 20 12 0 14 -233017 -66577
0;
#X msg 21 566 forceXT \$1 [\$2];
#X text 12 538 Table in:;
#X msg 16 717 massDistance [\$1 [\$2]];
#X text 199 732 distance mass1 mass2 distanceX \, distanceY \, distanceZ
\, distance;
#X msg 17 320 massPosL (\$1);
#X msg 17 340 massForceL (\$1);
#X msg 17 360 massSpeedL (\$1);
#X msg 19 445 massPosT \$1 (\$2);
#X msg 19 465 massForceT \$1 (\$2);
#X msg 19 485 massSpeedT \$1 (\$2);
#X text 193 140 \$1 : Id float or symbol of masses (nothing for all)
;
#X text 196 200 \$1 : Id float or symbol of masses (nothing for all)
;
#X text 200 253 \$1 : Id float or symbol of masses (nothing for all)
;
#X text 165 106 output a message for every mass :;
#X text 166 168 output a message for every mass :;
#X text 169 225 output a message for every mass :;
#X text 15 30 The attributes messages ask the object to output some
of its internal parameters. They can be output as lists for positions
and forces of masses.;
#X text 170 569 apply a force to masses. Force comes from a table;
#X text 175 718 output a series of messages :;
#X text 11 414 Tables out:;
#X text 167 444 Output all masses positions on a table;
#X text 167 465 Output all forces applied on masses on a table;
#X text 167 485 Output all speeds of the masses on a table;
#X text 200 517 \$2 (optional): Masses Id);
#X text 200 502 \$1 = table name;
#X text 197 760 \$1 (optional): Masses Id;
#X text 197 776 \$2 (optional): Masses Id;
#X restore 12 497 pd masses_attributes___;
#N canvas 410 289 631 464 statistics 0;
#X obj 20 41 cnv 15 170 150 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 19 21 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 260 196 \$1 : none or Id;
#X text 202 119 output the standard deviation of masses force;
#X text 202 166 output the standard deviation of masses velocity;
#X text 22 21 masses :;
#X obj 23 247 cnv 15 170 180 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 23 227 cnv 15 590 15 empty empty empty 20 12 0 14 -158509 -66577
0;
#X text 246 434 \$1 : none or Id;
#X text 209 316 output the standard deviation of links length;
#X text 208 358 output the standard deviation of links center position
velocity;
#X text 209 405 output the standard deviation of links length change
;
#X text 26 227 links :;
#X text 201 51 output the average position of masses;
#X text 202 74 output the standard deviation of masses position;
#X text 202 143 output the average velocity of masses;
#X text 208 254 output the average position of links center;
#X text 208 297 output the average links length;
#X text 208 336 output the average center position velocity of links
;
#X text 209 385 output the average change in links length;
#X text 201 96 output the average force applied to masses;
#X text 208 274 output the standard deviation of links center position
;
#X msg 30 51 massPosMean [\$1];
#X msg 30 74 massPosStd [\$1];
#X msg 31 165 massSpeedStd [\$1];
#X msg 31 120 massForceStd [\$1];
#X msg 30 97 massForceMean [\$1];
#X msg 31 143 massSpeedMean [\$1];
#X msg 34 254 linkPosMean [\$1];
#X msg 34 275 linkPosStd [\$1];
#X msg 34 296 linkLengthMean [\$1];
#X msg 34 317 linkLengthStd [\$1];
#X msg 34 338 linkPosSpeedMean [\$1];
#X msg 34 358 linkPosSpeedStd [\$1];
#X msg 34 384 linkLengthSpeedMean [\$1];
#X msg 34 405 linkLengthSpeedStd [\$1];
#X restore 12 537 pd statistics _________;
#X text 161 539 To get statistical data of the simulation.;
#X text 101 388 Bang - A bang at the left inlet computes the new model
state based on previous time step.;
#X text 160 498 To get the model parameters (masses).;
#X text 161 518 To get the model parameters (links).;
#X text 9 691 KEYWORDS: physical model \, mass \, spring \, damper
\, link;
#X connect 20 0 44 0;
#X connect 21 0 24 0;
#X connect 24 0 23 0;
#X connect 26 0 25 0;
#X connect 27 0 29 0;
#X connect 28 0 18 0;
#X connect 29 0 32 0;
#X connect 32 0 21 0;
#X connect 32 1 22 0;
#X connect 32 2 30 0;
#X connect 32 3 31 0;
#X connect 44 0 19 0;
#X connect 47 0 26 0;