aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/boids-with-gemlist.pd202
1 files changed, 202 insertions, 0 deletions
diff --git a/examples/boids-with-gemlist.pd b/examples/boids-with-gemlist.pd
new file mode 100644
index 0000000..0e9805d
--- /dev/null
+++ b/examples/boids-with-gemlist.pd
@@ -0,0 +1,202 @@
+#N canvas 521 28 520 660 10;
+#X declare -lib cyclone -lib boids -lib Gem;
+#X msg 432 52 destroy;
+#N canvas 494 140 629 324 gemwin 0;
+#X obj 219 190 gemwin;
+#X obj 66 194 outlet;
+#X obj 67 10 inlet;
+#X obj 67 41 route create;
+#X msg 67 70 set destroy;
+#X msg 157 70 set create;
+#X msg 350 115 destroy \, reset;
+#X msg 238 71 color 0 0 0.5;
+#X msg 212 146 create \, 1 \, frame 30 \, color 1 1 1;
+#X connect 2 0 3 0;
+#X connect 3 0 4 0;
+#X connect 3 0 8 0;
+#X connect 3 1 5 0;
+#X connect 3 1 6 0;
+#X connect 4 0 1 0;
+#X connect 5 0 1 0;
+#X connect 6 0 0 0;
+#X connect 7 0 0 0;
+#X connect 8 0 0 0;
+#X restore 432 72 pd gemwin;
+#X text 27 61 There is more information about the technique used in
+this patch in the Gem documentation \, mainly at the end of the 02.advanced
+section.;
+#X text 29 32 manage lots of boids using [gemlist];
+#X floatatom 314 241 5 0 0 0 - - -;
+#X floatatom 359 241 5 0 0 0 - - -;
+#N canvas 0 22 466 316 orbit 0;
+#X obj 103 82 counter 360;
+#X floatatom 103 107 5 0 0 0 - - -;
+#X obj 102 204 poltocar;
+#X obj 134 169 expr $f1 * (3.141593/180.);
+#X obj 103 134 t b f;
+#X obj 103 45 inlet;
+#X obj 152 254 outlet;
+#X obj 96 254 outlet;
+#X obj 102 170 1.5;
+#X connect 0 0 1 0;
+#X connect 1 0 4 0;
+#X connect 2 0 6 0;
+#X connect 2 1 7 0;
+#X connect 3 0 2 1;
+#X connect 4 0 8 0;
+#X connect 4 1 3 0;
+#X connect 5 0 0 0;
+#X connect 8 0 2 0;
+#X restore 314 219 pd orbit;
+#X obj 314 188 spigot;
+#X obj 350 167 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
+1;
+#X obj 350 134 loadbang;
+#X msg 128 313 attractpt \$1 \$2;
+#X obj 314 264 pack 0 0;
+#X obj 47 133 gemhead;
+#X obj 47 590 translateXYZ;
+#X obj 47 509 alpha;
+#X obj 47 616 circle 0.05;
+#X obj 47 394 gemlist;
+#X obj 47 420 separator;
+#N canvas 754 114 494 546 init 0;
+#X obj 34 20 inlet;
+#X msg 198 102 neighbors 4;
+#X msg 203 389 speed 3;
+#X msg 203 479 prefdist 1.5;
+#X msg 203 149 maxspeed 1.5;
+#X msg 203 179 minspeed 1.2;
+#X msg 203 209 center 1.2;
+#X msg 203 239 attract 1.25;
+#X msg 203 269 match 0.3;
+#X msg 203 329 repel 3.5;
+#X msg 203 299 avoid 3.5;
+#X msg 203 359 edgedist 3;
+#X msg 203 420 inertia 4.5;
+#X msg 203 449 accel 2.5;
+#X obj 34 520 outlet;
+#X connect 0 0 1 0;
+#X connect 0 0 2 0;
+#X connect 0 0 3 0;
+#X connect 0 0 4 0;
+#X connect 0 0 5 0;
+#X connect 0 0 6 0;
+#X connect 0 0 7 0;
+#X connect 0 0 8 0;
+#X connect 0 0 9 0;
+#X connect 0 0 10 0;
+#X connect 0 0 11 0;
+#X connect 0 0 12 0;
+#X connect 0 0 13 0;
+#X connect 1 0 14 0;
+#X connect 2 0 14 0;
+#X connect 3 0 14 0;
+#X connect 4 0 14 0;
+#X connect 5 0 14 0;
+#X connect 6 0 14 0;
+#X connect 7 0 14 0;
+#X connect 8 0 14 0;
+#X connect 9 0 14 0;
+#X connect 10 0 14 0;
+#X connect 11 0 14 0;
+#X connect 12 0 14 0;
+#X connect 13 0 14 0;
+#X restore 60 220 pd init;
+#N canvas 0 22 418 379 circle 0;
+#X obj 101 37 gemhead;
+#X obj 99 201 translateXYZ;
+#X obj 124 166 unpack 0 0 0;
+#X obj 147 94 inlet;
+#X msg 240 193 draw line;
+#X obj 252 106 loadbang;
+#X obj 100 131 alpha;
+#X obj 101 68 color 1 0.5 0 0.5;
+#X obj 99 228 circle 0.1;
+#X connect 0 0 7 0;
+#X connect 1 0 8 0;
+#X connect 2 0 1 1;
+#X connect 2 1 1 2;
+#X connect 2 2 1 3;
+#X connect 3 0 2 0;
+#X connect 4 0 8 0;
+#X connect 5 0 4 0;
+#X connect 6 0 1 0;
+#X connect 7 0 6 0;
+#X restore 314 299 pd circle to follow;
+#X obj 47 158 trigger bang anything bang;
+#N canvas 1 98 474 324 random 0;
+#X obj 47 130 random 1000;
+#X obj 48 171 * 0.001;
+#X obj 131 130 random 1000;
+#X obj 132 171 * 0.001;
+#X obj 214 131 random 1000;
+#X obj 215 172 * 0.001;
+#X obj 46 83 t b b b;
+#X obj 48 256 outlet;
+#X obj 49 217 pack 0 0 0 0.5;
+#X obj 47 26 inlet;
+#X msg 161 41 seed 1.23342e+06;
+#X obj 158 16 inlet;
+#X msg 191 65 seed 4.56325e+06;
+#X msg 240 92 seed 65426;
+#X connect 0 0 1 0;
+#X connect 1 0 8 0;
+#X connect 2 0 3 0;
+#X connect 3 0 8 1;
+#X connect 4 0 5 0;
+#X connect 5 0 8 2;
+#X connect 6 0 0 0;
+#X connect 6 1 2 0;
+#X connect 6 2 4 0;
+#X connect 8 0 7 0;
+#X connect 9 0 6 0;
+#X connect 10 0 0 0;
+#X connect 11 0 10 0;
+#X connect 11 0 12 0;
+#X connect 11 0 13 0;
+#X connect 12 0 2 0;
+#X connect 13 0 4 0;
+#X restore 200 394 pd random color lists;
+#X obj 47 368 trigger bang anything bang;
+#X obj 200 449 unpack 0 0 0;
+#X obj 77 548 unpack 0 0 0;
+#X obj 350 114 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
+-1 -1;
+#X obj 47 342 boids2d 100;
+#X obj 47 459 color;
+#X obj 265 6 declare -lib cyclone -lib boids -lib Gem;
+#X connect 0 0 1 0;
+#X connect 1 0 0 0;
+#X connect 4 0 11 0;
+#X connect 5 0 11 1;
+#X connect 6 0 4 0;
+#X connect 6 1 5 0;
+#X connect 7 0 6 0;
+#X connect 8 0 7 1;
+#X connect 9 0 8 0;
+#X connect 9 0 18 0;
+#X connect 10 0 26 0;
+#X connect 11 0 10 0;
+#X connect 11 0 19 0;
+#X connect 12 0 20 0;
+#X connect 13 0 15 0;
+#X connect 14 0 13 0;
+#X connect 16 0 17 0;
+#X connect 17 0 27 0;
+#X connect 18 0 26 0;
+#X connect 20 0 26 0;
+#X connect 20 1 16 1;
+#X connect 20 2 7 0;
+#X connect 20 2 21 1;
+#X connect 21 0 23 0;
+#X connect 21 0 27 1;
+#X connect 22 0 16 0;
+#X connect 22 1 24 0;
+#X connect 22 2 21 0;
+#X connect 23 0 14 1;
+#X connect 24 1 13 1;
+#X connect 24 2 13 2;
+#X connect 25 0 9 0;
+#X connect 26 0 22 0;
+#X connect 27 0 14 0;