aboutsummaryrefslogtreecommitdiff
path: root/msd2D/editor/msd2d-editor.pd
diff options
context:
space:
mode:
Diffstat (limited to 'msd2D/editor/msd2d-editor.pd')
-rw-r--r--msd2D/editor/msd2d-editor.pd300
1 files changed, 143 insertions, 157 deletions
diff --git a/msd2D/editor/msd2d-editor.pd b/msd2D/editor/msd2d-editor.pd
index fb07b54..97e6d91 100644
--- a/msd2D/editor/msd2d-editor.pd
+++ b/msd2D/editor/msd2d-editor.pd
@@ -1,5 +1,5 @@
-#N canvas 34 224 866 562 10;
-#N canvas 0 0 1222 870 data 0;
+#N canvas 121 260 866 562 10;
+#N canvas 334 79 1222 870 data 0;
#X restore 719 51 pd data;
#X obj 24 523 structures;
#X obj 30 314 bng 24 250 50 0 empty \$0-generate generate 0 -6 0 8
@@ -45,8 +45,7 @@
#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 msg 20 230 next;
-#X obj 79 198 pointer mass;
+#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;
@@ -70,29 +69,34 @@
#X obj 211 404 tabwrite \$0-mid2msdid;
#X text 125 434 Store a mapping mid => msdid for fixing links later
;
-#X obj 43 30 inlet;
+#X obj 43 24 inlet;
#X obj 158 221 outlet;
+#X text 96 52 Avoid stack overflow lops;
+#X obj 85 23 r \$0-stack-delay;
+#X obj 16 228 ds-next;
+#X obj 43 51 del 0;
#X connect 0 5 1 0;
-#X connect 0 6 4 0;
-#X connect 1 0 3 0;
-#X connect 2 0 3 0;
-#X connect 3 0 9 0;
-#X connect 3 1 2 0;
-#X connect 3 2 14 0;
-#X connect 5 0 10 0;
-#X connect 5 0 6 0;
-#X connect 8 0 10 1;
-#X connect 9 0 2 0;
-#X connect 9 1 5 0;
-#X connect 9 4 8 0;
-#X connect 9 5 6 1;
-#X connect 10 0 11 0;
-#X connect 13 0 0 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 msg 116 316 next;
#X obj 239 189 s \$0-reset-counter;
#X obj 175 284 pointer liaison;
#X text 293 285 At end: make links in msd*!;
@@ -101,27 +105,32 @@
#X obj 343 418 tabread \$0-mid2msdid;
#X obj 192 389 get liaison mid1 mid2;
#X obj 175 333 t b b b b p p;
-#X obj 139 128 inlet;
+#X obj 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 4 0;
-#X connect 2 0 4 0;
-#X connect 4 0 10 0;
-#X connect 4 1 2 0;
-#X connect 4 2 12 0;
-#X connect 6 0 7 0;
-#X connect 8 0 7 1;
-#X connect 9 0 6 0;
-#X connect 9 1 8 0;
-#X connect 10 0 2 0;
-#X connect 10 4 9 0;
-#X connect 10 5 7 2;
-#X connect 11 0 0 0;
+#X 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 msg 135 280 next;
#X obj 184 206 pointer mass;
#X obj 325 385 select 0;
#X msg 365 410 0;
@@ -138,35 +147,35 @@
#X obj 214 444 pack 0 0 0 0 0;
#X obj 184 255 t b p;
#X obj 214 402 scale-ds2msd;
+#X obj 120 251 ds-next;
#X connect 0 5 1 0;
+#X connect 0 6 6 0;
#X connect 0 6 7 0;
-#X connect 0 6 8 0;
-#X connect 1 0 3 0;
-#X connect 2 0 3 0;
-#X connect 3 0 17 0;
-#X connect 3 1 2 0;
-#X connect 3 2 14 0;
-#X connect 4 0 6 0;
-#X connect 4 1 5 0;
-#X connect 5 0 16 3;
-#X connect 6 0 16 3;
-#X connect 8 0 9 0;
-#X connect 8 0 10 0;
-#X connect 12 0 0 0;
-#X connect 15 0 18 0;
-#X connect 15 1 18 1;
-#X connect 15 2 16 2;
-#X connect 15 3 4 0;
-#X connect 15 4 16 4;
-#X connect 16 0 13 0;
-#X connect 17 0 2 0;
-#X connect 17 1 15 0;
-#X connect 18 0 16 0;
-#X connect 18 1 16 1;
+#X connect 1 0 2 0;
+#X connect 2 0 16 0;
+#X connect 2 1 18 0;
+#X connect 2 2 13 0;
+#X connect 3 0 5 0;
+#X connect 3 1 4 0;
+#X connect 4 0 15 3;
+#X connect 5 0 15 3;
+#X connect 7 0 8 0;
+#X connect 7 0 9 0;
+#X connect 11 0 0 0;
+#X connect 14 0 17 0;
+#X connect 14 1 17 1;
+#X connect 14 2 15 2;
+#X connect 14 3 3 0;
+#X connect 14 4 15 4;
+#X connect 15 0 12 0;
+#X connect 16 0 18 0;
+#X connect 16 1 14 0;
+#X connect 17 0 15 0;
+#X connect 17 1 15 1;
+#X connect 18 0 2 0;
#X restore 244 115 pd get-masses;
#N canvas 0 0 768 708 make-links 0;
#X obj 316 252 pointer liaison;
-#X msg 316 226 next;
#X msg 354 227 traverse pd-data \, bang;
#X obj 286 274 t b p;
#X obj 334 374 outlet;
@@ -175,20 +184,26 @@
#X text 142 412 Now set lid field of links.;
#X obj 316 298 get liaison mid1 mid2 K D D2;
#X obj 334 341 pack 0 0 0 0 0;
-#X connect 0 0 3 0;
-#X connect 0 1 1 0;
-#X connect 0 2 6 0;
+#X text 407 200 Avoid stack overflow lops;
+#X obj 399 167 r \$0-stack-delay;
+#X obj 286 226 ds-next;
+#X obj 354 201 del 0;
+#X connect 0 0 2 0;
+#X connect 0 1 11 0;
+#X connect 0 2 5 0;
#X connect 1 0 0 0;
-#X connect 2 0 0 0;
-#X connect 3 0 1 0;
-#X connect 3 1 8 0;
-#X connect 5 0 2 0;
-#X connect 8 0 9 0;
-#X connect 8 1 9 1;
-#X connect 8 2 9 2;
-#X connect 8 3 9 3;
-#X connect 8 4 9 4;
-#X connect 9 0 4 0;
+#X connect 2 0 11 0;
+#X connect 2 1 7 0;
+#X connect 4 0 12 0;
+#X connect 7 0 8 0;
+#X connect 7 1 8 1;
+#X connect 7 2 8 2;
+#X connect 7 3 8 3;
+#X connect 7 4 8 4;
+#X connect 8 0 3 0;
+#X connect 10 0 12 1;
+#X connect 11 0 0 0;
+#X connect 12 0 1 0;
#X restore 148 257 pd make-links;
#X text 284 418 TABLES USED:;
#X text 364 174 Change DS mass ids to match msdIds \, store mid2msdid
@@ -202,13 +217,12 @@ is right.;
#X obj 162 203 spigot;
#X msg 292 129 1;
#X msg 236 127 0;
-#X obj 238 62 inlet;
+#X obj 238 22 inlet;
#X obj 238 93 t b b b b b;
#X obj 310 307 pointer liaison;
#X msg 310 281 traverse pd-data \, next;
#X msg 288 163 infosL;
#X obj 162 231 route Link;
-#X msg 272 307 next;
#X obj 145 254 t b a;
#X text 105 394 This will move around the links \, but it's not critical
as long as we have the same number of graphical links as we have inside
@@ -218,24 +232,33 @@ turn and crashed the car and left the toilet seat open.;
#X text 104 481 Shouldn't happen.;
#X msg 175 332 \$1 \$3 \$4 \$5 \$6 \$7;
#X obj 175 357 set liaison lid mid1 mid2 K D D2;
+#X text 291 52 Avoid stack overflow lops;
+#X obj 287 21 r \$0-stack-delay;
+#X obj 219 307 ds-next;
+#X msg 260 281 next;
+#X obj 74 351 print set-lid;
+#X obj 238 51 del 0;
#X connect 0 0 2 0;
#X connect 2 0 10 0;
#X connect 3 0 2 1;
#X connect 4 0 2 1;
-#X connect 5 0 6 0;
+#X connect 5 0 21 0;
#X connect 6 1 4 0;
#X connect 6 2 9 0;
#X connect 6 3 3 0;
#X connect 6 4 8 0;
-#X connect 7 0 16 6;
-#X connect 7 1 11 0;
+#X connect 7 0 15 6;
+#X connect 7 1 19 0;
#X connect 8 0 7 0;
#X connect 9 0 1 0;
-#X connect 10 0 12 0;
-#X connect 11 0 7 0;
-#X connect 12 0 11 0;
-#X connect 12 1 15 0;
-#X connect 15 0 16 0;
+#X connect 10 0 11 0;
+#X connect 11 0 19 0;
+#X connect 11 1 14 0;
+#X connect 14 0 15 0;
+#X connect 14 0 20 0;
+#X connect 17 0 21 1;
+#X connect 19 0 7 0;
+#X connect 21 0 6 0;
#X restore 148 322 pd set-lid;
#X text 238 322 Correct lids to match what msd2D tells us;
#X obj 146 446 table \$0-mid2msdid 4000;
@@ -304,7 +327,7 @@ from the #define in msd sources.;
#X connect 15 1 13 1;
#X connect 15 2 13 2;
#X connect 16 0 17 0;
-#X restore 112 401 pd make-setters;
+#X restore 112 428 pd make-setters;
#X obj 181 344 r pointer2msd;
#X obj 112 91 inlet;
#X msg 131 324 link ml \$1 \$2 \$3 \$4 \$5;
@@ -362,13 +385,14 @@ from the #define in msd sources.;
#X connect 23 0 20 0;
#X connect 24 0 23 0;
#X connect 25 0 23 1;
-#X restore 112 441 pd set-min-max;
+#X restore 112 468 pd set-min-max;
#X text 283 344 <== messages coming from the data structure setters
;
+#X obj 112 399 del 200;
#X connect 0 0 8 0;
#X connect 0 1 9 0;
#X connect 2 0 3 0;
-#X connect 4 0 5 0;
+#X connect 4 0 12 0;
#X connect 4 1 0 0;
#X connect 4 3 2 0;
#X connect 5 0 10 0;
@@ -376,6 +400,7 @@ from the #define in msd sources.;
#X connect 7 0 4 0;
#X connect 8 0 1 0;
#X connect 9 0 1 0;
+#X connect 12 0 5 0;
#X restore 30 343 pd generator;
#N canvas 0 0 718 819 activate 0;
#X obj 233 307 msd2D;
@@ -492,71 +517,8 @@ create the physical model inside.;
#X obj 147 265 print FromMSD;
#X obj 147 210 r \$0-msd-out;
#N canvas 0 0 578 686 setter 0;
-#X obj 930 500 mass-set 31;
-#X obj 900 500 mass-set 30;
-#X obj 870 500 mass-set 29;
-#X obj 840 500 mass-set 28;
-#X obj 810 500 mass-set 27;
-#X obj 780 500 mass-set 26;
-#X obj 750 500 mass-set 25;
-#X obj 720 500 mass-set 24;
-#X obj 690 500 mass-set 23;
-#X obj 660 500 mass-set 22;
-#X obj 630 500 mass-set 21;
-#X obj 600 500 mass-set 20;
-#X obj 570 500 mass-set 19;
-#X obj 540 500 mass-set 18;
-#X obj 510 500 mass-set 17;
-#X obj 480 500 mass-set 16;
-#X obj 450 500 mass-set 15;
-#X obj 420 500 mass-set 14;
-#X obj 390 500 mass-set 13;
-#X obj 360 500 mass-set 12;
-#X obj 330 500 mass-set 11;
-#X obj 300 500 mass-set 10;
-#X obj 270 500 mass-set 9;
-#X obj 240 500 mass-set 8;
-#X obj 210 500 mass-set 7;
-#X obj 180 500 mass-set 6;
-#X obj 150 500 mass-set 5;
-#X obj 120 500 mass-set 4;
-#X obj 90 500 mass-set 3;
-#X obj 60 500 mass-set 2;
-#X obj 30 500 mass-set 1;
-#X obj 0 500 mass-set 0;
#X restore 521 67 pd setter;
#N canvas 0 0 822 675 lsetter 0;
-#X obj 0 500 link-set 15;
-#X obj 30 500 link-set 23;
-#X obj 60 500 link-set 7;
-#X obj 90 500 link-set 27;
-#X obj 120 500 link-set 11;
-#X obj 150 500 link-set 19;
-#X obj 180 500 link-set 3;
-#X obj 210 500 link-set 29;
-#X obj 240 500 link-set 13;
-#X obj 270 500 link-set 21;
-#X obj 300 500 link-set 5;
-#X obj 330 500 link-set 25;
-#X obj 360 500 link-set 9;
-#X obj 390 500 link-set 17;
-#X obj 420 500 link-set 1;
-#X obj 450 500 link-set 30;
-#X obj 480 500 link-set 14;
-#X obj 510 500 link-set 22;
-#X obj 540 500 link-set 6;
-#X obj 570 500 link-set 26;
-#X obj 600 500 link-set 10;
-#X obj 630 500 link-set 18;
-#X obj 660 500 link-set 2;
-#X obj 690 500 link-set 28;
-#X obj 720 500 link-set 12;
-#X obj 750 500 link-set 20;
-#X obj 780 500 link-set 4;
-#X obj 810 500 link-set 24;
-#X obj 840 500 link-set 8;
-#X obj 870 500 link-set 16;
-#X obj 900 500 link-set 0;
#X restore 520 90 pd lsetter;
#X text 504 43 Automatic scripting targets;
#X text 23 46 You can ignore this stuff here \, unless something goes
@@ -570,7 +532,7 @@ wrong.;
#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 1 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;
@@ -598,6 +560,10 @@ wrong.;
#X obj 625 117 s pd-lsetter;
#X msg 531 346 massesForcesL;
#X msg 630 225 massesPosYL;
+#X obj 28 133 nbx 5 14 -1e+37 1e+37 0 0 \$0-delay-stack empty delay-stack
+0 -6 0 10 -262144 -1 -1 0 256;
+#X text 25 92 If you experience stack overflows \, try setting this
+larger than 10;
#X connect 1 0 0 0;
#X connect 2 0 1 1;
#X connect 3 0 1 0;
@@ -638,12 +604,12 @@ metro \, to accelerate or slow down the simulation.;
in edit mode \, then press "L" to connect those with a link. If you
select more than two masses \, then all possible links between those
masses will get created. Use this to mass-connect masses. :);
-#N canvas 630 176 576 613 forces 0;
+#N canvas 423 517 576 613 forces 0;
#X obj 295 415 s \$0-msd;
#X obj 394 355 hsl 128 24 -5 5 0 1 empty empty empty -2 -6 0 8 -262144
-1 -1 6350 1;
#X obj 295 230 vsl 24 128 -5 5 0 1 empty empty empty 0 -8 0 8 -262144
--1 -1 7550 1;
+-1 -1 6350 1;
#X msg 295 388 forceY id \$1;
#X msg 391 388 forceX id \$1;
#X obj 295 174 tgl 24 0 empty empty constant? 0 -6 0 8 -262144 -1 -1
@@ -702,11 +668,11 @@ masses will get created. Use this to mass-connect masses. :);
#X connect 27 0 26 0;
#X connect 29 0 28 0;
#X restore 28 463 pd forces;
-#X obj 254 524 tgl 15 0 \$0-gem-masses-on empty gem_m 0 -6 0 8 -233017
+#X obj 254 524 tgl 15 0 \$0-gem-masses-on empty gem_m 0 -6 0 8 -225280
-1 -1 0 1;
-#X obj 296 524 tgl 15 0 \$0-gem-links-on empty gem_l 0 -6 0 8 -233017
+#X obj 296 524 tgl 15 0 \$0-gem-links-on empty gem_l 0 -6 0 8 -225271
-1 -1 0 1;
-#N canvas 557 667 450 300 props 0;
+#N canvas 779 673 450 300 props 0;
#X obj 117 204 s \$0-msd;
#X obj 117 46 vsl 15 64 0 10 0 0 empty empty D 0 -8 0 8 -262144 -1
-1 0 1;
@@ -786,10 +752,30 @@ from left to right. one2many will connect one mass to many others.
First select the first mass \, then set the toggle to 1 \, after that
select the other masses and set toggle to 0;
#X obj 707 106 tgl 15 0 \$0-poll-ds \$0-poll-ds poll-ds 0 -6 0 8 -225280
--1 -1 0 1;
+-1 -1 1 1;
#X obj 765 106 tgl 15 0 \$0-set-ds \$0-set-ds set-ds 0 -6 0 8 -225271
--1 -1 0 1;
+-1 -1 1 1;
#X text 669 75 Data struct anim ON/OFF:;
+#N canvas 504 489 531 315 TODO 0;
+#X text 146 11 TODO :: IDEAS;
+#X text 41 92 Make symbolic ids of new masses/links editable. For this
+I need to add new fields \, probably called "sym" \, to masses and
+links. They have to be floats for now (symbols in DS don't work yet).
+Then [makefilename] symbolic ids of this.;
+#X text 41 48 Save/load of MSD messages: Route [r \$0-msd] to a [textfile]
+or [qlist];
+#X text 41 164 Related to that the props and forces subpatches should
+be dynamic as well \, so that users can send messages to groups of
+masses/links using the different symbolic names.;
+#X restore 777 529 pd TODO;
+#N canvas 307 452 509 305 NEWS 0;
+#X text 42 52 Hopefully fixed the "stack overflows" when creating lots
+of masses.;
+#X text 32 24 RecentChanges;
+#X text 39 90 Geos: Now it's possible to add masses in geometric formations:
+rectangles (2d-networks) and circles (set center point \, radius and
+number of masses).;
+#X restore 777 508 pd NEWS;
#X connect 2 0 6 0;
#X connect 7 0 8 0;
#X connect 7 1 9 0;