#N canvas 289 54 1035 471 12;
#X msg 84 374 bang;
#X floatatom 670 67 0 0 0 0 - - -;
#N canvas 685 165 422 119 sample-subpatch 0;
#X text 39 43 this is a subpatch of the main patch.;
#X restore 124 100 pd sample-subpatch;
#N canvas 566 198 643 322 eager-adder 0;
#X obj 67 46 inlet;
#X obj 123 46 inlet;
#X obj 123 161 outlet;
#X obj 123 74 t b f;
#X obj 123 129 +;
#X text 97 213 Aside: this shows why \, in Pd and Max \, objects such
as "+" only trigger on their left inlets: it's easy to build up from
there \, but if more than one inlet were "hot" \, you wouldn't be able
to change both of them without firing the calculation twice., f 63
;
#X text 212 124 Because of the two inlets and the one outlet \, the
containing box (in the parent patch) has two inlets and one outlet.
They respect the left-to-right order of the inlet and outlet objects
in the subpatch., f 52;
#X text 212 28 This is a sample subpatch which maintains the sum of
two inputs \, doing the computation when either input changes. If it's
the left input \, the "+" object takes care if it. If the right \,
the "trigger" object first gives the "+" the new value \, then "bangs"
the right inlet to make "+" do the computation., f 52;
#X connect 0 0 4 0;
#X connect 1 0 3 0;
#X connect 3 0 4 0;
#X connect 3 1 4 1;
#X connect 4 0 2 0;
#X restore 183 229 pd eager-adder;
#X floatatom 183 202 0 0 0 0 - - -;
#X floatatom 278 202 0 0 0 0 - - -;
#X floatatom 183 257 0 0 0 0 - - -;
#X text 37 290 There is also a facility for making many copies of a
patch which track any changes you make in the original. The subpatches
are called abstractions. For example \, here's a simple abstraction
that sends a number to a "receive" on command:, f 64;
#X obj 84 407 sendnumber 45 cookies;
#X msg 271 374 bang;
#X obj 271 407 sendnumber 67 pretzels;
#X floatatom 671 135 0 0 0 0 - - -;
#X text 535 344 Note that "\$1" \, etc \, has a different meaning in
object boxes. Open one of the "sendnumber" abstractions for details.
, f 64;
#X text 534 278 If you change one copy of an abstraction the change
isn't automatically made on any other copies. You must keep track \,
save the changes \, and cause Pd to reload the other copies (for example
\, by closing and reopening the containing patch.), f 64;
#X obj 670 40 r cookies;
#X obj 671 108 r pretzels;
#X text 34 150 If you click on the box (in run mode) the subwindow
appears. Click on the one below to see how you give a subpatch inlets
and outlets., f 63;
#X text 777 404 updated for Pd version 0.34;
#X text 534 195 There is a separate file in this directory named "sendnumber.pd"
which is loaded every time you type "sendnumber" in a box. Click on
a "sendnumber" box above to see it. You can make changes in the subpatch
and save them. The changes will be saved back to sendnumber.pd and
not as part of this (containing) patch., f 64;
#X text 259 99 <= you can give the window a name as an argument, f
26;
#X text 34 16 You can nest entire windows inside Pd boxes (and so on
\, as deep as you wish.) There are two different ways to do it. First
\, if you just want to add a room to the house \, so to speak \, type
"pd" into an object box:, f 63;
#X text 60 99 click => to open, f 8;
#X connect 0 0 8 0;
#X connect 3 0 6 0;
#X connect 4 0 3 0;
#X connect 5 0 3 1;
#X connect 9 0 10 0;
#X connect 14 0 1 0;
#X connect 15 0 11 0;
