aboutsummaryrefslogtreecommitdiff
path: root/canvas_name-help.pd
blob: 126874b991117c6f1d4ad0be40a9974107650328 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#N canvas 73 22 480 392 10;
#X obj 136 290 sys_gui;
#X symbolatom 254 206 0 0 0 0 - - -;
#X obj 241 145 loadbang;
#X msg 136 260 \$2 configure -background \$1;
#X obj 136 231 pack symbol symbol;
#X obj 86 64 colorpanel;
#X obj 67 356 pddp/pddplink http://tcl.tk/man/tcl8.4/TkCmd/canvas.htm
;
#X text 34 330 for more options:;
#N canvas 685 90 416 325 generate 0;
#X obj 81 23 inlet;
#X obj 82 262 outlet;
#X obj 83 66 unpack float float float;
#X obj 83 90 * 255;
#X obj 83 113 int;
#X obj 83 136 makefilename %x;
#X obj 183 90 * 255;
#X obj 183 113 int;
#X obj 183 136 makefilename %x;
#X obj 283 90 * 255;
#X obj 283 113 int;
#X obj 283 136 makefilename %x;
#X obj 83 171 pack symbol symbol symbol;
#X obj 83 195 zexy/makesymbol #%s%s%s;
#X connect 0 0 2 0;
#X connect 2 0 3 0;
#X connect 2 1 6 0;
#X connect 2 2 9 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 5 0 12 0;
#X connect 6 0 7 0;
#X connect 7 0 8 0;
#X connect 8 0 12 1;
#X connect 9 0 10 0;
#X connect 10 0 11 0;
#X connect 11 0 12 2;
#X connect 12 0 13 0;
#X connect 13 0 1 0;
#X restore 86 85 pd generate web color;
#X obj 86 20 bng 35 250 50 0 empty empty empty 17 7 0 10 -204786 -1
-1;
#X symbolatom 106 113 10 0 0 0 - - -;
#X obj 198 293 print;
#X obj 241 182 canvas_name;
#X msg 138 143 grey;
#X msg 148 162 white;
#X msg 158 183 pink;
#X msg 162 205 black;
#N canvas 373 75 457 313 get 0;
#X symbolatom 42 225 0 0 0 0 - - -;
#X obj 42 204 canvas_name;
#X obj 42 181 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X symbolatom 126 225 0 0 0 0 - - -;
#X obj 126 181 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#N canvas 0 22 450 300 subname 0;
#X obj 117 21 inlet;
#X obj 119 265 outlet;
#X obj 107 137 canvas_name;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X restore 126 204 pd subname;
#X symbolatom 209 225 0 0 0 0 - - -;
#X obj 209 181 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#N canvas 496 269 450 300 get 0;
#X obj 117 21 inlet;
#X obj 119 265 outlet;
#X obj 109 137 canvas_name 1;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X restore 209 204 pd get parent;
#X symbolatom 73 118 0 0 0 0 - - -;
#X obj 73 74 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X text 47 26 You can get the canvas name of other patches that this
one is embedded in by setting the argument to the level:;
#X obj 73 97 canvas_name 1;
#X text 78 137 ^-- this is the same as the top level of this help patch
;
#X symbolatom 299 225 0 0 0 0 - - -;
#X obj 299 181 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#N canvas 496 269 450 300 get 0;
#X obj 117 21 inlet;
#X obj 119 265 outlet;
#X obj 109 137 canvas_name 2;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X restore 299 204 pd get parent of parent;
#N canvas 169 157 481 329 get 0;
#X symbolatom 114 120 0 0 0 0 - - -;
#X obj 101 96 canvas_name 1;
#X symbolatom 119 205 0 0 0 0 - - -;
#X obj 84 66 loadbang;
#X obj 106 181 canvas_name 0;
#X symbolatom 43 204 0 0 0 0 - - -;
#X obj 30 180 canvas_name;
#N canvas 0 22 450 300 add 0;
#X symbolatom 175 224 0 0 0 0 - - -;
#X obj 162 200 canvas_name 1;
#X symbolatom 264 224 0 0 0 0 - - -;
#X obj 251 200 canvas_name 2;
#X symbolatom 85 224 0 0 0 0 - - -;
#X obj 175 101 loadbang;
#X obj 72 200 canvas_name 0;
#X text 59 28 Now 0 is this subpatch \, 1 is the "pd get from parent"
subpatch that this subpatch is in \, and 2 is the "canvas_name-help.pd"
patch.;
#X connect 1 0 0 0;
#X connect 3 0 2 0;
#X connect 5 0 1 0;
#X connect 5 0 3 0;
#X connect 5 0 6 0;
#X connect 6 0 4 0;
#X restore 164 267 pd add another level;
#X text 31 14 Following the interface of [getdir] and others \, you
can get the canvas name from parent patches by using a float to represent
how many levels up you want to get:;
#X text 36 237 To see it in action with a 2nd level \, check this subpatch:
;
#X text 189 204 <-- these two are the same since Pd inits to 0;
#X text 187 119 <-- this gets the canvas name from the parent;
#X connect 1 0 0 0;
#X connect 3 0 1 0;
#X connect 3 0 4 0;
#X connect 3 0 6 0;
#X connect 4 0 2 0;
#X connect 6 0 5 0;
#X restore 183 267 pd get from parent;
#X text 43 268 some more examples:;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 4 0 5 0;
#X connect 5 0 3 0;
#X connect 7 0 8 0;
#X connect 8 0 6 0;
#X connect 10 0 12 0;
#X connect 12 0 9 0;
#X connect 15 0 16 0;
#X connect 16 0 14 0;
#X restore 265 51 pd get from different levels;
#N canvas 0 22 450 300 get 0;
#X symbolatom 73 259 0 0 0 0 - - -;
#X obj 73 215 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X symbolatom 72 176 0 0 0 0 - - -;
#X obj 72 132 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 72 155 canvas_name pd-test;
#X obj 73 238 canvas_name pd-canvas_name-help.pd;
#N canvas 0 22 450 300 test 0;
#X restore 221 155 pd test;
#X obj 220 77 namecanvas myname;
#X symbolatom 73 99 0 0 0 0 - - -;
#X obj 73 55 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 73 78 canvas_name myname;
#X text 53 14 You can also use the canvas receive symbol to get the
canvas_name:;
#X connect 1 0 5 0;
#X connect 3 0 4 0;
#X connect 4 0 2 0;
#X connect 5 0 0 0;
#X connect 9 0 10 0;
#X connect 10 0 8 0;
#X restore 265 76 pd get by canvas receive symbol;
#X connect 2 0 12 0;
#X connect 3 0 0 0;
#X connect 3 0 11 0;
#X connect 4 0 3 0;
#X connect 5 0 8 0;
#X connect 8 0 10 0;
#X connect 8 0 4 0;
#X connect 9 0 5 0;
#X connect 12 0 1 0;
#X connect 12 0 4 1;
#X connect 13 0 4 0;
#X connect 14 0 4 0;
#X connect 15 0 4 0;
#X connect 16 0 4 0;