aboutsummaryrefslogtreecommitdiff
path: root/msd2D/editor/msd2d-editor.pd
blob: 656624951c8dc7ad25b45c7f3f3e7755c7965f09 (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
#N canvas 130 52 866 562 10;
#N canvas 610 84 617 552 data 1;
#X restore 735 71 pd data;
#X obj 56 517 structures;
#X msg 152 72 \; pd-data clear;
#X obj 62 308 bng 24 250 50 0 empty \$0-generate generate 0 -6 0 8
-24198 -1 -1;
#X text 57 493 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 62 17 bng 20 250 50 0 empty empty save_as 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 33 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 723 150 pd save;
#X text 728 46 Edit here:;
#N canvas 257 131 781 748 generator 0;
#N canvas 210 99 931 555 getter 0;
#X obj 244 89 inlet;
#X obj 244 141 outlet;
#X text 91 57 First build masses \, then links!!;
#X obj 148 281 outlet;
#N canvas 403 15 685 826 fix-mass-ids 0;
#X obj 139 158 t b b b b b b b;
#X msg 175 254 traverse pd-data \, next;
#X msg 116 316 next;
#X obj 175 284 pointer mass;
#X obj 239 189 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 192 384 pd counter;
#X obj 192 420 tabread \$0-msdid;
#X obj 192 482 set mass mid;
#X text 272 286 At end: fix links!;
#X obj 282 386 get mass mid;
#X obj 175 333 t b b b b p p;
#X obj 307 461 pack 0 0;
#X obj 307 490 tabwrite \$0-mid2msdid;
#X text 269 520 Store a mapping mid => msdid for fixing links later
;
#X obj 139 116 inlet;
#X obj 254 307 outlet;
#X connect 0 5 1 0;
#X connect 0 6 4 0;
#X connect 1 0 3 0;
#X connect 2 0 3 0;
#X connect 3 0 10 0;
#X connect 3 1 2 0;
#X connect 3 2 15 0;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 6 0 11 0;
#X connect 9 0 11 1;
#X connect 10 0 2 0;
#X connect 10 1 5 0;
#X connect 10 4 9 0;
#X connect 10 5 7 1;
#X connect 11 0 12 0;
#X connect 14 0 0 0;
#X restore 330 177 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 msg 116 316 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 128 inlet;
#X obj 275 312 outlet;
#X connect 0 5 1 0;
#X connect 1 0 4 0;
#X connect 2 0 4 0;
#X connect 4 0 10 0;
#X connect 4 1 2 0;
#X connect 4 2 12 0;
#X connect 6 0 7 0;
#X connect 8 0 7 1;
#X connect 9 0 6 0;
#X connect 9 1 8 0;
#X connect 10 0 2 0;
#X connect 10 4 9 0;
#X connect 10 5 7 2;
#X connect 11 0 0 0;
#X restore 330 200 pd fix-links;
#N canvas 0 0 920 707 get-masses 0;
#X obj 228 162 t b b b b b b b;
#X msg 264 258 traverse pd-data \, next;
#X msg 215 362 next;
#X obj 264 288 pointer mass;
#X obj 458 455 select 0;
#X msg 498 480 0;
#X msg 457 479 1;
#X obj 328 193 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 364 362 pd counter;
#X obj 264 337 t b b b b p p b;
#X obj 364 385 s \$0-current-mass-idx;
#X obj 437 537 s \$0-current-mid;
#X msg 328 213 const 0;
#X obj 328 234 s \$0-mid;
#X obj 390 234 s \$0-msdid;
#X text 575 330 At end: start 2nd pass;
#X obj 228 113 inlet;
#X obj 347 564 outlet;
#X obj 656 566 r \$0-current-mass-idx;
#X obj 605 539 r \$0-current-mid;
#X obj 605 616 tabwrite \$0-mid;
#X obj 605 592 pack 0 0;
#X text 598 515 Write old mids to table;
#X obj 605 640 print mass-as-in-struct;
#X obj 612 368 outlet;
#X obj 347 432 get mass x y mid mob M;
#X obj 347 514 pack 0 0 0 0 0;
#X connect 0 5 1 0;
#X connect 0 6 7 0;
#X connect 0 6 12 0;
#X connect 1 0 3 0;
#X connect 2 0 3 0;
#X connect 3 0 9 0;
#X connect 3 1 2 0;
#X connect 3 2 24 0;
#X connect 4 0 6 0;
#X connect 4 1 5 0;
#X connect 5 0 26 3;
#X connect 6 0 26 3;
#X connect 8 0 10 0;
#X connect 9 0 2 0;
#X connect 9 5 25 0;
#X connect 9 6 8 0;
#X connect 12 0 13 0;
#X connect 12 0 14 0;
#X connect 16 0 0 0;
#X connect 18 0 21 1;
#X connect 19 0 21 0;
#X connect 21 0 20 0;
#X connect 21 0 23 0;
#X connect 25 0 26 0;
#X connect 25 1 26 1;
#X connect 25 2 11 0;
#X connect 25 2 26 2;
#X connect 25 3 4 0;
#X connect 25 4 26 4;
#X connect 26 0 17 0;
#X restore 244 115 pd get-masses;
#N canvas 0 0 768 708 make-links 0;
#X obj 156 229 pointer liaison;
#X msg 156 203 next;
#X msg 194 204 traverse pd-data \, bang;
#X obj 126 251 t b p;
#X obj 174 351 outlet;
#X obj 194 147 inlet;
#X obj 388 303 outlet;
#X text 440 302 Now set lid field of links.;
#X obj 156 275 get liaison mid1 mid2 K D D2;
#X obj 174 318 pack 0 0 0 0 0;
#X connect 0 0 3 0;
#X connect 0 1 1 0;
#X connect 0 2 6 0;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 1 0;
#X connect 3 1 8 0;
#X connect 5 0 2 0;
#X connect 8 0 9 0;
#X connect 8 1 9 1;
#X connect 8 2 9 2;
#X connect 8 3 9 3;
#X connect 8 4 9 4;
#X connect 9 0 4 0;
#X restore 148 257 pd make-links;
#N canvas 0 0 590 588 get-ids-from-msd 0;
#X obj 176 209 r \$0-msd-attr;
#X msg 287 189 infosL;
#X obj 176 277 route Mass;
#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 206 324 pd counter;
#X obj 176 301 t a b;
#X obj 287 233 s \$0-msd;
#X obj 176 249 spigot;
#X msg 347 187 1;
#X msg 237 185 0;
#X obj 176 350 pack 0 0;
#X obj 176 374 tabwrite \$0-msdid;
#X obj 176 412 print mass-as-in-msd;
#X msg 176 325 \$1;
#X obj 239 151 t b b b b;
#X obj 239 120 inlet;
#X obj 94 208 outlet;
#X text 71 167 Then fix mass ids;
#X connect 0 0 6 0;
#X connect 1 0 5 0;
#X connect 2 0 4 0;
#X connect 3 0 9 1;
#X connect 4 0 12 0;
#X connect 4 1 3 0;
#X connect 6 0 2 0;
#X connect 7 0 6 1;
#X connect 8 0 6 1;
#X connect 9 0 10 0;
#X connect 9 0 11 0;
#X connect 12 0 9 0;
#X connect 13 0 15 0;
#X connect 13 1 8 0;
#X connect 13 2 1 0;
#X connect 13 3 7 0;
#X connect 14 0 13 0;
#X restore 330 151 pd get-ids-from-msd;
#X text 569 416 TABLES USED:;
#X text 639 457 ordered mass ids;
#X text 639 481 ordered mass ids as in [msd*];
#X text 639 510 mass id as index \, msdid as value;
#X text 354 111 First get masses positions \, send to msd2D \, store
in table mid;
#X text 482 152 Then get numercial ids from msd2D \, store in table
msdid;
#X text 484 174 Change DS mass ids to match msdIds \, store mid2msdid
mapping;
#X text 480 200 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 62 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 msg 272 307 next;
#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 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 6 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 16 6;
#X connect 7 1 11 0;
#X connect 8 0 7 0;
#X connect 9 0 1 0;
#X connect 10 0 12 0;
#X connect 11 0 7 0;
#X connect 12 0 11 0;
#X connect 12 1 15 0;
#X connect 15 0 16 0;
#X restore 234 286 pd set-lid;
#X text 314 284 Correct lids to match what msd2D tells us;
#X obj 475 458 table \$0-mid 4000;
#X obj 459 484 table \$0-msdid 4000;
#X obj 433 512 table \$0-mid2msdid 4000;
#X connect 0 0 6 0;
#X connect 4 0 5 0;
#X connect 5 0 7 0;
#X connect 6 0 1 0;
#X connect 6 1 8 0;
#X connect 7 0 3 0;
#X connect 7 1 18 0;
#X connect 8 0 4 0;
#X restore 131 221 pd getter;
#X obj 131 369 s \$0-msd;
#X msg 175 154 reset;
#X obj 175 200 s \$0-msd;
#X msg 175 175 Xmin 0 \, Xmax 800 \, Ymin 0 \, Ymax 800;
#X msg 368 473 mass fix 0 100 \$1 \$2;
#X obj 112 132 t b b b b;
#N canvas 376 279 682 601 make-setters 0;
#X obj 236 443 s pd-setter;
#X msg 206 213 traverse pd-data \, next;
#X obj 168 109 t b b b b;
#X obj 236 329 get mass x y mid;
#X msg 236 396 obj \$1 \$2 mass-set \$3;
#X obj 236 352 pack 0 0 0;
#X msg 151 239 next;
#X obj 145 327 s mypointer;
#X obj 206 272 t p p;
#X msg 226 135 clear;
#X obj 226 160 s pd-setter;
#X obj 168 68 inlet;
#X obj 206 240 pointer mass liaison;
#X obj 480 365 pack 0 0 0;
#X obj 389 294 t p p;
#X obj 480 342 get liaison x1 y1 lid;
#X msg 480 409 obj \$1 \$2 link-set \$3;
#X obj 480 454 s pd-lsetter;
#X obj 226 186 s pd-lsetter;
#X obj 373 342 s myliapointer;
#X connect 1 0 12 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 401 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;
#X connect 0 0 10 0;
#X connect 0 1 11 0;
#X connect 2 0 3 0;
#X connect 4 0 3 0;
#X connect 6 0 7 0;
#X connect 6 1 0 0;
#X connect 6 2 4 0;
#X connect 6 3 2 0;
#X connect 8 0 1 0;
#X connect 9 0 6 0;
#X connect 10 0 1 0;
#X connect 11 0 1 0;
#X restore 62 337 pd generator;
#N canvas 0 0 718 819 activate 0;
#X obj 233 284 msd2D;
#X obj 233 215 r \$0-msd;
#X msg 317 213 infosL;
#X msg 300 256 get linksPos;
#X obj 233 449 gem_masses;
#X obj 313 445 gem_links;
#X msg 167 193 bang \, get massesPos \, get linksPos;
#X obj 177 125 gemhead;
#X obj 233 396 route massesPos linksPos;
#X obj 139 498 gemwin;
#X msg 139 447 create \, 1;
#X msg 139 471 0 \, destroy;
#X msg 315 233 forceX id 200;
#X obj 249 354 s \$0-msd-out;
#X obj 139 425 select 1 0;
#X obj 139 397 tgl 24 0 empty empty GEM 0 -6 0 8 -262144 -1 -1 0 1
;
#X obj 279 301 s \$0-msd-attr;
#X obj 233 510 s masspositions;
#X obj 313 488 s linkspositions;
#X obj 167 69 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#X obj 233 421 spigot;
#X obj 313 421 spigot;
#X text 238 532 sent to the data struct pointers;
#X obj 167 149 t b b;
#X obj 197 172 s pollpos;
#X obj 167 44 inlet data_only;
#X obj 81 316 inlet GEM;
#X obj 341 40 inlet speed;
#X obj 62 378 select 1;
#X msg 62 403 0;
#X obj 80 340 t f f;
#X obj 54 90 select 1;
#X msg 54 115 0;
#X obj 72 52 t f f;
#X msg 225 622 set \$1;
#X msg 56 467 set \$1;
#X obj 231 648 outlet;
#X obj 57 493 outlet;
#X obj 167 92 metro 20;
#X obj 413 395 r \$0-gem-masses-on;
#X obj 413 417 r \$0-gem-links-on;
#X connect 0 0 8 0;
#X connect 0 0 13 0;
#X connect 0 1 16 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 23 0;
#X connect 8 0 17 0;
#X connect 8 0 20 0;
#X connect 8 1 18 0;
#X connect 8 1 21 0;
#X connect 10 0 9 0;
#X connect 11 0 9 0;
#X connect 12 0 0 0;
#X connect 14 0 10 0;
#X connect 14 1 11 0;
#X connect 15 0 14 0;
#X connect 15 0 20 1;
#X connect 15 0 21 1;
#X connect 15 0 35 0;
#X connect 19 0 34 0;
#X connect 19 0 38 0;
#X connect 20 0 4 0;
#X connect 21 0 5 0;
#X connect 23 0 6 0;
#X connect 23 1 24 0;
#X connect 25 0 33 0;
#X connect 26 0 30 0;
#X connect 27 0 38 1;
#X connect 28 0 29 0;
#X connect 29 0 19 0;
#X connect 30 0 15 0;
#X connect 30 1 28 0;
#X connect 31 0 32 0;
#X connect 32 0 15 0;
#X connect 33 0 19 0;
#X connect 33 1 31 0;
#X connect 34 0 36 0;
#X connect 35 0 37 0;
#X connect 38 0 23 0;
#X connect 39 0 4 1;
#X connect 40 0 5 1;
#X restore 61 414 pd activate;
#X obj 61 378 tgl 24 0 empty empty GEM 0 -6 0 8 -233017 -1 -1 0 1;
#X obj 97 378 tgl 24 0 empty empty Graphical_Datastructures 0 -6 0
8 -1 -262144 -1 0 1;
#X text 275 306 Press "generate" to generate messages to msd2D and
create the physical model inside.;
#N canvas 0 0 751 433 ignore 0;
#X obj 102 264 print ToMSD;
#X obj 102 234 spigot;
#X obj 139 181 tgl 15 0 empty empty debug 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 102 207 r \$0-msd;
#X obj 281 239 spigot;
#X obj 318 186 tgl 15 0 empty empty debug 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 281 267 print FromMSD;
#X obj 281 212 r \$0-msd-out;
#N canvas 0 0 578 686 setter 0;
#X obj 137 196 mass-set 12;
#X obj 164 167 mass-set 11;
#X obj 133 167 mass-set 10;
#X obj 160 196 mass-set 9;
#X obj 215 220 mass-set 8;
#X obj 82 220 mass-set 7;
#X obj 175 187 mass-set 6;
#X obj 122 187 mass-set 5;
#X obj 173 235 mass-set 4;
#X obj 124 235 mass-set 3;
#X obj 184 300 mass-set 2;
#X obj 113 300 mass-set 1;
#X obj 149 100 mass-set 0;
#X restore 305 122 pd setter;
#N canvas 0 0 822 675 lsetter 0;
#X obj 133 167 link-set 23;
#X obj 160 196 link-set 22;
#X obj 164 167 link-set 21;
#X obj 137 196 link-set 20;
#X obj 133 167 link-set 19;
#X obj 133 167 link-set 18;
#X obj 124 235 link-set 17;
#X obj 175 187 link-set 16;
#X obj 173 235 link-set 15;
#X obj 122 187 link-set 14;
#X obj 124 235 link-set 13;
#X obj 175 187 link-set 12;
#X obj 122 187 link-set 11;
#X obj 82 220 link-set 10;
#X obj 175 187 link-set 9;
#X obj 215 220 link-set 8;
#X obj 113 300 link-set 7;
#X obj 113 300 link-set 6;
#X obj 184 300 link-set 5;
#X obj 173 235 link-set 4;
#X obj 149 100 link-set 3;
#X obj 164 167 link-set 2;
#X obj 122 187 link-set 1;
#X obj 160 196 link-set 0;
#X restore 304 145 pd lsetter;
#X text 288 98 Automatic scripting targets;
#X text 65 66 You can ignore this stuff here \, unless something goes
wrong.;
#X obj 407 239 spigot;
#X obj 444 186 tgl 15 0 empty empty debug 0 -6 0 8 -262144 -1 -1 1
1;
#X obj 407 212 r \$0-msd-attr;
#X obj 407 270 print AttrMSD;
#X obj 532 270 s \$0-msd;
#X msg 532 249 infosL;
#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 restore 149 517 pd ignore this;
#X floatatom 133 385 5 10 1000 1 frequency - -;
#X text 272 364 Visualization is done using either a GEM OpenGL window
\, or just animate the data structure alone. Better don't use both
at the same time. In GDS-mode you can set the frequency of the internal
metro \, to accelerate or slow down the simulation.;
#X text 273 110 Links are created by selecting at least two masses
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 0 0 526 412 forces 0;
#X obj 183 333 s \$0-msd;
#X obj 282 273 hsl 128 24 -500 500 0 1 empty empty empty -2 -6 0 8
-262144 -1 -1 6350 1;
#X obj 183 148 vsl 24 128 -500 500 0 1 empty empty empty 0 -8 0 8 -262144
-1 -1 6350 1;
#X msg 183 306 forceY id \$1;
#X msg 279 306 forceX id \$1;
#X obj 183 284 * -1;
#X obj 183 92 tgl 24 0 empty empty constant? 0 -6 0 8 -262144 -1 -1
0 1;
#X obj 279 213 tgl 24 0 empty empty constant? 0 -6 0 8 -262144 -1 -1
0 1;
#X obj 183 123 metro 10;
#X obj 279 244 metro 10;
#X msg 343 243 0;
#X msg 151 122 0;
#X text 118 45 Add some forces to the system.;
#X connect 1 0 4 0;
#X connect 2 0 5 0;
#X connect 3 0 0 0;
#X connect 4 0 0 0;
#X connect 5 0 3 0;
#X connect 6 0 8 0;
#X connect 7 0 9 0;
#X connect 8 0 2 0;
#X connect 9 0 1 0;
#X connect 10 0 1 0;
#X connect 11 0 2 0;
#X restore 60 457 pd forces;
#X obj 286 518 tgl 15 0 \$0-gem-masses-on empty gem_m 0 -6 0 8 -233017
-1 -1 0 1;
#X obj 328 518 tgl 15 0 \$0-gem-links-on empty gem_l 0 -6 0 8 -233017
-1 -1 0 1;
#N canvas 84 573 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 1 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 134 458 pd props;
#X text 369 515 Toggle display of masses and links in GEM.;
#X text 273 445 In edit mode and while visualization is active \, you
can move around the masses. The red masses will not receive any other
forces from the model. Use the "forces" and "props" subpatches to change
parameters of links and send forces.;
#X text 271 219 More ways to create links: left-to-right connects masses
from left to right. one2many will connect one mass to many others.
First select the first mass \, the set the toggle to 1 \, after that
select the other masses and set toggle to 0;
#X text 150 47 Clear all:;
#X text 270 181 "L" is only active \, if the green toggle "Key:L" is
set to on. Otherwise use the yellow "link" bang.;
#X text 705 123 Save network to disk:;
#X obj 56 114 morelinks;
#X obj 57 8 msd_append;
#X text 274 23 First create structure inside [pd data] using msd_append.
Add mobile masses with black bang \, add fixed masses with the red
bang. Set weight of mass with the "M" number box.;
#X connect 3 0 7 0;
#X connect 8 0 9 0;
#X connect 8 1 10 0;
#X connect 9 0 8 0;
#X connect 10 0 8 1;
#X connect 13 0 8 2;