#N canvas 241 181 666 534 12;
#N canvas 0 0 600 400 (subpatch) 0;
#X restore 23 13 pd;
#X text 57 14 - subpatch;
#X obj 180 13 inlet;
#X text 238 12 - control inlet;
#X obj 410 12 inlet~;
#X text 480 12 - audio inlet;
#X obj 180 41 outlet;
#X text 238 43 - control outlet;
#X obj 410 40 outlet~;
#X text 480 40 - audio outlet;
#X text 15 77 Type "pd" into an object box to make a subpatch. When
in run mode you can click on the object to open the subpatch. You can
name the subpatch with an argument:;
#N canvas 156 300 518 221 my-subpatch 0;
#X text 49 96 this is a subpatch for the "pd" help window.;
#X restore 111 134 pd my-subpatch;
#X text 19 161 and you can put inlets and outlets by making "inlet"
objects \, etc \, in the subpatch (open the patch below to see them.)
;
#X obj 315 317 print~;
#X obj 315 245 sig~ 12;
#X floatatom 50 253 0 0 0 0 - - -;
#X floatatom 50 305 0 0 0 0 - - -;
#X text 345 293 (check that audio is on);
#X text 20 232 messages in and out;
#X text 285 222 audio in and out;
#X text 13 470 see also:;
#X obj 97 470 block~;
#X obj 325 295 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#N canvas 868 141 634 613 up/downsampling 0;
#X obj 29 395 print~;
#X obj 47 369 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 152 397 print~;
#X obj 170 371 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 276 395 print~;
#X obj 294 369 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-tab 64 float 3;
#A 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
#X coords 0 1 64 -1 200 140 1;
#X restore 285 180 graph;
#X obj 354 360 s \$0-tab;
#X msg 353 333 const 0 \, 0 0 1;
#X obj 176 243 print~;
#X obj 176 218 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 24 191 tabreceive~ \$0-tab;
#N canvas 162 294 571 346 test-subpatch-upsampled 0;
#X obj 40 17 block~ 128 1 2;
#X obj 43 144 inlet~ hold;
#X obj 318 149 inlet~ lin;
#X obj 183 200 print~;
#X obj 201 174 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 43 204 print~;
#X obj 61 178 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 317 209 print~;
#X obj 334 183 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X text 42 49 Upsampling methods:;
#X text 41 109 sample/hold;
#X text 300 114 linear interpolation;
#X obj 183 144 inlet~ pad;
#X text 183 113 zero-padded;
#X text 43 245 The default \, if no method is specified \, is sample/hold.
;
#X connect 1 0 5 0;
#X connect 2 0 7 0;
#X connect 4 0 3 0;
#X connect 6 0 5 0;
#X connect 8 0 7 0;
#X connect 12 0 3 0;
#X restore 24 295 pd test-subpatch-upsampled;
#N canvas 45 42 585 267 test-subpatch-downsampled 0;
#X obj 367 153 outlet~ lin;
#X text 206 173 sample/hold;
#X text 364 177 linear interpolation;
#X text 197 19 upsampling methods:;
#X obj 40 17 block~ 32 1 0.5;
#X text 18 169 interleaved zeros;
#X obj 21 83 tabreceive~ \$0-tab;
#X obj 23 146 outlet~ pad;
#X obj 209 149 outlet~ hold;
#X connect 6 0 0 0;
#X connect 6 0 7 0;
#X connect 6 0 8 0;
#X restore 28 339 pd test-subpatch-downsampled;
#X text 50 11 When a subpatch is reblocked to a higher or lower sample
rate \, the inlet~ and outlet~ objects offer a choice of three upsampling
methods. (The inlet~ upsamples when entering a subpatch with a higher
sample rate \; the outlet~ upsamples when leaving a subpatch of _lower_
sample rate \, as demonstrated below.) There is no corresponding choice
of downsampling method - downsampling is done simply by dropping the
extra samples.;
#X msg 127 541 \; pd compatibility 0.43;
#X text 27 469 COMPATIBILITY NOTE: in Pd versions before 0.44 \, the
default method was "pad". To get the old behavior \, either change
the patch to specify "pad" \, or set "compatibility" to 0.43 in Pd's
command line or by a message:;
#X connect 1 0 0 0;
#X connect 3 0 2 0;
#X connect 5 0 4 0;
#X connect 8 0 7 0;
#X connect 10 0 9 0;
#X connect 11 0 12 0;
#X connect 11 0 12 2;
#X connect 11 0 9 0;
#X connect 11 0 12 1;
#X connect 13 0 0 0;
#X connect 13 1 2 0;
#X connect 13 2 4 0;
#X restore 20 370 pd up/downsampling;
#N canvas 103 180 836 342 subpatch-with-inlets-and-outlets 0;
#X obj 64 83 inlet;
#X text 16 53 control inlet for receiving messages;
#X floatatom 64 111 0 0 0 0 - - -;
#X floatatom 67 212 0 0 0 0 - - -;
#X obj 67 244 outlet;
#X text 31 182 control outlet for sending message;
#X obj 517 157 inlet~;
#X obj 517 208 print~;
#X msg 532 182 bang;
#X obj 526 292 outlet~;
#X obj 526 266 sig~ 34;
#X floatatom 498 132 5 0 0 0 - - -;
#X text 366 6 Same for signals. Inlet~ objects take float messages
to set the value if there's no signal connected (the same as with signal
inlets to other Pd objects) and you can also set this value by a "float"
message to the inlet~ object. (You'll have to disconnect the signal
connection on the parent to see this happen.) You can use a "loadbang"
object to pass arguments to initialize signal inlets in abstractions.
;
#X connect 0 0 2 0;
#X connect 3 0 4 0;
#X connect 6 0 7 0;
#X connect 8 0 7 0;
#X connect 10 0 9 0;
#X connect 11 0 6 0;
#X restore 50 279 pd subpatch-with-inlets-and-outlets;
#X text 164 369 <- details on up/downsampling for inlet~ and outlet~
;
#X text 387 458 updated for Pd version 0.51;
#X text 350 489 (new: messages to inlet~ objects);
#X text 169 428 <- catching messages to inlet~ objects;
#N canvas 868 141 593 411 inlet~-forwarding 0;
#X obj 59 177 inlet~ fwd;
#X obj 59 140 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X floatatom 84 139 5 0 0 0 - - -;
#X msg 127 140 1 2 3;
#X msg 174 141 poodle 50;
#X obj 128 207 print;
#X obj 60 278 print~;
#X text 90 254 (check that audio is on);
#X obj 70 256 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X text 50 11 you can pass "fwd" as an argument to inlet~ to ask for
a second outlet that forwards messages. Float messages aren't forwarded
though - instead \, they set the signal output value in case the parent
inlet isn't connected. Messages to the inlet~ object are treated the
same as messages to the inlet on the parent.;
#X text 56 309 (note: inlet~ objects inside patches that are copied
using clone~ are always connected to incoming signals \, so a float
message to such an inlet~ has no effect.);
#X connect 0 0 6 0;
#X connect 0 1 5 0;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 4 0 0 0;
#X connect 8 0 6 0;
#X restore 20 430 pd inlet~-forwarding;
#X obj 20 398 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X floatatom 45 397 5 0 0 0 - - -;
#X msg 88 398 1 2 3;
#X msg 135 399 poodle 50;
#X connect 14 0 24 1;
#X connect 15 0 24 0;
#X connect 22 0 13 0;
#X connect 24 0 16 0;
#X connect 24 1 13 0;
#X connect 30 0 29 0;
#X connect 31 0 29 0;
#X connect 32 0 29 0;
#X connect 33 0 29 0;
