Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c74c2de

Browse files
committed
Update clone help patch (backport from vanilla).
1 parent 9af328f commit c74c2de

File tree

5 files changed

+303
-110
lines changed

5 files changed

+303
-110
lines changed

pd/doc/5.reference/clone-abs-a.pd

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#N canvas 585 104 563 448 12;
2+
#X obj 65 207 osc~;
3+
#X obj 65 307 outlet~;
4+
#X obj 65 246 *~;
5+
#X obj 65 139 t f b, f 7;
6+
#X obj 65 171 mtof;
7+
#X obj 269 150 float \$1;
8+
#X obj 269 106 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
9+
#X text 64 14 This is the abstraction for the clone help patch. It plays tones at pitches sent to its inlet., f 64;
10+
#X floatatom 269 179 5 0 0 0 - - - 0;
11+
#X obj 111 207 vline~;
12+
#X text 300 99 You can access the instance number within the patch., f 27;
13+
#X obj 111 246 pow~ 4;
14+
#X msg 111 171 0.5 50 \, 0 4000 50;
15+
#X obj 65 66 inlet;
16+
#X obj 318 307 outlet;
17+
#X floatatom 318 261 5 0 0 0 - - - 0;
18+
#X text 248 342 control data is preceded by instance number in [clone]'s output., f 25;
19+
#X obj 65 104 route float bang;
20+
#X obj 269 202 print instance number;
21+
#X connect 0 0 2 0;
22+
#X connect 2 0 1 0;
23+
#X connect 3 0 4 0;
24+
#X connect 3 1 12 0;
25+
#X connect 4 0 0 0;
26+
#X connect 5 0 8 0;
27+
#X connect 6 0 5 0;
28+
#X connect 8 0 18 0;
29+
#X connect 9 0 11 0;
30+
#X connect 11 0 2 1;
31+
#X connect 12 0 9 0;
32+
#X connect 13 0 17 0;
33+
#X connect 15 0 14 0;
34+
#X connect 17 0 3 0;
35+
#X connect 17 1 5 0;

pd/doc/5.reference/clone-abs-b.pd

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#N canvas 571 175 261 316 12;
2+
#X obj 80 264 outlet~;
3+
#X obj 80 193 *~;
4+
#X obj 80 89 inlet~;
5+
#X obj 98 152 osc~ 20;
6+
#X obj 80 230 *~ 0.5;
7+
#X text 16 15 This is an abstraction for the [clone] help patch. It performs amplitude modulation., f 31;
8+
#X connect 1 0 4 0;
9+
#X connect 2 0 1 0;
10+
#X connect 3 0 1 1;
11+
#X connect 4 0 0 0;

pd/doc/5.reference/clone-abs-c.pd

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#N canvas 585 104 323 372 12;
2+
#X obj 110 199 osc~;
3+
#X obj 110 315 outlet~;
4+
#X obj 110 238 *~;
5+
#X obj 110 163 mtof;
6+
#X obj 156 261 pow~ 4;
7+
#X obj 110 81 inlet;
8+
#X obj 110 114 unpack, f 7;
9+
#X obj 156 156 / 127;
10+
#X text 61 21 This is the abstraction for the [poly] help patch., f 26;
11+
#X obj 156 222 line~;
12+
#X msg 156 186 \$1 150;
13+
#X connect 0 0 2 0;
14+
#X connect 2 0 1 0;
15+
#X connect 3 0 0 0;
16+
#X connect 4 0 2 1;
17+
#X connect 5 0 6 0;
18+
#X connect 6 0 3 0;
19+
#X connect 6 1 7 0;
20+
#X connect 7 0 10 0;
21+
#X connect 9 0 4 0;
22+
#X connect 10 0 9 0;

pd/doc/5.reference/clone-help.pd

Lines changed: 235 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,239 @@
1-
#N canvas 155 58 847 810 12;
2-
#X floatatom 218 329 5 36 144 0 - - -, f 5;
3-
#X obj 218 350 t b f;
4-
#X obj 218 374 f;
5-
#X obj 218 398 + 1;
6-
#X obj 218 422 mod 16;
7-
#X obj 218 446 pack;
8-
#X msg 327 422 next \$1;
9-
#X floatatom 327 402 5 36 144 0 - - -, f 5;
10-
#X floatatom 327 452 5 36 144 0 - - -, f 5;
11-
#X msg 327 471 this \$1;
12-
#X floatatom 326 499 5 36 144 0 - - -, f 5;
13-
#X msg 326 518 set \$1;
14-
#X msg 80 397 vis 5 1;
15-
#X msg 79 425 vis 5 0;
16-
#X floatatom 325 545 5 36 144 0 - - -, f 5;
17-
#X msg 325 566 all \$1;
18-
#X obj 178 662 ../3.audio.examples/output~;
19-
#X text 597 749 updated for Pd version 0.47;
20-
#X text 496 579 creation arguments:;
21-
#X text 26 610 click to open ->;
22-
#X text 14 632 (first copy only);
23-
#X text 67 351 open or close copy number 5:, f 14;
24-
#X text 276 326 A list beginning with a number dispatches the rest
25-
of the list as a message, f 23;
26-
#X text 403 392 "next" forwards a message to the next instance (incrementing
27-
and repeating circularly)., f 33;
28-
#X text 407 445 "this" forwards a message to the previous instance
1+
#N canvas 309 29 783 709 12;
2+
#X declare -stdpath ./;
3+
#X floatatom 223 264 5 57 83 0 - - -, f 5;
4+
#X obj 223 304 t b f, f 9;
5+
#X obj 223 330 f;
6+
#X msg 401 348 next \$1;
7+
#X msg 409 397 this \$1;
8+
#X msg 420 445 set \$1;
9+
#X msg 429 493 all \$1;
10+
#X text 464 322 "next" forwards a message to the next instance (incrementing
11+
and repeating circularly)., f 31;
12+
#X text 472 376 "this" forwards a message to the previous instance
2913
sent to by "this" or "next", f 30;
30-
#X text 391 500 "set" sets the "next"/"this" counter;
31-
#X text 386 546 "all" broadcasts a message to all instances;
32-
#X text 24 8 clone - make multiple copies of a patch;
33-
#X text 20 170 clone's inlets and outlets correspond to those of the
34-
contained patch \, and may be signal and/or control inlets and outlets.
35-
(In this example there's one control inlet and one signal outlet).
36-
You can click on the clone~ object to see the first of the created
37-
instances., f 72;
38-
#X obj 179 609 clone clone-subpatch 16;
39-
#X text 30 734 note: for backward compatibility \, you can also invoke
40-
this as "clone clone-subpatch 16" (for instance) \, swapping the abstraction
41-
name and the mumber of voices.;
42-
#X text 19 247 Signal inlets are copied to all the instances. Control
43-
inlets forward messages as shown below. Signal outlets output the sum
44-
of all instances' outputs \, and control outlets forward messages with
45-
the number of the instance prepended to them., f 67;
46-
#X text 418 605 optional "-s #" to set starting voice number \; optional
47-
-x to avoid setting \$1 to voice number \; filename \; number of copies
48-
\; optional arguments to copies;
49-
#X text 21 36 clone creates any number of copies of a desired abstraction
50-
(a patch loaded as an object in another patch). Within each copy \,
51-
"\$1" is set to the instance number. (These count from 0 unless overridden
52-
by the "-s" option in the creation arguments. You can avoid this behavior
53-
using the "-x" option.), f 71;
54-
#X text 23 129 You can pass additional arguments to the copies that
55-
appear as \$2 and onward (or \$1 and onward with "-x" option)., f
56-
71;
14+
#X obj 223 562 output~;
15+
#X obj 30 8 clone;
16+
#X obj 223 392 pack f f;
17+
#X listbox 223 420 5 0 0 0 - - -, f 5;
18+
#X obj 100 574 declare -stdpath ./, f 11;
19+
#X obj 6 37 cnv 1 775 1 empty empty empty 8 12 0 13 #000000 #000000
20+
0;
21+
#X obj 6 668 cnv 1 775 1 empty empty empty 8 12 0 13 #000000 #000000
22+
0;
23+
#X obj 252 330 + 1;
24+
#N canvas 696 57 567 608 reference 0;
25+
#X obj 8 43 cnv 5 550 5 empty empty INLETS: 8 18 0 13 #202020 #000000
26+
0;
27+
#X obj 8 76 cnv 1 550 1 empty empty 'n': 8 12 0 13 #9f9f9f #000000
28+
0;
29+
#X obj 8 299 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000
30+
0;
31+
#X obj 7 586 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000
32+
0;
33+
#X obj 28 13 clone;
34+
#X obj 8 393 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000
35+
0;
36+
#X obj 7 418 cnv 1 550 1 empty empty flags: 8 12 0 13 #7c7c7c #000000
37+
0;
38+
#X text 104 84 list -;
39+
#X text 55 189 next <list> -;
40+
#X text 55 223 this <list> -;
41+
#X text 62 255 set <list> - sets the "next"/"this" counter., f 67
42+
;
43+
#X text 28 443 "-s <float>" - sets starting voice number (default 0).
44+
, f 70;
45+
#X text 84 426 "-x" - avoids including a first argument setting voice
46+
number., f 62;
47+
#X text 113 524 1) symbol - abstraction name., f 49;
48+
#X text 113 542 2) float - number of copies., f 49;
49+
#X obj 7 519 cnv 1 550 1 empty empty args: 8 12 0 13 #7c7c7c #000000
50+
0;
51+
#X text 113 560 3) list - optional arguments to the abstraction.,
52+
f 49;
53+
#X text 153 85 first number sets the copy number and the rest of the
54+
list is sent to that instance's inlet., f 54;
55+
#X text 153 188 forwards a message to the next instance's inlet (incrementing
56+
and repeating circularly)., f 54;
57+
#X text 153 223 forwards a message to the previous instance's inlet
58+
sent to by "this" or "next"., f 54;
59+
#X text 62 273 all <list> - sends a message to all instances' inlet.
60+
, f 67;
61+
#X text 79 52 (number and type depends on the abstraction);
62+
#X text 90 116 signal -;
63+
#X text 153 117 for signal inlets \, audio is sent to all copies.,
64+
f 54;
65+
#X text 75 13 - make multiple copies of an abstraction.;
66+
#X obj 8 329 cnv 1 550 1 empty empty 'n': 8 12 0 13 #9f9f9f #000000
67+
0;
68+
#X text 62 154 vis <list> -;
69+
#X text 153 155 opens a copy \, takes copy number and visualization
70+
status (1 to open \, 0 to close)., f 54;
71+
#X text 34 136 resize <float> -;
72+
#X text 153 137 resizes the number of copies., f 54;
73+
#X text 61 335 control outlets - message with a prepended copy number.
74+
, f 68;
75+
#X text 68 353 signal outlets -;
76+
#X text 187 353 either a multichannel output with signals from all
77+
copies or the sum of all copies as a mono output., f 50;
78+
#X text 91 460 -di - distribute multichannel input signals across cloned
79+
patches., f 66;
80+
#X text 91 475 -do - combine signal outputs to make a multichannel
81+
signal.;
82+
#X text 98 491 -d - set both -di and -do flags.;
83+
#X text 84 304 (number and type depends on the abstraction);
84+
#X restore 592 8 pd reference;
85+
#X text 685 8 <= click;
86+
#X text 268 259 A list beginning with a number dispatches the rest
87+
of the list as a message to a copy of the abstraction defined by the
88+
first number., f 69;
89+
#X text 91 533 click to open --> (first copy only), f 17;
90+
#X text 78 9 - make multiple copies of an abstraction;
91+
#X text 565 677 updated for Pd version 0.54;
92+
#X text 15 678 see also:;
93+
#X obj 87 679 inlet;
94+
#X obj 135 679 snake~;
95+
#X text 438 582 mutichannel signal support ----------->, f 20;
96+
#X floatatom 420 423 5 0 3 0 - - -, f 5;
97+
#N canvas 461 86 828 543 multichannel 0;
98+
#X obj 361 338 output~;
99+
#X obj 361 296 snake~ out;
100+
#X msg 361 221 next \$1;
101+
#X floatatom 361 189 5 57 83 0 - - -, f 5;
102+
#X text 583 46 The '-d' flag sets both -di and -do flags \, so it takes
103+
and generates multichannel signals., f 27;
104+
#X obj 95 340 output~;
105+
#X obj 95 256 snake~ in;
106+
#X obj 95 217 osc~ 444;
107+
#X obj 167 217 osc~ 666;
108+
#X floatatom 95 189 5 0 0 0 - - -, f 5;
109+
#X floatatom 167 189 5 0 0 0 - - -, f 5;
110+
#X obj 361 258 clone -do clone-abs-a 2;
111+
#X obj 95 298 clone -di clone-abs-b 2;
112+
#X text 54 118 The '-di' flag distributes a multichannel signal to
113+
different copies inside [clone]., f 32;
114+
#X obj 615 203 snake~ in;
115+
#X obj 615 164 osc~ 444;
116+
#X obj 687 164 osc~ 666;
117+
#X floatatom 615 136 5 0 0 0 - - -, f 5;
118+
#X floatatom 687 136 5 0 0 0 - - -, f 5;
119+
#X obj 615 335 output~;
120+
#X obj 615 293 snake~ out;
121+
#X obj 615 245 clone -d clone-abs-b 2;
122+
#X text 322 118 The '-do' flag combines the audio of all copies into
123+
a multichannel signal output., f 27;
124+
#X text 46 20 By default \, for signal inlets \, [clone] expects a
125+
single mono channel and distributes it to all copies of the abstraction.
126+
If you have a multichannel input you need to use a flag to split and
127+
distribute the channels separately to each copy. By default \, an outlet
128+
connection gets the sum of all copies \, but you can also get a multichannel
129+
output that combines the output of all copies with a flag., f 70;
130+
#X text 73 440 When distributing a mutichannel input into copies \,
131+
if the number of channels is less than the number of copies \, [clone]
132+
will wrap around and copy the first channels until reaching the number
133+
of copies. This is specially useful if you have like an actual multichannel
134+
input in the leftmost inlet and other secondary signal inlets that
135+
just receive a single channel signal \, in which case the single channels
136+
are sent to all copies., f 97;
137+
#X connect 1 0 0 0;
138+
#X connect 1 1 0 1;
139+
#X connect 2 0 11 0;
140+
#X connect 3 0 2 0;
141+
#X connect 6 0 12 0;
142+
#X connect 7 0 6 0;
143+
#X connect 8 0 6 1;
144+
#X connect 9 0 7 0;
145+
#X connect 10 0 8 0;
146+
#X connect 11 0 1 0;
147+
#X connect 12 0 5 0;
148+
#X connect 14 0 21 0;
149+
#X connect 15 0 14 0;
150+
#X connect 16 0 14 1;
151+
#X connect 17 0 15 0;
152+
#X connect 18 0 16 0;
153+
#X connect 20 0 19 0;
154+
#X connect 20 1 19 1;
155+
#X connect 21 0 20 0;
156+
#X restore 589 597 pd multichannel;
157+
#X obj 223 366 mod 4;
158+
#X msg 44 469 vis 2 0;
159+
#X msg 108 470 vis 2 1;
160+
#X floatatom 429 471 4 57 83 0 - - -, f 4;
161+
#X floatatom 409 375 5 0 3 0 - - -, f 5;
162+
#X floatatom 401 326 5 0 3 0 - - -, f 5;
163+
#X text 367 532 <-- file name and number of copies;
164+
#X obj 223 532 clone clone-abs-a 4;
165+
#X floatatom 317 303 5 0 0 0 - - -, f 5;
166+
#X msg 317 343 resize \$1;
167+
#X text 480 433 "set" sets the "next" and "this" counter, f 22;
168+
#X text 486 481 "all" sends a message to all instances, f 21;
169+
#X text 364 300 <-- resize the number of instances;
170+
#X text 24 46 [clone] creates any number of copies of an abstraction
171+
(a patch loaded as an object in another patch). By default "\$1" is
172+
set to the instance number within each copy (counted from 0 unless
173+
overridden by the "-s" flag). You can prevent '\$1' from reflecting
174+
the instance number with the "-x" flag. Arguments must be filename
175+
and number of copies \, additional arguments are passed to the copies
176+
and appear as \$2 and onward (or \$1 and onward with the "-x" flag).
177+
, f 104;
178+
#X listbox 353 560 7 0 0 0 - - -, f 7;
179+
#X text 410 560 control data is preceded by instance number;
180+
#X obj 193 679 poly;
181+
#X text 80 627 Note: for backwards compatibility \, you can also invoke
182+
this as "clone 16 clone-abstraction" (for instance) \, swapping the
183+
abstraction name and the number of voices., f 91;
184+
#X text 54 431 Open or close copy number 2:, f 14;
185+
#X floatatom 165 368 5 0 3 0 - - -, f 5;
186+
#X text 24 269 Check [poly]'s help for a polyphonic synth example with
187+
[clone] and a list input., f 25;
188+
#X text 25 354 Just a float sends an empty list to the instance \,
189+
which becomes a bang!, f 19;
190+
#X text 23 129 [clone]'s inlets/outlets correspond to those of the
191+
contained patch and may be control and/or signal inlets/outlets. This
192+
example has one control inlet. It also has a signal and another control
193+
outlet. You can click on the [clone] object to see the first of the
194+
cloned instances. At least one control inlet is present even if the
195+
abstraction has none \, so [clone] can receive the 'vis' and 'resize'
196+
messages. The way control inlets/outlets forward messages is shown
197+
below., f 104;
198+
#X text 23 213 Signal inlets can get non float control messages via
199+
their 2nd outlet in the same way \, but signals are sent to all the
200+
instances. See [pd multichannel] example for more details on how signal
201+
distribution works in [clone]., f 104;
202+
#X obj 74 317 poly;
203+
#X obj 236 678 notein;
204+
#N canvas 946 442 494 344 META 0;
205+
#X text 12 65 LIBRARY internal;
206+
#X text 12 105 WEBSITE http://crca.ucsd.edu/~msp/;
207+
#X text 12 25 LICENSE SIBSD;
208+
#X text 12 85 AUTHOR Miller Puckette;
209+
#X text 12 125 RELEASE_DATE 2023;
210+
#X text 12 5 KEYWORDS clone abstraction;
211+
#X text 12 45 DESCRIPTION make multiple copies of an abstraction;
212+
#X text 12 145 HELP_PATCH_AUTHORS Updated for Pd version 0.54 by Alexandre
213+
Porres. PDDP META added by Albert Gräf.;
214+
#X restore 400 678 pd META;
57215
#X connect 0 0 1 0;
58216
#X connect 1 0 2 0;
59-
#X connect 1 1 5 1;
60-
#X connect 2 0 3 0;
61-
#X connect 3 0 4 0;
62-
#X connect 4 0 2 1;
63-
#X connect 4 0 5 0;
64-
#X connect 5 0 29 0;
65-
#X connect 6 0 29 0;
66-
#X connect 7 0 6 0;
67-
#X connect 8 0 9 0;
68-
#X connect 9 0 29 0;
69-
#X connect 10 0 11 0;
70-
#X connect 11 0 29 0;
71-
#X connect 12 0 29 0;
72-
#X connect 13 0 29 0;
73-
#X connect 14 0 15 0;
74-
#X connect 15 0 29 0;
217+
#X connect 1 1 11 1;
218+
#X connect 2 0 29 0;
219+
#X connect 3 0 36 0;
220+
#X connect 4 0 36 0;
221+
#X connect 5 0 36 0;
222+
#X connect 6 0 36 0;
223+
#X connect 11 0 12 0;
224+
#X connect 12 0 36 0;
225+
#X connect 16 0 2 1;
226+
#X connect 27 0 5 0;
227+
#X connect 29 0 11 0;
75228
#X connect 29 0 16 0;
76-
#X connect 29 0 16 1;
229+
#X connect 30 0 36 0;
230+
#X connect 31 0 36 0;
231+
#X connect 32 0 6 0;
232+
#X connect 33 0 4 0;
233+
#X connect 34 0 3 0;
234+
#X connect 36 0 9 0;
235+
#X connect 36 1 43 0;
236+
#X connect 37 0 38 0;
237+
#X connect 37 0 29 1;
238+
#X connect 38 0 36 0;
239+
#X connect 48 0 36 0;

0 commit comments

Comments
 (0)