aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorN.N. <nimon@users.sourceforge.net>2005-04-25 16:18:38 +0000
committerN.N. <nimon@users.sourceforge.net>2005-04-25 16:18:38 +0000
commit8ea100baa14f1f3f663b7a72a79f67aff2609a09 (patch)
tree944fc3276e5d18abd18502f77c0b688866fe091c
parenta9b231fe0aa28b9c4081edbc75f5a46fcff0cfe5 (diff)
MSD Version 0.03
svn path=/trunk/externals/nusmuk/; revision=2814
-rw-r--r--msd/03_msdwave.pd169
-rw-r--r--msd/filet.pd106
-rw-r--r--msd/help-msd.pd20
-rwxr-xr-xmsd/main.cpp23
4 files changed, 301 insertions, 17 deletions
diff --git a/msd/03_msdwave.pd b/msd/03_msdwave.pd
new file mode 100644
index 0000000..e09102f
--- /dev/null
+++ b/msd/03_msdwave.pd
@@ -0,0 +1,169 @@
+#N canvas 303 67 947 811 10;
+#X obj 32 13 loadbang;
+#X obj 603 265 gemwin;
+#X msg 603 243 0 \, destroy;
+#X obj 602 291 gemhead;
+#X obj 602 355 world_light;
+#X obj 145 226 t a;
+#X obj 145 12 bng 20 250 50 0 empty empty empty 0 -6 0 8 -262131 -1
+-1;
+#X msg 203 63 reset;
+#X obj 33 298 gemhead;
+#N canvas 721 124 605 590 massrender 0;
+#X obj 127 22 inlet;
+#X obj 48 203 translateXYZ;
+#X obj 64 114 gemhead;
+#X obj 48 177 separator;
+#X obj 48 153 any;
+#X obj 127 136 t b f;
+#X obj 127 57 unpack f f f;
+#X obj 45 283 cuboid 0.065 0.065 0.07;
+#X connect 0 0 6 0;
+#X connect 1 0 7 0;
+#X connect 2 0 4 1;
+#X connect 3 0 1 0;
+#X connect 4 0 3 0;
+#X connect 5 0 4 0;
+#X connect 5 1 1 1;
+#X connect 6 0 5 0;
+#X connect 6 1 1 2;
+#X connect 6 2 7 3;
+#X restore 265 625 pd massrender;
+#X msg 203 83 symbol reset;
+#X text 793 205 Select view;
+#X obj 145 38 t b b b b;
+#X text 418 114 Filet abstraction : x0 y0 stepx stepy ny nx;
+#X obj 454 464 msd -------------;
+#X obj 568 488 print msd;
+#X obj 33 497 msd2D --------------------------------;
+#X obj 294 522 print msd2D;
+#X obj 305 254 route mass;
+#X msg 305 275 mass msd1 \$1 \$2 \$5;
+#X obj 145 253 route mass;
+#X msg 145 274 mass msd2 \$1 \$2 \$3 \$4;
+#X obj 33 539 route massesPos;
+#X msg 33 343 bang \, get massesPos;
+#X obj 33 321 t b b;
+#X obj 265 600 pack f f f;
+#X obj 33 561 unpack f f;
+#X obj 33 583 t f b;
+#N canvas 0 0 450 300 getmasses 0;
+#X obj 84 33 inlet;
+#X obj 91 71 t b b b;
+#X obj 120 139 f 0;
+#X obj 120 166 + 1;
+#X obj 223 34 inlet;
+#X obj 224 64 select reset;
+#X msg 224 98 0;
+#X obj 193 228 outlet;
+#X obj 120 191 % 800;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 2 0 7 0;
+#X connect 3 0 8 0;
+#X connect 4 0 5 0;
+#X connect 5 0 6 0;
+#X connect 6 0 2 1;
+#X connect 8 0 2 1;
+#X restore 63 698 pd getmasses;
+#X obj 454 507 route massesPosNo;
+#X msg 63 718 get massesPos \$1;
+#X obj 602 334 rotateXYZ;
+#X obj 651 450 vsl 15 128 0 4 0 0 empty empty empty 0 -8 0 8 -262131
+-1 -1 0 1;
+#X obj 670 450 vsl 15 128 0 4 0 0 empty empty empty 0 -8 0 8 -262131
+-1 -1 0 1;
+#X obj 689 450 vsl 15 128 0 4 0 0 empty empty empty 0 -8 0 8 -262131
+-1 -1 0 1;
+#X obj 707 450 vsl 15 128 0 4 0 0 empty empty empty 0 -8 0 8 -262131
+-1 -1 0 1;
+#X msg 651 585 posX 0 \$1;
+#X msg 621 311 45;
+#X msg 603 223 view 4 0 0.5 0 0 0 0 0 1;
+#X msg 603 185 view 0 0.5 6 0 0 0 0 1 0;
+#X msg 650 311 45;
+#X msg 603 138 reset \, dimen 800 800 \, create \, lighting 1 \, 1
+;
+#X msg 145 173 Xmax 4 \, Xmin -4 \, Ymax 4 \, Ymin -4;
+#X msg 145 199 Xmax 4 \, Xmin -4;
+#X obj 603 161 t b;
+#X obj 183 113 filet -3.2 -2 0.1685 0.1685 20 40;
+#X msg 164 140 setFixed 0 \, setFixed 39 \, setFixed 760 \, setFixed
+799;
+#X msg 603 204 view 0 5 0 0 0 0 0 0 1;
+#X msg 670 605 posX 39 \$1;
+#X msg 689 625 posX 799 \$1;
+#X msg 708 645 posX 760 \$1;
+#X text 734 508 Move corners to send a wave!;
+#X text 194 703 Each time a mass2D position is send \, the corresponding
+z is asked to the 1D model.;
+#X text 389 35 X-Y : 2D model;
+#X text 389 49 Z : 1D model;
+#X text 146 300 If it's a mass message : send XY to ms2D and Z to msd
+;
+#X text 178 14 Reset;
+#X text 304 228 800 masses / 1540 links for each model;
+#X text 31 455 The 2D model is just here to help display masses and
+test synchronization between msd objects;
+#X connect 0 0 12 0;
+#X connect 2 0 1 0;
+#X connect 3 0 31 0;
+#X connect 5 0 18 0;
+#X connect 5 0 20 0;
+#X connect 6 0 12 0;
+#X connect 7 0 5 0;
+#X connect 8 0 24 0;
+#X connect 10 0 28 1;
+#X connect 10 0 45 1;
+#X connect 12 0 42 0;
+#X connect 12 0 43 0;
+#X connect 12 1 46 0;
+#X connect 12 2 45 0;
+#X connect 12 3 7 0;
+#X connect 12 3 10 0;
+#X connect 14 0 29 0;
+#X connect 14 1 15 0;
+#X connect 16 0 22 0;
+#X connect 16 1 17 0;
+#X connect 18 0 19 0;
+#X connect 18 1 14 0;
+#X connect 19 0 14 0;
+#X connect 20 0 21 0;
+#X connect 20 1 16 0;
+#X connect 21 0 16 0;
+#X connect 22 0 26 0;
+#X connect 23 0 16 0;
+#X connect 24 0 23 0;
+#X connect 24 1 14 0;
+#X connect 25 0 9 0;
+#X connect 26 0 27 0;
+#X connect 26 1 25 1;
+#X connect 27 0 25 0;
+#X connect 27 1 28 0;
+#X connect 28 0 30 0;
+#X connect 29 0 25 2;
+#X connect 30 0 14 0;
+#X connect 31 0 4 0;
+#X connect 32 0 36 0;
+#X connect 33 0 48 0;
+#X connect 34 0 49 0;
+#X connect 35 0 50 0;
+#X connect 36 0 14 0;
+#X connect 37 0 31 1;
+#X connect 38 0 1 0;
+#X connect 39 0 1 0;
+#X connect 40 0 31 2;
+#X connect 41 0 1 0;
+#X connect 41 0 44 0;
+#X connect 42 0 16 0;
+#X connect 43 0 14 0;
+#X connect 44 0 39 0;
+#X connect 44 0 40 0;
+#X connect 44 0 37 0;
+#X connect 45 0 5 0;
+#X connect 46 0 5 0;
+#X connect 47 0 1 0;
+#X connect 48 0 14 0;
+#X connect 49 0 14 0;
+#X connect 50 0 14 0;
diff --git a/msd/filet.pd b/msd/filet.pd
new file mode 100644
index 0000000..ccc5fc5
--- /dev/null
+++ b/msd/filet.pd
@@ -0,0 +1,106 @@
+#N canvas 543 268 669 547 10;
+#X obj 54 407 outlet;
+#X obj 152 71 f \$5;
+#X obj 188 72 f \$6;
+#X obj 115 17 loadbang;
+#X obj 46 134 repeat 0;
+#X obj 172 101 *;
+#X obj 130 45 t b b b b;
+#X obj 46 164 f -1;
+#X obj 46 188 + 1;
+#X msg 297 77 -1;
+#X obj 46 211 t f f;
+#X obj 150 323 pack f f;
+#X obj 46 50 inlet;
+#X obj 297 28 select reset;
+#X obj 297 5 inlet;
+#X obj 46 89 t b b;
+#X obj 330 175 repeat 0;
+#X obj 330 197 f -1;
+#X obj 330 218 + 1;
+#X obj 381 153 - 1;
+#X obj 387 340 moses;
+#X obj 46 280 + \$1;
+#X obj 176 278 + \$2;
+#X obj 46 234 mod \$6;
+#X obj 176 234 div \$6;
+#X text 445 35 x0 y0 xstep ystep M N;
+#X obj 414 314 - 1;
+#X obj 357 297 mod \$6;
+#X obj 474 300 div \$6;
+#X obj 366 396 + 1;
+#X obj 336 432 pack f f;
+#X obj 344 59 t b b;
+#X obj 375 370 t b;
+#X obj 334 391 f;
+#X msg 335 468 link fil \$1 \$2 10 2.5 0.5;
+#X obj 330 253 t f f f f;
+#X obj 494 339 moses;
+#X obj 443 431 pack f f;
+#X obj 482 369 t b;
+#X obj 441 390 f;
+#X obj 473 395 + \$6;
+#X obj 521 313 - 1;
+#X msg 54 359 mass filet 1 80 \$1 \$2 0;
+#X obj 46 257 * \$3;
+#X obj 176 256 * \$4;
+#X connect 1 0 5 0;
+#X connect 1 0 41 0;
+#X connect 2 0 5 1;
+#X connect 2 0 26 0;
+#X connect 3 0 6 0;
+#X connect 4 0 7 0;
+#X connect 5 0 4 1;
+#X connect 5 0 19 0;
+#X connect 6 2 1 0;
+#X connect 6 3 2 0;
+#X connect 6 3 9 0;
+#X connect 7 0 8 0;
+#X connect 8 0 7 1;
+#X connect 8 0 10 0;
+#X connect 9 0 7 1;
+#X connect 9 0 17 1;
+#X connect 10 0 23 0;
+#X connect 10 1 24 0;
+#X connect 11 0 42 0;
+#X connect 12 0 15 0;
+#X connect 13 0 9 0;
+#X connect 13 0 31 0;
+#X connect 14 0 13 0;
+#X connect 15 0 16 0;
+#X connect 15 1 4 0;
+#X connect 16 0 17 0;
+#X connect 17 0 18 0;
+#X connect 18 0 17 1;
+#X connect 18 0 35 0;
+#X connect 19 0 16 1;
+#X connect 20 0 32 0;
+#X connect 21 0 11 0;
+#X connect 22 0 11 1;
+#X connect 23 0 43 0;
+#X connect 24 0 44 0;
+#X connect 26 0 20 1;
+#X connect 27 0 20 0;
+#X connect 28 0 36 0;
+#X connect 29 0 30 1;
+#X connect 30 0 34 0;
+#X connect 31 0 1 0;
+#X connect 31 1 2 0;
+#X connect 32 0 33 0;
+#X connect 33 0 30 0;
+#X connect 34 0 0 0;
+#X connect 35 0 27 0;
+#X connect 35 1 29 0;
+#X connect 35 1 33 1;
+#X connect 35 2 28 0;
+#X connect 35 3 40 0;
+#X connect 35 3 39 1;
+#X connect 36 0 38 0;
+#X connect 37 0 34 0;
+#X connect 38 0 39 0;
+#X connect 39 0 37 0;
+#X connect 40 0 37 1;
+#X connect 41 0 36 1;
+#X connect 42 0 0 0;
+#X connect 43 0 21 0;
+#X connect 44 0 22 0;
diff --git a/msd/help-msd.pd b/msd/help-msd.pd
index 358df40..157d95f 100644
--- a/msd/help-msd.pd
+++ b/msd/help-msd.pd
@@ -15,7 +15,6 @@
#X text 235 367 Compute new masses positions;
#X obj 61 403 cnv 15 610 210 empty empty DYNAMIC_SETTING 20 12 0 14
-262131 -66577 0;
-#X text 350 449 \$1 : Id (symbol);
#X text 350 467 \$2 : New value;
#X text 348 503 \$1 : Id (symbol);
#X text 348 521 \$2 : New value;
@@ -58,19 +57,20 @@ their;
#X text 345 578 Change mobile parameter;
#X text 345 594 \$1 : Creation No of mass;
#X text 334 271 \$4 : initial position;
+#X text 350 449 \$1 : Id (symbol) or No;
#X connect 2 0 0 0;
#X connect 9 0 0 0;
-#X connect 16 0 0 0;
-#X connect 19 0 0 0;
+#X connect 15 0 0 0;
+#X connect 18 0 0 0;
+#X connect 20 0 0 0;
#X connect 21 0 0 0;
-#X connect 22 0 0 0;
-#X connect 25 0 0 0;
+#X connect 24 0 0 0;
+#X connect 28 0 0 0;
#X connect 29 0 0 0;
-#X connect 30 0 0 0;
-#X connect 33 0 0 0;
-#X connect 35 0 0 0;
-#X connect 44 0 0 0;
-#X restore 281 323 pd masses;
+#X connect 32 0 0 0;
+#X connect 34 0 0 0;
+#X connect 43 0 0 0;
+#X restore 282 323 pd masses;
#N canvas 222 83 808 841 links 0;
#X obj 33 821 msd;
#X obj 62 192 cnv 15 610 360 empty empty CREATION 20 12 0 14 -262131
diff --git a/msd/main.cpp b/msd/main.cpp
index aabd8d1..2e4e5c2 100755
--- a/msd/main.cpp
+++ b/msd/main.cpp
@@ -222,17 +222,26 @@ protected:
{
// displace mass(es) named Id to a certain position
t_int i;
- const t_symbol *sym = GetSymbol(argv[0]);
+ const t_symbol *sym = GetASymbol(argv[0]);
if (argc != 2)
- error("posX : Idmass value");
+ error("posX : Id/Nomass value");
if (GetFloat(argv[1]) < Xmax && GetFloat(argv[1]) > Xmin)
- for (i=0; i<nb_mass;i++)
- {
- if (sym == mass[i]->Id)
- mass[i]->posX = GetAFloat(argv[1]);
- }
+ if (sym ==0)
+ for (i=0; i<nb_mass;i++)
+ {
+ if (GetInt(argv[0]) == mass[i]->nbr) {
+ mass[i]->posX = GetFloat(argv[1]);
+ break;
+ }
+ }
+ else
+ for (i=0; i<nb_mass;i++)
+ {
+ if (sym == mass[i]->Id)
+ mass[i]->posX = GetFloat(argv[1]);
+ }
}
void m_set_mobile(int argc,t_atom *argv)