diff --git a/pd/doc/5.reference/file-help.pd b/pd/doc/5.reference/file-help.pd new file mode 100644 index 000000000..41c5016d9 --- /dev/null +++ b/pd/doc/5.reference/file-help.pd @@ -0,0 +1,1461 @@ +#N canvas 437 23 566 697 12; +#X text 441 70 details:; +#X text 439 53 click for; +#N canvas 190 61 1062 654 handle 0; +#X obj 123 484 file handle; +#X msg 110 164 open /tmp/test.c r; +#X msg 185 444 close; +#X msg 130 222 1024; +#X text 168 223 read (up to) 1024 bytes; +#X obj 123 537 print data, f 5; +#X msg 141 256 seek 3; +#X text 198 258 seek to the 3rd byte; +#X text 280 379 seek to the next byte; +#X msg 123 193 1; +#X text 156 192 read the next byte; +#X msg 35 189 open \$1; +#X obj 35 164 openpanel; +#X obj 565 484 file handle; +#X msg 654 446 close; +#X msg 601 289 seek 3; +#X text 655 289 seek to the 3rd byte; +#X obj 486 182 savepanel; +#X msg 486 207 open \$1 w; +#X msg 560 181 open /tmp/test.c a; +#X msg 572 211 open /tmp/test.c c; +#X msg 586 245 104 101 108 108 111 32 119 111 114 108 100 13 10, f 26; +#X text 248 166 explicit Read-mode; +#X text 704 180 open file for writing (Append mode); +#X text 713 204 open file for writing (Create (or trunCate) mode), f 27; +#X text 777 252 write some bytes; +#X obj 351 21 file; +#X obj 229 557 print INFO; +#X text 67 529 list of bytes read, f 7; +#X text 721 492 if opening the file or writing to it fails \, the file is closed and a bang is sent to the 2nd outlet., f 44; +#X text 330 595 when seeking \, the position from the start of the file (or -1 on error) is output here., f 44; +#X msg 640 412 creationmode 0o600; +#X msg 150 289 seek 3 start; +#X text 248 282 seek to the 3rd byte from the "start", f 21; +#X msg 158 321 seek 0 end; +#X msg 165 351 seek -1 end; +#X msg 172 381 seek 1 current; +#X msg 179 413 seek -1 relative; +#X text 304 402 seek to the previous byte ("relative" is an alias for "current"), f 22; +#X text 237 320 seek to the end-of-file; +#X text 251 350 seek to the last byte; +#X msg 621 347 seek 10 end; +#X text 707 345 seek beyond the end of file; +#X msg 611 319 seek 10 start; +#X text 714 320 seek to the 10th byte; +#X msg 629 378 seek 10 current; +#X obj 639 508 print INFO; +#X text 778 406 restrict permissions of the to-be-created file, f 24; +#X obj 197 530 t a a; +#X obj 197 591 route bang seek; +#X floatatom 248 618 5 0 0 1 - - - 0; +#X text 748 374 seek to the 10th byte from the current position, f 27; +#X obj 48 21 file handle; +#N canvas 692 43 571 468 reference 0; +#X obj 7 44 cnv 5 550 5 empty empty INLETS: 8 18 0 13 #202020 #000000 0; +#X obj 7 231 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 6 440 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 24 13 file handle; +#X text 116 12 - operate on file handles.; +#X obj 7 198 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 7 74 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X text 94 78 open - open a file., f 37; +#X text 150 96 float - read number of bytes.; +#X text 108 114 seek - seek file., f 35; +#X text 150 132 close - close file., f 29; +#X text 144 203 symbol - change the associated file-handle.; +#X text 80 150 verbose - set verbosity on or off.; +#X obj 7 286 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 7 257 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X text 158 262 list - data bytes.; +#X text 108 289 bang -; +#X text 158 289 if file can't be opened \, end of the file is reached or a read error occurred., f 51; +#X text 53 323 seek - seek output., f 66; +#X text 45 170 creationmode - restrict permissions of the to-be-created file., f 70; +#X text 83 378 -q: set quiet verbosity., f 63; +#X text 83 396 -v: set loud verbosity., f 63; +#X text 83 414 -m: file creation mode (user/group/other permissions) in octal., f 63; +#X obj 7 350 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 7 376 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0; +#X restore 948 21 pd reference; +#X obj 21 51 cnv 1 1025 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#X text 140 20 - operate on file handles.; +#X text 231 438 close file, f 5; +#X text 510 155 <-- open file in Write mode; +#X text 702 441 close file, f 5; +#X text 153 620 close; +#X obj 35 136 bng 19 250 50 0 empty empty empty -35 10 0 10 #dfdfdf #000000 #000000; +#X text 134 62 The data you read from or write to a file are lists of bytes \, which appear in Pd as lists of numbers from 0 to 255 (using out-of-range numbers or symbols leads to undefined behavior.) The 2nd inlet of the [file handle] object is documented in the [pd file define] subpatch., f 121; +#X text 394 20 - short form for [file handle].; +#X text 314 551 If the file cannot be opened \, a bang is sent to the 2nd outlet. When the end of the file is reached or a read error occurred \, the file is closed and a bang is sent too., f 85; +#X obj 486 156 bng 19 250 50 0 empty empty empty -35 10 0 10 #dfdfdf #000000 #000000; +#X obj 197 618 bng 19 250 50 0 empty empty empty -35 10 0 10 #dfdfdf #000000 #000000; +#X text 288 618 pos; +#N canvas 453 93 754 409 flags 0; +#X obj 136 82 file handle -q; +#X text 264 82 less verbose (quiet); +#X obj 136 112 file handle -v; +#X text 264 112 more verbose (loud); +#X obj 96 233 file handle -m 0o600; +#X text 296 228 file creation mode (user/group/other permissions) in octal.; +#X msg 563 96 verbose \$1; +#X obj 563 121 file; +#X obj 563 70 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X text 138 31 error reporting on the Pd-console; +#X text 43 98 via flags:; +#X text 453 96 via a message:; +#X text 67 167 restricted permissions of created files:; +#X text 104 298 via a message:; +#X obj 96 348 file; +#X text 295 328 the creation mode only affects files that are created after the mode has been set.; +#X msg 96 323 creationmode 0o600; +#X text 294 266 the actual permissions of the created file also takes the umask into account. this might be ignored by the underlying filesystem.; +#X text 99 199 via creation flags:; +#X connect 6 0 7 0; +#X connect 8 0 6 0; +#X connect 16 0 14 0; +#X restore 384 502 pd flags; +#X text 127 127 reading files:; +#X text 538 127 writing files:; +#X connect 0 0 5 0; +#X connect 0 1 48 0; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 3 0 0 0; +#X connect 6 0 0 0; +#X connect 9 0 0 0; +#X connect 11 0 0 0; +#X connect 12 0 11 0; +#X connect 13 1 46 0; +#X connect 14 0 13 0; +#X connect 15 0 13 0; +#X connect 17 0 18 0; +#X connect 18 0 13 0; +#X connect 19 0 13 0; +#X connect 20 0 13 0; +#X connect 21 0 13 0; +#X connect 31 0 13 0; +#X connect 32 0 0 0; +#X connect 34 0 0 0; +#X connect 35 0 0 0; +#X connect 36 0 0 0; +#X connect 37 0 0 0; +#X connect 41 0 13 0; +#X connect 43 0 13 0; +#X connect 45 0 13 0; +#X connect 48 0 49 0; +#X connect 48 1 27 0; +#X connect 49 0 65 0; +#X connect 49 1 50 0; +#X connect 60 0 12 0; +#X connect 64 0 17 0; +#X restore 442 97 pd handle; +#N canvas 680 67 617 565 glob 0; +#X obj 50 378 file glob; +#X obj 50 443 print DATA; +#X obj 110 405 print ERROR; +#X msg 71 153 symbol ~/*.*; +#X msg 134 331 symbol; +#X msg 53 107 symbol .*; +#X text 190 331 no match (files with an empty filename...); +#X msg 101 219 symbol %WinDir%/*.exe; +#X text 260 218 executable files in the Windows-directory; +#X msg 28 66 symbol *; +#X text 140 100 all files/directories starting with a dot (except for the special directories '.' and '..'), f 50; +#X msg 125 297 symbol .; +#X msg 84 189 symbol /tmp/*.pd; +#X text 211 190 all Pd-files in /tmp/; +#X text 195 297 the '.' directory (not very useful); +#X text 172 154 all files/directories with a dot in your homedir; +#X msg 118 259 symbol ../*/; +#X text 218 259 all directories in the parent directory; +#N canvas 478 221 790 409 recursive 0; +#X obj 112 223 file glob; +#X obj 112 116 openpanel 1; +#X obj 112 171 t s; +#X msg 122 147 symbol .; +#X msg 112 248 \$2 \$1; +#X obj 112 273 route 0 1; +#X obj 112 358 print files; +#X msg 112 196 symbol \$1/*; +#X obj 142 301 symbol; +#X text 61 19 you can use [file glob] to recursively walk a directory tree; +#X obj 492 223 file glob; +#X obj 492 116 openpanel 1; +#X obj 492 171 t s; +#X msg 502 147 symbol .; +#X msg 492 248 \$2 \$1; +#X obj 492 273 route 0 1; +#X obj 522 301 symbol; +#X text 421 61 get all .pd files from the directory (+subdirs); +#X text 65 60 get all files from the directory (+subdirs); +#X msg 492 196 symbol \$1/*.pd \, symbol \$1/*/; +#X obj 492 358 print pd-files; +#X obj 112 90 bng 19 250 50 0 empty empty empty -35 10 0 10 #dfdfdf #000000 #000000; +#X obj 492 90 bng 19 250 50 0 empty empty empty -35 10 0 10 #dfdfdf #000000 #000000; +#X connect 0 0 4 0; +#X connect 1 0 2 0; +#X connect 2 0 7 0; +#X connect 3 0 2 0; +#X connect 4 0 5 0; +#X connect 5 0 6 0; +#X connect 5 1 8 0; +#X connect 7 0 0 0; +#X connect 8 0 7 0; +#X connect 10 0 14 0; +#X connect 11 0 12 0; +#X connect 12 0 19 0; +#X connect 13 0 12 0; +#X connect 14 0 15 0; +#X connect 15 0 20 0; +#X connect 15 1 16 0; +#X connect 16 0 19 0; +#X connect 19 0 10 0; +#X connect 21 0 1 0; +#X connect 22 0 11 0; +#X restore 153 525 pd recursive globbing; +#X text 202 400 if no files are found or an error is encountered \, a bang is sent to the 2nd outlet, f 49; +#X text 149 450 matching files and directories are sent as lists of (including the search directory) and a identifier that indicates if the path is a file (0) or a directory (1).; +#N canvas 424 264 893 441 cross-platform 0; +#X text 37 329 - files/dirs starting with a "." only match if the matching pattern explicitly contains the leading dot.; +#X msg 483 338 symbol *; +#X msg 583 338 symbol .*; +#X text 556 337 vs; +#X text 556 377 vs; +#X msg 483 378 symbol .*; +#X msg 583 378 symbol ..; +#X text 37 372 - the special files/dirs "." and ".." only match if requested explicitly \, never with a wildcard pattern.; +#X text 579 207 vs; +#X msg 483 208 symbol /tmp/*; +#X msg 603 208 symbol /*/foo; +#X text 40 191 - the behavior of patterns that contain wildcards in a path component other than the last one is *undefined* (and platform dependent). DO NOT USE THIS.; +#X text 39 280 - patterns ending with anything else will match files AND directories; +#X text 579 277 vs; +#X text 599 147 vs; +#X msg 483 148 symbol file.txt; +#X msg 623 148 symbol *.txt; +#X text 719 147 vs; +#X msg 743 148 symbol fi?e.txt; +#X text 39 260 - patterns ending with '/' will ONLY match directories; +#X msg 603 278 symbol */; +#X msg 483 278 symbol *; +#X text 39 131 - the pattern may contain the wildcards '*' (for any number of characters) and '?' (for a single character) in the last path component. no other wildcards are supported.; +#X text 45 47 [file glob] attempts to unify the behavior of wildcard matching on different platforms. as such \, it does not support all features of a given pattern matching implementation (or only accidentally)., f 107; +#X text 45 80 the following rules should help you to write patches that use platform independent globbing., f 107; +#X text 27 23 cross-platform notes on globbing:; +#X restore 314 525 pd cross-platform pattern matching; +#X text 35 525 more:; +#X text 99 60 all files/directories in this directory (that don't start with a dot), f 39; +#X obj 11 47 cnv 1 600 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#X text 118 16 - find pathnames matching a pattern; +#X obj 40 17 file glob; +#N canvas 599 129 578 333 reference 0; +#X text 118 16 - find pathnames matching a pattern; +#X obj 40 17 file glob; +#X obj 9 52 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0; +#X obj 9 111 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 8 303 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 9 187 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 137 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X text 155 260 -q: set quiet verbosity., f 49; +#X text 155 278 -v: set loud verbosity., f 49; +#X text 54 86 verbose - set verbosity on or off.; +#X text 117 65 symbol - pattern to be found.; +#X text 119 142 list -; +#X text 167 143 found files/directories as a path symbol and type (file <0> or directory <1>)., f 49; +#X text 132 194 bang - if nothing is found or an error occurs.; +#X obj 7 226 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 7 252 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0; +#X restore 520 17 pd reference; +#N canvas 480 231 738 232 flags 0; +#X text 274 145 less verbose (quiet); +#X text 274 175 more verbose (loud); +#X msg 563 149 verbose \$1; +#X obj 563 122 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X text 106 70 error reporting on the Pd-console; +#X text 239 111 via flags:; +#X text 524 95 via a message:; +#X obj 563 174 file glob; +#X obj 146 145 file glob -q; +#X obj 146 175 file glob -v; +#X connect 2 0 7 0; +#X connect 3 0 2 0; +#X restore 85 525 pd flags; +#X connect 0 0 1 0; +#X connect 0 1 2 0; +#X connect 3 0 0 0; +#X connect 4 0 0 0; +#X connect 5 0 0 0; +#X connect 7 0 0 0; +#X connect 9 0 0 0; +#X connect 11 0 0 0; +#X connect 12 0 0 0; +#X connect 16 0 0 0; +#X restore 442 249 pd glob; +#X obj 27 97 file handle; +#X obj 27 287 file stat; +#X text 154 96 - read/write binary files; +#X text 154 223 - find a file in Pd's search-path; +#X text 154 250 - list files in directories; +#X obj 27 249 file glob; +#X obj 27 222 file which; +#N canvas 535 52 616 613 which 0; +#X obj 45 365 file which; +#X symbolatom 45 479 79 0 0 0 - - - 0; +#X obj 45 505 print found; +#X obj 112 418 print not!found; +#X msg 45 279 symbol hilbert~.pd; +#X text 187 279 a file that ships with Pd; +#X text 162 327 probably does not exist in Pd's search path; +#X symbolatom 112 391 47 0 0 0 - - - 0; +#X obj 45 451 unpack s f; +#X floatatom 137 452 3 0 0 1 - - - 0; +#X obj 11 47 cnv 1 600 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#X text 137 14 - locate a file; +#X obj 50 15 file which; +#N canvas 680 125 563 321 reference 0; +#X obj 9 52 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0; +#X obj 9 131 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 8 304 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 9 187 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 157 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X text 155 260 -q: set quiet verbosity., f 49; +#X text 155 278 -v: set loud verbosity., f 49; +#X obj 31 22 file which; +#X text 114 22 - locate a file; +#X text 137 65 symbol - file to locate using Pd's search-paths., f 51; +#X text 74 103 verbose - set verbosity on or off., f 60; +#X obj 7 228 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 7 254 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0; +#X text 118 163 list - symbol path of located file and directory flag.; +#X text 105 194 symbol - the input symbol if file isn't located.; +#X text 39 83 list - file name and patch depth level to search., f 65; +#X restore 518 15 pd reference; +#X text 27 63 [file which] tries to locate a file using Pd's search-paths. This includes the same relative path (the folder where the patch lives \, and other Pd seatch paths like the ones set via preferences and/or the [declare] object. If the file is found \, the object returns a list in the left outlet with the resolved path and a flag to inform if it is a file (0) or a directory (1) \, though this currently only works for filesT If nothing is found \, the entry is sent to the right outlet., f 79; +#X text 166 444 directory flag: 0 if file \, 1 if directory (currently this only works for files), f 41; +#X text 134 506 note: - currently only the first match is returned; +#N canvas 628 410 738 232 flags 0; +#X text 274 145 less verbose (quiet); +#X text 274 175 more verbose (loud); +#X msg 563 149 verbose \$1; +#X obj 563 122 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X text 106 70 error reporting on the Pd-console; +#X text 239 111 via flags:; +#X text 524 95 via a message:; +#X obj 146 145 file which -q; +#X obj 146 175 file which -v; +#X obj 563 174 file which; +#X connect 2 0 9 0; +#X connect 3 0 2 0; +#X restore 336 559 pd flags; +#X msg 68 328 list nada 1; +#X text 26 180 The [file which] object takes a symbol with the file name to search \, but you can Also provide a list with file name and depth level. The depth level is useful for setting which relative path to search for if the object is used in an abstraction. The default value is '0' \, which means relative to this patch. '1' is the parent patch \, '2' is the grandparent \, and so on., f 79; +#X connect 0 0 8 0; +#X connect 0 1 7 0; +#X connect 1 0 2 0; +#X connect 4 0 0 0; +#X connect 7 0 3 0; +#X connect 8 0 1 0; +#X connect 8 1 9 0; +#X connect 18 0 0 0; +#X restore 442 222 pd which; +#X obj 27 148 file mkdir; +#X text 155 149 - create a directory; +#N canvas 593 65 525 590 mkdir 0; +#X obj 42 387 file mkdir; +#X symbolatom 42 470 64 0 0 0 - - - 0; +#X obj 42 504 print mkdir; +#X obj 109 438 print ERR:mkdir; +#X msg 62 261 symbol \$1/subdir/another/sub/directory; +#X msg 83 303 symbol .; +#X text 33 81 parent directories are created as needed.; +#X text 33 101 it is not an error \, if the requested directory already exists (and is a directory).; +#X text 148 153 create a new directory; +#X text 157 215 create a deep directory; +#X text 164 305 (re)create an existing directory; +#X text 134 412 on error \, a bang is sent to the 2nd outlet; +#X text 136 497 on success \, the name of the created directory is sent to the 1st outlet, f 36; +#X msg 87 351 creationmode 0o700; +#X obj 62 236 savepanel 1; +#X obj 42 176 savepanel 1; +#X obj 37 16 file mkdir; +#X text 120 16 - create directories; +#X text 34 63 This ensures that a given directory exists by creating it.; +#X obj 16 47 cnv 1 500 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#N canvas 778 127 575 333 reference 0; +#X obj 9 44 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0; +#X obj 9 118 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 8 303 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 28 15 file mkdir; +#X text 111 15 - create directories; +#X text 125 57 symbol - directory to be created., f 56; +#X text 27 75 creationmode - restrict permissions of the created directory., f 70; +#X obj 9 174 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 144 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X text 125 149 symbol - created directory on success., f 56; +#X text 139 181 bang - when there's an error creating the directory.; +#X text 85 244 -q: set quiet verbosity., f 63; +#X text 85 261 -v: set loud verbosity., f 63; +#X text 85 278 -m: file creation mode (user/group/other permissions) in octal., f 63; +#X text 62 94 verbose - set verbosity on or off., f 65; +#X obj 7 212 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 7 238 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0; +#X restore 424 15 pd reference; +#X obj 42 149 bng 19 250 50 0 empty empty empty -35 10 0 10 #dfdfdf #000000 #000000; +#X obj 62 211 bng 19 250 50 0 empty empty empty -35 10 0 10 #dfdfdf #000000 #000000; +#X obj 109 413 bng 19 250 50 0 empty empty empty -35 10 0 10 #dfdfdf #000000 #000000; +#N canvas 596 129 736 450 flags 0; +#X text 209 100 less verbose (quiet); +#X text 209 130 more verbose (loud); +#X msg 498 104 verbose \$1; +#X obj 498 77 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X text 41 25 error reporting on the Pd-console; +#X text 174 66 via flags:; +#X text 459 50 via a message:; +#X text 89 335 via a message:; +#X text 84 236 via creation flags:; +#X text 52 204 restricted permissions of created directories:; +#X text 279 266 directory creation mode (user/group/other permissions) in octal.; +#X msg 81 360 creationmode 0o700; +#X text 277 304 the actual permissions of the created directory also takes the umask into account. this might be ignored by the underlying filesystem.; +#X text 278 366 the creation mode only affects directories that are created after the mode has been set.; +#X obj 81 385 file mkdir; +#X obj 81 270 file mkdir -m 0o700; +#X obj 81 130 file mkdir -v; +#X obj 81 100 file mkdir -q; +#X obj 498 129 file mkdir; +#X connect 2 0 18 0; +#X connect 3 0 2 0; +#X connect 11 0 14 0; +#X restore 195 551 pd flags; +#X connect 0 0 1 0; +#X connect 0 1 23 0; +#X connect 1 0 2 0; +#X connect 4 0 0 0; +#X connect 5 0 0 0; +#X connect 13 0 0 0; +#X connect 14 0 4 0; +#X connect 15 0 0 0; +#X connect 21 0 15 0; +#X connect 22 0 14 0; +#X connect 23 0 3 0; +#X restore 442 148 pd mkdir; +#X obj 27 451 file delete; +#X text 155 452 - delete files and directories; +#N canvas 521 23 666 648 delete 0; +#X obj 85 216 file delete; +#X obj 159 243 print ERR:delete; +#X obj 85 273 print deleted; +#X text 51 84 NOTE: deleting destroys data. there is no confirmation dialog or anything of that kind., f 74; +#X msg 85 155 symbol nada; +#X text 173 157 file or directory to be deleted; +#X text 60 331 recursive deletion; +#X obj 95 520 file delete; +#X msg 95 439 recursive nada; +#X obj 169 547 print ERR:recursive-delete; +#X obj 95 605 print recursively-deleted; +#X text 208 440 remove the nada/ directory with all its content.; +#X text 283 239 on error \, a bang is sent to the 2nd outlet; +#X text 197 275 on success \, the deleted path is sent to the 1st outlet; +#X text 225 522 on error \, a bang is sent to the 2nd outlet; +#X text 118 581 on success \, the deleted path is sent to the 1st outlet; +#X text 212 464 if nada is a file (rather than a directory) \, it will be deleted just so.; +#X text 60 346 ------------------; +#X text 82 365 if you are sure that you want to remove an entire directory tree with all the files and subdirectories \, you can also remove it *recursively* using the "recursive" message.; +#X obj 11 47 cnv 1 650 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#N canvas 599 129 573 316 reference 0; +#X obj 9 48 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0; +#X obj 9 107 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 8 282 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 9 163 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 133 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X text 54 82 verbose - set verbosity on or off.; +#X text 132 170 bang - if an error occurs.; +#X text 117 61 symbol - file or directory to be deleted.; +#X text 120 138 symbol - the deleted path on success.; +#X obj 28 16 file delete; +#X text 124 16 - remove files and directories.; +#X text 155 236 -q: set quiet verbosity., f 49; +#X text 155 254 -v: set loud verbosity., f 49; +#X obj 7 203 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 7 229 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0; +#X restore 567 15 pd reference; +#X obj 36 15 file delete; +#X text 132 15 - remove files and directories.; +#N canvas 577 348 738 232 flags 0; +#X text 274 145 less verbose (quiet); +#X text 274 175 more verbose (loud); +#X msg 563 149 verbose \$1; +#X obj 563 124 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X text 106 70 error reporting on the Pd-console; +#X text 239 111 via flags:; +#X text 524 97 via a message:; +#X obj 146 145 file delete -q; +#X obj 146 175 file delete -v; +#X obj 563 174 file delete; +#X connect 2 0 9 0; +#X connect 3 0 2 0; +#X restore 512 157 pd flags; +#X connect 0 0 2 0; +#X connect 0 1 1 0; +#X connect 4 0 0 0; +#X connect 7 0 10 0; +#X connect 7 1 9 0; +#X connect 8 0 7 0; +#X restore 442 451 pd delete; +#N canvas 504 123 674 330 copy 0; +#X msg 48 115 list source destination; +#X text 233 114 copies the file 'source' to the new file 'destination'; +#X obj 48 284 print copy; +#X obj 129 285 print ERR:copy; +#N canvas 648 181 502 408 arguments 0; +#X msg 136 143 verbose \$1; +#X obj 136 122 tgl 17 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X obj 136 168 outlet; +#X text 61 82 error reporting; +#X text 244 118 turn error-printout on/off; +#X text 65 254 or via flags:; +#X obj 90 292 file copy -v; +#X text 206 294 more verbose; +#X obj 90 322 file copy -q; +#X text 206 324 less verbose (quiet); +#X connect 0 0 2 0; +#X connect 1 0 0 0; +#X restore 72 193 pd arguments; +#X text 245 169 'destination' can be a file or a directory.; +#X text 245 149 'source' must be a file.; +#X text 247 202 the destination directory must exist and be writable.; +#X obj 11 47 cnv 1 650 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#N canvas 599 129 573 331 reference 0; +#X obj 9 52 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0; +#X obj 9 111 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 8 286 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 9 167 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 137 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X text 155 242 -q: set quiet verbosity., f 49; +#X text 155 260 -v: set loud verbosity., f 49; +#X text 84 86 verbose - set verbosity on or off.; +#X text 132 174 bang - if an error occurs.; +#X text 147 65 list - source and destination.; +#X text 120 142 list -; +#X text 167 143 source and destination on success., f 39; +#X text 112 15 - copy a file around.; +#X obj 36 15 file copy; +#X obj 7 207 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 7 233 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0; +#X restore 567 15 pd reference; +#X text 112 15 - copy a file around.; +#X obj 36 15 file copy; +#X obj 48 239 file copy, f 12; +#X msg 63 153 list \$1 porra; +#X text 64 68 [file copy] duplicates the content of a file to a destination., f 64; +#X connect 0 0 12 0; +#X connect 4 0 12 0; +#X connect 12 0 2 0; +#X connect 12 1 3 0; +#X connect 13 0 12 0; +#X restore 442 399 pd copy; +#X obj 27 399 file copy; +#X text 155 400 - copy files; +#X obj 27 425 file move; +#X text 155 426 - move files; +#X obj 27 488 file split; +#X obj 27 513 file join; +#X obj 27 538 file splitext; +#X obj 27 563 file splitname; +#X text 155 519 - filename operations; +#X obj 31 12 file; +#X text 78 11 - low-level file operations; +#X obj 27 312 file isfile; +#X obj 27 337 file isdirectory; +#X obj 27 362 file size; +#N canvas 478 65 815 507 info 0; +#X obj 36 300 file isfile, f 15; +#X floatatom 36 325 5 0 0 0 - - - 0; +#X floatatom 538 328 5 0 0 0 - - - 0; +#X obj 538 303 file isdirectory; +#X text 210 115 select a file; +#X text 251 144 select a directory; +#X msg 270 172 symbol .; +#X text 344 171 some directory; +#X msg 291 202 symbol nada; +#X obj 647 354 print ERR:isDir; +#X obj 538 354 print isDir; +#X obj 36 349 print isFile; +#X text 265 342 sends a bang to the 2nd outlet \, if the path could not be read, f 32; +#X text 381 204 probably not there; +#X floatatom 48 443 5 0 0 0 - - - 0; +#X obj 48 418 file size, f 13; +#X obj 48 467 print size; +#X text 216 436 on error \, a bang is sent to the 2nd outlet; +#X obj 138 349 print ERR:isFile; +#X obj 136 467 print ERR:size; +#X text 214 403 gets the size of a file (in bytes) \, as reported by the filesystem. for directories \, this will return '0'.; +#X obj 80 17 file isfile; +#X obj 45 40 file isdirectory; +#X obj 94 63 file size; +#X obj 36 274 r \$0-info-path; +#X obj 48 391 r \$0-info-path; +#X obj 538 278 r \$0-info-path; +#X symbolatom 189 234 0 0 0 0 - - - 0; +#N canvas 578 479 645 307 info-path 0; +#X obj 44 107 openpanel; +#X obj 167 116 openpanel 1; +#X obj 240 182 symbol .; +#X obj 272 238 s \$0-info-path; +#X obj 240 210 t s s; +#X obj 240 265 outlet; +#X obj 44 59 inlet; +#X text 40 35 files; +#X obj 167 58 inlet; +#X text 168 34 directories; +#X obj 341 58 inlet; +#X text 335 35 fixes; +#X connect 0 0 2 0; +#X connect 1 0 2 0; +#X connect 2 0 4 0; +#X connect 4 0 5 0; +#X connect 4 1 3 0; +#X connect 6 0 0 0; +#X connect 8 0 1 0; +#X connect 10 0 2 0; +#X restore 189 199 pd info-path; +#X obj 189 271 s \$0-info-path; +#X obj 7 95 cnv 1 800 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#X text 716 59 <= click; +#N canvas 599 129 572 356 reference 0; +#X obj 9 94 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0; +#X obj 9 153 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 8 323 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 9 212 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 179 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X text 155 279 -q: set quiet verbosity., f 49; +#X text 155 297 -v: set loud verbosity., f 49; +#X text 54 128 verbose - set verbosity on or off.; +#X text 132 219 bang - if an error occurs.; +#X obj 58 16 file isfile; +#X obj 23 39 file isdirectory; +#X obj 72 62 file size; +#X text 145 62 - get size of a file; +#X text 145 40 - check if path is an existing directory; +#X text 145 17 - check if path is an existing regular file; +#X text 117 107 symbol -file or directory name.; +#X text 110 186 float -; +#X text 167 185 true <1> of false <0>., f 39; +#X obj 7 247 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 7 273 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0; +#X restore 613 60 pd reference; +#X text 167 63 - get size of a file; +#X text 167 41 - check if path is an existing directory; +#X text 167 18 - check if path is an existing regular file; +#X obj 189 116 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000; +#X obj 229 145 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000; +#X obj 138 325 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000; +#X obj 136 443 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000; +#X obj 647 328 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000; +#N canvas 143 98 738 232 flags 0; +#X text 274 145 less verbose (quiet); +#X text 274 175 more verbose (loud); +#X msg 563 149 verbose \$1; +#X obj 563 123 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X text 106 70 error reporting on the Pd-console; +#X text 239 111 via flags:; +#X text 524 96 via a message:; +#X obj 146 145 file size -q; +#X obj 146 175 file isfile -v; +#X obj 563 174 file isdirectory; +#X connect 2 0 9 0; +#X connect 3 0 2 0; +#X restore 626 175 pd flags; +#X connect 0 0 1 0; +#X connect 0 1 38 0; +#X connect 1 0 11 0; +#X connect 2 0 10 0; +#X connect 3 0 2 0; +#X connect 3 1 40 0; +#X connect 6 0 28 2; +#X connect 8 0 28 2; +#X connect 14 0 16 0; +#X connect 15 0 14 0; +#X connect 15 1 39 0; +#X connect 24 0 0 0; +#X connect 25 0 15 0; +#X connect 26 0 3 0; +#X connect 27 0 29 0; +#X connect 28 0 27 0; +#X connect 36 0 28 0; +#X connect 37 0 28 1; +#X connect 38 0 18 0; +#X connect 39 0 19 0; +#X connect 40 0 9 0; +#X restore 442 340 pd info; +#N canvas 302 23 827 708 stat 0; +#X text 27 59 select a file, f 6; +#X text 140 63 select a directory; +#X msg 161 94 symbol .; +#X text 233 93 some directory; +#X msg 192 122 symbol nada; +#X text 282 124 probably not there; +#X obj 185 204 print ERR:stat; +#X obj 80 209 t a a; +#X obj 112 233 print stat; +#X obj 130 347 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X obj 156 435 route type; +#X obj 156 460 symbol; +#X obj 129 377 route isfile isdirectory issymlink; +#X symbolatom 156 486 10 0 0 0 - - - 0; +#X floatatom 151 593 5 0 0 0 - - - 0; +#X floatatom 198 593 5 0 0 0 - - - 0; +#X floatatom 339 518 5 0 0 0 - - - 0; +#X obj 80 622 route mtime atime, f 62; +#X msg 80 648 symbol \$1-\$2-\$3T\$4:\$5:\$6; +#X symbolatom 80 673 19 0 0 0 modified - - 0; +#X msg 295 648 symbol \$1-\$2-\$3T\$4:\$5:\$6; +#X symbolatom 295 673 18 0 0 0 accessed - - 0; +#X obj 80 320 t a a; +#X obj 80 526 t a a; +#X obj 80 377 t a a; +#X obj 80 445 t a a; +#X obj 80 566 t a a; +#X floatatom 135 291 5 0 0 0 - - - 0; +#X obj 80 266 t a a; +#X text 296 195 on error \, a bang is sent to the 2nd outlet, f 22; +#X obj 135 266 route size; +#X obj 130 320 route readable writable executable owned; +#X obj 339 495 route permissions; +#X obj 339 542 makefilename %o; +#X symbolatom 339 567 10 0 0 0 - - - 0; +#X text 461 534 numeric permissions (the more common form is the octal representation), f 37; +#X text 384 366 boolean values whether the path is a file/directory/symlink; +#X text 239 593 numeric user-id & group-id of the file; +#X text 528 613 last modification resp. access time, f 19; +#X text 229 264 file size (for regular files/symlinks \, 0 for directories \, -1 otherwise), f 38; +#X text 209 460 symbolic description of the path type (after resolving any symlinks), f 68; +#N canvas 871 315 423 294 openpanel 0; +#X obj 74 97 openpanel; +#X obj 167 97 openpanel 1; +#X obj 271 195 symbol .; +#X obj 271 220 outlet; +#X obj 271 58 inlet; +#X text 270 34 fixes; +#X obj 167 58 inlet; +#X text 156 33 directories; +#X obj 74 59 inlet; +#X text 70 33 files; +#X connect 0 0 2 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 4 0 2 0; +#X connect 6 0 1 0; +#X connect 8 0 0 0; +#X restore 80 121 pd openpanel; +#X obj 80 180 file stat; +#X text 445 70 [file stat] queries the filesystem about the given path \, and outputs the collected data as a number of routable messages., f 46; +#X text 385 384 (the symlink flag is additional: e.g. \, if the path is a symlink to a directory \, both isdirectory and issymlink will be true); +#X symbolatom 80 150 66 0 0 0 - - - 0; +#X text 425 318 whether the file is readable/writable/executable/owned by the user (might be '-1' if undeterminable), f 54; +#X obj 151 566 route uid gidd; +#X text 112 15 - get metainformation about a file/directory; +#X obj 36 15 file stat; +#X obj 11 47 cnv 1 800 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#N canvas 599 129 574 320 reference 0; +#X text 106 15 - get metainformation about a file/directory; +#X obj 30 15 file stat; +#X obj 10 50 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0; +#X obj 10 109 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 9 294 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 10 175 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 10 135 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X text 156 249 -q: set quiet verbosity., f 49; +#X text 156 267 -v: set loud verbosity., f 49; +#X text 55 84 verbose - set verbosity on or off.; +#X text 90 140 anything -; +#X text 168 141 several messages for metainformation., f 39; +#X text 133 182 bang - if an error occurs.; +#X obj 8 210 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 8 236 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0; +#X text 118 63 symbol - file or directory name.; +#X restore 722 15 pd reference; +#X obj 80 64 bng 19 250 50 0 empty empty empty -35 10 0 10 #dfdfdf #000000 #000000; +#X obj 120 65 bng 19 250 50 0 empty empty empty -35 10 0 10 #dfdfdf #000000 #000000; +#X obj 185 178 bng 19 250 50 0 empty empty empty -35 10 0 10 #dfdfdf #000000 #000000; +#X text 151 347 r; +#X obj 199 347 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X obj 268 347 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X obj 337 347 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X text 221 347 w; +#X text 291 347 x; +#X obj 129 403 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X obj 207 403 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X obj 285 403 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X text 151 403 F; +#X text 228 404 D; +#X text 307 404 L; +#N canvas 565 317 738 232 flags 0; +#X text 274 145 less verbose (quiet); +#X text 274 175 more verbose (loud); +#X msg 563 149 verbose \$1; +#X obj 563 124 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X text 106 70 error reporting on the Pd-console; +#X text 239 111 via flags:; +#X text 524 97 via a message:; +#X obj 146 145 file stat -q; +#X obj 146 175 file stat -v; +#X obj 563 174 file stat; +#X connect 2 0 9 0; +#X connect 3 0 2 0; +#X restore 671 194 pd flags; +#X connect 2 0 41 2; +#X connect 4 0 41 2; +#X connect 7 0 28 0; +#X connect 7 1 8 0; +#X connect 10 0 11 0; +#X connect 11 0 13 0; +#X connect 12 0 61 0; +#X connect 12 1 62 0; +#X connect 12 2 63 0; +#X connect 16 0 33 0; +#X connect 17 0 18 0; +#X connect 17 1 20 0; +#X connect 18 0 19 0; +#X connect 20 0 21 0; +#X connect 22 0 24 0; +#X connect 22 1 31 0; +#X connect 23 0 26 0; +#X connect 23 1 32 0; +#X connect 24 0 25 0; +#X connect 24 1 12 0; +#X connect 25 0 23 0; +#X connect 25 1 10 0; +#X connect 26 0 17 0; +#X connect 26 1 47 0; +#X connect 28 0 22 0; +#X connect 28 1 30 0; +#X connect 30 0 27 0; +#X connect 31 0 9 0; +#X connect 31 1 56 0; +#X connect 31 2 57 0; +#X connect 31 3 58 0; +#X connect 32 0 16 0; +#X connect 33 0 34 0; +#X connect 41 0 45 0; +#X connect 42 0 7 0; +#X connect 42 1 54 0; +#X connect 45 0 42 0; +#X connect 47 0 14 0; +#X connect 47 1 15 0; +#X connect 52 0 41 0; +#X connect 53 0 41 1; +#X connect 54 0 6 0; +#X restore 442 311 pd stat; +#N canvas 549 160 676 359 move 0; +#X msg 53 110 list source destination; +#N canvas 305 121 542 398 arguments 0; +#X msg 136 143 verbose \$1; +#X obj 136 118 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X obj 136 168 outlet; +#X text 90 76 error reporting; +#X text 228 144 turn error-printout on/off; +#X text 65 254 or via flags:; +#X text 206 294 more verbose; +#X text 206 324 less verbose (quiet); +#X obj 90 292 file move -v; +#X obj 90 322 file move -q; +#X connect 0 0 2 0; +#X connect 1 0 0 0; +#X restore 77 190 pd arguments; +#X text 270 164 'destination' can be a file or a directory.; +#X text 270 144 'source' must be a file.; +#X text 272 197 the destination directory must exist and be writable.; +#X text 70 68 [file move] moves (renames) files; +#X text 241 109 renames the file 'source' to the new file 'destination'; +#X obj 53 234 file move, f 12; +#X obj 53 259 print move; +#X obj 134 260 print ERR:move; +#X text 55 313 NOTE: moving a file removes the original file.; +#X obj 11 47 cnv 1 650 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#N canvas 599 129 573 331 reference 0; +#X obj 9 52 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0; +#X obj 9 111 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 8 286 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 9 167 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 137 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X text 155 240 -q: set quiet verbosity., f 49; +#X text 155 258 -v: set loud verbosity., f 49; +#X text 54 86 verbose - set verbosity on or off.; +#X text 132 174 bang - if an error occurs.; +#X text 117 65 list - source and destination.; +#X text 120 142 list -; +#X text 167 143 source and destination on success., f 39; +#X obj 36 15 file move; +#X text 112 15 - move a file to a new destination.; +#X obj 7 207 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 7 233 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0; +#X restore 567 15 pd reference; +#X obj 36 15 file move; +#X text 112 15 - move a file to a new destination.; +#X connect 0 0 7 0; +#X connect 1 0 7 0; +#X connect 7 0 8 0; +#X connect 7 1 9 0; +#X restore 442 425 pd move; +#X text 22 665 see also:; +#X obj 97 664 text; +#X obj 139 664 array; +#X obj 188 664 list; +#X text 155 328 - get information on existing files; +#N canvas 451 65 791 637 split+join 0; +#N canvas 140 311 547 369 path 0; +#X obj 103 233 symbol; +#X obj 260 292 print PATH; +#X obj 103 291 outlet; +#X obj 56 115 openpanel; +#X obj 139 115 openpanel 1; +#X msg 139 141 symbol \$1/; +#X obj 56 58 route file directory dir random; +#N canvas 853 241 513 304 random 0; +#X obj 71 39 inlet; +#X obj 71 225 outlet; +#X obj 71 77 t b; +#X obj 71 161 random; +#X obj 71 129 t b f; +#X obj 71 188 text get \$0-name-split+join-strings; +#X obj 71 102 text size \$0-name-split+join-strings; +#X obj 143 149 text define -k \$0-name-split+join-strings; +#A set ///foo/bar/pizza \; dir/subdir/ \; soundfile.wav \; /path/to/pd.exe \; ../file.txt; +#X connect 0 0 2 0; +#X connect 2 0 6 0; +#X connect 3 0 5 0; +#X connect 4 0 3 0; +#X connect 4 1 3 1; +#X connect 5 0 1 0; +#X connect 6 0 4 0; +#X restore 254 155 pd random; +#X obj 237 259 t s s b; +#X obj 360 292 print -n; +#X msg 360 266 -------------------; +#X obj 56 25 inlet; +#X obj 237 234 r \$0-split+join-in; +#X obj 237 323 s \$0-split+join; +#X obj 56 87 b; +#X obj 139 88 b; +#X obj 270 178 b; +#X connect 0 0 2 0; +#X connect 3 0 0 0; +#X connect 4 0 5 0; +#X connect 5 0 0 0; +#X connect 6 0 14 0; +#X connect 6 1 15 0; +#X connect 6 2 15 0; +#X connect 6 3 7 0; +#X connect 6 4 16 0; +#X connect 7 0 0 0; +#X connect 8 0 13 0; +#X connect 8 1 1 0; +#X connect 8 2 10 0; +#X connect 10 0 9 0; +#X connect 11 0 6 0; +#X connect 12 0 8 0; +#X connect 14 0 3 0; +#X connect 15 0 4 0; +#X connect 16 0 0 0; +#X restore 173 143 pd path; +#X text 346 293 if the input ends with a / \, a '/' will be sent to the 2nd outlet. otherwise \, the 2nd outlet will fire a bang.; +#X obj 126 262 file split; +#X obj 168 419 file join; +#X obj 168 513 print join; +#X symbolatom 173 170 0 0 0 0 - - \$0-split+join-in 0; +#X msg 173 65 file; +#X msg 183 92 directory; +#X text 46 168 or type your own:; +#X symbolatom 168 461 0 0 0 0 - - - 0; +#X msg 193 117 random string; +#X text 271 415 'join' a list of path components to a full path \, using '/' as the path separator., f 42; +#X text 184 488 duplicate path separator will be removed.; +#X text 345 278 duplicate path separator will be removed.; +#X obj 8 47 cnv 1 775 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#N canvas 574 89 571 484 reference 0; +#X obj 9 45 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0; +#X obj 9 85 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 8 210 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 9 141 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 111 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 176 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 34 12 file split; +#X text 120 13 - 'split' path into components; +#X text 117 58 symbol - file or directory name to split.; +#X text 150 116 list - list of split components.; +#X text 101 148 symbol/bang - '/' if inputs ends with '/' or bang otherwise.; +#X obj 9 295 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0; +#X obj 9 335 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 8 460 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 9 391 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 361 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 426 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 34 262 file join; +#X text 110 263 - 'join' a list of components using '/' as the separator.; +#X text 143 308 list - list of components to join.; +#X text 164 366 symbol - joined path or file.; +#X text 162 184 NONE; +#X text 222 434 NONE; +#X text 194 400 Inactive Outlet!; +#X restore 691 15 pd reference; +#X text 189 15 - filename operations; +#X obj 33 15 file split; +#X obj 116 15 file join; +#X text 67 307 trailing slash ->; +#X text 27 348 components ->; +#X obj 168 379 list; +#X text 210 260 <-- 'split' path into components, f 16; +#X text 96 65 select a:; +#X text 242 419 <--; +#X obj 126 230 r \$0-split+join; +#X text 345 216 A list of path components (symbols) is sent to the 1st outlet. if the input started with a / \, the first path component will be a symbol '/'. otherwise no slashes will appear in the path components.; +#X text 344 96 These objects perform common string operations on filenames. no checks are performed verifying the validity/existence of any path-component., f 47; +#X listbox 193 310 4 0 0 0 - - - 0; +#X listbox 126 349 0 0 0 0 - - - 0; +#X text 89 547 NOTE: [file split] will always output (lists of) symbols \, even if the component looks like a number. on one hand this makes it harder to [route] \, but on the other hand this will keep zero-padded numbers intact (think "2020/01/01/0042.wav")., f 91; +#X text 89 595 Conversely \, the [file join] object accepts both symbols and numbers., f 91; +#X connect 0 0 5 0; +#X connect 2 0 29 0; +#X connect 2 1 28 0; +#X connect 3 0 9 0; +#X connect 6 0 0 0; +#X connect 7 0 0 0; +#X connect 9 0 4 0; +#X connect 10 0 0 0; +#X connect 21 0 3 0; +#X connect 25 0 2 0; +#X connect 28 0 21 1; +#X connect 29 0 21 0; +#X restore 442 518 pd split+join; +#N canvas 395 48 794 632 base+ext 0; +#N canvas 375 327 547 369 path 0; +#X obj 103 233 symbol; +#X symbolatom 148 165 10 0 0 0 - - - 0; +#X obj 260 292 print PATH; +#X obj 103 291 outlet; +#X obj 56 115 openpanel; +#X obj 139 115 openpanel 1; +#X msg 139 141 symbol \$1/; +#X obj 56 58 route file directory dir random; +#X obj 237 259 t s s b; +#X obj 360 292 print -n; +#X msg 360 266 -------------------; +#X obj 56 25 inlet; +#N canvas 667 322 513 304 random 0; +#X obj 71 39 inlet; +#X obj 71 225 outlet; +#X obj 71 77 t b; +#X obj 71 161 random; +#X obj 71 129 t b f; +#X obj 143 149 text define -k \$0-base+ext-strings; +#A set ///foo/bar/pizza \; dir/subdir/ \; soundfile.wav \; /path/to/pd.exe \; ../file.txt; +#X obj 71 102 text size \$0-base+ext-strings; +#X obj 71 188 text get \$0-base+ext-strings; +#X connect 0 0 2 0; +#X connect 2 0 6 0; +#X connect 3 0 7 0; +#X connect 4 0 3 0; +#X connect 4 1 3 1; +#X connect 6 0 4 0; +#X connect 7 0 1 0; +#X restore 254 155 pd random; +#X obj 237 323 s \$0-base+ext; +#X obj 237 234 r \$0-base+ext-in; +#X obj 56 87 b; +#X obj 139 88 b; +#X obj 270 178 b; +#X connect 0 0 3 0; +#X connect 1 0 0 0; +#X connect 4 0 0 0; +#X connect 5 0 6 0; +#X connect 6 0 0 0; +#X connect 7 0 15 0; +#X connect 7 1 16 0; +#X connect 7 2 16 0; +#X connect 7 3 12 0; +#X connect 7 4 17 0; +#X connect 8 0 13 0; +#X connect 8 1 2 0; +#X connect 8 2 10 0; +#X connect 10 0 9 0; +#X connect 11 0 7 0; +#X connect 12 0 0 0; +#X connect 14 0 8 0; +#X connect 15 0 4 0; +#X connect 16 0 5 0; +#X connect 17 0 0 0; +#X restore 167 148 pd path; +#X symbolatom 167 173 0 0 0 0 - - \$0-base+ext-in 0; +#X msg 167 70 file; +#X msg 177 97 directory; +#X text 40 173 or type your own:; +#X text 97 72 select a; +#X msg 187 122 random string; +#X obj 8 47 cnv 1 775 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#N canvas 724 152 573 467 reference 0; +#X obj 9 52 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0; +#X obj 9 91 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 8 211 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 9 147 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 117 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 177 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 20 19 file splitname; +#X text 135 19 - separates directory an file components.; +#X text 117 65 symbol - file name.; +#X text 120 122 list - the separated directory and file components.; +#X text 108 154 symbol - file component if no directory component is found.; +#X obj 9 282 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0; +#X obj 9 321 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 8 441 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 9 377 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 347 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 407 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X text 117 295 symbol - file name.; +#X text 120 352 list - the separated directory and file components.; +#X obj 19 252 file splitext; +#X text 126 252 - separates directory+file and extension.; +#X text 108 384 symbol - path if no extension is found.; +#X text 162 185 NONE; +#X text 162 415 NONE; +#X restore 691 15 pd reference; +#X text 259 15 - more filename operations.; +#X obj 33 15 file splitname; +#X obj 146 15 file splitext; +#X text 326 91 These objects perform common string operations on filenames. no checks are performed verifying the validity/existence of any path-component., f 49; +#X text 400 247 If no directory component can be found \, the path is sent to the 2nd outlet., f 45; +#X text 400 281 A trailing slash is removed., f 45; +#X text 400 302 The filename is the non-empty string after the last path-separator, f 45; +#X text 407 448 If no extension is found \, the path is sent to the 2nd outlet., f 45; +#X text 407 487 An extension is a non-empty string after the last '.' in the filename-component of the path., f 45; +#X obj 67 440 file splitext; +#X listbox 179 424 0 0 0 0 - - - 0; +#X listbox 67 494 0 0 0 0 - - - 0; +#X obj 179 453 print splitext no extension; +#X obj 67 521 print splitext root+ext; +#X obj 67 409 r \$0-base+ext; +#X obj 63 256 file splitname; +#X obj 63 225 r \$0-base+ext; +#X listbox 179 246 0 0 0 0 - - - 0; +#X listbox 63 309 0 0 0 0 - - - 0; +#X obj 63 337 print splitname dir+file; +#X obj 179 271 print splitname file; +#X text 400 198 [file splitname] separates the directory component from the file component of the path \, and outputs a list with both on the 1st outlet., f 47; +#X text 407 384 [file splitext] separates the directory+file component from the extension of the given path \, and outputs a list with both on the 1st outlet., f 45; +#X text 79 564 NOTE: the [file split*] objects will always output (lists of) symbols \, even if the component looks like a number. On one hand this makes it harder to [route] \, but on the other hand this will keep zero-padded numbers intact (think "2020/01/01/0042.wav")., f 92; +#X connect 0 0 1 0; +#X connect 2 0 0 0; +#X connect 3 0 0 0; +#X connect 6 0 0 0; +#X connect 18 0 20 0; +#X connect 18 1 19 0; +#X connect 19 0 21 0; +#X connect 20 0 22 0; +#X connect 23 0 18 0; +#X connect 24 0 27 0; +#X connect 24 1 26 0; +#X connect 25 0 24 0; +#X connect 26 0 29 0; +#X connect 27 0 28 0; +#X restore 442 548 pd base+ext; +#X obj 27 123 file define \$0.f; +#X text 154 122 - shared file handles; +#N canvas 565 43 617 557 define 0; +#X obj 63 177 file define \$0.foo; +#X text 213 177 declare a file-handle with a given name.; +#X msg 80 263 open /tmp/test.txt; +#X obj 80 325 file handle \$0.foo; +#X msg 103 293 close; +#X msg 102 404 8; +#X text 134 403 read some bytes; +#X text 42 228 here we open/close the file that is associated with '\$0.foo'; +#X text 81 377 here we read the file that is opened elsewhere.; +#X obj 102 499 file handle \$0.foo; +#X obj 225 467 symbol \$0.bar; +#X text 249 438 you can change the associated file-handle; +#X text 17 66 Sometimes it is easier to access the same file-handle from different parts of the patch (e.g. when reading and parsing a file) \, rather than going backwards and forwards with a single 'file handle' object., f 77; +#X obj 28 19 file define x; +#X text 134 19 - share file handles.; +#X obj 7 52 cnv 1 600 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#N canvas 599 129 578 200 reference 0; +#X obj 9 52 cnv 5 550 5 empty empty INLETS: 8 18 0 13 #202020 #000000 0; +#X obj 9 93 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 9 131 cnv 2 550 2 empty empty ARGUMENT: 8 12 0 13 #202020 #000000 0; +#X obj 8 170 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X text 136 20 - share file handles.; +#X obj 30 20 file define z; +#X text 164 103 NONE; +#X text 164 65 NONE; +#X text 143 140 1) symbol - declared file-handle name.; +#X restore 513 18 pd reference; +#X obj 225 439 bng 19 250 50 0 empty empty empty -35 10 0 10 #dfdfdf #000000 #000000; +#X text 17 122 In this case \, you can use the [file define] object to provide a file handle that can then be accessed by multiple [file handle] objects., f 77; +#X connect 2 0 3 0; +#X connect 4 0 3 0; +#X connect 5 0 9 0; +#X connect 10 0 9 1; +#X connect 17 0 10 0; +#X restore 442 123 pd define; +#X obj 10 44 cnv 1 550 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#N canvas 765 68 566 232 reference 0; +#X obj 7 163 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 8 75 cnv 2 550 2 empty empty ARGUMENT: 8 12 0 13 #202020 #000000 0; +#X text 96 85 symbol -; +#X obj 7 54 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X text 147 183 Open specific references in each subpatch detailing each function on parent patch., f 41; +#X obj 26 18 file; +#X text 73 18 - low-level file operations; +#X text 160 86 sets the function of [file] \, possible values: handle \, define \, mkdir \, which \, glob \, stat \, isfile \, isdirectory \, size \, copy \, move \, delete \, split \, join \, splitext and splitname. The default value is 'define'., f 54; +#X restore 469 12 pd reference; +#X obj 9 653 cnv 1 550 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#X obj 27 197 file patchpath; +#N canvas 513 87 618 571 patchpath 0; +#X symbolatom 88 529 0 0 0 0 - - - 0; +#X obj 88 462 file patchpath; +#X text 75 167 get the directory this patch is in; +#X msg 132 330 symbol /absolute; +#X msg 112 292 symbol rela/tive; +#X text 259 332 absolute paths stay absolute; +#X text 237 291 a filename relative to this patch; +#X msg 146 376 list ../foo 1; +#X floatatom 88 223 5 0 0 0 - - - 0; +#X text 253 378 combining a filename and the ownership level; +#X floatatom 183 492 5 0 0 0 - - - 0; +#X text 227 493 effective ownership level; +#X text 146 206 a numeric ownership level specifies this patch (0) \, owning patch (1) \, its own owner (2) \, and so on. (Ownership level is reduced if owners don't exist \, so here anything greater than zero is ignored.); +#X text 245 418 tip: use [file normalize] on the output of [file patchpath] to drop relative directory components (../), f 43; +#X text 51 99 For reading files \, you might want to use [file which] instead (which uses Pd's search path to find existing files)., f 68; +#X obj 9 49 cnv 1 601 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#N canvas 719 76 573 367 reference 0; +#X obj 9 52 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0; +#X obj 9 171 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 8 346 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 9 228 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 198 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X text 155 302 -q: set quiet verbosity., f 49; +#X text 155 320 -v: set loud verbosity., f 49; +#X text 70 146 verbose - set verbosity on or off.; +#X obj 7 268 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 7 294 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0; +#X text 133 85 symbol - filename to resolve relative to patch directory; +#X text 147 65 bang - get the directory this patch is in; +#X text 141 234 float - the effective ownership level; +#X text 133 202 symbol - the patch directory; +#X text 139 105 float - ownership level; +#X text 146 125 list - filename + ownership level; +#X obj 36 15 file patchpath; +#X text 152 16 - resolve paths relative to the patch.; +#X restore 503 17 pd reference; +#X text 148 16 - resolve paths relative to the patch; +#X obj 32 15 file patchpath; +#X obj 47 168 bng 20 250 50 0 empty empty empty -35 10 0 10 #dfdfdf #000000 #000000; +#X text 51 64 [file patchpath] gets the directory this patch (or its owner) is on. This is especially useful for creating filenames for saving., f 68; +#X connect 1 0 0 0; +#X connect 1 1 10 0; +#X connect 3 0 1 0; +#X connect 4 0 1 0; +#X connect 7 0 1 0; +#X connect 8 0 1 0; +#X connect 19 0 1 0; +#X restore 442 197 pd patchpath; +#X text 155 196 - get path relative to the patch; +#X obj 27 172 file cwd; +#X text 155 171 - get/set the current working directory; +#N canvas 536 54 569 586 cwd 0; +#X obj 196 467 bng 20 250 50 0 empty empty empty -35 10 0 10 #dfdfdf #000000 #000000; +#X obj 108 425 file cwd, f 13; +#X text 115 172 get the Current Working Directory; +#X obj 108 470 print CWD; +#X msg 129 257 symbol ~; +#X msg 108 216 symbol ..; +#X text 185 215 change to the parent directory; +#X text 202 257 change to the HOME-directory; +#X msg 145 298 symbol /foo; +#X text 237 292 change to some other (most likely nonexistent) directory, f 29; +#X obj 160 366 openpanel 1; +#X text 189 340 select a new working directory; +#X text 52 63 [file cwd] allows you to query and set the Current Working Directory., f 69; +#X text 53 90 The Current Working Directory is typically the directory where you started Pd from (and is distinct from the directory your patch or abstraction lives in \, or where Pd is installed to), f 69; +#X obj 11 47 cnv 1 550 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#N canvas 699 31 574 336 reference 0; +#X obj 9 52 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0; +#X obj 9 131 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 8 306 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 9 187 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 157 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X text 155 262 -q: set quiet verbosity., f 49; +#X text 155 280 -v: set loud verbosity., f 49; +#X text 70 106 verbose - set verbosity on or off.; +#X text 132 194 bang - if an error occurs.; +#X obj 7 227 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 7 253 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0; +#X text 147 65 bang - get the current working directory; +#X text 133 85 symbol - new working directory; +#X text 120 162 symbol - the current working directory; +#X text 112 15 - the Current Working Directory; +#X obj 36 15 file cwd; +#X restore 447 14 pd reference; +#X text 112 15 - the Current Working Directory; +#X obj 36 15 file cwd; +#X text 189 491 error; +#X obj 83 172 bng 20 250 50 0 empty empty empty -35 10 0 10 #dfdfdf #000000 #000000; +#X obj 160 341 bng 20 250 50 0 empty empty empty -35 10 0 10 #dfdfdf #000000 #000000; +#X text 242 431 In case of an error \, the 2nd outlet sends out a bang. An error occurs for example \, if you try to change the CWD to a path that is not a directory., f 37; +#N canvas 373 310 531 228 flags 0; +#X text 164 93 less verbose (quiet); +#X text 164 123 more verbose (loud); +#X msg 354 113 verbose \$1; +#X obj 354 81 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X text 34 29 error reporting on the Pd-console; +#X text 129 59 via flags:; +#X text 380 82 via a message:; +#X obj 36 93 file cwd -q; +#X obj 36 123 file cwd -v; +#X obj 354 138 file cwd; +#X connect 2 0 9 0; +#X connect 3 0 2 0; +#X restore 350 533 pd flags; +#X connect 1 0 3 0; +#X connect 1 1 0 0; +#X connect 4 0 1 0; +#X connect 5 0 1 0; +#X connect 8 0 1 0; +#X connect 10 0 1 0; +#X connect 19 0 1 0; +#X connect 20 0 10 0; +#X restore 442 172 pd cwd; +#X obj 27 614 file isabsolute; +#N canvas 469 92 627 573 isabsolute 0; +#X floatatom 89 529 5 0 0 0 - - - 0; +#X obj 158 378 openpanel; +#X msg 64 153 symbol .; +#X text 50 122 relative directories; +#X msg 88 184 symbol ../foo/./bar; +#X msg 102 216 symbol foo/gen; +#X text 129 254 absolute directories; +#X msg 140 285 symbol /foo; +#X msg 148 319 symbol ~; +#X text 218 315 (the HOME-directory is expanded to an absolute path), f 32; +#X text 232 379 [openpanel] always returns an absolute path; +#X msg 159 445 symbol C:/Windows/; +#X text 310 424 this is an absolute path on Windows \, but on un*x-like systems (like Linux or macOS) it is relative..., f 36; +#X obj 11 47 cnv 1 605 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#N canvas 662 80 573 295 reference 0; +#X obj 9 52 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0; +#X obj 9 91 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 8 266 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 9 148 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 118 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X text 155 222 -q: set quiet verbosity., f 49; +#X text 155 240 -v: set loud verbosity., f 49; +#X obj 7 188 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 7 214 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0; +#X text 141 154 (unused); +#X text 133 122 float - whether the input path is absolute or not; +#X text 133 65 symbol - filename to test if is absolute; +#X text 152 16 - check whether a path is absolute; +#X obj 36 15 file isabsolute; +#X restore 502 14 pd reference; +#X text 152 16 - check whether a path is absolute; +#X obj 36 15 file isabsolute; +#X obj 89 493 file isabsolute; +#X text 161 415 system-dependent...; +#X text 24 66 [file isabsolute] reports whether a given path is absolute or relative. this only takes the value of the path into account. NO checks are performed verifying the validity/existence of any path-component., f 76; +#X obj 158 349 bng 19 250 50 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000; +#X connect 1 0 17 0; +#X connect 2 0 17 0; +#X connect 4 0 17 0; +#X connect 5 0 17 0; +#X connect 7 0 17 0; +#X connect 8 0 17 0; +#X connect 11 0 17 0; +#X connect 17 0 0 0; +#X connect 20 0 1 0; +#X restore 442 614 pd isabsolute; +#X obj 27 587 file normalize; +#N canvas 493 23 705 716 normalize 0; +#X symbolatom 77 403 0 0 0 0 - - - 0; +#X symbolatom 77 340 0 0 0 0 - - - 0; +#X msg 37 111 symbol foo/./bar///pizza; +#X obj 77 371 file normalize; +#X msg 61 143 symbol path/to/pd; +#X text 217 112 remove ./ and duplicate /; +#X text 194 141 already normalized paths are passed through unchanged; +#X msg 77 175 symbol foo/..; +#X msg 100 216 symbol ../foo; +#X text 187 168 entering a directory and then going "up" again \, is the same as not entering at all, f 47; +#X text 207 209 however \, going up from the current directory and then entering "foo" \, you might end up somewhere else. so this is left unchanged., f 66; +#X msg 116 258 symbol /../foo; +#X text 235 251 you cannot go up from the root directory (/) \, so the ".." component doesn't do anything. "foo" however does.; +#X msg 134 301 symbol C:/../foo; +#X symbolatom 56 690 0 0 0 0 - - - 0; +#X symbolatom 56 609 0 0 0 0 - - - 0; +#X obj 56 635 file normalize; +#X floatatom 151 663 5 0 0 0 - - - 0; +#X msg 56 482 symbol foo/C:/bar; +#X text 219 626 in order to make your patches cross-platform compatible \, you should avoid paths that are allowed on your current system \, but illegal on other OSs., f 63; +#X msg 76 521 symbol this|that; +#X msg 96 555 symbol mixer/AUX/fx~; +#X text 191 475 ":" is a reserved character on MSW \, so you cannot use it in a path (only for the disk volume). On un*x this is allowed.; +#X text 201 520 other characters are just illegal on MSW.; +#X text 253 554 sometimes even entire words are illegal on MSW.; +#X obj 7 40 cnv 1 690 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#N canvas 657 23 576 318 reference 0; +#X obj 9 52 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0; +#X obj 9 111 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0; +#X obj 8 286 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 9 168 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 138 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X text 155 242 -q: set quiet verbosity., f 49; +#X text 155 260 -v: set loud verbosity., f 49; +#X obj 7 208 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 7 234 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0; +#X text 131 174 float - error-code indicating if the path is valid; +#X text 133 142 symbol - the normalized path; +#X obj 36 15 file normalize; +#X text 152 16 - remove redundant elements from a path.; +#X text 133 65 symbol - path to normalize; +#X text 68 85 verbose - set verbosity; +#X restore 588 12 pd reference; +#X obj 29 12 file normalize; +#X text 145 11 - remove redundant elements from a path.; +#X text 23 50 [file normalize] removes unnecessary elements from a path \, like duplicate path separators or "./" (which just points to the same path). This only takes the string value of the path into account. no checks are performed verifying the validity/existence of any path-component., f 93; +#X text 42 432 [file normalize] can also be used to check whether a path is valid. Invalid paths will also print an error to the Pd-console \, which can be suppressed by reducing the verbosity., f 89; +#X text 268 296 On Microsoft Windows (MSW) \, "C:/" this is an absolute path \, so going up from it is just discarded. However \, on un*x (Linux \, macOS \, ...) \, C: is just a relative path that is made redundant by the following "..", f 53; +#X text 219 591 The 2nd outlet gives an error code \, indicating whether the path is valid (0) \, invalid (2) or invalid-on-other-systems (1)., f 63; +#N canvas 19 51 868 238 flags 0; +#X text 274 145 less verbose (quiet); +#X text 274 175 more verbose (loud); +#X msg 563 149 verbose \$1; +#X obj 563 127 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1; +#X text 106 70 error reporting on the Pd-console; +#X text 239 111 via flags:; +#X text 524 100 via a message:; +#X obj 146 145 file normalize -q; +#X obj 146 175 file normalize -v; +#X obj 563 174 file normalize; +#X connect 2 0 9 0; +#X connect 3 0 2 0; +#X restore 513 680 pd flags; +#X connect 1 0 3 0; +#X connect 2 0 1 0; +#X connect 3 0 0 0; +#X connect 4 0 1 0; +#X connect 7 0 1 0; +#X connect 8 0 1 0; +#X connect 11 0 1 0; +#X connect 13 0 1 0; +#X connect 15 0 16 0; +#X connect 16 0 14 0; +#X connect 16 1 17 0; +#X connect 18 0 15 0; +#X connect 20 0 15 0; +#X connect 21 0 15 0; +#X restore 442 587 pd normalize; +#X text 349 664 updated for Pd version 0.55; +#X text 28 68 The first argument of [file] sets its function:; diff --git a/pd/doc/5.reference/slop~-help.pd b/pd/doc/5.reference/slop~-help.pd new file mode 100644 index 000000000..7dc46fa70 --- /dev/null +++ b/pd/doc/5.reference/slop~-help.pd @@ -0,0 +1,617 @@ +#N canvas 304 34 927 598 12; +#X obj 35 122 osc~; +#X floatatom 35 96 5 0 0 0 - - - 0; +#X obj 81 478 tabwrite~ \$0-graph; +#X obj 107 447 metro 500; +#X obj 107 401 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X floatatom 116 159 5 0 10000 0 - - - 0; +#X floatatom 152 186 5 0 10000 0 - - - 0; +#X floatatom 224 269 5 0 0 0 - - - 0; +#X msg 83 133 set 0; +#X obj 224 292 / 100; +#X obj 152 209 / 100; +#X obj 81 363 slop~ 1000 1e+09 0 1e+09 0; +#X text 158 159 cutoff frequency in linear region; +#X floatatom 188 236 5 0 10000 0 - - - 0; +#X text 198 186 maximum downward slew of linear region; +#X text 231 226 asymptotic downward cutoff frequency (for downward slews greater than maximum), f 41; +#X text 273 267 maximum upward slew of linear region; +#X text 305 316 asymptotic upward cutoff frequency (for upward slews greater than maximum), f 41; +#X floatatom 260 323 5 0 10000 0 - - - 0; +#X text 76 96 frequency of test oscillator; +#N canvas 321 28 964 672 compander-limiter 0; +#N canvas 622 189 476 482 generate-test 0; +#X obj 77 159 osc~ 440; +#X obj 197 162 line~; +#X msg 197 136 1 \, 0 500; +#X msg 130 125 -0.25; +#X obj 197 196 *~; +#X obj 78 256 *~; +#X obj 78 365 outlet~; +#X obj 178 299 tabwrite~ \$0-test-in; +#X obj 178 70 r \$0-testpulse; +#X connect 0 0 5 0; +#X connect 1 0 4 0; +#X connect 1 0 4 1; +#X connect 2 0 1 0; +#X connect 3 0 0 1; +#X connect 4 0 5 1; +#X connect 5 0 6 0; +#X connect 5 0 7 0; +#X connect 8 0 7 0; +#X connect 8 0 3 0; +#X connect 8 0 2 0; +#X restore 221 64 pd generate-test; +#X obj 88 99 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X obj 88 126 metro 500; +#X obj 88 156 s \$0-testpulse; +#N canvas 323 324 347 253 resize 0; +#X obj 83 52 inlet; +#X msg 83 79 resize \$1; +#X obj 105 109 s \$0-test-in; +#X obj 98 141 s \$0-slop-out; +#X obj 83 168 s \$0-compander-out; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 1 0 3 0; +#X connect 1 0 4 0; +#X restore 607 610 pd resize; +#X msg 624 579 20000; +#N canvas 455 23 698 690 parameters 0; +#X obj 191 14 inlet; +#X obj 29 32 r \$0-limit; +#X obj 37 55 r \$0-knee; +#X obj 45 78 r \$0-boost; +#X obj 61 122 r \$0-thresh; +#X obj 54 100 r \$0-ratio; +#X obj 29 158 t b b; +#X obj 29 208 until; +#X obj 87 235 + 1; +#X msg 78 205 0; +#X obj 96 649 tabwrite \$0-dynamic-curve, f 52; +#X obj 472 427 moses; +#X obj 543 377 r \$0-thresh; +#X obj 605 414 r \$0-ratio; +#X obj 605 441 f; +#X obj 605 466 / 100; +#X obj 96 595 +; +#X msg 504 453 0; +#X obj 482 520 expr ($f1-$f2)*$f3; +#X obj 96 620 max 0; +#X obj 605 491 - 1; +#X obj 29 318 +; +#X obj 47 294 r \$0-boost; +#X obj 137 294 r \$0-limit; +#X obj 119 327 f; +#X obj 137 352 -; +#X obj 29 344 t f b; +#X obj 271 294 r \$0-knee; +#X obj 182 420 +; +#X obj 61 394 -; +#X obj 29 421 moses; +#X obj 96 451 moses; +#X obj 123 515 b; +#X obj 359 448 r \$0-limit; +#X obj 143 548 f; +#X obj 96 483 expr $f4 - ($f2-$f1)*($f2-$f1)/(4*$f3); +#X obj 51 462 +; +#X msg 29 183 102; +#X obj 271 320 f; +#X obj 271 345 / 2; +#X obj 155 327 r \$0-boost; +#X obj 86 419 r \$0-boost; +#X obj 29 266 trigger float float, f 61; +#X obj 161 514 r \$0-limit; +#X obj 29 233 float; +#X obj 191 49 unpack f f f f f f; +#N canvas 416 159 334 253 set-speed 0; +#X msg 115 81 set \$1; +#X obj 95 43 inlet; +#X obj 115 111 s \$0-speed-set; +#X obj 96 154 s \$0-speed; +#X connect 0 0 2 0; +#X connect 1 0 0 0; +#X connect 1 0 3 0; +#X restore 314 76 pd set-speed; +#N canvas 416 159 334 253 set-thresh 0; +#X msg 115 81 set \$1; +#X obj 95 43 inlet; +#X obj 115 111 s \$0-thresh-set; +#X obj 96 154 s \$0-thresh; +#X connect 0 0 2 0; +#X connect 1 0 0 0; +#X connect 1 0 3 0; +#X restore 289 103 pd set-thresh; +#N canvas 416 159 334 253 set-ratio 0; +#X msg 115 81 set \$1; +#X obj 95 43 inlet; +#X obj 115 111 s \$0-ratio-set; +#X obj 96 154 s \$0-ratio; +#X connect 0 0 2 0; +#X connect 1 0 0 0; +#X connect 1 0 3 0; +#X restore 264 129 pd set-ratio; +#N canvas 416 159 334 253 set-boost 0; +#X msg 115 81 set \$1; +#X obj 95 43 inlet; +#X obj 115 111 s \$0-boost-set; +#X obj 96 154 s \$0-boost; +#X connect 0 0 2 0; +#X connect 1 0 0 0; +#X connect 1 0 3 0; +#X restore 240 156 pd set-boost; +#N canvas 416 159 334 253 set-knee 0; +#X msg 115 81 set \$1; +#X obj 95 43 inlet; +#X obj 115 111 s \$0-knee-set; +#X obj 96 154 s \$0-knee; +#X connect 0 0 2 0; +#X connect 1 0 0 0; +#X connect 1 0 3 0; +#X restore 215 180 pd set-knee; +#N canvas 416 159 334 253 set-limit 0; +#X msg 115 81 set \$1; +#X obj 95 43 inlet; +#X obj 115 111 s \$0-limit-set; +#X obj 96 154 s \$0-limit; +#X connect 0 0 2 0; +#X connect 1 0 0 0; +#X connect 1 0 3 0; +#X restore 191 204 pd set-limit; +#X connect 0 0 45 0; +#X connect 1 0 6 0; +#X connect 2 0 6 0; +#X connect 3 0 6 0; +#X connect 4 0 6 0; +#X connect 5 0 6 0; +#X connect 6 0 37 0; +#X connect 6 1 9 0; +#X connect 7 0 44 0; +#X connect 8 0 44 1; +#X connect 9 0 44 1; +#X connect 11 0 18 0; +#X connect 11 1 17 0; +#X connect 12 0 11 1; +#X connect 12 0 18 1; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 20 0; +#X connect 16 0 19 0; +#X connect 17 0 16 1; +#X connect 18 0 16 1; +#X connect 19 0 10 0; +#X connect 20 0 18 2; +#X connect 21 0 26 0; +#X connect 22 0 21 1; +#X connect 23 0 24 1; +#X connect 24 0 25 0; +#X connect 25 0 28 0; +#X connect 25 0 29 0; +#X connect 26 0 30 0; +#X connect 26 1 24 0; +#X connect 27 0 38 0; +#X connect 28 0 31 1; +#X connect 28 0 35 1; +#X connect 29 0 30 1; +#X connect 30 0 36 0; +#X connect 30 1 31 0; +#X connect 31 0 35 0; +#X connect 31 1 32 0; +#X connect 32 0 34 0; +#X connect 33 0 35 3; +#X connect 34 0 16 0; +#X connect 35 0 16 0; +#X connect 36 0 16 0; +#X connect 37 0 7 0; +#X connect 38 0 39 0; +#X connect 39 0 29 1; +#X connect 39 0 28 1; +#X connect 39 0 35 2; +#X connect 40 0 25 1; +#X connect 41 0 36 1; +#X connect 42 0 21 0; +#X connect 42 1 10 1; +#X connect 42 1 11 0; +#X connect 43 0 34 1; +#X connect 44 0 8 0; +#X connect 44 0 42 0; +#X connect 45 0 51 0; +#X connect 45 1 50 0; +#X connect 45 2 49 0; +#X connect 45 3 48 0; +#X connect 45 4 47 0; +#X connect 45 5 46 0; +#X restore 719 530 pd parameters; +#X floatatom 618 340 4 0 100 0 limit \$0-limit-set \$0-limit 0; +#X floatatom 618 361 4 0 20 0 knee \$0-knee-set \$0-knee 0; +#X floatatom 618 382 4 0 50 0 boost \$0-boost-set \$0-boost 0; +#X floatatom 618 403 4 0 200 0 ratio \$0-ratio-set \$0-ratio 0; +#X floatatom 618 425 4 0 100 0 thresh \$0-thresh-set \$0-thresh 0; +#X floatatom 618 446 4 0 200 0 speed \$0-speed-set \$0-speed 0; +#N canvas 403 113 573 630 run-compander 0; +#X obj 47 20 inlet~; +#X obj 83 174 slop~ 0 0 0 0 1e+09; +#X obj 161 82 r \$0-speed; +#X obj 161 107 f; +#X obj 161 132 / 10; +#X obj 343 231 r \$0-testpulse; +#X obj 357 289 tabwrite~ \$0-slop-out; +#X obj 83 142 abs~; +#X obj 97 278 tabread4~ \$0-dynamic-curve; +#X obj 65 328 -~; +#X obj 65 353 +~ 100; +#X obj 65 378 dbtorms~; +#X obj 83 246 rmstodb~; +#X obj 47 428 *~; +#X obj 47 563 outlet~; +#X obj 343 517 tabwrite~ \$0-compander-out; +#X text 241 168 same envelope follower as in the peak meter example, f 26; +#X text 130 322 "correct" the level by applying a gain calculated from the difference between the measured and desired level, f 27; +#X connect 0 0 7 0; +#X connect 0 0 13 0; +#X connect 1 0 6 0; +#X connect 1 0 12 0; +#X connect 2 0 3 0; +#X connect 3 0 4 0; +#X connect 4 0 1 3; +#X connect 5 0 6 0; +#X connect 5 0 15 0; +#X connect 7 0 1 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X connect 10 0 11 0; +#X connect 11 0 13 1; +#X connect 12 0 9 1; +#X connect 12 0 8 0; +#X connect 13 0 14 0; +#X connect 13 0 15 0; +#X restore 221 149 pd run-compander; +#X msg 616 551 2000; +#X msg 607 525 300; +#X msg 730 424 100 0 0 200 100 100; +#X msg 710 368 100 0 0 100 0 50; +#X text 831 367 no change; +#X text 841 397 limit; +#X text 872 422 expand; +#X text 872 452 compress; +#X text 876 480 noise gate; +#X msg 750 481 100 0 0 200 60 30; +#X msg 740 452 100 0 0 50 100 100; +#X msg 720 397 90 10 0 100 0 50; +#N canvas 601 360 267 339 (subpatch) 0; +#X obj 108 109 hsl 100 15 0 1 0 0 empty empty Volume 32 9 0 12 #dcdcdc #000000 #000000 0 1; +#X obj 87 43 inlet~; +#X obj 105 148 pow 4; +#X obj 105 199 line~; +#X msg 105 173 \$1 10; +#X obj 87 226 *~; +#X obj 87 257 dac~; +#X connect 0 0 2 0; +#X connect 1 0 5 0; +#X connect 2 0 4 0; +#X connect 3 0 5 1; +#X connect 4 0 3 0; +#X connect 5 0 6 0; +#X connect 5 0 6 1; +#X coords 0 -1 1 1 116 32 2 100 100; +#X restore 245 100 pd; +#N canvas 601 360 267 339 (subpatch) 0; +#X obj 108 109 hsl 100 15 0 1 0 0 empty empty Volume 32 9 0 12 #dcdcdc #000000 #000000 0 1; +#X obj 87 43 inlet~; +#X obj 105 148 pow 4; +#X obj 105 199 line~; +#X msg 105 173 \$1 10; +#X obj 87 226 *~; +#X obj 87 257 dac~; +#X connect 0 0 2 0; +#X connect 1 0 5 0; +#X connect 2 0 4 0; +#X connect 3 0 5 1; +#X connect 4 0 3 0; +#X connect 5 0 6 0; +#X connect 5 0 6 1; +#X coords 0 -1 1 1 116 32 2 100 100; +#X restore 221 186 pd; +#X text 440 47 See the HTML documentation (link on main page of this patch) for details.; +#X obj 710 339 loadbang; +#X text 36 22 Using [slop~] to make a compressor/expander/limiter; +#X msg 458 152 \; pd dsp \$1; +#X obj 458 117 set-dsp-tgl; +#X text 489 121 DSP on/off; +#X obj 34 241 cnv 19 498 138 empty empty empty 20 12 0 12 #e0e0e0 #404040 0; +#X obj 34 411 cnv 19 498 68 empty empty empty 20 12 0 12 #e0e0e0 #404040 0; +#N canvas 0 50 450 250 (subpatch) 0; +#X array \$0-test-in 20000 float 2; +#X coords 0 1 20000 -1 500 140 1 0 0; +#X restore 33 240 graph; +#N canvas 0 50 450 250 (subpatch) 0; +#X array \$0-slop-out 20000 float 2; +#X coords 0 1 20000 0 500 70 1 0 0; +#X restore 33 410 graph; +#X obj 34 512 cnv 19 498 138 empty empty empty 20 12 0 12 #e0e0e0 #404040 0; +#N canvas 0 50 450 250 (subpatch) 0; +#X array \$0-compander-out 20000 float 2; +#X coords 0 1 20000 -1 500 140 1 0 0; +#X restore 33 511 graph; +#X obj 673 111 cnv 19 198 198 empty empty empty 20 12 0 12 #e0e0e0 #404040 0; +#N canvas 0 50 450 250 (subpatch) 0; +#X array \$0-dynamic-curve 102 float 0; +#X coords 0 100 101 0 200 200 1 0 0; +#X restore 672 110 graph; +#X connect 0 0 13 0; +#X connect 0 0 26 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 5 0 4 0; +#X connect 13 0 27 0; +#X connect 14 0 4 0; +#X connect 15 0 4 0; +#X connect 16 0 6 0; +#X connect 17 0 6 0; +#X connect 23 0 6 0; +#X connect 24 0 6 0; +#X connect 25 0 6 0; +#X connect 29 0 17 0; +#X connect 32 0 31 0; +#X restore 704 301 pd compander-limiter; +#N canvas 392 78 904 478 slew-limiter 0; +#X floatatom 134 96 5 0 1000 0 - - - 0; +#X obj 134 120 t f b; +#X obj 166 149 samplerate~; +#X obj 134 149 /; +#X obj 78 378 metro 500; +#X obj 54 412 tabwrite~ \$0-slew-graph; +#X floatatom 214 217 5 0 1000 0 - - - 0; +#X obj 214 241 t f b; +#X obj 246 269 samplerate~; +#X obj 214 270 /; +#X obj 54 201 osc~ 100; +#X text 437 234 See the HTML documentation (link on main page of this patch) for details.; +#X text 437 164 Here the maximum slope of the 100-Hz. sinusoid is 200pi \, about 628.3. Setting upward or downward slew limits below that will replace the waveform with straight line segments on the way up and/or down., f 60; +#X text 182 95 max downward slope; +#X text 262 216 max upward slope; +#X text 437 31 The slew limiter is a filter whose cutoff frequency is infinite (so that the output follows the input exactly) unless the input varies from the previous output by more than the highest slope we allow (the slew limit) times the sample period (i.e. \, the maximum variation allowed over the space of a sample). This limit is therefore in units of amplitude per sample. The number boxes specify amplitude change per second \, which we divide by the sample rate to convert to the units needed by [slop~]., f 60; +#X obj 78 336 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X text 102 335 <- start metronome to graph output, f 18; +#X text 83 27 Using [slop~] to make a slew limiter; +#X msg 261 388 \; pd dsp \$1; +#X obj 261 353 set-dsp-tgl; +#X text 291 357 DSP on/off; +#X obj 393 307 cnv 19 498 138 empty empty empty 20 12 0 12 #e0e0e0 #404040 0; +#N canvas 0 50 450 250 (subpatch) 0; +#X array \$0-slew-graph 1000 float 0; +#X coords 0 1 999 -1 500 140 1 0 0; +#X restore 392 306 graph; +#X obj 137 69 hsl 162 19 628.3 100 0 0 empty empty empty -2 -10 0 12 #dfdfdf #000000 #000000 0 1; +#X obj 217 191 hsl 162 19 628.3 100 0 0 empty empty empty -2 -10 0 12 #dfdfdf #000000 #000000 0 1; +#X obj 54 302 slop~ 1e+09 0.0142 0 0.0142 0; +#X connect 0 0 1 0; +#X connect 1 0 3 0; +#X connect 1 1 2 0; +#X connect 2 0 3 1; +#X connect 3 0 26 2; +#X connect 4 0 5 0; +#X connect 6 0 7 0; +#X connect 7 0 9 0; +#X connect 7 1 8 0; +#X connect 8 0 9 1; +#X connect 9 0 26 4; +#X connect 10 0 26 0; +#X connect 16 0 4 0; +#X connect 20 0 19 0; +#X connect 24 0 0 0; +#X connect 25 0 6 0; +#X connect 26 0 5 0; +#X restore 704 249 pd slew-limiter; +#N canvas 420 78 763 564 peak-meter 0; +#X floatatom 217 132 5 0 50 0 - \$0-decay-speed-init - 0; +#N canvas 422 246 639 450 generate-test 0; +#X obj 45 196 osc~ 440; +#X msg 98 166 -0.25; +#X obj 165 239 *~; +#X obj 147 270 *~; +#X obj 147 395 outlet~; +#X obj 165 153 f; +#X msg 165 178 1 \, 0 \$1; +#X obj 338 87 loadbang; +#X obj 383 157 s \$0-decay-speed-init; +#X msg 338 127 30; +#X obj 97 78 metro 500; +#X obj 97 25 inlet; +#X msg 383 127 500; +#X obj 183 25 inlet; +#X obj 165 204 line~; +#X obj 338 187 s \$0-pulse-length-init; +#X obj 253 25 inlet; +#X obj 253 243 pow 4; +#X obj 253 294 line~; +#X msg 253 268 \$1 10; +#X obj 235 321 *~; +#X obj 235 352 dac~; +#X connect 0 0 3 0; +#X connect 1 0 0 1; +#X connect 2 0 3 1; +#X connect 3 0 4 0; +#X connect 3 0 20 0; +#X connect 5 0 6 0; +#X connect 6 0 14 0; +#X connect 7 0 9 0; +#X connect 7 0 12 0; +#X connect 9 0 15 0; +#X connect 10 0 5 0; +#X connect 10 0 1 0; +#X connect 11 0 10 0; +#X connect 12 0 8 0; +#X connect 13 0 5 1; +#X connect 14 0 2 0; +#X connect 14 0 2 1; +#X connect 16 0 17 0; +#X connect 17 0 19 0; +#X connect 18 0 20 1; +#X connect 19 0 18 0; +#X connect 20 0 21 0; +#X connect 20 0 21 1; +#X restore 47 101 pd generate-test; +#X text 365 155 Envelope follower for use in peak metering; +#X text 314 467 See the HTML documentation (link on main page of this patch) for more details., f 54; +#X floatatom 101 63 5 1 100 2 pulse-length \$0-pulse-length-init - 0; +#X obj 47 214 env~ 1024; +#X obj 139 183 abs~; +#X obj 139 248 snapshot~; +#X obj 139 281 rmstodb; +#X obj 127 347 vu 18 160 empty VU -20 20 0 12 #404040 #000000 1 0; +#X obj 139 213 slop~ 0 0 0 0 1e+09; +#X obj 47 248 t f b; +#X obj 47 289 - 100; +#X obj 139 306 - 100; +#X obj 47 24 tgl 19 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000 0 1; +#X obj 217 156 expr 1000 / $f1; +#X text 197 132 ms; +#X text 215 109 decay speed; +#X floatatom 217 182 5 0 0 0 - - - 0; +#X text 197 183 hz; +#X obj 159 72 hsl 128 19 0 1 0 0 empty empty empty 32 9 0 12 #dcdcdc #000000 #000000 0 1; +#X text 314 204 A slew limiter can be used as a fast-rising envelope follower \, useful for example in peak metering. In this example a short burst of sound is metered using both the [env~] follower (which measures an average over a time window) and a fast-rising envelope follower consisting of an [abs~] object (to rectify the signal) followed by a [slop~] object set to rise quickly (1e09 asymptotic rise speed \, 0 up-slew needed to engage it) and with controllable decay (asymptotic downward speed controlled by a number box). There is no linear region at all so the linear cutoff frequency has no effect., f 54; +#X text 314 368 The output is sampled using a [snapshot~] object. Both envelope followers are converted to dBFS for the IEM VU meter., f 54; +#X text 314 420 When the pulse is very short (1 msec \, for instance) the RMS meter acts badly but the [slop~]-driven one still shows the peak., f 54; +#X text 198 73 Volume; +#X text 71 23 <- turn on test pulse; +#X text 35 421 see also ->; +#X msg 385 81 \; pd dsp \$1; +#X obj 385 46 set-dsp-tgl; +#X text 416 50 DSP on/off; +#X connect 0 0 15 0; +#X connect 1 0 5 0; +#X connect 1 0 6 0; +#X connect 4 0 1 1; +#X connect 5 0 11 0; +#X connect 6 0 10 0; +#X connect 7 0 8 0; +#X connect 8 0 13 0; +#X connect 10 0 7 0; +#X connect 11 0 12 0; +#X connect 11 1 7 0; +#X connect 12 0 9 0; +#X connect 13 0 9 1; +#X connect 14 0 1 0; +#X connect 15 0 18 0; +#X connect 18 0 10 3; +#X connect 20 0 1 2; +#X connect 28 0 27 0; +#X restore 704 274 pd peak-meter; +#X text 129 132 set state (previously stored output); +#N canvas 467 45 850 454 jitter-remover 0; +#X floatatom 132 194 5 0 100 0 - - - 0; +#X obj 95 354 metro 500; +#X obj 95 308 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X obj 69 70 osc~ 100; +#X obj 69 385 tabwrite~ \$0-jitter-graph; +#X obj 69 101 clip~ -0.3 0.3; +#X obj 186 85 osc~ 1000; +#X obj 186 110 *~ 0.03; +#X obj 69 146 +~; +#X obj 69 255 slop~ 0 0 1e+09 0 1e+09; +#X obj 132 218 / 1000; +#X text 179 193 jitter range \, 0 to 0.1; +#X text 69 27 jitter remover; +#X text 411 150 Set the jitter range to zero to see the original signal and raise it to see smoothing.; +#X text 412 59 If you have a noisy sensor \, one approach to smoothing it is to set slop~ up to only react to motion past a certain window. The linear frequency cutoff is set to zero so that the output only changes when the input strays by more than the maximum upward or downward slew.; +#X text 120 308 <-- start metronome to graph output, f 20; +#X msg 281 108 \; pd dsp \$1; +#X obj 281 73 set-dsp-tgl; +#X text 312 77 DSP on/off; +#X obj 306 263 cnv 19 498 138 empty empty empty 20 12 0 12 #e0e0e0 #404040 0; +#N canvas 0 50 450 250 (subpatch) 0; +#X array \$0-jitter-graph 1000 float 0; +#X coords 0 1 999 -1 500 140 1 0 0; +#X restore 305 262 graph; +#X connect 0 0 10 0; +#X connect 1 0 4 0; +#X connect 2 0 1 0; +#X connect 3 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 7 0; +#X connect 7 0 8 1; +#X connect 8 0 9 0; +#X connect 9 0 4 0; +#X connect 10 0 9 2; +#X connect 10 0 9 4; +#X connect 17 0 16 0; +#X restore 704 329 pd jitter-remover; +#X text 699 223 Examples:; +#X text 22 565 see also:; +#X obj 101 564 lop~; +#X obj 151 564 fexpr~; +#X obj 24 44 slop~, f 7; +#X obj 10 75 cnv 1 910 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#X obj 436 15 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000; +#X obj 10 551 cnv 1 910 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#N canvas 798 148 488 282 html-reference 0; +#X obj 101 59 inlet; +#X obj 101 190 pdcontrol; +#X obj 101 130 pdcontrol; +#X msg 101 105 dir; +#X text 205 94 this window opens the html reference link via the [pdcontrol] object., f 25; +#X msg 101 159 browse \$1/../8.topics/slop-tilde.htm; +#X connect 0 0 3 0; +#X connect 2 0 5 0; +#X connect 3 0 2 0; +#X connect 5 0 1 0; +#X restore 436 44 pd html-reference; +#N canvas 734 107 574 398 reference 0; +#X obj 11 46 cnv 5 550 5 empty empty INLETS: 8 18 0 13 #202020 #000000 0; +#X obj 11 242 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000 0; +#X obj 11 275 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 10 371 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 11 75 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 117 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 24 15 slop~, f 7; +#X obj 11 141 cnv 1 550 1 empty empty 3rd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 165 cnv 1 550 1 empty empty 4th: 8 12 0 13 #7c7c7c #000000 0; +#X obj 11 191 cnv 1 550 1 empty empty 5th: 8 12 0 13 #7c7c7c #000000 0; +#X obj 9 217 cnv 1 550 1 empty empty 6th: 8 12 0 13 #7c7c7c #000000 0; +#X text 120 78 signal - input signal to be filtered., f 46; +#X text 85 96 set - set state (previously stored output).; +#X text 120 120 signal - cutoff frequency in linear region., f 46; +#X text 120 144 signal - maximum downward slew of linear region.; +#X text 120 169 signal - asymptotic downward cutoff frequency.; +#X text 120 195 signal - maximum upward slew of linear region.; +#X text 120 250 signal - filtered signal.; +#X text 120 220 signal - asymptotic upward cutoff frequency.; +#X text 107 281 1) float - cutoff frequency in linear region (default 0)., f 62; +#X text 107 298 2) float - maximum downward slew of linear region (default 0)., f 62; +#X text 107 315 3) float - asymptotic downward cutoff frequency (default 0)., f 62; +#X text 107 332 4) float - maximum upward slew of linear region (default 0)., f 62; +#X text 107 349 5) float - asymptotic upward cutoff frequency (default 0)., f 62; +#X text 84 14 - slew-limiting / low-pass filter; +#X restore 739 44 pd reference; +#X text 837 43 <= click; +#X text 518 106 The [slop~] object is a low-pass filter whose frequency response (i.e. \, reaction speed) can vary according to the filter's state. It can be useful for slew limiting \, dynamics processing (companders/limiters/noise gates) \, and soft saturation. Examples below are explained in the HTML reference (linked above)., f 55; +#X text 133 399 <- start metronome to graph output, f 18; +#X text 459 14 <- Open HTML reference; +#X text 84 43 - slew-limiting / low-pass filter; +#X msg 252 489 \; pd dsp \$1; +#X obj 252 454 set-dsp-tgl; +#X text 283 458 DSP on/off; +#X obj 405 385 cnv 19 498 138 empty empty empty 20 12 0 12 #e0e0e0 #404040 0; +#N canvas 0 50 450 250 (subpatch) 0; +#X array \$0-graph 1000 float 1; +#A 0 -0.239854 -0.245719 -0.251574 -0.25742 -0.263255 -0.269079 -0.274893 -0.280696 -0.286488 -0.292268 -0.298037 -0.303793 -0.309538 -0.315271 -0.320991 -0.326698 -0.332393 -0.338074 -0.343743 -0.349397 -0.355039 -0.360666 -0.366279 -0.371878 -0.377463 -0.383033 -0.388588 -0.394128 -0.399653 -0.405162 -0.410656 -0.416135 -0.421597 -0.427043 -0.432473 -0.437887 -0.443284 -0.448664 -0.454028 -0.459374 -0.464539 -0.469444 -0.474091 -0.478482 -0.482619 -0.486504 -0.49014 -0.493527 -0.496669 -0.499566 -0.502222 -0.504637 -0.506815 -0.508757 -0.510465 -0.511941 -0.513187 -0.514205 -0.514997 -0.515566 -0.515913 -0.51604 -0.515949 -0.515643 -0.515123 -0.514391 -0.51345 -0.512302 -0.510949 -0.509392 -0.507635 -0.505678 -0.503525 -0.501178 -0.498637 -0.495907 -0.492988 -0.489883 -0.486594 -0.483123 -0.479474 -0.475646 -0.471644 -0.467469 -0.463124 -0.45861 -0.45393 -0.449086 -0.444081 -0.438916 -0.433594 -0.428118 -0.422489 -0.41671 -0.410784 -0.404712 -0.398497 -0.392141 -0.385647 -0.379017 -0.372253 -0.365358 -0.358334 -0.351183 -0.343909 -0.33661 -0.329311 -0.322012 -0.314713 -0.307414 -0.300115 -0.292816 -0.285517 -0.278218 -0.27092 -0.263621 -0.256322 -0.249023 -0.241724 -0.234425 -0.227126 -0.219827 -0.212528 -0.205229 -0.19793 -0.190631 -0.183332 -0.176033 -0.168734 -0.161435 -0.154136 -0.146837 -0.139538 -0.132239 -0.12494 -0.117641 -0.110342 -0.103043 -0.0957445 -0.0884455 -0.0811465 -0.0738476 -0.0665486 -0.0592497 -0.0519507 -0.0446517 -0.0373528 -0.0300538 -0.0227548 -0.0154559 -0.00815693 -0.000857967 0.00644099 0.01374 0.0210389 0.0283379 0.0356368 0.0429358 0.0502348 0.0575337 0.0648327 0.0721316 0.0794306 0.0867296 0.0940285 0.101327 0.108626 0.115925 0.123224 0.130523 0.137822 0.145121 0.15242 0.159719 0.167018 0.174317 0.181616 0.188915 0.196214 0.203513 0.210812 0.218111 0.22541 0.232709 0.240008 0.247307 0.254606 0.261905 0.269204 0.276502 0.283801 0.2911 0.298399 0.305698 0.312997 0.320296 0.327595 0.334894 0.342193 0.349492 0.356791 0.36409 0.371389 0.378688 0.385987 0.393286 0.400585 0.407884 0.415182 0.422481 0.42978 0.437079 0.444378 0.451677 0.458976 0.466275 0.473574 0.480873 0.488172 0.495471 0.50277 0.510069 0.517368 0.524667 0.531966 0.539265 0.546564 0.553862 0.561161 0.568403 0.575451 0.582305 0.588966 0.595432 0.601705 0.607784 0.61367 0.619362 0.624862 0.630168 0.63528 0.6402 0.644928 0.649463 0.653806 0.657957 0.661916 0.665684 0.669261 0.672647 0.675842 0.678848 0.681663 0.68429 0.686727 0.688976 0.691037 0.692911 0.694597 0.696097 0.697411 0.69854 0.699484 0.700244 0.70082 0.701213 0.701425 0.701454 0.701303 0.700972 0.700462 0.699774 0.698908 0.697865 0.696646 0.695252 0.693685 0.691944 0.690031 0.687946 0.685692 0.683268 0.680677 0.677918 0.674994 0.671904 0.668651 0.665236 0.661659 0.657922 0.654027 0.649974 0.645764 0.6414 0.636882 0.632212 0.627391 0.622421 0.617302 0.612037 0.606692 0.601337 0.595972 0.590598 0.585214 0.579821 0.574417 0.569004 0.56358 0.558147 0.552703 0.54725 0.541787 0.536313 0.53083 0.525336 0.519832 0.514318 0.508794 0.50326 0.497716 0.492162 0.486597 0.481022 0.475438 0.469843 0.464238 0.458623 0.452999 0.447364 0.441719 0.436065 0.4304 0.424726 0.419042 0.413348 0.407645 0.401932 0.39621 0.390478 0.384737 0.378986 0.373226 0.367457 0.361679 0.355891 0.350095 0.34429 0.338476 0.332654 0.326823 0.320983 0.315136 0.30928 0.303415 0.297543 0.291663 0.285775 0.279879 0.273976 0.268065 0.262147 0.256222 0.25029 0.244351 0.238405 0.232453 0.226494 0.220528 0.214557 0.208579 0.202596 0.196607 0.190612 0.184612 0.178607 0.172597 0.166582 0.160562 0.154537 0.148508 0.142475 0.136438 0.130397 0.124353 0.118305 0.112253 0.106199 0.100141 0.0940813 0.0880188 0.0819539 0.0758868 0.0698179 0.0637472 0.057675 0.0516014 0.0455267 0.0394512 0.0333749 0.0272982 0.0212211 0.015144 0.00906699 0.00299037 -0.00308567 -0.00916093 -0.0152352 -0.0213082 -0.0273798 -0.0334498 -0.0395178 -0.0455838 -0.0516474 -0.0577085 -0.0637668 -0.0698221 -0.0758742 -0.0819228 -0.0879677 -0.0940088 -0.100046 -0.106078 -0.112106 -0.118129 -0.124148 -0.130161 -0.136168 -0.14217 -0.148165 -0.154155 -0.160138 -0.166114 -0.172084 -0.178047 -0.184002 -0.18995 -0.19589 -0.201822 -0.207745 -0.213661 -0.219567 -0.225465 -0.231353 -0.237233 -0.243102 -0.248962 -0.254812 -0.260652 -0.266481 -0.2723 -0.278108 -0.283904 -0.28969 -0.295463 -0.301226 -0.306976 -0.312714 -0.318439 -0.324153 -0.329853 -0.33554 -0.341214 -0.346875 -0.352523 -0.358156 -0.363776 -0.369381 -0.374972 -0.380548 -0.38611 -0.391657 -0.397189 -0.402705 -0.408206 -0.413691 -0.419161 -0.424614 -0.430052 -0.435472 -0.440877 -0.446265 -0.451636 -0.45699 -0.46227 -0.467291 -0.472052 -0.476557 -0.480807 -0.484804 -0.48855 -0.492048 -0.495298 -0.498304 -0.501067 -0.503589 -0.505873 -0.507919 -0.509731 -0.51131 -0.512658 -0.513777 -0.514669 -0.515337 -0.515782 -0.516007 -0.516013 -0.515802 -0.515377 -0.514739 -0.513891 -0.512835 -0.511573 -0.510106 -0.508438 -0.50657 -0.504504 -0.502242 -0.499787 -0.497141 -0.494305 -0.491283 -0.488076 -0.484686 -0.481116 -0.477367 -0.473442 -0.469344 -0.465074 -0.460635 -0.456028 -0.451257 -0.446323 -0.441229 -0.435977 -0.430569 -0.425008 -0.419295 -0.413434 -0.407427 -0.401275 -0.394981 -0.388549 -0.381979 -0.375274 -0.368437 -0.36147 -0.354375 -0.347156 -0.339857 -0.332558 -0.325259 -0.31796 -0.310661 -0.303362 -0.296063 -0.288764 -0.281465 -0.274166 -0.266867 -0.259568 -0.25227 -0.244971 -0.237672 -0.230373 -0.223074 -0.215775 -0.208476 -0.201177 -0.193878 -0.186579 -0.17928 -0.171981 -0.164682 -0.157383 -0.150084 -0.142785 -0.135486 -0.128187 -0.120888 -0.113589 -0.10629 -0.0989913 -0.0916924 -0.0843934 -0.0770945 -0.0697955 -0.0624965 -0.0551976 -0.0478986 -0.0405997 -0.0333007 -0.0260017 -0.0187028 -0.0114038 -0.00410485 0.00319411 0.0104931 0.017792 0.025091 0.03239 0.0396889 0.0469879 0.0542868 0.0615858 0.0688848 0.0761837 0.0834827 0.0907816 0.0980806 0.10538 0.112679 0.119977 0.127276 0.134575 0.141874 0.149173 0.156472 0.163771 0.17107 0.178369 0.185668 0.192967 0.200266 0.207565 0.214864 0.222163 0.229462 0.236761 0.24406 0.251359 0.258658 0.265957 0.273256 0.280555 0.287854 0.295152 0.302451 0.30975 0.317049 0.324348 0.331647 0.338946 0.346245 0.353544 0.360843 0.368142 0.375441 0.38274 0.390039 0.397338 0.404637 0.411936 0.419235 0.426533 0.433832 0.441131 0.44843 0.455729 0.463028 0.470327 0.477626 0.484925 0.492224 0.499523 0.506822 0.514121 0.52142 0.528719 0.536018 0.543317 0.550616 0.557915 0.565214 0.572347 0.579287 0.586034 0.592586 0.598945 0.605111 0.611082 0.61686 0.622445 0.627837 0.633035 0.638041 0.642854 0.647475 0.651903 0.656139 0.660184 0.664036 0.667698 0.671169 0.674449 0.677538 0.680438 0.683149 0.68567 0.688003 0.690147 0.692104 0.693873 0.695456 0.696853 0.698064 0.69909 0.699931 0.700589 0.701063 0.701356 0.701466 0.701395 0.701144 0.700714 0.700104 0.699317 0.698352 0.697212 0.695896 0.694405 0.692741 0.690904 0.688896 0.686717 0.684368 0.681851 0.679167 0.676316 0.673299 0.670119 0.666776 0.66327 0.659605 0.655779 0.651796 0.647656 0.643361 0.638911 0.634308 0.629554 0.62465 0.619597 0.614397 0.609056 0.603705 0.598345 0.592975 0.587595 0.582206 0.576807 0.571398 0.565979 0.56055 0.555111 0.549662 0.544203 0.538734 0.533255 0.527766 0.522267 0.516757 0.511238 0.505708 0.500169 0.494619 0.489059 0.483489 0.477908 0.472318 0.466718 0.461108 0.455487 0.449857 0.444217 0.438567 0.432907 0.427237 0.421557 0.415868 0.410169 0.40446 0.398742 0.393014 0.387277 0.38153 0.375775 0.37001 0.364235 0.358452 0.35266 0.346859 0.341049 0.33523 0.329403 0.323568 0.317723 0.311871 0.30601 0.300142 0.294265 0.288381 0.282488 0.276588 0.270681 0.264766 0.258844 0.252915 0.246979 0.241036 0.235087 0.229131 0.223168 0.2172 0.211225 0.205244 0.199257 0.193265 0.187268 0.181265 0.175257 0.169244 0.163226 0.157203 0.151176 0.145145 0.13911 0.133071 0.127028 0.120981 0.114931 0.108878 0.102822 0.0967633 0.0907019 0.084638 0.0785719 0.0725038 0.0664338 0.0603623 0.0542893 0.0482151 0.04214 0.036064 0.0299874 0.0239105 0.0178334 0.0117564 0.00567956 -0.000396765 -0.0064724 -0.0125471 -0.0186207 -0.024693 -0.0307636 -0.0368325 -0.0428995 -0.0489641 -0.0550263 -0.0610859 -0.0671425 -0.073196 -0.0792462 -0.0852928 -0.0913357 -0.0973744 -0.103409 -0.109439 -0.115464 -0.121485 -0.1275 -0.13351 -0.139514 -0.145512 -0.151505 -0.157491 -0.16347 -0.169443 -0.175409 -0.181367 -0.187318 -0.193262 -0.199197 -0.205125 -0.211044 -0.216954 -0.222856 -0.228748 -0.234632 -0.240506 -0.24637 -0.252224 -0.258069 -0.263903 -0.269726 -0.275539 -0.28134 -0.287131 -0.29291 -0.298677 -0.304432 -0.310176 -0.315907 -0.321626 -0.327332 -0.333025 -0.338705 -0.344372 -0.350025 -0.355665 -0.36129 -0.366902 -0.372499 -0.378082 -0.383651 -0.389204 -0.394742 -0.400266 -0.405774 -0.411266 -0.416742 -0.422203 -0.427647 -0.433076 -0.438487 -0.443883 -0.449261 -0.454623 -0.459967 -0.465103 -0.469979 -0.474597 -0.47896 -0.483069 -0.486926 -0.490534 -0.493894 -0.497008 -0.499878 -0.502507 -0.504896 -0.507048 -0.508963 -0.510645 -0.512095 -0.513316 -0.514309 -0.515076 -0.51562 -0.515942 -0.516045 -0.51593 -0.515599 -0.515056 -0.514301 -0.513337 -0.512166 -0.51079 -0.509211 -0.507431 -0.505453 -0.503278 -0.500908 -0.498347 -0.495595 -0.492655 -0.48953 -0.486221 -0.48273 -0.47906 -0.475214 -0.471192 -0.466998 -0.462634 -0.458101 -0.453403 -0.448541 -0.443518 -0.438335 -0.432996 -0.427503 -0.421857 -0.416062 -0.410119 -0.404031 -0.3978 -0.391429 -0.384919 -0.378274 -0.371496 -0.364586 -0.357548 -0.350384 -0.343095 -0.335797 -0.328498 -0.321199 -0.3139 -0.306601 -0.299302; +#X coords 0 1 999 -1 500 140 1 0 0; +#X restore 404 384 graph; +#X text 686 564 updated for Pd version 0.50-0; +#X connect 0 0 11 0; +#X connect 1 0 0 0; +#X connect 3 0 2 0; +#X connect 4 0 3 0; +#X connect 5 0 11 1; +#X connect 6 0 10 0; +#X connect 7 0 9 0; +#X connect 8 0 11 0; +#X connect 9 0 11 4; +#X connect 10 0 11 2; +#X connect 11 0 2 0; +#X connect 13 0 11 3; +#X connect 18 0 11 5; +#X connect 31 0 33 0; +#X connect 41 0 40 0; diff --git a/pd/doc/5.reference/trace-help.pd b/pd/doc/5.reference/trace-help.pd new file mode 100644 index 000000000..0e94018cc --- /dev/null +++ b/pd/doc/5.reference/trace-help.pd @@ -0,0 +1,53 @@ +#N canvas 417 23 749 564 12; +#X obj 439 397 trace; +#X obj 49 17 trace; +#X msg 427 314 1; +#X obj 427 342 + 2; +#X obj 439 429 + 3; +#X msg 264 176 \; pd set-tracing \$1; +#X obj 264 150 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1; +#X floatatom 439 458 5 0 0 0 - - - 0; +#X text 101 18 - message tracing for debugging control flow in patches; +#X text 417 159 Note: this slows message passing down \, so don't turn it on unless you want to use it., f 32; +#X text 510 533 updated for Pd version 0.52; +#X obj 439 485 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000; +#X msg 471 332 1; +#X msg 506 332 2; +#X floatatom 471 369 3 0 0 0 - - - 0; +#X floatatom 427 369 3 0 0 0 - - - 0; +#X text 506 368 <= set number of messages to trace, f 17; +#X text 96 149 First enable tracing with a message to Pd:, f 21; +#X obj 11 51 cnv 1 725 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#X obj 11 521 cnv 1 725 1 empty empty empty 8 12 0 13 #000000 #000000 0; +#N canvas 730 162 575 273 reference 0; +#X obj 8 52 cnv 5 550 5 empty empty INLETS: 8 18 0 13 #202020 #000000 0; +#X obj 8 165 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000 0; +#X obj 8 202 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0; +#X obj 7 239 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0; +#X obj 8 126 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0; +#X obj 8 85 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0; +#X obj 39 17 trace; +#X text 91 18 - message tracing for debugging control flow in patches.; +#X text 98 92 anything - any message to be traced from this point on., f 62; +#X text 158 213 NONE, f 15; +#X text 119 136 float - arms the object for the given number of messages.; +#X text 99 174 anything - bypasses the input message further down the chain., f 62; +#X restore 539 18 pd reference; +#X text 633 18 <= click; +#X text 25 228 Second \, send a number greater than zero to the right inlet of trace to arm it. This number sets the number of following messages that will be traced (that is \, it's a counter.) Once it receives that many messages \, the object is unarmed again., f 91; +#X msg 383 342 5 \, 8; +#X text 23 66 When 'set-tracing' is on and the object is armed \, [trace] prints in the Pd window the message it receives and also outputs the messages all the other objects further down in the chain send. You can control-click on the printout to select in the patch the object that caused the message. Once this is done \, trace also prints a backtrace of messages leading up to the one that has set it off., f 98; +#X text 58 346 Now the next message (or messages) [trace] gets on its left inlet is forwarded to its output with tracing turned on., f 42; +#X obj 427 288 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000; +#X connect 0 0 4 0; +#X connect 2 0 3 0; +#X connect 3 0 15 0; +#X connect 4 0 7 0; +#X connect 6 0 5 0; +#X connect 7 0 11 0; +#X connect 12 0 14 0; +#X connect 13 0 14 0; +#X connect 14 0 0 1; +#X connect 15 0 0 0; +#X connect 23 0 15 0; +#X connect 26 0 2 0;