#N canvas 377 49 559 597 10;
#X declare -stdpath ./;
#X obj 4 570 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X obj 5 288 cnv 3 550 3 empty empty inlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 5 425 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 5 456 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 83 297 cnv 17 3 78 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 81 401 cnv 17 3 17 empty empty 2 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 161 296 signal;
#X obj 81 380 cnv 17 3 17 empty empty 1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 81 432 cnv 17 3 17 empty empty 0-n 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 161 433 signal;
#X text 143 477 2) float;
#X text 143 494 3) float;
#X text 143 510 4) float;
#X text 143 460 1) symbol;
#X text 125 402 float/signal;
#X text 125 382 float/signal;
#X text 213 402 - set endpoint (in ms), f 54;
#X text 213 382 - set startpoint (in ms), f 54;
#X text 213 477 - startpoint in ms (default 0), f 54;
#X text 125 312 set <symbol>;
#X text 213 312 - sets array name, f 54;
#X text 113 328 interp <float>;
#N canvas 860 67 456 425 interpolation_modes 0;
#N canvas 448 113 531 386 theory 0;
#N canvas 773 91 547 406 non-cubic 0;
#X text 51 312 The cosine interpolator maps a cosine curve (from phase 0 to phase pi) to the values it is interpolating between. It is of limited use., f 76;
#X text 45 150 As indices in an array increase \, there is less and less index resolution between integer index values. The low-quality linear interpolation maps the 0.0-1.0 phase range to the array range in single precision \, which means that low index resolution later in the table can result in lower quality audio. The high-quality linear interpolation handles all index values as well as values read from the table in double precision \, so that the 24-bit resolution between 0 and 1 is preserved no matter where in the table it reads from., f 76;
#X text 49 122 Modes 1 & 2 (High & Low Quality Linear Interpolation \, respectively):, f 69;
#X text 49 63 mode 0 (no interpolation):, f 76;
#X text 51 88 there is no interpolation \, this means that indexes are truncated to the sample point., f 73;
#X text 41 282 Mode 3 Cosine Interpolation):;
#X restore 139 320 pd non-cubic (modes 0 to 3);
#N canvas 384 89 982 510 cubic 0;
#X text 24 283 The advantage of Lagrange interpolation is that the curve drawn has low RMS error with respect to that of an ideal (sinc) interpolator. A disadvantage is that the first derivative (the isntantaneous slope of the curve) is not usually continuous at breakpoints \, which can cause sharp corners in the curve (see examples in the parent patch)., f 75;
#X text 24 396 An Hermite interpolator addresses the first derivative problem with the Lagrange by deliberately making the first derivative continuous at breakpoints. It interpolates between b and c by finding a cubic polynomial curve that passes through b and c. The curve does not usually pass through a and d. Instead \, the interpolator uses the pairs (a \, c) and (b \, d) to set the curve slope at points b and c \, respectively., f 75;
#X text 25 187 To interpolate between points b and c \, a Lagrange interpolator finds a cubic polynomial curve f(x) that passes through all four points a \, b \, c \, and d \, imagining a = f(-1) \, b = f(0) \, c = f(1) \, and d = f(2)., f 75;
#X text 24 235 This is the the kind of interpolation used in Pd's [tabread4~] \, as well as the cubic interpolating functions in csound. The output is f(m) (where m is the fractional index between 0 and 1)., f 75;
#X text 514 37 The most basic form of Hermite interpolator sets the curve slope at point b as the slope of the line passing through a and c \, which is defined (c - a)/2. The curve slope at point c is set to (d - b)/2. In the examples \, it is easy to see that there are no sharp corners. However \, the second derivative is discontinuous \, so there are occasional abrupt changes in concavity \, e.g. at zero-crossings in the 4-period cosine example. There are no such abrupt changes in concavity with Lagrange interpolation. This type of interpolation is used in SuperCollider's interpolating functions., f 75;
#X text 514 459 The normal range for both tension and bias values is -1 to +1. Outside of that range the curves can be unpredictable., f 75;
#X text 21 86 The four cubic interpolators work differently from one another. They are discussed out of order here for the sake of clarity. For all examples \, let us label the four points as: a \, b \, c \, and d \, with interpolation between points b and c., f 76;
#X text 21 38 Cubic interpolation draws a cubic polynomial curve between the two points it is interpolating between \, and uses the points to the left and right of these two as extra information to draw these curves., f 76;
#X text 514 220 Other slope values can be used to accentuate or attenuate the shape of the curve. The "tension" setting in mode 6 adjusts the curve slope at breakpoints. At point b \, the slope is (1 - tension)*((c - a)/2). A tension value of 0 is identical to the Catmull-Rom spline (Mode 5). When tension is +1 \, the slope is 0 (horizontal) at all breakpoints. Between 0 and 1 \, the slope at breakpoints is less than that for the Catmull-Rom spline \, and the maxima and curve is shallower., f 75;
#X text 514 317 Tension values between 0 and -1 increase the slope at breakpoints and make the curve deeper. At tension = -1 \, the slope at breakpoints is double that of the Catmull-Rom spline \, and the curve is identical to the "Cubic" interpolation (Mode 4). The period-8 cosine example in the [pd examples] subpatch is a good illustration of tension., f 75;
#X text 514 389 Bias is related to tension in that it changes slope at breakpoints and depth of curve \, but it does so by giving one of the two points surrounding the breakpoint more control over the slope at that breakpoint than the other. Bias values between 0 and 1 give the left point more influence than the right \, bias values between 0 and -1 do the opposite., f 75;
#X text 22 18 Overview:;
#X text 24 157 Mode 7: Pd's Cubic Interpolator (Lagrange):;
#X text 26 372 Modes 4 \, 5 & 6: Hermite Interpolators;
#X text 516 19 Catmull-Rom Spline (mode 5);
#X text 518 146 (modes 4 and 6):;
#X text 525 166 Mode 6: With settable Tension and Bias;
#X text 528 187 Mode 4: "Cubic" \, with tension of -1;
#X restore 319 320 pd cubic (modes 4 to 7);
#X text 19 17 Though not referred in Max's documentation \, the interpolation formulas for [wave~] almost certainly can found in <http://paulbourke.net/miscellaneous/interpolation>., f 82;
#X text 19 50 [wave~]'s input phase varies between 0 and 1 \, which in 32-bit floating point arithmetic has 24 bits of index resolution. All interpolators (except mode 2: low quality linear) use double-precision index mapping \, so behavior should be the same in all parts of a table., f 82;
#X text 19 185 Backwards compatibility:, f 82;
#X text 19 209 At the time of Max 4 \, [wave~] only had one cheaop linear interpolator. Earlier versions of cyclone included Pd's interpolator isntead. This is mode is now added as an extra mode 7 (and is also used in [tabread4~] \, [tabosc4~] \, and [vd~] or [delread4~])., f 82;
#X text 20 280 Please find more theoretical details for each mode in the subpatches below:, f 82;
#X text 19 108 Unlike [tabread4~] \, [wave~] does not use guard points for interpolating between the end and the beginning of the array \, but isntead treats the range as a circular buffer \, where phases 0 and 1 point to the first element of the table. Input phase is clipped to the 0-1 range. A bug from Max was fixed \, where the 4-point interpolation modes did not wrap correctly., f 82;
#X restore 166 334 pd theory;
#N canvas 428 110 700 590 examples 0;
#X obj 17 30 cnv 15 183 99 empty empty empty 20 12 0 14 #dcdcdc #404040 0;
#N canvas 0 22 450 278 (subpatch) 0;
#X array \$0-source 12 float 2;
#X coords 0 1.1 12 -1.1 185 100 2 0 0;
#X restore 16 30 graph;
#X obj 477 53 bng 35 250 50 0 \$0-impulse \$0-impulse-set Impulse -10 -20 0 14 #b8b8b8 #606060 #000000;
#X obj 552 52 bng 35 250 50 0 \$0-step \$0-dummy Step 2 -20 0 14 #b8b8b8 #606060 #000000;
#X obj 554 113 hradio 15 1 1 2 \$0-step-dir-snd \$0-step-dir-rcv empty 0 -8 0 10 #b8b8b8 #606060 #000000 0;
#X text 547 95 Up;
#X text 567 95 Down;
#X obj 629 52 bng 35 250 50 0 \$0-cosine \$0-dummy Cosine -6 -20 0 14 #b8b8b8 #606060 #000000;
#X obj 618 113 hradio 15 1 1 4 \$0-cos-period-snd \$0-cos-period-rcv Period 12 -10 0 10 #b8b8b8 #606060 #000000 0;
#X text 618 131 2;
#X text 633 131 3;
#X text 649 131 4;
#X obj 406 54 bng 35 250 50 0 \$0-noise \$0-dummy Noise -2 -20 0 14 #b8b8b8 #606060 #000000;
#X obj 223 45 bng 35 250 50 0 \$0-read-write \$0-dummy Draw 1 -20 0 14 #b8b8b8 #606060 #000000;
#X obj 348 98 bng 35 250 50 0 \$0-clear \$0-dummy empty -2 -20 0 14 #b8b8b8 #606060 #000000;
#X obj 421 250 nbx 5 20 -1e+37 1e+37 0 0 \$0-tension-snd \$0-tension-rcv empty 0 -8 0 16 #dcdcdc #000000 #000000 0 256;
#X obj 563 250 nbx 5 20 -1e+37 1e+37 0 0 \$0-bias-snd \$0-bias-rcv empty 0 -8 0 16 #dcdcdc #000000 #000000 0 256;
#X text 472 96 L;
#X text 489 96 M;
#X text 506 96 R;
#X obj 471 116 vsl 15 45 -1 1 0 0 \$0-left-impulse-snd \$0-left-impulse-rcv empty 0 -9 0 10 #b8b8b8 #000000 #000000 0 1;
#X obj 487 116 vsl 15 45 -1 1 0 0 \$0-mid-impulse-snd \$0-mid-impulse-rcv empty 0 -9 0 10 #b8b8b8 #000000 #000000 0 1;
#X obj 503 116 vsl 15 45 -1 1 0 0 \$0-right-impulse-snd \$0-right-impulse-rcv empty 0 -9 0 10 #b8b8b8 #000000 #000000 0 1;
#X text 270 44 Draw function in source window \, then click this bang., f 19;
#X text 667 131 8;
#X obj 34 204 nbx 3 20 0 256 0 0 \$0-periods-snd \$0-periods-rcv empty 0 -8 0 16 #dcdcdc #000000 #000000 0 256;
#X obj 226 104 nbx 2 15 4 48 0 0 \$0-draw-samps-snd \$0-draw-samps-rcv empty -10 -8 0 12 #b8b8b8 #000000 #000000 0 256;
#X text 222 86 Samples;
#X obj 410 115 nbx 2 15 4 48 0 0 \$0-noise-samps-snd \$0-noise-samps-rcv empty -10 -8 0 12 #b8b8b8 #000000 #000000 0 256;
#X text 401 97 Samples;
#N canvas 923 442 398 304 guts 0;
#N canvas 294 76 427 599 \$0-clear 0;
#X obj 174 38 loadbang;
#X msg 44 86 const 0;
#X obj 274 38 r \$0-clear;
#X obj 164 361 s \$0-source;
#X obj 144 391 s \$0-1-Linear;
#X obj 124 421 s \$0-3-Cosine;
#X obj 104 451 s \$0-4-Cubic;
#X obj 84 481 s \$0-5-Spline;
#X obj 64 511 s \$0-6-Hermite;
#X obj 44 541 s \$0-7-Lagrange-(Pd-Cubic);
#X obj 174 331 s \$0-left-impulse-rcv;
#X msg 174 86 0;
#X obj 194 301 s \$0-mid-impulse-rcv;
#X obj 204 271 s \$0-right-impulse-rcv;
#X obj 214 241 s \$0-step-dir-rcv;
#X obj 224 211 s \$0-cos-period-rcv;
#X obj 234 181 s \$0-periods-rcv;
#X msg 234 87 1;
#X obj 274 151 s \$0-noise-samps-rcv;
#X msg 274 87 8;
#X obj 284 121 s \$0-draw-samps-rcv;
#X connect 0 0 1 0;
#X connect 0 0 11 0;
#X connect 0 0 17 0;
#X connect 0 0 19 0;
#X connect 1 0 3 0;
#X connect 1 0 4 0;
#X connect 1 0 5 0;
#X connect 1 0 6 0;
#X connect 1 0 9 0;
#X connect 1 0 8 0;
#X connect 1 0 7 0;
#X connect 2 0 1 0;
#X connect 2 0 11 0;
#X connect 2 0 17 0;
#X connect 2 0 19 0;
#X connect 11 0 10 0;
#X connect 11 0 13 0;
#X connect 11 0 12 0;
#X connect 11 0 14 0;
#X connect 11 0 15 0;
#X connect 17 0 16 0;
#X connect 19 0 18 0;
#X connect 19 0 20 0;
#X restore 33 39 pd \$0-clear;
#N canvas 96 69 263 142 \$0-read-write 0;
#N canvas 504 321 431 356 \$0-phasor 0;
#X obj 57 247 phasor~;
#X msg 216 131 0;
#X obj 57 95 samplerate~;
#X obj 57 49 r \$0-read-write;
#X obj 57 276 s~ \$0-phasor;
#X obj 57 321 outlet~;
#X obj 57 141 / 512;
#X obj 57 212 *;
#X obj 72 164 r \$0-periods-snd;
#X connect 0 0 4 0;
#X connect 1 0 0 1;
#X connect 2 0 6 0;
#X connect 3 0 2 0;
#X connect 3 0 1 0;
#X connect 6 0 7 0;
#X connect 7 0 0 0;
#X connect 8 0 7 1;
#X restore 33 40 pd \$0-phasor;
#N canvas 177 79 567 671 \$0-wave-tabwrite 0;
#X obj 42 33 inlet~;
#X obj 59 150 r \$0-read-write;
#X obj 42 115 cyclone/wave~ \$0-source @interp 1;
#X obj 42 176 tabwrite~ \$0-1-Linear;
#X obj 42 89 r~ \$0-phasor;
#X obj 299 150 r \$0-read-write;
#X obj 282 89 r~ \$0-phasor;
#X obj 282 176 tabwrite~ \$0-3-Cosine;
#X obj 282 115 cyclone/wave~ \$0-source @interp 3;
#X obj 59 310 r \$0-read-write;
#X obj 42 249 r~ \$0-phasor;
#X obj 299 310 r \$0-read-write;
#X obj 282 249 r~ \$0-phasor;
#X obj 59 610 r \$0-read-write;
#X obj 42 429 r~ \$0-phasor;
#X obj 299 490 r \$0-read-write;
#X obj 282 429 r~ \$0-phasor;
#X obj 42 275 cyclone/wave~ \$0-source @interp 4;
#X obj 282 275 cyclone/wave~ \$0-source @interp 5;
#X obj 42 575 cyclone/wave~ \$0-source @interp 6;
#X obj 282 455 cyclone/wave~ \$0-source @interp 7;
#X obj 42 336 tabwrite~ \$0-4-Cubic;
#X obj 282 336 tabwrite~ \$0-5-Spline;
#X obj 42 636 tabwrite~ \$0-6-Hermite;
#X obj 282 516 tabwrite~ \$0-7-Lagrange-(Pd-Cubic);
#X msg 70 488 interp_tension \$1;
#X msg 80 548 interp_bias \$1;
#X obj 70 459 r \$0-tension-snd;
#X obj 80 519 r \$0-bias-snd;
#X connect 1 0 3 0;
#X connect 2 0 3 0;
#X connect 4 0 2 0;
#X connect 5 0 7 0;
#X connect 6 0 8 0;
#X connect 8 0 7 0;
#X connect 9 0 21 0;
#X connect 10 0 17 0;
#X connect 11 0 22 0;
#X connect 12 0 18 0;
#X connect 13 0 23 0;
#X connect 14 0 19 0;
#X connect 15 0 24 0;
#X connect 16 0 20 0;
#X connect 17 0 21 0;
#X connect 18 0 22 0;
#X connect 19 0 23 0;
#X connect 20 0 24 0;
#X connect 25 0 19 0;
#X connect 26 0 19 0;
#X connect 27 0 25 0;
#X connect 28 0 26 0;
#X restore 33 71 pd \$0-wave-tabwrite;
#X connect 0 0 1 0;
#X restore 33 85 pd \$0-read-write;
#N canvas 291 103 300 402 \$0-impulse 0;
#X obj 70 194 r \$0-left-impulse-snd;
#X obj 93 215 r \$0-mid-impulse-snd;
#X obj 116 238 r \$0-right-impulse-snd;
#X obj 47 263 pack 0 0 0 0;
#X obj 28 49 r \$0-impulse;
#X obj 47 319 s \$0-source;
#X obj 28 350 s \$0-read-write;
#X msg 47 292 0 \$2 0 0 0 0 0 \$3 0 0 0 0 \$4;
#X obj 28 81 t b b b;
#X msg 67 116 resize 12;
#X obj 67 147 s \$0-source;
#X connect 0 0 3 1;
#X connect 1 0 3 2;
#X connect 2 0 3 3;
#X connect 3 0 7 0;
#X connect 4 0 8 0;
#X connect 7 0 5 0;
#X connect 8 0 6 0;
#X connect 8 1 3 0;
#X connect 8 2 9 0;
#X connect 9 0 10 0;
#X restore 33 134 pd \$0-impulse;
#N canvas 322 149 524 433 \$0-step 0;
#X obj 28 49 r \$0-step;
#X obj 271 235 sel 0 1;
#X obj 271 210 f;
#X obj 28 360 s \$0-read-write;
#X obj 45 329 s \$0-source;
#X obj 286 181 r \$0-step-dir-snd;
#X msg 57 266 0 -1 -1 -1 -1 0 0 0 0 1 1 1 1;
#X msg 290 266 0 1 1 1 1 0 0 0 0 -1 -1 -1 -1;
#X msg 45 217 normalize 0.75;
#X obj 28 81 t b b b b;
#X msg 286 116 resize 12;
#X obj 286 147 s \$0-source;
#X connect 0 0 9 0;
#X connect 1 0 6 0;
#X connect 1 1 7 0;
#X connect 2 0 1 0;
#X connect 5 0 2 1;
#X connect 6 0 4 0;
#X connect 7 0 4 0;
#X connect 8 0 4 0;
#X connect 9 0 3 0;
#X connect 9 1 8 0;
#X connect 9 2 2 0;
#X connect 9 3 10 0;
#X connect 10 0 11 0;
#X restore 33 164 pd \$0-step;
#N canvas 170 180 1163 394 \$0-cosine 0;
#X obj 218 110 f;
#X obj 28 340 s \$0-read-write;
#X obj 47 309 s \$0-source;
#X obj 28 81 t b b b;
#X obj 28 49 r \$0-cosine;
#X obj 233 81 r \$0-cos-period-snd;
#X obj 218 135 sel 0 1 2 3;
#X obj 73 195 t b b;
#X msg 47 117 normalize 0.95;
#X msg 148 227 resize 4;
#X msg 59 226 0 1 -1 1 -1;
#X obj 233 195 t b b;
#X msg 388 226 resize 6;
#X msg 219 226 0 1 -0.5 -0.5 1 -0.5 -0.5;
#X obj 473 195 t b b;
#X msg 459 226 0 1 0 -1 0 1 0 -1 0;
#X msg 628 226 resize 4;
#X obj 703 75 t b b;
#X msg 1068 106 resize 7;
#X msg 689 106 0 1 0.62349 -0.222521 -0.900969 -0.900969 -0.222521 0.62349;
#X obj 703 225 t b b;
#X msg 1068 256 resize 8;
#X msg 689 256 0 1 0.707107 0 -0.707107 -1 -0.707107 0 0.707107;
#X connect 0 0 6 0;
#X connect 3 0 1 0;
#X connect 3 1 8 0;
#X connect 3 2 0 0;
#X connect 4 0 3 0;
#X connect 5 0 0 1;
#X connect 6 0 7 0;
#X connect 6 1 11 0;
#X connect 6 2 14 0;
#X connect 6 3 17 0;
#X connect 6 3 20 0;
#X connect 7 0 10 0;
#X connect 7 1 9 0;
#X connect 8 0 2 0;
#X connect 9 0 2 0;
#X connect 10 0 2 0;
#X connect 11 0 13 0;
#X connect 11 1 12 0;
#X connect 12 0 2 0;
#X connect 13 0 2 0;
#X connect 14 0 15 0;
#X connect 14 1 16 0;
#X connect 15 0 2 0;
#X connect 16 0 2 0;
#X connect 17 0 19 0;
#X connect 17 1 18 0;
#X connect 20 0 22 0;
#X connect 20 1 21 0;
#X connect 21 0 2 0;
#X connect 22 0 2 0;
#X restore 33 194 pd \$0-cosine;
#X msg 222 73 resize \$1;
#X obj 222 110 s \$0-source;
#N canvas 926 45 353 517 \$0-noise 0;
#X obj 28 420 s \$0-read-write;
#X obj 103 229 s \$0-source;
#X msg 103 198 resize \$1;
#X obj 47 151 f;
#X obj 47 176 t f f;
#X obj 47 229 until;
#X obj 47 382 tabwrite \$0-source;
#X msg 206 121 0;
#X obj 152 302 f;
#X obj 201 302 + 1;
#X obj 28 81 t b b b;
#X obj 47 260 t b b;
#X obj 47 302 random 32768;
#X obj 47 332 / 16389;
#X obj 47 354 - 1;
#X obj 28 49 r \$0-noise;
#X obj 62 121 r \$0-noise-samps-snd;
#X connect 2 0 1 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 4 1 2 0;
#X connect 5 0 11 0;
#X connect 7 0 8 1;
#X connect 8 0 9 0;
#X connect 8 0 6 1;
#X connect 9 0 8 1;
#X connect 10 0 0 0;
#X connect 10 1 3 0;
#X connect 10 2 7 0;
#X connect 11 0 12 0;
#X connect 11 1 8 0;
#X connect 12 0 13 0;
#X connect 13 0 14 0;
#X connect 14 0 6 0;
#X connect 15 0 10 0;
#X connect 16 0 3 1;
#X restore 33 224 pd \$0-noise;
#X obj 222 44 r \$0-draw-samps-snd;
#X msg 225 187 1;
#X obj 225 215 s \$0-left-impulse-rcv;
#X obj 225 161 loadbang;
#X obj 264 187 s \$0-impulse-set;
#X connect 5 0 6 0;
#X connect 8 0 5 0;
#X connect 9 0 10 0;
#X connect 11 0 9 0;
#X connect 11 0 12 0;
#X restore 637 539 pd guts;
#X text 432 199 Usual range is -1 to +1 for both;
#X obj 203 308 vradio 15 1 0 8 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0;
#X msg 203 443 interp \$1;
#X obj 203 486 cyclone/wave~ \$0-source;
#X text 223 354 3 - cosine;
#X text 223 369 4 - cubic;
#X text 223 383 5 - spline;
#X text 223 399 6 - hermite;
#X text 223 414 7 - lagrange (Pd's);
#X obj 42 318 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 39 347 nbx 7 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 39 376 sig~;
#X msg 421 420 interp_tension \$1;
#X msg 563 424 interp_bias \$1;
#X text 223 308 0 - none;
#X text 223 324 1 - linear (hi-quality);
#X text 223 339 2 - linear (lo-quality);
#N canvas 693 36 563 327 Mode_1) 0;
#X obj 30 69 cnv 15 512 192 empty empty empty 20 12 0 14 #dcdcdc #404040 0;
#N canvas 0 22 450 278 (subpatch) 0;
#X array \$0-1-Linear 513 float 2;
#X coords 0 1 513 -1 513 192 1 0 0;
#X restore 29 69 graph;
#X restore 119 208 pd Mode_1) Linear;
#N canvas 192 23 573 338 Mode_3) 0;
#X obj 33 49 cnv 15 512 192 empty empty empty 20 12 0 14 #dcdcdc #404040 0;
#N canvas 0 22 450 278 (subpatch) 0;
#X array \$0-3-Cosine 513 float 2;
#X coords 0 1 513 -1 513 192 1 0 0;
#X restore 32 49 graph;
#X restore 119 234 pd Mode_3) Cosine;
#N canvas 192 23 577 277 Mode_4) 0;
#X obj 38 36 cnv 15 512 192 empty empty empty 20 12 0 14 #dcdcdc #404040 0;
#N canvas 0 22 450 278 (subpatch) 0;
#X array \$0-4-Cubic 513 float 2;
#X coords 0 1 513 -1 513 192 1 0 0;
#X restore 37 36 graph;
#X restore 119 260 pd Mode_4) Cubic;
#N canvas 192 23 577 277 Mode_5) 0;
#X obj 28 33 cnv 15 512 192 empty empty empty 20 12 0 14 #dcdcdc #404040 0;
#N canvas 0 22 450 278 (subpatch) 0;
#X array \$0-5-Spline 513 float 2;
#X coords 0 1 513 -1 513 192 1 0 0;
#X restore 27 33 graph;
#X restore 247 207 pd Mode_5) Spline;
#N canvas 192 23 577 277 Mode_6) 0;
#X obj 27 33 cnv 15 512 192 empty empty empty 20 12 0 14 #dcdcdc #404040 0;
#N canvas 0 22 450 278 (subpatch) 0;
#X array \$0-6-Hermite 513 float 2;
#X coords 0 1 513 -1 513 192 1 0 0;
#X restore 26 33 graph;
#X restore 247 234 pd Mode_6) Hermite;
#N canvas 201 24 588 341 Mode_7) 0;
#X obj 54 51 cnv 15 512 192 empty empty empty 20 12 0 14 #dcdcdc #404040 0;
#N canvas 0 22 450 278 (subpatch) 0;
#X array \$0-7-Lagrange-(Pd-Cubic) 513 float 2;
#X coords 0 1 513 -1 513 192 1 0 0;
#X restore 53 51 graph;
#X restore 248 260 pd Mode_7) Lagrange;
#N canvas 0 22 450 278 (subpatch) 0;
#X coords 0 1 100 -1 360 140 1 0 0;
#X restore 22 158 graph;
#N canvas 0 22 450 278 (subpatch) 0;
#X coords 0 1 100 -1 210 160 1 0 0;
#X restore 397 14 graph;
#N canvas 0 22 450 278 (subpatch) 0;
#X coords 0 1 100 -1 80 160 1 0 0;
#X restore 457 14 graph;
#N canvas 0 22 450 278 (subpatch) 0;
#X coords 0 1 100 -1 80 160 1 0 0;
#X restore 607 14 graph;
#N canvas 0 22 450 278 (subpatch) 0;
#X coords 0 1 100 -1 180 127 1 0 0;
#X restore 217 14 graph;
#N canvas 0 22 450 278 (subpatch) 0;
#X coords 0 1 100 -1 290 100 1 0 0;
#X restore 395 188 graph;
#X text 56 169 Open subpatches below and compare:;
#X text 27 230 Periods of source to draw, f 11;
#X text 310 108 Clear;
#X text 418 229 Hermite Tension;
#X text 563 230 Hermite Bias;
#X obj 203 522 cyclone/snapshot~ 1;
#X obj 203 549 nbx 7 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X connect 15 0 43 0;
#X connect 16 0 44 0;
#X connect 32 0 33 0;
#X connect 33 0 34 0;
#X connect 34 0 65 0;
#X connect 40 0 41 0;
#X connect 41 0 42 0;
#X connect 42 0 34 0;
#X connect 43 0 34 0;
#X connect 44 0 34 0;
#X connect 65 0 66 0;
#X restore 259 334 pd examples;
#X text 77 85 0 - No interpolation, f 47;
#X text 77 101 1 - High-quality linear interpolation (default);
#X text 77 119 2 -;
#X text 101 118 Low-quality linear interpolation (found in MSP 1.x versions of [wave~], f 43;
#X text 77 147 3 - Cosine interpolation, f 47;
#X text 77 164 4 - Cubic interpolation, f 47;
#X text 77 180 5 - Spline interpolation, f 47;
#X text 77 196 6 - Hermite interpolation, f 47;
#X text 77 212 7 - Extra: Pd's interpolator (Lagrange), f 47;
#X text 40 29 The [wave~] object in cyclone offers 7 modes of interpolation \, which can be set with the "interp" message/attribute., f 62;
#X text 41 60 The modes are:;
#X text 41 241 The Hermite interpolation has extra parameters: 'bias' and 'tension' \, respectively set with the 'interp_bias' and 'interp_tension' messages/attributes.;
#X text 41 290 For more details in the theory of interpolation and some examples \, please check the subopatches below:, f 58;
#X text 101 366 Information and examples provided by Matt Barber;
#X restore 406 255 pd interpolation_modes;
#X text 89 360 interp_tension <f>;
#X obj 2 529 cnv 3 550 3 empty empty attributes 8 12 0 13 #dcdcdc #000000 0;
#X text 107 344 interp_bias <f>;
#X obj 166 191 cyclone/wave~ \$0-wavetable;
#X obj 166 141 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 166 164 phasor~ 440;
#X text 213 494 - endpoint in ms (default is length of array in ms), f 54;
#N canvas 625 257 741 345 sample_example 0;
#X obj 231 128 hsl 128 15 0 -0.0226757 0 0 \$0-end \$0-end-set empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 231 109 hsl 128 15 0 -0.0226757 0 0 \$0-start \$0-start-set empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X text 248 109 start point (ms);
#X text 252 128 end point (ms);
#X obj 228 200 line~;
#X msg 228 178 \$1 100;
#X obj 151 200 line~;
#X msg 151 178 \$1 100;
#X obj 75 128 bng 15 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 228 155 nbx 7 15 -1e+37 1e+37 0 0 empty \$0-end-nbx empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 151 155 nbx 7 15 -1e+37 1e+37 0 0 empty \$0-start-nbx empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 102 128 nbx 7 15 -1e+37 1e+37 0 0 empty \$0-end-nbx empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X msg 75 175 0 \, 1 \$1;
#X obj 75 200 line~;
#X obj 75 152 float;
#N canvas 358 169 432 429 load_sample 0;
#X obj 47 67 - 1;
#X obj 47 113 cyclone/sampstoms~;
#X floatatom 152 140 0 0 0 0 - - - 0;
#X obj 47 44 soundfiler;
#X obj 223 216 s \$0-start-set;
#X obj 212 240 s \$0-end-set;
#X msg 212 192 range 0 \$1;
#X obj 73 306 r \$0-start;
#X obj 162 308 r \$0-end;
#X obj 46 365 s \$0-start-set;
#X obj 152 364 s \$0-end-set;
#X text 170 330 keeps start slider before end slider;
#X obj 46 337 moses;
#X obj 125 339 moses;
#X floatatom 47 90 7 0 0 0 - - - 0;
#X text 97 90 max array index;
#X text 36 141 array length in ms;
#X obj 232 169 s \$0-ms;
#X msg 164 201 set \$1;
#X obj 183 170 t f f;
#X obj 183 265 s \$0-end-nbx;
#X obj 252 51 table \$0-sample;
#X obj 36 203 cyclone/rdiv 1000;
#X floatatom 36 229 0 0 0 0 - - - 0;
#X obj 36 258 s \$0-freq;
#X obj 47 21 cyclone/loadmess read -resize violin.wav \$0-sample;
#X text 317 228 <= set sliders;
#X text 170 345 and keeps end slider after start slider;
#X connect 0 0 14 0;
#X connect 1 1 2 0;
#X connect 2 0 19 0;
#X connect 2 0 13 1;
#X connect 2 0 22 0;
#X connect 3 0 0 0;
#X connect 6 0 5 0;
#X connect 6 0 4 0;
#X connect 7 0 12 1;
#X connect 7 0 13 0;
#X connect 8 0 12 0;
#X connect 8 0 13 1;
#X connect 12 0 9 0;
#X connect 13 1 10 0;
#X connect 14 0 1 0;
#X connect 18 0 5 0;
#X connect 19 0 18 0;
#X connect 19 0 20 0;
#X connect 19 1 17 0;
#X connect 19 1 6 0;
#X connect 22 0 23 0;
#X connect 23 0 24 0;
#X connect 25 0 3 0;
#X restore 449 29 pd load_sample;
#X obj 581 130 hsl 128 15 0 -0.0226757 0 0 \$0-end \$0-end-set empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 581 111 hsl 128 15 0 -0.0226757 0 0 \$0-start \$0-start-set empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X text 598 111 start point (ms);
#X text 602 130 end point (ms);
#X obj 578 202 line~;
#X msg 578 180 \$1 100;
#X obj 501 202 line~;
#X msg 501 180 \$1 100;
#X obj 578 157 nbx 7 15 -1e+37 1e+37 0 0 empty \$0-end-nbx empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 501 157 nbx 7 15 -1e+37 1e+37 0 0 empty \$0-start-nbx empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 75 225 cyclone/wave~ \$0-sample, f 26;
#X obj 425 227 cyclone/wave~ \$0-sample, f 26;
#X obj 425 193 phasor~;
#X obj 425 158 nbx 6 15 -1e+37 1e+37 0 0 empty \$0-freq empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 89 53 Using [wave~] to read a sample file;
#X obj 75 261 output~;
#X obj 425 263 output~;
#X connect 0 0 9 0;
#X connect 1 0 10 0;
#X connect 4 0 26 2;
#X connect 5 0 4 0;
#X connect 6 0 26 1;
#X connect 7 0 6 0;
#X connect 8 0 14 0;
#X connect 9 0 5 0;
#X connect 10 0 7 0;
#X connect 11 0 14 1;
#X connect 12 0 13 0;
#X connect 13 0 26 0;
#X connect 14 0 12 0;
#X connect 16 0 24 0;
#X connect 17 0 25 0;
#X connect 20 0 27 2;
#X connect 21 0 20 0;
#X connect 22 0 27 1;
#X connect 23 0 22 0;
#X connect 24 0 21 0;
#X connect 25 0 23 0;
#X connect 26 0 31 0;
#X connect 27 0 32 0;
#X connect 28 0 27 0;
#X connect 29 0 28 0;
#X restore 437 206 pd sample_example;
#N canvas 571 181 750 225 multichannel 0;
#X text 38 80 If more than one channel is set \, the name convention for multi channel arrays is the table name preceded by the channel number (starting from zero) and "-" \, such as: "0-" \, "1-" \, "2-" \, "3-" \, and so on...;
#X text 41 151 You can manually set multi channel arrays in Pd like that or use the [buffer~] object \, which does this internally.;
#X msg 457 152 open;
#X obj 457 184 cyclone/buffer~ stereo_\$0 stereo.aif -1 2;
#X obj 528 23 phasor~ 0.5;
#X obj 528 56 cyclone/wave~ stereo_\$0 0 2000 2, f 18;
#X text 38 28 Multi channel playback is possible (up to 64 channels) when you specify it with a 4th argument. The number of channels defines the number 'n' of outlets.;
#X obj 530 102 output~;
#X connect 2 0 3 0;
#X connect 4 0 5 0;
#X connect 5 0 7 0;
#X connect 5 1 7 1;
#X restore 448 230 pd multichannel;
#N canvas 785 97 376 358 load 0;
#X obj 77 62 loadbang;
#X obj 97 175 cnv 15 198 138 empty empty empty 20 12 0 14 #fce0c4 #404040 0;
#N canvas 0 22 450 300 (subpatch) 0;
#X array \$0-wavetable 4099 float 0;
#X coords 0 1 4098 -1 200 140 1 0 0;
#X restore 96 174 graph;
#X obj 77 117 send \$0-wavetable;
#X msg 77 91 sinesum 4096 1 0.5 0.333 0.25 \, normalize;
#X connect 0 0 4 0;
#X connect 4 0 3 0;
#X restore 268 144 pd load \; wavetable;
#X text 78 83 With a phase signal input (from 0 and 1) \, [wave~] reads a given table. It has many interpolation options and can set a start and end point in the array.;
#N canvas 637 163 575 237 tabread_example 0;
#X obj 51 118 cyclone/wave~ \$0-table;
#X obj 51 68 nbx 5 14 0 1 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 54 47 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 51 92 sig~;
#X obj 250 45 cnv 15 198 138 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#N canvas 0 22 450 278 (subpatch) 0;
#X array \$0-table 16 float 3;
#A 0 0.599999 -0.328571 -0.0857142 0.599999 -0.42857 0.271428 -0.214285 -0.285713 -0.0857142 -0.414285 -0.62857 -0.171428 0.614284 0.72857 0.42857 -0.571429;
#X coords 0 1 16 -1 200 140 1 0 0;
#X restore 249 44 graph;
#N canvas 207 34 366 264 (subpatch) 0;
#X obj 51 101 tgl 42 0 \$0-tgl-s \$0-tgl-r empty 1 8 1 9 #dcdcdc #7c7c7c #fcfcfc 0 1;
#X obj 215 68 route dsp;
#X obj 215 37 receive pd;
#N canvas 977 77 379 291 set_color 0;
#X obj 47 30 inlet;
#X obj 147 200 s \$0-cnv;
#X obj 47 83 select 0 1;
#X obj 47 220 s \$0-tgl-r;
#N canvas 0 22 712 637 off 0;
#X obj 490 220 * -1;
#X obj 424 300 +;
#X obj 409 325 +;
#X obj 347 219 * -65536;
#X obj 424 220 * -256;
#X obj 409 356 - 1;
#X obj 390 189 unpack f f f;
#X obj 225 295 +;
#X obj 210 320 +;
#X obj 148 214 * -65536;
#X obj 225 215 * -256;
#X obj 291 215 * -1;
#X obj 210 351 - 1;
#X obj 191 184 unpack f f f;
#X obj 379 423 pack;
#X msg 395 152 124 124 124;
#X msg 203 154 220 220 220;
#X obj 238 121 t b b;
#X obj 238 81 inlet;
#X obj 378 485 outlet;
#X connect 0 0 1 1;
#X connect 1 0 2 1;
#X connect 2 0 5 0;
#X connect 3 0 2 0;
#X connect 4 0 1 0;
#X connect 5 0 14 1;
#X connect 6 0 3 0;
#X connect 6 1 4 0;
#X connect 6 2 0 0;
#X connect 7 0 8 1;
#X connect 8 0 12 0;
#X connect 9 0 8 0;
#X connect 10 0 7 0;
#X connect 11 0 7 1;
#X connect 12 0 14 0;
#X connect 13 0 9 0;
#X connect 13 1 10 0;
#X connect 13 2 11 0;
#X connect 14 0 19 0;
#X connect 15 0 6 0;
#X connect 16 0 13 0;
#X connect 17 0 16 0;
#X connect 17 1 15 0;
#X connect 18 0 17 0;
#X restore 47 113 pd off;
#X msg 47 180 color \$1 \$2 0;
#X msg 147 131 -4.86997e+06 -1.34937e+07;
#X msg 147 171 color \$1 0 \$2;
#X connect 0 0 2 0;
#X connect 2 0 4 0;
#X connect 2 1 6 0;
#X connect 4 0 5 0;
#X connect 4 0 7 0;
#X connect 5 0 3 0;
#X connect 6 0 7 0;
#X connect 6 0 5 0;
#X connect 7 0 1 0;
#X restore 215 165 pd set_color;
#X obj 135 122 r \$0-tgl-s;
#N canvas 121 482 450 300 (subpatch) 0;
#X obj 101 101 cnv 25 40 25 empty \$0-cnv DSP 3 13 0 20 #dcdcdc #7c7c7c 0;
#X coords 0 -1 1 1 42 27 1 100 100;
#X restore 51 144 pd;
#X obj 226 139 s \$0-tgl-r;
#X msg 226 115 set \$1;
#X msg 135 177 \; pd dsp \$1;
#N canvas 256 32 278 194 load_check 0;
#X obj 136 53 sig~ 1;
#X obj 74 24 loadbang;
#X obj 136 86 snapshot~;
#X obj 91 52 del 5;
#X obj 136 151 outlet;
#X obj 74 103 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X obj 74 126 switch~;
#X connect 0 0 2 0;
#X connect 1 0 3 0;
#X connect 1 0 5 0;
#X connect 2 0 4 0;
#X connect 3 0 2 0;
#X connect 3 0 5 0;
#X connect 5 0 6 0;
#X restore 51 72 pd load_check;
#X connect 1 0 3 0;
#X connect 1 0 7 0;
#X connect 2 0 1 0;
#X connect 4 0 8 0;
#X connect 4 0 3 0;
#X connect 7 0 6 0;
#X connect 9 0 0 0;
#X coords 0 -1 1 1 44 72 2 50 100;
#X restore 501 28 pd;
#X text 35 19 [wave~] as a table reader;
#X text 112 66 <= index;
#X text 52 196 table value;
#X obj 51 147 cyclone/snapshot~ 1;
#X obj 51 174 nbx 7 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X connect 0 0 10 0;
#X connect 1 0 3 0;
#X connect 2 0 1 0;
#X connect 3 0 0 0;
#X connect 10 0 11 0;
#X restore 431 182 pd tabread_example;
#X text 64 179 as a wavetable oscillator ====>, f 17;
#X text 213 433 - the specified portion of the given wavetable channel;
#X text 213 328 - set inpterpolation modes <0-7> (see details above), f 54;
#X text 213 344 - hermite interpolation bias (default 0), f 54;
#X text 213 360 - hermite interpolation tension (default 0), f 54;
#X text 213 296 - phase signal to read the array (values from 0-1);
#N canvas 688 268 450 300 related 0;
#X obj 253 117 tabosc4~;
#X obj 253 160 tabread4~;
#X obj 253 139 tabread~;
#X obj 60 106 cyclone/cycle~;
#X obj 60 134 cyclone/lookup~;
#X obj 60 164 cyclone/play~;
#X restore 226 573 pd related;
#X text 176 534 @interp <f> (interpolation mode \, default 1: linear);
#X text 146 549 @interp_bias <f> (default 0) | @interp_tension <f> (default 0), f 63;
#X text 213 460 - array name (required), f 54;
#X text 213 511 - number of output channels (max 64) - default 1;
#X obj 166 224 output~;
#X obj 2 3 ./header wave~;
#X text 22 61 Wavetable reader;
#X obj 23 250 declare -stdpath ./;
#X connect 26 0 46 0;
#X connect 27 0 28 0;
#X connect 28 0 26 0;
