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
|
#N canvas 121 260 866 562 10;
#N canvas 334 79 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 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;
#X obj 4 17 bng 20 250 50 0 empty empty load 0 -6 0 8 -258699 -1 -1
;
#X obj 34 17 bng 20 250 50 0 empty empty saveas 0 -6 0 8 -24198 -1
-1;
#X obj 101 60 savepanel;
#X obj 50 168 s pd-data;
#X msg 101 115 write \$1;
#X obj 20 91 openpanel;
#X msg 20 115 read \$1;
#X obj 20 138 t b a;
#X obj 20 195 s \$0-generate;
#X obj 79 17 bng 20 250 50 0 empty empty save 0 -6 0 8 -241291 -1 -1
;
#X obj 100 91 symbol;
#X connect 1 0 6 0;
#X connect 2 0 3 0;
#X connect 3 0 11 0;
#X connect 5 0 4 0;
#X connect 6 0 7 0;
#X connect 6 0 11 1;
#X connect 7 0 8 0;
#X connect 8 0 9 0;
#X connect 8 1 4 0;
#X connect 10 0 11 0;
#X connect 11 0 5 0;
#X coords 0 0 1 1 102 44 1;
#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;
#X obj 330 145 outlet;
#X text 91 57 First build masses \, then links!!;
#X obj 234 285 outlet;
#N canvas 629 18 551 784 fix-mass-ids 0;
#X obj 43 72 t b b b b b b b;
#X msg 79 168 traverse pd-data \, next;
#X obj 79 200 pointer mass;
#X obj 143 103 s \$0-reset-counter;
#N canvas 331 520 708 349 counter 0;
#X obj 156 125 f 0;
#X msg 172 102 0;
#X obj 172 74 r \$0-reset-counter;
#X obj 188 125 + 1;
#X obj 156 179 outlet;
#X obj 156 50 inlet;
#X connect 0 0 3 0;
#X connect 0 0 4 0;
#X connect 1 0 0 1;
#X connect 2 0 1 0;
#X connect 3 0 0 1;
#X connect 5 0 0 0;
#X restore 96 298 pd counter;
#X obj 96 396 set mass mid;
#X text 176 200 At end: fix links!;
#X obj 186 300 get mass mid;
#X obj 79 247 t b b b b p p;
#X obj 211 375 pack 0 0;
#X obj 211 404 tabwrite \$0-mid2msdid;
#X text 125 434 Store a mapping mid => msdid for fixing links later
;
#X obj 43 24 inlet;
#X obj 158 221 outlet;
#X text 96 52 Avoid stack overflow lops;
#X obj 85 23 r \$0-stack-delay;
#X obj 16 228 ds-next;
#X obj 43 51 del 0;
#X connect 0 5 1 0;
#X connect 0 6 3 0;
#X connect 1 0 2 0;
#X connect 2 0 8 0;
#X connect 2 1 16 0;
#X connect 2 2 13 0;
#X connect 4 0 9 0;
#X connect 4 0 5 0;
#X connect 7 0 9 1;
#X connect 8 0 16 0;
#X connect 8 1 4 0;
#X connect 8 4 7 0;
#X connect 8 5 5 1;
#X connect 9 0 10 0;
#X connect 12 0 17 0;
#X connect 15 0 17 1;
#X connect 16 0 2 0;
#X connect 17 0 0 0;
#X restore 244 173 pd fix-mass-ids;
#N canvas 403 15 685 826 fix-links 0;
#X obj 139 158 t b b b b b b b;
#X msg 175 254 traverse pd-data \, next;
#X obj 239 189 s \$0-reset-counter;
#X obj 175 284 pointer liaison;
#X text 293 285 At end: make links in msd*!;
#X obj 192 420 tabread \$0-mid2msdid;
#X obj 192 482 set liaison mid1 mid2;
#X obj 343 418 tabread \$0-mid2msdid;
#X obj 192 389 get liaison mid1 mid2;
#X obj 175 333 t b b b b p p;
#X obj 139 70 inlet;
#X obj 275 312 outlet;
#X text 192 106 Avoid stack overflow lops;
#X obj 188 68 r \$0-stack-delay;
#X obj 113 282 ds-next;
#X obj 139 105 del 0;
#X connect 0 5 1 0;
#X connect 1 0 3 0;
#X connect 3 0 9 0;
#X connect 3 1 14 0;
#X connect 3 2 11 0;
#X connect 5 0 6 0;
#X connect 7 0 6 1;
#X connect 8 0 5 0;
#X connect 8 1 7 0;
#X connect 9 0 14 0;
#X connect 9 4 8 0;
#X connect 9 5 6 2;
#X connect 10 0 15 0;
#X connect 13 0 15 1;
#X connect 14 0 3 0;
#X connect 15 0 0 0;
#X restore 244 196 pd fix-links;
#N canvas 236 8 602 856 get-masses 0;
#X obj 148 80 t b b b b b b b;
#X msg 184 176 traverse pd-data \, next;
#X obj 184 206 pointer mass;
#X obj 325 385 select 0;
#X msg 365 410 0;
#X msg 324 409 1;
#X obj 248 111 s \$0-reset-counter;
#X msg 248 131 const 0;
#X obj 248 152 s \$0-mid;
#X obj 310 152 s \$0-msdid;
#X text 44 397 At end: start 2nd pass;
#X obj 148 31 inlet;
#X obj 214 494 outlet;
#X obj 81 435 outlet;
#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 obj 120 251 ds-next;
#X connect 0 5 1 0;
#X connect 0 6 6 0;
#X connect 0 6 7 0;
#X connect 1 0 2 0;
#X connect 2 0 16 0;
#X connect 2 1 18 0;
#X connect 2 2 13 0;
#X connect 3 0 5 0;
#X connect 3 1 4 0;
#X connect 4 0 15 3;
#X connect 5 0 15 3;
#X connect 7 0 8 0;
#X connect 7 0 9 0;
#X connect 11 0 0 0;
#X connect 14 0 17 0;
#X connect 14 1 17 1;
#X connect 14 2 15 2;
#X connect 14 3 3 0;
#X connect 14 4 15 4;
#X connect 15 0 12 0;
#X connect 16 0 18 0;
#X connect 16 1 14 0;
#X connect 17 0 15 0;
#X connect 17 1 15 1;
#X connect 18 0 2 0;
#X restore 244 115 pd get-masses;
#N canvas 0 0 768 708 make-links 0;
#X obj 316 252 pointer liaison;
#X msg 354 227 traverse pd-data \, bang;
#X obj 286 274 t b p;
#X obj 334 374 outlet;
#X obj 354 170 inlet;
#X obj 192 389 outlet;
#X text 142 412 Now set lid field of links.;
#X obj 316 298 get liaison mid1 mid2 K D D2;
#X obj 334 341 pack 0 0 0 0 0;
#X text 407 200 Avoid stack overflow lops;
#X obj 399 167 r \$0-stack-delay;
#X obj 286 226 ds-next;
#X obj 354 201 del 0;
#X connect 0 0 2 0;
#X connect 0 1 11 0;
#X connect 0 2 5 0;
#X connect 1 0 0 0;
#X connect 2 0 11 0;
#X connect 2 1 7 0;
#X connect 4 0 12 0;
#X connect 7 0 8 0;
#X connect 7 1 8 1;
#X connect 7 2 8 2;
#X connect 7 3 8 3;
#X connect 7 4 8 4;
#X connect 8 0 3 0;
#X connect 10 0 12 1;
#X connect 11 0 0 0;
#X connect 12 0 1 0;
#X restore 148 257 pd make-links;
#X text 284 418 TABLES USED:;
#X text 364 174 Change DS mass ids to match msdIds \, store mid2msdid
mapping;
#X text 366 196 Fix mid1 and mid2 in links to match what msd2D thinks
is right.;
#X text 257 258 Create messages to msd2D to create links;
#N canvas 209 87 622 579 set-lid 0;
#X obj 162 163 r \$0-msd-attr;
#X obj 288 201 s \$0-msd;
#X obj 162 203 spigot;
#X msg 292 129 1;
#X msg 236 127 0;
#X obj 238 22 inlet;
#X obj 238 93 t b b b b b;
#X obj 310 307 pointer liaison;
#X msg 310 281 traverse pd-data \, next;
#X msg 288 163 infosL;
#X obj 162 231 route Link;
#X obj 145 254 t b a;
#X text 105 394 This will move around the links \, but it's not critical
as long as we have the same number of graphical links as we have inside
the msd2D object. And we'd better damn sure should have the same amount
\, otherwise somethings went really \, really wrong and took a bad
turn and crashed the car and left the toilet seat open.;
#X text 104 481 Shouldn't happen.;
#X msg 175 332 \$1 \$3 \$4 \$5 \$6 \$7;
#X obj 175 357 set liaison lid mid1 mid2 K D D2;
#X text 291 52 Avoid stack overflow lops;
#X obj 287 21 r \$0-stack-delay;
#X obj 219 307 ds-next;
#X msg 260 281 next;
#X obj 74 351 print set-lid;
#X obj 238 51 del 0;
#X connect 0 0 2 0;
#X connect 2 0 10 0;
#X connect 3 0 2 1;
#X connect 4 0 2 1;
#X connect 5 0 21 0;
#X connect 6 1 4 0;
#X connect 6 2 9 0;
#X connect 6 3 3 0;
#X connect 6 4 8 0;
#X connect 7 0 15 6;
#X connect 7 1 19 0;
#X connect 8 0 7 0;
#X connect 9 0 1 0;
#X connect 10 0 11 0;
#X connect 11 0 19 0;
#X connect 11 1 14 0;
#X connect 14 0 15 0;
#X connect 14 0 20 0;
#X connect 17 0 21 1;
#X connect 19 0 7 0;
#X connect 21 0 6 0;
#X restore 148 322 pd set-lid;
#X text 238 322 Correct lids to match what msd2D tells us;
#X obj 146 446 table \$0-mid2msdid 4000;
#X text 354 111 First get masses positions \, send to msd2D;
#X text 324 446 mass id as index \, msdid as value. Size 4000 taken
from the #define in msd sources.;
#X connect 0 0 6 0;
#X connect 4 0 5 0;
#X connect 5 0 7 0;
#X connect 6 0 4 0;
#X connect 6 1 1 0;
#X connect 7 0 12 0;
#X connect 7 1 3 0;
#X restore 131 221 pd getter;
#X obj 131 369 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 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;
#X connect 3 1 5 1;
#X connect 3 2 5 2;
#X connect 4 0 0 0;
#X connect 5 0 4 0;
#X connect 6 0 12 0;
#X connect 8 0 7 0;
#X connect 8 1 3 0;
#X connect 9 0 10 0;
#X connect 9 0 18 0;
#X connect 11 0 2 0;
#X connect 12 0 6 0;
#X connect 12 0 8 0;
#X connect 12 1 6 0;
#X connect 12 1 14 0;
#X connect 12 2 6 0;
#X connect 13 0 16 0;
#X connect 14 0 19 0;
#X connect 14 1 15 0;
#X connect 15 0 13 0;
#X connect 15 1 13 1;
#X connect 15 2 13 2;
#X connect 16 0 17 0;
#X restore 112 428 pd make-setters;
#X obj 181 344 r pointer2msd;
#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;
#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 468 pd set-min-max;
#X text 283 344 <== messages coming from the data structure setters
;
#X obj 112 399 del 200;
#X connect 0 0 8 0;
#X connect 0 1 9 0;
#X connect 2 0 3 0;
#X connect 4 0 12 0;
#X connect 4 1 0 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 12 0 5 0;
#X restore 30 343 pd generator;
#N canvas 0 0 718 819 activate 0;
#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 216 bang \, get massesPos \, get linksPos;
#X obj 177 125 gemhead;
#X obj 233 396 route massesPos linksPos;
#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 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 559 sent to the data struct pointers;
#X obj 167 149 t b b;
#X obj 197 193 s pollpos;
#X obj 167 44 inlet data_only;
#X obj 41 314 inlet GEM;
#X obj 341 40 inlet speed;
#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 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 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;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 6 0 0 0;
#X connect 7 0 22 0;
#X connect 8 0 19 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;
#X connect 13 1 10 0;
#X connect 14 0 13 0;
#X connect 14 0 19 1;
#X connect 14 0 20 1;
#X connect 14 0 34 0;
#X connect 18 0 33 0;
#X connect 18 0 37 0;
#X connect 19 0 4 0;
#X connect 20 0 5 0;
#X connect 22 0 6 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;
#X connect 27 0 28 0;
#X connect 28 0 18 0;
#X connect 29 0 14 0;
#X connect 29 1 27 0;
#X connect 30 0 31 0;
#X connect 31 0 14 0;
#X connect 32 0 18 0;
#X connect 32 1 30 0;
#X connect 33 0 35 0;
#X connect 34 0 36 0;
#X connect 37 0 22 0;
#X connect 38 0 4 1;
#X connect 39 0 5 1;
#X connect 40 0 9 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 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_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_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 restore 521 67 pd setter;
#N canvas 0 0 822 675 lsetter 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_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 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;
#X obj 143 336 r \$0-msd-out;
#X obj 143 391 s MSD-OUT-GLOBAL;
#X msg 532 223 massesPosL;
#X obj 532 199 metro 40;
#X obj 532 177 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X floatatom 585 178 5 0 0 0 - - -;
#X obj 280 365 spigot;
#X obj 317 312 tgl 15 0 empty empty global-receive 0 -6 0 8 -262144
-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 obj 28 133 nbx 5 14 -1e+37 1e+37 0 0 \$0-delay-stack empty delay-stack
0 -6 0 10 -262144 -1 -1 0 256;
#X text 25 92 If you experience stack overflows \, try setting this
larger than 10;
#X connect 1 0 0 0;
#X connect 2 0 1 1;
#X connect 3 0 1 0;
#X connect 4 0 6 0;
#X connect 5 0 4 1;
#X connect 7 0 4 0;
#X connect 12 0 15 0;
#X connect 13 0 12 1;
#X connect 14 0 12 0;
#X connect 17 0 16 0;
#X connect 18 0 21 0;
#X connect 19 0 18 1;
#X connect 20 0 18 0;
#X connect 22 0 16 0;
#X connect 23 0 22 0;
#X connect 24 0 23 0;
#X connect 25 0 23 1;
#X connect 26 0 29 0;
#X connect 27 0 26 1;
#X connect 28 0 26 0;
#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 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 423 517 576 613 forces 0;
#X obj 295 415 s \$0-msd;
#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 6350 1;
#X msg 295 388 forceY id \$1;
#X msg 391 388 forceX id \$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
0 1;
#X obj 295 205 metro 10;
#X obj 391 326 metro 10;
#X msg 455 325 0;
#X msg 263 204 0;
#X text 230 127 Add some forces to the system.;
#X msg 63 158 forceX \$2 \$1;
#X msg 63 272 forceY \$2 \$1;
#X obj 63 137 pack 0 0;
#X floatatom 114 114 5 0 0 2 Mass_ID - -;
#X obj 63 249 pack 0 0;
#X floatatom 63 115 5 0 0 0 forceX - -;
#X floatatom 63 204 5 0 0 0 forceY - -;
#X obj 63 299 s \$0-msd;
#X obj 63 181 s \$0-msd;
#X obj 63 224 * -1;
#X obj 63 461 pack 0 0;
#X floatatom 63 437 5 0 0 0 posY - -;
#X obj 63 511 s \$0-msd;
#X msg 63 484 posY \$2 \$1;
#X obj 63 358 pack 0 0;
#X floatatom 63 334 5 0 0 0 posX - -;
#X obj 63 408 s \$0-msd;
#X msg 63 381 posX \$2 \$1;
#X text 31 74 Modify one mass:;
#X connect 1 0 4 0;
#X connect 2 0 3 0;
#X connect 3 0 0 0;
#X connect 4 0 0 0;
#X connect 5 0 7 0;
#X connect 6 0 8 0;
#X connect 7 0 2 0;
#X connect 8 0 1 0;
#X connect 9 0 1 0;
#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 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 -225280
-1 -1 0 1;
#X obj 296 524 tgl 15 0 \$0-gem-links-on empty gem_l 0 -6 0 8 -225271
-1 -1 0 1;
#N canvas 779 673 450 300 props 0;
#X obj 117 204 s \$0-msd;
#X obj 117 46 vsl 15 64 0 10 0 0 empty empty D 0 -8 0 8 -262144 -1
-1 0 1;
#X obj 141 46 vsl 15 64 0 10 0 0 empty empty D2 0 -8 0 8 -262144 -1
-1 0 1;
#X obj 90 46 vsl 15 64 0 100 0 0 empty empty K 0 -8 0 8 -262144 -1
-1 0 1;
#X msg 90 175 setK ml \$1;
#X msg 117 151 setD ml \$1;
#X msg 141 122 setD2 ml \$1;
#X text 192 47 Edit properties of Links.;
#X connect 1 0 5 0;
#X connect 2 0 6 0;
#X connect 3 0 4 0;
#X connect 4 0 0 0;
#X connect 5 0 0 0;
#X connect 6 0 0 0;
#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 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 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 1 1;
#X obj 765 106 tgl 15 0 \$0-set-ds \$0-set-ds set-ds 0 -6 0 8 -225271
-1 -1 1 1;
#X text 669 75 Data struct anim ON/OFF:;
#N canvas 504 489 531 315 TODO 0;
#X text 146 11 TODO :: IDEAS;
#X text 41 92 Make symbolic ids of new masses/links editable. For this
I need to add new fields \, probably called "sym" \, to masses and
links. They have to be floats for now (symbols in DS don't work yet).
Then [makefilename] symbolic ids of this.;
#X text 41 48 Save/load of MSD messages: Route [r \$0-msd] to a [textfile]
or [qlist];
#X text 41 164 Related to that the props and forces subpatches should
be dynamic as well \, so that users can send messages to groups of
masses/links using the different symbolic names.;
#X restore 777 529 pd TODO;
#N canvas 307 452 509 305 NEWS 0;
#X text 42 52 Hopefully fixed the "stack overflows" when creating lots
of masses.;
#X text 32 24 RecentChanges;
#X text 39 90 Geos: Now it's possible to add masses in geometric formations:
rectangles (2d-networks) and circles (set center point \, radius and
number of masses).;
#X restore 777 508 pd NEWS;
#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 26 0 25 0;
#X connect 27 0 25 0;
|