splines.pd 4.83 KB
Newer Older
1
#N struct splines float x float y float qmid float c1 float c2;
2
#N canvas 480 58 700 527 10;
3
#X scalar splines 92 86 2.7957 174.445 329.234 \;;
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
#X floatatom 311 161 5 0 0 0 - - -, f 5;
#N canvas 253 138 810 446 (subpatch) 0;
#X obj 129 -207 draw path M 75 qmid h 10 m -5 -5 v 10;
#X obj 129 -462 loadbang;
#X obj 129 -392 loadbang;
#X obj 129 -322 loadbang;
#X obj 129 -279 draw path M 15 100 h 10 m -5 -5 v 10;
#X msg 129 -301 stroke red;
#X obj 129 -252 loadbang;
#X obj 129 -152 loadbang;
#X msg 129 -131 stroke red;
#X obj 129 -109 draw path M 135 100 h 10 m -5 -5 v 10;
#X obj 449 -462 loadbang;
#X obj 449 -392 loadbang;
#X obj 449 -322 loadbang;
#X obj 449 -276 draw path M 15 250 h 10 m -5 -5 v 10;
#X msg 449 -301 stroke red;
#X obj 449 -252 loadbang;
#X obj 679 -252 loadbang;
#X obj 449 -152 loadbang;
#X msg 449 -131 stroke red;
#X obj 449 -109 draw path M 135 250 h 10 m -5 -5 v 10;
#X text 167 -490 Quadratic spline;
#X text 530 -490 Cubic spline;
#X obj 129 -419 draw path M 20 100 L 80 qmid 140 100;
#X obj 129 -349 draw path M 20 100 Q 80 qmid 140 100;
#X obj 449 -209 draw path M 55 c1 h 10 m -5 -5 v 10;
#X obj 679 -210 draw path M 95 c2 h 10 m -5 -5 v 10;
#X obj 449 -418 draw path M 20 250 L 60 c1 100 c2 140 250;
#X obj 449 -351 draw path M 20 250 C 60 c1 100 c2 140 250;
34
35
36
37
#X msg 129 -441 stroke blue \, stroke-width 1 \, fill none;
#X msg 129 -371 stroke black \, stroke-width 3 \, fill none;
#X msg 449 -441 stroke blue \, stroke-width 1 \, fill none;
#X msg 449 -371 stroke black \, stroke-width 3 \, fill none;
38
39
40
41
42
43
44
45
46
47
48
49
#X obj 129 -186 outlet;
#X obj 449 -188 outlet;
#X obj 679 -189 outlet;
#X msg 129 -231 stroke red \, mousedown 1 \, drag 1;
#X msg 449 -231 stroke red \, mousedown 1 \, drag 1;
#X msg 679 -231 stroke red \, mousedown 1 \, drag 1;
#X connect 0 0 32 0;
#X connect 1 0 28 0;
#X connect 2 0 29 0;
#X connect 3 0 5 0;
#X connect 5 0 4 0;
#X connect 6 0 35 0;
50
51
#X connect 7 0 8 0;
#X connect 8 0 9 0;
52
53
#X connect 10 0 30 0;
#X connect 11 0 31 0;
Ivica Bukvic's avatar
Ivica Bukvic committed
54
55
#X connect 12 0 14 0;
#X connect 14 0 13 0;
56
57
#X connect 15 0 36 0;
#X connect 16 0 37 0;
58
#X connect 17 0 18 0;
59
60
61
62
63
64
65
66
67
68
#X connect 18 0 19 0;
#X connect 24 0 33 0;
#X connect 25 0 34 0;
#X connect 28 0 22 0;
#X connect 29 0 23 0;
#X connect 30 0 26 0;
#X connect 31 0 27 0;
#X connect 35 0 0 0;
#X connect 36 0 24 0;
#X connect 37 0 25 0;
69
#X restore 311 205 draw group;
Ivica Bukvic's avatar
Ivica Bukvic committed
70
#X obj 309 93 struct splines float x float y float qmid float c1 float
71
c2;
72
#X text 272 394 <- Click-drag the inner red crosses to change the y-value
73
of the lines and curves.;
74
#X text 363 161 <- works when transformed \, too;
Ivica Bukvic's avatar
Ivica Bukvic committed
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#N canvas 890 193 450 300 sfx~ 0;
#X obj 109 51 inlet;
#X obj 109 71 b;
#X obj 109 253 *~;
#X obj 109 207 line~;
#X msg 109 162 1 10;
#X msg 157 183 0 10;
#X obj 156 162 del 10;
#X obj 203 216 osc~ 330;
#X msg 218 129 330;
#X obj 203 162 f;
#X obj 218 108 del 400;
#X obj 109 295 outlet~;
#X obj 203 183 + 0.25;
#X obj 109 274 *~ 0.2;
#X connect 0 0 1 0;
#X connect 1 0 4 0;
#X connect 1 0 6 0;
#X connect 1 0 9 0;
#X connect 1 0 10 0;
#X connect 2 0 13 0;
#X connect 3 0 2 0;
#X connect 4 0 3 0;
#X connect 5 0 3 0;
#X connect 6 0 5 0;
#X connect 7 0 2 1;
#X connect 8 0 9 1;
#X connect 9 0 12 0;
#X connect 10 0 8 0;
#X connect 12 0 9 1;
#X connect 12 0 7 0;
#X connect 13 0 11 0;
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#X restore 449 265 pd sfx~;
#X obj 449 286 output~;
#X msg 311 182 transform rotate \$1 80 150;
#N canvas 433 184 450 300 quadratic 0;
#X obj 86 64 route drag;
#X obj 233 109 unpack p;
#X obj 116 135 get splines qmid;
#X obj 86 160 +;
#X obj 86 181 set splines qmid;
#X obj 86 85 trigger anything anything;
#X obj 86 42 inlet;
#X msg 86 135 \$5;
#X connect 0 0 5 0;
#X connect 1 0 2 0;
#X connect 1 0 4 1;
#X connect 2 0 3 1;
#X connect 3 0 4 0;
#X connect 5 0 7 0;
#X connect 5 1 1 0;
#X connect 6 0 0 0;
#X connect 7 0 3 0;
#X restore 311 277 pd quadratic;
#N canvas 433 184 450 300 cubic-c1 0;
#X obj 86 64 route drag;
#X obj 233 109 unpack p;
#X obj 86 160 +;
#X obj 86 85 trigger anything anything;
#X obj 86 42 inlet;
#X obj 116 135 get splines c1;
#X obj 86 181 set splines c1;
#X msg 86 135 \$5;
#X connect 0 0 3 0;
#X connect 1 0 5 0;
#X connect 1 0 6 1;
#X connect 2 0 6 0;
#X connect 3 0 7 0;
#X connect 3 1 1 0;
#X connect 4 0 0 0;
#X connect 5 0 2 1;
#X connect 7 0 2 0;
#X restore 325 257 pd cubic-c1;
#N canvas 433 184 450 300 cubic-c2 0;
#X obj 86 64 route drag;
#X obj 233 109 unpack p;
#X obj 86 160 +;
#X obj 86 85 trigger anything anything;
#X obj 86 42 inlet;
#X obj 116 135 get splines c2;
#X obj 86 181 set splines c2;
#X msg 86 135 \$5;
#X connect 0 0 3 0;
#X connect 1 0 5 0;
#X connect 1 0 6 1;
#X connect 2 0 6 0;
Ivica Bukvic's avatar
Ivica Bukvic committed
161
#X connect 3 0 7 0;
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#X connect 3 1 1 0;
#X connect 4 0 0 0;
#X connect 5 0 2 1;
#X connect 7 0 2 0;
#X restore 339 237 pd cubic-c2;
#X obj 449 242 route drag;
#X connect 1 0 8 0;
#X connect 2 0 9 0;
#X connect 2 0 12 0;
#X connect 2 1 10 0;
#X connect 2 1 12 0;
#X connect 2 2 11 0;
#X connect 2 2 12 0;
#X connect 6 0 7 0;
#X connect 8 0 2 0;
#X connect 12 0 6 0;