aboutsummaryrefslogtreecommitdiff
path: root/msd
diff options
context:
space:
mode:
authorCyrille Henry <nusmuk@users.sourceforge.net>2010-11-10 11:51:42 +0000
committerCyrille Henry <nusmuk@users.sourceforge.net>2010-11-10 11:51:42 +0000
commitb55f64ad45b4d390f2f373abe54347739b17f26e (patch)
tree58f59e1818ed40be56295fe596e8187053b8bfbd /msd
parentd9b0488b75b27c78083fd2275985d0f0593a465f (diff)
move editor to msd
svn path=/trunk/externals/nusmuk/; revision=14364
Diffstat (limited to 'msd')
-rw-r--r--msd/editor/README14
-rw-r--r--msd/editor/arial.ttfbin0 -> 143300 bytes
-rw-r--r--msd/editor/cone.obj70
-rw-r--r--msd/editor/countto.pd19
-rw-r--r--msd/editor/curve2.pd18
-rw-r--r--msd/editor/ds-next.pd10
-rw-r--r--msd/editor/ds-vnext.pd10
-rw-r--r--msd/editor/expr_scale.pd53
-rw-r--r--msd/editor/gem_links.pd66
-rw-r--r--msd/editor/gem_masses.pd77
-rw-r--r--msd/editor/gem_strings.pd40
-rw-r--r--msd/editor/link-set.pd74
-rw-r--r--msd/editor/link2masses.pd35
-rw-r--r--msd/editor/make_circ.pd89
-rw-r--r--msd/editor/make_rect.pd117
-rw-r--r--msd/editor/mass-set.pd68
-rw-r--r--msd/editor/morelinks.pd234
-rw-r--r--msd/editor/msd-editor.pd1864
-rw-r--r--msd/editor/msd_append.pd248
-rw-r--r--msd/editor/mytri.pd45
-rw-r--r--msd/editor/obj-render.pd141
-rw-r--r--msd/editor/scale-ds2msd.pd42
-rw-r--r--msd/editor/scale-msd2ds.pd42
-rw-r--r--msd/editor/sixpack.pd31
-rw-r--r--msd/editor/structures.pd20
25 files changed, 3427 insertions, 0 deletions
diff --git a/msd/editor/README b/msd/editor/README
new file mode 100644
index 0000000..e6253db
--- /dev/null
+++ b/msd/editor/README
@@ -0,0 +1,14 @@
+msd-editor
+------------
+
+patched by Frank Barknecht <fbar@footils.org> with a big hand from Nicolas
+Montgermont <montgermont@la-kitchen.fr> who wrote the msd2D and msd3D externals
+required for using this patch. GEM is used to provide an alternative
+visualization, but it is not required for the patch to work.
+
+If you want to export the messages to msd2d, that are created, you also need a
+[prepend] external, preferably the one from the Cyclone library.
+
+Thanks Nicolas for a great external colletion.
+
+msd-editor.pd is the patch to open, further documentation is inside.
diff --git a/msd/editor/arial.ttf b/msd/editor/arial.ttf
new file mode 100644
index 0000000..fc0a41b
--- /dev/null
+++ b/msd/editor/arial.ttf
Binary files differ
diff --git a/msd/editor/cone.obj b/msd/editor/cone.obj
new file mode 100644
index 0000000..7ff7446
--- /dev/null
+++ b/msd/editor/cone.obj
@@ -0,0 +1,70 @@
+# Exported from Wings 3D 0.98.29b
+mtllib cone.mtl
+o cone1
+#17 vertices, 30 faces
+v 1.00000000 -1.00000000 0.0000000e+0
+v 0.92387953 -1.00000000 0.38268343
+v 0.70710678 -1.00000000 0.70710678
+v 0.38268343 -1.00000000 0.92387953
+v 6.1230318e-17 -1.00000000 1.00000000
+v -0.38268343 -1.00000000 0.92387953
+v -0.70710678 -1.00000000 0.70710678
+v -0.92387953 -1.00000000 0.38268343
+v -1.00000000 -1.00000000 1.2246064e-16
+v -0.92387953 -1.00000000 -0.38268343
+v -0.70710678 -1.00000000 -0.70710678
+v -0.38268343 -1.00000000 -0.92387953
+v -1.8369095e-16 -1.00000000 -1.00000000
+v 0.38268343 -1.00000000 -0.92387953
+v 0.70710678 -1.00000000 -0.70710678
+v 0.92387953 -1.00000000 -0.38268343
+v 0.0000000e+0 1.00000000 0.0000000e+0
+vn 0.99770979 -6.7640061e-2 -1.2578715e-16
+vn 0.59046943 -0.76910745 0.24458044
+vn 0.45192573 -0.76910745 0.45192573
+vn 0.24458044 -0.76910745 0.59046943
+vn 0.0000000e+0 -0.76910745 0.63911950
+vn -0.24458044 -0.76910745 0.59046943
+vn -0.45192573 -0.76910745 0.45192573
+vn -0.77971445 -0.53641108 0.32296830
+vn -0.99770979 -6.7640061e-2 1.4151054e-16
+vn -0.59046943 -0.76910745 -0.24458044
+vn -0.45192573 -0.76910745 -0.45192573
+vn -0.24458044 -0.76910745 -0.59046943
+vn -8.0577559e-17 -0.76910745 -0.63911950
+vn 0.24458044 -0.76910745 -0.59046943
+vn 0.45192573 -0.76910745 -0.45192573
+vn 0.77971445 -0.53641108 -0.32296830
+vn -3.1518972e-17 1.00000000 9.0617045e-17
+g cone1_default
+usemtl default
+f 1//1 17//17 2//2
+f 2//2 16//16 1//1
+f 2//2 17//17 3//3
+f 3//3 15//15 2//2
+f 3//3 17//17 4//4
+f 4//4 14//14 3//3
+f 4//4 17//17 5//5
+f 5//5 13//13 4//4
+f 5//5 17//17 6//6
+f 6//6 12//12 5//5
+f 6//6 17//17 7//7
+f 7//7 11//11 6//6
+f 7//7 17//17 8//8
+f 8//8 10//10 7//7
+f 8//8 17//17 9//9
+f 9//9 10//10 8//8
+f 9//9 17//17 10//10
+f 10//10 17//17 11//11
+f 11//11 7//7 10//10
+f 11//11 17//17 12//12
+f 12//12 6//6 11//11
+f 12//12 17//17 13//13
+f 13//13 5//5 12//12
+f 13//13 17//17 14//14
+f 14//14 4//4 13//13
+f 14//14 17//17 15//15
+f 15//15 3//3 14//14
+f 15//15 17//17 16//16
+f 16//16 2//2 15//15
+f 16//16 17//17 1//1
diff --git a/msd/editor/countto.pd b/msd/editor/countto.pd
new file mode 100644
index 0000000..dd621e9
--- /dev/null
+++ b/msd/editor/countto.pd
@@ -0,0 +1,19 @@
+#N canvas 0 0 450 300 10;
+#X obj 110 106 until;
+#X obj 108 141 f 0;
+#X obj 140 141 + 1;
+#X obj 110 193 outlet;
+#X text 207 35 from \, to;
+#X obj 113 34 inlet;
+#X obj 112 59 t a a;
+#X msg 111 80 \$2;
+#X msg 177 110 \$1;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 1 0 3 0;
+#X connect 2 0 1 1;
+#X connect 5 0 6 0;
+#X connect 6 0 7 0;
+#X connect 6 1 8 0;
+#X connect 7 0 0 0;
+#X connect 8 0 1 1;
diff --git a/msd/editor/curve2.pd b/msd/editor/curve2.pd
new file mode 100644
index 0000000..0d7da1b
--- /dev/null
+++ b/msd/editor/curve2.pd
@@ -0,0 +1,18 @@
+#N canvas 409 354 379 280 10;
+#X obj 31 123 GEMglBegin;
+#X obj 86 100 GLdefine GL_LINE_STRIP;
+#X obj 31 13 inlet;
+#X obj 86 77 loadbang;
+#X obj 159 13 inlet;
+#X obj 221 12 inlet;
+#X obj 31 200 GEMglEnd;
+#X obj 31 151 GEMglVertex3fv;
+#X obj 31 175 GEMglVertex3fv;
+#X connect 0 0 7 0;
+#X connect 1 0 0 1;
+#X connect 2 0 0 0;
+#X connect 3 0 1 0;
+#X connect 4 0 7 1;
+#X connect 5 0 8 1;
+#X connect 7 0 8 0;
+#X connect 8 0 6 0;
diff --git a/msd/editor/ds-next.pd b/msd/editor/ds-next.pd
new file mode 100644
index 0000000..14f9653
--- /dev/null
+++ b/msd/editor/ds-next.pd
@@ -0,0 +1,10 @@
+#N canvas 0 0 450 300 10;
+#X obj 138 76 inlet;
+#X obj 138 214 outlet;
+#X obj 138 111 t b;
+#X msg 138 168 next;
+#X obj 138 140 del 0;
+#X connect 0 0 2 0;
+#X connect 2 0 4 0;
+#X connect 3 0 1 0;
+#X connect 4 0 3 0;
diff --git a/msd/editor/ds-vnext.pd b/msd/editor/ds-vnext.pd
new file mode 100644
index 0000000..93a9d81
--- /dev/null
+++ b/msd/editor/ds-vnext.pd
@@ -0,0 +1,10 @@
+#N canvas 0 0 450 300 10;
+#X obj 138 76 inlet;
+#X obj 138 214 outlet;
+#X obj 138 111 t b;
+#X msg 138 168 vnext 1;
+#X obj 138 140 del 1;
+#X connect 0 0 2 0;
+#X connect 2 0 4 0;
+#X connect 3 0 1 0;
+#X connect 4 0 3 0;
diff --git a/msd/editor/expr_scale.pd b/msd/editor/expr_scale.pd
new file mode 100644
index 0000000..fe55fa5
--- /dev/null
+++ b/msd/editor/expr_scale.pd
@@ -0,0 +1,53 @@
+#N canvas 236 224 1026 642 10;
+#X obj 166 328 expr ($f1-$f2)*($f4-$f5)/($f2-$f3)+$f4;
+#X obj 252 286 f \$1;
+#X obj 402 288 f \$4;
+#X obj 352 284 f \$3;
+#X obj 302 284 f \$2;
+#X obj 252 197 inlet;
+#X obj 302 197 inlet;
+#X obj 352 197 inlet;
+#X obj 402 197 inlet;
+#X obj 166 129 inlet;
+#X obj 166 369 outlet;
+#X text 510 173 ARGS;
+#X text 520 197 1: input_low_border;
+#X text 520 219 2: input_high_border;
+#X text 520 245 3: output_low_border;
+#X text 520 267 4: output_high_border;
+#X text 229 149 scale [from_low \, from_hi] to [to_low \, to_hi];
+#X obj 273 243 t b;
+#X obj 298 171 loadbang;
+#X obj 166 156 t f b;
+#N canvas 0 0 1090 810 once 0;
+#X obj 86 53 inlet;
+#X obj 92 185 outlet;
+#X obj 81 146 spigot 1;
+#X obj 112 91 t b a;
+#X msg 131 123 0;
+#X connect 0 0 3 0;
+#X connect 2 0 1 0;
+#X connect 3 0 4 0;
+#X connect 3 1 2 0;
+#X connect 4 0 2 1;
+#X restore 196 186 pd once;
+#X text 174 391 [pc once] is only used \, because autogenerated objects
+don't receive loadbangs;
+#X connect 0 0 10 0;
+#X connect 1 0 0 1;
+#X connect 2 0 0 4;
+#X connect 3 0 0 3;
+#X connect 4 0 0 2;
+#X connect 5 0 1 0;
+#X connect 6 0 4 0;
+#X connect 7 0 3 0;
+#X connect 8 0 2 0;
+#X connect 9 0 19 0;
+#X connect 17 0 1 0;
+#X connect 17 0 3 0;
+#X connect 17 0 4 0;
+#X connect 17 0 2 0;
+#X connect 18 0 17 0;
+#X connect 19 0 0 0;
+#X connect 19 1 20 0;
+#X connect 20 0 17 0;
diff --git a/msd/editor/gem_links.pd b/msd/editor/gem_links.pd
new file mode 100644
index 0000000..3bff241
--- /dev/null
+++ b/msd/editor/gem_links.pd
@@ -0,0 +1,66 @@
+#N canvas 375 164 720 697 10;
+#X obj 141 31 inlet;
+#X obj 109 389 separator;
+#X obj 147 166 t b f;
+#X obj 178 210 pack 0 0 0;
+#X obj 269 213 pack 0 0 0;
+#X obj 141 97 unpack 0 0 0 0 0;
+#X obj 282 324 inlet;
+#X obj 109 364 spigot;
+#X msg 281 302 1;
+#X obj 281 277 loadbang;
+#N canvas 0 0 450 300 demux 0;
+#X obj 91 69 inlet;
+#X obj 255 73 inlet;
+#X obj 223 106 select 0;
+#X obj 73 213 spigot 1;
+#X obj 165 219 spigot 0;
+#X obj 141 188 unpack 1 0;
+#X obj 96 255 outlet;
+#X obj 173 257 outlet;
+#X msg 174 140 1 0;
+#X msg 216 140 0 1;
+#X connect 0 0 3 0;
+#X connect 0 0 4 0;
+#X connect 1 0 2 0;
+#X connect 2 0 8 0;
+#X connect 2 1 9 0;
+#X connect 3 0 6 0;
+#X connect 4 0 7 0;
+#X connect 5 0 3 1;
+#X connect 5 1 4 1;
+#X connect 8 0 5 0;
+#X connect 9 0 5 0;
+#X restore 141 64 pd demux;
+#X obj 192 37 r MSD-TYPE;
+#X obj 280 97 unpack 0 0 0 0 0 0 0;
+#X obj 156 432 curve2;
+#X obj 125 308 gemhead 40;
+#X obj 70 257 loadbang;
+#X msg 70 282 0;
+#X connect 0 0 10 0;
+#X connect 1 0 13 0;
+#X connect 2 0 14 0;
+#X connect 2 1 3 0;
+#X connect 3 0 13 1;
+#X connect 4 0 13 2;
+#X connect 5 1 2 0;
+#X connect 5 2 3 1;
+#X connect 5 3 4 0;
+#X connect 5 4 4 1;
+#X connect 6 0 7 1;
+#X connect 7 0 1 0;
+#X connect 8 0 7 1;
+#X connect 9 0 8 0;
+#X connect 10 0 5 0;
+#X connect 10 1 12 0;
+#X connect 11 0 10 1;
+#X connect 12 1 2 0;
+#X connect 12 2 3 1;
+#X connect 12 3 3 2;
+#X connect 12 4 4 0;
+#X connect 12 5 4 1;
+#X connect 12 6 4 2;
+#X connect 14 0 7 0;
+#X connect 15 0 16 0;
+#X connect 16 0 14 0;
diff --git a/msd/editor/gem_masses.pd b/msd/editor/gem_masses.pd
new file mode 100644
index 0000000..08a0827
--- /dev/null
+++ b/msd/editor/gem_masses.pd
@@ -0,0 +1,77 @@
+#N canvas 28 301 667 612 10;
+#X obj 141 31 inlet;
+#X obj 150 424 translateXYZ;
+#X obj 150 393 separator;
+#X obj 166 162 t b f;
+#X msg 47 325 draw line;
+#X obj 48 300 loadbang;
+#X obj 141 104 unpack 0 0 0;
+#X obj 338 297 inlet;
+#X obj 150 362 spigot;
+#X msg 337 275 1;
+#N canvas 0 0 450 300 demux 0;
+#X obj 91 69 inlet;
+#X obj 255 73 inlet;
+#X obj 223 106 select 0;
+#X obj 73 213 spigot 1;
+#X obj 165 219 spigot 0;
+#X obj 141 188 unpack 1 0;
+#X obj 96 255 outlet;
+#X obj 173 257 outlet;
+#X msg 174 140 1 0;
+#X msg 216 140 0 1;
+#X connect 0 0 3 0;
+#X connect 0 0 4 0;
+#X connect 1 0 2 0;
+#X connect 2 0 8 0;
+#X connect 2 1 9 0;
+#X connect 3 0 6 0;
+#X connect 4 0 7 0;
+#X connect 5 0 3 1;
+#X connect 5 1 4 1;
+#X connect 8 0 5 0;
+#X connect 9 0 5 0;
+#X restore 141 71 pd demux;
+#X obj 192 44 r MSD-TYPE;
+#X obj 238 104 unpack 0 0 0 0;
+#X floatatom 308 400 5 0 0 0 - - -;
+#X obj 126 479 square 0.025;
+#X msg 259 469 text \$1;
+#X obj 279 561 text3d;
+#X obj 388 503 loadbang;
+#X msg 385 528 2;
+#X obj 391 395 inlet mass-id;
+#X obj 211 516 spigot;
+#X obj 150 295 gemhead 40;
+#X msg 107 258 0;
+#X obj 107 227 loadbang;
+#X connect 0 0 10 0;
+#X connect 1 0 14 0;
+#X connect 1 0 20 0;
+#X connect 2 0 1 0;
+#X connect 3 0 21 0;
+#X connect 3 1 1 1;
+#X connect 5 0 4 0;
+#X connect 6 0 15 0;
+#X connect 6 1 3 0;
+#X connect 6 2 1 2;
+#X connect 7 0 8 1;
+#X connect 8 0 2 0;
+#X connect 9 0 8 1;
+#X connect 10 0 6 0;
+#X connect 10 1 12 0;
+#X connect 11 0 10 1;
+#X connect 12 0 15 0;
+#X connect 12 1 3 0;
+#X connect 12 2 1 2;
+#X connect 12 3 1 3;
+#X connect 13 0 14 1;
+#X connect 15 0 16 0;
+#X connect 17 0 18 0;
+#X connect 18 0 16 1;
+#X connect 19 0 20 1;
+#X connect 19 0 16 1;
+#X connect 20 0 16 0;
+#X connect 21 0 8 0;
+#X connect 22 0 21 0;
+#X connect 23 0 22 0;
diff --git a/msd/editor/gem_strings.pd b/msd/editor/gem_strings.pd
new file mode 100644
index 0000000..c84aaba
--- /dev/null
+++ b/msd/editor/gem_strings.pd
@@ -0,0 +1,40 @@
+#N canvas 76 70 906 731 10;
+#X obj 141 31 inlet;
+#X obj 109 369 separator;
+#X obj 147 166 t b f;
+#X obj 229 116 - 250;
+#X obj 147 110 - 250;
+#X obj 147 140 / 100;
+#X obj 229 143 / -100;
+#X obj 352 114 - 250;
+#X obj 287 116 - 250;
+#X obj 287 151 / 100;
+#X obj 352 143 / -100;
+#X obj 156 432 curve 2;
+#X obj 178 210 pack 0 0 0;
+#X obj 255 189 pack 0 0 0;
+#X obj 141 62 unpack 0 0 0 0 0;
+#X msg 65 279 0;
+#X obj 65 248 loadbang;
+#X obj 125 308 gemhead 40;
+#X connect 0 0 14 0;
+#X connect 1 0 11 0;
+#X connect 2 0 17 0;
+#X connect 2 1 12 0;
+#X connect 3 0 6 0;
+#X connect 4 0 5 0;
+#X connect 5 0 2 0;
+#X connect 6 0 12 1;
+#X connect 7 0 10 0;
+#X connect 8 0 9 0;
+#X connect 9 0 13 0;
+#X connect 10 0 13 1;
+#X connect 12 0 11 1;
+#X connect 13 0 11 2;
+#X connect 14 1 4 0;
+#X connect 14 2 3 0;
+#X connect 14 3 8 0;
+#X connect 14 4 7 0;
+#X connect 15 0 17 0;
+#X connect 16 0 15 0;
+#X connect 17 0 1 0;
diff --git a/msd/editor/link-set.pd b/msd/editor/link-set.pd
new file mode 100644
index 0000000..ec9edda
--- /dev/null
+++ b/msd/editor/link-set.pd
@@ -0,0 +1,74 @@
+#N canvas 449 81 747 726 10;
+#X obj 251 159 pack 0 p;
+#X obj 251 187 route \$1;
+#X obj 251 100 t p p;
+#X obj 90 229 spigot;
+#X msg 132 203 1;
+#X obj 216 212 t b p;
+#X obj 90 257 route \$1;
+#X obj 147 227 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
+1;
+#X obj 90 165 r linkspositions;
+#X text 81 137 lid \, x1 \, y1 \, x2 \, y2;
+#X obj 251 131 get liaison lid;
+#X text 261 220 Select pointer with lid matching \$1;
+#X obj 90 526 set liaison x1 y1 x2 y2;
+#X obj 251 73 r myliapointer;
+#X obj 90 337 unpack 0 0 0 0;
+#X obj 90 497 scale-msd2ds;
+#X obj 181 496 scale-msd2ds;
+#N canvas 0 0 450 300 demux 0;
+#X obj 91 69 inlet;
+#X obj 255 73 inlet;
+#X obj 223 106 select 0;
+#X obj 73 213 spigot 1;
+#X obj 165 219 spigot 0;
+#X obj 141 188 unpack 1 0;
+#X obj 96 255 outlet;
+#X obj 173 257 outlet;
+#X msg 174 140 1 0;
+#X msg 216 140 0 1;
+#X connect 0 0 3 0;
+#X connect 0 0 4 0;
+#X connect 1 0 2 0;
+#X connect 2 0 8 0;
+#X connect 2 1 9 0;
+#X connect 3 0 6 0;
+#X connect 4 0 7 0;
+#X connect 5 0 3 1;
+#X connect 5 1 4 1;
+#X connect 8 0 5 0;
+#X connect 9 0 5 0;
+#X restore 90 292 pd demux;
+#X obj 272 340 unpack 0 0 0 0 0 0;
+#X text 198 336 msd2D;
+#X text 410 338 msd3D: skip Z;
+#X obj 157 255 r MSD-TYPE;
+#X connect 0 0 1 0;
+#X connect 1 0 5 0;
+#X connect 2 0 10 0;
+#X connect 2 1 0 1;
+#X connect 3 0 6 0;
+#X connect 4 0 3 1;
+#X connect 4 0 7 0;
+#X connect 5 0 4 0;
+#X connect 5 1 12 4;
+#X connect 6 0 17 0;
+#X connect 8 0 3 0;
+#X connect 10 0 0 0;
+#X connect 13 0 2 0;
+#X connect 14 0 15 0;
+#X connect 14 1 15 1;
+#X connect 14 2 16 0;
+#X connect 14 3 16 1;
+#X connect 15 0 12 0;
+#X connect 15 1 12 1;
+#X connect 16 0 12 2;
+#X connect 16 1 12 3;
+#X connect 17 0 14 0;
+#X connect 17 1 18 0;
+#X connect 18 0 15 0;
+#X connect 18 1 15 1;
+#X connect 18 3 16 0;
+#X connect 18 4 16 1;
+#X connect 21 0 17 1;
diff --git a/msd/editor/link2masses.pd b/msd/editor/link2masses.pd
new file mode 100644
index 0000000..b685745
--- /dev/null
+++ b/msd/editor/link2masses.pd
@@ -0,0 +1,35 @@
+#N canvas 567 387 697 434 10;
+#X obj 42 51 inlet;
+#X obj 42 83 t a b;
+#X obj 360 209 append liaison mid1 x1 y1;
+#X obj 530 186 pointer;
+#X msg 530 157 traverse pd-data \, bang;
+#X obj 42 118 unpack p p;
+#X obj 360 158 get mass mid x y;
+#X obj 42 177 get mass mid x y;
+#X text 199 24 Link two masses with a link in [pd data];
+#X obj 178 55 inlet;
+#X text 227 54 List: K \, D \, sid \, P \, Lmin \, Lmax;
+#X obj 42 249 set liaison mid2 x2 y2 K D sid P Lmin Lmax;
+#X obj 178 89 unpack 0 0 0 0 0 0;
+#X connect 0 0 1 0;
+#X connect 1 0 5 0;
+#X connect 1 1 4 0;
+#X connect 2 0 11 9;
+#X connect 3 0 2 3;
+#X connect 4 0 3 0;
+#X connect 5 0 7 0;
+#X connect 5 1 6 0;
+#X connect 6 0 2 0;
+#X connect 6 1 2 1;
+#X connect 6 2 2 2;
+#X connect 7 0 11 0;
+#X connect 7 1 11 1;
+#X connect 7 2 11 2;
+#X connect 9 0 12 0;
+#X connect 12 0 11 3;
+#X connect 12 1 11 4;
+#X connect 12 2 11 5;
+#X connect 12 3 11 6;
+#X connect 12 4 11 7;
+#X connect 12 5 11 8;
diff --git a/msd/editor/make_circ.pd b/msd/editor/make_circ.pd
new file mode 100644
index 0000000..839f493
--- /dev/null
+++ b/msd/editor/make_circ.pd
@@ -0,0 +1,89 @@
+#N canvas 496 414 573 483 10;
+#X obj 79 355 pack 0 0;
+#X obj 79 388 outlet;
+#X obj 235 67 unpack 0 0 0 0;
+#X obj 235 233 s \$0-x0;
+#X obj 274 205 s \$0-y0;
+#X obj 312 173 s \$0-radius;
+#X obj 352 150 s \$0-masses;
+#X obj 235 43 inlet;
+#X obj 79 34 inlet;
+#X obj 130 332 + 0;
+#X obj 149 304 r \$0-y0;
+#X obj 79 330 + 0;
+#X obj 95 304 r \$0-x0;
+#N canvas 484 634 450 300 1028-turnme 0;
+#X obj 119 48 inlet;
+#X obj 119 243 outlet;
+#X obj 135 77 r \$0-masses;
+#X obj 254 169 r \$0-radius;
+#X obj 119 195 expr $f2 * sin($f1) \; $f2 * cos($f1);
+#X obj 119 102 / 1;
+#X obj 254 242 outlet;
+#X obj 119 134 * 6.28319;
+#X text 192 132 2 * M_PI;
+#X connect 0 0 5 0;
+#X connect 2 0 5 1;
+#X connect 3 0 4 1;
+#X connect 4 0 1 0;
+#X connect 4 1 6 0;
+#X connect 5 0 7 0;
+#X connect 7 0 4 0;
+#X restore 79 122 pd \$0-turnme;
+#N canvas 0 0 723 519 1028-count 0;
+#X text 294 126 count y;
+#N canvas 0 0 450 300 1028-count 0;
+#X obj 112 28 inlet;
+#X obj 116 96 f 0;
+#X obj 156 98 + 1;
+#X obj 178 52 inlet;
+#X msg 175 73 0;
+#X obj 118 122 outlet;
+#X obj 112 66 until;
+#X connect 0 0 6 0;
+#X connect 1 0 2 0;
+#X connect 1 0 5 0;
+#X connect 2 0 1 1;
+#X connect 3 0 4 0;
+#X connect 4 0 1 1;
+#X connect 6 0 1 0;
+#X restore 237 228 pd \$0-count;
+#X obj 237 103 inlet;
+#X obj 237 371 outlet;
+#X obj 237 130 t b b;
+#X obj 262 176 r \$0-masses;
+#X obj 237 197 f 1;
+#X connect 1 0 3 0;
+#X connect 2 0 4 0;
+#X connect 4 0 6 0;
+#X connect 4 1 1 1;
+#X connect 5 0 6 1;
+#X connect 6 0 1 0;
+#X restore 79 80 pd \$0-count;
+#X obj 235 125 f \$1;
+#X obj 274 124 f \$2;
+#X obj 312 124 f \$3;
+#X obj 352 124 f \$4;
+#X obj 352 67 loadbang;
+#X connect 0 0 1 0;
+#X connect 2 0 15 0;
+#X connect 2 1 16 0;
+#X connect 2 2 17 0;
+#X connect 2 3 18 0;
+#X connect 7 0 2 0;
+#X connect 8 0 14 0;
+#X connect 9 0 0 1;
+#X connect 10 0 9 1;
+#X connect 11 0 0 0;
+#X connect 12 0 11 1;
+#X connect 13 0 11 0;
+#X connect 13 1 9 0;
+#X connect 14 0 13 0;
+#X connect 15 0 3 0;
+#X connect 16 0 4 0;
+#X connect 17 0 5 0;
+#X connect 18 0 6 0;
+#X connect 19 0 18 0;
+#X connect 19 0 17 0;
+#X connect 19 0 16 0;
+#X connect 19 0 15 0;
diff --git a/msd/editor/make_rect.pd b/msd/editor/make_rect.pd
new file mode 100644
index 0000000..57bc285
--- /dev/null
+++ b/msd/editor/make_rect.pd
@@ -0,0 +1,117 @@
+#N canvas 253 193 699 400 10;
+#X obj 77 53 inlet;
+#X obj 298 50 inlet;
+#X obj 298 77 unpack 0 0 0 0 0 0;
+#X obj 259 123 f \$1;
+#X obj 298 122 f \$2;
+#X obj 336 122 f \$3;
+#X obj 376 122 f \$4;
+#X obj 412 122 f \$5;
+#X obj 259 260 s \$0-x0;
+#X obj 448 122 f \$6;
+#X obj 298 239 s \$0-y0;
+#X obj 336 206 s \$0-xgap;
+#X obj 412 164 s \$0-xsteps;
+#X obj 448 143 s \$0-ysteps;
+#X obj 376 185 s \$0-ygap;
+#X obj 77 226 pack 0 0;
+#X obj 77 260 outlet;
+#X obj 77 129 t b f;
+#N canvas 0 0 490 471 1002-countx 0;
+#X obj 149 231 r \$0-x0;
+#X obj 126 258 + \$1;
+#X obj 126 200 * \$3;
+#X obj 149 171 r \$0-xgap;
+#X obj 126 115 f \$5;
+#X obj 149 92 r \$0-xsteps;
+#X text 194 49 count x;
+#X obj 126 23 inlet;
+#N canvas 0 0 450 300 1002-count 0;
+#X obj 112 28 inlet;
+#X obj 116 96 f 0;
+#X obj 156 98 + 1;
+#X obj 178 52 inlet;
+#X msg 175 73 0;
+#X obj 118 122 outlet;
+#X obj 112 66 until;
+#X connect 0 0 6 0;
+#X connect 1 0 2 0;
+#X connect 1 0 5 0;
+#X connect 2 0 1 1;
+#X connect 3 0 4 0;
+#X connect 4 0 1 1;
+#X connect 6 0 1 0;
+#X restore 126 146 pd \$0-count;
+#X obj 126 284 outlet;
+#X obj 126 48 t b b;
+#X connect 0 0 1 1;
+#X connect 1 0 9 0;
+#X connect 2 0 1 0;
+#X connect 3 0 2 1;
+#X connect 4 0 8 0;
+#X connect 5 0 4 1;
+#X connect 7 0 10 0;
+#X connect 8 0 2 0;
+#X connect 10 0 4 0;
+#X connect 10 1 8 1;
+#X restore 77 172 pd \$0-countx;
+#N canvas 0 0 723 519 1002-county 0;
+#X obj 260 174 r \$0-ysteps;
+#X obj 260 253 r \$0-ygap;
+#X obj 260 313 r \$0-y0;
+#X obj 237 340 + \$2;
+#X obj 237 282 * \$4;
+#X obj 237 197 f \$6;
+#X text 294 126 count y;
+#N canvas 0 0 450 300 1002-count 0;
+#X obj 112 28 inlet;
+#X obj 116 96 f 0;
+#X obj 156 98 + 1;
+#X obj 178 52 inlet;
+#X msg 175 73 0;
+#X obj 118 122 outlet;
+#X obj 112 66 until;
+#X connect 0 0 6 0;
+#X connect 1 0 2 0;
+#X connect 1 0 5 0;
+#X connect 2 0 1 1;
+#X connect 3 0 4 0;
+#X connect 4 0 1 1;
+#X connect 6 0 1 0;
+#X restore 237 228 pd \$0-count;
+#X obj 237 103 inlet;
+#X obj 237 371 outlet;
+#X obj 237 130 t b b;
+#X connect 0 0 5 1;
+#X connect 1 0 4 1;
+#X connect 2 0 3 1;
+#X connect 3 0 9 0;
+#X connect 4 0 3 0;
+#X connect 5 0 7 0;
+#X connect 7 0 4 0;
+#X connect 8 0 10 0;
+#X connect 10 0 5 0;
+#X connect 10 1 7 1;
+#X restore 77 100 pd \$0-county;
+#X obj 77 76 t b;
+#X text 452 208 Args;
+#X connect 0 0 20 0;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 2 1 4 0;
+#X connect 2 2 5 0;
+#X connect 2 3 6 0;
+#X connect 2 4 7 0;
+#X connect 2 5 9 0;
+#X connect 3 0 8 0;
+#X connect 4 0 10 0;
+#X connect 5 0 11 0;
+#X connect 6 0 14 0;
+#X connect 7 0 12 0;
+#X connect 9 0 13 0;
+#X connect 15 0 16 0;
+#X connect 17 0 18 0;
+#X connect 17 1 15 1;
+#X connect 18 0 15 0;
+#X connect 19 0 17 0;
+#X connect 20 0 19 0;
diff --git a/msd/editor/mass-set.pd b/msd/editor/mass-set.pd
new file mode 100644
index 0000000..1c53605
--- /dev/null
+++ b/msd/editor/mass-set.pd
@@ -0,0 +1,68 @@
+#N canvas 471 153 686 707 10;
+#X obj 251 159 pack 0 p;
+#X obj 251 187 route \$1;
+#X obj 118 383 set mass x y;
+#X obj 251 100 t p p;
+#X obj 251 131 get mass mid;
+#X text 261 220 Select pointer with mid matching \$1;
+#X obj 91 229 spigot;
+#X msg 133 203 1;
+#X obj 216 212 t b p;
+#X obj 91 165 r masspositions;
+#X text 94 145 mid \, x \, y;
+#X obj 91 291 route \$1;
+#X obj 148 227 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
+1;
+#X obj 251 73 r mypointer;
+#X obj 263 348 pointer;
+#X obj 307 651 s pointer2msd;
+#X obj 91 261 t b a;
+#X obj 263 320 spigot;
+#X msg 305 294 1;
+#X obj 320 318 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
+1;
+#X obj 263 274 r pollpos;
+#X obj 263 453 pack 0 0 0 0;
+#X obj 263 397 get mass mob mid x y;
+#X obj 263 478 route 0;
+#X text 320 478 = is a mobile mass \, don't set positions for these
+;
+#X msg 307 536 posX \$2 \$3;
+#X msg 327 562 posY \$2 \$4;
+#X obj 39 355 scale-msd2ds;
+#X obj 337 422 scale-ds2msd;
+#X msg 95 323 \$1 \$2;
+#X connect 0 0 1 0;
+#X connect 1 0 8 0;
+#X connect 3 0 4 0;
+#X connect 3 1 0 1;
+#X connect 4 0 0 0;
+#X connect 6 0 16 0;
+#X connect 7 0 6 1;
+#X connect 7 0 12 0;
+#X connect 8 0 7 0;
+#X connect 8 0 18 0;
+#X connect 8 1 2 2;
+#X connect 8 1 14 1;
+#X connect 9 0 6 0;
+#X connect 11 0 29 0;
+#X connect 13 0 3 0;
+#X connect 14 0 22 0;
+#X connect 16 1 11 0;
+#X connect 17 0 14 0;
+#X connect 18 0 17 1;
+#X connect 18 0 19 0;
+#X connect 20 0 17 0;
+#X connect 21 0 23 0;
+#X connect 22 0 21 0;
+#X connect 22 1 21 1;
+#X connect 22 2 28 0;
+#X connect 22 3 28 1;
+#X connect 23 1 25 0;
+#X connect 23 1 26 0;
+#X connect 25 0 15 0;
+#X connect 26 0 15 0;
+#X connect 27 2 2 0;
+#X connect 28 0 21 2;
+#X connect 28 1 21 3;
+#X connect 29 0 27 2;
diff --git a/msd/editor/morelinks.pd b/msd/editor/morelinks.pd
new file mode 100644
index 0000000..60d7624
--- /dev/null
+++ b/msd/editor/morelinks.pd
@@ -0,0 +1,234 @@
+#N canvas 225 469 146 202 10;
+#N canvas 375 417 614 523 left-right-links 0;
+#X obj 192 225 pointer mass;
+#X obj 184 423 pack p p;
+#X msg 192 193 traverse pd-data \, vnext 1;
+#X obj 191 150 inlet;
+#X text 115 56 m1 ---> m2 ---> m3 ---> m4;
+#X obj 393 207 s pd-data;
+#X msg 393 186 sort;
+#X text 111 18 This will walk through the selected masses from left
+to right and create links between two neighbor masses like:;
+#X text 113 90 Great for connecting "strings".;
+#X text 427 186 first sort left to right;
+#X obj 192 169 t b b b;
+#X obj 192 248 t b b p;
+#X obj 239 148 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 236 320 t p p;
+#X msg 294 320 0;
+#X obj 184 385 spigot;
+#X msg 206 321 1;
+#X text 258 384 Skip the first mass;
+#X obj 256 416 r \$0-link-param;
+#X obj 113 225 ds-vnext;
+#X obj 184 454 link2masses;
+#X connect 0 0 11 0;
+#X connect 0 1 19 0;
+#X connect 1 0 20 0;
+#X connect 2 0 0 0;
+#X connect 3 0 10 0;
+#X connect 6 0 5 0;
+#X connect 10 0 2 0;
+#X connect 10 1 14 0;
+#X connect 10 2 6 0;
+#X connect 11 0 19 0;
+#X connect 11 1 16 0;
+#X connect 11 2 13 0;
+#X connect 12 0 10 0;
+#X connect 13 0 1 1;
+#X connect 13 1 15 0;
+#X connect 14 0 15 1;
+#X connect 15 0 1 0;
+#X connect 16 0 15 1;
+#X connect 18 0 20 1;
+#X connect 19 0 0 0;
+#X restore 141 67 pd left-right-links;
+#X obj 2 18 cnv 15 140 80 empty empty empty 20 12 0 14 -233017 -66577
+0;
+#X obj 10 52 bng 15 250 50 0 empty empty left-to-right 20 8 0 8 -241291
+-1 -1;
+#N canvas 487 247 771 749 one-to-many 0;
+#X obj 203 173 pointer mass;
+#X obj 182 442 pack p p;
+#X msg 203 141 traverse pd-data \, vnext 1;
+#X obj 132 337 t b p;
+#X obj 69 120 inlet;
+#X obj 135 310 pointer mass;
+#X obj 203 196 t b p;
+#X obj 69 178 t b b;
+#X msg 135 242 traverse pd-data;
+#X obj 274 378 outlet;
+#X msg 274 325 label one2many-Start;
+#X msg 281 351 label one2many-Ends;
+#X obj 69 146 select 0 1;
+#X obj 254 440 r \$0-link-param;
+#X obj 69 281 ds-vnext;
+#X obj 182 473 link2masses;
+#X connect 0 0 6 0;
+#X connect 1 0 15 0;
+#X connect 2 0 0 0;
+#X connect 3 0 14 0;
+#X connect 3 1 1 0;
+#X connect 4 0 12 0;
+#X connect 5 0 3 0;
+#X connect 5 1 14 0;
+#X connect 5 2 10 0;
+#X connect 6 0 11 0;
+#X connect 6 1 1 1;
+#X connect 7 0 14 0;
+#X connect 7 1 8 0;
+#X connect 8 0 5 0;
+#X connect 10 0 9 0;
+#X connect 11 0 9 0;
+#X connect 12 0 7 0;
+#X connect 12 1 2 0;
+#X connect 13 0 15 1;
+#X connect 14 0 5 0;
+#X restore 143 94 pd one-to-many;
+#X obj 10 75 tgl 15 0 empty empty one2many-Start 20 8 0 8 -262131 -1
+-1 0 1;
+#X obj 10 30 bng 15 250 50 0 empty empty all_selected 20 8 0 8 -241291
+-1 -1;
+#X obj 115 31 tgl 15 0 empty empty Keys -3 -6 0 8 -24198 -1 -1 0 1
+;
+#X obj 211 5 keyup;
+#X obj 211 26 spigot;
+#X obj 2 100 cnv 15 140 100 empty empty Link_Params 10 10 0 10 -195568
+-1 0;
+#X obj 20 120 nbx 4 14 -1e+37 1e+37 0 0 \$0-K \$0-K K -12 8 0 10 -225271
+-1 -1 10 256;
+#X obj 46 181 nbx 5 14 -1e+37 1e+37 0 0 \$0-lsid \$0-lsid SID -30 8
+0 10 -261681 -1 -1 0 256;
+#X obj 20 142 nbx 4 14 -1e+37 1e+37 0 0 \$0-D \$0-D D -12 8 0 10 -225271
+-1 -1 2.5 256;
+#N canvas 374 319 746 411 linkparam 0;
+#X obj 34 229 s \$0-link-param;
+#X obj 38 104 t b f;
+#X obj 81 106 t b f;
+#X obj 28 27 r \$0-K;
+#X obj 38 56 r \$0-D;
+#X obj 240 240 s \$0-K;
+#X obj 320 233 s \$0-D;
+#X obj 402 236 s \$0-D2;
+#X obj 240 147 f \$1;
+#X obj 320 157 f \$2;
+#X obj 402 156 f \$3;
+#X obj 240 178 select 0;
+#X msg 240 204 10;
+#X obj 320 181 select 0;
+#X obj 402 177 select 0;
+#X msg 320 207 2.5;
+#X msg 402 203 1.5;
+#X obj 443 50 loadbang;
+#X text 438 28 Init;
+#X obj 485 236 s \$0-lsid;
+#X msg 485 159 0;
+#X obj 81 80 r \$0-lsid;
+#X msg 515 131 1;
+#X obj 515 208 s \$0-P;
+#X obj 151 104 t b f;
+#X obj 151 78 r \$0-P;
+#X msg 563 129 0;
+#X obj 563 166 s \$0-Lmin;
+#X obj 632 202 s \$0-Lmax;
+#X msg 632 132 1e+10;
+#X obj 34 196 pack 0 0 0 0 0 0;
+#X obj 195 106 t b f;
+#X obj 235 106 t b f;
+#X obj 195 53 r \$0-Lmin;
+#X obj 235 78 r \$0-Lmax;
+#X obj 49 315 outlet;
+#X obj 49 287 r \$0-link-param;
+#X connect 1 0 30 0;
+#X connect 1 1 30 1;
+#X connect 2 0 30 0;
+#X connect 2 1 30 2;
+#X connect 3 0 30 0;
+#X connect 4 0 1 0;
+#X connect 8 0 11 0;
+#X connect 9 0 13 0;
+#X connect 10 0 14 0;
+#X connect 11 0 12 0;
+#X connect 11 1 5 0;
+#X connect 12 0 5 0;
+#X connect 13 0 15 0;
+#X connect 13 1 6 0;
+#X connect 14 0 16 0;
+#X connect 14 1 7 0;
+#X connect 15 0 6 0;
+#X connect 16 0 7 0;
+#X connect 17 0 8 0;
+#X connect 17 0 9 0;
+#X connect 17 0 10 0;
+#X connect 17 0 20 0;
+#X connect 17 0 22 0;
+#X connect 17 0 26 0;
+#X connect 17 0 29 0;
+#X connect 20 0 19 0;
+#X connect 21 0 2 0;
+#X connect 22 0 23 0;
+#X connect 24 0 30 0;
+#X connect 24 1 30 3;
+#X connect 25 0 24 0;
+#X connect 26 0 27 0;
+#X connect 29 0 28 0;
+#X connect 30 0 0 0;
+#X connect 31 0 30 0;
+#X connect 31 1 30 4;
+#X connect 32 0 30 0;
+#X connect 32 1 30 5;
+#X connect 33 0 31 0;
+#X connect 34 0 32 0;
+#X connect 36 0 35 0;
+#X restore 145 126 pd linkparam;
+#N canvas 0 0 483 507 ilinker 0;
+#X obj 195 306 pointer mass;
+#X obj 197 167 pointer mass;
+#X obj 197 190 t b p;
+#X obj 177 387 pack p p;
+#X msg 197 135 traverse pd-data \, vnext 1;
+#X obj 147 330 t b p;
+#X obj 197 106 inlet;
+#X text 111 48 This will create all possible links between all selected
+masses like iLink.;
+#X obj 249 386 r \$0-link-param;
+#X obj 274 214 ds-vnext;
+#X obj 147 257 ds-vnext;
+#X obj 177 418 link2masses;
+#X connect 0 0 5 0;
+#X connect 0 1 10 0;
+#X connect 0 2 9 0;
+#X connect 1 0 2 0;
+#X connect 1 1 9 0;
+#X connect 2 0 10 0;
+#X connect 2 1 3 1;
+#X connect 2 1 0 1;
+#X connect 3 0 11 0;
+#X connect 4 0 1 0;
+#X connect 5 0 10 0;
+#X connect 5 1 3 0;
+#X connect 6 0 4 0;
+#X connect 8 0 11 1;
+#X connect 9 0 1 0;
+#X connect 10 0 0 0;
+#X restore 137 45 pd ilinker;
+#X obj 210 46 select 108 114;
+#X obj 77 132 nbx 3 14 0 1e+37 0 0 \$0-Lmin \$0-Lmin Lmin 0 -8 0 10
+-225271 -1 -1 0 256;
+#X obj 20 161 nbx 3 14 -1e+37 1e+37 0 0 \$0-P \$0-P P -12 8 0 10 -225271
+-1 -1 1 256;
+#X obj 76 162 nbx 6 14 0 1e+37 0 0 \$0-Lmax \$0-Lmax Lmax 0 -8 0 10
+-225271 -1 -1 1e+10 256;
+#X obj 145 156 outlet;
+#X connect 2 0 0 0;
+#X connect 3 0 4 0;
+#X connect 4 0 3 0;
+#X connect 5 0 14 0;
+#X connect 6 0 8 1;
+#X connect 7 0 8 0;
+#X connect 8 0 15 0;
+#X connect 13 0 19 0;
+#X connect 15 0 14 0;
+#X connect 15 1 0 0;
+#X coords 0 0 1 1 142 200 1;
diff --git a/msd/editor/msd-editor.pd b/msd/editor/msd-editor.pd
new file mode 100644
index 0000000..eb6b9ce
--- /dev/null
+++ b/msd/editor/msd-editor.pd
@@ -0,0 +1,1864 @@
+#N struct liaison float x1 float y1 float x2 float y2 float mid1 float
+mid2 float lid float K float D float P float Lmin float Lmax float
+sid;
+#N struct mass float x float y float mid float mob float M float sid
+;
+#N canvas 249 108 419 631 10;
+#X obj 9 50 cnv 15 400 220 empty empty EDIT 20 12 1 14 -233017 -66577
+0;
+#X obj 9 275 cnv 15 400 60 empty empty CREATE 20 12 1 14 -195568 -66577
+0;
+#X obj 10 340 cnv 15 400 140 empty empty CONTROL 20 12 1 14 -233017
+-66577 0;
+#X obj 211 295 bng 24 250 50 0 \$0-generate \$0-generate generate 0
+-6 0 8 -24198 -1 -1;
+#N canvas 392 0 718 819 activate 0;
+#X obj 233 238 r \$0-msd;
+#X obj 233 453 gem_masses;
+#X obj 313 445 gem_links;
+#X obj 177 113 gemhead;
+#X obj 233 396 route massesPos linksPos;
+#X obj 97 710 gemwin;
+#X msg 97 683 0 \, destroy;
+#X obj 249 354 s \$0-msd-out;
+#X obj 97 597 select 1 0;
+#X obj 97 569 tgl 24 0 empty empty GEM 0 -6 0 8 -262144 -1 -1 0 1;
+#X obj 275 330 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 279 192 s pollpos;
+#X obj 165 22 inlet data_only;
+#X obj 39 488 inlet GEM;
+#X obj 341 40 inlet speed;
+#X obj 20 550 select 1;
+#X msg 20 575 0;
+#X obj 38 512 t f f;
+#X obj 54 90 select 1;
+#X msg 54 115 0;
+#X obj 72 52 t f f;
+#X msg 135 283 set \$1;
+#X msg 14 639 set \$1;
+#X obj 141 309 outlet;
+#X obj 15 665 outlet;
+#X obj 167 92 metro 20;
+#X obj 413 395 r \$0-gem-masses-on;
+#X obj 415 439 r \$0-gem-links-on;
+#X obj 279 171 spigot 1;
+#X obj 330 145 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 obj 297 238 r \$0-save-msd;
+#X obj 257 286 s \$0-msd2save;
+#X obj 255 261 spigot 0;
+#N canvas 0 0 788 568 msd 0;
+#N canvas 0 0 450 300 demux 0;
+#X obj 91 69 inlet;
+#X obj 255 73 inlet;
+#X obj 223 106 select 0;
+#X obj 73 213 spigot 1;
+#X obj 165 219 spigot 0;
+#X obj 141 188 unpack 1 0;
+#X obj 96 255 outlet;
+#X obj 173 257 outlet;
+#X msg 174 140 1 0;
+#X msg 216 140 0 1;
+#X connect 0 0 3 0;
+#X connect 0 0 4 0;
+#X connect 1 0 2 0;
+#X connect 2 0 8 0;
+#X connect 2 1 9 0;
+#X connect 3 0 6 0;
+#X connect 4 0 7 0;
+#X connect 5 0 3 1;
+#X connect 5 1 4 1;
+#X connect 8 0 5 0;
+#X connect 9 0 5 0;
+#X restore 195 170 pd demux;
+#X obj 262 133 r MSD-TYPE;
+#N canvas 0 0 450 300 demux 0;
+#X obj 91 69 inlet;
+#X obj 255 73 inlet;
+#X obj 223 106 select 0;
+#X obj 73 213 spigot 1;
+#X obj 165 219 spigot 0;
+#X obj 141 188 unpack 1 0;
+#X obj 96 255 outlet;
+#X obj 173 257 outlet;
+#X msg 174 140 1 0;
+#X msg 216 140 0 1;
+#X connect 0 0 3 0;
+#X connect 0 0 4 0;
+#X connect 1 0 2 0;
+#X connect 2 0 8 0;
+#X connect 2 1 9 0;
+#X connect 3 0 6 0;
+#X connect 4 0 7 0;
+#X connect 5 0 3 1;
+#X connect 5 1 4 1;
+#X connect 8 0 5 0;
+#X connect 9 0 5 0;
+#X restore 198 305 pd demux;
+#X obj 261 282 r MSD-TYPE;
+#X obj 195 136 inlet;
+#X obj 198 366 outlet;
+#N canvas 0 0 450 300 demux 0;
+#X obj 91 69 inlet;
+#X obj 255 73 inlet;
+#X obj 223 106 select 0;
+#X obj 73 213 spigot 1;
+#X obj 165 219 spigot 0;
+#X obj 141 188 unpack 1 0;
+#X obj 96 255 outlet;
+#X obj 173 257 outlet;
+#X msg 174 140 1 0;
+#X msg 216 140 0 1;
+#X connect 0 0 3 0;
+#X connect 0 0 4 0;
+#X connect 1 0 2 0;
+#X connect 2 0 8 0;
+#X connect 2 1 9 0;
+#X connect 3 0 6 0;
+#X connect 4 0 7 0;
+#X connect 5 0 3 1;
+#X connect 5 1 4 1;
+#X connect 8 0 5 0;
+#X connect 9 0 5 0;
+#X restore 377 303 pd demux;
+#X obj 442 280 r MSD-TYPE;
+#X obj 377 371 outlet;
+#X obj 200 233 msd2D;
+#X obj 350 233 msd3D;
+#X connect 0 0 9 0;
+#X connect 0 1 10 0;
+#X connect 1 0 0 1;
+#X connect 2 0 5 0;
+#X connect 2 1 5 0;
+#X connect 3 0 2 1;
+#X connect 4 0 0 0;
+#X connect 6 0 8 0;
+#X connect 6 1 8 0;
+#X connect 7 0 6 1;
+#X connect 9 0 2 0;
+#X connect 9 1 6 0;
+#X connect 10 0 2 0;
+#X connect 10 1 6 0;
+#X restore 233 308 pd msd;
+#X obj 357 676 gemhead;
+#X obj 357 699 world_light;
+#X obj 147 617 r \$0-fullscreen;
+#X obj 97 634 f 0;
+#X msg 97 659 reset \, lighting 1 \, fullscreen \$1 \, create \, 1
+;
+#X obj 535 568 pack 0 0 0;
+#X obj 540 699 s \$0-msd;
+#X msg 537 594 grabMass \$1 \$2 \$3;
+#X obj 602 540 t b f;
+#X obj 535 540 - 4;
+#X obj 572 539 + 4;
+#X obj 538 506 gemmouse 8 -8;
+#X obj 537 652 spigot 1;
+#X obj 591 630 r \$0-gemgrab;
+#X obj 353 175 s GEMBANG-GLOBAL;
+#X msg 432 671 0.6 0.8 0.4;
+#X obj 167 137 t b b b b;
+#X msg 167 216 get massesPos \, get linksPos \, get massesSpeeds;
+#X floatatom 265 121 5 0 0 0 - - -;
+#X msg 293 85 frame \$1;
+#X floatatom 331 67 5 0 0 0 - - -;
+#X obj 547 394 r \$0-show-mids;
+#X connect 0 0 41 0;
+#X connect 0 0 42 0;
+#X connect 3 0 59 0;
+#X connect 4 0 14 0;
+#X connect 4 0 37 0;
+#X connect 4 1 15 0;
+#X connect 4 1 38 0;
+#X connect 6 0 5 0;
+#X connect 8 0 46 0;
+#X connect 8 1 6 0;
+#X connect 9 0 8 0;
+#X connect 9 0 14 1;
+#X connect 9 0 15 1;
+#X connect 9 0 28 0;
+#X connect 13 0 27 0;
+#X connect 13 0 31 0;
+#X connect 14 0 1 0;
+#X connect 15 0 2 0;
+#X connect 18 0 26 0;
+#X connect 19 0 23 0;
+#X connect 20 0 31 1;
+#X connect 21 0 22 0;
+#X connect 22 0 13 0;
+#X connect 23 0 9 0;
+#X connect 23 1 21 0;
+#X connect 24 0 25 0;
+#X connect 25 0 9 0;
+#X connect 26 0 13 0;
+#X connect 26 1 24 0;
+#X connect 27 0 29 0;
+#X connect 28 0 30 0;
+#X connect 31 0 59 0;
+#X connect 32 0 1 1;
+#X connect 33 0 2 1;
+#X connect 34 0 17 0;
+#X connect 35 0 34 1;
+#X connect 36 0 38 1;
+#X connect 36 0 37 1;
+#X connect 37 0 11 0;
+#X connect 38 0 12 0;
+#X connect 39 0 41 1;
+#X connect 41 0 40 0;
+#X connect 42 0 7 0;
+#X connect 42 0 4 0;
+#X connect 42 1 10 0;
+#X connect 43 0 44 0;
+#X connect 45 0 46 1;
+#X connect 46 0 47 0;
+#X connect 47 0 5 0;
+#X connect 48 0 50 0;
+#X connect 50 0 55 0;
+#X connect 51 0 48 0;
+#X connect 51 1 48 2;
+#X connect 52 0 48 0;
+#X connect 53 0 48 1;
+#X connect 54 0 52 0;
+#X connect 54 1 53 0;
+#X connect 54 2 51 0;
+#X connect 55 0 49 0;
+#X connect 56 0 55 1;
+#X connect 58 0 44 1;
+#X connect 59 0 60 0;
+#X connect 59 1 42 0;
+#X connect 59 2 34 0;
+#X connect 59 3 57 0;
+#X connect 60 0 42 0;
+#X connect 62 0 3 0;
+#X connect 63 0 62 0;
+#X connect 64 0 1 2;
+#X restore 31 416 pd activate;
+#X obj 31 381 tgl 24 0 empty empty GEM 0 -6 0 8 -195568 -1 -1 0 1;
+#X obj 67 381 tgl 24 0 empty empty Datastructures 0 -6 0 8 -1 -262144
+-1 0 1;
+#X floatatom 103 396 5 10 1000 2 frequency - -;
+#N canvas 602 189 584 687 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 4000 1;
+#X obj 295 230 vsl 24 128 -5 5 0 1 empty empty empty 0 -8 0 8 -262144
+-1 -1 8496 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 obj 63 560 pack 0 0;
+#X floatatom 63 536 5 0 0 0 posZ - -;
+#X obj 63 610 s \$0-msd;
+#X msg 63 583 posZ \$2 \$1;
+#X msg 295 388 forceY 0-m \$1;
+#X msg 391 388 forceX 0-m \$1;
+#X obj 324 600 s \$0-msd;
+#X obj 327 530 hsl 128 24 -5 5 0 0 empty empty empty -2 -6 0 8 -233017
+-1 -1 0 1;
+#X obj 324 470 tgl 24 0 empty empty constant? 0 -6 0 8 -262144 -1 -1
+0 1;
+#X obj 324 501 metro 10;
+#X msg 324 563 forceZ 0-m \$1;
+#X msg 393 501 0;
+#X connect 1 0 34 0;
+#X connect 2 0 33 0;
+#X connect 3 0 5 0;
+#X connect 4 0 6 0;
+#X connect 5 0 2 0;
+#X connect 6 0 1 0;
+#X connect 7 0 1 0;
+#X connect 8 0 2 0;
+#X connect 10 0 18 0;
+#X connect 11 0 17 0;
+#X connect 12 0 10 0;
+#X connect 13 0 12 1;
+#X connect 13 0 14 1;
+#X connect 13 0 20 1;
+#X connect 13 0 24 1;
+#X connect 13 0 29 1;
+#X connect 14 0 11 0;
+#X connect 15 0 12 0;
+#X connect 16 0 19 0;
+#X connect 19 0 14 0;
+#X connect 20 0 23 0;
+#X connect 21 0 20 0;
+#X connect 23 0 22 0;
+#X connect 24 0 27 0;
+#X connect 25 0 24 0;
+#X connect 27 0 26 0;
+#X connect 29 0 32 0;
+#X connect 30 0 29 0;
+#X connect 32 0 31 0;
+#X connect 33 0 0 0;
+#X connect 34 0 0 0;
+#X connect 36 0 39 0;
+#X connect 37 0 38 0;
+#X connect 38 0 36 0;
+#X connect 39 0 35 0;
+#X connect 40 0 36 0;
+#X restore 176 450 pd forces;
+#N canvas 113 581 450 300 props 0;
+#X obj 121 232 s \$0-msd;
+#X text 244 59 Edit properties of Links.;
+#X obj 77 36 inlet;
+#X obj 123 36 inlet;
+#X obj 169 36 inlet;
+#X obj 152 101 pack 0 0;
+#X obj 239 33 inlet lsid;
+#X msg 121 179 setD \$2-l \$1;
+#X msg 94 203 setK \$2-l \$1;
+#X obj 122 123 pack 0 0;
+#X obj 76 99 pack 0 0;
+#X msg 145 150 setL \$2-l \$1;
+#X connect 2 0 10 0;
+#X connect 3 0 9 0;
+#X connect 4 0 5 0;
+#X connect 5 0 11 0;
+#X connect 6 0 5 1;
+#X connect 6 0 10 1;
+#X connect 6 0 9 1;
+#X connect 7 0 0 0;
+#X connect 8 0 0 0;
+#X connect 9 0 7 0;
+#X connect 10 0 8 0;
+#X connect 11 0 0 0;
+#X restore 268 452 pd props;
+#X obj 342 218 s pd-data;
+#X msg 342 194 clear;
+#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 800 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 -4 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 4 256;
+#N canvas 0 0 450 300 l 0;
+#X msg 35 78 0;
+#X obj 35 41 loadbang;
+#X obj 36 136 loadbang;
+#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 msg 128 75 800;
+#X msg 36 173 -4;
+#X msg 129 170 4;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 1 0 7 0;
+#X connect 2 0 8 0;
+#X connect 2 0 9 0;
+#X connect 7 0 4 0;
+#X connect 8 0 5 0;
+#X connect 9 0 6 0;
+#X restore 82 19 pd l;
+#X coords 0 0 1 1 132 135 1;
+#X restore 252 50 pd minmax;
+#X obj 177 295 tgl 24 0 MSD-TYPE \$0-MSD-TYPE 3-D 0 -6 0 8 -233017
+-1 -1 1 1;
+#X obj 28 96 msd_append;
+#X obj 10 566 cnv 15 400 60 empty empty DOC 20 12 1 14 -233017 -66577
+0;
+#X obj 182 381 tgl 15 0 \$0-gem-masses-on empty gem_m 0 -6 0 8 -225280
+-1 -1 0 1;
+#X obj 218 381 tgl 15 0 \$0-gem-links-on empty gem_l 0 -6 0 8 -225271
+-1 -1 0 1;
+#X obj 182 416 tgl 15 0 \$0-poll-ds \$0-poll-ds poll-ds -10 -6 0 8
+-225280 -1 -1 0 1;
+#X obj 218 416 tgl 15 0 \$0-set-ds \$0-set-ds set-ds 0 -6 0 8 -225271
+-1 -1 0 1;
+#X text 28 305 MSD-TYPE (2D or 3D):;
+#X obj 9 9 cnv 15 400 30 empty empty MSD-EDITOR 20 14 1 14 -128992
+-262144 0;
+#X obj 10 485 cnv 15 400 75 empty empty PERSIST 20 12 1 14 -195568
+-66577 0;
+#N canvas 460 399 104 45 save 0;
+#X obj 2 3 cnv 15 100 40 empty empty empty 20 12 0 14 -233017 -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 116 489 pd save;
+#N canvas 0 0 84 49 save 0;
+#X obj 2 3 cnv 15 75 40 empty empty empty 20 12 0 14 -233017 -66577
+0;
+#X obj 37 18 bng 20 250 50 0 empty empty saveas 0 -6 0 8 -24198 -1
+-1;
+#X obj 285 129 textfile;
+#X obj 285 64 r \$0-msd2save;
+#X obj 183 157 s \$0-generate;
+#X obj 166 270 s \$0-save-msd;
+#X msg 203 187 1;
+#X msg 138 193 0;
+#X obj 145 33 t b b b b;
+#X msg 213 55 clear;
+#X obj 285 88 prepend add;
+#X obj 138 126 del 500;
+#X obj 35 168 savepanel;
+#X msg 37 193 write \$1;
+#X obj 58 148 t b b;
+#X obj 292 202 s \$0-msd;
+#X msg 427 125 rewind;
+#X obj 7 18 bng 20 250 50 0 empty empty load 0 -6 0 8 -258699 -1 -1
+;
+#X obj 392 156 until;
+#X obj 396 102 t b b;
+#X obj 521 95 openpanel;
+#X msg 523 120 read \$1;
+#X obj 526 145 t b a;
+#X connect 1 0 8 0;
+#X connect 2 0 15 0;
+#X connect 2 1 18 1;
+#X connect 3 0 10 0;
+#X connect 6 0 5 0;
+#X connect 7 0 5 0;
+#X connect 8 1 11 0;
+#X connect 8 2 4 0;
+#X connect 8 3 6 0;
+#X connect 8 3 9 0;
+#X connect 9 0 2 0;
+#X connect 10 0 2 0;
+#X connect 11 0 14 0;
+#X connect 12 0 13 0;
+#X connect 13 0 2 0;
+#X connect 14 0 12 0;
+#X connect 14 1 7 0;
+#X connect 16 0 2 0;
+#X connect 17 0 20 0;
+#X connect 18 0 2 0;
+#X connect 19 0 18 0;
+#X connect 19 1 16 0;
+#X connect 20 0 21 0;
+#X connect 21 0 22 0;
+#X connect 22 0 19 0;
+#X connect 22 1 2 0;
+#X coords 0 0 1 1 77 44 1;
+#X restore 222 489 pd save;
+#X obj 285 374 vsl 15 64 0 10 0 0 empty empty D 0 -8 0 8 -195568 -1
+-1 0 1;
+#X obj 302 374 vsl 15 64 0 1 0 0 empty empty L 0 -8 0 8 -195568 -1
+-1 0 1;
+#X obj 268 374 vsl 15 64 0 100 0 0 empty empty K 0 -8 0 8 -195568 -1
+-1 0 1;
+#N canvas 504 489 531 315 TODO 0;
+#X text 146 11 TODO :: IDEAS;
+#X text 41 56 Oriented Links. It's best to create new data structures
+for this \, as the old link DS is quite loaded already.;
+#X restore 197 573 pd TODO;
+#N canvas 307 452 509 305 NEWS 0;
+#X text 32 24 RecentChanges;
+#X text 43 67 Links: D2 was killed \, L was born.;
+#X text 43 100 SID for Links and masses: Symbolic ids can now be set.
+You supply a number \, which will get transformed into a symbol id
+(sid) #-m for masses and #-l for standard Links.;
+#X restore 146 573 pd NEWS;
+#N canvas 387 277 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 obj 73 654 mass-set 0;
+#X obj 109 596 mass-set 1;
+#X obj 130 639 mass-set 2;
+#X obj 188 434 mass-set 3;
+#X restore 523 45 pd setter;
+#N canvas 0 0 1257 922 lsetter 0;
+#X obj 130 639 link-set 0;
+#X obj 109 596 link-set 1;
+#X obj 109 596 link-set 2;
+#X obj 73 654 link-set 3;
+#X obj 73 654 link-set 4;
+#X obj 73 654 link-set 5;
+#X restore 522 68 pd lsetter;
+#X text 506 21 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 627 48 clear;
+#X obj 627 75 s pd-setter;
+#X obj 627 95 s pd-lsetter;
+#X msg 531 346 massesForcesL;
+#X msg 630 225 massesPosYL;
+#N canvas 0 0 450 300 msd-type 0;
+#X obj 94 78 r MSD-TYPE;
+#X obj 89 201 s \$0-MSD-TYPE;
+#X obj 98 136 select 0;
+#X msg 89 168 label 2-D;
+#X msg 185 170 label 3-D;
+#X connect 0 0 2 0;
+#X connect 2 0 3 0;
+#X connect 2 1 4 0;
+#X connect 3 0 1 0;
+#X connect 4 0 1 0;
+#X restore 415 123 pd msd-type;
+#N canvas 6 378 553 343 camera 0;
+#X obj 161 31 gemhead;
+#X obj 162 82 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+;
+#X obj 185 63 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+;
+#X obj 234 108 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+1;
+#X obj 260 86 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+;
+#X msg 234 124 left \$1;
+#X msg 260 102 right \$1;
+#X obj 75 120 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+;
+#X obj 101 98 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+;
+#X msg 101 114 up \$1;
+#X msg 75 136 down \$1;
+#X msg 267 58 reset;
+#X msg 185 80 forward \$1;
+#X msg 162 98 reverse \$1;
+#X msg 66 252 speed \$1;
+#X floatatom 66 232 5 0 0 0 - - -;
+#X floatatom 67 195 5 0 0 0 - - -;
+#X msg 379 150 lookX \$1;
+#X msg 379 187 lookY \$1;
+#X msg 379 223 lookZ \$1;
+#X floatatom 379 134 5 0 0 0 - - -;
+#X floatatom 379 207 5 0 0 0 - - -;
+#X floatatom 379 170 5 0 0 0 - - -;
+#X msg 67 213 distance \$1;
+#X obj 114 182 f 4;
+#X obj 181 237 +;
+#X obj 183 185 camera;
+#X connect 0 0 26 0;
+#X connect 1 0 13 0;
+#X connect 2 0 12 0;
+#X connect 3 0 5 0;
+#X connect 4 0 6 0;
+#X connect 5 0 26 0;
+#X connect 6 0 26 0;
+#X connect 7 0 10 0;
+#X connect 8 0 9 0;
+#X connect 9 0 26 0;
+#X connect 10 0 26 0;
+#X connect 11 0 26 0;
+#X connect 12 0 26 0;
+#X connect 13 0 26 0;
+#X connect 14 0 26 0;
+#X connect 15 0 14 0;
+#X connect 16 0 23 0;
+#X connect 17 0 26 0;
+#X connect 18 0 26 0;
+#X connect 19 0 26 0;
+#X connect 20 0 17 0;
+#X connect 21 0 19 0;
+#X connect 22 0 18 0;
+#X connect 23 0 26 0;
+#X connect 24 0 23 0;
+#X restore 416 83 pd camera;
+#N canvas 0 0 450 300 msynth 0;
+#X restore 522 89 pd msynth;
+#N canvas 0 0 1257 922 lsynth 0;
+#X restore 521 109 pd lsynth;
+#X obj 627 117 s pd-msynt;
+#X obj 627 137 s pd-lsynth;
+#X obj 63 101 tgl 16 0 \$0-gensynth \$0-gensynth l-synthesis 0 -6 0
+8 -262144 -1 -1 0 1;
+#X symbolatom 96 105 10 0 0 1 link-synth - #0-lsynth-name;
+#X symbolatom 99 138 10 0 0 1 masses-synth - #0-msynth-name;
+#X obj 62 137 tgl 16 0 \$0-gensynth-m \$0-gensynth-m m-synthesis 0
+-6 0 8 -262144 -1 -1 0 1;
+#X obj 420 381 netsend;
+#X obj 420 354 prepend send;
+#X msg 419 407 connect localhost 7777;
+#N canvas 0 0 582 592 save-trans 0;
+#X obj 28 53 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 28 72 savepanel;
+#X obj 28 121 s \$0-mid2msdid;
+#X msg 28 95 write \$1;
+#X text 118 84 Save mis2msdid table to disk.;
+#X obj 76 42 inlet;
+#X connect 0 0 1 0;
+#X connect 1 0 3 0;
+#X connect 3 0 2 0;
+#X connect 5 0 1 0;
+#X restore 413 180 pd save-trans;
+#X msg 413 157 bang;
+#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 38 0 47 0;
+#X connect 38 0 48 0;
+#X connect 41 0 37 0;
+#X connect 42 0 33 0;
+#X connect 54 0 53 0;
+#X connect 55 0 53 0;
+#X connect 57 0 56 0;
+#X restore 248 573 pd ignore this;
+#N canvas 0 0 489 250 help 0;
+#N canvas 0 0 450 300 visualize? 0;
+#X text 18 91 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 19 172 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 56 39 Help on Visualization;
+#X restore 301 169 pd visualize?;
+#N canvas 0 0 450 300 append? 0;
+#X text 36 72 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 text 29 29 Help on Mass creation;
+#X text 34 122 Use the greenish "geos" bang to open a subwindow for
+creating masses in geometric formations: circles and rectangles.;
+#X restore 303 70 pd append?;
+#N canvas 0 0 537 336 links? 0;
+#X text 47 77 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. :);
+#X text 32 26 Help on Link Creation;
+#X text 44 148 The keyboard shortcut "L" is only active \, if the green
+toggle "Keys" is set to on. Otherwise use the yellow "link" bang.;
+#X text 45 196 More ways to create links: left-to-right connects masses
+from left to right. The keyboard shortcut for this is "R" (for "Right"
+\, as "L" is for "Links"). one2many will connect one mass to many others
+and has no shortcuts. First select the first mass \, then set the toggle
+to 1 \, after that select the other masses and set toggle to 0;
+#X restore 302 94 pd links?;
+#N canvas 0 0 450 300 generate? 0;
+#X text 19 98 Press "generate" to generate messages to the msd object
+and create the physical model inside. You can select which type of
+msd* to use as well: msd2D or msd3D. With 3-D \, the Z-coordinate will
+default to a value of zero.;
+#X text 31 38 Help on MSD generation;
+#X restore 302 144 pd generate?;
+#N canvas 0 0 215 157 minmax? 0;
+#X text 38 35 Data structs and;
+#X text 38 49 GEM like different;
+#X text 38 63 coordinate systems.;
+#X text 38 87 Set the mapping;
+#X text 38 101 between both here.;
+#X restore 302 118 pd minmax?;
+#X text 39 18 HELP / USAGE;
+#X text 143 71 How to create masses:;
+#X text 143 94 How to create links:;
+#X text 102 118 Coordinates in MSD-Editor:;
+#X text 109 146 Generate the MSD-Network:;
+#X text 17 170 Visualize the network using GEM or DS:;
+#X restore 95 573 pd help;
+#X obj 32 450 tgl 16 0 \$0-fullscreen \$0-fullscreen fullscreen 0 -6
+0 8 -195568 -1 -1 0 1;
+#X obj 319 427 nbx 5 14 -1e+37 1e+37 0 0 empty empty link-sid 0 -6
+0 10 -195568 -1 -1 0 256;
+#X obj 95 601 structures;
+#X obj 252 194 cnv 15 84 42 empty empty empty 2 8 1 10 -1 -66577 0
+;
+#X obj 253 195 cnv 15 82 40 empty empty EDIT_AREA 2 8 1 10 -225271
+-66577 0;
+#N canvas 0 35 1022 952 data 0;
+#X scalar liaison 130.917 639.836 188 434 2 3 0 10 2.5 1 0 1e+10 0
+\;;
+#X scalar liaison 109.715 596.152 188 434 1 3 1 10 2.5 1 0 1e+10 0
+\;;
+#X scalar liaison 109.715 596.152 130.917 639.836 1 2 2 10 2.5 1 0
+1e+10 0 \;;
+#X scalar liaison 73.418 654.69 188 434 0 3 3 10 2.5 1 0 1e+10 0 \;
+;
+#X scalar liaison 73.418 654.69 130.917 639.836 0 2 4 10 2.5 1 0 1e+10
+0 \;;
+#X scalar liaison 73.418 654.69 109.715 596.152 0 1 5 10 2.5 1 0 1e+10
+0 \;;
+#X scalar mass 73.418 654.69 0 0 100 0 \;;
+#X scalar mass 109.715 596.152 1 0 100 0 \;;
+#X scalar mass 130.917 639.836 2 0 100 0 \;;
+#X scalar mass 188 434 3 900 100 0 \;;
+#X restore 269 214 pd data;
+#X obj 265 295 bng 24 250 50 0 \$0-set-from-ds \$0-set-from-ds set-from-ds
+0 -6 0 8 -225271 -1 -1;
+#N canvas 0 0 450 300 testing 0;
+#N canvas 39 482 450 300 mass-lines 0;
+#X text 26 19 Paint a line of masses between two masses. First select
+two masses \, then press this bang:;
+#X obj 41 86 bng 20 250 50 0 \$0-massline \$0-massline massline 0 -6
+0 8 -262144 -1 -1;
+#N canvas 65 73 818 854 make-ml 0;
+#X obj 254 188 pointer mass;
+#X msg 254 156 traverse pd-data \, vnext 1;
+#X obj 455 170 s pd-data;
+#X msg 455 149 sort;
+#X text 489 149 first sort left to right;
+#X obj 254 132 t b b b;
+#X obj 301 111 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 141 186 ds-vnext;
+#X obj 380 390 get mass x y;
+#X obj 252 394 get mass x y;
+#X obj 341 531 -;
+#X obj 265 529 -;
+#X obj 344 585 / 5;
+#X obj 263 588 / 5;
+#X obj 48 368 - 1;
+#X obj 33 271 inlet;
+#X obj 28 393 f 4;
+#X obj 185 722 pack 0 0 0;
+#X obj 91 275 inlet;
+#X obj 87 296 select 0 1;
+#X msg 90 322 0;
+#X msg 123 321 900;
+#X obj 214 98 t b b;
+#X obj 219 68 r \$0-massline;
+#X obj 185 777 s \$0-newmass;
+#X obj 276 271 f 0;
+#X obj 306 271 + 1;
+#X msg 289 244 0;
+#X obj 280 332 route 1 0;
+#X obj 254 211 t b b p;
+#X obj 280 300 pack 0 p;
+#X obj 322 70 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 31 483 countto;
+#X obj 33 456 pack 1 0;
+#X obj 30 420 t b f;
+#X obj 91 572 f 0;
+#X obj 147 591 *;
+#X obj 109 621 +;
+#X obj 193 641 f 0;
+#X obj 243 646 *;
+#X obj 211 674 +;
+#X obj 107 647 t b f;
+#X obj 124 693 f;
+#X obj 30 751 print countto;
+#X obj 607 632 inlet linkit;
+#X obj 543 727 link2masses;
+#X obj 615 677 r \$0-link-param;
+#X obj 622 479 pointer;
+#X obj 495 477 pointer;
+#X text 548 479 first;
+#X text 686 477 last mass;
+#X obj 69 514 t f b b f;
+#X obj 536 617 pack p p;
+#X obj 526 513 r \$0-lastmass;
+#X obj 482 545 pointer;
+#X obj 413 488 t b b;
+#X obj 225 355 t b a a;
+#X obj 415 458 select 1;
+#X obj 577 366 select 1;
+#X obj 476 511 t b;
+#X obj 525 592 t p p;
+#X obj 610 426 t b b b;
+#X obj 557 671 spigot;
+#X connect 0 0 29 0;
+#X connect 0 1 7 0;
+#X connect 1 0 0 0;
+#X connect 3 0 2 0;
+#X connect 5 0 1 0;
+#X connect 5 2 3 0;
+#X connect 5 2 27 0;
+#X connect 6 0 5 0;
+#X connect 7 0 0 0;
+#X connect 8 0 11 1;
+#X connect 8 0 35 1;
+#X connect 8 1 10 1;
+#X connect 8 1 38 1;
+#X connect 9 0 11 0;
+#X connect 9 1 10 0;
+#X connect 10 0 12 0;
+#X connect 11 0 13 0;
+#X connect 12 0 39 1;
+#X connect 13 0 36 1;
+#X connect 14 0 16 1;
+#X connect 15 0 13 1;
+#X connect 15 0 12 1;
+#X connect 15 0 14 0;
+#X connect 16 0 34 0;
+#X connect 17 0 24 0;
+#X connect 18 0 19 0;
+#X connect 19 0 20 0;
+#X connect 19 1 21 0;
+#X connect 20 0 42 1;
+#X connect 21 0 42 1;
+#X connect 22 1 5 0;
+#X connect 23 0 22 0;
+#X connect 25 0 26 0;
+#X connect 25 0 30 0;
+#X connect 26 0 25 1;
+#X connect 27 0 25 1;
+#X connect 28 0 56 0;
+#X connect 28 1 8 0;
+#X connect 28 1 48 1;
+#X connect 29 0 7 0;
+#X connect 29 1 25 0;
+#X connect 29 2 30 1;
+#X connect 30 0 28 0;
+#X connect 31 0 22 0;
+#X connect 32 0 43 0;
+#X connect 32 0 51 0;
+#X connect 33 0 32 0;
+#X connect 34 0 33 0;
+#X connect 34 1 33 1;
+#X connect 34 1 58 1;
+#X connect 35 0 37 0;
+#X connect 36 0 37 1;
+#X connect 37 0 41 0;
+#X connect 38 0 40 0;
+#X connect 39 0 40 1;
+#X connect 40 0 17 2;
+#X connect 41 0 42 0;
+#X connect 41 1 17 1;
+#X connect 42 0 17 0;
+#X connect 44 0 62 1;
+#X connect 46 0 45 1;
+#X connect 47 0 52 1;
+#X connect 48 0 52 1;
+#X connect 51 0 57 0;
+#X connect 51 1 35 0;
+#X connect 51 2 38 0;
+#X connect 51 3 39 0;
+#X connect 51 3 36 0;
+#X connect 52 0 62 0;
+#X connect 53 0 54 1;
+#X connect 54 0 60 0;
+#X connect 55 0 54 0;
+#X connect 55 1 48 0;
+#X connect 56 0 16 0;
+#X connect 56 1 9 0;
+#X connect 56 2 47 1;
+#X connect 57 0 55 0;
+#X connect 57 1 58 0;
+#X connect 58 0 61 0;
+#X connect 58 1 59 0;
+#X connect 59 0 54 0;
+#X connect 60 0 52 1;
+#X connect 60 1 52 0;
+#X connect 61 0 54 0;
+#X connect 61 1 47 0;
+#X connect 61 2 59 0;
+#X connect 62 0 45 0;
+#X restore 108 92 pd make-ml;
+#X obj 173 69 tgl 15 0 empty empty fix/mob 0 -6 0 8 -262144 -1 -1 0
+1;
+#X floatatom 108 71 5 0 0 2 howmany - -;
+#X obj 73 89 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+;
+#X connect 3 0 2 1;
+#X connect 4 0 2 0;
+#X connect 5 0 2 2;
+#X restore 40 32 pd mass-lines;
+#N canvas 14 85 865 862 mousepaint 0;
+#X obj 45 97 tot data;
+#X obj 99 136 route motion mouseup mouse key;
+#X msg 45 69 capture \$1;
+#X obj 45 46 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+;
+#X obj 106 258 pack 0 0 0;
+#X obj 106 293 s \$0-newmass;
+#X obj 455 410 link2masses;
+#X obj 527 360 r \$0-link-param;
+#X obj 457 192 r \$0-lastmass;
+#X obj 407 190 t b;
+#X obj 456 271 t p p;
+#X obj 204 194 print mouse;
+#X obj 592 194 r \$0-lastmass;
+#X obj 548 226 pointer;
+#X msg 134 232 \$1;
+#X msg 160 232 \$2;
+#X obj 455 318 pack p p;
+#X obj 413 224 pointer;
+#X msg 96 228 900;
+#X obj 134 166 t b a a;
+#X msg 49 183 \$3;
+#X obj 51 205 select 1 2;
+#X msg 41 229 0;
+#X obj 100 33 inlet;
+#X connect 0 2 1 0;
+#X connect 1 2 11 0;
+#X connect 1 2 19 0;
+#X connect 2 0 0 0;
+#X connect 3 0 2 0;
+#X connect 4 0 5 0;
+#X connect 7 0 6 1;
+#X connect 8 0 17 1;
+#X connect 9 0 17 0;
+#X connect 10 0 16 1;
+#X connect 10 1 16 0;
+#X connect 12 0 13 1;
+#X connect 14 0 4 1;
+#X connect 15 0 4 2;
+#X connect 16 0 6 0;
+#X connect 17 0 10 0;
+#X connect 18 0 4 0;
+#X connect 19 0 17 0;
+#X connect 19 1 20 0;
+#X connect 19 2 14 0;
+#X connect 19 2 15 0;
+#X connect 20 0 21 0;
+#X connect 21 0 22 0;
+#X connect 21 1 18 0;
+#X connect 22 0 4 0;
+#X connect 23 0 2 0;
+#X restore 31 97 pd mousepaint;
+#X obj 31 74 tgl 15 0 empty empty capture 0 -6 0 8 -262144 -1 -1 0
+1;
+#X connect 2 0 1 0;
+#X restore 175 601 pd testing;
+#X obj 24 79 r \$0-newmass;
+#X obj 17 226 s \$0-lastmass;
+#X obj 110 250 s \$0-link-param;
+#X obj 110 50 morelinks;
+#N canvas 0 0 450 300 guts 0;
+#N canvas 366 103 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 text 122 470 This still is not prepared to handle symbolic IDs!!!
+;
+#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 184 255 t b p;
+#X obj 214 402 scale-ds2msd;
+#X obj 120 251 ds-next;
+#X obj 214 362 get mass x y mid mob M sid;
+#X obj 214 444 pack 0 0 0 0 0 0;
+#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 14 0;
+#X connect 2 1 16 0;
+#X connect 2 2 13 0;
+#X connect 3 0 5 0;
+#X connect 3 1 4 0;
+#X connect 4 0 18 3;
+#X connect 5 0 18 3;
+#X connect 7 0 8 0;
+#X connect 7 0 9 0;
+#X connect 11 0 0 0;
+#X connect 14 0 16 0;
+#X connect 14 1 17 0;
+#X connect 15 0 18 0;
+#X connect 15 1 18 1;
+#X connect 16 0 2 0;
+#X connect 17 0 15 0;
+#X connect 17 1 15 1;
+#X connect 17 2 18 2;
+#X connect 17 3 3 0;
+#X connect 17 4 18 4;
+#X connect 17 5 18 5;
+#X connect 18 0 12 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 364 418 outlet;
+#X obj 354 170 inlet;
+#X obj 192 389 outlet;
+#X text 142 412 Now set lid field of links.;
+#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 obj 316 298 get liaison sid mid1 mid2 K D P Lmin Lmax;
+#X obj 364 385 pack 0 0 0 0 0 0 0 0;
+#X connect 0 0 2 0;
+#X connect 0 1 9 0;
+#X connect 0 2 5 0;
+#X connect 1 0 0 0;
+#X connect 2 0 9 0;
+#X connect 2 1 11 0;
+#X connect 4 0 10 0;
+#X connect 8 0 10 1;
+#X connect 9 0 0 0;
+#X connect 10 0 1 0;
+#X connect 11 0 12 0;
+#X connect 11 1 12 1;
+#X connect 11 2 12 2;
+#X connect 11 3 12 3;
+#X connect 11 4 12 4;
+#X connect 11 5 12 5;
+#X connect 11 6 12 6;
+#X connect 11 7 12 7;
+#X connect 12 0 3 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;
+#X text 317 325 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.;
+#N canvas 283 271 635 631 set-lid-alternative 0;
+#X obj 43 72 t b b b b b b b;
+#X msg 79 168 traverse pd-data \, next;
+#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 79 247 t b b b b p p;
+#X obj 43 24 inlet;
+#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 obj 79 200 pointer liaison;
+#X obj 96 396 set liaison lid;
+#X connect 0 5 1 0;
+#X connect 1 0 9 0;
+#X connect 2 0 10 0;
+#X connect 3 0 7 0;
+#X connect 3 1 2 0;
+#X connect 3 5 10 1;
+#X connect 4 0 8 0;
+#X connect 6 0 8 1;
+#X connect 7 0 9 0;
+#X connect 8 0 0 0;
+#X connect 9 0 3 0;
+#X connect 9 1 7 0;
+#X restore 148 329 pd set-lid-alternative;
+#X text 319 346 This is simpler and may work as well. It depends on
+sorted data structures.;
+#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 16 0;
+#X connect 7 1 3 0;
+#X restore 131 221 pd getter;
+#X obj 131 369 s \$0-msd;
+#X msg 170 107 reset;
+#X obj 170 132 s \$0-msd;
+#X obj 112 80 t b b b b;
+#N canvas 338 182 781 563 make-setters 0;
+#X obj 262 451 s pd-setter;
+#X obj 136 109 t b b b b;
+#X obj 262 337 get mass x y mid;
+#X msg 262 404 obj \$1 \$2 mass-set \$3;
+#X obj 262 360 pack 0 0 0;
+#X obj 171 335 s mypointer;
+#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 506 373 pack 0 0 0;
+#X obj 506 350 get liaison x1 y1 lid;
+#X msg 506 417 obj \$1 \$2 link-set \$3;
+#X obj 506 462 s pd-lsetter;
+#X obj 194 186 s pd-lsetter;
+#X obj 399 350 s myliapointer;
+#X obj 136 487 outlet;
+#X text 196 487 Post-Actions;
+#X obj 401 270 t b p p;
+#X obj 174 272 t b p p;
+#N canvas 0 0 450 300 next 0;
+#X obj 140 92 inlet;
+#X obj 140 215 outlet;
+#X msg 140 169 next;
+#X obj 140 134 del 0;
+#X connect 0 0 3 0;
+#X connect 2 0 1 0;
+#X connect 3 0 2 0;
+#X restore 37 267 pd next;
+#X msg 174 213 traverse pd-data;
+#X obj 136 443 del 1;
+#N canvas 0 0 859 632 1002-make-lsynth 0;
+#X obj 190 186 pack 0 0 0 s;
+#X obj 190 121 spigot;
+#X obj 283 149 r \$0-lsynth-name;
+#X msg 190 209 obj \$1 \$2 \$4 \$3;
+#X obj 190 77 inlet;
+#X obj 190 153 unpack 0 0 0;
+#X obj 234 66 r \$0-gensynth;
+#X obj 190 234 s pd-lsynth;
+#X connect 0 0 3 0;
+#X connect 1 0 5 0;
+#X connect 2 0 0 3;
+#X connect 3 0 7 0;
+#X connect 4 0 1 0;
+#X connect 5 0 0 0;
+#X connect 5 1 0 1;
+#X connect 5 2 0 2;
+#X connect 6 0 1 1;
+#X restore 590 397 pd \$0-make-lsynth;
+#N canvas 0 0 859 632 1002-make-msynth 0;
+#X obj 190 186 pack 0 0 0 s;
+#X msg 190 209 obj \$1 \$2 \$4 \$3;
+#X obj 190 77 inlet;
+#X obj 190 153 unpack 0 0 0;
+#X obj 192 232 s pd-msynth;
+#X obj 285 149 r \$0-msynth-name;
+#X obj 236 66 r \$0-gensynth-m;
+#X obj 190 121 spigot;
+#X connect 0 0 1 0;
+#X connect 1 0 4 0;
+#X connect 2 0 7 0;
+#X connect 3 0 0 0;
+#X connect 3 1 0 1;
+#X connect 3 2 0 2;
+#X connect 5 0 0 3;
+#X connect 6 0 7 1;
+#X connect 7 0 3 0;
+#X restore 290 383 pd \$0-make-msynth;
+#X obj 328 126 spigot 0;
+#X obj 329 167 s pd-msynth;
+#X obj 419 167 s pd-lsynth;
+#X msg 329 144 clear;
+#X obj 418 126 spigot 0;
+#X msg 419 144 clear;
+#X obj 469 99 r \$0-gensynth;
+#X obj 379 76 r \$0-gensynth-m;
+#X connect 1 0 22 0;
+#X connect 1 1 20 0;
+#X connect 1 2 21 0;
+#X connect 1 3 6 0;
+#X connect 1 3 25 0;
+#X connect 1 3 29 0;
+#X connect 2 0 4 0;
+#X connect 2 1 4 1;
+#X connect 2 2 4 2;
+#X connect 3 0 0 0;
+#X connect 4 0 3 0;
+#X connect 4 0 24 0;
+#X connect 6 0 7 0;
+#X connect 6 0 14 0;
+#X connect 8 0 1 0;
+#X connect 9 0 19 0;
+#X connect 9 1 18 0;
+#X connect 10 0 12 0;
+#X connect 10 0 23 0;
+#X connect 11 0 10 0;
+#X connect 11 1 10 1;
+#X connect 11 2 10 2;
+#X connect 12 0 13 0;
+#X connect 18 0 20 0;
+#X connect 18 1 15 0;
+#X connect 18 2 11 0;
+#X connect 19 0 20 0;
+#X connect 19 1 5 0;
+#X connect 19 2 2 0;
+#X connect 20 0 9 0;
+#X connect 21 0 9 0;
+#X connect 22 0 16 0;
+#X connect 25 0 28 0;
+#X connect 28 0 26 0;
+#X connect 29 0 30 0;
+#X connect 30 0 27 0;
+#X connect 31 0 29 1;
+#X connect 32 0 25 1;
+#X restore 112 428 pd make-setters;
+#X obj 181 344 r pointer2msd;
+#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 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 obj 745 82 f 0;
+#X obj 761 54 r MSD-TYPE;
+#X obj 746 109 s MSD-TYPE;
+#X msg 339 306 Xmin \$1 \, Xmax \$2 \, Ymin \$1 \, Ymax \$2 \, Zmin
+\$1 \, Zmax \$2;
+#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 23 1;
+#X connect 9 0 17 0;
+#X connect 9 0 19 0;
+#X connect 9 0 24 1;
+#X connect 10 0 11 0;
+#X connect 11 0 20 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 11 1 25 0;
+#X connect 20 0 23 0;
+#X connect 20 1 24 0;
+#X connect 22 0 28 0;
+#X connect 23 0 22 0;
+#X connect 24 0 22 1;
+#X connect 25 0 27 0;
+#X connect 26 0 25 1;
+#X connect 28 0 21 0;
+#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 obj 172 399 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#N canvas 0 0 450 300 demux 0;
+#X obj 91 69 inlet;
+#X obj 255 73 inlet;
+#X obj 223 106 select 0;
+#X obj 73 213 spigot 1;
+#X obj 165 219 spigot 0;
+#X obj 141 188 unpack 1 0;
+#X obj 96 255 outlet;
+#X obj 173 257 outlet;
+#X msg 174 140 1 0;
+#X msg 216 140 0 1;
+#X connect 0 0 3 0;
+#X connect 0 0 4 0;
+#X connect 1 0 2 0;
+#X connect 2 0 8 0;
+#X connect 2 1 9 0;
+#X connect 3 0 6 0;
+#X connect 4 0 7 0;
+#X connect 5 0 3 1;
+#X connect 5 1 4 1;
+#X connect 8 0 5 0;
+#X connect 9 0 5 0;
+#X restore 189 246 pd demux;
+#X obj 240 219 r MSD-TYPE;
+#X obj 112 41 r \$0-generate;
+#X msg 189 275 mass \$6-m \$4 \$5 \$1 \$2;
+#X msg 341 275 mass \$6-m \$4 \$5 \$1 \$2 0;
+#X obj 150 187 s pd-data;
+#X msg 150 159 sort;
+#X msg 131 324 link \$1-l \$2 \$3 \$4 \$5 \$6 \$7 \$8;
+#X connect 0 0 18 0;
+#X connect 0 1 11 0;
+#X connect 2 0 3 0;
+#X connect 4 0 9 0;
+#X connect 4 1 0 0;
+#X connect 4 2 17 0;
+#X connect 4 3 2 0;
+#X connect 5 0 7 0;
+#X connect 6 0 1 0;
+#X connect 9 0 5 0;
+#X connect 10 0 5 0;
+#X connect 11 0 14 0;
+#X connect 11 1 15 0;
+#X connect 12 0 11 1;
+#X connect 13 0 4 0;
+#X connect 14 0 1 0;
+#X connect 15 0 1 0;
+#X connect 17 0 16 0;
+#X connect 18 0 1 0;
+#X restore 106 127 pd generator;
+#N canvas 444 101 836 641 set 0;
+#N canvas 311 93 877 551 getter 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 148 31 inlet;
+#X obj 214 494 outlet;
+#X obj 184 255 t b p;
+#X obj 214 402 scale-ds2msd;
+#X obj 120 251 ds-next;
+#X obj 214 362 get mass x y mid;
+#X obj 214 444 pack 0 0 0;
+#X connect 0 5 1 0;
+#X connect 1 0 2 0;
+#X connect 2 0 5 0;
+#X connect 2 1 7 0;
+#X connect 3 0 0 0;
+#X connect 5 0 7 0;
+#X connect 5 1 8 0;
+#X connect 6 0 9 0;
+#X connect 6 1 9 1;
+#X connect 7 0 2 0;
+#X connect 8 0 6 0;
+#X connect 8 1 6 1;
+#X connect 8 2 9 2;
+#X connect 9 0 4 0;
+#X restore 228 102 pd getter;
+#X obj 228 179 s \$0-msd;
+#X msg 213 140 posX \$3 \$1;
+#X msg 309 137 posY \$3 \$2;
+#X obj 227 80 r \$0-set-from-ds;
+#X connect 0 0 2 0;
+#X connect 0 0 3 0;
+#X connect 2 0 1 0;
+#X connect 3 0 1 0;
+#X connect 4 0 0 0;
+#X restore 148 105 pd set;
+#N canvas 410 39 529 725 edits 0;
+#N canvas 203 212 450 300 1002-show 0;
+#X obj 101 125 makefilename pd-%s;
+#X obj 50 153 pack 0 s;
+#X obj 50 63 t f b;
+#X msg 50 202 \; \$2 vis \$1;
+#X obj 50 33 inlet;
+#X obj 101 95 symbol \$0-edit-mass;
+#X connect 0 0 1 1;
+#X connect 1 0 3 0;
+#X connect 2 0 1 0;
+#X connect 2 1 5 0;
+#X connect 4 0 2 0;
+#X connect 5 0 0 0;
+#X restore 234 58 pd \$0-show;
+#X obj 234 34 tgl 20 0 empty \$0-show-masseditor edit_mass 0 -6 0 8
+-262144 -1 -1 0 1;
+#N canvas 786 268 360 441 1002-edit-mass 0;
+#X obj 48 68 nbx 5 14 -1e+37 1e+37 0 0 \$0-mob-set \$0-mob-get mob_(900=fixed)
+0 -8 1 10 -262144 -1 -1 0 256;
+#X obj 48 31 nbx 5 15 -1e+37 1e+37 0 0 \$0-mid-set \$0-mid-get mass-id
+0 -6 1 10 -1 -233017 -1 0 256;
+#X obj 48 106 nbx 5 14 -1e+37 1e+37 0 0 \$0-M-set \$0-M-get Mass 0
+-6 1 10 -262144 -1 -1 0 256;
+#X obj 48 146 nbx 5 14 -1e+37 1e+37 0 0 \$0-sid-set \$0-sid-get SymbolicID
+0 -6 1 10 -262144 -1 -1 0 256;
+#X obj 39 403 s \$0-edit-mass;
+#X msg 39 379 vnext 1;
+#X obj 48 174 nbx 5 14 -1e+37 1e+37 0 0 \$0-mx-set \$0-mx-get x 0 -6
+1 10 -262144 -1 -1 0 256;
+#X obj 48 202 nbx 5 14 -1e+37 1e+37 0 0 \$0-my-set \$0-my-get y 0 -6
+1 10 -262144 -1 -1 0 256;
+#X msg 40 356 traverse pd-data;
+#X obj 218 29 nbx 5 15 -1e+37 1e+37 0 0 \$0-set-l-lid \$0-get-l-lid
+link-id 0 -6 1 10 -1 -233017 -1 0 256;
+#X msg 215 378 vnext 1;
+#X obj 215 401 s \$0-edit-link;
+#X obj 218 63 nbx 5 15 -1e+37 1e+37 0 0 \$0-set-l-mid1 \$0-get-l-mid1
+mass1 0 -6 1 10 -262144 -1 -1 0 256;
+#X obj 218 95 nbx 5 15 -1e+37 1e+37 0 0 \$0-set-l-mid2 \$0-get-l-mid2
+mass2 0 -6 1 10 -262144 -1 -1 0 256;
+#X obj 218 131 nbx 5 15 -1e+37 1e+37 0 0 \$0-set-l-sid \$0-get-l-sid
+SymbolicID 0 -6 1 10 -262144 -1 -1 0 256;
+#X obj 218 171 nbx 5 15 -1e+37 1e+37 0 0 \$0-set-l-K \$0-get-l-K K
+0 -6 1 10 -262144 -1 -1 0 256;
+#X obj 218 201 nbx 5 15 -1e+37 1e+37 0 0 \$0-set-l-D \$0-get-l-D D
+0 -6 1 10 -262144 -1 -1 0 256;
+#X obj 218 233 nbx 5 15 -1e+37 1e+37 0 0 \$0-set-l-P \$0-get-l-P P
+0 -6 1 10 -262144 -1 -1 0 256;
+#X obj 218 265 nbx 5 15 -1e+37 1e+37 0 0 \$0-set-l-Lmin \$0-get-l-Lmin
+Lmin 0 -6 1 10 -262144 -1 -1 0 256;
+#X obj 218 301 nbx 5 15 -1e+37 1e+37 0 0 \$0-set-l-Lmax \$0-get-l-Lmax
+Lmax 0 -6 1 10 -262144 -1 -1 0 256;
+#X msg 216 354 traverse pd-data;
+#X text 39 331 Next mass:;
+#X text 215 326 Next link:;
+#X connect 5 0 4 0;
+#X connect 8 0 4 0;
+#X connect 10 0 11 0;
+#X connect 20 0 11 0;
+#X restore 42 33 pd \$0-edit-mass;
+#N canvas 0 0 589 777 1002-editmass-guts 0;
+#X obj 80 289 s \$0-mob-get;
+#X obj 45 318 s \$0-mid-get;
+#X obj 115 258 s \$0-M-get;
+#X obj 151 230 s \$0-sid-get;
+#X msg 84 175 vnext 1;
+#X obj 20 63 r \$0-edit-mass;
+#X obj 45 83 loadbang;
+#X obj 45 148 pointer mass;
+#X obj 79 382 r \$0-mob-set;
+#X obj 41 411 r \$0-mid-set;
+#X obj 153 323 r \$0-sid-set;
+#X obj 115 351 r \$0-M-set;
+#X obj 14 175 t p p;
+#X obj 267 435 set mass M;
+#X obj 350 435 set mass sid;
+#X obj 170 436 set mass mob;
+#X obj 41 439 set mass mid;
+#X obj 252 322 pointer mass;
+#X msg 45 110 traverse pd-data;
+#X obj 45 201 get mass mid mob M sid x y;
+#X obj 193 258 s \$0-mx-get;
+#X obj 244 234 s \$0-my-get;
+#X obj 99 515 set mass x;
+#X obj 253 519 set mass y;
+#X obj 99 487 r \$0-mx-set;
+#X obj 252 495 r \$0-my-set;
+#X connect 4 0 7 0;
+#X connect 5 0 7 0;
+#X connect 6 0 18 0;
+#X connect 7 0 12 0;
+#X connect 7 1 4 0;
+#X connect 7 2 18 0;
+#X connect 8 0 15 0;
+#X connect 9 0 16 0;
+#X connect 10 0 14 0;
+#X connect 11 0 13 0;
+#X connect 12 0 19 0;
+#X connect 12 1 17 0;
+#X connect 17 0 16 1;
+#X connect 17 0 15 1;
+#X connect 17 0 13 1;
+#X connect 17 0 14 1;
+#X connect 17 0 23 1;
+#X connect 17 0 22 1;
+#X connect 18 0 7 0;
+#X connect 19 0 1 0;
+#X connect 19 1 0 0;
+#X connect 19 2 2 0;
+#X connect 19 3 3 0;
+#X connect 19 4 20 0;
+#X connect 19 5 21 0;
+#X connect 24 0 22 0;
+#X connect 25 0 23 0;
+#X restore 43 59 pd \$0-editmass-guts;
+#N canvas 599 247 589 777 1002-editlinks-guts 0;
+#X msg 84 175 vnext 1;
+#X obj 45 83 loadbang;
+#X obj 14 175 t p p;
+#X msg 45 110 traverse pd-data;
+#X obj 20 63 r \$0-edit-link;
+#X obj 45 148 pointer liaison;
+#X obj 325 279 s \$0-get-l-sid;
+#X obj 289 308 s \$0-get-l-Lmax;
+#X obj 249 338 s \$0-get-l-Lmin;
+#X obj 211 370 s \$0-get-l-P;
+#X obj 178 398 s \$0-get-l-D;
+#X obj 130 419 s \$0-get-l-K;
+#X obj 10 226 get liaison mid1 mid2 lid K D P Lmin Lmax sid;
+#X obj 17 544 s \$0-get-l-mid1;
+#X obj 52 493 s \$0-get-l-mid2;
+#X obj 92 469 s \$0-get-l-lid;
+#N canvas 266 70 710 834 1002-lset 0;
+#X obj 31 44 inlet;
+#X obj 41 65 s \$0-current-set-link;
+#X obj 483 69 r \$0-current-set-link;
+#X obj 372 38 r \$0-set-l-mid2;
+#X obj 379 98 set liaison mid2;
+#X obj 169 547 r \$0-current-set-link;
+#X obj 64 550 r \$0-set-l-lid;
+#X obj 65 576 set liaison lid;
+#X obj 170 493 r \$0-current-set-link;
+#X obj 65 496 r \$0-set-l-K;
+#X obj 66 522 set liaison K;
+#X obj 164 443 r \$0-current-set-link;
+#X obj 67 440 r \$0-set-l-D;
+#X obj 158 371 r \$0-current-set-link;
+#X obj 68 468 set liaison D;
+#X obj 64 398 set liaison P;
+#X obj 61 368 r \$0-set-l-P;
+#X obj 169 316 r \$0-current-set-link;
+#X obj 56 311 r \$0-set-l-Lmin;
+#X obj 59 339 set liaison Lmin;
+#X obj 171 248 r \$0-current-set-link;
+#X obj 59 271 set liaison Lmax;
+#X obj 56 243 r \$0-set-l-Lmax;
+#X obj 174 178 r \$0-current-set-link;
+#X obj 69 181 r \$0-set-l-sid;
+#X obj 70 207 set liaison sid;
+#X obj 408 179 pointer mass;
+#X msg 409 142 traverse pd-data \, next;
+#X msg 362 180 next;
+#X obj 408 226 get mass mid;
+#X obj 399 273 select;
+#X obj 406 202 t p p;
+#X obj 402 298 pointer;
+#X obj 402 337 get mass x y;
+#X obj 374 67 t f b f;
+#X obj 503 360 r \$0-current-set-link;
+#X obj 397 386 set liaison x2 y2;
+#X obj 504 449 r \$0-current-set-link;
+#X obj 429 559 pointer mass;
+#X msg 438 528 traverse pd-data \, next;
+#X msg 383 560 next;
+#X obj 429 606 get mass mid;
+#X obj 420 653 select;
+#X obj 427 582 t p p;
+#X obj 423 678 pointer;
+#X obj 423 717 get mass x y;
+#X obj 395 447 t f b f;
+#X obj 524 740 r \$0-current-set-link;
+#X obj 391 418 r \$0-set-l-mid1;
+#X obj 400 478 set liaison mid1;
+#X obj 418 766 set liaison x1 y1;
+#X obj 401 501 t b b;
+#X obj 396 529 until;
+#X obj 363 117 t b b;
+#X obj 358 145 until;
+#X connect 0 0 1 0;
+#X connect 2 0 4 1;
+#X connect 3 0 34 0;
+#X connect 5 0 7 1;
+#X connect 6 0 7 0;
+#X connect 8 0 10 1;
+#X connect 9 0 10 0;
+#X connect 11 0 14 1;
+#X connect 12 0 14 0;
+#X connect 13 0 15 1;
+#X connect 16 0 15 0;
+#X connect 17 0 19 1;
+#X connect 18 0 19 0;
+#X connect 20 0 21 1;
+#X connect 22 0 21 0;
+#X connect 23 0 25 1;
+#X connect 24 0 25 0;
+#X connect 26 0 31 0;
+#X connect 26 1 28 0;
+#X connect 26 2 54 1;
+#X connect 27 0 26 0;
+#X connect 28 0 26 0;
+#X connect 29 0 30 0;
+#X connect 30 0 32 0;
+#X connect 31 0 29 0;
+#X connect 31 1 32 1;
+#X connect 32 0 33 0;
+#X connect 33 0 36 0;
+#X connect 33 1 36 1;
+#X connect 34 0 4 0;
+#X connect 34 1 53 0;
+#X connect 34 2 30 1;
+#X connect 35 0 36 2;
+#X connect 37 0 49 1;
+#X connect 38 0 43 0;
+#X connect 38 1 40 0;
+#X connect 38 2 52 1;
+#X connect 39 0 38 0;
+#X connect 40 0 38 0;
+#X connect 41 0 42 0;
+#X connect 42 0 44 0;
+#X connect 43 0 41 0;
+#X connect 43 1 44 1;
+#X connect 44 0 45 0;
+#X connect 45 0 50 0;
+#X connect 45 1 50 1;
+#X connect 46 0 49 0;
+#X connect 46 1 51 0;
+#X connect 46 2 42 1;
+#X connect 47 0 50 2;
+#X connect 48 0 46 0;
+#X connect 51 0 52 0;
+#X connect 51 1 39 0;
+#X connect 52 0 40 0;
+#X connect 53 0 54 0;
+#X connect 53 1 27 0;
+#X connect 54 0 28 0;
+#X restore 46 201 pd \$0-lset;
+#X msg 19 521 set \$1;
+#X msg 50 286 set \$1;
+#X msg 84 314 set \$1;
+#X msg 124 288 set \$1;
+#X msg 168 320 set \$1;
+#X msg 202 278 set \$1;
+#X msg 242 302 set \$1;
+#X msg 278 272 set \$1;
+#X msg 321 251 set \$1;
+#X connect 0 0 5 0;
+#X connect 1 0 3 0;
+#X connect 2 0 12 0;
+#X connect 2 1 16 0;
+#X connect 3 0 5 0;
+#X connect 4 0 5 0;
+#X connect 5 0 2 0;
+#X connect 5 1 0 0;
+#X connect 5 2 3 0;
+#X connect 12 0 17 0;
+#X connect 12 1 18 0;
+#X connect 12 2 19 0;
+#X connect 12 3 20 0;
+#X connect 12 4 21 0;
+#X connect 12 5 22 0;
+#X connect 12 6 23 0;
+#X connect 12 7 24 0;
+#X connect 12 8 25 0;
+#X connect 17 0 13 0;
+#X connect 18 0 14 0;
+#X connect 19 0 15 0;
+#X connect 20 0 11 0;
+#X connect 21 0 10 0;
+#X connect 22 0 9 0;
+#X connect 23 0 8 0;
+#X connect 24 0 7 0;
+#X connect 25 0 6 0;
+#X restore 43 87 pd \$0-editlinks-guts;
+#X connect 1 0 0 0;
+#X restore 118 156 pd edits;
+#X restore 348 573 pd guts;
+#X obj 29 249 tgl 18 0 \$0-show-masseditor empty EditParam 22 9 0 8
+-1 -233017 -1 0 1;
+#X obj 181 355 nbx 2 14 0 99 0 0 \$0-show-mids \$0-show-mids show-mids
+0 -6 0 8 -225280 -1 -1 0 256;
+#N canvas 0 0 106 49 obj 0;
+#X obj 2 3 cnv 15 100 40 empty empty empty 20 12 0 14 -233017 -66577
+0;
+#X obj 7 18 bng 20 250 50 0 empty empty load 0 -6 0 8 -258699 -1 -1
+;
+#X obj 38 17 tgl 15 0 RENDER-PRIMTRI RENDER-PRIMTRI TRI 0 -6 0 8 -262131
+-1 -1 0 1;
+#X obj 110 6 obj-render;
+#X obj 62 17 tgl 15 0 \$0-gen-tri \$0-gen-tri Gen-TRI 0 -6 0 8 -261681
+-1 -1 0 1;
+#X obj 111 26 s \$0-msd;
+#X connect 1 0 3 0;
+#X connect 3 0 5 0;
+#X connect 4 0 3 1;
+#X coords 0 0 1 1 102 44 1;
+#X restore 304 489 pd obj;
+#X text 229 537 Save MSD;
+#X text 314 538 Load *.obj;
+#X text 112 537 Save or Load DS;
+#X connect 4 0 5 0;
+#X connect 4 1 6 0;
+#X connect 5 0 4 0;
+#X connect 6 0 4 1;
+#X connect 7 0 4 2;
+#X connect 11 0 10 0;
+#X connect 14 0 41 0;
+#X connect 25 0 9 1;
+#X connect 26 0 9 2;
+#X connect 27 0 9 0;
+#X connect 33 0 9 3;
+#X connect 40 0 14 2;
+#X connect 43 0 42 0;
diff --git a/msd/editor/msd_append.pd b/msd/editor/msd_append.pd
new file mode 100644
index 0000000..7c5a13e
--- /dev/null
+++ b/msd/editor/msd_append.pd
@@ -0,0 +1,248 @@
+#N canvas 862 152 89 147 10;
+#X obj 2 16 cnv 15 80 60 empty empty empty 20 12 0 14 -233017 -66577
+0;
+#X obj 6 29 bng 15 250 50 0 empty empty mass 0 -6 0 8 -1 -262144 -1
+;
+#X obj 34 29 bng 15 250 50 0 empty empty fix 0 -6 0 8 -258699 -1 -1
+;
+#N canvas 355 305 863 719 guts 0;
+#X obj 289 340 pointer;
+#X msg 289 303 traverse pd-data \, bang;
+#X obj 107 89 inlet;
+#X obj 214 89 inlet;
+#X obj 679 378 + 1;
+#X obj 649 318 r \$0-counter-bng;
+#X obj 649 420 s \$0-nextmass;
+#X obj 182 354 r \$0-nextmass;
+#X obj 107 298 s \$0-counter-bng;
+#X msg 107 112 0;
+#X text 148 89 mobile;
+#X text 260 89 fixed mass;
+#X msg 214 111 900;
+#X obj 649 378 f 0;
+#X obj 685 343 loadbang;
+#X obj 549 321 r \$0-counter;
+#X msg 590 411 set \$1;
+#X obj 590 452 s \$0-counter-in;
+#X obj 245 334 r \$0-M;
+#X obj 553 175 f \$1;
+#X obj 553 199 select 0;
+#X obj 553 254 s \$0-M;
+#X msg 552 224 100;
+#X obj 558 152 loadbang;
+#X obj 40 316 r \$0-geos;
+#X obj 289 278 r \$0-start-traverse;
+#X obj 216 405 f 0;
+#X obj 40 339 t a b;
+#X obj 232 374 r \$0-mfds;
+#X obj 270 399 r \$0-msid;
+#X obj 105 432 append mass x y mid mob M sid;
+#X obj 678 195 loadbang;
+#X obj 678 249 s \$0-msid;
+#X msg 678 221 0;
+#X msg 197 376 \$1;
+#X obj 141 172 random 100;
+#X obj 227 172 random 100;
+#X obj 141 196 + 20;
+#X obj 227 194 + 20;
+#X obj 107 272 t b a b b b a b;
+#X msg 123 356 \$2 \$3;
+#X obj 128 150 t f b;
+#X obj 107 230 pack 0 0 0;
+#X obj 363 90 inlet;
+#X text 410 91 another mass: list of "mob \, x \, y";
+#X obj 105 477 outlet;
+#X text 159 480 last mass created;
+#X obj 338 531 append hole x y;
+#X obj 438 505 pointer;
+#X msg 438 468 traverse pd-data \, bang;
+#X obj 438 443 r \$0-start-traverse;
+#X msg 338 479 10 10;
+#X connect 0 0 30 6;
+#X connect 1 0 0 0;
+#X connect 2 0 9 0;
+#X connect 3 0 12 0;
+#X connect 4 0 13 1;
+#X connect 5 0 13 0;
+#X connect 7 0 30 2;
+#X connect 9 0 41 0;
+#X connect 12 0 41 0;
+#X connect 13 0 4 0;
+#X connect 13 0 6 0;
+#X connect 13 0 16 0;
+#X connect 14 0 13 0;
+#X connect 15 0 13 0;
+#X connect 16 0 17 0;
+#X connect 18 0 30 4;
+#X connect 19 0 20 0;
+#X connect 20 0 22 0;
+#X connect 20 1 21 0;
+#X connect 22 0 21 0;
+#X connect 23 0 19 0;
+#X connect 24 0 27 0;
+#X connect 25 0 1 0;
+#X connect 26 0 30 3;
+#X connect 27 0 30 0;
+#X connect 27 1 26 0;
+#X connect 28 0 26 1;
+#X connect 29 0 30 5;
+#X connect 30 0 45 0;
+#X connect 31 0 33 0;
+#X connect 33 0 32 0;
+#X connect 34 0 30 3;
+#X connect 35 0 37 0;
+#X connect 36 0 38 0;
+#X connect 37 0 42 1;
+#X connect 38 0 42 2;
+#X connect 39 0 8 0;
+#X connect 39 1 40 0;
+#X connect 39 5 34 0;
+#X connect 39 6 1 0;
+#X connect 40 0 30 0;
+#X connect 41 0 42 0;
+#X connect 41 1 35 0;
+#X connect 41 1 36 0;
+#X connect 42 0 39 0;
+#X connect 43 0 42 0;
+#X connect 48 0 47 2;
+#X connect 49 0 48 0;
+#X connect 50 0 49 0;
+#X connect 51 0 47 0;
+#X restore 105 79 pd guts;
+#X obj 105 6 inlet;
+#X obj 148 5 inlet;
+#X obj 25 59 nbx 5 14 -1e+37 1e+37 0 0 \$0-counter \$0-counter-in id
+-22 8 0 10 -262144 -1 -1 0 256;
+#X obj 2 79 cnv 15 80 60 empty empty empty 10 10 0 10 -195568 -1 0
+;
+#X obj 26 85 nbx 5 14 -1e+37 1e+37 0 0 \$0-M \$0-M M -12 8 0 10 -225271
+-1 -1 100 256;
+#N canvas 379 246 663 624 geos 0;
+#X obj 93 96 make_rect 100 100 30 30 10 10;
+#X obj 123 162 s \$0-geos;
+#X obj 93 188 s \$0-counter-bng;
+#X obj 48 33 r \$0-make-rect;
+#X msg 93 67 bang;
+#N canvas 449 480 450 300 1015-geos 0;
+#X obj 48 82 bng 24 250 50 0 \$0-make-rect empty make-rect 0 -6 0 8
+-24198 -1 -1;
+#X floatatom 151 76 5 0 0 0 x0 - #0-x0;
+#X floatatom 151 92 5 0 0 0 y0 - #0-y0;
+#X floatatom 227 75 5 0 0 0 xgap - #0-xgap;
+#X floatatom 227 91 5 0 0 0 ygap - #0-ygap;
+#X floatatom 322 74 5 0 0 0 xsteps - #0-xsteps;
+#X floatatom 322 90 5 0 0 0 ysteps - #0-ysteps;
+#X text 46 18 Add various geometric forms;
+#X text 38 46 Rectangle Networks:;
+#X text 37 137 Circles:;
+#X obj 52 172 bng 24 250 50 0 \$0-make-circ empty make-circ 0 -6 0
+8 -24198 -1 -1;
+#X floatatom 145 166 5 0 0 0 x0 - #0-x0-circ;
+#X floatatom 145 182 5 0 0 0 y0 - #0-y0-circ;
+#X floatatom 251 166 5 0 0 0 radius - #0-radius;
+#X floatatom 251 184 5 0 0 0 masses_# - #0-masses-circ;
+#X text 107 266 All coords as used by data structs.;
+#X obj 54 233 hradio 15 1 0 2 \$0-mf \$0-mf Mobile/Fix 0 -6 0 8 -262144
+-1 -1 0;
+#X obj 91 234 cnv 15 60 15 \$0-mobfix \$0-mobfix mobile 2 6 0 10 -233017
+-66577 0;
+#X restore 518 165 pd \$0-geos;
+#X msg 519 125 \; \$1 vis 1;
+#X obj 518 96 makefilename pd-%s;
+#X obj 520 68 symbol \$0-geos;
+#X msg 516 22 bang;
+#X obj 48 66 t b b;
+#X obj 78 226 s \$0-start-traverse;
+#N canvas 0 0 930 534 1015-sixpack 0;
+#X obj 250 282 r \$0-x0;
+#X text 452 208 Args;
+#X obj 320 310 sixpack --------------------;
+#X obj 296 237 r \$0-y0;
+#X obj 336 206 r \$0-xgap;
+#X obj 376 185 r \$0-ygap;
+#X obj 412 164 r \$0-xsteps;
+#X obj 448 143 r \$0-ysteps;
+#X obj 326 342 outlet;
+#X connect 0 0 2 0;
+#X connect 2 0 8 0;
+#X connect 3 0 2 1;
+#X connect 4 0 2 2;
+#X connect 5 0 2 3;
+#X connect 6 0 2 4;
+#X connect 7 0 2 5;
+#X restore 291 40 pd \$0-sixpack;
+#X obj 93 128 t b a;
+#X obj 524 45 r \$0-show-geos;
+#X obj 63 322 r \$0-make-circ;
+#N canvas 0 0 930 534 1015-fourpack 0;
+#X text 452 208 Args;
+#X obj 320 310 sixpack --------------------;
+#X obj 319 390 outlet;
+#X msg 319 349 \$1 \$2 \$3 \$4;
+#X obj 252 282 r \$0-x0-circ;
+#X obj 296 237 r \$0-y0-circ;
+#X obj 376 185 r \$0-masses-circ;
+#X obj 336 206 r \$0-radius;
+#X connect 1 0 3 0;
+#X connect 3 0 2 0;
+#X connect 4 0 1 0;
+#X connect 5 0 1 1;
+#X connect 6 0 1 3;
+#X connect 7 0 1 2;
+#X restore 219 327 pd \$0-fourpack;
+#X obj 136 441 s \$0-geos;
+#X obj 106 467 s \$0-counter-bng;
+#X obj 63 345 t b b;
+#X obj 93 505 s \$0-start-traverse;
+#X obj 106 407 t b a;
+#X obj 63 370 make_circ 300 300 100 8;
+#X obj 368 266 select 0;
+#X msg 368 306 label mobile;
+#X obj 368 329 s \$0-mobfix;
+#X msg 420 288 label fix;
+#X obj 368 236 r \$0-mf;
+#X obj 507 332 s \$0-mfds;
+#X msg 508 301 0;
+#X msg 544 299 900;
+#X connect 0 0 13 0;
+#X connect 3 0 10 0;
+#X connect 4 0 0 0;
+#X connect 7 0 6 0;
+#X connect 8 0 7 0;
+#X connect 9 0 8 0;
+#X connect 10 0 0 0;
+#X connect 10 1 11 0;
+#X connect 12 0 0 1;
+#X connect 13 0 2 0;
+#X connect 13 1 1 0;
+#X connect 14 0 8 0;
+#X connect 15 0 19 0;
+#X connect 16 0 22 1;
+#X connect 19 0 22 0;
+#X connect 19 1 20 0;
+#X connect 21 0 18 0;
+#X connect 21 1 17 0;
+#X connect 22 0 21 0;
+#X connect 23 0 24 0;
+#X connect 23 0 29 0;
+#X connect 23 1 26 0;
+#X connect 23 1 30 0;
+#X connect 24 0 25 0;
+#X connect 26 0 25 0;
+#X connect 27 0 23 0;
+#X connect 29 0 28 0;
+#X connect 30 0 28 0;
+#X restore 106 122 pd geos;
+#X obj 59 29 bng 15 250 50 0 \$0-show-geos \$0-show-geos geos 0 -6
+0 8 -225271 -1 -1;
+#X obj 35 111 nbx 4 14 -1e+37 1e+37 0 0 \$0-msid \$0-msid SID -30 8
+0 10 -261681 -1 -1 0 256;
+#X obj 200 1 inlet;
+#X obj 105 103 outlet;
+#X connect 1 0 3 0;
+#X connect 2 0 3 1;
+#X connect 3 0 13 0;
+#X connect 4 0 3 0;
+#X connect 5 0 3 1;
+#X connect 12 0 3 2;
+#X coords 0 0 1 1 82 130 1;
diff --git a/msd/editor/mytri.pd b/msd/editor/mytri.pd
new file mode 100644
index 0000000..8049938
--- /dev/null
+++ b/msd/editor/mytri.pd
@@ -0,0 +1,45 @@
+#N canvas 0 0 773 622 10;
+#X obj 271 316 cnv 15 100 30 empty empty empty 20 12 0 14 -24198 -66577
+0;
+#X msg 222 209 draw line;
+#X msg 222 230 draw fill;
+#X msg 222 252 draw point;
+#X msg 309 242 0 0 1;
+#X msg 302 223 0 1 0;
+#X msg 294 204 1 0 0;
+#X text 335 204 (XYZ)1;
+#X text 347 222 (XYZ)2;
+#X text 357 242 (XYZ)3;
+#X msg 334 302 0 0 1;
+#X msg 327 283 0 1 0;
+#X msg 319 264 1 0 0;
+#X text 362 264 (XYZ)1;
+#X text 372 282 (XYZ)2;
+#X text 382 302 (XYZ)3;
+#X obj 280 323 primTri;
+#X obj 327 75 r MSD-OUT-GLOBAL;
+#X obj 314 148 route massesPos;
+#X obj 383 187 route \$1 \$2 \$3;
+#X obj 113 170 gemhead;
+#X obj 173 169 r RENDER-PRIMTRI;
+#X obj 113 215 spigot 0;
+#X obj 322 115 spigot 0;
+#X connect 1 0 16 0;
+#X connect 2 0 16 0;
+#X connect 3 0 16 0;
+#X connect 4 0 16 3;
+#X connect 5 0 16 2;
+#X connect 6 0 16 1;
+#X connect 10 0 16 6;
+#X connect 11 0 16 5;
+#X connect 12 0 16 4;
+#X connect 17 0 23 0;
+#X connect 18 0 19 0;
+#X connect 19 0 16 1;
+#X connect 19 1 16 3;
+#X connect 19 2 16 2;
+#X connect 20 0 22 0;
+#X connect 21 0 22 1;
+#X connect 21 0 23 1;
+#X connect 22 0 16 0;
+#X connect 23 0 18 0;
diff --git a/msd/editor/obj-render.pd b/msd/editor/obj-render.pd
new file mode 100644
index 0000000..3f2430b
--- /dev/null
+++ b/msd/editor/obj-render.pd
@@ -0,0 +1,141 @@
+#N canvas 226 31 720 648 10;
+#X obj 175 139 textfile;
+#N canvas 550 94 450 300 tri 0;
+#X restore 175 616 pd tri;
+#X msg 551 125 rewind;
+#X obj 175 99 until;
+#X obj 175 585 s pd-tri;
+#X msg 12 531 clear;
+#X msg 115 445 \$1;
+#X msg 219 447 \$1;
+#X msg 323 446 \$1;
+#X obj 175 517 pack 0 0 0;
+#X obj 115 481 - 1;
+#X obj 219 479 - 1;
+#X obj 323 481 - 1;
+#X obj 175 218 route f v;
+#X msg 472 357 mass 0-m 1 100 \$1 \$2 \$3;
+#X msg 482 430 link 0-l \$1 \$2 10 2.5 1.5;
+#X msg 482 401 \$1 \$2 \, \$2 \$3 \, \$3 \$1;
+#X msg 495 477 reset;
+#X obj 175 67 t b b;
+#N canvas 282 359 730 665 find-min-max 0;
+#X obj 166 448 outlet;
+#X obj 100 66 inlet;
+#X obj 182 26 inlet;
+#X obj 235 133 inlet;
+#X obj 182 124 abs;
+#X obj 182 223 spigot;
+#X obj 182 158 t f f;
+#X obj 166 388 pack 0 0;
+#X msg 166 414 Xmin \$1 \, Xmax \$2 \, Ymin \$1 \, Ymax \$2 \, Zmin
+\$1 \, Zmax \$2;
+#X obj 166 347 * -1;
+#X obj 166 323 t f f;
+#X obj 166 265 f 4;
+#X obj 219 197 > 4;
+#X msg 235 168 4;
+#X text 251 221 find maximum of all x \, y \, z;
+#X text 293 134 rest;
+#X text 216 326 at end \, send max to msd3D;
+#X obj 166 291 + 1;
+#X obj 182 52 t a a a;
+#X msg 251 80 \$1;
+#X msg 217 80 \$2;
+#X msg 182 82 \$3;
+#X connect 1 0 11 0;
+#X connect 2 0 18 0;
+#X connect 3 0 13 0;
+#X connect 4 0 6 0;
+#X connect 5 0 11 1;
+#X connect 6 0 5 0;
+#X connect 6 1 12 0;
+#X connect 7 0 8 0;
+#X connect 8 0 0 0;
+#X connect 9 0 7 0;
+#X connect 10 0 9 0;
+#X connect 10 1 7 1;
+#X connect 11 0 17 0;
+#X connect 12 0 5 1;
+#X connect 13 0 12 1;
+#X connect 17 0 10 0;
+#X connect 18 0 21 0;
+#X connect 18 1 20 0;
+#X connect 18 2 19 0;
+#X connect 19 0 4 0;
+#X connect 20 0 4 0;
+#X connect 21 0 4 0;
+#X restore 285 266 pd find-min-max;
+#X obj 233 100 s \$0-obj-import-init;
+#X obj 385 236 r \$0-obj-import-init;
+#X obj 495 456 r \$0-obj-import-init;
+#X obj 12 506 r \$0-obj-import-init;
+#X obj 24 99 r \$0-ob-import-file;
+#X obj 409 157 s \$0-ob-import-file;
+#X obj 409 59 openpanel;
+#X obj 409 37 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X msg 428 124 print;
+#X msg 409 102 read \$1 cr \, rewind;
+#X msg 495 126 bang;
+#X msg 175 32 bang;
+#X obj 551 99 r \$0-obj-import-init;
+#X msg 281 181 \; pd-tri loadbang;
+#X msg 175 542 obj 0 0 mytri \$1 \$2 \$3;
+#X obj 383 81 t b a;
+#X obj 409 12 inlet;
+#X obj 572 546 inlet;
+#X obj 175 563 spigot;
+#X obj 472 509 outlet;
+#X obj 115 414 symbol2list /;
+#X obj 219 414 symbol2list /;
+#X obj 323 413 symbol2list /;
+#X obj 175 376 unpack s s s;
+#X connect 0 0 13 0;
+#X connect 0 1 3 1;
+#X connect 0 1 19 0;
+#X connect 0 1 33 0;
+#X connect 2 0 25 0;
+#X connect 3 0 0 0;
+#X connect 5 0 4 0;
+#X connect 6 0 10 0;
+#X connect 7 0 11 0;
+#X connect 8 0 12 0;
+#X connect 9 0 34 0;
+#X connect 9 0 16 0;
+#X connect 10 0 9 0;
+#X connect 11 0 9 1;
+#X connect 12 0 9 2;
+#X connect 13 0 43 0;
+#X connect 13 1 14 0;
+#X connect 13 1 19 1;
+#X connect 14 0 39 0;
+#X connect 15 0 39 0;
+#X connect 16 0 15 0;
+#X connect 17 0 39 0;
+#X connect 18 0 3 0;
+#X connect 18 1 20 0;
+#X connect 19 0 39 0;
+#X connect 21 0 19 2;
+#X connect 22 0 17 0;
+#X connect 23 0 5 0;
+#X connect 24 0 0 0;
+#X connect 26 0 35 0;
+#X connect 27 0 26 0;
+#X connect 28 0 25 0;
+#X connect 29 0 25 0;
+#X connect 30 0 25 0;
+#X connect 31 0 18 0;
+#X connect 32 0 2 0;
+#X connect 34 0 38 0;
+#X connect 35 0 31 0;
+#X connect 35 1 29 0;
+#X connect 36 0 27 0;
+#X connect 37 0 38 1;
+#X connect 38 0 4 0;
+#X connect 40 0 6 0;
+#X connect 41 0 7 0;
+#X connect 42 0 8 0;
+#X connect 43 0 40 0;
+#X connect 43 1 41 0;
+#X connect 43 2 42 0;
diff --git a/msd/editor/scale-ds2msd.pd b/msd/editor/scale-ds2msd.pd
new file mode 100644
index 0000000..df103aa
--- /dev/null
+++ b/msd/editor/scale-ds2msd.pd
@@ -0,0 +1,42 @@
+#N canvas 257 161 999 516 10;
+#X obj 43 52 inlet;
+#X text 87 52 X-coord. as in DS;
+#X obj 43 255 outlet;
+#X obj 338 50 inlet;
+#X obj 338 253 outlet;
+#X text 382 50 Y-coord. as in DS;
+#X text 99 255 X-coord. as in MSD;
+#X text 398 253 Y-coord. as in MSD;
+#X obj 688 336 pack 0 0;
+#X obj 688 367 outlet;
+#X obj 689 55 unpack 0 0;
+#X obj 689 30 inlet;
+#X text 725 148 Or use lists: (x \, y);
+#X obj 78 101 r DS-xmin;
+#X obj 149 166 r MSD-xmin;
+#X obj 373 99 r DS-ymin;
+#X obj 444 164 r MSD-ymin;
+#X obj 114 128 r DS-xmax;
+#X obj 185 191 r MSD-xmax;
+#X obj 409 126 r DS-ymax;
+#X obj 480 189 r MSD-ymax;
+#X obj 43 218 expr_scale 0 600 -2 2;
+#X obj 338 216 expr_scale 600 0 -2 2;
+#X connect 0 0 21 0;
+#X connect 3 0 22 0;
+#X connect 8 0 9 0;
+#X connect 10 0 21 0;
+#X connect 10 1 22 1;
+#X connect 11 0 10 0;
+#X connect 13 0 21 1;
+#X connect 14 0 21 3;
+#X connect 15 0 22 1;
+#X connect 16 0 22 3;
+#X connect 17 0 21 2;
+#X connect 18 0 21 4;
+#X connect 19 0 22 2;
+#X connect 20 0 22 4;
+#X connect 21 0 2 0;
+#X connect 21 0 8 0;
+#X connect 22 0 4 0;
+#X connect 22 0 8 1;
diff --git a/msd/editor/scale-msd2ds.pd b/msd/editor/scale-msd2ds.pd
new file mode 100644
index 0000000..d90c3c2
--- /dev/null
+++ b/msd/editor/scale-msd2ds.pd
@@ -0,0 +1,42 @@
+#N canvas 9 170 970 485 10;
+#X obj 43 52 inlet;
+#X obj 43 255 outlet;
+#X obj 338 50 inlet;
+#X obj 338 253 outlet;
+#X text 382 50 Y-coord. as in MSD;
+#X text 87 52 X-coord. as in MSD;
+#X text 99 255 X-coord. as in DS;
+#X text 398 253 Y-coord. as in DS;
+#X obj 688 336 pack 0 0;
+#X obj 688 367 outlet;
+#X obj 689 55 unpack 0 0;
+#X obj 689 30 inlet;
+#X text 725 148 Or use lists: (x \, y);
+#X obj 78 164 r MSD-xmin;
+#X obj 114 189 r MSD-xmax;
+#X obj 149 111 r DS-xmin;
+#X obj 185 138 r DS-xmax;
+#X obj 444 99 r DS-ymin;
+#X obj 480 126 r DS-ymax;
+#X obj 373 164 r MSD-ymin;
+#X obj 409 189 r MSD-ymax;
+#X obj 338 216 expr_scale -2 2 600 0;
+#X obj 43 218 expr_scale -2 2 0 600;
+#X connect 0 0 22 0;
+#X connect 2 0 21 0;
+#X connect 8 0 9 0;
+#X connect 10 0 22 0;
+#X connect 10 1 21 0;
+#X connect 11 0 10 0;
+#X connect 13 0 22 1;
+#X connect 14 0 22 2;
+#X connect 15 0 22 3;
+#X connect 16 0 22 4;
+#X connect 17 0 21 3;
+#X connect 18 0 21 4;
+#X connect 19 0 21 1;
+#X connect 20 0 21 2;
+#X connect 21 0 3 0;
+#X connect 21 0 8 1;
+#X connect 22 0 1 0;
+#X connect 22 0 8 0;
diff --git a/msd/editor/sixpack.pd b/msd/editor/sixpack.pd
new file mode 100644
index 0000000..fd97eee
--- /dev/null
+++ b/msd/editor/sixpack.pd
@@ -0,0 +1,31 @@
+#N canvas 519 499 450 300 10;
+#X obj 143 51 inlet;
+#X obj 91 51 inlet;
+#X obj 141 72 t b f;
+#X obj 191 51 inlet;
+#X obj 189 72 t b f;
+#X obj 238 50 inlet;
+#X obj 236 71 t b f;
+#X obj 148 222 outlet;
+#X obj 287 49 inlet;
+#X obj 285 70 t b f;
+#X obj 334 48 inlet;
+#X obj 332 69 t b f;
+#X obj 148 179 pack 0 0 0 0 0 0;
+#X connect 0 0 2 0;
+#X connect 1 0 12 0;
+#X connect 2 0 12 0;
+#X connect 2 1 12 1;
+#X connect 3 0 4 0;
+#X connect 4 0 12 0;
+#X connect 4 1 12 2;
+#X connect 5 0 6 0;
+#X connect 6 0 12 0;
+#X connect 6 1 12 3;
+#X connect 8 0 9 0;
+#X connect 9 0 12 0;
+#X connect 9 1 12 4;
+#X connect 10 0 11 0;
+#X connect 11 0 12 0;
+#X connect 11 1 12 5;
+#X connect 12 0 7 0;
diff --git a/msd/editor/structures.pd b/msd/editor/structures.pd
new file mode 100644
index 0000000..80ca36c
--- /dev/null
+++ b/msd/editor/structures.pd
@@ -0,0 +1,20 @@
+#N canvas 752 10 450 300 10;
+#N canvas 470 500 664 321 mass 0;
+#X obj 62 182 drawnumber mid 0 -18 0 m;
+#X obj 61 136 filledpolygon mob mob 1 -5 0 -4 4 0 5 4 4 5 0 4 -4 0
+-5 -4 -4;
+#X obj 64 72 struct mass float x float y float mid float mob float
+M float sid;
+#X restore 132 125 pd mass;
+#N canvas 73 302 487 201 liaison 0;
+#X obj 23 73 drawpolygon sid 2 x1 y1 x2 y2;
+#X obj 19 25 struct liaison float x1 float y1 float x2 float y2 float
+mid1 float mid2 float lid float K float D float P float Lmin float
+Lmax float sid;
+#X restore 132 147 pd liaison;
+#N canvas 749 676 450 300 hole 0;
+#X obj 79 73 struct hole float x float y;
+#X text 93 162 Green cross;
+#X obj 79 97 drawpolygon 50 2 -5 -5 5 5;
+#X obj 79 122 drawpolygon 50 2 -5 5 5 -5;
+#X restore 132 170 pd hole;