#N canvas 669 111 580 580 12;
#X obj 125 23 inlet;
#X text 183 22 - control inlet;
#X obj 315 22 inlet~;
#X text 375 22 - audio inlet;
#X obj 125 51 outlet;
#X text 183 53 - control outlet;
#X obj 315 50 outlet~;
#X text 375 50 - audio outlet;
#X obj 303 311 print~;
#X obj 303 231 sig~ 12;
#X floatatom 61 235 5 0 0 0 - - - 0;
#X floatatom 61 287 5 0 0 0 - - - 0;
#X text 31 214 messages in and out;
#X text 273 208 audio in and out;
#X text 45 523 see also:;
#X obj 119 524 block~;
#X obj 315 289 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#N canvas 486 122 538 582 up/downsampling 0;
#X obj 37 395 print~;
#X obj 55 369 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X obj 133 397 print~;
#X obj 151 371 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#X obj 230 395 print~;
#X obj 248 369 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-tab 64 float 1;
#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 63 -1 200 140 1;
#X restore 270 175 graph;
#X obj 362 360 s \$0-tab;
#X msg 362 333 const 0 \, 0 0 1;
#X obj 185 243 print~;
#X obj 185 218 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#X obj 33 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 #fcfcfc
#000000 #000000;
#X obj 43 204 print~;
#X obj 61 178 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X obj 317 209 print~;
#X obj 334 183 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#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 33 295 pd test-subpatch-upsampled;
#N canvas 362 216 585 262 test-subpatch-downsampled 0;
#X obj 319 151 outlet~ lin;
#X text 198 171 sample/hold;
#X text 316 175 linear interpolation;
#X obj 105 28 block~ 32 1 0.5;
#X text 59 167 interleaved zeros;
#X obj 201 81 tabreceive~ \$0-tab;
#X obj 64 144 outlet~ pad;
#X obj 201 147 outlet~ hold;
#X text 233 29 downsampling methods:;
#X connect 5 0 0 0;
#X connect 5 0 6 0;
#X connect 5 0 7 0;
#X restore 37 339 pd test-subpatch-downsampled;
#X text 48 14 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 314 498 \; pd compatibility 0.43;
#X text 48 444 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 text 62 150 (DSP needs to be on);
#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 95 348 pd up/downsampling;
#N canvas 309 180 813 339 subpatch-with-inlets-and-outlets 0;
#X obj 97 94 inlet;
#X text 49 64 control inlet for receiving messages;
#X floatatom 97 122 5 0 0 0 - - - 0;
#X floatatom 100 223 5 0 0 0 - - - 0;
#X obj 100 255 outlet;
#X text 64 193 control outlet for sending message;
#X obj 466 217 inlet~;
#X obj 466 268 print~;
#X msg 481 242 bang;
#X obj 635 276 outlet~;
#X obj 635 230 sig~ 34;
#X floatatom 466 191 5 0 0 0 - - - 0;
#X text 365 52 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 text 427 300 (DSP needs to be on);
#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 61 261 pd subpatch-with-inlets-and-outlets;
#N canvas 0 23 600 400 (subpatch) 0;
#X restore 172 524 pd;
#X text 70 97 Inlets/outlets are used to receive and get information
on a patch window. This can be an abstraction or a subpatch. To create
a subpatch \, type "pd" into an object box \, then you can put inlets
and outlets by making "inlet" objects \, etc \, in the subpatch (open
the patch below to see them.);
#X text 230 348 <= details on up/downsampling;
#X text 251 364 for inlet~ and outlet~, f 26;
#X text 334 513 updated for Pd version 0.51;
#X text 306 535 (new: messages to inlet~ objects);
#N canvas 582 179 543 415 inlet~-forwarding 0;
#X obj 173 182 inlet~ fwd;
#X floatatom 131 145 5 0 0 0 - - - 0;
#X msg 174 145 1 2 3;
#X msg 221 145 poodle 50;
#X obj 174 283 print~;
#X obj 187 255 bng 17 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#X text 58 16 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 64 339 (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 obj 240 214 print fwd;
#X text 213 255 (DSP needs to be on);
#X obj 106 145 bng 17 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#X connect 0 0 4 0;
#X connect 0 1 8 0;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 5 0 4 0;
#X connect 10 0 0 0;
#X restore 106 451 pd inlet~-forwarding;
#X obj 84 416 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X floatatom 49 414 4 0 0 0 - - - 0;
#X msg 106 416 1 2 3;
#X msg 153 416 poodle 50;
#X text 255 450 <= catching messages to inlet~ objects;
#X text 332 288 (DSP needs to be on);
#X obj 431 214 tgl 17 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000 0 1;
#X text 455 215 DSP on/off;
#X msg 431 238 \; pd dsp \$1;
#X connect 9 0 18 1;
#X connect 10 0 18 0;
#X connect 16 0 8 0;
#X connect 18 0 11 0;
#X connect 18 1 8 0;
#X connect 26 0 25 0;
#X connect 27 0 25 0;
#X connect 28 0 25 0;
#X connect 29 0 25 0;
#X connect 32 0 34 0;
