#N canvas 457 27 561 488 10;
#X declare -stdpath ./;
#X obj 5 462 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X obj 5 281 cnv 3 550 3 empty empty inlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 5 316 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 5 345 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 95 290 cnv 17 3 17 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 103 352 1) symbol;
#X text 201 323 (none);
#X text 176 367 - audio file to load (optional), f 60;
#X text 103 367 2) symbol;
#X text 103 382 3) float;
#X text 103 398 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 80 cyclone/buffer~ cyclone_\$0 violin.wav -1;
#X connect 8 0 24 0;
#X connect 13 0 12 0;
#X restore 434 250 pd related objects;
#N canvas 538 103 787 401 read/write 0;
#X msg 447 63 read;
#X msg 466 94 open;
#X msg 507 95 close;
#X msg 521 123 clear;
#X msg 525 148 readagain;
#X text 548 97 open/close buffer window;
#X text 565 122 clears all channels;
#X msg 516 233 write;
#X text 480 63 without symbol: opens dialog box;
#X msg 428 29 read stereo.aif;
#X msg 532 181 write test.wav;
#X text 588 147 reloads the last opened file;
#X text 627 174 writes contents of buffer into a file, f 20;
#X text 559 227 without symbol: opens dialog box, f 17;
#X text 25 89 The "write" mesaage Saves the contents of [buffer~] into an audio file. A standard file dialog is opened for naming the file unless the word write is followed by a symbol \, in which case the file is saved in the current default folder \, using the symbol as the filename.;
#X text 26 164 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.;
#X text 27 239 For last \, "writeaiff" and "writewave" messages can write a filename to the specified format.;
#X text 239 327 Numerical values are \; 16 - 16-bit integer (default) \; 24 - 24-bit integer \;;
#X text 28 297 The "format" message sets the bit depth for writing files \, it accepts floats or symbols:;
#X text 449 320 symbol values are \; int16 - 16-bit integer (default) \; int24 - 24-bit integer \; float32 - 32-bit float \;;
#X obj 428 274 cyclone/buffer~ buff2_\$0 -1 2;
#X text 533 22 read a file specified by a symbol (.wav \, .aif/.aiff or .caf), f 33;
#X text 540 200 formats: .wav \, .aif/.aiff or .caf;
#X text 25 35 You can specify a sound file to load as the second argument or via the "read" message. Buffer can currently load 'wav' and 'aif/aiff' sound files.;
#X connect 0 0 20 0;
#X connect 1 0 20 0;
#X connect 2 0 20 0;
#X connect 3 0 20 0;
#X connect 4 0 20 0;
#X connect 7 0 20 0;
#X connect 9 0 20 0;
#X connect 10 0 20 0;
#X restore 464 199 pd read/write;
#X msg 254 158 start;
#X msg 120 200 open;
#X text 74 84 [buffer~] stores audio in a memory buffer. 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 from the Max/MSP original.;
#X obj 5 421 cnv 3 550 3 empty empty attributes 8 12 0 13 #dcdcdc #000000 0;
#X text 162 427 @size <float> (sets buffer size in ms), f 44;
#X text 156 442 @samps <float> (sets buffer size in samples), f 45;
#N canvas 527 168 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 obj 114 312 cyclone/loadmess fill sinc 8;
#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 24 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 obj 513 352 cyclone/buffer~ window_\$0 @samps 1024;
#X obj 114 344 cyclone/buffer~ gen_\$0 @samps 1024;
#X text 31 33 fill:;
#X text 417 34 apply:;
#X connect 0 0 12 0;
#X connect 1 0 13 0;
#X connect 3 0 14 0;
#X connect 4 0 14 0;
#X connect 12 0 13 0;
#X restore 404 225 pd functions/generators;
#X msg 109 172 crop 140 480;
#X msg 38 172 readagain;
#X msg 163 206 wclose;
#N canvas 647 158 511 331 All_Messages 0;
#X text 94 6 clear;
#X text 100 157 open;
#X text 139 6 - fills all arrays with zeros, f 59;
#X text 139 157 - opens buffer supbatch window, f 59;
#X text 139 173 - closes buffer supbatch window, f 59;
#X text 139 242 - changes the buffer name, f 59;
#X text 46 40 read <symbol>;
#X text 40 73 write <symbol>;
#X text 46 258 name <symbol>;
#X text 52 241 set <symbol>;
#X text 139 259 - same as 'name', f 59;
#X text 34 291 setsize <float>;
#X text 139 292 - sets buffer size in ms, f 59;
#X text 34 308 sizeinsamps <f>;
#X text 139 309 - sets buffer size in samples, f 59;
#X text 70 56 readagain;
#X text 46 274 normalize <f>;
#X text 139 275 - normalizes to the given float value, f 59;
#X text 64 208 fill <any>;
#X text 139 208 - see [pd function/generators] above, f 59;
#X text 139 224 - see [pd function/generators] above, f 59;
#X text 58 224 apply <any>;
#X text 22 140 filetype <symbol>;
#X text 139 140 - symbol sets file type to write ("wave" or "aiff"), f 59;
#X text 139 40 - sets file to load from (no symbol opens dialog box), f 59;
#X text 139 73 - 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 56 - reads and loads the previously opened file again, f 59;
#X text 88 173 wclose;
#X text 16 106 writewave <symbol>;
#X text 16 123 writeaiff <symbol>;
#X text 139 123 - sets file to write in aiff (no symbol opens dialog box), f 59;
#X text 139 106 - sets file to write in wave (no symbol opens dialog box), f 59;
#X text 52 89 format <any>;
#X text 139 89 - sets bit depth - see [pd read/write] for details, f 59;
#X text 64 189 sr <float>;
#X text 139 189 - sets sample rate for writing a file (default: Patch's), f 59;
#X restore 374 290 pd All_Messages;
#X text 124 291 click to open and check all messages: =>;
#X text 175 352 - buffer name, f 60;
#X text 176 398 - channels (1 to 64) default 1 or audio file's (if given);
#X obj 254 185 cyclone/play~ buff1_\$0 2;
#X obj 109 234 cyclone/buffer~ buff1_\$0 stereo.aif, f 19;
#X text 176 382 - buffer size in ms (default 0 or -1 if audio file is given);
#X obj 254 217 output~;
#X text 25 58 Audio buffer;
#X obj 431 166 declare -stdpath ./;
#X obj 2 2 header buffer~;
#X connect 13 0 27 0;
#X connect 14 0 28 0;
#X connect 20 0 28 0;
#X connect 21 0 28 0;
#X connect 22 0 28 0;
#X connect 27 0 30 0;
#X connect 27 1 30 1;
