diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/pddp/TODO | 3 | ||||
-rw-r--r-- | doc/pddp/all_about_hid.pd | 18 | ||||
-rw-r--r-- | doc/pddp/all_about_hid_mapping.pd | 33 | ||||
-rw-r--r-- | doc/pddp/help-operators.pd | 566 | ||||
-rw-r--r-- | doc/pddp/help-otherbinops.pd | 870 | ||||
-rw-r--r-- | doc/pddp/help-spigot.pd | 256 |
6 files changed, 890 insertions, 856 deletions
diff --git a/doc/pddp/TODO b/doc/pddp/TODO index 7e569e54..ed3d67f5 100644 --- a/doc/pddp/TODO +++ b/doc/pddp/TODO @@ -3,4 +3,5 @@ - make a Pd patch to launch table_of_contents.pd to solve recursive problem - +- make [pddp] a patch that opens the filename given as an argument using an + internal GOP bang. For example: [[]pddp all_about_hid]. diff --git a/doc/pddp/all_about_hid.pd b/doc/pddp/all_about_hid.pd index f4338124..6216e637 100644 --- a/doc/pddp/all_about_hid.pd +++ b/doc/pddp/all_about_hid.pd @@ -1,4 +1,4 @@ -#N canvas 281 174 864 594 10; +#N canvas 136 163 868 598 10; #X obj 5 2 cnv 15 850 20 empty empty all_about_hid 20 10 1 18 -233017 -66577 0; #X obj 821 3 pddp; @@ -9,19 +9,19 @@ etc. There a number of unusual HIDs \, like the Griffin PowerMate on the low end \, or the SensAble PHANTOM 6DOF on the high end.; #X obj 595 437 gemmouse; #X text 0 214 KEYBOARDS; -#X obj 34 233 key; -#X obj 66 233 keyup; +#X obj 11 233 key; +#X obj 43 233 keyup; #X obj 431 437 gemkeyboard; #X obj 659 437 gemtablet; #X obj 730 437 gemorb; #X obj 517 437 gemkeyname; -#X obj 111 233 keyname; +#X obj 88 233 keyname; #X text 16 557 (C) Copyright 2004 Hans-Christoph Steiner <hans@at.or.at> ; #X text 233 571 released under the GNU GPL; -#X text 429 558 $Revision: 1.3 $$Date: 2004-11-28 23:58:40 $; +#X text 429 558 $Revision: 1.4 $$Date: 2005-04-18 00:33:26 $; #X text 430 571 $Author: eighthave $; -#N canvas 0 22 643 447 deprecated 0; +#N canvas 0 22 647 451 deprecated 0; #X text 35 38 The use of these objects is deprecated since the functionality that they provide is available in the [hid] object \, which is a unified \, cross-platform approach.; @@ -112,7 +112,7 @@ sound.; #X text 435 314 -------------------------------------------------------- ; #X text 3 453 PLATFORM-SPECIFIC HID OBJECTS; -#X obj 90 528 linuxmouse; +#X obj 254 527 linuxmouse; #X text 15 470 To get full access to some devices \, you need to use the platform-specific objects. The objects have dummy versions on the other platforms so that you open the patches on other platforms and @@ -122,5 +122,7 @@ They only receive key events when Pd has focus \; they output alternating 1s and 0s to represent auto-repeat \; [key] and [heyup] are limited to the 'printing' characters. [keyname] reports Shift \, Ctrl \, Alt \, Meta \, etc.; -#X obj 12 528 linuxhid; +#X obj 12 527 linuxhid; #X text 435 216 USB mice on Windows or MacOS X; +#X obj 85 527 darwinhid; +#X obj 166 527 windowshid; diff --git a/doc/pddp/all_about_hid_mapping.pd b/doc/pddp/all_about_hid_mapping.pd index ddb57fb1..84351eff 100644 --- a/doc/pddp/all_about_hid_mapping.pd +++ b/doc/pddp/all_about_hid_mapping.pd @@ -1,4 +1,4 @@ -#N canvas 304 56 880 562 10; +#N canvas 304 56 896 578 10; #N canvas 0 22 450 300 graph1 0; #X array cuberoot 100 float 0; #X coords 0 1 99 0 100 100 1; @@ -86,7 +86,7 @@ #X obj 5 2 cnv 15 850 20 empty empty all_about_hid_mapping 20 10 1 18 -233017 -66577 0; #X obj 821 3 pddp; -#X obj 156 329 hid_graph; +#X obj 209 398 hid_graph; #X obj 9 102 notescale; #X obj 653 104 pow 3; #X obj 406 100 pow 0.333333; @@ -106,15 +106,15 @@ #X text 641 297 exponential; #X obj 9 213 buttongate; #X obj 88 213 keygate; -#X text 341 393 - CURVE TEXT IDEAS; -#X text 370 419 - amplitude is generally perceived on a logarithmic +#X text 341 423 - CURVE TEXT IDEAS; +#X text 370 449 - amplitude is generally perceived on a logarithmic scale; #X obj 9 124 hid_invert; -#X text 22 500 (C) Copyright 2004 Hans-Christoph Steiner <hans@at.or.at> +#X text 22 530 (C) Copyright 2004 Hans-Christoph Steiner <hans@at.or.at> ; -#X text 239 514 released under the GNU GPL; -#X text 445 501 $Revision: 1.5 $$Date: 2004-12-19 18:22:45 $; -#X text 446 514 $Author: eighthave $; +#X text 239 544 released under the GNU GPL; +#X text 445 531 $Revision: 1.6 $$Date: 2005-04-18 00:33:26 $; +#X text 446 544 $Author: eighthave $; #X obj 88 167 hid_average; #X text 1 83 SCALING AND RANGING; #X text 1 150 SMOOTHING; @@ -125,5 +125,18 @@ scale; #X obj 9 262 hid_one2two; #X obj 94 262 hid_one2three; #X text 379 30 CURVES; -#X text 371 443 - pitch is perceived on logarithmic scale; -#X text 371 466 - many sensors work best on other curves; +#X text 371 473 - pitch is perceived on logarithmic scale; +#X text 371 496 - many sensors work best on other curves; +#X text 1 286 POLAR COORDINATES; +#X obj 84 303 hid_degrees; +#X obj 9 303 hid_polar; +#X obj 174 303 hid_spiral; +#X obj 10 350 hid2rad; +#X obj 130 350 hid2deg; +#X obj 70 350 rad2hid; +#X obj 190 350 deg2hid; +#X text 1 330 ANGLE CONVERSIONS; +#X text 474 386 Objects that start with "hid_" accept input data in +the range of 0-1 and output data in the same range \, allowing you +to chain as many of these objects together without thinking about scaling +the resulting data with each step.; diff --git a/doc/pddp/help-operators.pd b/doc/pddp/help-operators.pd index 2c524d0d..6ff5ae0b 100644 --- a/doc/pddp/help-operators.pd +++ b/doc/pddp/help-operators.pd @@ -1,283 +1,283 @@ -#N canvas 23 29 920 640 10;
-#X obj 622 350 +~;
-#X obj 626 499 trigger;
-#X text 25 8 ARITHMETIC;
-#X text 30 29 PD's arithmetic objects include:;
-#X obj 231 30 +;
-#X obj 256 30 -;
-#X obj 282 30 *;
-#X obj 308 30 /;
-#X obj 334 30 pow;
-#X obj 359 30 max;
-#X obj 385 30 min;
-#X obj 32 276 +;
-#X floatatom 32 205 0 0 0;
-#X floatatom 32 297 0 0 0;
-#X floatatom 45 228 0 0 0;
-#X msg 63 254 bang;
-#X text 98 255 Bang outputs sum;
-#X text 70 204 Numbers in left inlet add and output sum;
-#X text 87 227 Numbers in right inlet only change the inlet's value
-;
-#X text 29 171 The example below performs basic addition with two numbers:
-i.e. a + b = c;
-#X text 28 54 All of these objects operate the same way. The right
-inlet sets or changes the numeric value of the object. Sending a number
-to the left inlet forces the object to perform the operation with the
-current numeric value of the object and output the result. A "bang"
-will output the result without changing the numeric values at either
-inlet. A creation argument can be used to define the initial numeric
-value of the right inlet.;
-#X text 29 325 The example below incorporates a creation argument:
-i.e. a + 42 = b;
-#X floatatom 29 357 0 0 0;
-#X floatatom 29 400 0 0 0;
-#X obj 29 379 + 42;
-#N canvas 38 134 637 241 basic_examples 0;
-#X obj 44 129 +;
-#X obj 113 129 -;
-#X obj 179 129 *;
-#X obj 244 129 /;
-#X obj 316 129 pow;
-#X obj 394 129 max;
-#X obj 482 129 min;
-#X floatatom 44 32 5 0 0;
-#X floatatom 44 150 0 0 0;
-#X floatatom 113 149 0 0 0;
-#X floatatom 179 149 0 0 0;
-#X floatatom 244 149 0 0 0;
-#X floatatom 316 149 0 0 0;
-#X floatatom 394 150 0 0 0;
-#X floatatom 482 149 0 0 0;
-#X floatatom 495 32 5 0 0;
-#X msg 360 32 bang;
-#X connect 0 0 8 0;
-#X connect 1 0 9 0;
-#X connect 2 0 10 0;
-#X connect 3 0 11 0;
-#X connect 4 0 12 0;
-#X connect 5 0 13 0;
-#X connect 6 0 14 0;
-#X connect 7 0 0 0;
-#X connect 7 0 1 0;
-#X connect 7 0 2 0;
-#X connect 7 0 3 0;
-#X connect 7 0 4 0;
-#X connect 7 0 5 0;
-#X connect 7 0 6 0;
-#X connect 15 0 6 1;
-#X connect 15 0 5 1;
-#X connect 15 0 4 1;
-#X connect 15 0 3 1;
-#X connect 15 0 2 1;
-#X connect 15 0 1 1;
-#X connect 15 0 0 1;
-#X connect 16 0 0 0;
-#X connect 16 0 1 0;
-#X connect 16 0 2 0;
-#X connect 16 0 3 0;
-#X connect 16 0 4 0;
-#X connect 16 0 5 0;
-#X connect 16 0 6 0;
-#X restore 28 542 pd basic_examples;
-#X text 29 425 + - * / are probably self-explanatory...if you are using
-PD \, then it is safe to say that you have passed third grade.;
-#X text 27 463 However \, [pow] \, [max] \, and [min] objects may need
-some explanation.;
-#N canvas 0 0 452 302 understanding_POW 0;
-#X text 12 25 [POW];
-#X obj 17 66 pow 2;
-#X floatatom 17 86 2 0 0;
-#X msg 17 46 2;
-#X text 61 115 - it is important to note that [pow] only works with
-NON-negative mantissas. That is to say that negative floating point
-fractions will be ignored.;
-#X obj 18 153 pow 2;
-#X floatatom 18 173 2 0 0;
-#X msg 13 111 -2;
-#X msg 24 132 -1.5;
-#X text 65 202 - however \, [pow] is capable of computing negative
-exponents!;
-#X floatatom 19 201 0 0 0;
-#X obj 19 221 pow -2;
-#X floatatom 19 242 0 0 0;
-#X text 57 39 - this object is used to exponentiate a number. The object
-returns the value at the left inlet to the power of the right inlet
-where the left inlet is the base and the right inlet is the exponent.
-For example: 2 to the power of 2 = 4 (i.e. 2 Squared);
-#X connect 1 0 2 0;
-#X connect 3 0 1 0;
-#X connect 5 0 6 0;
-#X connect 7 0 5 0;
-#X connect 8 0 5 0;
-#X connect 10 0 11 0;
-#X connect 11 0 12 0;
-#X restore 28 497 pd understanding_POW;
-#N canvas 0 0 474 341 understanding_MAX_and_MIN 0;
-#X text 34 9 [MAX];
-#X obj 32 51 max 10;
-#X floatatom 32 29 5 0 0;
-#X floatatom 32 76 5 0 0;
-#X text 87 26 - [max] returns the greater of the two numbers passed
-to its inlets. For example \, if the creation argument (or right inlet)
-is equal to 10 \, and you send 9 to the left inlet then the object
-will return 10 If you pass it an 11 \, then object returns 11;
-#X floatatom 33 116 5 0 0;
-#X floatatom 33 163 5 0 0;
-#X text 35 96 [MIN];
-#X text 88 113 - [min] returns the lesser of the two numbers passed
-to its inlets. For example \, if the creation argument (or right inlet)
-is equal to 10 \, and you send 9 to the left inlet then the object
-will return 9 If you pass it an 11 \, then object returns 10;
-#X obj 33 138 min 10;
-#X text 32 185 - It is important to note that [max] and [min] output
-a number with every number or "bang" that is sent to the left inlet.
-;
-#X floatatom 35 234 5 0 0;
-#X floatatom 35 282 5 0 0;
-#X obj 35 256 min 10;
-#X obj 76 281 bng 15 50 10 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X text 80 232 Move this number box above 10;
-#X connect 1 0 3 0;
-#X connect 2 0 1 0;
-#X connect 5 0 9 0;
-#X connect 9 0 6 0;
-#X connect 11 0 13 0;
-#X connect 13 0 12 0;
-#X connect 13 0 14 0;
-#X restore 28 519 pd understanding_MAX_and_MIN;
-#X obj 430 568 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 430 12 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X text 469 20 THE SUM OF MANY NUMBERS;
-#X text 473 40 PD has wonderful object called [expr] which allows you
-to write mathematical expressions. I would suggest that you investigate
-the [expr] object to process basic mathematical equations with more
-than 2 separate values.;
-#X msg 481 151 bang;
-#X obj 481 203 random 10;
-#X obj 543 203 random 10;
-#X obj 605 203 random 10;
-#X text 509 222 a;
-#X text 571 223 b;
-#X text 632 222 c;
-#X text 512 288 d;
-#X floatatom 481 288 0 0 0;
-#X obj 481 172 t b b b;
-#X obj 481 245 +;
-#X obj 481 266 +;
-#X floatatom 481 223 0 0 0;
-#X floatatom 543 223 0 0 0;
-#X floatatom 605 223 0 0 0;
-#X text 474 102 Having said that \, it IS possible to build equations
-with multiple elements using these basic math objects \, as in the
-example below: (i.e. a + b + c = d);
-#X text 469 324 RELATED OBJECTS;
-#X obj 651 350 -~;
-#X obj 680 350 *~;
-#X obj 708 350 /~;
-#X obj 736 350 max~;
-#X obj 766 350 min~;
-#X text 550 350 Audio Math;
-#X obj 622 374 ==;
-#X obj 680 374 >;
-#X obj 736 374 <;
-#X obj 708 374 >=;
-#X obj 766 373 <=;
-#X obj 652 374 !=;
-#X text 514 375 Relational Tests;
-#X text 508 398 Logical Operators;
-#X obj 623 398 &;
-#X obj 652 398 |;
-#X obj 680 398 &&;
-#X obj 708 398 ||;
-#X obj 736 398 <<;
-#X obj 766 398 >>;
-#X obj 680 499 expr;
-#X obj 622 422 mtof;
-#X obj 653 422 ftom;
-#X obj 684 422 powtodb;
-#X obj 734 422 rmstodb;
-#X obj 784 422 dbtopow;
-#X obj 834 422 dbtorms;
-#X text 455 423 Acoustical Unit Conversion;
-#X text 547 450 Higher Math;
-#X obj 793 374 mod;
-#X obj 820 374 div;
-#X obj 626 449 sin;
-#X obj 652 449 cos;
-#X obj 679 449 tan;
-#X obj 706 449 atan;
-#X obj 625 473 atan2;
-#X obj 716 499 random;
-#X obj 663 473 sqrt;
-#X obj 694 473 log;
-#X obj 720 473 exp;
-#X obj 746 473 abs;
-#X text 580 499 Other;
-#N canvas 181 122 454 304 related_objects_from_other_libraries 0;
-#X obj 37 25 vector+;
-#X obj 37 45 vector-;
-#X obj 37 65 vector*;
-#X obj 85 25 vector/;
-#X obj 85 45 rgb2hsv;
-#X obj 85 65 hsv2rgb;
-#X obj 133 25 abs~;
-#X obj 133 45 db2v;
-#X obj 133 65 v2db;
-#X obj 163 25 avg~;
-#X obj 164 45 tavg~;
-#X obj 164 65 pdf~;
-#X obj 201 24 <~;
-#X obj 201 45 ==~;
-#X obj 201 67 >~;
-#X obj 228 25 &&~;
-#X obj 228 46 ||~;
-#X obj 228 67 matrix~;
-#X obj 280 25 mavg;
-#X obj 280 46 mean;
-#X obj 280 68 divide;
-#X obj 323 27 divmod;
-#X obj 324 47 minus;
-#X obj 324 67 plus;
-#X text 29 104 These objects are offered in PD only if you have downloaded
-and properly installed the appropriate library. These objects may or
-may not exist in a single library.;
-#X text 28 153 The best places to find information about PD's libraries
-is:;
-#X text 25 175 www.puredata.org and click on "Downloads" then "Software"
-;
-#X text 27 190 or;
-#X text 27 205 iem.kug.ac.at/pdb/;
-#X obj 370 27 q8_rsqrt~;
-#X obj 370 51 q8_sqrt~;
-#X restore 520 537 pd related_objects_from_other_libraries;
-#X obj 763 499 f;
-#X obj 791 499 int;
-#X obj 794 398 %;
-#X obj 251 539 timer;
-#X text 292 584 This document was updated for PD version 0.35 test
-28 by Dave Sabine as part of a project called pddp proposed by Krzysztof
-Czaja to build comprehensive documentation for PD.;
-#X obj 739 449 pow;
-#X connect 11 0 13 0;
-#X connect 12 0 11 0;
-#X connect 14 0 11 1;
-#X connect 15 0 11 0;
-#X connect 22 0 24 0;
-#X connect 24 0 23 0;
-#X connect 31 0 30 0;
-#X connect 34 0 43 0;
-#X connect 35 0 46 0;
-#X connect 36 0 47 0;
-#X connect 37 0 48 0;
-#X connect 43 0 35 0;
-#X connect 43 1 36 0;
-#X connect 43 2 37 0;
-#X connect 44 0 45 0;
-#X connect 45 0 42 0;
-#X connect 46 0 44 0;
-#X connect 47 0 44 1;
-#X connect 48 0 45 1;
+#N canvas 23 29 924 644 10; +#X obj 637 350 +~; +#X obj 641 499 trigger; +#X text 25 8 ARITHMETIC; +#X text 30 29 PD's arithmetic objects include:; +#X obj 231 30 +; +#X obj 256 30 -; +#X obj 282 30 *; +#X obj 308 30 /; +#X obj 334 30 pow; +#X obj 359 30 max; +#X obj 385 30 min; +#X obj 32 276 +; +#X floatatom 32 205 0 0 0 0 - - -; +#X floatatom 32 297 0 0 0 0 - - -; +#X floatatom 45 228 0 0 0 0 - - -; +#X msg 63 254 bang; +#X text 98 255 Bang outputs sum; +#X text 70 204 Numbers in left inlet add and output sum; +#X text 87 227 Numbers in right inlet only change the inlet's value +; +#X text 29 171 The example below performs basic addition with two numbers: +i.e. a + b = c; +#X text 28 54 All of these objects operate the same way. The right +inlet sets or changes the numeric value of the object. Sending a number +to the left inlet forces the object to perform the operation with the +current numeric value of the object and output the result. A "bang" +will output the result without changing the numeric values at either +inlet. A creation argument can be used to define the initial numeric +value of the right inlet.; +#X text 29 325 The example below incorporates a creation argument: +i.e. a + 42 = b; +#X floatatom 29 357 0 0 0 0 - - -; +#X floatatom 29 400 0 0 0 0 - - -; +#X obj 29 379 + 42; +#N canvas 38 134 637 241 basic_examples 0; +#X obj 44 129 +; +#X obj 113 129 -; +#X obj 179 129 *; +#X obj 244 129 /; +#X obj 316 129 pow; +#X obj 394 129 max; +#X obj 482 129 min; +#X floatatom 44 32 5 0 0 0 - - -; +#X floatatom 44 150 0 0 0 0 - - -; +#X floatatom 113 149 0 0 0 0 - - -; +#X floatatom 179 149 0 0 0 0 - - -; +#X floatatom 244 149 0 0 0 0 - - -; +#X floatatom 316 149 0 0 0 0 - - -; +#X floatatom 394 150 0 0 0 0 - - -; +#X floatatom 482 149 0 0 0 0 - - -; +#X floatatom 495 32 5 0 0 0 - - -; +#X msg 360 32 bang; +#X connect 0 0 8 0; +#X connect 1 0 9 0; +#X connect 2 0 10 0; +#X connect 3 0 11 0; +#X connect 4 0 12 0; +#X connect 5 0 13 0; +#X connect 6 0 14 0; +#X connect 7 0 0 0; +#X connect 7 0 1 0; +#X connect 7 0 2 0; +#X connect 7 0 3 0; +#X connect 7 0 4 0; +#X connect 7 0 5 0; +#X connect 7 0 6 0; +#X connect 15 0 6 1; +#X connect 15 0 5 1; +#X connect 15 0 4 1; +#X connect 15 0 3 1; +#X connect 15 0 2 1; +#X connect 15 0 1 1; +#X connect 15 0 0 1; +#X connect 16 0 0 0; +#X connect 16 0 1 0; +#X connect 16 0 2 0; +#X connect 16 0 3 0; +#X connect 16 0 4 0; +#X connect 16 0 5 0; +#X connect 16 0 6 0; +#X restore 28 542 pd basic_examples; +#X text 29 425 + - * / are probably self-explanatory...if you are using +PD \, then it is safe to say that you have passed third grade.; +#X text 27 463 However \, [pow] \, [max] \, and [min] objects may need +some explanation.; +#N canvas 0 22 452 302 understanding_POW 0; +#X text 12 25 [POW]; +#X obj 17 66 pow 2; +#X floatatom 17 86 2 0 0 0 - - -; +#X msg 17 46 2; +#X text 61 115 - it is important to note that [pow] only works with +NON-negative mantissas. That is to say that negative floating point +fractions will be ignored.; +#X obj 18 153 pow 2; +#X floatatom 18 173 2 0 0 0 - - -; +#X msg 13 111 -2; +#X msg 24 132 -1.5; +#X text 65 202 - however \, [pow] is capable of computing negative +exponents!; +#X floatatom 19 201 0 0 0 0 - - -; +#X obj 19 221 pow -2; +#X floatatom 19 242 0 0 0 0 - - -; +#X text 57 39 - this object is used to exponentiate a number. The object +returns the value at the left inlet to the power of the right inlet +where the left inlet is the base and the right inlet is the exponent. +For example: 2 to the power of 2 = 4 (i.e. 2 Squared); +#X connect 1 0 2 0; +#X connect 3 0 1 0; +#X connect 5 0 6 0; +#X connect 7 0 5 0; +#X connect 8 0 5 0; +#X connect 10 0 11 0; +#X connect 11 0 12 0; +#X restore 28 497 pd understanding_POW; +#N canvas 0 22 474 341 understanding_MAX_and_MIN 0; +#X text 34 9 [MAX]; +#X obj 32 51 max 10; +#X floatatom 32 29 5 0 0 0 - - -; +#X floatatom 32 76 5 0 0 0 - - -; +#X text 87 26 - [max] returns the greater of the two numbers passed +to its inlets. For example \, if the creation argument (or right inlet) +is equal to 10 \, and you send 9 to the left inlet then the object +will return 10 If you pass it an 11 \, then object returns 11; +#X floatatom 33 116 5 0 0 0 - - -; +#X floatatom 33 163 5 0 0 0 - - -; +#X text 35 96 [MIN]; +#X text 88 113 - [min] returns the lesser of the two numbers passed +to its inlets. For example \, if the creation argument (or right inlet) +is equal to 10 \, and you send 9 to the left inlet then the object +will return 9 If you pass it an 11 \, then object returns 10; +#X obj 33 138 min 10; +#X text 32 185 - It is important to note that [max] and [min] output +a number with every number or "bang" that is sent to the left inlet. +; +#X floatatom 35 234 5 0 0 0 - - -; +#X floatatom 35 282 5 0 0 0 - - -; +#X obj 35 256 min 10; +#X obj 76 281 bng 15 50 10 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X text 80 232 Move this number box above 10; +#X connect 1 0 3 0; +#X connect 2 0 1 0; +#X connect 5 0 9 0; +#X connect 9 0 6 0; +#X connect 11 0 13 0; +#X connect 13 0 12 0; +#X connect 13 0 14 0; +#X restore 28 519 pd understanding_MAX_and_MIN; +#X obj 430 568 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 430 12 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X text 469 20 THE SUM OF MANY NUMBERS; +#X text 473 40 PD has wonderful object called [expr] which allows you +to write mathematical expressions. I would suggest that you investigate +the [expr] object to process basic mathematical equations with more +than 2 separate values.; +#X msg 481 151 bang; +#X obj 481 203 random 10; +#X obj 543 203 random 10; +#X obj 605 203 random 10; +#X text 509 222 a; +#X text 571 223 b; +#X text 632 222 c; +#X text 512 288 d; +#X floatatom 481 288 0 0 0 0 - - -; +#X obj 481 172 t b b b; +#X obj 481 245 +; +#X obj 481 266 +; +#X floatatom 481 223 0 0 0 0 - - -; +#X floatatom 543 223 0 0 0 0 - - -; +#X floatatom 605 223 0 0 0 0 - - -; +#X text 474 102 Having said that \, it IS possible to build equations +with multiple elements using these basic math objects \, as in the +example below: (i.e. a + b + c = d); +#X text 469 324 RELATED OBJECTS; +#X obj 666 350 -~; +#X obj 695 350 *~; +#X obj 723 350 /~; +#X obj 751 350 max~; +#X obj 781 350 min~; +#X text 540 350 Audio Math; +#X obj 637 374 ==; +#X obj 695 374 >; +#X obj 751 374 <; +#X obj 723 374 >=; +#X obj 781 373 <=; +#X obj 667 374 !=; +#X text 504 375 Relational Tests; +#X text 498 398 Logical Operators; +#X obj 638 398 &; +#X obj 667 398 |; +#X obj 695 398 &&; +#X obj 723 398 ||; +#X obj 751 398 <<; +#X obj 781 398 >>; +#X obj 695 499 expr; +#X obj 637 422 mtof; +#X obj 668 422 ftom; +#X obj 699 422 powtodb; +#X obj 749 422 rmstodb; +#X obj 799 422 dbtopow; +#X obj 849 422 dbtorms; +#X text 445 423 Acoustical Unit Conversion; +#X text 537 450 Higher Math; +#X obj 808 374 mod; +#X obj 835 374 div; +#X obj 641 449 sin; +#X obj 667 449 cos; +#X obj 694 449 tan; +#X obj 721 449 atan; +#X obj 640 473 atan2; +#X obj 731 499 random; +#X obj 678 473 sqrt; +#X obj 709 473 log; +#X obj 735 473 exp; +#X obj 761 473 abs; +#X text 570 499 Other; +#N canvas 181 122 454 304 related_objects_from_other_libraries 0; +#X obj 37 25 vector+; +#X obj 37 45 vector-; +#X obj 37 65 vector*; +#X obj 85 25 vector/; +#X obj 85 45 rgb2hsv; +#X obj 85 65 hsv2rgb; +#X obj 133 25 abs~; +#X obj 133 45 db2v; +#X obj 133 65 v2db; +#X obj 163 25 avg~; +#X obj 164 45 tavg~; +#X obj 164 65 pdf~; +#X obj 201 24 <~; +#X obj 201 45 ==~; +#X obj 201 67 >~; +#X obj 228 25 &&~; +#X obj 228 46 ||~; +#X obj 228 67 matrix~; +#X obj 280 25 mavg; +#X obj 280 46 mean; +#X obj 280 68 divide; +#X obj 323 27 divmod; +#X obj 324 47 minus; +#X obj 324 67 plus; +#X text 29 104 These objects are offered in PD only if you have downloaded +and properly installed the appropriate library. These objects may or +may not exist in a single library.; +#X text 28 153 The best places to find information about PD's libraries +is:; +#X text 25 175 www.puredata.org and click on "Downloads" then "Software" +; +#X text 27 190 or; +#X text 27 205 iem.kug.ac.at/pdb/; +#X obj 370 27 q8_rsqrt~; +#X obj 370 51 q8_sqrt~; +#X restore 520 537 pd related_objects_from_other_libraries; +#X obj 778 499 f; +#X obj 806 499 int; +#X obj 809 398 %; +#X obj 251 539 timer; +#X text 292 584 This document was updated for PD version 0.35 test +28 by Dave Sabine as part of a project called pddp proposed by Krzysztof +Czaja to build comprehensive documentation for PD.; +#X obj 754 449 pow; +#X connect 11 0 13 0; +#X connect 12 0 11 0; +#X connect 14 0 11 1; +#X connect 15 0 11 0; +#X connect 22 0 24 0; +#X connect 24 0 23 0; +#X connect 31 0 30 0; +#X connect 34 0 43 0; +#X connect 35 0 46 0; +#X connect 36 0 47 0; +#X connect 37 0 48 0; +#X connect 43 0 35 0; +#X connect 43 1 36 0; +#X connect 43 2 37 0; +#X connect 44 0 45 0; +#X connect 45 0 42 0; +#X connect 46 0 44 0; +#X connect 47 0 44 1; +#X connect 48 0 45 1; diff --git a/doc/pddp/help-otherbinops.pd b/doc/pddp/help-otherbinops.pd index 3e57b6d4..e44a299e 100644 --- a/doc/pddp/help-otherbinops.pd +++ b/doc/pddp/help-otherbinops.pd @@ -1,435 +1,435 @@ -#N canvas 16 1 887 655 10;
-#X floatatom 217 438 0 0 0;
-#X floatatom 267 517 0 0 0;
-#X obj 466 28 &;
-#X obj 494 28 |;
-#X obj 574 28 &&;
-#X obj 601 28 ||;
-#X obj 7 25 >;
-#X obj 36 25 >=;
-#X obj 67 24 ==;
-#X obj 125 24 <=;
-#X obj 153 24 <;
-#X obj 217 417 >;
-#X obj 267 496 ==;
-#X obj 96 24 !=;
-#X obj 521 28 <<;
-#X obj 548 28 >>;
-#X obj 627 28 %;
-#X text 464 5 THE LOGICAL OPERATORS -- A.K.A. "Bit Twiddling";
-#X text 6 6 THE RELATIONAL OPERATORS;
-#N canvas 0 0 454 304 understanding_%_modulus 0;
-#X text 24 23 MODULUS - [%];
-#X floatatom 28 187 0 0 0;
-#X text 22 40 - this object has nothing to do with percentage!;
-#X text 20 54 - a modulus is a number by which two given numbers can
-be divided and produce the same remainder.;
-#X text 21 81 - in the example below: 9 / 2 = 4.5 \, and 7 / 2 = 3.5.
-Hence if 7 and 9 are divided by 2 \, then the remainder of both equations
-is .5. Therefore \, the modulus of 7 and 9 is "2".;
-#X msg 28 138 9;
-#X obj 28 166 % 7;
-#X floatatom 62 142 5 0 0;
-#X text 20 222 Note that the modulus operator is not a "bitwise" operator
-\, but a math function.;
-#X connect 5 0 6 0;
-#X connect 6 0 1 0;
-#X connect 7 0 6 0;
-#X restore 476 418 pd understanding_%_modulus;
-#X text 478 252 Below is a brief explanation of each of these logical
-operators.;
-#X text 473 53 These objects are adopted from the mother of all object
-oriented languages: C. They are "bitwise" operators which perform logical
-and shift operations on 32-bit numbers.;
-#X text 467 100 WHAT DOES "BITWISE" MEAN?;
-#X text 478 208 Hence \, performing "bitwise" relational tests means
-that PD can compare "1101" to "1001" instead of operating with the
-integers that are represented by those binary codes.;
-#N canvas 81 197 456 306 understanding_&_AND 0;
-#X obj 33 216 &;
-#X floatatom 87 182 5 0 0;
-#X floatatom 129 183 5 0 0;
-#X msg 33 154 13;
-#X msg 62 155 9;
-#X text 18 18 [&] -- This is the bitwise AND operator which returns
-a "1" for each bit position where the corresponding bits of both its
-operands are "1". For example:;
-#X text 22 67 13 = "1101";
-#X text 28 79 9 = "1001";
-#X text 15 92 Hence:"1001";
-#X obj 33 114 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 33 132 t b b;
-#X text 101 66 When comparing the binary codes for 13 and 9 \, we can
-see that the first and fourth digits of both codes are 1 Hence the
-result will be "1001" -- in other words "9".;
-#X floatatom 33 238 0 0 0;
-#X connect 0 0 12 0;
-#X connect 1 0 0 0;
-#X connect 2 0 0 1;
-#X connect 3 0 0 0;
-#X connect 4 0 0 1;
-#X connect 9 0 10 0;
-#X connect 10 0 3 0;
-#X connect 10 1 4 0;
-#X restore 478 286 pd understanding_&_AND;
-#N canvas 190 317 454 304 understanding_|_OR 0;
-#X floatatom 32 247 0 0 0;
-#X floatatom 86 191 5 0 0;
-#X floatatom 128 192 5 0 0;
-#X msg 32 163 13;
-#X msg 61 164 9;
-#X text 21 76 13 = "1101";
-#X text 27 88 9 = "1001";
-#X obj 32 123 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 32 141 t b b;
-#X text 18 18 [|] -- This is the bitwise OR operator which returns
-a "1" for each bit position where one OR both of the corresponding
-bits of both its operands is a "1". For example:;
-#X text 14 101 Hence:"1101";
-#X text 98 76 When comparing the binary codes for 13 and 9 \, we can
-see that the first and fourth digits of both codes are both 1 and the
-second position of 13 is a one. Hence the result will be "1101" --
-in other words "13".;
-#X obj 32 225 |;
-#X connect 1 0 12 0;
-#X connect 2 0 12 1;
-#X connect 3 0 12 0;
-#X connect 4 0 12 1;
-#X connect 7 0 8 0;
-#X connect 8 0 3 0;
-#X connect 8 1 4 0;
-#X connect 12 0 0 0;
-#X restore 478 307 pd understanding_|_OR;
-#N canvas 0 0 454 304 understanding_<<_LEFT-SHIFT 0;
-#X obj 46 142 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 46 160 t b b;
-#X msg 46 181 13;
-#X obj 46 222 <<;
-#X floatatom 46 244 5 0 0;
-#X msg 74 181 2;
-#X floatatom 112 193 5 0 0;
-#X floatatom 160 193 5 0 0;
-#X text 29 25 [<<] -- This is the left shift operator and it works
-by shifting the digits of the binary representation of the first operand
-(left inlet) to the left by the number of places specified by the second
-operand (right inlet). The spaces created to the right are filled by
-zeros \, and any digits falling off the left are discarded. The following
-code returns 52 as the binary of 13 ("1101") is shifted two places
-to the left giving "110100":;
-#X connect 0 0 1 0;
-#X connect 1 0 2 0;
-#X connect 1 1 5 0;
-#X connect 2 0 3 0;
-#X connect 3 0 4 0;
-#X connect 5 0 3 1;
-#X connect 6 0 3 0;
-#X connect 7 0 3 1;
-#X restore 477 328 pd understanding_<<_LEFT-SHIFT;
-#N canvas 0 0 456 380 understanding_>>_RIGHT-SHIFT 0;
-#X obj 41 155 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 41 173 t b b;
-#X floatatom 41 257 5 0 0;
-#X floatatom 107 206 5 0 0;
-#X floatatom 155 206 5 0 0;
-#X msg 41 194 13;
-#X obj 41 235 >>;
-#X msg 69 194 2;
-#X text 33 21 [>>] -- This is the sign-propagating right shift operator
-which shifts the digits of the binary representation of the first operand
-(left inlet) to the right by the number of places specified by the
-second operand (right inlet) \, discarding any shifted off to the right.
-The copies of the leftmost bit are added on from the left \, thereby
-preserving the sign of the number. This next examples returns 3 ("11")
-as the two right-most bits of 13 ("1101") are shifted off to the right
-and discarded.;
-#X text 33 284 Note that this object preserves negative values for
-negative operands. ("sign-propagating").;
-#X connect 0 0 1 0;
-#X connect 1 0 5 0;
-#X connect 1 1 7 0;
-#X connect 3 0 6 0;
-#X connect 4 0 6 1;
-#X connect 5 0 6 0;
-#X connect 6 0 2 0;
-#X connect 7 0 6 1;
-#X restore 477 350 pd understanding_>>_RIGHT-SHIFT;
-#N canvas 56 51 528 425 understanding_&&_LOGICAL-AND 0;
-#X msg 56 269 5;
-#X obj 25 319 &&;
-#X floatatom 25 339 5 0 0;
-#X floatatom 194 277 5 0 0;
-#X text 12 26 [&&] - This is the logical AND operator \, which returns
-a Boolean true (a one) if both operands are true. Logically it follows
-that if the first operand is false \, then the whole expression is
-false \, and this is how the objects works: It first evaluates the
-left hand operand (left inlet) and if this returns false (zero) then
-\, without going any further \, it returns a false (a zero). Otherwise
-it returns the value of the second operand (right inlet).;
-#X floatatom 237 277 5 0 0;
-#X text 25 364 Note that this is not a bitwise operator. It compares
-floats.;
-#X obj 25 227 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 25 245 t b b;
-#X msg 25 269 17;
-#X text 12 145 In other words \, IF the left inlet is zero \, THEN
-output zero. ELSEIF the left inlet is non-zero AND the right inlet
-is zero \, then output zero. ELSEIF the left inlet is non-zero AND
-the right inlet is non-zero \, THEN output non-zero!;
-#X obj 91 227 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 91 245 t b b;
-#X msg 91 269 17;
-#X msg 122 269 0;
-#X connect 0 0 1 1;
-#X connect 1 0 2 0;
-#X connect 3 0 1 0;
-#X connect 5 0 1 1;
-#X connect 7 0 8 0;
-#X connect 8 0 9 0;
-#X connect 8 1 0 0;
-#X connect 9 0 1 0;
-#X connect 11 0 12 0;
-#X connect 12 0 13 0;
-#X connect 12 1 14 0;
-#X connect 13 0 1 0;
-#X connect 14 0 1 1;
-#X restore 477 373 pd understanding_&&_LOGICAL-AND;
-#N canvas 244 51 530 427 understanding_||_LOGICAL-OR 0;
-#X msg 56 269 5;
-#X floatatom 25 339 5 0 0;
-#X floatatom 196 280 5 0 0;
-#X floatatom 239 280 5 0 0;
-#X text 25 364 Note that this is not a bitwise operator. It compares
-floats.;
-#X obj 25 227 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 25 245 t b b;
-#X msg 25 269 17;
-#X text 17 21 [||] -- This is the logical OR operator and it returns
-a value of true (non-zero) if one or both of the operands is true.
-It works by first evaluating the left-hand operand (left inlet) and
-\, if this is true \, diregarding the right-hand operand (right inlet)
-and returning a non-zero. If \, however \, the left-hand operand (left
-inlet) is false \, then it returns the value of the right-hand operand
-(right inlet).;
-#X text 12 145 In other words \, IF the left inlet is non-zero \, THEN
-output non-zero. ELSEIF the left inlet is zero AND the right inlet
-is zero \, then output zero. ELSEIF the left inlet is zero AND the
-right inlet is non-zero \, THEN output non-zero!;
-#X obj 25 319 ||;
-#X obj 96 226 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 96 244 t b b;
-#X msg 96 268 0;
-#X msg 127 268 0;
-#X connect 0 0 10 1;
-#X connect 2 0 10 0;
-#X connect 3 0 10 1;
-#X connect 5 0 6 0;
-#X connect 6 0 7 0;
-#X connect 6 1 0 0;
-#X connect 7 0 10 0;
-#X connect 10 0 1 0;
-#X connect 11 0 12 0;
-#X connect 12 0 13 0;
-#X connect 12 1 14 0;
-#X connect 13 0 10 0;
-#X connect 14 0 10 1;
-#X restore 477 395 pd understanding_||_LOGICAL-OR;
-#X obj 432 12 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 432 607 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 54 186 == 42;
-#X floatatom 54 165 5 0 0;
-#X floatatom 54 212 2 0 0;
-#X obj 79 211 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X msg 24 161 42;
-#X text 9 143 For example: IF 42 is equal to x \, then "1" (True);
-#X text 99 203 Note that the object outputs 1 or 0 with every incoming
-message.;
-#X text 10 233 All of these objects operate the same way. The right
-inlet or creation argument sets the "condition" to which the incoming
-messages are compared. The left inlet accepts numbers or a "bang" --
-a number will reset the value and output a true or false (1 or 0) depending
-on whether or not the incoming value meets the necessary condition.
-A "bang" will force the object to output a true or false (1 or 0) based
-on the value that is already stored in the left inlet.;
-#X floatatom 25 378 5 0 0;
-#X floatatom 98 345 5 0 0;
-#X text 10 376 a;
-#X text 138 344 b;
-#X text 93 439 Is a greater than b?;
-#X floatatom 242 478 0 0 0;
-#X text 47 478 Is a greater than or equal to b?;
-#X obj 242 457 >=;
-#X text 166 517 Is a equal to b?;
-#X obj 295 534 !=;
-#X floatatom 295 554 0 0 0;
-#X obj 325 367 r a_b;
-#X obj 325 386 unpack f f;
-#X obj 25 395 pack f f;
-#X obj 25 415 s a_b;
-#X obj 98 361 bang;
-#X text 172 555 Is a NOT equal to b?;
-#X floatatom 321 592 0 0 0;
-#X text 215 592 Is a less than b?;
-#X obj 321 572 <;
-#X floatatom 346 631 0 0 0;
-#X obj 346 611 <;
-#X text 168 631 Is a less than or equal to b?;
-#X text 474 583 This document was updated for PD version 0.35 test
-29 by Dave Sabine as part of a project called pddp proposed by Krzysztof
-Czaja to build comprehensive documentation for PD.;
-#X text 461 460 RELATED OBJECTS;
-#X obj 813 477 +;
-#X text 480 477 Visit the Help document for MATH for more math objects:
-;
-#N canvas 0 0 452 302 related_objects_from_other_libraries 0;
-#X obj 47 34 strcomp;
-#X text 102 33 Relational tests for strings.;
-#X text 29 104 These objects are offered in PD only if you have downloaded
-and properly installed the appropriate library. These objects may or
-may not exist in a single library.;
-#X text 28 153 The best places to find information about PD's libraries
-is:;
-#X text 25 175 www.puredata.org and click on "Downloads" then "Software"
-;
-#X text 27 190 or;
-#X text 27 205 iem.kug.ac.at/pdb/;
-#X restore 482 501 pd related_objects_from_other_libraries;
-#X text 478 120 Well \, these objects perform "relational" tests on
-the binary forms of 32-bit numbers. For example \, the number 13 is
-represented in your computer's operating system in binary code by "1101"
-and the number 9 is "1001". Each of those binary digits is an 8-bit
-word: 8 bits * 4 digits = 32-bits!;
-#X obj 179 24 mod;
-#X obj 206 24 div;
-#X text 8 84 Most relational operators output a boolean value: true
-or false (1 or 0) depending on the relation between the input (left
-inlet) and the condition (right inlet or creation argument).;
-#N canvas 7 1 506 648 understanding_MOD_and_DIV 0;
-#X text 24 5 [mod] and [div] are helpful objects to determine whether
-or not a fraction produces a remainder \, or to determine the value
-of the remainder.;
-#X text 24 80 while \, 4 / 3 = 1 with a remainder of 1;
-#X text 25 51 For example \, 3 / 3 = 1 with a remainder of zero (i.e.
-no remainder).;
-#X floatatom 26 190 0 0 0;
-#X floatatom 26 232 0 0 0;
-#X floatatom 138 192 0 0 0;
-#X text 68 191 divided by;
-#X text 184 192 has a remainder of;
-#X floatatom 300 193 0 0 0;
-#X obj 26 211 mod;
-#X text 22 103 [mod] takes a number in its left inlet and will divide
-that number by either the creation argument or the number given at
-its left inlet and will produce the value of the remainder at its outlet.
-If no creation argument is given \, then the default value is 1;
-#X obj 88 173 loadbang;
-#X msg 138 173 1;
-#X text 23 255 [div] takes a number in its left inlet and will divide
-that number by either the creation argument or the number given at
-its left inlet and will produce the result without a remainder. If
-no creation argument is given \, then the default value is 1;
-#X floatatom 28 341 0 0 0;
-#X floatatom 28 383 0 0 0;
-#X floatatom 140 343 0 0 0;
-#X text 70 342 divided by;
-#X floatatom 256 344 0 0 0;
-#X obj 90 324 loadbang;
-#X msg 140 324 1;
-#X obj 28 362 div;
-#X text 186 343 is equal to;
-#X text 294 343 with no remainder.;
-#X obj 257 371 /;
-#X floatatom 257 391 0 0 0;
-#X text 237 389 or;
-#X text 310 392 with a remainder.;
-#X text 23 408 In the following example \, I've built a metronome which
-counts bar numbers and beat numbers: default time signature is 4/4
-(Common Time).;
-#X obj 23 489 metro 500;
-#X obj 23 470 tgl 15 0 empty empty Start-Stop 0 -6 0 8 -262144 -1 -1
-0 1;
-#X obj 48 510 + 1;
-#X floatatom 23 530 0 0 0;
-#X text 52 532 Total Beat Count;
-#X obj 23 559 div 4;
-#X obj 134 560 mod 4;
-#X floatatom 219 601 0 0 0;
-#X floatatom 108 600 0 0 0;
-#X obj 23 510 f 1;
-#X msg 107 468 1;
-#X obj 23 579 + 1;
-#X obj 134 579 + 1;
-#X text 131 468 Reset;
-#X text 44 599 Bar number;
-#X text 157 601 Beat Count;
-#X floatatom 339 511 0 0 0;
-#X text 196 511 How many beats per bar?;
-#X connect 3 0 9 0;
-#X connect 4 0 8 0;
-#X connect 5 0 9 1;
-#X connect 9 0 4 0;
-#X connect 11 0 12 0;
-#X connect 12 0 5 0;
-#X connect 14 0 21 0;
-#X connect 14 0 24 0;
-#X connect 15 0 18 0;
-#X connect 16 0 21 1;
-#X connect 16 0 24 1;
-#X connect 19 0 20 0;
-#X connect 20 0 16 0;
-#X connect 21 0 15 0;
-#X connect 24 0 25 0;
-#X connect 29 0 38 0;
-#X connect 30 0 29 0;
-#X connect 31 0 38 1;
-#X connect 32 0 34 0;
-#X connect 32 0 35 0;
-#X connect 34 0 40 0;
-#X connect 35 0 41 0;
-#X connect 38 0 31 0;
-#X connect 38 0 32 0;
-#X connect 39 0 38 1;
-#X connect 40 0 37 0;
-#X connect 41 0 36 0;
-#X connect 45 0 35 1;
-#X connect 45 0 34 1;
-#X restore 9 58 pd understanding_MOD_and_DIV;
-#X connect 11 0 0 0;
-#X connect 12 0 1 0;
-#X connect 30 0 31 0;
-#X connect 32 0 34 0;
-#X connect 32 0 35 0;
-#X connect 33 0 32 0;
-#X connect 36 0 32 0;
-#X connect 40 0 53 0;
-#X connect 41 0 53 1;
-#X connect 41 0 55 0;
-#X connect 47 0 45 0;
-#X connect 49 0 50 0;
-#X connect 51 0 52 0;
-#X connect 52 0 11 0;
-#X connect 52 0 47 0;
-#X connect 52 0 12 0;
-#X connect 52 0 49 0;
-#X connect 52 0 59 0;
-#X connect 52 0 61 0;
-#X connect 52 1 11 1;
-#X connect 52 1 47 1;
-#X connect 52 1 12 1;
-#X connect 52 1 49 1;
-#X connect 52 1 59 1;
-#X connect 52 1 61 1;
-#X connect 53 0 54 0;
-#X connect 55 0 40 0;
-#X connect 59 0 57 0;
-#X connect 61 0 60 0;
+#N canvas 16 22 895 663 10; +#X floatatom 217 438 0 0 0 0 - - -; +#X floatatom 267 517 0 0 0 0 - - -; +#X obj 466 28 &; +#X obj 494 28 |; +#X obj 574 28 &&; +#X obj 601 28 ||; +#X obj 7 25 >; +#X obj 36 25 >=; +#X obj 67 24 ==; +#X obj 125 24 <=; +#X obj 153 24 <; +#X obj 217 417 >; +#X obj 267 496 ==; +#X obj 96 24 !=; +#X obj 521 28 <<; +#X obj 548 28 >>; +#X obj 627 28 %; +#X text 464 5 THE LOGICAL OPERATORS -- A.K.A. "Bit Twiddling"; +#X text 6 6 THE RELATIONAL OPERATORS; +#N canvas 0 22 454 304 understanding_%_modulus 0; +#X text 24 23 MODULUS - [%]; +#X floatatom 28 187 0 0 0 0 - - -; +#X text 22 40 - this object has nothing to do with percentage!; +#X text 20 54 - a modulus is a number by which two given numbers can +be divided and produce the same remainder.; +#X text 21 81 - in the example below: 9 / 2 = 4.5 \, and 7 / 2 = 3.5. +Hence if 7 and 9 are divided by 2 \, then the remainder of both equations +is .5. Therefore \, the modulus of 7 and 9 is "2".; +#X msg 28 138 9; +#X obj 28 166 % 7; +#X floatatom 62 142 5 0 0 0 - - -; +#X text 20 222 Note that the modulus operator is not a "bitwise" operator +\, but a math function.; +#X connect 5 0 6 0; +#X connect 6 0 1 0; +#X connect 7 0 6 0; +#X restore 476 418 pd understanding_%_modulus; +#X text 478 252 Below is a brief explanation of each of these logical +operators.; +#X text 473 53 These objects are adopted from the mother of all object +oriented languages: C. They are "bitwise" operators which perform logical +and shift operations on 32-bit numbers.; +#X text 467 100 WHAT DOES "BITWISE" MEAN?; +#X text 478 208 Hence \, performing "bitwise" relational tests means +that PD can compare "1101" to "1001" instead of operating with the +integers that are represented by those binary codes.; +#N canvas 81 197 456 306 understanding_&_AND 0; +#X obj 33 216 &; +#X floatatom 87 182 5 0 0 0 - - -; +#X floatatom 129 183 5 0 0 0 - - -; +#X msg 33 154 13; +#X msg 62 155 9; +#X text 18 18 [&] -- This is the bitwise AND operator which returns +a "1" for each bit position where the corresponding bits of both its +operands are "1". For example:; +#X text 22 67 13 = "1101"; +#X text 28 79 9 = "1001"; +#X text 15 92 Hence:"1001"; +#X obj 33 114 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 33 132 t b b; +#X text 101 66 When comparing the binary codes for 13 and 9 \, we can +see that the first and fourth digits of both codes are 1 Hence the +result will be "1001" -- in other words "9".; +#X floatatom 33 238 0 0 0 0 - - -; +#X connect 0 0 12 0; +#X connect 1 0 0 0; +#X connect 2 0 0 1; +#X connect 3 0 0 0; +#X connect 4 0 0 1; +#X connect 9 0 10 0; +#X connect 10 0 3 0; +#X connect 10 1 4 0; +#X restore 478 286 pd understanding_&_AND; +#N canvas 190 317 454 304 understanding_|_OR 0; +#X floatatom 32 247 0 0 0 0 - - -; +#X floatatom 86 191 5 0 0 0 - - -; +#X floatatom 128 192 5 0 0 0 - - -; +#X msg 32 163 13; +#X msg 61 164 9; +#X text 21 76 13 = "1101"; +#X text 27 88 9 = "1001"; +#X obj 32 123 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 32 141 t b b; +#X text 18 18 [|] -- This is the bitwise OR operator which returns +a "1" for each bit position where one OR both of the corresponding +bits of both its operands is a "1". For example:; +#X text 14 101 Hence:"1101"; +#X text 98 76 When comparing the binary codes for 13 and 9 \, we can +see that the first and fourth digits of both codes are both 1 and the +second position of 13 is a one. Hence the result will be "1101" -- +in other words "13".; +#X obj 32 225 |; +#X connect 1 0 12 0; +#X connect 2 0 12 1; +#X connect 3 0 12 0; +#X connect 4 0 12 1; +#X connect 7 0 8 0; +#X connect 8 0 3 0; +#X connect 8 1 4 0; +#X connect 12 0 0 0; +#X restore 478 307 pd understanding_|_OR; +#N canvas 0 22 454 304 understanding_<<_LEFT-SHIFT 0; +#X obj 46 142 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 46 160 t b b; +#X msg 46 181 13; +#X obj 46 222 <<; +#X floatatom 46 244 5 0 0 0 - - -; +#X msg 74 181 2; +#X floatatom 112 193 5 0 0 0 - - -; +#X floatatom 160 193 5 0 0 0 - - -; +#X text 29 25 [<<] -- This is the left shift operator and it works +by shifting the digits of the binary representation of the first operand +(left inlet) to the left by the number of places specified by the second +operand (right inlet). The spaces created to the right are filled by +zeros \, and any digits falling off the left are discarded. The following +code returns 52 as the binary of 13 ("1101") is shifted two places +to the left giving "110100":; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 1 1 5 0; +#X connect 2 0 3 0; +#X connect 3 0 4 0; +#X connect 5 0 3 1; +#X connect 6 0 3 0; +#X connect 7 0 3 1; +#X restore 477 328 pd understanding_<<_LEFT-SHIFT; +#N canvas 0 22 456 380 understanding_>>_RIGHT-SHIFT 0; +#X obj 41 155 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 41 173 t b b; +#X floatatom 41 257 5 0 0 0 - - -; +#X floatatom 107 206 5 0 0 0 - - -; +#X floatatom 155 206 5 0 0 0 - - -; +#X msg 41 194 13; +#X obj 41 235 >>; +#X msg 69 194 2; +#X text 33 21 [>>] -- This is the sign-propagating right shift operator +which shifts the digits of the binary representation of the first operand +(left inlet) to the right by the number of places specified by the +second operand (right inlet) \, discarding any shifted off to the right. +The copies of the leftmost bit are added on from the left \, thereby +preserving the sign of the number. This next examples returns 3 ("11") +as the two right-most bits of 13 ("1101") are shifted off to the right +and discarded.; +#X text 33 284 Note that this object preserves negative values for +negative operands. ("sign-propagating").; +#X connect 0 0 1 0; +#X connect 1 0 5 0; +#X connect 1 1 7 0; +#X connect 3 0 6 0; +#X connect 4 0 6 1; +#X connect 5 0 6 0; +#X connect 6 0 2 0; +#X connect 7 0 6 1; +#X restore 477 350 pd understanding_>>_RIGHT-SHIFT; +#N canvas 56 51 528 425 understanding_&&_LOGICAL-AND 0; +#X msg 56 269 5; +#X obj 25 319 &&; +#X floatatom 25 339 5 0 0 0 - - -; +#X floatatom 194 277 5 0 0 0 - - -; +#X text 12 26 [&&] - This is the logical AND operator \, which returns +a Boolean true (a one) if both operands are true. Logically it follows +that if the first operand is false \, then the whole expression is +false \, and this is how the objects works: It first evaluates the +left hand operand (left inlet) and if this returns false (zero) then +\, without going any further \, it returns a false (a zero). Otherwise +it returns the value of the second operand (right inlet).; +#X floatatom 237 277 5 0 0 0 - - -; +#X text 25 364 Note that this is not a bitwise operator. It compares +floats.; +#X obj 25 227 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 25 245 t b b; +#X msg 25 269 17; +#X text 12 145 In other words \, IF the left inlet is zero \, THEN +output zero. ELSEIF the left inlet is non-zero AND the right inlet +is zero \, then output zero. ELSEIF the left inlet is non-zero AND +the right inlet is non-zero \, THEN output non-zero!; +#X obj 91 227 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 91 245 t b b; +#X msg 91 269 17; +#X msg 122 269 0; +#X connect 0 0 1 1; +#X connect 1 0 2 0; +#X connect 3 0 1 0; +#X connect 5 0 1 1; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X connect 8 1 0 0; +#X connect 9 0 1 0; +#X connect 11 0 12 0; +#X connect 12 0 13 0; +#X connect 12 1 14 0; +#X connect 13 0 1 0; +#X connect 14 0 1 1; +#X restore 477 373 pd understanding_&&_LOGICAL-AND; +#N canvas 244 51 530 427 understanding_||_LOGICAL-OR 0; +#X msg 56 269 5; +#X floatatom 25 339 5 0 0 0 - - -; +#X floatatom 196 280 5 0 0 0 - - -; +#X floatatom 239 280 5 0 0 0 - - -; +#X text 25 364 Note that this is not a bitwise operator. It compares +floats.; +#X obj 25 227 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 25 245 t b b; +#X msg 25 269 17; +#X text 17 21 [||] -- This is the logical OR operator and it returns +a value of true (non-zero) if one or both of the operands is true. +It works by first evaluating the left-hand operand (left inlet) and +\, if this is true \, diregarding the right-hand operand (right inlet) +and returning a non-zero. If \, however \, the left-hand operand (left +inlet) is false \, then it returns the value of the right-hand operand +(right inlet).; +#X text 12 145 In other words \, IF the left inlet is non-zero \, THEN +output non-zero. ELSEIF the left inlet is zero AND the right inlet +is zero \, then output zero. ELSEIF the left inlet is zero AND the +right inlet is non-zero \, THEN output non-zero!; +#X obj 25 319 ||; +#X obj 96 226 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 96 244 t b b; +#X msg 96 268 0; +#X msg 127 268 0; +#X connect 0 0 10 1; +#X connect 2 0 10 0; +#X connect 3 0 10 1; +#X connect 5 0 6 0; +#X connect 6 0 7 0; +#X connect 6 1 0 0; +#X connect 7 0 10 0; +#X connect 10 0 1 0; +#X connect 11 0 12 0; +#X connect 12 0 13 0; +#X connect 12 1 14 0; +#X connect 13 0 10 0; +#X connect 14 0 10 1; +#X restore 477 395 pd understanding_||_LOGICAL-OR; +#X obj 432 12 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 432 607 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 54 186 == 42; +#X floatatom 54 165 5 0 0 0 - - -; +#X floatatom 28 212 2 0 0 0 - - -; +#X obj 53 211 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 24 161 42; +#X text 9 143 For example: IF 42 is equal to x \, then "1" (True); +#X text 73 203 Note that the object outputs 1 or 0 with every incoming +message.; +#X text 10 233 All of these objects operate the same way. The right +inlet or creation argument sets the "condition" to which the incoming +messages are compared. The left inlet accepts numbers or a "bang" -- +a number will reset the value and output a true or false (1 or 0) depending +on whether or not the incoming value meets the necessary condition. +A "bang" will force the object to output a true or false (1 or 0) based +on the value that is already stored in the left inlet.; +#X floatatom 25 378 5 0 0 0 - - -; +#X floatatom 98 345 5 0 0 0 - - -; +#X text 10 376 a; +#X text 138 344 b; +#X text 63 439 Is a greater than b?; +#X floatatom 242 478 0 0 0 0 - - -; +#X text 17 478 Is a greater than or equal to b?; +#X obj 242 457 >=; +#X text 136 517 Is a equal to b?; +#X obj 295 534 !=; +#X floatatom 295 554 0 0 0 0 - - -; +#X obj 325 367 r a_b; +#X obj 325 386 unpack f f; +#X obj 25 395 pack f f; +#X obj 25 415 s a_b; +#X obj 98 361 bang; +#X text 142 555 Is a NOT equal to b?; +#X floatatom 321 592 0 0 0 0 - - -; +#X text 185 592 Is a less than b?; +#X obj 321 572 <; +#X floatatom 346 631 0 0 0 0 - - -; +#X obj 346 611 <; +#X text 138 631 Is a less than or equal to b?; +#X text 464 583 This document was updated for PD version 0.35 test +29 by Dave Sabine as part of a project called pddp proposed by Krzysztof +Czaja to build comprehensive documentation for PD.; +#X text 461 460 RELATED OBJECTS; +#X obj 853 477 +; +#X text 460 477 Visit the Help document for MATH for more math objects: +; +#N canvas 0 22 452 302 related_objects_from_other_libraries 0; +#X obj 47 34 strcomp; +#X text 102 33 Relational tests for strings.; +#X text 29 104 These objects are offered in PD only if you have downloaded +and properly installed the appropriate library. These objects may or +may not exist in a single library.; +#X text 28 153 The best places to find information about PD's libraries +is:; +#X text 25 175 www.puredata.org and click on "Downloads" then "Software" +; +#X text 27 190 or; +#X text 27 205 iem.kug.ac.at/pdb/; +#X restore 482 501 pd related_objects_from_other_libraries; +#X text 478 120 Well \, these objects perform "relational" tests on +the binary forms of 32-bit numbers. For example \, the number 13 is +represented in your computer's operating system in binary code by "1101" +and the number 9 is "1001". Each of those binary digits is an 8-bit +word: 8 bits * 4 digits = 32-bits!; +#X obj 179 24 mod; +#X obj 206 24 div; +#X text 8 84 Most relational operators output a boolean value: true +or false (1 or 0) depending on the relation between the input (left +inlet) and the condition (right inlet or creation argument).; +#N canvas 7 22 514 656 understanding_MOD_and_DIV 0; +#X text 24 5 [mod] and [div] are helpful objects to determine whether +or not a fraction produces a remainder \, or to determine the value +of the remainder.; +#X text 24 80 while \, 4 / 3 = 1 with a remainder of 1; +#X text 25 51 For example \, 3 / 3 = 1 with a remainder of zero (i.e. +no remainder).; +#X floatatom 26 190 0 0 0 0 - - -; +#X floatatom 26 232 0 0 0 0 - - -; +#X floatatom 138 192 0 0 0 0 - - -; +#X text 58 191 divided by; +#X text 173 193 has a remainder of; +#X floatatom 300 193 0 0 0 0 - - -; +#X obj 26 211 mod; +#X text 22 103 [mod] takes a number in its left inlet and will divide +that number by either the creation argument or the number given at +its left inlet and will produce the value of the remainder at its outlet. +If no creation argument is given \, then the default value is 1; +#X obj 78 173 loadbang; +#X msg 138 173 1; +#X text 23 255 [div] takes a number in its left inlet and will divide +that number by either the creation argument or the number given at +its left inlet and will produce the result without a remainder. If +no creation argument is given \, then the default value is 1; +#X floatatom 28 341 0 0 0 0 - - -; +#X floatatom 28 383 0 0 0 0 - - -; +#X floatatom 140 343 0 0 0 0 - - -; +#X text 60 342 divided by; +#X floatatom 256 344 0 0 0 0 - - -; +#X obj 80 324 loadbang; +#X msg 140 324 1; +#X obj 28 362 div; +#X text 176 343 is equal to; +#X text 294 343 with no remainder.; +#X obj 257 371 /; +#X floatatom 257 391 0 0 0 0 - - -; +#X text 227 389 or; +#X text 297 392 with a remainder.; +#X text 23 408 In the following example \, I've built a metronome which +counts bar numbers and beat numbers: default time signature is 4/4 +(Common Time).; +#X obj 23 489 metro 500; +#X obj 23 470 tgl 15 0 empty empty Start-Stop 0 -6 0 8 -262144 -1 -1 +0 1; +#X obj 48 510 + 1; +#X floatatom 23 530 0 0 0 0 - - -; +#X text 52 532 Total Beat Count; +#X obj 23 559 div 4; +#X obj 134 560 mod 4; +#X floatatom 219 601 0 0 0 0 - - -; +#X floatatom 108 600 0 0 0 0 - - -; +#X obj 23 510 f 1; +#X msg 107 468 1; +#X obj 23 579 + 1; +#X obj 134 579 + 1; +#X text 131 468 Reset; +#X text 34 599 Bar number; +#X text 147 601 Beat Count; +#X floatatom 339 511 0 0 0 0 - - -; +#X text 176 511 How many beats per bar?; +#X connect 3 0 9 0; +#X connect 4 0 8 0; +#X connect 5 0 9 1; +#X connect 9 0 4 0; +#X connect 11 0 12 0; +#X connect 12 0 5 0; +#X connect 14 0 21 0; +#X connect 14 0 24 0; +#X connect 15 0 18 0; +#X connect 16 0 21 1; +#X connect 16 0 24 1; +#X connect 19 0 20 0; +#X connect 20 0 16 0; +#X connect 21 0 15 0; +#X connect 24 0 25 0; +#X connect 29 0 38 0; +#X connect 30 0 29 0; +#X connect 31 0 38 1; +#X connect 32 0 34 0; +#X connect 32 0 35 0; +#X connect 34 0 40 0; +#X connect 35 0 41 0; +#X connect 38 0 31 0; +#X connect 38 0 32 0; +#X connect 39 0 38 1; +#X connect 40 0 37 0; +#X connect 41 0 36 0; +#X connect 45 0 35 1; +#X connect 45 0 34 1; +#X restore 9 58 pd understanding_MOD_and_DIV; +#X connect 11 0 0 0; +#X connect 12 0 1 0; +#X connect 30 0 31 0; +#X connect 32 0 34 0; +#X connect 32 0 35 0; +#X connect 33 0 32 0; +#X connect 36 0 32 0; +#X connect 40 0 53 0; +#X connect 41 0 53 1; +#X connect 41 0 55 0; +#X connect 47 0 45 0; +#X connect 49 0 50 0; +#X connect 51 0 52 0; +#X connect 52 0 11 0; +#X connect 52 0 47 0; +#X connect 52 0 12 0; +#X connect 52 0 49 0; +#X connect 52 0 59 0; +#X connect 52 0 61 0; +#X connect 52 1 11 1; +#X connect 52 1 47 1; +#X connect 52 1 12 1; +#X connect 52 1 49 1; +#X connect 52 1 59 1; +#X connect 52 1 61 1; +#X connect 53 0 54 0; +#X connect 55 0 40 0; +#X connect 59 0 57 0; +#X connect 61 0 60 0; diff --git a/doc/pddp/help-spigot.pd b/doc/pddp/help-spigot.pd index 43bf1240..f9965551 100644 --- a/doc/pddp/help-spigot.pd +++ b/doc/pddp/help-spigot.pd @@ -1,119 +1,137 @@ -#N canvas 94 12 862 647 10;
-#X msg 16 96 0.5 1000;
-#X floatatom 47 160 1 0 0;
-#X obj 16 177 spigot;
-#X obj 16 198 print;
-#X msg 28 136 walk the cat;
-#X msg 22 116 bang;
-#X obj 35 11 spigot;
-#X text 83 11 - pass or block messages;
-#X text 72 160 control: nonzero to pass messages \, zero to stop them
-;
-#X text 12 294 USING [SPIGOT] TO CREATE A GATE.;
-#X text 15 309 Unlike its closest cousin MAX \, PD does not have a
-native [gate] object. There are other PD libraries which include gates
-for both audio and numerical data \, but similar routines can be built
-in PD using [spigot]. The example below shows a two-way gate using
-two [spigots] and the [expr] object.;
-#X obj 95 505 spigot;
-#X floatatom 96 459 1 0 0;
-#X text 113 458 controls: open and close the gates.;
-#X floatatom 31 527 5 0 0;
-#X floatatom 95 527 5 0 0;
-#X obj 15 400 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
-;
-#X obj 15 418 metro 200;
-#X obj 15 439 f;
-#X obj 39 439 + 1;
-#X obj 126 484 expr 1-$f1;
-#X text 32 398 Click to start sending info through the gates.;
-#X obj 96 439 loadbang;
-#X text 16 38 [spigot] passes messages from its left inlet to its outlet
-\, as long as a nonzero number is sent to its right inlet. When its
-right inlet gets zero \, incoming messages are "blocked" (i.e. ignored).
-;
-#X text 14 231 [spigot] works essentially like a doorway. When the
-door is open \, messages can pass through. When the door is closed
-\, messages are ignored. By default \, the door is always closed!;
-#X obj 31 505 spigot;
-#X text 13 547 In the example above \, the magic is created by the
-[expr] object which performs a simple calculation using the incoming
-number (1 or 0). Note that the figure "$f1" is a variable which assumes
-the value of the incoming number.;
-#X text 402 36 CREATION ARGUMENTS?;
-#X obj 416 98 spigot 0;
-#X text 404 196 [SPIGOT] FOR AUDIO SIGNALS?;
-#X text 417 213 [spigot] does not work with audio signals. The data
-types which are accepted by this object are floats \, symbols \, lists
-\, bangs \, anythings and pointers. However \, audio signals require
-a completely different treatment.;
-#X text 414 265 PD does not have a [spigot] for audio signals \, but
-the same effect can be created using the following structure:;
-#X obj 418 312 osc~ 800;
-#X obj 386 15 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 386 596 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 418 369 *~;
-#X floatatom 431 352 1 0 0;
-#X obj 400 447 env~;
-#X floatatom 400 468 5 0 0;
-#X msg 628 341 \; pd dsp \$1 \;;
-#X obj 628 322 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-1;
-#X obj 445 466 dac~;
-#X obj 445 446 *~ 0.05;
-#X text 645 323 Turn on audio computation first.;
-#X text 449 357 Here is the [spigot].;
-#X text 448 370 When "0" \, audio signal;
-#X text 447 386 is effectively blocked.;
-#X text 448 400 When "1" \, audio signal is;
-#X text 448 415 not effected in any way.;
-#X text 406 498 RELATED OBJECTS;
-#N canvas 0 0 454 304 related_objects_from_other_libraries 0;
-#X obj 40 36 gate;
-#X text 18 86 These objects are offered in PD only if you have downloaded
-and properly installed the appropriate library. These objects may or
-may not exist in a single library.;
-#X text 17 135 The best places to find information about PD's libraries
-is:;
-#X text 14 157 www.puredata.org and click on "Downloads" then "Software"
-;
-#X text 15 173 or;
-#X text 16 187 iem.kug.ac.at/pdb/;
-#X restore 419 519 pd related_objects_from_other_libraries;
-#X text 453 574 This document was updated for PD version 0.35 test
-26 by Dave Sabine as part of a project called pddp proposed by Krzysztof
-Czaja to build comprehensive documentation for PD.;
-#X obj 416 170 spigot cat;
-#X obj 490 170 spigot dog;
-#X text 415 119 It also accepts any symbol \, but all of these are
-meaningless and have no effect on the operation of the object.;
-#X text 416 54 [spigot] only accepts one numerical creation argument:
-a zero. At creation time the [spigot] is "closed". So this creation
-argument is not needed and is rather useless.;
-#X connect 0 0 2 0;
-#X connect 1 0 2 1;
-#X connect 2 0 3 0;
-#X connect 4 0 2 0;
-#X connect 5 0 2 0;
-#X connect 11 0 15 0;
-#X connect 12 0 20 0;
-#X connect 12 0 25 1;
-#X connect 16 0 17 0;
-#X connect 17 0 18 0;
-#X connect 18 0 19 0;
-#X connect 18 0 11 0;
-#X connect 18 0 25 0;
-#X connect 19 0 18 1;
-#X connect 20 0 11 1;
-#X connect 22 0 12 0;
-#X connect 25 0 14 0;
-#X connect 32 0 35 0;
-#X connect 33 0 34 0;
-#X connect 35 0 37 0;
-#X connect 35 0 42 0;
-#X connect 36 0 35 1;
-#X connect 37 0 38 0;
-#X connect 40 0 39 0;
-#X connect 42 0 41 0;
+#N canvas 94 22 874 659 10; +#X msg 8 96 0.5 1000; +#X floatatom 38 160 1 0 0 0 - - -; +#X obj 8 177 spigot; +#X obj 7 198 print; +#X msg 20 136 walk the cat; +#X msg 13 116 bang; +#X obj 27 11 spigot; +#X text 75 11 - pass or block messages; +#X text 51 160 control: nonzero to pass messages \, zero to stop them +; +#X text 4 294 USING [SPIGOT] TO CREATE A GATE.; +#X text 14 312 Unlike its closest cousin MAX \, PD does not have a +native [gate] object. There are other PD libraries which include gates +for both audio and numerical data \, but similar routines can be built +in PD using [spigot]. The example below shows a two-way gate using +two [spigots] and the [expr] object.; +#X obj 87 505 spigot; +#X floatatom 88 459 1 0 0 0 - - -; +#X text 105 458 controls: open and close the gates.; +#X floatatom 23 527 5 0 0 0 - - -; +#X floatatom 87 527 5 0 0 0 - - -; +#X obj 4 400 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +; +#X obj 7 418 metro 200; +#X obj 4 439 f; +#X obj 31 439 + 1; +#X obj 118 484 expr 1-$f1; +#X text 24 398 Click to start sending info through the gates.; +#X obj 88 439 loadbang; +#X text 8 38 [spigot] passes messages from its left inlet to its outlet +\, as long as a nonzero number is sent to its right inlet. When its +right inlet gets zero \, incoming messages are "blocked" (i.e. ignored). +; +#X text 6 231 [spigot] works essentially like a doorway. When the door +is open \, messages can pass through. When the door is closed \, messages +are ignored. By default \, the door is always closed!; +#X obj 23 505 spigot; +#X text 5 547 In the example above \, the magic is created by the [expr] +object which performs a simple calculation using the incoming number +(1 or 0). Note that the figure "$f1" is a variable which assumes the +value of the incoming number.; +#X text 447 17 CREATION ARGUMENTS?; +#X obj 567 98 spigot 0; +#X text 434 216 [SPIGOT] FOR AUDIO SIGNALS?; +#X text 447 233 [spigot] does not work with audio signals. The data +types which are accepted by this object are floats \, symbols \, lists +\, bangs \, anythings and pointers. However \, audio signals require +a completely different treatment.; +#X text 444 285 PD does not have a [spigot] for audio signals \, but +the same effect can be created using the following structure:; +#X obj 458 332 osc~ 800; +#X obj 426 15 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 426 596 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 458 389 *~; +#X floatatom 471 372 1 0 0 0 - - -; +#X obj 440 467 env~; +#X floatatom 440 488 5 0 0 0 - - -; +#X msg 598 342 \; pd dsp \$1 \;; +#X obj 598 323 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 +1; +#X obj 485 486 dac~; +#X obj 485 466 *~ 0.05; +#X text 615 324 Turn on audio computation first.; +#X text 489 377 Here is the [spigot].; +#X text 488 390 When "0" \, audio signal; +#X text 487 406 is effectively blocked.; +#X text 488 420 When "1" \, audio signal is; +#X text 488 435 not effected in any way.; +#X text 446 518 RELATED OBJECTS; +#N canvas 0 22 454 304 related_objects_from_other_libraries 0; +#X obj 40 36 gate; +#X text 18 86 These objects are offered in PD only if you have downloaded +and properly installed the appropriate library. These objects may or +may not exist in a single library.; +#X text 17 135 The best places to find information about PD's libraries +is:; +#X text 14 157 www.puredata.org and click on "Downloads" then "Software" +; +#X text 15 173 or; +#X text 16 187 iem.kug.ac.at/pdb/; +#X restore 459 539 pd related_objects_from_other_libraries; +#X obj 456 188 spigot cat; +#X obj 534 188 spigot dog; +#X text 454 33 [spigot] only accepts one numerical creation argument: +a one or a zero. At creation time the [spigot] is "closed". With a +one \, its defaults to open.; +#X obj 635 98 spigot 1; +#X obj 579 71 bng 15 250 50 0 empty empty empty 0 -6 0 8 -225271 -1 +-1; +#X obj 511 98 spigot; +#X obj 511 116 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 567 117 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 635 117 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X text 451 576 This document was updated for Pd version 0.38-4. It +was edited by Dave Sabine and Hans-Christoph Steiner as part of a project +called pddp proposed by Krzysztof Czaja to build comprehensive documentation +for Pd.; +#X text 455 143 [spigot] used to accept any symbol \, but all of these +are meaningless and have no effect on the operation of the object. +This was removed in Pd 0.38-3; +#X connect 0 0 2 0; +#X connect 1 0 2 1; +#X connect 2 0 3 0; +#X connect 4 0 2 0; +#X connect 5 0 2 0; +#X connect 11 0 15 0; +#X connect 12 0 20 0; +#X connect 12 0 25 1; +#X connect 16 0 17 0; +#X connect 17 0 18 0; +#X connect 18 0 19 0; +#X connect 18 0 11 0; +#X connect 18 0 25 0; +#X connect 19 0 18 1; +#X connect 20 0 11 1; +#X connect 22 0 12 0; +#X connect 25 0 14 0; +#X connect 28 0 58 0; +#X connect 32 0 35 0; +#X connect 33 0 34 0; +#X connect 35 0 37 0; +#X connect 35 0 42 0; +#X connect 36 0 35 1; +#X connect 37 0 38 0; +#X connect 40 0 39 0; +#X connect 42 0 41 0; +#X connect 54 0 59 0; +#X connect 55 0 28 0; +#X connect 55 0 56 0; +#X connect 55 0 54 0; +#X connect 56 0 57 0; |