409 changes: 353 additions & 56 deletions doc/5.reference/Pd-messages.pd
@@ -1,11 +1,12 @@
#N canvas 505 106 1023 606 12;
#X obj 624 189 s pd;
#X msg 624 160 dsp \$1;
#X msg 801 166 \; pd dsp 0;
#X obj 624 135 tgl 17 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#N struct template1 float x float y float z float q;
#N canvas 606 60 1039 684 12;
#X obj 626 180 s pd;
#X msg 626 151 dsp \$1;
#X msg 803 157 \; pd dsp 0;
#X obj 626 126 tgl 17 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000 0 1;
#X text 649 133 turn DSP engine on/off;
#X msg 727 166 \; pd dsp 1;
#X text 651 124 turn DSP engine on/off;
#X msg 729 157 \; pd dsp 1;
#X obj 283 315 s pd;
#X msg 74 298 \; pd compatibility 0.52;
#X msg 283 288 compatibility 0.49;
Expand All @@ -31,8 +32,6 @@ that makes sense for you to send to Pd from within a patch. Conversely
#X msg 72 534 \; pd set-tracing \$1;
#X obj 72 497 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000 0 1;
#X text 105 489 the set-tracing message is useful for debugging with
the [trace] object. Check its help file., f 47;
#N canvas 731 117 720 669 fast-forward 0;
#X msg 176 499 stop;
#X obj 176 466 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
Expand Down Expand Up @@ -96,79 +95,377 @@ we use it to record 6 seconds of white noise into an array., f 74
#X connect 24 0 26 0;
#X connect 26 0 20 0;
#X connect 27 0 26 1;
#X restore 821 390 pd fast-forward;
#N canvas 608 91 947 589 other-messages 0;
#X text 650 344 WARNING: This will quit and close Pd!!!, f 20;
#X text 671 393 UNSAVED PATCHES WILL BE LOST!!!, f 16;
#X restore 821 381 pd fast-forward;
#N canvas 608 91 960 556 other-messages 0;
#X msg 651 465 \; pd quit;
#X obj 167 231 pdcontrol;
#X msg 167 203 dir;
#X obj 602 486 s pd;
#X msg 602 459 quit;
#X msg 585 110 \; pd audio-properties;
#X msg 582 270 \; pd verifyquit;
#X text 693 271 Quits Pd but verifies if there are unsaved changes
#X msg 585 100 \; pd audio-properties;
#X msg 585 264 \; pd verifyquit;
#X text 696 265 Quits Pd but verifies if there are unsaved changes
, f 25;
#X text 731 463 <= You've been warned. Do it at your own risk!, f
23;
#X msg 585 197 \; pd start-startup-dialog;
#X text 49 130 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.
, f 64;
#X msg 167 261 \; pd open help-intro.pd \$1;
#X text 243 230 <= get currently directory;
#X obj 167 450 pdcontrol;
#X msg 167 422 dir;
#X text 243 449 <= get currently directory;
#X msg 167 480 \; pd menunew new-patch \$1;
#X text 45 336 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 lives. You can use this for dynamic patching., f 64;
#X text 581 78 Open audio settings;
#X obj 156 466 pdcontrol;
#X msg 156 438 dir;
#X text 232 465 <= get currently directory;
#X msg 156 496 \; pd menunew new-patch \$1;
#X text 590 78 Open audio settings;
#X text 589 173 Open startup;
#X text 51 35 Here are some more messages Pd receives when using the
software's menus besides the "dsp" message. There are much more messages
that Pd can internally receive and you can search the source code for
if you're clever enough. But most of them aren't that useful. Here
are some potentially interesting messages though., f 65;
#X text 561 35 And here are some more:;
#X connect 3 0 13 0;
#X text 570 34 And here are some more:;
#X text 59 332 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 lives. You can use this for dynamic patching (see next section
on parent patch)., f 64;
#X obj 639 333 cnv 15 170 100 empty empty empty 20 12 0 14 #f88c7c
#404040 0;
#X text 649 346 WARNING: This will quit and close Pd!!!, f 20;
#X text 667 389 UNSAVED PATCHES WILL BE LOST!!!, f 16;
#X obj 723 459 cnv 15 178 45 empty empty empty 20 12 0 14 #f88c7c #404040
0;
#X text 731 463 <= You've been warned. Do it at your own risk!, f
23;
#X connect 1 0 10 0;
#X connect 2 0 1 0;
#X connect 4 0 3 0;
#X connect 6 0 5 0;
#X connect 15 0 18 0;
#X connect 16 0 15 0;
#X restore 850 481 pd other-messages;
#X text 816 552 updated for Pd 0.52;
#X text 531 26 Pd gets also receives messages when you browse through
the Menus and click on something. We can also send such messages from
within the patch. The most widely used one is the "DSP" message that
we send to Pd when we go to the "media menu" and click on "DSP On"
or "DSP Off" \, which sends \, respectively \, the messages: "dsp 1"
and "dsp 0"., f 64;
#X text 570 380 The "fast-forward" message to Pd allows batch processing.
#X connect 12 0 15 0;
#X connect 13 0 12 0;
#X restore 841 459 pd other-messages;
#X text 406 635 updated for Pd 0.52;
#X text 570 371 The "fast-forward" message to Pd allows batch processing.
Open the subpatch for an example., f 32;
#X text 550 471 Here are some other maybe interesting (maybe not) messages
#X text 541 449 Here are some other maybe interesting (maybe not) messages
you can send to Pd., f 41;
#X text 565 554 see also:;
#X obj 682 553 samplerate~;
#X obj 640 553 send;
#X obj 567 321 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#X text 40 635 see also:;
#X obj 157 636 samplerate~;
#X obj 115 636 send;
#X obj 567 312 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#X obj 567 288 receive pd-dsp-started;
#X obj 781 288 receive pd-dsp-stopped;
#X obj 781 321 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#X obj 567 279 receive pd-dsp-started;
#X obj 781 279 receive pd-dsp-stopped;
#X obj 781 312 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#X text 587 320 when DSP is turned on;
#X text 804 320 when DSP is turned off;
#X text 536 237 Note you can get a bang message Pd sends when DSP starts
or stops in Pd if you receive from 'pd-dsp-started' and 'pd-dsp-stopped'.
#X text 587 311 when DSP is turned on;
#X text 804 311 when DSP is turned off;
#X obj 246 636 namecanvas;
#X msg 334 636 message;
#X obj 68 18 cnv 15 242 27 empty empty Messages\\\ you\\\ can\\\ send\\\ to\\\ Pd:
10 12 0 14 #e0e0e0 #404040 0;
#X obj 584 524 cnv 15 390 27 empty empty Messages\\\ you\\\ can\\\ send\\\ to\\\ Pd\\\ files\\\ and\\\ canvases
10 12 0 14 #e0e0e0 #404040 0;
#X obj 584 551 cnv 15 390 27 empty empty (aka\\\ Dynamic\\\ patching):
100 12 0 14 #e0e0e0 #404040 0;
#N canvas 899 385 786 394 Dynamic-Patching 0;
#X text 98 127 For reference \, please check the help file of =>,
f 25;
#X text 31 21 You can communicate with a Pd window by sending messages
to the name of the file (which communicates to the main window). You
can also commucate with a subpatch's window by sending messages to
the subpatch's name. In both cases you need to preceed the send name
with 'pd-'. Alternatively you can name a main window or a subpatch
with [namecanvas]., f 62;
#X text 31 183 Many of the menu entries in Pd end up making Pd send
a message to a canvas name. For instance \, when you create an object
or message box. See example below for creating 'boxes'., f 62;
#N canvas 849 41 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 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 19 74 The 'msg' message creates message boxes. after a pair
of x/y coordinates you can specify the message's content.;
#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 text 336 483 Arguments are \; - width (default 0) \; - lower limit
(default 0) \; - higher limit (ddefault 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 39;
#X text 20 126 The 'floatatom' \, 'symbolatom' andd 'listbox' message
create \, respectively \, number \, symbol and list boxes. After a
pair of x/y coordinates you can specify arguments \, see below.;
#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 connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 4 0 0 0;
#X connect 7 0 0 0;
#X connect 8 0 0 0;
#X restore 177 253 pd creating-boxes;
#N canvas 713 136 1102 596 creating-arrays 0;
#X obj 154 441 s pd-mygraph;
#N canvas 319 193 394 307 make-array 0;
#X restore 330 231 pd make-array;
#X obj 169 239 s pd-make-array;
#X text 57 30 Graphical arrays live in subpatches. More specifically
'graphs' \, which are just subpatches with a 'graph on 'parent' selection.
, f 65;
#X msg 169 177 graph mygraph;
#X text 57 66 You can create graphs with the 'graph' message \, it
expects a graph name \, which is the name of the subpatch you can then
send messages to., f 65;
#X text 276 178 <= create graph;
#X msg 176 412 clear;
#X msg 99 175 vis \$1;
#X obj 99 146 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000 0 1;
#X text 119 144 <= open;
#X msg 191 208 clear;
#X text 59 291 Now we use the 'array' message to add an array named
'array1' \, with 100 points. The data type is a float and the display
format is '2' (points), f 64;
#X text 221 410 clears array from 'mygraph';
#X obj 128 536 s array1;
#X text 340 491 and now you can send messages to array to set it up
as well., f 21;
#X msg 155 376 array array1 10 float;
#X msg 128 501 style 0 \, color 900 \, width 3;
#X obj 615 494 ../2.control.examples/15.array;
#X obj 614 522 ../2.control.examples/16.more.arrays;
#X text 839 492 <= click;
#X text 878 524 <= click;
#X text 498 506 ===> see also:;
#X obj 627 190 s pd-make-array;
#X obj 591 339 s pd-another-graph;
#X msg 766 181 \; pd-another-graph vis 0;
#X msg 602 97 vis 1 \, clear;
#X text 698 98 reinitialize;
#X text 838 135 create subpatch;
#X text 937 189 hide it;
#X msg 627 134 obj 100 100 pd another-graph;
#X msg 591 296 coords 0 1 10 -1 200 100 2 0 0, f 17;
#X msg 640 421 clear;
#X msg 619 385 array array1 10 float;
#X obj 618 450 s pd-another-graph;
#X text 685 419 clears array from 'pd-another-graph';
#X text 589 239 We can now set the window's properties with the 'coords'
message \, which is also useful for general 'Graph on Parent' configuration.
, f 65;
#X text 736 287 Arguments are \; - bounds: xmin \, ymax \, xmax \,
ymin \; - size: xsize \, ysize \; - gop flag (0: no gop \, 1: gop \,
2: gop+hide) \; - margin: xmargin \, ymargin.;
#X text 781 385 finally create the array.;
#X text 562 19 We can also restart from scratch and start by creating
a subpatch with the 'pd' object. This gives us the option to place
the subpatch/graph wherever we want. Note that when we create a subpatch
like that it shows its content \, so we send 'vis 0' to it so it closes.
, f 70;
#X connect 4 0 2 0;
#X connect 7 0 0 0;
#X connect 8 0 2 0;
#X connect 9 0 8 0;
#X connect 11 0 2 0;
#X connect 16 0 0 0;
#X connect 17 0 14 0;
#X connect 26 0 23 0;
#X connect 30 0 23 0;
#X connect 31 0 24 0;
#X connect 32 0 34 0;
#X connect 33 0 34 0;
#X restore 551 275 pd creating-arrays;
#X text 526 27 You can create objects and also connect them to create
patches. See subpatch below:, f 28;
#N canvas 592 374 529 443 loadbang 0;
#X text 63 32 A 'loadbang' message will make [loadbang] objects output
a bang. This is useful because when you create abstractions that contain
a loadbang object \, they don't get fired \, so you have to force fire
after you created your abstraction(s)., f 58;
#X obj 94 313 s pd-loadbang-example;
#N canvas 376 356 304 192 loadbang-example 0;
#X restore 302 212 pd loadbang-example;
#X text 63 112 Creating a [loadbang] object itself via dynamic patching
also doesn't make it fire. So you may also need to send a 'loadbang'
message afterwards., f 58;
#X msg 114 263 loadbang;
#X msg 94 197 clear \, obj 100 100 bng \, obj 100 75 loadbang \, connect
1 0 0 0 \, vis 1, f 23;
#X text 55 372 The 'loadbang' message will fire [loadbang] objects
that are place in the named canvas and also in subwindows of that canvas
\, but not other loadbang objects elsewhere.;
#X text 184 264 fire loadbang;
#X connect 4 0 1 0;
#X connect 5 0 1 0;
#X restore 580 174 pd loadbang;
#X obj 284 142 namecanvas;
#N canvas 1027 261 592 528 Data-Structures 0;
#X text 70 14 A 'vis 1' message shows the window while 'vis 0' hides
it. The 'read' and 'write' messages can be usedd to import and export
contents of a window \, mostly used for Data Structures. The 'clear'
message clears the contentes of a window whatever they are (objects
\, Data Sructures \, arrays \, anything). A 'scalar' message adds a
Data Structure scalar to the window., f 62;
#X text 70 109 For more on Data Structures \, check section 4.data.structures
in Pd's tutorial examples. See 1st example of the series below.;
#X obj 160 154 ../4.data.structures/01.scalars;
#X msg 140 439 clear;
#X msg 41 307 vis \$1;
#X obj 41 280 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000 0 1;
#N canvas 523 391 191 85 ds2 0;
#N canvas 50 470 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 11 11 pd template-toplevel;
#N canvas 199 231 600 239 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 11 34 pd template-element;
#X restore 362 385 pd ds2;
#X text 62 278 show/hide;
#N canvas 361 282 477 239 ds 0;
#X obj 52 45 filledcurve 990 0 1 0 0 50 0 50 50 0 50;
#X obj 52 72 drawcurve 0 1 15 15 20 15 20 20 15 20 15 15;
#X obj 52 99 drawcurve 0 1 30 15 35 15 35 20 30 20 30 15;
#X obj 52 126 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 52 153 drawsymbol sym 55 25 0;
#X restore 474 344 pd ds;
#X msg 100 309 scalar ds 225 225 -hi_there!!;
#X text 322 307 add data structure scalar 'ds' (see [pd ds]) and 3
fields., f 30;
#X msg 116 356 read ds-text.txt;
#X text 249 361 read/write from/to text;
#X text 327 386 see;
#X text 186 440 clean it up;
#X msg 126 381 write ds-text-2.txt;
#X obj 140 414 loadbang;
#N canvas 291 367 514 421 \$0-DS-example 0;
#X restore 363 460 pd \$0-DS-example;
#X obj 102 474 s pd-\$0-DS-example;
#X text 66 202 Note you can also use "\$0" to give local names to subpatches.
This is useful for abstractions in general. In this case we need to
use [send] as "\$0" doesn't work in messages., f 61;
#X connect 3 0 18 0;
#X connect 4 0 18 0;
#X connect 5 0 4 0;
#X connect 9 0 18 0;
#X connect 11 0 18 0;
#X connect 15 0 18 0;
#X connect 16 0 3 0;
#X restore 267 323 pd Data-Structures;
#N canvas 835 158 597 554 (dis)connecting-boxes 0;
#X obj 79 482 send pd-connect-boxes;
#N canvas 545 273 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 text 71 160 Being aware of the object number can be hard and tricky.
The best way to control this is start a patch or subpatch from scratch
in a subpatch. This way \, you the number of the object by the order
they were created., f 67;
#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 are defined by their 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 connect 2 0 0 0;
#X connect 4 0 0 0;
#X connect 7 0 0 0;
#X connect 9 0 0 0;
#X connect 10 0 0 0;
#X restore 539 99 pd (dis)connecting-boxes;
#X text 552 142 loadbang handling:;
#X text 535 227 Creating an array is also possible \, see example:
, f 25;
#N canvas 992 149 809 381 save 0;
#X msg 326 71 menusave;
#X msg 367 121 menusaveas;
#X msg 386 171 menuclose;
#X obj 70 138 pdcontrol;
#X msg 70 110 dir;
#X text 49 52 first let's send a message to Pd to create a new patch/cavas.
, f 32;
#X text 104 109 <= go;
#X msg 70 168 \; pd menunew new-example \$1;
#X obj 367 283 s pd-new-example;
#X text 398 58 this will save and create the patch in the directory
you created. It'll also rewrite if it's already saved., f 39;
#X text 453 113 opens a dialog for you to choose where to save., f
24;
#X obj 114 285 s pd-new-example;
#X msg 114 256 text 100 100 very nice;
#X text 466 164 closes the patch without saving if the changes were
made with dynamic patching., f 40;
#X msg 411 245 vis \$1;
#X obj 411 215 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000 0 1;
#X text 480 212 note 'vis 0' doesn't close the patch \, just hides
it (and shows it too if it's opened)., f 31;
#X text 131 232 add something;
#X connect 0 0 8 0;
#X connect 1 0 8 0;
#X connect 2 0 8 0;
#X connect 3 0 7 0;
#X connect 4 0 3 0;
#X connect 12 0 11 0;
#X connect 14 0 8 0;
#X connect 15 0 14 0;
#X restore 641 333 pd save;
#X text 503 324 Other messages (saving a patch):, f 17;
#X text 68 302 clear \, vis \, read \, write and scalar (Data Structures)
and "\$0":, f 34;
#X restore 800 640 pd Dynamic-Patching;
#X text 105 489 The set-tracing message is useful for debugging with
the [trace] object. Check its help file., f 47;
#X text 531 17 Pd gets also receives messages when you browse through
the Menus and click on something. We can also send such messages from
within the patch. The most widely used one is the "DSP" message that
we send to Pd when we click on the DSP toggle on the Pd window or go
to the "media menu" and click on "DSP On" or "DSP Off" \, which sends
\, respectively \, the messages: "dsp 1" and "dsp 0"., f 66;
#X text 536 221 Note 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 text 61 21 Messages you can send to Pd:;
#X text 690 593 Open subpatch for documentation on how to send messages
to to a patch window:, f 31;
#X connect 1 0 0 0;
#X connect 3 0 1 0;
#X connect 8 0 6 0;
#X connect 18 0 17 0;
#X connect 30 0 29 0;
#X connect 31 0 32 0;
#X connect 28 0 27 0;
#X connect 29 0 30 0;
39 changes: 39 additions & 0 deletions doc/5.reference/ds-text.txt
@@ -0,0 +1,39 @@
data;
template template-toplevel;
float x;
float y;
float z;
float q;
array bazoo template-element;
;
template template-element;
float x;
float y;
float w;
;
;
template-toplevel 76 177 -66 85;
0 0 0;
30 0 0;
0 111 8;
-47 22 0;
0 0 0;
0 70 0;
0 70 70;
70 70 0;
0 70 0;
;
template-toplevel 196 109 77 802;
-20 77 0;
0 0 4;
67 59 0;
0 76 12;
-45 -68 0;
;
template-toplevel 150 250 20 80;
0 0 0;
40 0 4;
60 50 0;
100 30 3;
200 0 0;
;
92 changes: 79 additions & 13 deletions doc/5.reference/namecanvas-help.pd
@@ -1,13 +1,79 @@
#N canvas 402 55 524 371 12;
#X obj 39 20 namecanvas;
#X obj 39 108 namecanvas bonzo;
#X text 291 309 updated for Pd version 0.44;
#X text 131 20 - attach this canvas to a name;
#X text 34 150 This is sometimes the only way to send a message to
a canvas when making graph-on-parent abstractions \, but its use in
making self-editing patches is dangerous since if you use it to edit
the namecanvas itself away you can cause Pd to crash. Instead \, you
can just say:;
#X msg 38 65 \; bonzo msg 280 50 hi there;
#X msg 38 237 \; pd-namecanvas-help.pd msg 280 80 this is safer but
only possible if you know the name of the canvas in advance.;
#N struct template1 float x float y float z float q;
#N canvas 585 36 884 508 12;
#X obj 50 19 namecanvas;
#X obj 248 156 namecanvas bonzo;
#X text 132 19 - attach this canvas to a name;
#N canvas 802 23 559 186 subpatch 0;
#X obj 70 57 namecanvas banzai;
#X text 229 46 This subpatch has its own name. It can receive messages
sent to it from anywhere., f 34;
#X msg 200 200 hi there;
#X msg 200 200 hi there;
#X msg 200 200 hi there;
#X msg 200 200 hi there;
#X msg 200 200 hi there;
#X msg 200 200 hi there;
#X msg 200 200 hi there;
#X msg 200 200 hi there;
#X msg 100 100 hi there;
#X msg 100 100 hi there;
#X msg 100 150 how are ya?;
#X msg 100 150 how are ya?;
#X restore 503 90 pd subpatch;
#X text 144 420 <= but you need to know the name of the canvas (file)
in advance., f 32;
#X text 18 47 You can use namecanvas to attach a receive name to a
canvas (patch window). This way you can send messages to the canvas
and set its properties or tell it to create and connect objects. This
is useful for 'dynamic patching'. Below \, we use it to name this canvas
'bonzo' and send it a message that makes it create a message box.,
f 55;
#X msg 33 364 \; pd-namecanvas-help.pd msg 40 420 this is safer;
#X msg 40 420 this is safer;
#X text 32 466 Note this doesn't make it possible to use "\$0".;
#X text 442 91 open =>;
#X text 801 89 click;
#X msg 600 81 \; banzai msg 100 100 hi there;
#X text 19 231 This is sometimes the only way to send a message to
a canvas when initializing graph-on-parent abstractions with local
parameters (using "\$0" to give it a local name). But its use in making
self-editing patches is dangerous since if you use it to edit the namecanvas
itself away you can cause Pd to crash. Instead \, you can use the file
name (preceded by "pd-") to access its main window \, see:, f 53;
#X msg 433 215 \; pd-subpatch msg 100 150 how are ya?;
#X obj 709 236 s pd-subpatch;
#X msg 709 213 vis \$1;
#X obj 709 193 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000 0 1;
#X text 441 13 You can use namecanvas to name subwindoes (subpatches).
But then you can also send messages to the subpatch using the subpatch's
name (also preceded by 'pd-')., f 55;
#X text 442 132 You can give the same name with [namecanvas] to different
windows to communicate to them with a single message. Similarly \,
any other patch or subpatch with the same name will receive the same
messages.;
#X text 728 190 show/hide window;
#X obj 458 346 namecanvas \$0-local-name;
#N canvas 488 451 446 165 \$0-local-subpatch 0;
#X text 75 83 A local subpatch \, useful in abstractions.;
#X restore 460 428 pd \$0-local-subpatch;
#X obj 680 418 s pd-\$0-local-subpatch;
#X obj 459 400 s \$0-local-name;
#X msg 20 171 \; bonzo msg 240 190 hey there;
#X msg 459 373 msg 320 190 wassup?;
#X msg 240 190 hey there;
#X msg 320 190 wassup?;
#X msg 680 355 vis 1;
#X msg 690 386 vis 0;
#X text 456 471 see also:;
#X obj 533 471 pd-messages;
#X text 705 469 updated for Pd 0.52;
#X text 433 265 You can also give multiple names to a single canvas
with [namecanvas] \, below we give it a local name with "\$0". You
can also use "\$0" in the name of subpatches. You then need to use
[send] as "\$0" doesn't work in messages.;
#X connect 15 0 14 0;
#X connect 16 0 15 0;
#X connect 25 0 23 0;
#X connect 28 0 22 0;
#X connect 29 0 22 0;
12 changes: 6 additions & 6 deletions doc/5.reference/plot-help.pd
Expand Up @@ -4,7 +4,7 @@ array array2 help-plot-array2-template array array3 help-plot-array3-template
#N struct help-plot-array1-template float y;
#N struct help-plot-array2-template float x float y;
#N struct help-plot-array3-template float y float w;
#N canvas 568 102 513 268 12;
#N canvas 568 102 488 256 12;
#N canvas 593 51 523 756 help-plot-template 0;
#X text 30 44 creation arguments:;
#X text 50 269 - RGB color (0=black \, 999=white \, 900=red \, 90=green
Expand Down Expand Up @@ -46,27 +46,27 @@ variable \, plot ignores x spacing requests and takes x from the data
itself., f 59;
#X text 47 144 - optional "-e [const or variable]" to enable/disable
editing, f 62;
#X restore 243 78 pd help-plot-template;
#X restore 242 79 pd help-plot-template;
#N canvas 754 260 353 124 help-plot-array1-template 0;
#X obj 30 71 filledpolygon 0 0 0 -5 0 0 5 5 0 0 -5;
#X obj 32 27 struct help-plot-array1-template float y;
#X restore 242 101 pd help-plot-array1-template;
#N canvas 665 269 402 83 help-plot-array2-template 0;
#X obj 32 26 struct help-plot-array2-template float x float y;
#X restore 243 123 pd help-plot-array2-template;
#N canvas 138 129 411 207 help-plot-data 1;
#N canvas 138 129 411 207 help-plot-data 0;
#X scalar help-plot-template 39 73 \; 0 \; 20 \; 0 \; 28 \; 0 \; \;
-9 -4 \; 0 10 \; 20 0 \; 0 -30 \; -40 0 \; 0 50 \; 60 0 \; \; 0 0 \;
10 10 \; 0 8 \; 0 1 \; 20 1 \; 20 10 \; 20 1 \; \;;
#X restore 242 57 pd help-plot-data;
#X text 51 133 see also:;
#X obj 57 181 drawnumber;
#X obj 45 22 plot;
#X text 87 22 -- draw array elements of scalars;
#X obj 57 206 drawpolygon;
#N canvas 599 270 419 104 help-plot-array3-template 0;
#X obj 43 32 struct help-plot-array3-template float y float w;
#X restore 242 144 pd help-plot-array3-template;
#X obj 57 157 struct;
#X text 34 90 explanation is in here ==>;
#X text 241 210 updated for Pd version 0.52;
#X text 56 79 explanation is in here ==>;
#X text 223 202 updated for Pd version 0.52;
#X text 87 22 - draw array elements of scalars;