#N canvas 340 98 1032 557 12;
#X obj 207 48 expr;
#X obj 258 48 expr~;
#X obj 317 48 fexpr~;
#X text 853 519 updated for Pd 0.48;
#X floatatom 786 121 5 0 0 0 - - -, f 5;
#X floatatom 786 209 5 0 0 0 - - -, f 5;
#X floatatom 836 209 5 0 0 0 - - -, f 5;
#X text 25 80 Online documentation: http://yadegari.org/expr/expr.html
, f 62;
#X text 49 459 - $x#[n]: an input audio sample from inlet # indexed
by 'n';
#X text 49 478 - $y#[n]: an output audio sample from outlet # indexed
by 'n', f 61;
#X text 65 505 where 'n' for $x# has to satisfy: 0 => n >= -vector
size;
#X text 64 524 and 'n' for $y# has to satisfy: -1 => n >= -vector size
;
#X text 25 115 - [expr]: used for evaluation of control data expressions
, f 62;
#X text 49 401 - $v#: an audio signal vector/block, f 59;
#X text 49 299 - $i#: an integer, f 59;
#X text 49 318 - $f#: a float, f 59;
#X text 49 337 - $s#: a symbol (used to define arrays), f 59;
#X obj 786 147 expr $f1 + 1 \; $f1 - 1 \; $f1 * 2;
#X floatatom 887 209 5 0 0 0 - - -, f 5;
#X text 389 50 Version 0.55;
#N canvas 452 26 864 538 Arrays 0;
#N canvas 0 50 450 300 (subpatch) 0;
#X array array1 10 float 0;
#X coords 0 10 9 0 220 130 1 0 0;
#X restore 599 144 graph;
#X floatatom 239 344 0 0 9 0 - - -;
#X floatatom 239 401 0 0 0 0 - - -;
#X obj 239 373 expr $s2[$f1];
#X msg 340 345 symbol array1;
#X obj 594 40 loadbang;
#X floatatom 139 136 5 0 9 0 - - -, f 5;
#X floatatom 139 212 5 0 0 0 - - -, f 5;
#X obj 139 173 expr array1[$f1];
#X msg 594 72 \; array1 0 1 4 2 8 5 6 1 4 2 8;
#X text 32 88 For instance:;
#X obj 340 316 loadbang;
#X text 34 266 A symbol inlet - defined as $s# (# being the inlet number)
- is used to receive array names.;
#X text 154 475 The '=' syntax allows you to set values to an array
index:;
#X floatatom 643 443 0 0 100 0 - - -;
#X obj 643 324 vsl 20 100 0 10 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 0 1;
#X obj 643 474 expr array1[1] = $f1;
#X text 29 24 The expr family of objects can read values from array
(without interpolation) and also write to them. The syntax is arrayname[index].
;
#X text 291 164 input is the index to read from the array, f 21;
#X connect 1 0 3 0;
#X connect 3 0 2 0;
#X connect 4 0 3 1;
#X connect 5 0 9 0;
#X connect 6 0 8 0;
#X connect 8 0 7 0;
#X connect 11 0 4 0;
#X connect 14 0 16 0;
#X connect 15 0 14 0;
#X restore 840 354 pd Arrays;
#X text 593 184 Basic examples:;
#X text 785 324 Further details:;
#N canvas 298 28 1045 460 Value 0;
#X floatatom 655 249 5 0 0 0 - - -, f 5;
#X obj 655 175 until;
#X msg 796 176 0;
#X obj 796 212 v i;
#X obj 655 213 expr i = i + 1;
#X msg 655 105 10;
#X obj 655 279 print;
#X obj 281 68 loadbang;
#X obj 241 181 value a;
#X obj 281 154 value b;
#X obj 324 128 value c;
#X text 102 112 loading values into [value] objects =====>, f 14;
#X obj 178 298 expr (a + b) / c;
#X obj 178 271 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X floatatom 178 332 0 0 0 0 - - -;
#X msg 241 102 5.2;
#X msg 281 102 3.3;
#X msg 324 102 2.1;
#X text 527 34 It is also possible to assign values to variables inside
the expr family of objects with the "=" syntax.;
#X obj 655 136 trigger float bang;
#X text 28 20 The expr family of objects can access variables set into
[value] objects.;
#X obj 787 357 expr i * 2 \; i = i + 1;
#X floatatom 787 403 5 0 0 0 - - -, f 5;
#X floatatom 872 404 5 0 0 0 - - -, f 5;
#X obj 787 332 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X text 280 356 Since expressions are output from right to left order
\, they are evaluated from bottom to top. This means you can update
a variable and call it in the above expression \, check it ==>;
#X text 30 232 All you have to do is just use the variable name into
the expression:;
#X connect 0 0 6 0;
#X connect 1 0 4 0;
#X connect 2 0 3 0;
#X connect 4 0 0 0;
#X connect 5 0 19 0;
#X connect 7 0 16 0;
#X connect 7 0 17 0;
#X connect 7 0 15 0;
#X connect 12 0 14 0;
#X connect 13 0 12 0;
#X connect 15 0 8 0;
#X connect 16 0 9 0;
#X connect 17 0 10 0;
#X connect 19 0 1 0;
#X connect 19 1 2 0;
#X connect 21 0 22 0;
#X connect 21 1 23 0;
#X connect 24 0 21 0;
#X restore 840 380 pd Value;
#N canvas 212 108 1069 507 Dealing_with_"\$0" 0;
#X obj 684 139 expr $s2[$f1];
#X obj 785 108 symbol \$0-x;
#X floatatom 684 113 5 0 99 0 - - -, f 5;
#X floatatom 684 167 5 0 0 0 - - -, f 5;
#X obj 785 85 loadbang;
#N canvas 0 50 450 300 (subpatch) 0;
#X array \$0-x 100 float 1;
#A 0 -0.720016 -0.706683 -0.693349 -0.680016 -0.666682 -0.653348 -0.640015
-0.625014 -0.610014 -0.595014 -0.580013 -0.565013 -0.550013 -0.535012
-0.520012 -0.505012 -0.490011 -0.475011 -0.460011 -0.44501 -0.43001
-0.415009 -0.400009 -0.385009 -0.370008 -0.355008 -0.340008 -0.325007
-0.310007 -0.295007 -0.280006 -0.264006 -0.248006 -0.232005 -0.216005
-0.200005 -0.184004 -0.168004 -0.152003 -0.136003 -0.120003 -0.106669
-0.0933355 -0.0800018 -0.0666682 -0.0533346 -0.0400009 -0.0266673 -0.0133336
-3.10441e-10 0.0133336 0.0266673 0.0400009 0.0533346 0.0666682 0.0800018
0.0933355 0.106669 0.120003 0.133336 0.14667 0.160004 0.173337 0.186671
0.200005 0.213338 0.226672 0.240005 0.253339 0.266673 0.280006 0.29715
0.314293 0.331436 0.348579 0.365723 0.382866 0.400009 0.413343 0.426676
0.44001 0.453344 0.466677 0.480011 0.500011 0.520012 0.540012 0.560013
0.570013 0.580013 0.590014 0.600014 0.620014 0.640015 0.660015 0.680016
0.680016 0.720016 0.720016 0.720016;
#X coords 0 1 99 -1 200 150 1 0 0;
#X restore 224 215 graph;
#X text 22 138 Also \, the '-' character is used as the subtraction
operator \, so '\$0-x' is interpreted as "Id number" minus 'x'.;
#X obj 82 405 expr \$0-x[$f1];
#X floatatom 82 371 5 0 99 0 - - -, f 5;
#X floatatom 82 441 5 0 0 0 - - -, f 5;
#X obj 848 409 value x\$0;
#X obj 890 377 value y_\$0;
#X obj 671 357 expr x\$0 \; y_\$0;
#X msg 848 379 1.3;
#X msg 890 347 4.7;
#X obj 848 307 loadbang;
#X obj 671 326 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X floatatom 740 406 5 0 0 0 - - -, f 5;
#X floatatom 671 406 5 0 0 0 - - -, f 5;
#X text 560 38 A solution for such issues is to send the table name
as a symbol:;
#X text 572 232 But a simpler practice is to just avoid these issues
by having '\$0' after a symbol character \, such as:;
#X text 21 26 '\$0' - the patch ID number used to force locality in
Pd - may be used in the definition of arrays or variables names. But
it is important to note the restrictions of adopting the C-style expression
syntax \, where variables cannot start with a number \, so '\$0x' is
an illegal character as Pd sees it as starting with a number. in this
case \, the object won't load!;
#X text 212 401 It loads \, but the symbol is interpreted as "\$0 -
x" \, so it is not a valid symbol character and not a table name -
see Pd window for error., f 40;
#X text 751 167 <= works now;
#X connect 0 0 3 0;
#X connect 1 0 0 1;
#X connect 2 0 0 0;
#X connect 4 0 1 0;
#X connect 7 0 9 0;
#X connect 8 0 7 0;
#X connect 12 0 18 0;
#X connect 12 1 17 0;
#X connect 13 0 10 0;
#X connect 14 0 11 0;
#X connect 15 0 13 0;
#X connect 15 0 14 0;
#X connect 16 0 12 0;
#X restore 840 408 pd Dealing_with_"\$0";
#X text 25 18 Expression evaluation family of objects:, f 62;
#X text 25 50 By Shahrokh Yadegari;
#X text 25 199 - [fexpr~]: used for evaluation of signal expressions
on sample level data (i.e. \, filter design) - very cpu intensive!
, f 62;
#X text 25 246 Input variables types for [expr] \, [expr~] and [fexpr~]
are: integers \, floats and symbols \, specified as follows where the
'#' stands for the inlet number:, f 62;
#X text 25 364 The [expr~] object has an exclusive input variable type
for signal vectors \, defined as:, f 62;
#X text 25 430 The [fexpr~] object has exclusive variable types \,
defined as:, f 62;
#X text 25 142 - [expr~]: used for evaluation of audio signal expression
- on a vector by vector basis (vector/block size is defined by the
[block~] or [switch~] objects)., f 62;
#X text 537 16 These objects have several built in operators and functions.
The syntax is quite similar to how expressions are written in C. A
semicolon can be used to define and separate different expressions.
If so \, an outlet is created for each expression and they're evaluated
from right to left (or bottom to up) order:;
#X text 573 410 see also:;
#X obj 615 512 block~;
#X obj 678 512 value;
#N canvas 708 54 478 476 All_functions 0;
#N canvas 497 97 374 326 Arithmetic-operators 0;
#X obj 57 90 expr $f1 + 4;
#X floatatom 57 63 5 0 0 0 - - -, f 5;
#X floatatom 57 118 5 0 0 0 - - -, f 5;
#X floatatom 208 63 5 0 0 0 - - -, f 5;
#X floatatom 208 118 5 0 0 0 - - -, f 5;
#X obj 208 90 expr $f1 * 4;
#X floatatom 57 197 5 0 0 0 - - -, f 5;
#X floatatom 57 252 5 0 0 0 - - -, f 5;
#X floatatom 208 197 5 0 0 0 - - -, f 5;
#X floatatom 208 252 5 0 0 0 - - -, f 5;
#X obj 57 224 expr $f1 - 1;
#X obj 208 224 expr $f1 / 10;
#X text 57 34 Add;
#X text 206 34 Multiply;
#X text 206 174 Divide;
#X text 56 174 Subtract;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 3 0 5 0;
#X connect 5 0 4 0;
#X connect 6 0 10 0;
#X connect 8 0 11 0;
#X connect 10 0 7 0;
#X connect 11 0 9 0;
#X restore 147 131 pd Arithmetic-operators;
#N canvas 513 126 621 391 Bitwise-operators 0;
#X floatatom 47 218 5 0 0 0 - - -, f 5;
#X obj 47 188 expr ~ $f1;
#X floatatom 44 103 5 0 0 0 - - -, f 5;
#X obj 44 73 expr $f1 & 3;
#X floatatom 44 43 5 0 0 0 - - -, f 5;
#X text 104 41 Bitwise And;
#X floatatom 347 98 5 0 0 0 - - -, f 5;
#X floatatom 347 38 5 0 0 0 - - -, f 5;
#X obj 347 68 expr $f1 << 1;
#X floatatom 349 207 5 0 0 0 - - -, f 5;
#X floatatom 349 147 5 0 0 0 - - -, f 5;
#X text 404 147 Bitshift Right;
#X text 413 36 Bitshift Left;
#X obj 349 177 expr $f1 >> 2;
#X floatatom 353 320 5 0 0 0 - - -, f 5;
#X floatatom 353 260 5 0 0 0 - - -, f 5;
#X obj 353 290 expr $f1 ^ 1;
#X text 409 260 Bitwise Exclusive Or;
#X floatatom 52 324 5 0 0 0 - - -, f 5;
#X floatatom 52 264 5 0 0 0 - - -, f 5;
#X text 114 256 Bitwise Or;
#X obj 52 294 expr $f1 | 3;
#X floatatom 47 158 5 0 0 0 - - -, f 5;
#X text 97 155 Bitwise Not;
#X text 141 187 (one's complement);
#X connect 1 0 0 0;
#X connect 3 0 2 0;
#X connect 4 0 3 0;
#X connect 7 0 8 0;
#X connect 8 0 6 0;
#X connect 10 0 13 0;
#X connect 13 0 9 0;
#X connect 15 0 16 0;
#X connect 16 0 14 0;
#X connect 19 0 21 0;
#X connect 21 0 18 0;
#X connect 22 0 1 0;
#X restore 147 162 pd Bitwise-operators;
#N canvas 444 131 689 317 Comparison-operators 0;
#X floatatom 48 55 5 0 0 0 - - -, f 5;
#X floatatom 48 110 5 0 0 0 - - -, f 5;
#X floatatom 199 54 5 0 0 0 - - -, f 5;
#X floatatom 199 109 5 0 0 0 - - -, f 5;
#X floatatom 55 194 5 0 0 0 - - -, f 5;
#X floatatom 55 249 5 0 0 0 - - -, f 5;
#X floatatom 351 58 5 0 0 0 - - -, f 5;
#X floatatom 351 113 5 0 0 0 - - -, f 5;
#X obj 48 82 expr $f1 > 4;
#X obj 199 81 expr $f1 < 4;
#X obj 55 221 expr $f1 >= 1;
#X text 207 26 Less than;
#X text 48 26 Greater than;
#X text 50 148 Greater than;
#X text 57 166 or equal;
#X floatatom 203 195 5 0 0 0 - - -, f 5;
#X floatatom 203 250 5 0 0 0 - - -, f 5;
#X text 206 167 or equal;
#X text 202 149 Less than;
#X obj 203 222 expr $f1 <= 10;
#X text 356 25 Equal;
#X obj 351 85 expr $f1 == 2;
#X floatatom 497 58 5 0 0 0 - - -, f 5;
#X floatatom 497 113 5 0 0 0 - - -, f 5;
#X text 502 25 Not Equal;
#X obj 497 85 expr $f1 != 2;
#X floatatom 360 191 5 0 0 0 - - -, f 5;
#X floatatom 360 246 5 0 0 0 - - -, f 5;
#X text 365 158 Logical And;
#X obj 360 218 expr $f1 && 1;
#X floatatom 498 191 5 0 0 0 - - -, f 5;
#X floatatom 498 246 5 0 0 0 - - -, f 5;
#X text 503 158 Logical Or;
#X obj 498 218 expr $f1 || 0;
#X connect 0 0 8 0;
#X connect 2 0 9 0;
#X connect 4 0 10 0;
#X connect 6 0 21 0;
#X connect 8 0 1 0;
#X connect 9 0 3 0;
#X connect 10 0 5 0;
#X connect 15 0 19 0;
#X connect 19 0 16 0;
#X connect 21 0 7 0;
#X connect 22 0 25 0;
#X connect 25 0 23 0;
#X connect 26 0 29 0;
#X connect 29 0 27 0;
#X connect 30 0 33 0;
#X connect 33 0 31 0;
#X restore 147 193 pd Comparison-operators;
#N canvas 458 88 472 464 If-function 0;
#X floatatom 82 53 5 0 0 0 - - -, f 5;
#X floatatom 82 112 5 0 0 0 - - -, f 5;
#X floatatom 87 218 5 0 0 0 - - -, f 5;
#X floatatom 87 277 5 0 0 0 - - -, f 5;
#X text 142 213 if(condition \, true \, false);
#X obj 87 246 expr if($f1 > 0 \, $f1 * 10 \, $f1 - 1);
#X floatatom 59 346 5 0 0 0 - - -, f 5;
#X floatatom 59 405 5 0 0 0 - - -, f 5;
#X obj 59 374 expr if($f1 > 10 \, 10 \, if($f1 < -10 \, -10 \, $f1))
;
#X text 118 404 <= clips at -10 and 10;
#X obj 82 81 expr if($f1 >= 0 \, 1 \, -1);
#X text 53 21 Syntax: if(condition \, true \, false);
#X text 143 325 You can also nest an if function as a true/false expression:
, f 32;
#X text 39 163 It accepts expressions as true/false as well:;
#X connect 0 0 10 0;
#X connect 2 0 5 0;
#X connect 5 0 3 0;
#X connect 6 0 8 0;
#X connect 8 0 7 0;
#X connect 10 0 1 0;
#X restore 148 226 pd If-function;
#N canvas 444 91 491 376 Random-function 0;
#X floatatom 107 206 5 0 0 0 - - -, f 5;
#X obj 107 175 expr random(10 \, 20);
#X obj 107 147 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X text 133 142 random values from 10 to 19;
#X floatatom 108 306 5 0 0 0 - - -, f 5;
#X obj 108 247 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 108 275 expr random(-100 \, 101);
#X text 134 242 random values from -100 to 100;
#X text 36 32 The random function generates random numbers within a
given range \, specified by the two arguments. The range is from the
first argument to the second argument minus one., f 51;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 5 0 6 0;
#X connect 6 0 4 0;
#X restore 148 257 pd Random-function;
#N canvas 437 97 594 434 Table-functions 0;
#X obj 63 73 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X floatatom 63 163 0 0 0 0 - - -;
#X floatatom 157 164 0 0 0 0 - - -;
#X floatatom 252 164 0 0 0 0 - - -;
#X text 28 101 Sum;
#X text 28 119 sum;
#X text 20 136 size;
#N canvas 0 50 450 300 (subpatch) 0;
#X array table 100 float 1;
#A 0 -0.714272 -0.678559 -0.642845 -0.607131 -0.571417 -0.52856 -0.485703
-0.428561 -0.371419 -0.314277 -0.257134 -0.228563 -0.114279 -0.0857077
-0.0571365 -0.0285654 5.72205e-06 0.0285769 0.0428624 0.057148 0.0857191
0.11429 0.142861 0.171432 0.171432 0.200004 0.200004 0.200004 0.228575
0.228575 0.228575 0.228575 0.228575 0.228575 0.228575 0.200004 0.0857191
5.72205e-06 -0.228563 -0.885699 -0.885699 -0.885699 -0.885699 -0.857128
-0.842843 -0.828557 -0.771415 -0.73332 -0.695225 -0.65713 -0.599988
-0.542846 -0.485703 -0.419038 -0.352372 -0.257134 -0.171421 -0.114279
5.72205e-06 0.0285769 0.142861 0.200004 0.228575 0.271431 0.314288
0.342859 0.400002 0.428573 0.485715 0.485715 0.514286 0.514286 0.514286
0.514286 0.514286 0.485715 0.457144 0.428573 0.428573 0.400002 0.342859
0.328574 0.314288 0.285717 0.285717 0.257146 0.257146 0.257146 0.257146
0.257146 0.257146 0.257146 0.285717 0.314288 0.342859 0.342859 0.342859
0.342859 0.342859 0.342859;
#X coords 0 1 99 -1 200 140 1 0 0;
#X restore 344 94 graph;
#X text 96 276 Note that the syntax requires that the table name is
inside quotes., f 51;
#X obj 295 347 expr size("$s1") \;;
#X obj 63 102 expr Sum("table" \, 3 \, 9) \; sum("table") \; size("table")
;
#X msg 295 317 symbol table;
#X floatatom 295 380 5 0 0 0 - - -, f 5;
#X text 64 187 Sums a range of indexes, f 8;
#X text 158 189 Sums all indexes, f 8;
#X text 249 189 Givesarray size, f 5;
#X text 114 26 There are 3 functions that operate on arrays: Sum \,
sum and size., f 45;
#X connect 0 0 10 0;
#X connect 9 0 12 0;
#X connect 10 0 1 0;
#X connect 10 1 2 0;
#X connect 10 2 3 0;
#X connect 11 0 9 0;
#X restore 147 326 pd Table-functions;
#N canvas 576 55 618 571 Power-functions 0;
#X floatatom 74 60 5 0 0 0 - - -, f 5;
#X floatatom 74 119 5 0 0 0 - - -, f 5;
#X floatatom 74 151 5 0 0 0 - - -, f 5;
#X floatatom 74 208 5 0 0 0 - - -, f 5;
#X floatatom 71 337 5 0 0 0 - - -, f 5;
#X floatatom 71 409 0 0 0 0 - - -;
#X floatatom 338 103 5 0 0 0 - - -, f 5;
#X floatatom 439 101 5 0 0 0 - - -, f 5;
#X floatatom 338 31 5 0 0 0 - - -, f 5;
#X floatatom 340 414 5 0 0 0 - - -, f 5;
#X floatatom 340 484 0 0 0 0 - - -;
#X floatatom 74 513 5 0 0 0 - - -, f 5;
#X obj 74 88 expr pow($f1 \, 2);
#X text 42 88 pow;
#X text 33 178 sqrt;
#X text 41 364 exp;
#X floatatom 338 276 5 0 0 0 - - -, f 5;
#X floatatom 338 224 5 0 0 0 - - -, f 5;
#X obj 338 56 expr ln($f1) \; log($f1);
#X obj 74 484 expr fact($f1);
#X msg 74 451 3;
#X floatatom 449 482 0 0 0 0 - - -;
#X text 304 442 erf;
#X text 296 458 erfc;
#X floatatom 180 408 0 0 0 0 - - -;
#X floatatom 339 187 5 0 0 0 - - -, f 5;
#X floatatom 339 135 5 0 0 0 - - -, f 5;
#X obj 339 160 expr log1p($f1);
#X obj 338 249 expr log10($f1);
#X floatatom 341 375 5 0 0 0 - - -, f 5;
#X floatatom 341 323 5 0 0 0 - - -, f 5;
#X obj 341 348 expr ldexp($f1 \, 3);
#X text 310 57 ln;
#X text 302 70 log;
#X text 284 250 log10;
#X text 287 159 log1p;
#X text 290 348 ldexp;
#X text 36 482 fact;
#X obj 71 365 expr exp($f1) \; expm1($f1);
#X text 24 382 expm1;
#X floatatom 73 239 5 0 0 0 - - -, f 5;
#X floatatom 73 296 5 0 0 0 - - -, f 5;
#X text 33 268 cbrt;
#X obj 74 179 expr sqrt($f1);
#X obj 73 267 expr cbrt($f1);
#X text 197 382 exp - 1;
#X text 267 507 error function;
#X text 448 505 complementary error function, f 14;
#X obj 340 442 expr erf($f1) \; erfc($f1);
#X text 76 33 Raise to the power of;
#X text 141 148 Square root;
#X text 150 239 Cube root;
#X text 133 324 Exp: 'e' raised to the power of, f 15;
#X text 110 451 Factorial;
#X text 385 29 Natural log;
#X text 397 133 Natural log of input + 1;
#X text 385 221 Log base 10;
#X text 396 307 Multiply by integral power of 2, f 20;
#X text 400 409 Error functions;
#X text 124 54 second argument;
#X connect 0 0 12 0;
#X connect 2 0 43 0;
#X connect 4 0 38 0;
#X connect 8 0 18 0;
#X connect 9 0 48 0;
#X connect 12 0 1 0;
#X connect 17 0 28 0;
#X connect 18 0 6 0;
#X connect 18 1 7 0;
#X connect 19 0 11 0;
#X connect 20 0 19 0;
#X connect 26 0 27 0;
#X connect 27 0 25 0;
#X connect 28 0 16 0;
#X connect 30 0 31 0;
#X connect 31 0 29 0;
#X connect 38 0 5 0;
#X connect 38 1 24 0;
#X connect 40 0 44 0;
#X connect 43 0 3 0;
#X connect 44 0 41 0;
#X connect 48 0 10 0;
#X connect 48 1 21 0;
#X restore 147 359 pd Power-functions;
#N canvas 411 157 793 422 Trigonometric-functions 0;
#X floatatom 73 34 5 0 0 0 - - -, f 5;
#X floatatom 73 93 5 0 0 0 - - -, f 5;
#X floatatom 73 125 5 0 0 0 - - -, f 5;
#X floatatom 73 182 5 0 0 0 - - -, f 5;
#X floatatom 72 213 5 0 0 0 - - -, f 5;
#X floatatom 72 270 5 0 0 0 - - -, f 5;
#X obj 73 62 expr sin($f1);
#X text 38 62 sin;
#X text 35 152 cos;
#X obj 73 153 expr cos($f1);
#X text 35 242 tan;
#X obj 72 241 expr tan($f1);
#X floatatom 273 34 5 0 0 0 - - -, f 5;
#X floatatom 273 93 5 0 0 0 - - -, f 5;
#X floatatom 273 125 5 0 0 0 - - -, f 5;
#X floatatom 273 182 5 0 0 0 - - -, f 5;
#X text 231 62 asin;
#X text 228 152 acos;
#X obj 273 62 expr asin($f1);
#X obj 273 153 expr acos($f1);
#X text 122 32 sine;
#X text 124 125 cosine;
#X text 123 213 tangent;
#X floatatom 274 209 5 0 0 0 - - -, f 5;
#X floatatom 274 266 5 0 0 0 - - -, f 5;
#X obj 274 237 expr tan($f1);
#X text 230 238 atan;
#X text 340 32 arc sine;
#X text 335 125 arc cosine;
#X text 335 209 arc tangent;
#X floatatom 506 33 5 0 0 0 - - -, f 5;
#X floatatom 506 92 5 0 0 0 - - -, f 5;
#X floatatom 506 124 5 0 0 0 - - -, f 5;
#X floatatom 506 181 5 0 0 0 - - -, f 5;
#X floatatom 507 208 5 0 0 0 - - -, f 5;
#X floatatom 507 265 5 0 0 0 - - -, f 5;
#X text 454 61 asinh;
#X text 451 151 acosh;
#X text 453 237 atanh;
#X text 640 46 inverse hyperbolic sine, f 10;
#X obj 506 61 expr asinh($f1);
#X obj 506 152 expr acosh($f1);
#X obj 507 236 expr atanh($f1);
#X text 641 137 inverse hyperbolic cosine, f 10;
#X text 642 225 inverse hyperbolic tangent, f 10;
#X floatatom 223 319 5 0 0 0 - - -, f 5;
#X floatatom 223 376 5 0 0 0 - - -, f 5;
#X text 172 348 atan2;
#X obj 223 347 expr atan2($f1 \, $f2);
#X floatatom 380 319 5 0 0 0 - - -, f 5;
#X text 416 347 arc tangent of 2 variables;
#X connect 0 0 6 0;
#X connect 2 0 9 0;
#X connect 4 0 11 0;
#X connect 6 0 1 0;
#X connect 9 0 3 0;
#X connect 11 0 5 0;
#X connect 12 0 18 0;
#X connect 14 0 19 0;
#X connect 18 0 13 0;
#X connect 19 0 15 0;
#X connect 23 0 25 0;
#X connect 25 0 24 0;
#X connect 30 0 40 0;
#X connect 32 0 41 0;
#X connect 34 0 42 0;
#X connect 40 0 31 0;
#X connect 41 0 33 0;
#X connect 42 0 35 0;
#X connect 45 0 48 0;
#X connect 48 0 46 0;
#X connect 49 0 48 1;
#X restore 147 392 pd Trigonometric-functions;
#N canvas 299 121 1056 535 Other-functions 0;
#X floatatom 93 26 5 0 0 0 - - -, f 5;
#X floatatom 93 99 5 0 0 0 - - -, f 5;
#X text 216 54 convert to int;
#X floatatom 88 147 5 0 0 0 - - -, f 5;
#X floatatom 88 237 5 0 0 0 - - -, f 5;
#X text 58 53 int;
#X text 46 178 rint;
#X text 139 139 round a float to a nearby integer, f 17;
#X text 6 211 nearbyint;
#X text 141 291 convert to float;
#X floatatom 89 367 5 0 0 0 - - -, f 5;
#X floatatom 254 365 5 0 0 0 - - -, f 5;
#X floatatom 89 295 5 0 0 0 - - -, f 5;
#X text 37 325 float;
#X floatatom 438 32 5 0 0 0 - - -, f 5;
#X floatatom 438 108 5 0 0 0 - - -, f 5;
#X floatatom 572 105 5 0 0 0 - - -, f 5;
#X text 403 77 min;
#X text 403 60 max;
#X obj 438 60 expr max($f1 \, 0) \; min($f1 \, 0);
#X text 490 30 maximum / minimum;
#X obj 437 175 expr copysign($f1 \, $f2);
#X floatatom 618 152 5 0 0 0 - - -, f 5;
#X floatatom 437 150 5 0 0 0 - - -, f 5;
#X text 360 176 copysign;
#X floatatom 437 204 5 0 0 0 - - -, f 5;
#X text 483 203 copy sign of a number;
#X obj 89 320 expr float($i1) / 10 \; float(5) / 10 \;;
#X floatatom 762 164 5 0 0 0 - - -, f 5;
#X floatatom 887 163 5 0 0 0 - - -, f 5;
#X obj 762 119 expr isinf($f1) \; finite($f1);
#X text 713 118 isinf;
#X text 705 136 finite;
#X text 907 117 "is infinite" and "is finite", f 15;
#X floatatom 762 87 5 0 0 0 - - -, f 5;
#X msg 802 29 2;
#X obj 762 54 pow 1e+10;
#X msg 762 27 1;
#X floatatom 770 347 5 0 0 0 - - -, f 5;
#X floatatom 770 285 5 0 0 0 - - -, f 5;
#X obj 770 315 expr isnan($f1);
#X text 718 316 isnan;
#X text 912 295 "is Nan" (not a number), f 8;
#X text 389 298 modf;
#X floatatom 430 255 5 0 0 0 - - -, f 5;
#X floatatom 430 324 5 0 0 0 - - -, f 5;
#X text 381 282 imodf;
#X obj 93 54 expr int($f1) \; trunc($f1);
#X floatatom 202 99 5 0 0 0 - - -, f 5;
#X text 48 66 trunc;
#X text 216 69 truncate a float;
#X floatatom 146 237 5 0 0 0 - - -, f 5;
#X text 38 195 round;
#X floatatom 205 237 5 0 0 0 - - -, f 5;
#X obj 88 178 expr rint($f1) \; round($f1) \; nearbyint($f1);
#X text 499 402 float remainder functions, f 15;
#X floatatom 427 426 5 0 0 0 - - -, f 5;
#X floatatom 427 497 5 0 0 0 - - -, f 5;
#X floatatom 584 496 5 0 0 0 - - -, f 5;
#X floatatom 91 421 5 0 0 0 - - -, f 5;
#X floatatom 91 494 5 0 0 0 - - -, f 5;
#X floatatom 208 494 5 0 0 0 - - -, f 5;
#X text 143 419 ceil / floor;
#X text 47 449 ceil;
#X text 39 467 floor;
#X obj 91 449 expr ceil($f1) \; floor($f1);
#X obj 430 281 expr imodf($f1) \; modf($f1);
#X text 414 345 get signed integer, f 10;
#X text 540 347 get signed fractional, f 11;
#X floatatom 555 324 5 0 0 0 - - -, f 5;
#X floatatom 801 400 5 0 0 0 - - -, f 5;
#X obj 801 437 expr abs($f1);
#X text 769 437 abs;
#X floatatom 801 474 5 0 0 0 - - -, f 5;
#X text 849 399 absolute value;
#X text 386 454 fmod;
#X text 346 468 remainder;
#X obj 770 225 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 427 451 expr fmod($f1 \, 4.1) \; remainder($f1 \, 4.1);
#X msg 427 402 7;
#X obj 770 251 expr log(-1);
#X connect 0 0 47 0;
#X connect 3 0 54 0;
#X connect 12 0 27 0;
#X connect 14 0 19 0;
#X connect 19 0 15 0;
#X connect 19 1 16 0;
#X connect 21 0 25 0;
#X connect 22 0 21 1;
#X connect 23 0 21 0;
#X connect 27 0 10 0;
#X connect 27 1 11 0;
#X connect 30 0 28 0;
#X connect 30 1 29 0;
#X connect 34 0 30 0;
#X connect 35 0 36 0;
#X connect 36 0 34 0;
#X connect 37 0 36 0;
#X connect 39 0 40 0;
#X connect 40 0 38 0;
#X connect 44 0 66 0;
#X connect 47 0 1 0;
#X connect 47 1 48 0;
#X connect 54 0 4 0;
#X connect 54 1 51 0;
#X connect 54 2 53 0;
#X connect 56 0 78 0;
#X connect 59 0 65 0;
#X connect 65 0 60 0;
#X connect 65 1 61 0;
#X connect 66 0 45 0;
#X connect 66 1 69 0;
#X connect 70 0 71 0;
#X connect 71 0 73 0;
#X connect 77 0 80 0;
#X connect 78 0 57 0;
#X connect 78 1 58 0;
#X connect 79 0 56 0;
#X connect 80 0 39 0;
#X restore 147 424 pd Other-functions;
#N canvas 332 23 592 281 Store-function 0;
#X text 40 26 The store function is defined with "=" \, and it can
store the result of any operation into a variable or table index.;
#X obj 32 131 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X floatatom 32 213 5 0 0 0 - - -, f 5;
#X floatatom 277 206 5 0 0 0 - - -, f 5;
#X obj 32 160 expr array2[inc - 1] = 1 / inc \; inc = inc + 1;
#N canvas 0 22 450 278 (subpatch) 0;
#X array array2 16 float 2;
#X coords 0 1.1 16 -0.1 200 140 1 0 0;
#X restore 351 101 graph;
#X obj 99 121 v inc;
#X msg 99 96 0;
#X connect 1 0 4 0;
#X connect 4 0 2 0;
#X connect 4 1 3 0;
#X connect 7 0 6 0;
#X restore 147 291 pd Store-function;
#X text 28 14 Here are all the operators and functions available for
[expr] \, [expr~] and [fexpr~] \, even though the given examples are
only presented with [expr]., f 52;
#X text 28 71 These are organized in different groups. Click on the
subpatches below to cheach each group:, f 52;
#X restore 840 434 pd All_functions \; and operators;
#N canvas 327 126 1037 555 [expr] 0;
#X obj 50 105 expr 1;
#X floatatom 48 238 0 0 0 0 - - -;
#X floatatom 50 135 0 0 0 0 - - -;
#X msg 50 77 bang;
#X obj 151 105 expr 2 + 3;
#X msg 151 78 bang;
#X floatatom 151 133 0 0 0 0 - - -;
#X floatatom 48 299 0 0 0 0 - - -;
#X floatatom 70 392 0 0 0 0 - - -;
#X floatatom 70 468 0 0 0 0 - - -;
#X floatatom 741 157 0 0 0 0 - - -;
#X obj 741 129 expr 8 / 3;
#X floatatom 695 330 0 0 0 0 - - -;
#X obj 741 103 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 695 262 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X floatatom 619 508 0 0 0 0 - - -;
#X obj 619 480 expr $f1 / 3;
#X floatatom 746 506 0 0 0 0 - - -;
#X obj 746 478 expr $i1 / 3;
#X msg 683 437 8;
#X obj 683 407 loadbang;
#X text 18 28 Examples of [expr] object:;
#X text 257 96 bang evaluates the expression, f 17;
#X obj 48 268 expr ($f1 + 2) + $i2;
#X floatatom 205 239 0 0 0 0 - - -;
#X text 478 24 NOTE About integers:;
#X floatatom 836 330 0 0 0 0 - - -;
#X obj 695 286 expr float(8) / 3 \; 8./3;
#X text 132 390 use of trigonometric functions;
#X obj 70 420 expr cos(2 * 3.14159 * $f1 / 360) \; sin(2 * 3.14159
* $f1 / 360);
#X floatatom 339 468 0 0 0 0 - - -;
#X text 506 54 Integer numbers in the [expr] object are interpreted
as integers \, not floats. Hence \, the result of the division below
is also an integer.;
#X text 521 374 But there's no issue if the inlet is defined as a float.
;
#X text 507 194 You can use the "float" function to convert an integer
to a float. Another workaround is to have a decimal point in a way
Pd can't turn into an integer \, such as below in the bottom expression:
;
#X text 253 231 '$f1' is a float from the 1st inlet \, '$i2' is an
integer from the second inlet (float input values are truncated to
integers), f 26;
#X connect 0 0 2 0;
#X connect 1 0 23 0;
#X connect 3 0 0 0;
#X connect 4 0 6 0;
#X connect 5 0 4 0;
#X connect 8 0 29 0;
#X connect 11 0 10 0;
#X connect 13 0 11 0;
#X connect 14 0 27 0;
#X connect 16 0 15 0;
#X connect 18 0 17 0;
#X connect 19 0 16 0;
#X connect 19 0 18 0;
#X connect 20 0 19 0;
#X connect 23 0 7 0;
#X connect 24 0 23 1;
#X connect 27 0 12 0;
#X connect 27 1 26 0;
#X connect 29 0 9 0;
#X connect 29 1 30 0;
#X restore 594 270 pd [expr] Examples;
#N canvas 426 64 877 686 [expr~] 0;
#X floatatom 89 364 0 0 0 0 - - -;
#X obj 89 471 dac~;
#X text 134 364 frequency;
#X floatatom 750 263 0 0 10 0 - - -;
#X obj 513 332 tabsend~ a1;
#N canvas 0 50 450 300 (subpatch) 0;
#X array a1 64 float 0;
#X coords 0 1 63 -1 200 140 1;
#X restore 649 350 graph;
#X obj 97 634 tabsend~ a2;
#X obj 286 630 tabsend~ a3;
#N canvas 0 50 450 300 (subpatch) 0;
#X array a2 64 float 1;
#A 0 0.320225 0.259744 0.19726 0.134162 0.0718381 0.0116777 -0.0449844
-0.0968794 -0.142839 -0.181805 -0.21287 -0.23528 -0.248446 -0.251982
-0.245675 -0.229516 -0.203702 -0.168604 -0.124801 -0.0730297 -0.014192
0.0506687 0.120387 0.193704 0.269284 0.345734 0.42167 0.495687 0.566438
0.63264 0.693059 0.74664 0.79241 0.829561 0.857474 0.875668 0.883918
0.882153 0.870483 0.849272 0.819 0.780379 0.734275 0.681646 0.623671
0.561566 0.496648 0.430299 0.363891 0.298839 0.236501 0.178182 0.125116
0.0784199 0.0390894 0.00796821 -0.0142663 -0.0271137 -0.0302628 -0.0235972
-0.0071979 0.0186594 0.0535072 0.0966986;
#X coords 0 1 63 -1 200 140 1;
#X restore 430 523 graph;
#N canvas 0 50 450 300 (subpatch) 0;
#X array a3 64 float 0;
#X coords 0 1 63 -1 200 140 1;
#X restore 652 523 graph;
#X obj 89 391 osc~ 440;
#X obj 321 335 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 0 1;
#X floatatom 318 355 5 0 0 0 - - -, f 5;
#X text 369 355 amplitude;
#X obj 318 402 line~;
#X msg 318 378 \$1 10;
#X obj 89 432 expr~ $v1 * pow($v2 / 127 \, 4);
#X obj 97 584 expr~ $v1 * $v2 \; if ($v2 > 0 \, 0 \, $v1*$v2);
#X obj 97 551 osc~ 440;
#X obj 513 255 osc~ 440;
#X msg 363 55 \; pd dsp 0;
#X msg 270 55 \; pd dsp 1;
#X text 268 33 audio on;
#X text 361 32 audio off;
#X obj 513 293 expr~ max(min($v1 \, $f2) \, -$f2);
#X obj 750 148 vsl 20 100 0 1 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 0 1;
#X text 492 193 Move the slider to change the limiter threshold (from
0-1)., f 29;
#X text 73 32 make sure to turn on the audio for the [expr~] examples
====>, f 23;
#X obj 158 301 print~;
#X msg 176 272 bang;
#X floatatom 275 211 0 0 0 0 - - -;
#X floatatom 158 186 0 0 0 0 - - -;
#X obj 158 241 expr~ $v1 + $f2;
#X obj 158 213 sig~ 1;
#X obj 286 551 osc~ 550;
#X text 490 169 A simple limiter/clip example:;
#X text 31 120 NOTE: The first inlet of [expr~] needs to be of type
'$v1' (cannot be '$f1' \, '$i1' or '$s1')., f 54;
#X text 36 205 Examples:;
#X text 503 40 NOTE: The vector/block size can be set with the [block~]
or [switch~] objects \, and is 64 samples by default., f 43;
#X connect 0 0 10 0;
#X connect 3 0 24 1;
#X connect 10 0 16 0;
#X connect 11 0 12 0;
#X connect 12 0 15 0;
#X connect 14 0 16 1;
#X connect 15 0 14 0;
#X connect 16 0 1 0;
#X connect 16 0 1 1;
#X connect 17 0 6 0;
#X connect 17 1 7 0;
#X connect 18 0 17 0;
#X connect 19 0 24 0;
#X connect 24 0 4 0;
#X connect 25 0 3 0;
#X connect 29 0 28 0;
#X connect 30 0 32 1;
#X connect 31 0 33 0;
#X connect 32 0 28 0;
#X connect 33 0 32 0;
#X connect 34 0 17 1;
#X restore 586 298 pd [expr~] Examples;
#N canvas 191 41 1110 716 [fexpr~] 0;
#X msg 371 46 \; pd dsp 0;
#X msg 278 46 \; pd dsp 1;
#X text 276 24 audio on;
#X text 369 23 audio off;
#X text 43 388 - $x1: same as $x1[0] \, $x2: same as $x2[0] (and so
on)., f 60;
#X text 43 369 - $x: same as $x1[0]., f 60;
#X text 43 407 - $y: same as $y1[-1]., f 60;
#X text 43 427 - $y1: same as $y1[-1] \, $y2: same as $y2[-1] (and
so on)., f 60;
#X msg 114 539 start;
#X msg 62 539 stop;
#X obj 62 509 loadbang;
#X msg 183 536 set 4000;
#X obj 170 502 sig~ 0.001;
#X obj 170 604 fexpr~ $x1[0] + $y1[-1];
#X msg 197 570 clear y1;
#X text 274 571 clears output buffer;
#X obj 170 642 snapshot~;
#X obj 34 594 metro 100;
#X obj 34 572 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X floatatom 170 674 0 0 0 0 - - -;
#X text 258 501 increment value;
#X text 256 535 set last output value ($y1[-1]);
#X text 558 234 - clear: clears all the previous input and output buffers
, f 60;
#X text 558 195 - clear x#: clears the previous values of the #th input
, f 60;
#X text 558 214 - clear y#: clears the previous values of the #th output
, f 60;
#X text 558 88 - set y# <list>: sets the as many supplied values of
the #th output (e.g. "set y3 1 2" sets $y3[-1] = 1 and $y3[-2] = 2).
;
#X floatatom 850 550 0 0 0 0 - - -;
#X msg 630 516 start;
#X msg 584 516 stop;
#X obj 584 483 loadbang;
#X msg 811 512 0;
#X obj 656 671 dac~;
#X obj 685 630 *~ 0.1;
#X obj 685 586 fexpr~ $x1 + $x1[$f2];
#X msg 685 458 1102.5;
#X floatatom 685 516 0 0 0 0 - - -;
#X text 534 383 Simple FIR filter:, f 63;
#X msg 890 512 -20;
#X msg 850 512 -10;
#X text 788 466 change values to filter the frequencies, f 23;
#X text 558 132 - set <list>: sets the first past values of each output
(e.g. "set 0.1 2.2 0.4" sets y1[-1] = 0.1 \, y2[-1] = 2.2 \, and y3[-1]
= 0.4).;
#X text 558 43 - set x# <list>: sets as many supplied values of the
#th input (e.g. "set x2 1 2" sets $x2[0] = 1 and $x2[-1] = 2)., f
60;
#X text 16 101 NOTES:;
#X text 16 461 Simple accumulator example:;
#X text 534 14 [fexpr~] responds to the following methods:, f 63;
#X text 27 130 - The first inlet of [fexpr~] only accepts signals and
needs to be '$x1' (cannot be '$f1' \, '$i1' or '$s1').;
#X text 27 173 - [fexpr~] does not understand '$v#' variables \, it
has special input and output variables:;
#X text 64 233 - $y#[n]: output sample of outlet # indexed by 'n';
#X text 64 214 - $x#[n]: input sample of inlet # indexed by 'n', f
50;
#X text 26 347 - There are shorthands as follows:;
#X text 558 253 - stop: stops the computation of [fexpr~] *, f 60
;
#X text 558 273 - start: starts the computation of [fexpr~] *, f 60
;
#X text 920 616 more examples:;
#N canvas 418 157 942 590 Difference 0;
#X obj 199 197 v pr;
#X obj 350 197 v r;
#X obj 254 199 v b;
#X floatatom 199 168 5 0 0 0 - - -, f 5;
#X floatatom 350 170 5 0 0 0 - - -, f 5;
#X msg 199 143 10;
#X msg 177 255 set 1.2 2.3 4.4;
#X floatatom 254 169 7 0 0 0 - - -, f 7;
#X floatatom 418 170 5 0 0 0 - - -, f 5;
#X obj 418 199 v dt;
#X msg 350 141 18;
#X msg 418 131 0.01;
#X obj 84 404 dac~;
#X obj 177 69 bng 25 250 50 0 empty empty empty 20 8 0 8 -262144 -1
-1;
#X obj 468 140 line;
#X msg 468 114 0.01 \, 0.04 5000;
#X obj 106 197 loadbang;
#N canvas 0 50 450 300 (subpatch) 0;
#X array X 64 float 0;
#X coords 0 20 63 -20 200 140 1 0 0;
#X restore 204 429 graph;
#N canvas 0 50 450 300 (subpatch) 0;
#X array Y 64 float 0;
#X coords 0 20 63 -20 200 140 2 0 0;
#X restore 451 427 graph;
#N canvas 0 50 450 300 (subpatch) 0;
#X array Z 64 float 0;
#X coords 0 40 63 0 200 140 2 0 0;
#X restore 696 426 graph;
#X obj 254 140 expr 8./3;
#X text 647 293 $y1 -> $y1[-1] $y2 -> $y2[-1] $y3 -> $y3[-1], f 15
;
#X obj 99 363 *~ 0.01;
#X text 171 553 -20;
#X text 178 422 20;
#X text 414 553 -20;
#X text 421 422 20;
#X text 676 553 0;
#X text 671 422 40;
#X text 667 28 Lorenz Equations written with 3 state variables X \,
Y \, and Z:, f 30;
#X text 453 305 <= Note the shorthands:;
#X text 713 71 dX/dt = pr * (Y - X);
#X text 713 91 dY/dt = X(r - Z) - Y;
#X text 713 111 dZ/dt = X*Y - bZ, f 20;
#X obj 177 289 fexpr~ $y1 + pr*($y2 - $y1) * dt \; $y2 + ($y1*(r -
$y3) - $y2) * dt \; $y3 + ($y1*$y2 - b*$y3) * dt;
#X obj 177 363 tabsend~ X;
#X obj 307 363 tabsend~ Y;
#X obj 438 364 tabsend~ Z;
#X text 309 254 <= sets initial values of $y1[-1] \, $y2[-1] \, and
$y3[-1];
#X msg 28 224 start \; pd dsp 1;
#X text 102 55 bang to start =>, f 8;
#X text 233 28 This is an example of how [fexpr~] can be used to solve
differential equations such as the lorenz equations., f 49;
#X msg 106 222 stop;
#X text 469 169 <= experiment with these parameter values. If you;
#X text 493 187 hear a click and audio stops \, the system went unstable
and you need to bang on the top again to reload the default values.
, f 46;
#X connect 3 0 0 0;
#X connect 4 0 1 0;
#X connect 5 0 3 0;
#X connect 6 0 34 0;
#X connect 7 0 2 0;
#X connect 8 0 9 0;
#X connect 10 0 4 0;
#X connect 11 0 8 0;
#X connect 13 0 5 0;
#X connect 13 0 10 0;
#X connect 13 0 11 0;
#X connect 13 0 6 0;
#X connect 13 0 39 0;
#X connect 13 0 20 0;
#X connect 14 0 8 0;
#X connect 15 0 14 0;
#X connect 16 0 42 0;
#X connect 20 0 7 0;
#X connect 22 0 12 0;
#X connect 22 0 12 1;
#X connect 34 0 22 0;
#X connect 34 0 35 0;
#X connect 34 1 36 0;
#X connect 34 2 37 0;
#X connect 39 0 34 0;
#X connect 42 0 34 0;
#X restore 776 670 pd Difference equations (Lorenz);
#X text 27 261 'n' goes from 0 to -vector size (defined by the [block~]
or [switch~] objects). As such \, $x#[0] specifies the current sample
input \, and $y#[-1] the last sample output (which is the minimum 'n'
value \, for $y#).;
#X text 81 25 make sure to turn on the audio for the [fexpr~] examples
====>, f 23;
#X text 606 300 * [fexpr~] can be CPU expensive! By default \, [fexpr~]
is on when it is loaded \, but you can save CPU and control when it
is on or off with the 'start' and 'stop' messages., f 54;
#N canvas 755 185 585 374 Fractional 0;
#X msg 135 180 start;
#X msg 83 179 stop;
#X obj 83 148 loadbang;
#X obj 155 330 dac~;
#X obj 166 289 *~ 0.1;
#X obj 334 137 hsl 128 15 0 -10 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 0 1;
#X floatatom 331 163 0 -10 0 0 - - -;
#X obj 331 223 line~;
#X msg 331 193 \$1 100;
#X obj 166 254 fexpr~ $x1 + $x1[$X2];
#X obj 166 212 osc~ 2205;
#X text 226 117 fractional sample index offset, f 17;
#X text 40 17 When fractional index offset is used for either input
or output samples \, [fexpr~] determines the value by linear interpolation.
, f 63;
#X text 40 58 In the following example \, you can continuously change
the sample input index from 0 to -10 (which filters the frequency of
2205)., f 63;
#X connect 0 0 9 0;
#X connect 1 0 9 0;
#X connect 2 0 1 0;
#X connect 4 0 3 0;
#X connect 4 0 3 1;
#X connect 5 0 6 0;
#X connect 6 0 8 0;
#X connect 7 0 9 1;
#X connect 8 0 7 0;
#X connect 9 0 4 0;
#X connect 10 0 9 0;
#X restore 824 642 pd Fractional sample index;
#X text 607 405 -10 offset filters audio at frequency of 2205 Hz -20
offset filters audio at frequency of 1102.5 Hz, f 50;
#X msg 702 485 2205;
#X obj 685 547 osc~ 2205;
#X connect 8 0 13 0;
#X connect 9 0 13 0;
#X connect 10 0 9 0;
#X connect 10 0 18 0;
#X connect 11 0 13 0;
#X connect 12 0 13 0;
#X connect 13 0 16 0;
#X connect 14 0 13 0;
#X connect 16 0 19 0;
#X connect 17 0 16 0;
#X connect 18 0 17 0;
#X connect 26 0 33 1;
#X connect 27 0 33 0;
#X connect 28 0 33 0;
#X connect 29 0 28 0;
#X connect 30 0 26 0;
#X connect 32 0 31 0;
#X connect 32 0 31 1;
#X connect 33 0 32 0;
#X connect 34 0 35 0;
#X connect 35 0 60 0;
#X connect 37 0 26 0;
#X connect 38 0 26 0;
#X connect 59 0 35 0;
#X connect 60 0 33 0;
#X restore 578 326 pd [fexpr~] Examples;
#X obj 836 239 print expr;
#X obj 755 460 +;
#X obj 755 485 +~;
#X obj 755 435 >;
#X text 610 436 binary operators:;
#X text 578 460 arithmetic operators:;
#X text 617 485 audio operators:;
#X text 598 208 (click on the subpatches to open them), f 13;
#X obj 731 512 random;
#X connect 4 0 17 0;
#X connect 5 0 40 0;
#X connect 6 0 40 0;
#X connect 17 0 5 0;
#X connect 17 1 6 0;
#X connect 17 2 18 0;
#X connect 18 0 40 0;
