#N canvas 455 50 565 589 10;
#X declare -stdpath ./;
#X obj 5 558 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X obj 5 373 cnv 3 550 3 empty empty inlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 5 410 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 5 439 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 95 384 cnv 17 3 17 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 103 446 1) symbol;
#X text 201 417 (none);
#X text 176 461 - audio file to load (optional), f 60;
#X text 103 461 2) symbol;
#X text 103 476 3) float;
#X text 103 492 4) float;
#N canvas 460 160 804 460 related 0;
#X obj 571 53 cyclone/buffir~;
#X obj 570 98 cyclone/lookup~;
#X obj 570 122 cyclone/index~;
#X obj 570 145 cyclone/peek~;
#X obj 570 190 cyclone/poke~;
#X obj 570 168 cyclone/play~;
#X obj 570 211 cyclone/record~;
#X text 426 20 Cyclone has several objects that work in conjunction with [buffer~] \, they are:;
#X msg 111 53 open;
#X text 144 54 <= check internal array;
#X text 62 146 Similar to:;
#X text 260 147 <= click to open;
#X obj 60 209 soundfiler;
#X obj 60 177 cyclone/loadmess read -resize violin.wav vanilla_\$0;
#X obj 146 147 table vanilla_\$0;
#X text 25 341 On the other hand \, for single or "mono" buffers \, a buffer named "test" has an internal array also named: "test"., f 60;
#X obj 570 76 cyclone/cycle~;
#X obj 571 234 cyclone/wave~;
#X text 429 270 All of them will work with mono or multi channel buffers. When trying to access the first channel of a buffer \, they look for a table name with the same name as the argument (for single channel buffer compatibility). If not found \, then they look for the first channel of a multi channel [buffer~] (the buffer name preeceded by "0-").;
#X text 25 376 You can use pd vanilla's objects (such as [tabreceive~] \, [tabplay~] \, [tabread4~] and so on) to access the internal arrays of a buffer. In the case of a multi channel buffer \, you have to give it the right table name according to a specific channel., f 60;
#X text 24 16 [buffer~] is similar to pd vanilla's [table] object.;
#X text 25 269 But [buffer~] is also able to define multi channel arrays (up to 64). The convention for channel ordering is the buffer name preceded by the channel number (from 0) and "-". For instance \, a 4 channel [buffer~] named "test" has arrays named as: "0-test" \, "1-test" \, "2-test" and "3-test"!;
#X text 430 362 Hence \, all of them can also access single channel arrays specified with a [table] object!;
#X text 428 399 [buffir~] \, [cycle~] and [lookup~] can only access the first channel of a buffer (single or multi channel) \, while the others have full multi channel capabilities.;
#X obj 111 79 cyclone/buffer~ cyclone_\$0 violin.wav;
#X connect 8 0 24 0;
#X connect 13 0 12 0;
#X restore 433 245 pd related objects;
#N canvas 178 118 894 498 read/write 0;
#X msg 491 107 read;
#X msg 539 138 open;
#X msg 580 139 close;
#X msg 591 168 clear;
#X msg 595 193 readagain;
#X text 621 141 open/close buffer window;
#X text 635 167 clears all channels;
#X msg 579 280 write;
#X text 584 107 without symbol: opens dialog box;
#X msg 602 228 write test.wav;
#X text 658 192 reloads the last opened file;
#X text 697 221 writes contents of buffer into a file, f 20;
#X text 622 274 without symbol: opens dialog box, f 17;
#X text 464 400 Numerical values are \; 16 - 16-bit integer (default) \; 24 - 24-bit integer \;;
#X text 453 361 The "format" message sets the bit depth for writing files \, it accepts floats or symbols:;
#X text 630 50 read a file specified by a symbol (.wav \, .aif/.aiff or .caf), f 33;
#X text 610 247 formats: .wav \, .aif/.aiff or .caf;
#X text 656 383 symbol values are \; int16 - 16-bit integer (default) \; int24 - 24-bit integer \; float32 - 32-bit float \; float64 - 64-bit float (use double precision Pd for this feature), f 34;
#X text 28 156 Just the "read" message opens a dialog for you to choose a sound file. If the buffer duration and number of channels is defined \, it will read the file according to it. You can also define the sound file as the 1st argument. The duration and number of channels may be defined with optional 2nd and 3rd arguments (0 or less in both cases will resize according to the file's size and number of channels)., f 65;
#X text 28 319 The "write" message saves the contents of [buffer~] into an audio file. If no file name is given \, a file dialog is opened for naming it \, or you can set it with an argument (in which case the file is saved in the current default folder)., f 65;
#X text 28 371 You can also specify a sound file format in the symbol (such as "test.wav" \, but if you don't specify a format \, [buffer~] will save in same format of the most recently opened audio file or the last given "filetype" message. By default \, [buffer~] saves in AIFF format. The "writeaiff" and "writewave" messages can write a filename to the specified format., f 65;
#X text 28 238 Just "replace" opens a dialog for you to choose a sound file or you can define it with an argument. This message always resizes and set the number of channels according to the loaded file (so it's like 'read' with '0 0' as 2nd and 3rd args)., f 65;
#X text 28 289 The "readagain" message reads and loads the previously opened file again., f 65;
#X text 28 39 You need a buffer name as the first argument. You can specify a sound file to load as the second argument and a 3rd and 4th optional argument may set the duration in ms and number of channels. The @samps or @size attributes can set duration as well. If no duration and channels are given \, [buffer~] will load the duration and number of channels from the file given as an argument. If no file is given as an argument \, [buffer~] will define its duration and number of channels from the first opened file loaded from a 'read' or 'replace' message. You can load 'wav' \, 'aif/aiff' and 'caf' sound files by the way., f 65;
#X msg 466 56 read stereo.aif 500 -1 -1;
#X msg 445 31 read violin.wav;
#X obj 491 321 cyclone/buffer~ buff2_\$0 stereo.aif;
#X msg 532 107 replace;
#X msg 477 80 replace violin.wav;
#X connect 0 0 26 0;
#X connect 1 0 26 0;
#X connect 2 0 26 0;
#X connect 3 0 26 0;
#X connect 4 0 26 0;
#X connect 7 0 26 0;
#X connect 9 0 26 0;
#X connect 24 0 26 0;
#X connect 25 0 26 0;
#X connect 27 0 26 0;
#X connect 28 0 26 0;
#X restore 463 194 pd read/write;
#X msg 254 158 start;
#X msg 120 200 open;
#X obj 5 515 cnv 3 550 3 empty empty attributes 8 12 0 13 #dcdcdc #000000 0;
#X text 162 522 @size <float> (sets buffer size in ms), f 44;
#X text 156 537 @samps <float> (sets buffer size in samples), f 45;
#N canvas 469 172 807 406 functions/generators 0;
#X obj 513 300 loadbang;
#X msg 464 320 open;
#X text 413 139 The message "apply getdeltas" replaces every sample value with the a new value representing the difference from the previous sample., f 60;
#X msg 65 313 open;
#X text 413 61 The message "apply gain" plus a float (specifying a gain value) scales every sample by the given gain coefficient., f 60;
#X text 413 94 The message "apply offset" plus a float (specifying a constant value offset) adds the offset to every sample in the buffer.;
#X text 24 61 The word "fill" followed by a float sets every sample in the [buffer~] to that value.;
#X text 24 97 The fill message can also fill the buffers with a specific function \, they are: sin (sine) \, cos \, (cosine) \, and sinc.;
#X text 23 135 For sin/cos \, an optional second argument (e.g. "fill sin 2") can be used to define the number of cycles of the function used to fill the buffer. An additional optional third argument defines a rational number of cycles with which to fill the buffer. For instance \, "fill cos 1 4" fills with a quarter cycle of the cosine function.;
#X text 24 221 The sinc function requires two arguments that specify the number of zero crossings and an additional flag that toggles starting the function at zero (e.g. "fill sinc 4 1").;
#X text 413 187 Apply can also apply evelopes from windowing functions \, they are: triangle \, hamming \, hanning \, blackman \, welch and kaiser. An additional "half" argument (e.g. apply blackman half ) applies only the second half of the window. The kaiser function requires an alpha parameter in radians \, which precedes the optional half argument (e.g. "apply kaiser 3.14 half"). The default alpha value is "6".;
#X msg 513 328 fill 1 \, apply hanning;
#X text 31 33 fill:;
#X text 417 34 apply:;
#X obj 114 312 cyclone/loadmess fill sinc 8;
#X obj 114 344 cyclone/buffer~ gen_\$0 @samps 1024;
#X obj 513 352 cyclone/buffer~ window_\$0 @samps 1024;
#X connect 0 0 11 0;
#X connect 1 0 16 0;
#X connect 3 0 15 0;
#X connect 11 0 16 0;
#X connect 14 0 15 0;
#X restore 403 220 pd functions/generators;
#X msg 109 172 crop 140 480;
#X msg 38 172 readagain;
#X msg 163 206 wclose;
#N canvas 555 196 512 443 All_Messages 0;
#X text 94 6 clear;
#X text 100 219 open;
#X text 139 6 - fills all arrays with zeros, f 59;
#X text 139 219 - opens buffer supbatch window, f 59;
#X text 139 235 - closes buffer supbatch window, f 59;
#X text 139 303 - changes the buffer name, f 59;
#X text 40 135 write <symbol>;
#X text 46 303 name <symbol>;
#X text 52 319 set <symbol>;
#X text 139 318 - same as 'name', f 59;
#X text 34 353 setsize <float>;
#X text 34 370 sizeinsamps <f>;
#X text 70 118 readagain;
#X text 46 336 normalize <f>;
#X text 139 337 - normalizes to the given float value, f 59;
#X text 64 270 fill <any>;
#X text 58 286 apply <any>;
#X text 22 202 filetype <symbol>;
#X text 139 202 - symbol sets file type to write ("wave" or "aiff"), f 59;
#X text 139 135 - sets file to write to (no symbol opens dialog box), f 59;
#X text 58 23 crop <f \, f>;
#X text 139 23 - trims the sample to a range in ms and resizes the buffer, f 59;
#X text 139 118 - reads and loads the previously opened file again, f 59;
#X text 88 235 wclose;
#X text 16 168 writewave <symbol>;
#X text 16 185 writeaiff <symbol>;
#X text 139 185 - sets file to write in aiff (no symbol opens dialog box), f 59;
#X text 139 168 - sets file to write in wave (no symbol opens dialog box), f 59;
#X text 52 151 format <any>;
#X text 139 151 - sets bit depth - see [pd read/write] for details, f 59;
#X text 64 251 sr <float>;
#X text 139 251 - sets sample rate for writing a file (default: Patch's), f 59;
#X text 139 354 - sets buffer size in ms (you can also use 'size'*), f 59;
#X text 139 371 - sets buffer size in samples (you can also use 'samps'*), f 59;
#X text 148 403 * as these are attributes names;
#X text 58 40 read <list>;
#X text 139 40 -;
#X text 151 39 needs a symbol file name to load and optional args (just 'read' opens dialog box) \, 1st arg is start in ms \, 2nd is duration in ms and 3rd is number of channels, f 57;
#X text 139 270 - see [pd function/generators] in parent, f 59;
#X text 139 286 - see [pd function/generators] in parent, f 59;
#X text 28 80 replace <symbol>;
#X text 139 80 -;
#X text 151 79 needs a symbol file name to load (just 'replace' opens dialog box). This replaces the buffer with the sample size and number of channels, f 57;
#X restore 374 384 pd All_Messages;
#X text 124 385 click to open and check all messages: =>;
#X text 176 446 - buffer name, f 60;
#X obj 254 185 cyclone/play~ buff1_\$0 2;
#X obj 254 217 output~;
#X text 25 58 Audio buffer;
#X obj 430 59 declare -stdpath ./;
#X obj 2 2 header buffer~;
#X text 176 476 - buffer size in ms (optional), f 60;
#X text 176 492 - channels (1 to 64 \, optional), f 60;
#X text 62 88 [buffer~] stores audio in a memory buffer (an array). It read/writes multichannel audio files and can be used in conjunction with [play~] and other related objects. This is an abstraction without the full functionalitites or compatibility to the MAX original and is based on [soundfiler]., f 68;
#X obj 109 234 cyclone/buffer~ buff1_\$0 stereo.aif, f 19;
#X text 104 316 see also:;
#X obj 404 342 open-else;
#X msg 404 296 sample~;
#X msg 416 319 tabgen;
#X text 171 307 Plugdata users or those with ELSE can also use [else/sample~] and [else/tabgen] as alternatives, f 34;
#X text 467 306 <- click;
#X connect 13 0 25 0;
#X connect 14 0 33 0;
#X connect 19 0 33 0;
#X connect 20 0 33 0;
#X connect 21 0 33 0;
#X connect 25 0 26 0;
#X connect 25 1 26 1;
#X connect 36 0 35 0;
#X connect 37 0 35 0;
