-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray-read6h-help.pd
More file actions
78 lines (78 loc) · 3.06 KB
/
array-read6h-help.pd
File metadata and controls
78 lines (78 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#N canvas 614 86 1040 490 10;
#X obj 653 34 loadbang;
#N canvas 0 22 450 278 (subpatch) 0;
#X array array-read6h-dirac 9 float 2;
#X coords 0 1 9 -1 100 70 1 0 0;
#X restore 512 37 graph;
#X obj 403 198 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 403 260 t f f;
#X obj 403 314 + 1;
#X floatatom 826 292 5 0 0 0 - - -, f 5;
#X floatatom 826 387 0 0 0 0 - - -;
#X obj 93 198 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 93 260 t f f;
#X obj 93 324 + 1;
#N canvas 104 443 1026 855 graphs 1;
#N canvas 0 22 450 278 (subpatch) 0;
#X array array-read6-lagrange 500 float 2;
#X coords 0 1 500 -1 500 300 1 0 0;
#X restore 84 61 graph;
#N canvas 0 22 450 278 (subpatch) 0;
#X array array-read6h-hermite 500 float 2;
#X coords 0 1 500 -1 500 300 1 0 0;
#X restore 84 441 graph;
#X text 621 115 Pd's cubic interpolation uses a Lagrange (la-GRANZH)
interpolator. While it offers very good performance with minimal distortion
\, as you can see on the left (after you run the routines on the main
help patch) \, its first derivative has discontinuities. This is seen
in the sharp corners at the break points \, especially at the peak.
On the other hand \, the second derivative is matched at the breakpoints.
Csound also uses a Lagrange interpolator in routines employing cubic
interpolation., f 54;
#X text 621 485 An Hermite (air-MEET) interpolator still provides cubic
interpolation \, but instead of trying to find a polynomial that matches
the four control points like Lagrange \, it matches the two inner control
points and uses the four points to match the approximate first derivative
\, ensuring that the first derivative is the same at each break point.
This removes the sharp corners. On the other hand \, the second derivative
is not matched at the breakpoints \, which can produce a discontinuity
of inflection at breakpoints \, which is visible at the zero-crossings
of the example whose source has several impulses. Supercollider uses
an Hermite interpolator in routines employing cubic interpolation.
, f 54;
#X restore 511 130 pd graphs;
#X text 583 133 <- open!;
#X obj 93 297 * 0.012;
#X obj 403 287 * 0.012;
#X obj 46 361 array-read6 array-read6h-dirac;
#X obj 356 361 array-read6h array-read6h-dirac;
#X obj 159 419 tabwrite array-read6-lagrange;
#X obj 469 419 tabwrite array-read6h-hermite;
#X msg 653 103 \; array-read6h-dirac 0 0 0.95 0 -0.95 0 0.95 0 -0.95
0;
#X obj 403 234 array-iterator array-read6h-hermite;
#X obj 93 234 array-iterator array-read6-lagrange;
#X text 22 20 array-read6h: [array-read6] with Hermite interpolation
\; Positive index range is 2 to n-3 \; Negative index range is -3 to
-n+2;
#X msg 653 61 \; array-read6h-dirac 0 0 0 0 0 0.95 0 0 0 0;
#X obj 826 341 array-read6h array-read6h-dirac;
#X connect 0 0 22 0;
#X connect 2 0 19 0;
#X connect 3 0 13 0;
#X connect 3 1 17 1;
#X connect 4 0 15 0;
#X connect 5 0 23 0;
#X connect 7 0 20 0;
#X connect 8 0 12 0;
#X connect 8 1 16 1;
#X connect 9 0 14 0;
#X connect 12 0 9 0;
#X connect 13 0 4 0;
#X connect 14 0 16 0;
#X connect 15 0 17 0;
#X connect 19 0 3 0;
#X connect 20 0 8 0;
#X connect 23 0 6 0;