#N canvas 450 71 529 560 12;
#X obj 85 250 bng 18 250 50 0 empty empty empty 8 -8 0 10 #dfdfdf #000000 #000000;
#X obj 112 313 tgl 55 0 empty empty Big\ Toggle 63 26 2 16 #dcdcdc #b40000 #ff0400 0 1;
#N canvas 568 187 676 290 old-behavior 0;
#X floatatom 38 57 5 0 0 0 - - - 0;
#X floatatom 89 217 5 0 0 0 - - - 0;
#X msg 257 190 \; pd compatibility 0.45;
#X msg 436 191 \; pd compatibility 0.46;
#X text 274 228 Old "compatible" behavior, f 16;
#X text 443 228 Mew "correct" behavior;
#X obj 89 166 tgl 30 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1.23;
#X floatatom 89 45 5 0 0 0 - - - 0;
#X msg 89 69 nonzero \$1;
#X msg 112 100 set 1.23;
#X msg 118 130 set 0;
#X text 213 138 You can get the old behavior globally by sending Pd a compatibility message as below:, f 60;
#X text 213 28 Pressing the toggle \, if it is in "off" state \, resets it to its "value" which is normally one. Prior to Pd version 0.46 \, the value itself was changed if non-zero numbers were sent to the toggle. Now they pass through but don't change the nonzero value anymore \, which may still be changed explicitly with a "nonzero" message. The behavior change also affects the set message \, because it also used to change the nonzero value.;
#X connect 0 0 6 0;
#X connect 6 0 1 0;
#X connect 7 0 8 0;
#X connect 8 0 6 0;
#X connect 9 0 6 0;
#X connect 10 0 6 0;
#X restore 339 409 pd old-behavior;
#X floatatom 112 382 4 0 0 0 - - - 0;
#X obj 38 12 tgl 18 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#N canvas 564 216 614 464 position 0;
#X floatatom 142 146 4 0 1000 0 - - - 0;
#X obj 191 173 t b f;
#X floatatom 191 146 5 0 500 0 - - - 0;
#X msg 142 243 pos \$1 \$2;
#X text 63 146 x-position;
#X text 235 145 y-position;
#X msg 264 183 delta 1 0;
#X text 337 182 increase x by 1;
#X msg 274 205 delta -1 0;
#X text 353 204 decrease x by 1;
#X msg 286 239 delta 0 1;
#X msg 292 261 delta 0 -1;
#X text 363 238 increase y by 1;
#X text 376 263 decrease y by 1;
#X msg 301 293 delta 1 1;
#X text 376 294 increase both by 1;
#X text 394 315 decrease both by -1;
#X msg 308 315 delta -1 -1;
#X obj 142 202 pack 265 350;
#X text 293 66 The 'delta' message changes the position of the object by a difference amount. It takes a list of x/y delta in pixels., f 40;
#X text 40 66 The 'pos' message takes a list of x/y coordinates in pixels and sets the objects's position., f 33;
#X text 159 19 You can also set and change the position of the object in the patch. Check below:, f 41;
#X obj 265 350 tgl 30 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X connect 0 0 18 0;
#X connect 1 0 18 0;
#X connect 1 1 18 1;
#X connect 2 0 1 0;
#X connect 3 0 22 0;
#X connect 6 0 22 0;
#X connect 8 0 22 0;
#X connect 10 0 22 0;
#X connect 11 0 22 0;
#X connect 14 0 22 0;
#X connect 17 0 22 0;
#X connect 18 0 3 0;
#X restore 376 243 pd position;
#N canvas 444 196 357 405 properties 0;
#N canvas 735 54 631 565 colors 0;
#X floatatom 71 244 3 0 29 0 - - - 0;
#X floatatom 107 244 3 0 29 0 - - - 0;
#X floatatom 176 249 3 0 29 0 - - - 0;
#X text 103 224 front;
#X text 169 224 label;
#X obj 107 273 t b f;
#X obj 176 275 t b f;
#X msg 71 343 color \$1 \$2 \$3;
#X obj 71 306 pack 0 22 22, f 20;
#X text 180 343 presets;
#X symbolatom 506 340 9 0 0 0 - - - 0;
#N canvas 1111 221 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 text 66 56 label;
#X obj 80 406 outlet;
#X msg 80 370 symbol #\$1\$2\$3;
#X obj 161 185 loadbang;
#X msg 161 217 0;
#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 11 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 11 0 10 0;
#X connect 12 0 13 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 506 158 pd label;
#X symbolatom 420 339 9 0 0 0 - - - 0;
#N canvas 939 210 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 text 69 56 front;
#X msg 74 370 symbol #\$1\$2\$3;
#X obj 177 168 loadbang;
#X msg 177 200 0;
#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 11 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 11 0 9 0;
#X connect 12 0 13 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 420 158 pd label;
#X symbolatom 334 339 9 0 0 0 - - - 0;
#N canvas 879 154 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 text 52 56 background;
#X msg 61 380 symbol #\$1\$2\$3;
#X obj 176 59 loadbang;
#X msg 176 91 set 255;
#X obj 176 176 route set;
#X obj 61 351 pack symbol symbol symbol;
#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 14 2;
#X connect 6 0 14 1;
#X connect 7 0 14 0;
#X connect 10 0 8 0;
#X connect 11 0 12 0;
#X connect 12 0 3 0;
#X connect 12 0 2 0;
#X connect 12 0 0 0;
#X connect 12 0 13 0;
#X connect 13 0 5 0;
#X connect 13 0 6 0;
#X connect 14 0 10 0;
#X coords 0 -1 1 1 80 170 2 50 50;
#X restore 334 158 pd label;
#X obj 474 370 t b s;
#X obj 388 370 t b s;
#X obj 243 209 loadbang;
#X obj 334 408 pack symbol symbol symbol;
#X msg 334 437 color \$1 \$2 \$3;
#X msg 256 263 list #ffffff #000000 #000000, f 7;
#X obj 243 408 metro 500;
#X obj 243 376 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X text 20 224 background;
#X text 443 438 RGB in hexadecimal;
#X text 47 17 The 'color' message takes a list of three values to set background \, front and label colors \, respectively. Integers from 0 to 29 represent the 30 preset colors found in the properties window \, values above are wrapped., f 77;
#X text 345 133 Set RGB values in the sliders;
#X text 60 157 Open subpatches for the conversion from RGB to hexadecimal ============>, f 38;
#N canvas 836 206 530 504 old_way 0;
#N canvas 1056 348 402 495 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 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 text 66 56 label;
#X obj 59 361 expr -($f1 * 65536 + $f2 * 256 + $f3 + 1);
#X obj 311 319 t b f;
#X obj 169 319 t b f;
#X obj 59 413 outlet;
#X connect 0 0 5 0;
#X connect 1 0 6 0;
#X connect 2 0 4 0;
#X connect 4 0 7 0;
#X connect 5 0 4 0;
#X connect 5 1 4 2;
#X connect 6 0 4 0;
#X connect 6 1 4 1;
#X coords 0 -1 1 1 80 170 2 50 50;
#X restore 355 133 pd label;
#X obj 67 251 loadbang;
#X obj 67 314 metro 500;
#X obj 67 285 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X text 194 108 Set RGB values in the sliders;
#N canvas 803 214 392 476 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 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 61 361 expr -($f1 * 65536 + $f2 * 256 + $f3 + 1);
#X obj 313 269 t b f;
#X obj 171 269 t b f;
#X obj 61 413 outlet;
#X text 52 56 background;
#X obj 180 83 loadbang;
#X msg 202 134 set 255;
#X msg 181 195 255 255 255;
#X connect 0 0 4 0;
#X connect 1 0 5 0;
#X connect 2 0 3 0;
#X connect 3 0 6 0;
#X connect 4 0 3 0;
#X connect 4 1 3 2;
#X connect 5 0 3 0;
#X connect 5 1 3 1;
#X connect 8 0 9 0;
#X connect 8 0 10 0;
#X connect 9 0 0 0;
#X connect 9 0 1 0;
#X connect 9 0 2 0;
#X connect 10 0 3 0;
#X coords 0 -1 1 1 80 170 2 50 50;
#X restore 183 133 pd label;
#N canvas 976 360 402 495 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 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 59 361 expr -($f1 * 65536 + $f2 * 256 + $f3 + 1);
#X obj 311 319 t b f;
#X obj 169 319 t b f;
#X obj 59 413 outlet;
#X text 66 56 front;
#X connect 0 0 4 0;
#X connect 1 0 5 0;
#X connect 2 0 3 0;
#X connect 3 0 6 0;
#X connect 4 0 3 0;
#X connect 4 1 3 2;
#X connect 5 0 3 0;
#X connect 5 1 3 1;
#X coords 0 -1 1 1 80 170 2 50 50;
#X restore 269 133 pd label;
#X text 31 162 Open subpatches for the conversion ====>, f 20;
#X msg 243 370 color -1.67772e+07 -1 -1;
#N canvas 574 194 328 335 pack 0;
#X obj 73 47 inlet;
#X obj 123 47 inlet;
#X obj 206 47 inlet;
#X msg 73 152 color \$1 \$2 \$3;
#X obj 206 85 t b f;
#X obj 123 85 t b f;
#X obj 73 123 pack float -1 -1, f 24;
#X obj 73 187 list prepend set;
#X obj 73 213 list trim;
#X obj 73 246 t b a;
#X obj 73 283 outlet;
#X connect 0 0 6 0;
#X connect 1 0 5 0;
#X connect 2 0 4 0;
#X connect 3 0 7 0;
#X connect 4 0 6 0;
#X connect 4 1 6 2;
#X connect 5 0 6 0;
#X connect 5 1 6 1;
#X connect 6 0 3 0;
#X connect 7 0 8 0;
#X connect 8 0 9 0;
#X connect 9 0 10 0;
#X connect 9 1 10 0;
#X restore 243 334 pd pack;
#X f 8;
#X obj 243 415 tgl 50 0 empty empty Label 55 24 0 25 #ffffff #000000 #000000 0 1;
#X text 108 14 The RGB color scheme can also be encoded \, for backwards compatibility \, as negative inetegers. For "R" (red) \, "G" (green) & "B" (blue) values from 0 to 255 \, the conversion formula is \; float = -(R * 65536 + G * 256 + B + 1)., f 47;
#X connect 0 0 9 2;
#X connect 1 0 3 0;
#X connect 2 0 10 0;
#X connect 3 0 2 0;
#X connect 5 0 9 0;
#X connect 6 0 9 1;
#X connect 8 0 10 0;
#X connect 9 0 8 0;
#X restore 62 508 pd old_way;
#X text 34 450 open subpatch below for the old way of encoding RGB values., f 20;
#X text 48 68 Negative integers were used to encode RGB values (and that still works for backwards compatibility). But since Pd 0.47-0 \, you can set colors with hexadecimal RGB symbol values \, which are followed by "#" \, check it below., f 77;
#X text 35 432 See also:;
#X obj 243 489 tgl 50 0 empty empty Label 55 24 0 25 #ffffff #000000 #000000 0 1;
#X connect 0 0 8 0;
#X connect 1 0 5 0;
#X connect 2 0 6 0;
#X connect 5 0 8 0;
#X connect 5 1 8 1;
#X connect 6 0 8 0;
#X connect 6 1 8 2;
#X connect 7 0 33 0;
#X connect 8 0 7 0;
#X connect 10 0 16 0;
#X connect 11 0 10 0;
#X connect 12 0 17 0;
#X connect 13 0 12 0;
#X connect 14 0 19 0;
#X connect 15 0 14 0;
#X connect 16 0 19 0;
#X connect 16 1 19 2;
#X connect 17 0 19 0;
#X connect 17 1 19 1;
#X connect 18 0 21 0;
#X connect 18 0 23 0;
#X connect 19 0 20 0;
#X connect 20 0 33 0;
#X connect 21 0 19 0;
#X connect 22 0 33 0;
#X connect 23 0 22 0;
#X coords 0 0 1 1 85 60 0;
#X restore 158 240 pd colors;
#N canvas 828 151 361 325 size 0;
#X floatatom 130 108 3 8 100 0 - - - 0;
#X text 157 108 size;
#X msg 130 145 size \$1;
#X text 48 22 The size message sets the object's size. The value represents the width in pixels for each side of the square., f 35;
#X obj 130 193 tgl 18 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X connect 0 0 2 0;
#X connect 2 0 4 0;
#X restore 172 100 pd size;
#N canvas 699 128 598 452 label 0;
#X msg 92 286 label \$1;
#X floatatom 239 168 4 0 3 0 - - - 0;
#X obj 281 195 t b f;
#X floatatom 281 168 5 5 50 0 - - - 0;
#X msg 239 265 label_font \$1 \$2;
#X text 201 167 type;
#X text 325 166 size;
#X obj 239 101 vradio 19 1 0 3 empty empty empty 0 -8 0 10 #dfdfdf #000000 #000000 0;
#X text 262 100 DejaVu Sans Mono;
#X text 262 121 Helvetica;
#X text 262 141 Times;
#X msg 104 254 symbol empty;
#X floatatom 393 184 4 -200 100 0 - - - 0;
#X obj 435 211 t b f;
#X floatatom 435 184 5 -150 150 0 - - - 0;
#X msg 393 281 label_pos \$1 \$2;
#X obj 393 239 pack 17 7, f 11;
#X text 375 183 x;
#X text 479 182 y;
#X text 388 160 label offset:;
#X msg 72 189 symbol label;
#X msg 92 218 symbol my\ label;
#X text 99 28 The 'label' message sets the label symbol \, setting it to "empty" clears it. The 'label_font' message sets font type and font size \, while 'label_pos' sets the x/y coordinates.;
#X obj 240 365 tgl 40 0 empty empty label 45 20 0 20 #dfdfdf #000000 #000000 0 1;
#X obj 239 224 pack 0 20, f 11;
#X connect 0 0 23 0;
#X connect 1 0 24 0;
#X connect 2 0 24 0;
#X connect 2 1 24 1;
#X connect 3 0 2 0;
#X connect 4 0 23 0;
#X connect 7 0 1 0;
#X connect 11 0 0 0;
#X connect 12 0 16 0;
#X connect 13 0 16 0;
#X connect 13 1 16 1;
#X connect 14 0 13 0;
#X connect 15 0 23 0;
#X connect 16 0 15 0;
#X connect 20 0 0 0;
#X connect 21 0 0 0;
#X connect 24 0 4 0;
#X restore 165 212 pd label;
#N canvas 855 201 424 388 init 0;
#X msg 174 188 init \$1;
#X obj 174 156 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X text 52 27 The 'init' message takes a float and sets to 'init mode' (if different than zero) or 'no init' (if equal to zero - the default value)., f 45;
#X obj 174 231 tgl 50 1 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 1 1;
#X obj 174 305 print tgl-init;
#X text 52 78 If in 'init mode' \, when loading the patch \, the objects sends its holding value from when the patch was last saved., f 45;
#X connect 0 0 3 0;
#X connect 1 0 0 0;
#X connect 3 0 4 0;
#X restore 172 156 pd init;
#N canvas 507 183 841 420 send-receive 0;
#X msg 222 191 receive empty;
#X msg 253 255 send empty;
#X text 53 96 The 'send' and 'receive' messages take a symbol to set \, respectively \, the send and receive symbol. If you set these to "empty" \, the symbols are cleared., f 50;
#X text 53 20 The object can have a send and receive symbol \, in which cases the inlet/outlet are visually hidden (but still functional in the patch). This way \, the object can communicate to [send] and [receive] objects., f 50;
#X msg 89 201 0;
#X msg 78 174 1;
#X obj 78 232 s \$0-tgl_rcv;
#X obj 80 283 r \$0-tgl_snd;
#X floatatom 80 320 5 0 0 0 - - - 0;
#X obj 221 313 tgl 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X msg 206 166 receive \\\$0-tgl_rcv;
#X msg 244 231 send \\\$0-tgl_snd;
#X text 437 22 Note how you need to escape dollar signs with backslashes to set something like "\$0-x". But the backslash is not needed if you set it directly via the properties window., f 50;
#X floatatom 553 375 5 0 0 0 - - - 0;
#X obj 557 276 tgl 50 0 \$0-tgl \$0-tgl empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X obj 550 233 s \$0-tgl;
#X obj 554 351 r \$0-tgl;
#X msg 561 202 0;
#X msg 550 175 1;
#X text 437 96 Feedback protection: iemguis can have the same name for both the send and receive symbols. This works without 'stack overflow' errors because they have feedback protection. See example below., f 50;
#X connect 0 0 9 0;
#X connect 1 0 9 0;
#X connect 4 0 6 0;
#X connect 5 0 6 0;
#X connect 7 0 8 0;
#X connect 10 0 9 0;
#X connect 11 0 9 0;
#X connect 16 0 13 0;
#X connect 17 0 15 0;
#X connect 18 0 15 0;
#X restore 116 184 pd send-receive;
#N canvas 882 246 447 314 loading-args 0;
#X text 59 115 For instance \, below \, we have \$0 used in the label field \, which gets expanded to the patch ID number. Using something like "\$1" is useful if you're using the object in an abstraction \, then you can load a value passed as an argument into a parameter., f 49;
#X obj 158 220 tgl 50 0 empty empty \$0-Label 57 23 0 14 #dcdcdc #000000 #000000 0 1;
#X text 59 26 Note that all the parameters that you can set by inserting a number or symbol into a field in the properties window can also load dollar sign arguments (\$0 \, \$1 \, \$2 \, and so on). Namely \, these parameters are: size \, nonzero value \, send/receive symbols \, label \, label offset and font size., f 49;
#X restore 124 338 pd loading-args;
#X text 111 294 Loading arguments in properties:, f 17;
#X text 46 23 All the parameters from the properties window can be set via messages as well. See examples and more details on each parameter in the subpatches below:, f 39;
#N canvas 884 142 379 377 nonzero 0;
#X floatatom 182 182 4 -100 100 0 - - - 0;
#X obj 83 184 tgl 18 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X obj 182 262 tgl 40 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 28;
#X msg 182 215 nonzero \$1;
#X floatatom 182 322 7 0 0 0 - - - 0;
#X text 97 25 The 'nonzero' message sets the non zero value of the toggle \, which is the value it outputs when it's on., f 27;
#X text 97 89 Note that negative values are also possible., f 27;
#X obj 83 159 loadbang;
#X obj 83 214 metro 1000;
#X connect 0 0 3 0;
#X connect 1 0 8 0;
#X connect 2 0 4 0;
#X connect 3 0 2 0;
#X connect 7 0 1 0;
#X connect 8 0 2 0;
#X restore 151 128 pd nonzero;
#X restore 362 215 pd properties;
#X text 68 11 - [toggle]/[tgl]: Toggle Button;
#X text 207 254 change state without output, f 14;
#X text 35 243 change state, f 6;
#X text 272 447 (c) musil@iem.kug.ac.at;
#X text 308 461 IEM KUG \, Graz \, Austria \, 2002, f 14;
#X text 69 521 see also:;
#X text 62 446 This object is part of the "iemguis" library \, natively included in Pd version 0.34., f 28;
#X text 280 521 updated for Pd version 0.51;
#X obj 112 412 print tgl;
#X text 24 142 Insert it from the Put menu (named as "Toggle") or its shortcut. Alternatively \, create it by typing "toggle" or "tgl" into an object box. Right click for properties (to set size \, colors \, labels \, etc)., f 67;
#X floatatom 112 250 4 0 0 0 - - - 0;
#X msg 159 271 set 0;
#N canvas 667 86 415 450 examples 0;
#X obj 82 67 tgl 30 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X obj 82 120 select 0 1;
#X obj 115 158 bng 20 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000;
#X obj 82 158 bng 20 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000;
#X obj 82 20 bng 20 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000;
#X text 183 58 Using toggle to alternate between two bangs., f 17;
#X obj 88 296 tgl 20 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X obj 88 335 metro 500;
#X obj 88 378 bng 20 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000;
#X obj 207 335 spigot;
#X obj 246 296 tgl 20 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X floatatom 196 296 5 0 0 0 - - - 0;
#X floatatom 207 378 5 0 0 0 - - - 0;
#X text 56 210 Many objects take a non zero value to turn something on \, and then zero value to turn it off. For instance \, "metro" and "spigot"., f 35;
#X connect 0 0 1 0;
#X connect 1 0 3 0;
#X connect 1 1 2 0;
#X connect 4 0 0 0;
#X connect 6 0 7 0;
#X connect 7 0 8 0;
#X connect 9 0 12 0;
#X connect 10 0 9 1;
#X connect 11 0 9 0;
#X restore 376 273 pd examples;
#X text 24 54 The toggle button is a GUI (Graphical User Interface) object that outputs number values alternating between 0 (when off) and a non zero value when on (default 1). It changes its state via clicks and also when receiving bang messages. Floats are passed through and the object changes its state when alternating between zero and nonzero values. A set message changes the state without output., f 67;
#X text 299 314 COMPATIBILITY NOTE: as of Pd 0.46 \, sending numbers through a toggle no longer resets the "nonzero" value. See how to get the old behavior back:, f 26;
#X msg 112 209 1;
#X msg 144 211 0;
#X obj 143 522 all_guis;
#X obj 12 41 cnv 1 500 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#N canvas 691 139 590 385 reference 0;
#X obj 18 43 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0;
#X obj 18 317 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000 0;
#X obj 18 355 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0;
#X text 75 113 size <float> - set size in pixels., f 65;
#X text 76 151 init <float> - non zero sets to init mode., f 56;
#X text 61 207 label <symbol> - set label., f 67;
#X text 48 188 receive <symbol> - set receive symbol name., f 60;
#X text 69 170 send <symbol> - set send symbol name., f 57;
#X text 40 226 label_font <f \, f> -;
#X text 180 226 set label type <0: DejaVu Sans Mono \, 1: Helvetica \, 2: Times> and font size., f 50;
#X text 47 258 label_pos <f \, f> - set label's x/y position., f 69;
#X text 75 278 color <list> -;
#X text 180 278 set colors of background \, front and label. Symbols for hexadecimal values or floats for presets., f 50;
#X obj 42 10 tgl 18 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X text 69 9 - [toggle]/[tgl]: Toggle Button.;
#X text 124 74 float - values pass through (non zero activates toggle)., f 58;
#X text 131 54 bang - changes toggle's state., f 57;
#X text 122 326 float -;
#X text 178 326 zero and non-zero value depending on state.;
#X text 54 132 nonzero <float> - set non-zero value (default 1).;
#X text 82 94 set <float> - zero sets to off \, non-zero sets to on (no output)., f 64;
#X restore 395 11 pd reference;
#X text 327 11 click =>;
#X obj 12 508 cnv 1 500 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X msg 155 248 set 14;
#X connect 0 0 1 0;
#X connect 1 0 3 0;
#X connect 3 0 15 0;
#X connect 17 0 1 0;
#X connect 18 0 1 0;
#X connect 22 0 17 0;
#X connect 23 0 17 0;
#X connect 29 0 1 0;
