aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/coordinates.pd83
-rw-r--r--examples/deg2rad.pd29
-rw-r--r--examples/operating_system.pd19
-rw-r--r--examples/prime.pd21
-rw-r--r--examples/rad2deg.pd29
-rw-r--r--examples/repeat.pd22
-rw-r--r--examples/symbol2list.pd46
-rw-r--r--examples/urn.pd65
-rw-r--r--examples/wrap.pd49
9 files changed, 363 insertions, 0 deletions
diff --git a/examples/coordinates.pd b/examples/coordinates.pd
new file mode 100644
index 0000000..0004931
--- /dev/null
+++ b/examples/coordinates.pd
@@ -0,0 +1,83 @@
+#N canvas 114 89 754 537 10;
+#X text 122 40 convert between SPHeric \, POLar and CARTesian coordinates
+;
+#X obj 99 305 cart2sph;
+#X floatatom 150 286 5 0 0 0 z - -;
+#X floatatom 124 268 5 0 0 0 y - -;
+#X floatatom 99 248 5 0 0 0 x - -;
+#X floatatom 150 366 5 0 0 0 theta - -;
+#X floatatom 124 348 5 0 0 0 phi - -;
+#X floatatom 99 328 5 0 0 0 r - -;
+#X floatatom 150 116 5 0 0 0 z - -;
+#X floatatom 124 98 5 0 0 0 y - -;
+#X floatatom 99 78 5 0 0 0 x - -;
+#X floatatom 150 196 5 0 0 0 z - -;
+#X floatatom 124 178 5 0 0 0 phi - -;
+#X floatatom 99 158 5 0 0 0 r - -;
+#X obj 99 135 cart2pol;
+#X floatatom 353 116 5 0 0 0 z - -;
+#X floatatom 331 98 5 0 0 0 phi - -;
+#X floatatom 309 78 5 0 0 0 r - -;
+#X floatatom 353 196 5 0 0 0 theta - -;
+#X floatatom 331 178 5 0 0 0 phi - -;
+#X floatatom 309 158 5 0 0 0 r - -;
+#X floatatom 360 286 5 0 0 0 z - -;
+#X floatatom 334 268 5 0 0 0 phi - -;
+#X floatatom 309 248 5 0 0 0 r - -;
+#X floatatom 360 366 5 0 0 0 z - -;
+#X floatatom 334 348 5 0 0 0 y - -;
+#X floatatom 309 328 5 0 0 0 x - -;
+#X floatatom 573 286 5 0 0 0 theta - -;
+#X floatatom 551 268 5 0 0 0 phi - -;
+#X floatatom 529 248 5 0 0 0 r - -;
+#X floatatom 573 366 5 0 0 0 z - -;
+#X floatatom 551 348 5 0 0 0 phi - -;
+#X floatatom 529 328 5 0 0 0 r - -;
+#X obj 529 305 sph2pol;
+#X floatatom 580 116 5 0 0 0 theta - -;
+#X floatatom 554 98 5 0 0 0 phi - -;
+#X floatatom 529 78 5 0 0 0 r - -;
+#X floatatom 580 196 5 0 0 0 z - -;
+#X floatatom 554 178 5 0 0 0 y - -;
+#X floatatom 529 158 5 0 0 0 x - -;
+#X obj 529 135 sph2cart;
+#X obj 309 135 pol2sph;
+#X obj 309 305 pol2cart;
+#X text 112 450 angles are given in RADian \, if you want DEGree you
+might want to use [deg2rad] and [rad2deg];
+#X connect 1 0 7 0;
+#X connect 1 1 6 0;
+#X connect 1 2 5 0;
+#X connect 2 0 1 2;
+#X connect 3 0 1 1;
+#X connect 4 0 1 0;
+#X connect 8 0 14 2;
+#X connect 9 0 14 1;
+#X connect 10 0 14 0;
+#X connect 14 0 13 0;
+#X connect 14 1 12 0;
+#X connect 14 2 11 0;
+#X connect 15 0 41 2;
+#X connect 16 0 41 1;
+#X connect 17 0 41 0;
+#X connect 21 0 42 2;
+#X connect 22 0 42 1;
+#X connect 23 0 42 0;
+#X connect 27 0 33 2;
+#X connect 28 0 33 1;
+#X connect 29 0 33 0;
+#X connect 33 0 32 0;
+#X connect 33 1 31 0;
+#X connect 33 2 30 0;
+#X connect 34 0 40 2;
+#X connect 35 0 40 1;
+#X connect 36 0 40 0;
+#X connect 40 0 39 0;
+#X connect 40 1 38 0;
+#X connect 40 2 37 0;
+#X connect 41 0 20 0;
+#X connect 41 1 19 0;
+#X connect 41 2 18 0;
+#X connect 42 0 26 0;
+#X connect 42 1 25 0;
+#X connect 42 2 24 0;
diff --git a/examples/deg2rad.pd b/examples/deg2rad.pd
new file mode 100644
index 0000000..076bdf1
--- /dev/null
+++ b/examples/deg2rad.pd
@@ -0,0 +1,29 @@
+#N canvas 421 168 450 300 10;
+#X obj 60 39 deg2rad;
+#X text 122 40 convert DEGree to RADian;
+#X obj 76 138 deg2rad;
+#X floatatom 76 167 5 0 0 0 - - -;
+#X floatatom 76 86 5 0 0 0 - - -;
+#X obj 132 129 / 180;
+#X obj 132 153 * 3.14159;
+#X obj 116 225 -;
+#X floatatom 132 176 5 0 0 0 - - -;
+#X obj 76 110 t f f;
+#X floatatom 116 257 16 0 0 0 - - -;
+#X floatatom 317 155 5 0 0 0 - - -;
+#X obj 317 172 deg2rad;
+#X obj 317 195 cos;
+#X floatatom 317 217 5 0 0 0 - - -;
+#X text 317 129 example:;
+#X connect 2 0 3 0;
+#X connect 3 0 7 0;
+#X connect 4 0 9 0;
+#X connect 5 0 6 0;
+#X connect 6 0 8 0;
+#X connect 7 0 10 0;
+#X connect 8 0 7 1;
+#X connect 9 0 2 0;
+#X connect 9 1 5 0;
+#X connect 11 0 12 0;
+#X connect 12 0 13 0;
+#X connect 13 0 14 0;
diff --git a/examples/operating_system.pd b/examples/operating_system.pd
new file mode 100644
index 0000000..1686d6d
--- /dev/null
+++ b/examples/operating_system.pd
@@ -0,0 +1,19 @@
+#N canvas 186 166 450 300 10;
+#X obj 77 40 operating_system;
+#X text 200 40 which OS are we running;
+#X symbolatom 75 140 10 0 0 0 - - -;
+#X msg 75 72 bang;
+#X obj 75 164 select linux windows macos;
+#X obj 75 190 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 134 190 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 193 191 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 75 108 operating_system;
+#X connect 2 0 4 0;
+#X connect 3 0 8 0;
+#X connect 4 0 5 0;
+#X connect 4 1 6 0;
+#X connect 4 2 7 0;
+#X connect 8 0 2 0;
diff --git a/examples/prime.pd b/examples/prime.pd
new file mode 100644
index 0000000..7fe557b
--- /dev/null
+++ b/examples/prime.pd
@@ -0,0 +1,21 @@
+#N canvas 0 0 450 300 10;
+#X obj 34 32 prime;
+#X text 82 34 a prime number detector;
+#X floatatom 51 116 8 0 0 0 - - -;
+#X obj 51 147 prime;
+#X msg 51 75 1;
+#X msg 81 75 2;
+#X msg 111 75 3;
+#X msg 142 74 4;
+#X floatatom 51 187 5 0 0 0 - - -;
+#X msg 175 74 11117;
+#X msg 227 74 1.23457e+06;
+#X text 114 193 1 if input is prime \, 0 otherwise;
+#X connect 2 0 3 0;
+#X connect 3 0 8 0;
+#X connect 4 0 2 0;
+#X connect 5 0 2 0;
+#X connect 6 0 2 0;
+#X connect 7 0 2 0;
+#X connect 9 0 2 0;
+#X connect 10 0 2 0;
diff --git a/examples/rad2deg.pd b/examples/rad2deg.pd
new file mode 100644
index 0000000..709d878
--- /dev/null
+++ b/examples/rad2deg.pd
@@ -0,0 +1,29 @@
+#N canvas 421 168 450 300 10;
+#X floatatom 76 167 5 0 0 0 - - -;
+#X floatatom 76 86 5 0 0 0 - - -;
+#X obj 116 225 -;
+#X floatatom 132 176 5 0 0 0 - - -;
+#X obj 76 110 t f f;
+#X floatatom 116 257 16 0 0 0 - - -;
+#X floatatom 317 155 5 0 0 0 - - -;
+#X floatatom 317 217 5 0 0 0 - - -;
+#X text 317 129 example:;
+#X obj 76 138 rad2deg;
+#X obj 132 129 * 180;
+#X obj 132 153 / 3.14159;
+#X obj 60 39 rad2deg;
+#X text 122 40 convert RADian and DEGree;
+#X obj 317 172 atan;
+#X obj 317 195 rad2deg;
+#X connect 0 0 2 0;
+#X connect 1 0 4 0;
+#X connect 2 0 5 0;
+#X connect 3 0 2 1;
+#X connect 4 0 9 0;
+#X connect 4 1 10 0;
+#X connect 6 0 14 0;
+#X connect 9 0 0 0;
+#X connect 10 0 11 0;
+#X connect 11 0 3 0;
+#X connect 14 0 15 0;
+#X connect 15 0 7 0;
diff --git a/examples/repeat.pd b/examples/repeat.pd
new file mode 100644
index 0000000..0a66cf3
--- /dev/null
+++ b/examples/repeat.pd
@@ -0,0 +1,22 @@
+#N canvas 59 45 599 332 10;
+#X msg 41 151 bang;
+#X msg 62 177 1 1 2 3 5 8 13 21 44 fibonacchi;
+#X obj 160 14 repeat;
+#X text 210 15 - repeat a message several times.;
+#X text 64 53 similar to [until] but doesn't output [bang( but whatever
+comes in;
+#X floatatom 99 237 5 0 0 0 - - -;
+#X text 76 152 repeat bangs;
+#X text 295 179 repeat a list;
+#X text 162 262 creation argument initializes the number of repeats
+;
+#X msg 82 207 set 5;
+#X text 130 208 repeat anything;
+#X obj 41 262 repeat 3;
+#X text 143 236 reset the number of repetitions;
+#X obj 41 303 print repetitio;
+#X connect 0 0 11 0;
+#X connect 1 0 11 0;
+#X connect 5 0 11 1;
+#X connect 9 0 11 0;
+#X connect 11 0 13 0;
diff --git a/examples/symbol2list.pd b/examples/symbol2list.pd
new file mode 100644
index 0000000..e53dccf
--- /dev/null
+++ b/examples/symbol2list.pd
@@ -0,0 +1,46 @@
+#N canvas 60 29 809 570 10;
+#X symbolatom 75 517 22 0 0 0 - - -;
+#X symbolatom 147 393 10 0 0 0 - - -;
+#X obj 135 48 symbol2list;
+#X text 219 48 convert a symbol into a list;
+#X obj 458 50 s2l;
+#X symbolatom 106 500 16 0 0 0 - - -;
+#X symbolatom 137 483 10 0 0 0 - - -;
+#X msg 75 97 symbol a_dash_separated_list;
+#X msg 147 358 symbol -;
+#X obj 348 409 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X msg 170 206 symbol _i;
+#X obj 170 226 t b s;
+#X obj 75 448 unpack s s s s;
+#X symbolatom 168 467 10 0 0 0 - - -;
+#X msg 159 118 symbol what_is-the_de-limiter_i-ask-(_i) ?;
+#X text 336 497 see also:;
+#X obj 447 497 list2symbol;
+#X text 253 189 by default \, list-elements are separated by spaces.
+You can set the separator to any symbol either with an argument or
+by setting the second inlet;
+#X text 250 240 using a zero-symbol as delimiter will break the symbol
+up into its characters.;
+#X msg 256 277 symbol;
+#X obj 256 296 t b s;
+#X text 221 393 delimiter;
+#X text 375 412 banging the object will re-parse the list-symbol;
+#X text 532 498 which does the inverse;
+#X obj 75 428 symbol2list _;
+#X connect 1 0 24 1;
+#X connect 7 0 24 0;
+#X connect 8 0 1 0;
+#X connect 9 0 24 0;
+#X connect 10 0 11 0;
+#X connect 11 0 24 0;
+#X connect 11 1 1 0;
+#X connect 12 0 0 0;
+#X connect 12 1 5 0;
+#X connect 12 2 6 0;
+#X connect 12 3 13 0;
+#X connect 14 0 24 0;
+#X connect 19 0 20 0;
+#X connect 20 0 24 0;
+#X connect 20 1 1 0;
+#X connect 24 0 12 0;
diff --git a/examples/urn.pd b/examples/urn.pd
new file mode 100644
index 0000000..34cf1cb
--- /dev/null
+++ b/examples/urn.pd
@@ -0,0 +1,65 @@
+#N canvas 217 38 529 495 10;
+#X obj 76 35 urn;
+#X text 73 75 generates random numbers without repetition;
+#X obj 25 110 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X floatatom 25 290 5 0 0 1 urn - -;
+#X obj 25 259 urn 10;
+#X text 97 257 generates integer numbers between 0..(n-1);
+#X text 51 110 do generate!;
+#X floatatom 92 223 5 0 0 0 - - -;
+#X text 132 221 set (n);
+#X msg 80 141 seed 10;
+#X text 134 142 set the seed \, so you can reproduce the random-numbers
+;
+#X msg 82 178 clear;
+#X text 126 177 put all the numbers back.;
+#X obj 62 333 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 106 35 a Unique Random Numbers generator;
+#X text 79 332 when all the numbers have been drawn from the pool \,
+the system is reset (the numbers are put back) and a bang is emitted
+via the second outlet;
+#N canvas 144 58 450 344 lotto 0;
+#X text 44 35 in austria \, lotto is 6-of-45;
+#X obj 88 133 urn 45;
+#X obj 88 161 + 1;
+#X obj 88 184 repack 6;
+#X obj 88 52 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 88 233 unpack 0 0 0 0 0 0;
+#X floatatom 88 253 2 0 0 0 - - -;
+#X floatatom 112 253 2 0 0 0 - - -;
+#X floatatom 136 253 2 0 0 0 - - -;
+#X floatatom 160 253 2 0 0 0 - - -;
+#X floatatom 184 253 2 0 0 0 - - -;
+#X floatatom 209 253 2 0 0 0 - - -;
+#X obj 88 207 sort;
+#X obj 88 112 until;
+#X msg 88 90 6;
+#X obj 88 71 t b b;
+#X msg 118 90 clear;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 3 0 12 0;
+#X connect 4 0 15 0;
+#X connect 5 0 6 0;
+#X connect 5 1 7 0;
+#X connect 5 2 8 0;
+#X connect 5 3 9 0;
+#X connect 5 4 10 0;
+#X connect 5 5 11 0;
+#X connect 12 0 5 0;
+#X connect 13 0 1 0;
+#X connect 14 0 13 0;
+#X connect 15 0 14 0;
+#X connect 15 1 16 0;
+#X connect 16 0 1 0;
+#X restore 74 440 pd lotto;
+#X obj 249 453 random;
+#X text 182 453 see also:;
+#X connect 2 0 4 0;
+#X connect 4 1 13 0;
+#X connect 7 0 4 1;
+#X connect 9 0 4 0;
+#X connect 11 0 4 0;
diff --git a/examples/wrap.pd b/examples/wrap.pd
new file mode 100644
index 0000000..50fb7cc
--- /dev/null
+++ b/examples/wrap.pd
@@ -0,0 +1,49 @@
+#N canvas 77 -120 738 641 10;
+#X text 118 18 wrap a float between to limits;
+#X obj 71 18 wrap;
+#X obj 42 150 wrap;
+#X floatatom 42 132 5 0 0 0 - - -;
+#X floatatom 42 173 5 0 0 0 - - -;
+#X floatatom 42 242 5 0 0 0 - - -;
+#X floatatom 42 283 5 0 0 0 - - -;
+#X text 32 94 if called without arguments \, [wrap] will wrap the input
+between [0 \, 1);
+#X text 32 204 if called with one argument f \, [wrap] will wrap the
+input between [0 \, f);
+#X text 37 53 (somehow a float-capable modulo-function with some extensions)
+;
+#X floatatom 32 342 5 0 0 0 - - -;
+#X floatatom 32 383 5 0 0 0 - - -;
+#X text 22 306 if called with two arguments f1 f2 \, [wrap] will wrap
+the input between [f1 \, f2);
+#X obj 42 260 wrap 10.5;
+#X floatatom 244 342 5 0 0 0 - - -;
+#X floatatom 244 383 5 0 0 0 - - -;
+#X text 127 361 is the same as;
+#X obj 31 497 wrap;
+#X floatatom 31 471 5 0 0 0 - - -;
+#X floatatom 31 520 5 0 0 0 - - -;
+#X obj 32 360 wrap 1 9.2;
+#X obj 244 360 wrap 9.2 1;
+#X msg 94 455 2 4;
+#X msg 94 478 -8;
+#X text 129 463 you can dynamically set the limits via the second inlet
+;
+#X text 143 502 if only one argument is given \, the second is assumed
+as zero (0).;
+#X text 137 543 wrapping is always done between [f1 \, f2) \, where
+f1 is ALWAYS less than f2.;
+#X text 130 593 if you need wrapping between (f1 \, f2] you have to
+multiply the numbers with -1 before and after wrapping.;
+#X connect 2 0 4 0;
+#X connect 3 0 2 0;
+#X connect 5 0 13 0;
+#X connect 10 0 20 0;
+#X connect 13 0 6 0;
+#X connect 14 0 21 0;
+#X connect 17 0 19 0;
+#X connect 18 0 17 0;
+#X connect 20 0 11 0;
+#X connect 21 0 15 0;
+#X connect 22 0 17 1;
+#X connect 23 0 17 1;