#N canvas 187 34 1000 661 12;
#X msg 733 127 dsp \$1;
#X msg 577 139 \; pd dsp 0;
#X text 757 98 turn DSP engine on/off;
#X msg 577 97 \; pd dsp 1;
#X msg 56 309 \; pd compatibility 0.52;
#X text 29 147 The 'compatibility' message takes a version number and sets the behavior of some objects back to that particular version. This can be useful in some cases if you want to guarantee that your patch will work in the same way as in the version you created it. This is because sometimes a new version of Pd may promote a change in the behavior of the object (usually to fix a bug) that can also break or change the result of a patch., f 62;
#X text 45 288 set compatibility to Pd 0.52;
#X text 273 277 set to Pd 0.49;
#X text 107 422 For example \, check the help file of:, f 18;
#X obj 258 431 wrap~;
#X obj 259 553 trace;
#X msg 54 545 \; pd set-tracing \$1;
#X obj 54 506 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#N canvas 598 98 712 610 fast-forward 0;
#X msg 176 449 stop;
#X obj 176 415 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X obj 176 342 trigger float float bang, f 25;
#X msg 262 423 fast-forward \$1;
#X obj 262 456 send pd;
#X obj 176 380 delay;
#X floatatom 176 311 5 0 8000 0 - - - 0;
#X text 79 311 milliseconds:;
#X obj 348 557 tabwrite~ fast-forward;
#X obj 371 463 noise~;
#X obj 371 522 *~;
#X text 479 335 --- 10 sec ---;
#X msg 62 240 \; pd dsp \$1;
#X obj 62 205 set-dsp-tgl;
#X text 93 209 <-- DSP on/off (make sure it is on);
#X text 219 310 <-- set other lengths;
#X text 376 422 <--;
#X text 423 463 <-- white noise generator;
#X text 76 448 stops the --> recording, f 13;
#X text 175 558 records to the array -->;
#X text 406 522 <-- amplitude modulation;
#X text 82 22 Pd is mostly used to generate and process things in realtime \, nonetheless \, the "fast-forward" message allows you to 'render' an amount of audio faster than realtime (and as fast as your CPU can handle) - this is also called 'batch processing'. In this example we use it to record 6 seconds of amplitude modulated white noise into an array., f 76;
#X text 82 105 This is very useful if you want to process a pre recorded audio in a Pd patch or to generate an audio file with a generative (or automated) patch. You can also use [soundfiler] to export to a sound file or directly use [writesf~] instead. The 'fast-forward' message takes a time in milliseconds to fast forward to. Check the example below., f 76;
#X text 354 373 <-- start recording;
#X msg 176 268 5000;
#X text 216 266 <-- time amount to render (5 seconds), f 19;
#N canvas 0 22 450 278 (subpatch) 0;
#X array fast-forward 480000 float 2;
#A color 0;
#A width 2;
#X coords 0 1 480000 -1 250 120 1 0 0;
#X restore 411 209 graph;
#X text 399 415 tells pd to 'fast-forward' and render the given amount of time in ms, f 37;
#X obj 389 493 osc~ 0.25;
#X text 57 379 sends a bang --> after the given time amount, f 16;
#X connect 0 0 8 0;
#X connect 1 0 0 0;
#X connect 2 0 5 0;
#X connect 2 1 3 0;
#X connect 2 2 8 0;
#X connect 3 0 4 0;
#X connect 5 0 1 0;
#X connect 6 0 2 0;
#X connect 9 0 10 0;
#X connect 10 0 8 0;
#X connect 13 0 12 0;
#X connect 24 0 6 0;
#X connect 28 0 10 1;
#X restore 779 326 pd fast-forward;
#N canvas 263 195 914 562 other-messages 0;
#X obj 86 212 pdcontrol;
#X msg 86 184 dir;
#X msg 697 196 \; pd verifyquit;
#X obj 86 466 pdcontrol;
#X msg 86 438 dir;
#X obj 567 26 cnv 15 300 80 empty empty empty 20 12 0 14 #f88c7c #404040 0;
#X text 739 47 UNSAVED PATCHES WILL BE LOST!!!, f 16;
#X text 42 29 Here are some more messages Pd receives that may be useful., f 30;
#N canvas 237 262 450 278 (subpatch) 0;
#X coords 0 1 100 -1 302 82 1 0 0;
#X restore 566 25 graph;
#X text 581 41 WARNING: the "quit" message quits and closes Pd!!!, f 20;
#X msg 736 365 \; pd perf \$1;
#X obj 736 335 tgl 22 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X text 462 243 The 'perf 1' message turns "performance" mode on \, and 'perf 0' turns it off. In performance mode \, a "close this window?" message appears when you try to close an unmodified patch. Also \, a "really quit?" message appears when you try to quit Pd and no changes have been made to the patch., f 58;
#X msg 86 242 \; pd open clone-abs-a.pd \$1;
#X text 39 312 The "menunew" message generates a new empty Pd file (but doesn't save it to disk unless you save the file.) It takes two symbols \, the first is the Pd filename and the second is the directory where it will be saved. This is also another form of dynamic patching (see next section on parent patch)., f 51;
#X text 461 18 And here are some more messages:, f 12;
#X text 510 341 Note that even in this mode the "quit" message to Pd will still mercilessly quit the Pd application., f 29;
#X msg 86 496 \; pd menunew new-patch.pd \$1;
#X msg 613 196 \; pd exit;
#X text 456 125 The 'exit' message is equally dangerous \, but it 'politely' asks the scheduler to quit \, closing properly all canvases. The 'verifyquit' message quits Pd but verifies if there are unsaved changes \, so it's safer!;
#X text 473 204 ALSO DANGEROUS -->;
#X text 804 202 (SAFER);
#X text 162 211 <-- get current directory;
#X text 162 465 <-- get current directory;
#X text 37 84 The "open" message opens a Pd file and takes two symbols \, the first is the Pd filename and the second is the directory where it lives. You can use this to open desired patches from within a patch - a.k.a "dynamic patching" (see next section on parent patch)., f 54;
#X obj 630 499 cnv 15 198 45 empty empty empty 20 12 0 14 #f88c7c #404040 0;
#N canvas 0 22 450 278 (subpatch) 0;
#X coords 0 1 100 -1 200 45 1 0 0;
#X restore 629 499 graph;
#X text 643 505 <-- Only try this if you know what you're doing!, f 24;
#X msg 554 505 \; pd vis;
#X msg 485 73 \; pd quit;
#X text 443 421 'vis' (without args) will stop the GUI. This may seem like Pd stopped \, but the process is still running. You can restart the GUI by sending a 'vis <path>' message \, with <path> being Pd's base directory (where 'tcl/pd-gui.tcl' is located)., f 62;
#X connect 0 0 13 0;
#X connect 1 0 0 0;
#X connect 3 0 17 0;
#X connect 4 0 3 0;
#X connect 11 0 10 0;
#X restore 781 377 pd other-messages;
#X text 22 627 see also:;
#X obj 139 628 samplerate~;
#X obj 97 628 send;
#X obj 228 628 namecanvas;
#X msg 387 628 message;
#X obj 77 24 cnv 15 242 27 empty empty Messages\ you\ can\ send\ to\ Pd: 11 14 0 14 #e0e0e0 #404040 0;
#X obj 524 447 cnv 15 420 27 empty empty Messages\ you\ can\ send\ to\ Patch\ windows\ (canvases) 15 14 0 14 #e0e0e0 #404040 0;
#X obj 524 473 cnv 15 420 27 empty empty (aka\ Dynamic\ patching): 117 12 0 14 #e0e0e0 #404040 0;
#N canvas 413 122 854 438 Dynamic-Patching 0;
#N canvas 338 52 659 663 creating-boxes 0;
#X obj 91 523 send pd-creating-boxes;
#X text 19 22 The 'obj' message creates objects boxes. It needs to be followed by a pair of x/y coordinates and then the object name followed by creation arguments (if necessary)., f 60;
#X msg 51 337 obj 470 35 float 5;
#X msg 69 365 msg 470 80 a message box;
#X msg 90 394 floatatom 470 120 \, symbolatom 470 140 \, listbox 470 160, f 19;
#X msg 107 453 text 470 190 a comment;
#X msg 120 486 obj 470 225 bng;
#X text 20 223 IEMGuis can be created as objects (such as [bng] for bang as the example below). An argument list is not documented yet \, you can check the source code but it also makes sense to connect a receive object to it and set its parameters with the documented methods (it's surely more readable).;
#X text 317 329 The arguments for the float/number/list boxes are the same. Just note that the limit values are invalid for the symbol box., f 39;
#X msg 387 386 \; pd-creating-boxes floatatom 100 570 7 -40 40 3 label r-sym s-sym 16, f 26;
#X text 318 407 click =>;
#X text 66 311 click these:;
#X text 19 74 The 'msg' message creates message boxes. After a pair of x/y coordinates you can specify the message's content.;
#X text 20 126 The 'floatatom' \, 'symbolatom' and 'listbox' message create \, respectively \, number \, symbol and list boxes. After a pair of x/y coordinates you can specify arguments (see below).;
#X text 20 187 The 'text' message creates a comment. After a pair of x/y coordinates you can specify the comment's content., f 60;
#X text 332 479 Arguments are \; - width (default 0 if created like this) \; - lower limit (default 0) \; - higher limit (default 0) \; - label position (0 <default>: left \, 1: right \, 2: top \, 3: bottom) \; - label symbol (default empty symbol) \; - receive symbol (default empty) \; - send symbol (default empty) \; - font size (default: 0 <auto>), f 42;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 4 0 0 0;
#X connect 5 0 0 0;
#X connect 6 0 0 0;
#X restore 283 353 pd creating-boxes;
#X obj 275 158 namecanvas;
#N canvas 461 65 592 579 Data-Structures 0;
#X msg 141 491 clear;
#X msg 41 364 vis \$1;
#X obj 41 334 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#N canvas 523 391 231 124 ds2 0;
#N canvas 261 467 557 157 template-toplevel 0;
#X obj 21 94 plot bazoo 700 3 10 20 20;
#X obj 21 68 drawpolygon q 4 0 0 20 z z -5 10 20;
#X obj 21 30 struct template-toplevel float x float y float z float q array bazoo template-element;
#X restore 32 29 pd template-toplevel;
#N canvas 280 487 477 161 template-element 0;
#X obj 58 83 drawpolygon 10 2 5 0 0 -5 -5 0 0 5 5 0;
#X obj 59 48 struct template-element float x float y float w;
#X restore 32 62 pd template-element;
#X restore 457 460 pd ds2;
#X text 65 334 show/hide;
#N canvas 361 282 477 221 ds 0;
#X obj 54 44 filledcurve 990 0 1 0 0 50 0 50 50 0 50;
#X obj 54 71 drawcurve 0 1 15 15 20 15 20 20 15 20 15 15;
#X obj 54 98 drawcurve 0 1 30 15 35 15 35 20 30 20 30 15;
#X obj 54 125 filledcurve 999 0 1 10 25 25 45 40 25 25 35 10 25;
#X obj 54 17 struct ds float x float y symbol sym;
#X obj 54 152 drawsymbol sym 55 25 0;
#X restore 456 399 pd ds;
#X msg 100 366 scalar ds 225 225 -hi_there!!;
#X text 317 360 add data structure scalar 'ds' (see [pd ds]) and 3 fields., f 30;
#X msg 117 407 read ds-text.txt;
#X text 187 492 clean it up;
#X msg 127 432 write ds-text-2.txt;
#X obj 141 466 loadbang;
#N canvas 164 235 514 421 \$0-DS-example 0;
#X restore 337 312 pd \$0-DS-example;
#X obj 102 526 s pd-\$0-DS-example;
#X text 216 312 click to open =>;
#X text 271 431 read/write from/to text (see [pd ds2]);
#X text 70 109 For more on Data Structures \, check section 4.data.structures in Pd's tutorial examples., f 61;
#X obj 102 166 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#N canvas 491 316 412 249 open 0;
#X obj 58 49 inlet;
#X obj 58 105 pdcontrol;
#X msg 58 78 dir;
#X msg 58 132 \; pd open 01.scalars.pd \$1/../4.data.structures;
#X connect 0 0 2 0;
#X connect 1 0 3 0;
#X connect 2 0 1 0;
#X restore 102 196 pd open;
#X text 126 165 <-- open first example of the 4.Data.Structure section;
#X text 66 242 Note you can also use "\$0" to give local names to subpatches. In this case we need to use [send] (as "\$0" doesn't work in messages)., f 61;
#X text 70 16 The 'read' and 'write' messages can be used to import and export contents of a window \, which is something used for Data Structures. A 'scalar' message adds a Data Structure scalar to the window. The 'clear' message clears the contentes of a window whatever they are (objects \, Data Structures \, arrays \, anything)., f 61;
#X connect 0 0 13 0;
#X connect 1 0 13 0;
#X connect 2 0 1 0;
#X connect 6 0 13 0;
#X connect 8 0 13 0;
#X connect 10 0 13 0;
#X connect 11 0 0 0;
#X connect 17 0 18 0;
#X restore 591 119 pd Data-Structures;
#N canvas 683 48 597 554 (dis)connecting-boxes 0;
#X obj 79 482 send pd-connect-boxes;
#N canvas 413 247 259 224 connect-boxes 0;
#X restore 357 477 pd connect-boxes;
#X msg 79 263 clear \, obj 70 40 bng \, obj 70 80 float 5 \, floatatom 70 120 \, vis 1, f 40;
#X text 85 237 clear \, create objects and show window:;
#X msg 109 326 connect 0 0 1 0;
#X text 229 318 connect object's 0 (bang) first outlet to object's 1 (float) first inlet., f 38;
#X text 240 362 connect object's 0 (bang) first outlet to object's 1 (float) first inlet., f 38;
#X msg 119 369 connect 1 0 2 0;
#X msg 145 445 clear \, vis 0;
#X msg 131 411 disconnect 0 0 1 0 \, disconnect 1 0 2 0;
#X text 416 411 same syntax.;
#X text 71 29 You can connect a pair of objects by using two pairs of numbers. The first pair identifies the object number and the outlet number. The second pair identifies the object number and inlet number to connect to. The 'disconnect' message has the same syntax., f 67;
#X text 71 94 The object's number is defined by its order of creation (indexed from 0). Every element in the patch counts (number boxes \, message boxes \, arrays and even comments). Inlets and outlets are also indexes from 0 \, by the way., f 67;
#X text 71 160 Being aware of an object number can be hard and tricky. The best way to control this is start a patch or subpatch from scratch. This way \, you can more easily know the number of the object by the order they were created., f 67;
#X connect 2 0 0 0;
#X connect 4 0 0 0;
#X connect 7 0 0 0;
#X connect 8 0 0 0;
#X connect 9 0 0 0;
#X restore 582 203 pd (dis)connecting-boxes;
#N canvas 407 108 849 512 save 0;
#X msg 326 121 menusave;
#X msg 367 171 menusaveas;
#X msg 386 221 menuclose;
#X text 453 163 opens a dialog for you to choose where to save., f 24;
#X msg 96 350 text 100 100 very nice;
#X msg 426 394 vis \$1;
#X obj 426 364 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X obj 405 273 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X msg 405 303 dirty \$1;
#X text 157 37 In this example we are sending messages to the main window of a different patch that we first create.;
#X obj 70 195 bng 19 250 50 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000;
#X obj 70 224 openpanel 1;
#X text 107 325 Now add something;
#X text 98 195 <-- choose a directory;
#X text 398 108 this will save and create the patch in the chosen directory. It'll also rewrite if it's already saved/created., f 40;
#X msg 70 254 \; pd menunew new-example.pd \$1;
#X obj 96 379 s pd-new-example.pd;
#X obj 367 437 s pd-new-example.pd;
#X text 478 267 Note that Pd won't ask you to save changes if they were made via dynamic patching. To make sure it asks you \, you can use the 'dirty 1' message. Conversely \, 'dirty 0' makes Pd ignore changes you made and doesn't ask you to save when you close the patch., f 47;
#X text 466 214 Closes the patch but asks you to save if changes were made (see considerations below)., f 48;
#X text 43 99 So first let's send a message to Pd to open a new patch/canvas in a directory of your choosing. Note that the file isn't saved or created yet in your hard drive., f 34;
#X connect 0 0 17 0;
#X connect 1 0 17 0;
#X connect 2 0 17 0;
#X connect 4 0 16 0;
#X connect 5 0 17 0;
#X connect 6 0 5 0;
#X connect 7 0 8 0;
#X connect 8 0 17 0;
#X connect 10 0 11 0;
#X connect 11 0 15 0;
#X restore 714 350 pd save;
#X text 582 341 Other messages (saving a patch):, f 17;
#X text 558 159 You can connect and disconnect boxes. See subpatch below:, f 30;
#X text 79 143 For reference \, please check the help file of -->, f 26;
#X obj 378 159 pdcontrol;
#X text 358 159 &;
#X text 45 268 Many of the menu entries in Pd (for instance \, when you create an object or message box) end up causing Pd to send a message to a named canvas. We can abuse this and also use such messages to control a canvas from a patch. See example below for how to create 'boxes'., f 62;
#N canvas 260 34 995 524 abstractions 0;
#X obj 119 173 send pd-abstractions;
#X obj 539 262 s pd-loadbang-example;
#N canvas 376 356 304 192 loadbang-example 0;
#X restore 782 211 pd loadbang-example;
#X msg 559 194 loadbang;
#X msg 539 118 clear \, obj 100 100 bng \, obj 100 75 loadbang \, connect 1 0 0 0 \, vis 1, f 23;
#X msg 578 231 clear \, vis 0;
#X msg 615 434 loadbang;
#X text 628 180 fire [loadbang] <-- objects, f 15;
#X obj 615 463 s pd-abstractions;
#X obj 802 436 loadbang;
#X obj 802 460 bng 19 250 50 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000;
#X msg 119 133 obj 150 225 rev3~ 100 90 3000 20;
#X msg 222 405 loadbang;
#X obj 222 445 send pd-rev3~.pd;
#X text 46 276 A 'loadbang' message will make [loadbang] objects output a bang. This is useful because when you create abstractions that contain a [loadbang] object (like [rev3~]) \, they don't get fired - so you have to force fire a 'loadbang' after they get created. One way to do this is to send the loadbang message to the abstraction file name.;
#X text 504 33 Note that creating a [loadbang] object itself via dynamic patching doesn't make it fire up either. So you probably want to send a 'loadbang' message afterwards.;
#X text 46 29 You can create abstractions just like you would create any other object in Pd. All you need to do is have the name of the abstraction as the object name followed by arguments if needed or desired. In this example we load [rev3~] \, an abstraction from the 'extra' library.;
#X text 518 318 The 'loadbang' message will fire [loadbang] objects that are placed in the canvas and also in subwindows of that canvas \, but not other loadbang objects elsewhere. Hence \, sending a loadbang message to this window will fire a loadbang in [rev3~] and in [pd loadbang-example] (as well as in this window of course)., f 57;
#X connect 3 0 1 0;
#X connect 4 0 1 0;
#X connect 5 0 1 0;
#X connect 6 0 8 0;
#X connect 9 0 10 0;
#X connect 11 0 0 0;
#X connect 12 0 13 0;
#X restore 622 288 pd abstractions \; and loadbangs;
#N canvas 550 46 607 633 vis 0;
#X msg 303 335 vis \$1;
#X obj 303 305 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X text 327 305 show/hide;
#X obj 170 526 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#N canvas 491 316 470 254 open 0;
#X obj 58 49 inlet;
#X obj 58 105 pdcontrol;
#X msg 58 78 dir;
#X msg 58 132 \; pd open 05.counter.pd \$1/../2.control.examples;
#X connect 0 0 2 0;
#X connect 1 0 3 0;
#X connect 2 0 1 0;
#X restore 170 576 pd open;
#X obj 210 345 rev1~;
#X obj 303 370 s pd-rev1~.pd;
#N canvas 164 235 514 421 subpatch 0;
#X restore 164 139 pd subpatch;
#X msg 288 131 vis \$1;
#X obj 288 101 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X text 312 101 show/hide;
#X obj 288 170 s pd-subpatch;
#X text 91 24 A 'vis 1' message shows the window while 'vis 0' hides it (so it doesn't get closed). In order to send messages to a subpatch name \, you need to precede its name with 'pd-'.;
#X msg 332 542 vis \$1;
#X obj 332 512 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X text 356 512 show/hide;
#X text 89 413 The thing is that an abstraction is a pd file that's loaded in another patch \, so nothing differs in respect to other pd files that are opened but not loaded as abstractions. Let's \, for instance \, open an arbitrary .pd file from Pd's control tutorial (05.counter.pd) and communicate with it.;
#X obj 332 581 s pd-05.counter.pd;
#X text 194 525 <-- first open file, f 11;
#X text 89 210 In the cases of abstractions and patch files you also need to precede the file name with 'pd-' \, but you also have to end it with the '.pd' extension (actually the extension is part of the window name \, so nothing is really different). Let's check this in practice with the [rev1~] abstraction., f 61;
#X connect 0 0 6 0;
#X connect 1 0 0 0;
#X connect 3 0 4 0;
#X connect 8 0 11 0;
#X connect 9 0 8 0;
#X connect 13 0 17 0;
#X connect 14 0 13 0;
#X restore 314 218 pd vis;
#X text 549 76 clear \, read \, write \, scalar (Data Structures) and "\$0":, f 34;
#X text 151 206 Let's start with the simple "vis" message:, f 21;
#X text 31 21 You can communicate with a Pd window by sending messages to the name of the pd file (which communicates to the main window of a patch or abstraction). You can also communicate with a subpatch's window. This will be shown shortly but note first that you can also name any window (main or subpatch) with [namecanvas] or \, alternatively \, use [pdcontrol] to send the same messages here documented., f 65;
#N canvas 313 300 450 293 goprect 0;
#N canvas 505 89 450 300 gop 0;
#X obj 91 80 bng 19 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000;
#X obj 171 80 hsl 162 19 0 127 0 0 empty empty empty -2 -10 0 12 #fcfcfc #000000 #000000 0 1;
#X coords 0 -1 1 1 100 70 1 50 50;
#X restore 31 156 pd gop;
#X obj 266 209 send pd-gop;
#X msg 281 181 goprect 150 50 200 70;
#X msg 266 152 goprect 50 50 100 70;
#X obj 266 123 loadbang;
#X text 33 20 Use the "goprect" message to set respectively the horizontal margin \, the vertical margin \, the width and height of a GOP ("Graph-On-Parent) rectangle. The width and height are optional so you can just set the margin if you want to., f 49;
#X connect 2 0 1 0;
#X connect 3 0 1 0;
#X connect 4 0 3 0;
#X restore 715 31 pd goprect;
#X text 531 31 resizing-GOP-subpatches:;
#X text 589 241 Handling abstractions and loadbangs:, f 22;
#X restore 675 567 pd Dynamic-Patching;
#X text 87 500 The set-tracing message is useful for debugging with the [trace] object. Check its help file., f 47;
#X obj 265 326 send pd;
#X text 29 74 We can use both the [send] object or message boxes to send messages to Pd. Here are some messages that makes sense for you to send to Pd from within a patch. Conversely \, you can also send Pd these messages via Pd's command line., f 62;
#X obj 733 156 send pd;
#X msg 265 299 compatibility 0.49;
#X text 595 24 The message "dsp 1" turns DSP on and "dsp 0" turns it off., f 32;
#X obj 733 99 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X obj 5 615 cnv 1 984 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#N canvas 0 22 450 278 (subpatch) 0;
#X coords 0 1 100 -1 244 28 1;
#X restore 76 24 graph;
#N canvas 0 22 450 278 (subpatch) 0;
#X coords 0 1 100 -1 422 54 1;
#X restore 523 447 graph;
#X obj 310 628 pdcontrol;
#N canvas 543 122 589 553 dsp-start/stop 0;
#X obj 93 119 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X obj 93 86 receive pd-dsp-started;
#X obj 307 86 receive pd-dsp-stopped;
#X text 117 119 when DSP is turned on;
#X text 330 119 when DSP is turned off;
#X obj 307 119 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X text 59 33 You can get a bang message sent by Pd when DSP starts or stops if you receive from 'pd-dsp-started' and 'pd-dsp-stopped'., f 65;
#X msg 223 284 \; pd dsp \$1;
#X obj 223 249 set-dsp-tgl;
#X text 254 253 <-- DSP on/off;
#X text 255 467 see also:;
#X obj 330 468 samplerate~;
#X text 86 178 These messages are used in the helper abstraction below to set the toggle according to the DSP state. This abstraction is used in Pd's documentation. Open it to check it out.;
#X text 85 354 Note that the you get a bang from 'pd-dsp-started' not only when audio is turned on \, but whenever the DSP chain gets updated \, as with new audio connections \, changes in settings such as a new sample rate or when the patch is saved. Check the help file of [samplerate~] that uses this feature to output the sample rate whenever it changes., f 63;
#X connect 1 0 0 0;
#X connect 2 0 5 0;
#X connect 8 0 7 0;
#X restore 780 266 pd dsp-start/stop;
#X text 539 310 The "fast-forward" message to Pd allows batch processing. Open --> the subpatch for an example., f 33;
#X text 559 376 Here are some other useful --> messages you can send to Pd., f 30;
#X text 584 518 Open the following subpatch for documentation on how to send messages to a patch window:, f 45;
#X obj 456 628 pd~;
#X text 35 376 Objects that change their behavior according to the set compatibility have that information in their help files.;
#X text 574 254 Pd sends you bangs when DSP is turned on or off \, see -->, f 28;
#N canvas 517 34 712 743 change-colors 0;
#X obj 66 344 send pd;
#X symbolatom 429 535 9 0 0 0 - - - 0;
#N canvas 882 167 390 482 label 0;
#X obj 102 80 vsl 15 128 0 255 0 0 empty empty empty 0 -9 0 10 #0800fc #fcfcfc #000000 0 1;
#X obj 109 225 t b f;
#X obj 81 80 vsl 15 128 0 255 0 0 empty empty empty 0 -9 0 10 #00fc00 #000000 #000000 0 1;
#X obj 80 341 pack s s s;
#X obj 61 80 vsl 15 128 0 255 0 0 empty empty empty 0 -9 0 10 #fc0000 #000000 #000000 0 1;
#X obj 81 250 t b f;
#X obj 147 257 makefilename %02x;
#X obj 113 284 makefilename %02x;
#X obj 74 311 makefilename %02x;
#X obj 80 406 outlet;
#X msg 80 370 symbol #\$1\$2\$3;
#X obj 161 185 loadbang;
#X msg 161 217 0;
#X text 56 56 selection;
#X obj 152 56 loadbang;
#X msg 152 88 255;
#X msg 160 118 set \$1;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 1 1 6 0;
#X connect 2 0 5 0;
#X connect 3 0 10 0;
#X connect 4 0 8 0;
#X connect 5 0 4 0;
#X connect 5 1 7 0;
#X connect 6 0 3 2;
#X connect 7 0 3 1;
#X connect 8 0 3 0;
#X connect 10 0 9 0;
#X connect 11 0 12 0;
#X connect 12 0 7 0;
#X connect 14 0 15 0;
#X connect 15 0 16 0;
#X connect 15 0 6 0;
#X connect 16 0 0 0;
#X coords 0 -1 1 1 80 170 2 50 50;
#X restore 429 357 pd label;
#X symbolatom 340 534 9 0 0 0 - - - 0;
#N canvas 890 211 390 482 label 0;
#X obj 102 80 vsl 15 128 0 255 0 0 empty empty empty 0 -9 0 10 #0800fc #fcfcfc #000000 0 1;
#X obj 109 225 t b f;
#X obj 81 80 vsl 15 128 0 255 0 0 empty empty empty 0 -9 0 10 #00fc00 #000000 #000000 0 1;
#X obj 74 341 pack s s s;
#X obj 61 80 vsl 15 128 0 255 0 0 empty empty empty 0 -9 0 10 #fc0000 #000000 #000000 0 1;
#X obj 81 250 t b f;
#X obj 146 257 makefilename %02x;
#X obj 112 284 makefilename %02x;
#X obj 74 311 makefilename %02x;
#X obj 74 406 outlet;
#X msg 74 370 symbol #\$1\$2\$3;
#X obj 164 156 loadbang;
#X msg 164 188 set 250;
#X obj 164 212 route set;
#X text 52 56 background;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 1 1 6 0;
#X connect 2 0 5 0;
#X connect 3 0 10 0;
#X connect 4 0 8 0;
#X connect 5 0 4 0;
#X connect 5 1 7 0;
#X connect 6 0 3 2;
#X connect 7 0 3 1;
#X connect 8 0 3 0;
#X connect 10 0 9 0;
#X connect 11 0 12 0;
#X connect 12 0 13 0;
#X connect 12 0 0 0;
#X connect 12 0 2 0;
#X connect 12 0 4 0;
#X connect 13 0 6 0;
#X connect 13 0 7 0;
#X coords 0 -1 1 1 80 170 2 50 50;
#X restore 340 357 pd label;
#X symbolatom 254 534 9 0 0 0 - - - 0;
#N canvas 799 177 390 482 label 0;
#X obj 102 80 vsl 15 128 0 255 0 0 empty empty empty 0 -9 0 10 #0800fc #fcfcfc #000000 0 1;
#X obj 109 225 t b f;
#X obj 81 80 vsl 15 128 0 255 0 0 empty empty empty 0 -9 0 10 #00fc00 #000000 #000000 0 1;
#X obj 61 80 vsl 15 128 0 255 0 0 empty empty empty 0 -9 0 10 #fc0000 #000000 #000000 0 1;
#X obj 81 250 t b f;
#X obj 221 257 makefilename %02x;
#X obj 141 284 makefilename %02x;
#X obj 61 321 makefilename %02x;
#X obj 61 416 outlet;
#X msg 61 380 symbol #\$1\$2\$3;
#X obj 176 59 loadbang;
#X obj 176 176 route set;
#X obj 61 351 pack symbol symbol symbol;
#X msg 176 91 set 0;
#X text 52 56 foreground;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 1 1 5 0;
#X connect 2 0 4 0;
#X connect 3 0 7 0;
#X connect 4 0 3 0;
#X connect 4 1 6 0;
#X connect 5 0 12 2;
#X connect 6 0 12 1;
#X connect 7 0 12 0;
#X connect 9 0 8 0;
#X connect 10 0 13 0;
#X connect 11 0 5 0;
#X connect 11 0 6 0;
#X connect 12 0 9 0;
#X connect 13 0 3 0;
#X connect 13 0 2 0;
#X connect 13 0 0 0;
#X connect 13 0 11 0;
#X coords 0 -1 1 1 80 170 2 50 50;
#X restore 254 357 pd label;
#X obj 397 563 t b s;
#X obj 309 563 t b s;
#X text 322 331 Set RGB values in the sliders;
#X listbox 254 636 33 0 0 0 - - - 0;
#X obj 174 390 loadbang;
#X obj 198 634 list;
#X obj 198 594 bng 21 250 50 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000;
#X text 371 123 The foreground color affects all boxes but iemguis and arrays \, which have their own foreground colors. The background affects the window canvas \, but iemguis also have their own background colors., f 43;
#X obj 254 606 pack symbol symbol symbol symbol, f 38;
#X symbolatom 517 535 9 0 0 0 - - - 0;
#N canvas 882 167 390 482 label 0;
#X obj 102 80 vsl 15 128 0 255 0 0 empty empty empty 0 -9 0 10 #0800fc #fcfcfc #000000 0 1;
#X obj 109 225 t b f;
#X obj 81 80 vsl 15 128 0 255 0 0 empty empty empty 0 -9 0 10 #00fc00 #000000 #000000 0 1;
#X obj 80 341 pack s s s;
#X obj 61 80 vsl 15 128 0 255 0 0 empty empty empty 0 -9 0 10 #fc0000 #000000 #000000 0 1;
#X obj 81 250 t b f;
#X obj 147 257 makefilename %02x;
#X obj 113 284 makefilename %02x;
#X obj 74 311 makefilename %02x;
#X obj 39 420 outlet;
#X msg 39 384 symbol #\$1\$2\$3;
#X obj 161 185 loadbang;
#X msg 161 217 0;
#X obj 152 56 loadbang;
#X msg 152 88 255;
#X msg 160 118 set \$1;
#X text 76 56 GOP;
#X obj 38 281 t b f;
#X obj 39 342 list;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 1 1 6 0;
#X connect 2 0 5 0;
#X connect 3 0 18 1;
#X connect 4 0 17 0;
#X connect 5 0 4 0;
#X connect 5 1 7 0;
#X connect 6 0 3 2;
#X connect 7 0 3 1;
#X connect 8 0 3 0;
#X connect 10 0 9 0;
#X connect 11 0 12 0;
#X connect 12 0 7 0;
#X connect 12 0 6 0;
#X connect 13 0 14 0;
#X connect 14 0 15 0;
#X connect 14 0 8 0;
#X connect 15 0 4 0;
#X connect 17 0 18 0;
#X connect 17 1 8 0;
#X connect 18 0 10 0;
#X coords 0 -1 1 1 80 170 2 50 50;
#X restore 517 357 pd label;
#X obj 485 563 t b s;
#X text 371 200 The selection color affects the outline and text of boxes. The GOP rectangle represents the viewing area of a GOP subwindow (like the ones below \, open them to check it out)., f 43;
#X text 89 595 set colors -->;
#X msg 22 158 colors #000000 #ffffff #0000ff #ff0000;
#X text 224 133 (default);
#X msg 54 193 colors #808080 #000000 #FF0000 #0000FF;
#X msg 77 229 colors #cccccc #800080 #ff00ff #ff0000;
#X msg 198 669 \; pd colors \$1 \$2 \$3 \$4;
#X msg 97 282 colors #8B7765 #FFE4E1 #D2691E;
#X text 37 434 Note that letters can be either lower or upper case., f 17;
#X msg 174 420 list #000000 #ffffff #0000ff #ff0000, f 7;
#X text 400 663 You can also set colors via startup with the "-send" flag \, for instance: -send "pd colors #cccccc #800080 #ff00ff #ff0000", f 36;
#X text 323 283 ('GOP' is left unchanged).;
#X text 47 14 With the "colors" message you can set colors for foregroung \, background \, selection and (optionally) GOP rectangle (if not set \, it remains the same). This is still experimental and might change in the future. It's not yet incorporated in Pd's preferences as it certainly should be and not fully implemented/integrated in the Pd GUI system. You must use RGB values in hexadecimal starting with "#". The default values for these are "#000000" (black) \, "#ffffff" (white) \, "#0000ff" (blue) and "#ff0000" (red). The letters in the hexadecimal symbols can be either lower or upper case., f 88;
#X connect 1 0 7 0;
#X connect 2 0 1 0;
#X connect 3 0 8 0;
#X connect 4 0 3 0;
#X connect 5 0 15 0;
#X connect 6 0 5 0;
#X connect 7 0 15 0;
#X connect 7 1 15 2;
#X connect 8 0 15 0;
#X connect 8 1 15 1;
#X connect 10 0 12 1;
#X connect 11 0 28 0;
#X connect 12 0 25 0;
#X connect 13 0 12 0;
#X connect 15 0 10 0;
#X connect 16 0 18 0;
#X connect 17 0 16 0;
#X connect 18 0 15 0;
#X connect 18 1 15 3;
#X connect 21 0 0 0;
#X connect 23 0 0 0;
#X connect 24 0 0 0;
#X connect 26 0 0 0;
#X connect 28 0 15 0;
#X restore 780 216 pd change-colors;
#X text 525 214 Message to set Pd's colors \, see -->;
#X text 780 627 updated for Pd version 0.56;
#X connect 0 0 27 0;
#X connect 12 0 11 0;
#X connect 28 0 25 0;
#X connect 30 0 0 0;
