#N canvas 425 44 707 760 12;
#X declare -stdpath ./;
#X obj 475 555 print didit;
#X floatatom 93 550 6 0 0 0 - - - 0;
#X msg 192 445 print;
#X obj 96 725 soundfiler;
#X text 17 724 see also:;
#X obj 33 11 readsf~;
#X obj 150 516 output~;
#X obj 185 725 writesf~;
#X obj 475 525 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X obj 3 41 cnv 1 695 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X text 623 10 <= click;
#N canvas 661 99 613 559 reference 0;
#X obj 8 52 cnv 5 590 5 empty empty INLET: 8 18 0 13 #202020 #000000 0;
#X obj 8 237 cnv 2 590 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0;
#X obj 8 386 cnv 2 590 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0;
#X obj 7 524 cnv 5 590 5 empty empty empty 8 18 0 13 #202020 #000000 0;
#X obj 7 350 cnv 1 590 1 empty empty rightmost: 8 12 0 13 #7c7c7c #000000 0;
#X obj 7 313 cnv 1 590 1 empty empty n: 8 12 0 13 #7c7c7c #000000 0;
#X obj 30 18 readsf~;
#X text 78 66 open <list> -;
#X text 120 184 float -;
#X text 177 184 nonzero starts playback \, zero stops., f 54;
#X text 121 205 print - prints information on Pd's terminal window., f 62;
#X text 122 322 signal -;
#X text 187 322 channel output of a given file., f 46;
#X text 137 358 bang - when finishing playing file., f 54;
#X text 108 473 1) float - sets number of output channels (default 1 \, max 64)., f 62;
#X text 82 242 ('n' number of outlets specified by argument);
#X text 120 144 start -;
#X text 127 164 stop -;
#X text 177 164 stop playback., f 54;
#X text 88 19 - soundfile playback from disk.;
#X text 177 144 start playback., f 54;
#X text 108 492 2) float - per channel buffer size in bytes (default/min 262144)., f 65;
#X text 177 66 (needed before start playback) sets a filename and optionally: samples onset \, header size to skip \, number of channels \, bytes per sample \, and endianness., f 54;
#X obj 8 270 cnv 1 590 1 empty empty 1st: 8 12 0 13 #9f9f9f #000000 0;
#X text 102 279 signals -;
#X text 175 279 a multichannel output if invoked with the -m flag.;
#X text 43 124 channels <float> -;
#X text 177 124 sets number of output channels iinvoked with the -m flag.;
#X obj 8 413 cnv 1 590 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0;
#X obj 8 460 cnv 1 590 1 empty empty arguments: 8 12 0 13 #9f9f9f #000000 0;
#X text 135 421 -m:;
#X text 164 420 creates a multichannel signal with number of input channels given as the 1st argument., f 54;
#X restore 529 11 pd reference;
#X floatatom 284 550 6 0 0 0 - - - 0;
#X text 502 466 Arguments:, f 20;
#X obj 144 380 tgl 19 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X floatatom 144 413 3 0 0 0 - - - 0;
#X text 171 374 nonzero starts playback \, zero stops it, f 24;
#X msg 120 321 start;
#X msg 131 349 stop;
#X text 165 321 start playback;
#X text 170 349 stop playback;
#X text 91 11 - soundfile playback from disk;
#X obj 3 713 cnv 1 695 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X obj 93 523 env~;
#X obj 284 523 env~;
#X text 348 518 "bang" when file reaches the end., f 16;
#X msg 93 291 open ../sound/bell.aiff 0 200 2 2 b;
#X text 502 484 - number of channels - per channel buffer size in bytes, f 20;
#X obj 93 479 readsf~ 2 262144, f 55;
#X text 21 51 The [readsf~] object streams a soundfile from the hard disk. That is \, it doesn't fully load it into the memory \, but into a small local buffer first. The "open" message starts filling this buffer but a playback only starts when you send a "1" or "start" message. A "0" or "stop" message stops it. You may get audio dropouts if you "start" right after the "open" message \, so you should wait a few milliseconds between "open" and "start" to ensure that the buffer is filled in time. You can also increase the default buffer size as the 2nd argument \, but it shouldn't really be necessary. The 1st argument initializes the number of channel outputs., f 94;
#X text 414 407 open at half a second into the file and start right away. Since it's mono \, we only have the left output., f 35;
#X text 21 155 The 'wave' \, 'aiff' \, 'caf' \, and 'next' formats are supported \, although only uncompressed 2- or 3-byte integer ("pcm") and 4- or 8-byte floating point samples are accepted., f 94;
#X text 240 438 print info on Pd window, f 12;
#X text 40 593 NOTE: check also [soundfiler] \, which allows you to load a file into memory by filling it into an array. This also gives you more playback possibilities with table reading objects., f 89;
#X obj 258 725 openpanel;
#X text 21 189 HINT: The 'open' message can take "~" to define the home directory. Also note you can use [openpanel] to find sound files., f 94;
#X text 40 643 ALSO NOTE: As of Pd 0.55-1 \, [readsf~]'s "open" method searches in the canvas environment \, just like [soundfiler] and similar objects. This means you can now use paths added via [declare] (which wasn't possible before)., f 89;
#X obj 30 264 openpanel;
#X msg 30 291 open \$1;
#X obj 30 237 bng 19 250 50 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000;
#X text 352 282 (By overriding the header here \, we force this mono file to be played as a stereo twice as fast), f 41;
#X text 131 233 The open message takes filename and optionally: onset in samples \, header size to skip \, channels number \, bytes per sample and endianness.;
#X text 394 344 mutichannel signal support ----->, f 20;
#N canvas 768 186 512 477 multichannel 0;
#X obj 89 245 readsf~ -m 2, f 17;
#X obj 89 332 output~;
#X obj 89 280 snake~ out;
#X text 118 35 A '-m' flag turns the output into a multichannel signal connection with the given number of channels., f 36;
#X msg 125 180 channels 1;
#X msg 113 139 start;
#X msg 135 210 channels 2;
#X text 226 172 The channels message is able to change the number of channels in the connection dynamically, f 31;
#X obj 82 423 declare -stdpath ./, f 20;
#X msg 89 103 open ../sound/stereo.wav;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X connect 2 1 1 1;
#X connect 4 0 0 0;
#X connect 5 0 0 0;
#X connect 6 0 0 0;
#X connect 9 0 0 0;
#X restore 503 364 pd multichannel;
#X text 476 724 updated for Pd version 0.56;
#X msg 185 415 open ../sound/stereo.wav 24000;
#X connect 2 0 28 0;
#X connect 8 0 0 0;
#X connect 14 0 15 0;
#X connect 15 0 28 0;
#X connect 17 0 28 0;
#X connect 18 0 28 0;
#X connect 23 0 1 0;
#X connect 24 0 12 0;
#X connect 26 0 28 0;
#X connect 28 0 6 0;
#X connect 28 0 23 0;
#X connect 28 1 24 0;
#X connect 28 1 6 1;
#X connect 28 2 8 0;
#X connect 37 0 38 0;
#X connect 38 0 28 0;
#X connect 39 0 37 0;
#X connect 45 0 28 0;
