aboutsummaryrefslogtreecommitdiff
path: root/doc/pddp/all_about_expr_if.pd
diff options
context:
space:
mode:
authorJonathan Wilkes <jancsika1@users.sourceforge.net>2010-08-25 00:12:22 +0000
committerJonathan Wilkes <jancsika1@users.sourceforge.net>2010-08-25 00:12:22 +0000
commit2f615ffbf13571a928856b8207d1ea215e857e3f (patch)
treefba96137a8474e9dce1555095a52990d5cece732 /doc/pddp/all_about_expr_if.pd
parentb98e2bc00355aae29d3e67ca41eda8cedfe0100d (diff)
Revised and added to all_about help patches
svn path=/trunk/; revision=13941
Diffstat (limited to 'doc/pddp/all_about_expr_if.pd')
-rw-r--r--doc/pddp/all_about_expr_if.pd64
1 files changed, 64 insertions, 0 deletions
diff --git a/doc/pddp/all_about_expr_if.pd b/doc/pddp/all_about_expr_if.pd
new file mode 100644
index 00000000..b1cd36c6
--- /dev/null
+++ b/doc/pddp/all_about_expr_if.pd
@@ -0,0 +1,64 @@
+#N canvas 0 0 448 500 10;
+#X obj 1 1 cnv 15 445 20 empty \$0-pddp.cnv.header expr_if 20 10 1
+18 -261106 -33289 0;
+#X obj 407 2 pddp/pddplink http://puredata.info/dev/pddp -text pddp
+;
+#X floatatom 23 315 5 0 0 0 - - -;
+#X floatatom 23 266 5 0 0 0 - - -;
+#X obj 374 374 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
+10;
+#X floatatom 23 441 5 0 0 0 - - -;
+#X floatatom 23 376 5 0 0 0 - - -;
+#X obj 83 441 print;
+#X floatatom 374 353 5 0 0 0 - - -;
+#X obj 23 400 expr if($f2 != 0 \, if($f1 % 13 != 0 \, random($f1 -
+$f2 * 0.5 \, $f1 + $f2 * 0.5) \, $f1) \, $f1 % 60);
+#X text 20 93 b) an expression to evaluate if the condition is true
+\, and;
+#X text 20 78 a) the condition \,;
+#X text 20 37 The [expr] \, [expr~] \, and [fexpr~] objects allow you
+to build a conditional statement using the "expr if" syntax. It is
+made up of three parts \, enclosed in parentheses:;
+#X text 20 126 Each part is separated by a comma.;
+#X text 20 108 c) an expression to evaluate if the condition is false.
+;
+#X text 20 239 c) if the condition is false \, the number 20 is output.
+;
+#X text 20 340 You can nest other functions within the if function
+\, including the if function itself.;
+#X text 20 157 By scrolling the number box below you can see the [expr
+if] function in action. When a number is received at the inlet:;
+#X text 20 189 a) the condition "$f1 < 20" checks if the input is less
+than twenty.;
+#X text 20 219 b) if true \, the value is subtracted from twenty and
+output.;
+#X obj 1 478 cnv 15 445 20 empty \$0-pddp.cnv.footer empty 20 12 0
+14 -233017 -33289 0;
+#N canvas 44 246 494 344 META 0;
+#X text 12 85 LIBRARY PDDP;
+#X text 12 45 KEYWORDS;
+#X text 12 5 GENRE all_about_pd;
+#X text 12 25 NAME expr expr~ fexpr~;
+#X text 12 105 HELP_PATCH_AUTHORS Dave Sabine \, May 5 \, 2003 . Jonathan
+Wilkes revised the patch to conform to the PDDP template for Pd version
+0.42.;
+#X text 12 65 DESCRIPTION an explanation of the "if" function from
+sly and the expr family stone;
+#X restore 392 480 pd META;
+#N canvas 9 355 428 136 Related_objects 0;
+#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
+14 -261106 -33289 0;
+#X text 7 2 [expr] if- Related Objects;
+#X obj 22 42 moses;
+#X obj 72 42 select;
+#X obj 132 42 spigot;
+#X restore 103 480 pd Related_objects;
+#X obj 6 480 pddp/pddplink pddp/help.pd -text help;
+#X obj 23 290 expr if($f1 < 50 \, 50-$f1 \, 50);
+#X connect 3 0 24 0;
+#X connect 4 0 9 1;
+#X connect 6 0 9 0;
+#X connect 8 0 4 0;
+#X connect 9 0 5 0;
+#X connect 9 0 7 0;
+#X connect 24 0 2 0;