-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcontour-help.pd
333 lines (333 loc) · 13.8 KB
/
contour-help.pd
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
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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
#N struct 3012-big2 float x float y array 3012-array2 ^&*-dsmall2;
#N struct ^&*-dsmall2 float x float y symbol onoff;
#N struct 3012-big1 float x float y array 3012-array1 ^&*-dsmall1;
#N struct ^&*-dsmall1 float x float y symbol onoff;
#N struct 3117-big2 float x float y array 3117-array2 ^&*-dsmall2;
#N struct 3117-big1 float x float y array 3117-array1 ^&*-dsmall1;
#N struct 3165-big2 float x float y array 3165-array2 ^&*-dsmall2;
#N struct 3165-big1 float x float y array 3165-array1 ^&*-dsmall1;
#N struct 3216-big2 float x float y array 3216-array2 ^&*-dsmall2;
#N struct 3216-big1 float x float y array 3216-array1 ^&*-dsmall1;
#N struct 3270-big1 float x float y array 3270-array1 ^&*-dsmall1;
#N struct 3324-big2 float x float y array 3324-array2 ^&*-dsmall2;
#N struct 3324-big1 float x float y array 3324-array1 ^&*-dsmall1;
#N struct 3375-big2 float x float y array 3375-array2 ^&*-dsmall2;
#N struct 3375-big1 float x float y array 3375-array1 ^&*-dsmall1;
#N struct 3427-big2 float x float y array 3427-array2 ^&*-dsmall2;
#N struct 3427-big1 float x float y array 3427-array1 ^&*-dsmall1;
#N struct 4142-big2 float x float y array 4142-array2 ^&*-dsmall2;
#N struct 4142-big1 float x float y array 4142-array1 ^&*-dsmall1;
#N canvas 67 145 860 592 10;
#X obj 241 343 contour :x 227 :y 109 point1 0.310259 0.588334 0.669604
0.551637 point2 0.0682824 0.766055 0.466961 0.32674 0.842669 0.767106
:name mycurve;
#X obj 175 23 cnv 15 202 72 empty empty empty 20 12 0 14 -99865 -66577
0;
#X obj 170 18 cnv 15 202 72 empty empty empty 20 12 0 14 -1 -66577
0;
#X obj 171 19 cnv 15 200 70 empty empty contour 23 26 1 41 -203565
-66577 0;
#X msg 241 257 end 1;
#X msg 311 257 end -1;
#X floatatom 477 293 5 0 0 0 - - -;
#X obj 477 314 tabread mycurve;
#X obj 477 345 vsl 15 104 0 1 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 0 1;
#X obj 32 348 cnv 15 192 72 empty empty empty 20 12 0 14 -99865 -66577
0;
#X obj 27 343 cnv 15 192 72 empty empty empty 20 12 0 14 -1 -66577
0;
#X obj 28 344 cnv 15 190 70 empty empty empty 20 12 0 14 -249809 -66577
0;
#X text 35 351 click and move the points around the canvas to see how
the curve changes -->, f 25;
#X obj 14 254 cnv 15 222 57 empty empty empty 20 12 0 14 -99865 -66577
0;
#X obj 9 249 cnv 15 222 57 empty empty empty 20 12 0 14 -1 -66577 0
;
#X obj 10 250 cnv 15 220 55 empty empty empty 20 12 0 14 -76543 -66577
0;
#X obj 523 258 cnv 15 202 52 empty empty empty 20 12 0 14 -99865 -66577
0;
#X obj 518 253 cnv 15 202 52 empty empty empty 20 12 0 14 -1 -66577
0;
#X obj 519 254 cnv 15 200 50 empty empty empty 20 12 0 14 -76543 -66577
0;
#X text 526 256 read array contents easily using tabread objects <-----
, f 27;
#X obj 522 362 cnv 15 202 102 empty empty empty 20 12 0 14 -99865 -66577
0;
#X obj 517 357 cnv 15 202 102 empty empty empty 20 12 0 14 -1 -66577
0;
#X obj 518 358 cnv 15 200 100 empty empty empty 20 12 0 14 -76543 -66577
0;
#X text 536 365 Contour autosaves \, so whatever you draw will reappear
the next time you open the patch. Just press Ctrl + S !, f 23;
#X obj 154 88 cnv 15 15 15 empty \$0-banner ~~.~~.~~.~~.~~.~~.~~.~~.
20 12 0 14 -262144 -66577 0;
#X obj 159 -2 cnv 15 15 15 empty \$0-banner ~~.~~.~~.~~.~~.~~.~~.~~.
20 12 0 14 -262144 -66577 0;
#N canvas 67 89 450 300 annimate 0;
#X obj 100 100 tgl 10 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X obj 100 120 metro 100;
#X obj 100 144 f;
#X obj 100 168 + 1;
#X obj 100 192 mod 3;
#X obj 100 216 sel 0 1 2;
#X msg 100 290 label .~~.~~.~~.~~.~~.~~.~~.~~;
#X msg 120 265 label ~~.~~.~~.~~.~~.~~.~~.~~.;
#X msg 140 241 label ~.~~.~~.~~.~~.~~.~~.~~.~;
#X obj 115 341 s \$0-banner;
#X obj 100 74 loadbang;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 2 1;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X connect 5 1 7 0;
#X connect 5 2 8 0;
#X connect 6 0 9 0;
#X connect 7 0 9 0;
#X connect 8 0 9 0;
#X connect 10 0 0 0;
#X coords 0 -1 1 1 10 10 2 100 100;
#X restore 383 5 pd annimate;
#X obj 13 155 cnv 15 672 72 empty empty empty 20 12 0 14 -1 -66577
0;
#X obj 14 156 cnv 15 670 70 empty empty empty 20 12 0 14 -257985 -66577
0;
#X obj 15 157 cnv 15 668 68 empty empty empty 20 12 0 14 -1 -66577
0;
#X obj 16 158 cnv 15 666 66 empty empty empty 20 12 0 14 -262144 -66577
0;
#X obj 158 103 cnv 15 15 15 empty empty an advanced interface for drawing arrays
20 12 0 14 -262144 -66577 0;
#X text 34 158 [contour] is a tool which helps you draw precise functions
into the PD array object. Contour can draw straight lines \, Bezier
curves and cusom formulas \, useful for creating envelopes and waveforms.
Contour can draw functions to a very high degree of complexity \, but
because the values are stored in an array \, playback is relatively
cheap., f 89;
#X text 172 21 ( ) ( ), f 2;
#X text 351 21 ) ( ) (, f 2;
#N canvas 203 104 633 587 (subpatch) 0;
#X obj 40 146 contour point1 0.679688 0.927681 point2 0.0937505 0.928374
;
#X text 133 241 Contour's options are:;
#X text 34 523 *Under some conditions \, curves which are defined by
a high number of Bezier points may distort. Error correction fixes
this \, at the cost of using slightly more CPU.;
#X text 176 139 Contour has a variety of options controlling its behaviour.
To access the options \, right click on any contour object and select
"properties". A menu window will appear with all the relevant options.
To get rid of the window \, press the ^ button in the upper left \,
or simply delete the object. You can also choose a condensed menu by
clicking on the '()' button \, which will give you a smaller dialogue
to create and destroy points., f 62;
#X text 39 266 point1 : ADD OR REMOVE END POINTS FROM THE CANVAS \;
point2 : ADD OR REMOVE CURVE (BEZIER) POINTS FROM THE CANVAS \; x :
set the x-axis (in pixels) \; y : set the y-axis (in pixels) \; time
: define the time in ms for playback with "bang" messages) \; colour
: define the colour of the canvas \; scale : scale the y sensitivity
of Bezier points \; name : define the name of the array \; size : define
the size of the array (in points) \; yu : define the upper limit of
the array \; yl : define the lower limit of the array \; speed : define
how fast the array refreshes when the points are moved \; duplicate
: create a duplicate of the defined shape in the array \; mirror-x
: flip the copy along the x-axis \; mirror-y : flip the copy along
the y-axis \; ec : turn error correction on* \; lock : prevent end
points from moving past one another \; name2 : add \$0 to the array
name, f 74;
#X restore 54 452 options;
#N canvas 213 183 762 514 (subpatch) 0;
#X obj 221 161 contour point1 0.0390625 0.923652 0.226564 0.771372
point2 0.71875 0.80535 :color -232491 :time 1500;
#X obj 68 356 *~;
#X obj 68 410 dac~;
#X obj 173 30 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X floatatom 28 235 5 0 0 0 - - -;
#X obj 28 304 tabread4~ waveform;
#X obj 28 256 phasor~ 440;
#X obj 227 321 contour point1 0.374999 0.903158 0.570312 0.850479 0.820312
0.907907 point2 0.0625005 0.922591 0.328126 0.809553 0.664062 0.918938
:name waveform :color -232617 :duplicate 1 :mirror-x 1;
#X obj 28 280 *~ 256;
#X obj 221 89 nbx 5 14 -1e+37 1e+37 0 1 empty empty empty 0 -8 0 10
-262144 -1 -1 1500 256;
#X msg 221 108 time \$1;
#X text 164 304 <----->;
#X text 198 24 A bang message to the first inlet plays the array through
the first outlet~ in a given amount of time. This is useful for creating
envelopes. The default time duration is 1000ms \, but this can be changed
using the "time" setting.;
#X text 369 176 <--play with the points to change the envelope!, f
31;
#X text 499 386 <--play with the points to change the waveform!, f
31;
#X obj 96 70 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1
;
#X obj 96 90 metro 2000;
#X obj 593 92 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X msg 593 112 \; pd dsp \$1;
#X text 298 246 This contour has the "duplicate" and "mirror-x" settings
on (see "settings") \, so you can draw both sides of the waveform at
once. Here the array is being read by [tabread4~ waveform]., f 49
;
#X connect 0 0 1 1;
#X connect 1 0 2 0;
#X connect 1 0 2 1;
#X connect 3 0 0 0;
#X connect 4 0 6 0;
#X connect 5 0 1 0;
#X connect 6 0 8 0;
#X connect 8 0 5 0;
#X connect 9 0 10 0;
#X connect 10 0 0 0;
#X connect 15 0 16 0;
#X connect 16 0 0 0;
#X connect 17 0 18 0;
#X restore 53 481 playback;
#N canvas 271 95 584 571 formulas 0;
#X text 16 17 Contour has some hidden inlet and outlets which are used
for defining custom formulas along the array. There are as many inlet
/ outlet pairs as there are "sections" of the curve. Sections are defined
by the grey end points \, so a contour with 3 end points will have
4 sections and consequently 4 extra in/outlets \, regardless of how
many brown curve points there are.;
#X msg 157 281 0;
#X obj 67 182 contour point1 0.179688 0.892067 0.351562 0.718824 0.679688
0.723819;
#X obj 37 305 s c1;
#X obj 97 305 s c2;
#X obj 37 281 pow 0.5;
#X obj 157 305 s c3;
#X obj 198 281 pow 2;
#X obj 198 305 s c4;
#X obj 85 143 r c1;
#X obj 121 143 r c2;
#X obj 157 143 r c3;
#X obj 193 143 r c4;
#X obj 97 281 pow 0.5;
#X text 23 346 Custom formulas work like this: when the given section
of the curve is redrawn \, the outlet will receive a line of numbers
between 0 and 1 These numbers can be processed in any way and then
sent back to the inlet \, where they will be transposed onto the original
coordinates.;
#X text 253 152 The in/outlets can be tricky to find \, since they
are not visible on the canvas. You can connect the cables directly
without using [send] and [receive] \, but you're on your own when it
comes to hiding them behind the canvas., f 26;
#X obj 31 522 contour :x 211 :y 118 point1 0.389007 0.805192 0.933649
0.644068 point2 0.560499 0.203647 :name first :color -232379;
#X text 21 446 You can have a lot of fun with custom formulas! Here
are some examples using [expr].;
#X obj 99 652 expr 0.2 * sin($f1*28) + $f1;
#X obj 99 676 s cc1;
#X obj 99 493 r cc1;
#X obj 61 864 contour :x 169 :y 103 point1 0.229523 0.250483 0.601162
0.763536 point2 0.0458838 0.599451 0.857988 0.631047 :name second :color
-65491 :duplicate 1 :mirror-x 1 :mirror-y 1;
#X obj 169 1179 expr first [$f1*120];
#X obj 167 690 t b f;
#X obj 167 713 random 100;
#X obj 167 737 expr ($f1 * 0.001 + $f2);
#X text 314 649 <--- draw a sine wave with four peaks between two points
, f 24;
#X text 24 734 draw some static-->;
#X obj 167 761 s cc2;
#X obj 167 493 r cc2;
#X obj 169 833 r cc3;
#X obj 169 1203 s cc3;
#X text 63 1288 Note: the interaction between Bezier curves and custom
formulas is unknown!, f 44;
#X text 290 805 Here \, duplicate \, mirror-x and mirror-y settings
are all on to help draw the waveform, f 30;
#X text 321 1179 <---copy all of the first array between two points
, f 27;
#X connect 1 0 6 0;
#X connect 2 1 5 0;
#X connect 2 2 13 0;
#X connect 2 3 1 0;
#X connect 2 4 7 0;
#X connect 5 0 3 0;
#X connect 7 0 8 0;
#X connect 9 0 2 1;
#X connect 10 0 2 2;
#X connect 11 0 2 3;
#X connect 12 0 2 4;
#X connect 13 0 4 0;
#X connect 16 1 18 0;
#X connect 16 2 23 0;
#X connect 18 0 19 0;
#X connect 20 0 16 1;
#X connect 21 2 22 0;
#X connect 22 0 31 0;
#X connect 23 0 24 0;
#X connect 23 1 25 1;
#X connect 24 0 25 0;
#X connect 25 0 28 0;
#X connect 29 0 16 2;
#X connect 30 0 21 2;
#X restore 53 537 custom formulas;
#X text 17 254 add or remove an end point ->;
#X msg 241 284 curve 1;
#X msg 311 284 curve -1;
#X obj 546 13 ctxfiles/license;
#X text 310 504 Thanks to https://pomax.github.io/bezierinfo/ for teaching
me how to create Bezier curves!;
#N canvas 397 284 450 453 (subpatch) 0;
#X obj 149 93 contour point1 0.273438 0.701634 point2 0.820312 0.702523
:name shift;
#X text 16 10 You can shift only the x-dimension of a point. To do
this \, simply hold down the left/right arrow keys and move a point.
Similarly \, you can shift only the y-dimension by holding down the
up/down keys.;
#X text 14 190 LIMITATION: The arrow keys stop the x/y component of
the curve from updating \, not the point from moving. This mean that
there can be some misalignment between the curve and the point. This
can create problems when saving a patch: on loading \, the curve will
jump to the actual position of the point \, which may differ from the
point you left it at \, if you were using x/y shifting.;
#X text 13 306 Two other key features (native to PD data structures):
;
#X text 13 332 --You can move multiple points at once using the Shift
key. When the Shift key is pressed \, the mouse will drag the selected
point and every point created after it.;
#X text 11 376 --You can create or destroy points by holding down the
Control key. However \, this is not as reliable as creating or destroying
points using the properties menu.;
#X restore 53 509 shifting;
#X text 10 281 add or remove a curve point ->;
#X obj 528 560 else/openfile coord-help.pd -h See also: [coord];
#X text 308 66 v1.4;
#N canvas 737 353 450 344 contour 0;
#X obj 116 163 context :H 18 :X 13 :Y 9 :d 5 :n ' me ' :Z 10 :ID 1
:ol 1 18 obj 12 44 contour :x 116 :y 40 :size 117 point1 0.181034 0.7
0.784483 0.65 point2 0.301724 0.025 4 obj 0 -20 mover 6 obj 87 4 ctxfiles/sketch-properties
7570 1 5 obj 140 134 cyclone/Snapshot~ 50 5 obj 140 163 s tovsl 5 connect
3 0 6 0 5 connect 5 0 3 0 5 connect 6 0 7 0;
#X obj 282 173 vsl 15 100 0 1 0 0 empty tovsl empty 0 -9 0 10 -262144
-1 -1 0 1;
#X text 57 27 You can embed a [content] array inside of Context. This
works much the same way as with [content]: the array will play back
in time with the cursor out of the hidden outlet~. You can also move
and resize the [content] array using [mover].;
#X obj 80 101 else/openfile mover-help.pd -h See the helpfile on [mover]
;
#X obj 80 118 else/openfile helpfiles/links/embedding.html -h See the
Context Manual entry on embedding;
#X text 46 294 Note: DSP must be turned on for this example to work.
;
#X msg 340 223 \; pd dsp 1;
#X restore 52 566 embedding contour in context;
#X connect 4 0 0 0;
#X connect 5 0 0 0;
#X connect 6 0 7 0;
#X connect 7 0 8 0;
#X connect 39 0 0 0;
#X connect 40 0 0 0;