#N canvas 517 136 1312 991 12;
#X obj 25 -41 cnv 15 400 40 empty empty Clip-(Ifthen-Elseif): 20 12
0 24 -262144 -66577 0;
#X floatatom 847 743 5 -20 20 0 - - -;
#X obj 847 769 moses 0;
#X floatatom 812 869 5 0 0 0 - - -;
#X obj 812 816 moses -10;
#X floatatom 872 869 5 0 0 0 - - -;
#X obj 249 318 moses 10;
#X floatatom 203 240 5 -20 20 0 - - -;
#X obj 203 266 moses 0;
#X floatatom 249 346 5 0 0 0 - - -;
#X floatatom 302 346 5 0 0 0 - - -;
#X text 160 294 then;
#X text 260 293 elseif;
#X text 207 345 then;
#X floatatom 203 294 5 0 0 0 - - -;
#X text 175 242 if;
#X obj 167 759 min 50;
#X obj 167 733 max -50;
#X floatatom 167 699 5 0 0 0 - - -;
#X floatatom 167 798 5 0 0 0 - - -;
#X floatatom 279 698 5 0 0 0 - - -;
#X floatatom 279 798 5 0 0 0 - - -;
#X obj 279 732 expr if($f1 > 50 \, 50 \, $f1);
#X obj 279 760 expr if($f1 < -50 \, -50 \, $f1);
#X text 242 746 =;
#X floatatom 166 438 5 -80 80 0 - - -;
#X obj 166 462 moses -50;
#X msg 166 488 -50;
#X floatatom 226 549 5 0 0 0 - - -;
#X msg 279 520 50;
#X obj 226 488 moses 50;
#X floatatom 740 42 5 0 0 0 - - -;
#X floatatom 740 111 5 0 0 0 - - -;
#X floatatom 810 27 5 0 0 0 - - -;
#X floatatom 814 52 5 0 0 0 - - -;
#X floatatom 488 283 5 0 0 0 - - -;
#X floatatom 488 377 5 0 0 0 - - -;
#X text 754 327 =;
#X floatatom 783 297 5 0 0 0 - - -;
#X floatatom 783 355 5 0 0 0 - - -;
#X obj 1076 500 min 50;
#X obj 1076 474 max -50;
#X floatatom 1076 447 5 0 0 0 - - -;
#X floatatom 1076 529 5 0 0 0 - - -;
#X floatatom 817 457 5 0 0 0 - - -;
#X floatatom 817 517 5 0 0 0 - - -;
#X text 1049 485 =;
#X msg 976 241 -50;
#X msg 1060 240 50;
#X obj 1015 199 loadbang;
#X floatatom 957 711 5 0 0 0 - - -;
#X floatatom 957 778 5 0 0 0 - - -;
#X obj 957 741 expr if($f1 > 0 \, if($f1 > 10 \, 100 \, $f1) \, -1)
;
#X text 343 346 else;
#X text 23 168 We can have nother "if" when not true \, that is "Elseif".
;
#X text 67 195 With [moses] \, it'd be something like this:;
#X text 49 396 But you don't need to think of it in this order \, for
example:;
#X text 208 437 X;
#X text 58 588 We can here say \; "if X < -50 \, then X = -50 \, elseif
X > 50 \, then X = 50 \, else X = X";
#X text 55 655 Now \, what we do below is just like above:;
#X text 66 843 And the procedure is that we force a number to be in
a specified range (from -50 to 50 here);
#X obj 1060 268 v Top;
#X obj 976 269 v Bottom;
#X obj 740 77 clip -50 50;
#X text 531 175 You can have more "if" functions when true and when
flase indefinitely:;
#X obj 488 315 expr if($f1 < Bottom \, Bottom \, $f1);
#X obj 488 339 expr if($f1 > Top \, Top \, $f1);
#X obj 783 326 expr if($f1 > Top \, Top \, if($f1 < Bottom \, Bottom
\, $f1));
#X text 521 419 We can also have conditionals inside conditionals in
[expr]. This is also a form of "Elseif":;
#X obj 817 487 expr max(Bottom \, min($f1 \, Top));
#X text 798 793 if;
#X text 756 835 then if;
#X text 839 835 else;
#X floatatom 225 59 5 -20 20 0 - - -;
#X obj 225 85 moses 0;
#X text 185 113 then;
#X floatatom 225 113 5 0 0 0 - - -;
#X text 198 59 if;
#X floatatom 271 113 5 0 0 0 - - -;
#X text 312 113 else;
#X text 44 15 If... then... \, else... -> For the "If" condition \,
when it's true \, we specify what to do "then". If not true \, we specify
what "else" to do:;
#X text 856 26 Argument 1 (Bottom);
#X text 856 50 Argument 2 (Top);
#X text 471 180 [expr]:;
#X text 770 671 There's also the "if -> then if" \, this would be to
have a second "if" when true:;
#X floatatom 912 867 5 0 0 0 - - -;
#X text 903 795 else;
#X text 954 826 <==== in [moses];
#X floatatom 613 793 5 0 0 0 - - -;
#X floatatom 574 518 5 0 0 0 - - -;
#X obj 574 619 sel 0 1;
#X obj 656 745 f;
#X obj 613 711 sel 0 1;
#X obj 613 651 f;
#X obj 574 554 trigger float f;
#X msg 613 745 50;
#X msg 574 746 -50;
#X obj 574 588 >= -50;
#X obj 613 683 <= 50;
#X text 462 76 [clip] forces a number within a range:;
#X text 707 580 <==== Here's how to do it only \; with [select] + comparatives
;
#X floatatom 1014 241 5 0 0 0 - - -;
#X floatatom 1101 238 5 0 0 0 - - -;
#X text 564 237 Here's how to programm [clip] with only one [expr]
and "elseif". You need to define Bottom and Top range =====>;
#X connect 1 0 2 0;
#X connect 2 0 4 0;
#X connect 2 1 85 0;
#X connect 4 0 3 0;
#X connect 4 1 5 0;
#X connect 6 0 9 0;
#X connect 6 1 10 0;
#X connect 7 0 8 0;
#X connect 8 0 14 0;
#X connect 8 1 6 0;
#X connect 16 0 19 0;
#X connect 17 0 16 0;
#X connect 18 0 17 0;
#X connect 20 0 22 0;
#X connect 22 0 23 0;
#X connect 23 0 21 0;
#X connect 25 0 26 0;
#X connect 26 0 27 0;
#X connect 26 1 30 0;
#X connect 27 0 28 0;
#X connect 29 0 28 0;
#X connect 30 0 28 0;
#X connect 30 1 29 0;
#X connect 31 0 63 0;
#X connect 33 0 63 1;
#X connect 34 0 63 2;
#X connect 35 0 65 0;
#X connect 38 0 67 0;
#X connect 40 0 43 0;
#X connect 41 0 40 0;
#X connect 42 0 41 0;
#X connect 44 0 69 0;
#X connect 47 0 62 0;
#X connect 48 0 61 0;
#X connect 49 0 47 0;
#X connect 49 0 48 0;
#X connect 50 0 52 0;
#X connect 52 0 51 0;
#X connect 63 0 32 0;
#X connect 65 0 66 0;
#X connect 66 0 36 0;
#X connect 67 0 39 0;
#X connect 69 0 45 0;
#X connect 73 0 74 0;
#X connect 74 0 76 0;
#X connect 74 1 78 0;
#X connect 89 0 94 0;
#X connect 90 0 96 0;
#X connect 90 1 93 0;
#X connect 91 0 88 0;
#X connect 92 0 95 0;
#X connect 92 1 91 0;
#X connect 93 0 98 0;
#X connect 94 0 97 0;
#X connect 94 1 91 1;
#X connect 94 1 93 1;
#X connect 95 0 88 0;
#X connect 96 0 88 0;
#X connect 97 0 90 0;
#X connect 98 0 92 0;
#X connect 101 0 62 0;
#X connect 102 0 61 0;
