diff options
Diffstat (limited to 'doc/tutorials/intro/37.math.pd')
-rw-r--r-- | doc/tutorials/intro/37.math.pd | 258 |
1 files changed, 258 insertions, 0 deletions
diff --git a/doc/tutorials/intro/37.math.pd b/doc/tutorials/intro/37.math.pd new file mode 100644 index 00000000..6ccae57e --- /dev/null +++ b/doc/tutorials/intro/37.math.pd @@ -0,0 +1,258 @@ +#N canvas 10 40 620 460 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 54 189 +; +#X floatatom 54 118 0 0 0 0 - - -; +#X floatatom 54 210 0 0 0 0 - - -; +#X floatatom 67 141 0 0 0 0 - - -; +#X msg 85 167 bang; +#X text 120 168 Bang outputs sum; +#X text 92 117 Numbers in left inlet add and output sum; +#X text 109 140 Numbers in right inlet only change the inlet's value +; +#X text 29 74 The example below performs basic addition with two numbers: +i.e. a + b = c; +#X text 34 263 The example below incorporates a creation argument: +i.e. a + 42 = b; +#X floatatom 34 295 0 0 0 0 - - -; +#X floatatom 34 338 0 0 0 0 - - -; +#X obj 34 317 + 42; +#N canvas 10 40 620 460 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 33 521 pd basic_examples; +#X text 32 422 However \, [pow] \, [max] \, and [min] objects may need +some explanation.; +#N canvas 10 40 620 460 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 33 456 pd understanding_POW; +#N canvas 10 40 620 460 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 33 488 pd understanding_MAX_and_MIN; +#X text 469 20 THE SUM OF MANY NUMBERS; +#X msg 600 98 bang; +#X obj 600 150 random 10; +#X obj 662 150 random 10; +#X obj 724 150 random 10; +#X text 628 169 a; +#X text 690 170 b; +#X text 751 169 c; +#X text 631 235 d; +#X floatatom 600 235 0 0 0 0 - - -; +#X obj 600 119 t b b b; +#X obj 600 192 +; +#X obj 600 213 +; +#X floatatom 600 170 0 0 0 0 - - -; +#X floatatom 662 170 0 0 0 0 - - -; +#X floatatom 724 170 0 0 0 0 - - -; +#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 10 40 620 460 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 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 21 0 23 0; +#X connect 23 0 22 0; +#X connect 29 0 38 0; +#X connect 30 0 41 0; +#X connect 31 0 42 0; +#X connect 32 0 43 0; +#X connect 38 0 30 0; +#X connect 38 1 31 0; +#X connect 38 2 32 0; +#X connect 39 0 40 0; +#X connect 40 0 37 0; +#X connect 41 0 39 0; +#X connect 42 0 39 1; +#X connect 43 0 40 1; |