/
coord-help.pd
262 lines (262 loc) · 9.72 KB
/
coord-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
#N struct 26054-big2 float x float y array 26054-array2 ^&*-dsmall2
;
#N struct ^&*-dsmall2 float x float y symbol onoff;
#N struct 26054-big1 float x float y array 26054-array1 ^&*-dsmall1
;
#N struct ^&*-dsmall1 float x float y symbol onoff;
#N struct 26161-big2 float x float y array 26161-array2 ^&*-dsmall2
;
#N struct 26161-big1 float x float y array 26161-array1 ^&*-dsmall1
;
#N canvas 67 93 765 616 10;
#X obj 33 26 cnv 15 152 42 empty empty empty 20 12 0 14 -99865 -66577
0;
#X obj 28 21 cnv 15 152 42 empty empty empty 20 12 0 14 -1 -66577 0
;
#X obj 29 22 cnv 15 150 40 empty empty coord 10 20 2 50 -2244 -262144
0;
#X obj 473 8 ctxfiles/license;
#X text 19 90 [coord] is a special slider that "grips" and lets you
move individual points on a [contour] array. There are three main reasons
you might want to do this:;
#N canvas 67 89 659 490 example 0;
#X obj 437 231 phasor~;
#X obj 437 254 *~ 255;
#X obj 389 354 *~;
#X obj 389 376 dac~;
#X obj 421 354 hsl 128 15 0 1 0 0 empty empty volume 4 7 0 10 -262144
-1 -1 0 1;
#N canvas 543 199 450 491 circle 0;
#X obj 167 100 tgl 18 1 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 167 190 f;
#X obj 167 213 t f f f;
#X obj 167 323 sin;
#X obj 167 346 * 20;
#X obj 167 369 + 40;
#X msg 167 392 \; help- p1-x \$1;
#X obj 200 306 * 20;
#X obj 200 329 + 40;
#X obj 200 283 cos;
#X msg 200 352 \; help- p1-y \$1;
#X obj 167 167 metro 50;
#X obj 206 237 + 0.01;
#X connect 0 0 11 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 2 1 9 0;
#X connect 2 2 12 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X connect 7 0 8 0;
#X connect 8 0 10 0;
#X connect 9 0 7 0;
#X connect 11 0 1 0;
#X connect 12 0 1 1;
#X coords 0 -1 1 1 85 18 1 100 100;
#X restore 527 118 pd circle;
#N canvas 604 174 450 519 random 0;
#X obj 167 100 tgl 18 1 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X msg 194 147 stop;
#X obj 167 123 sel 1;
#X obj 131 183 t b b b;
#X obj 35 316 random 100;
#X obj 35 339 pack;
#X obj 150 316 random 100;
#X obj 150 339 pack;
#X obj 170 262 t f f f;
#X obj 170 209 random 5000;
#X obj 209 286 del;
#X msg 35 363 \; help- p2-x \$1 \$2;
#X msg 150 363 \; help- p2-y \$1 \$2;
#X obj 170 232 + 800;
#X connect 0 0 2 0;
#X connect 1 0 10 0;
#X connect 2 0 3 0;
#X connect 2 1 1 0;
#X connect 3 0 4 0;
#X connect 3 1 6 0;
#X connect 3 2 9 0;
#X connect 4 0 5 0;
#X connect 5 0 11 0;
#X connect 6 0 7 0;
#X connect 7 0 12 0;
#X connect 8 0 5 1;
#X connect 8 1 7 1;
#X connect 8 2 10 0;
#X connect 9 0 13 0;
#X connect 10 0 3 0;
#X connect 13 0 8 0;
#X coords 0 -1 1 1 85 18 1 100 100;
#X restore 527 140 pd random;
#X obj 410 187 nbx 5 14 -1e+37 1e+37 0 1 empty empty pitch 0 -8 0 10
-262144 -1 -1 85 256;
#X obj 410 206 t f f;
#X obj 388 278 phasor~;
#X obj 388 301 *~ 255;
#X obj 388 254 * 1.5;
#X obj 437 278 tabread4~ wave;
#X obj 389 325 tabread4~ wave;
#X obj 82 182 contour point1 0.451174 0.521572 point2 0.204918 0.14924
0.859375 0.753165 :name wave :color -1.47304e+07 :duplicate 1 :mirror-x
1 :mirror-y 1;
#X obj 82 128 coord wave x p2 help;
#X obj 82 148 coord wave x p1 help;
#X obj 58 184 coord wave y p1 help;
#X obj 36 184 coord wave y p2 help;
#X text 349 129 turn on automation here -->;
#X text 555 353 <--volume here;
#X text 47 11 This example uses two pairs of [coord] to control the
points on a [contour] array. The [contour] has its "duplicate" \, "mirror-x"
and "mirror-y" settings turned on \, so the waveform is completed symmetrically.
Positions are sent to the [coord] objects from the two subpatches on
the right.;
#X obj 40 128 coord-index wave p2 0 0;
#X obj 60 148 coord-index wave p1 0 2;
#X connect 0 0 1 0;
#X connect 1 0 12 0;
#X connect 2 0 3 0;
#X connect 2 0 3 1;
#X connect 4 0 2 1;
#X connect 7 0 8 0;
#X connect 8 0 11 0;
#X connect 8 1 0 0;
#X connect 9 0 10 0;
#X connect 10 0 13 0;
#X connect 11 0 9 0;
#X connect 12 0 2 0;
#X connect 13 0 2 0;
#X restore 563 571 automation example;
#X obj 8 154 cnv 15 679 217 empty empty empty 20 12 0 14 -1 -66577
0;
#X obj 9 155 cnv 15 677 215 empty empty empty 20 12 0 14 -241291 -66577
0;
#X obj 11 157 cnv 15 673 211 empty empty empty 20 12 0 14 -1 -66577
0;
#X obj 12 158 cnv 15 671 209 empty empty empty 20 12 0 14 -261689 -66577
0;
#X obj 221 211 contour point1 0.122951 0.767123 0.6875 0.436709 point2
0.286885 0.386076 :name env;
#X obj 202 211 coord env y gr;
#X obj 221 294 coord env x gr;
#X text 354 235 <-- this is;
#X text 355 291 <-- this is also [coord];
#X text 45 234 this is [coord] -->;
#X text 45 311 It tells you which point is selected., f 21;
#X obj 16 447 cnv 15 390 155 empty empty empty 20 12 0 14 -99865 -66577
0;
#X obj 11 442 cnv 15 390 155 empty empty empty 20 12 0 14 -1 -66577
0;
#X obj 12 443 cnv 15 388 153 empty empty empty 20 12 0 14 -261689 -66577
0;
#X text 30 458 [coord] is quite easy to use. By moving the slider \,
you will move the x- or y-axis of whichever point is selected.;
#X text 29 509 To select another point \, hold down the Control or
Command key and then move the slider. Instead of moving the point \,
the slider will "grip" to the nearest point.;
#X obj 18 402 cnv 15 82 32 empty empty empty 20 12 0 14 -99865 -66577
0;
#X obj 13 397 cnv 15 82 32 empty empty empty 20 12 0 14 -1 -66577 0
;
#X obj 14 398 cnv 15 80 30 empty empty use 18 10 2 32 -208320 -66577
0;
#X obj 568 402 cnv 15 122 32 empty empty empty 20 12 0 14 -99865 -66577
0;
#X obj 563 397 cnv 15 122 32 empty empty empty 20 12 0 14 -1 -66577
0;
#X obj 564 398 cnv 15 120 30 empty empty setup 24 10 2 32 -208320 -66577
0;
#N canvas 67 87 455 558 arguments 0;
#X text 46 37 [coord] has 5 arguments \, but the last 2 are optional.
;
#X text 104 66 1: ARRAY NAME. This must correspond with the name of
the [contour] array \, which is visible just above the object. Note
that the default name isn't a very good option \, which it resets every
time the patch is loaded (\$0). So it is best to name the [contour]
array using the "name" command or the properties menu (see contour-help.pd).
, f 49;
#X text 104 167 2: x or y. This indicates whether you want a vertical
or a horizontal [coord] object. You must enter the character "x" or
the character "y" as the second argument., f 49;
#X text 104 227 3: label. This is a custom symbol which is used to
identify the slider. It is best to keep the label short in case the
text falls outside the display area. If you are using a pair of [coord]
objects to control the x- and y-axis \, then give them the same label
so that they can communicate with each other., f 49;
#X text 104 372 5: time grain for line input (see "input"). Defaults
to 100 if left blank., f 49;
#X text 47 416 So for example \, the [coord] objects created in the
main window of this help patch are:;
#X text 103 454 [coord env x gr];
#X text 103 475 [coord env y gr];
#X text 66 511 Note: If you right click on [coord] and select "properties"
\, you can edit the creation argument.;
#X text 104 326 4: group-name (only required if you are using [coord]
in an abstraction and you want it to operate like [slide]. (see "input").
, f 49;
#X restore 563 504 creation arguments;
#X text 525 447 [coord] works automatically \, but it needs to be initialized
with the correct creation arguments., f 36;
#N canvas 580 337 450 300 object 0;
#X text 48 21 [contour-index] is the little number box visible in the
bottom-left of the example in the main window of the help patch. It
is used for two things:;
#X text 77 78 1: setting which point [coord] grips \; 2: state-saving
its selection.;
#X text 49 130 [contour-index] takes the following three arguments:
;
#X text 77 162 1: array name \, the same as with [coord] \; 2: label
\, corresponding to those of [coord] \; 3: \$1 (if using as a part
of a;
#X obj 262 188 else/openfile psave-help.pd -h psave abstraction.;
#X restore 563 527 contour-index object;
#N canvas 323 197 680 524 and 0;
#X text 84 30 There are four ways of getting data into [coord]:;
#X text 108 55 1: Manually using the mouse.;
#X text 108 80 2: Using the inlet.;
#X floatatom 71 79 5 0 0 0 - - -, f 5;
#X floatatom 489 105 5 0 0 0 - - -, f 5;
#X obj 38 219 coord env x gp help-patch;
#X text 109 104 3: By sending a message. This requires the fourth creation
argument as an identifier (see "creation arguments"). You need to send
message message "label-x my message" to channel [s group-name-]. See
example to the right.;
#X msg 489 127 \; help-patch- gp-x \$1;
#X text 174 217 <-- this object is [coord env x gp help-patch].;
#X text 108 170 4: using [control]. [coord] will integrate with [pgrid]
to operate like a regular slider in mode-4.;
#X text 80 280 There are two types of data you can send to [coord]:
;
#X text 107 321 1: Single floats (0-100). As above \, the slider will
jump to the new position.;
#X text 108 362 2: Double float lists (position \, time). This will
move the slider to the new position over the given time (in millieconds).
The time grain can be set with [coord]'s 6th creation argument (see
"creation arguments").;
#X floatatom 478 322 5 0 0 0 - - -, f 5;
#X obj 478 344 pack f 1000;
#X floatatom 541 322 5 0 0 0 - - -, f 5;
#X msg 478 371 \; help-patch- gp-x \$1 \$2;
#X text 76 452 [contour-gri] has one outlet which outputs a value between
0 and 1 You can use this to track the placement of a contour point.
;
#X floatatom 56 496 5 0 0 0 - - -, f 5;
#X obj 417 183 else/openfile pgrid-help.pd -h See [pgrid].;
#X obj 649 439 coord-index env gp 0 1;
#X connect 3 0 5 0;
#X connect 4 0 7 0;
#X connect 5 0 18 0;
#X connect 13 0 14 0;
#X connect 14 0 16 0;
#X connect 15 0 14 1;
#X restore 563 549 input and output;
#X text 36 294 this is [contour-index] -->;
#X text 30 561 Note that you can also select a point using [contour-index].
;
#X obj 203 293 coord-index env gr 0 1;
#X text 396 89 1: For more precision \; 2: for integrating with [control]
\; 3: for automation (see [automation example]);
#X obj 427 235 else/openfile contour-help.pd -h contour;
#X text 475 235 which is used to draw functions.;