#N canvas 547 36 564 640 10;
#X declare -stdpath ./;
#X obj 4 599 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X obj 5 292 cnv 3 550 3 empty empty inlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 5 477 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 5 528 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 80 299 cnv 17 3 172 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 80 485 cnv 17 3 17 empty empty 0-n 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 141 315 signal;
#X text 141 485 signal;
#X text 123 551 2) float;
#X text 123 535 1) symbol;
#N canvas 541 160 812 305 multichannel 0;
#X msg 544 44 stop;
#X msg 534 21 start;
#X obj 681 104 bng 30 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X text 30 19 Multi channel playback is possible (up to 64 channels) when you specify it with a second argument. The number of channels defines the number 'n' of outlets - where the first outlets are the channel inputs and the righmost is the bang outlet.;
#X text 30 99 If more than one channel is set \, the name convention for multi channel arrays is the table name preceded by the channel number (starting from zero) and "-" \, such as: "0-" \, "1-" \, "2-" \, "3-" \, and so on...;
#X text 33 172 You can manually set multi channel arrays in Pd like that or use the [buffer~] object \, which does this internally.;
#X msg 91 229 open;
#X obj 534 72 cyclone/play~ stereo_\$0 2;
#X obj 91 257 cyclone/buffer~ stereo_\$0 stereo.aif -1 2;
#X text 439 179 If the [buffer~] being played has fewer channels than the number of output channels in [play~] \, the extra channels output a zero signal.;
#X text 438 229 Inconsistency: In Max \, if [buffer~] has more channels than [play~] \, the channels are mixed. This could be implemented in cyclone if the [buffer~] object ever becomes a compiled object.;
#X obj 527 104 output~;
#X connect 0 0 7 0;
#X connect 1 0 7 0;
#X connect 6 0 8 0;
#X connect 7 0 11 0;
#X connect 7 1 11 1;
#X connect 7 2 2 0;
#X restore 455 253 pd multichannel;
#X text 185 485 - the playback of a channel, f 60;
#X text 186 534 - table name (required), f 60;
#X obj 221 142 tgl 25 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000 0 1;
#N canvas 577 100 351 116 load 0;
#X obj 32 52 soundfiler;
#X obj 241 55 table \$0-violin;
#X obj 32 20 cyclone/loadmess read -resize violin.wav \$0-violin;
#X obj 31 76 outlet;
#X connect 0 0 3 0;
#X connect 2 0 0 0;
#X restore 41 182 pd load \; sample;
#X msg 262 166 stop;
#X msg 260 142 start;
#X msg 162 160 loop \$1;
#X obj 162 138 tgl 15 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000 0 1;
#X text 147 298 float;
#X text 185 332 - sets array name, f 60;
#X text 105 332 set <symbol>;
#X text 141 377 <stop>;
#X text 135 393 <pause>;
#X text 129 409 <resume>;
#X text 87 348 start <f \, f \, f>;
#X text 185 315 - playback position in ms, f 60;
#X text 185 377 - stops playing and outputs 0 (cannot be resumed), f 60;
#X text 185 298 - non zero plays the array in original speed \, <0> stops it, f 60;
#X text 185 409 - resumes playing after being paused, f 60;
#X text 129 425 loop <f>;
#X text 93 441 loopinterp <f>;
#X text 185 441 - non zero enables crossfading when looping \, <0> disables it;
#X text 185 425 - non zero enables looping \, <0> disables it, f 60;
#X text 93 457 interptime <f>;
#X text 185 457 - sets crossfading time in ms (default 50), f 60;
#X obj 356 216 bng 25 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#N canvas 836 149 489 442 signal 0;
#X obj 167 192 phasor~;
#X obj 167 224 *~;
#X obj 240 141 receive \$0-array_size;
#X floatatom 240 166 0 0 0 0 - - - 0;
#X obj 240 192 cyclone/sampstoms~;
#X obj 167 166 *~ 0.5;
#X obj 167 138 osc~ 0.1;
#X text 310 266 array size in ms;
#X text 57 22 A signal input can be used as the position in ms to read into the array. You can use any signal such as from a [line~] object or a LFO. A signal offers the ability to read the array at a varying speed as the example below.;
#X text 60 86 When a signal is connected \, control play messages are ignored.;
#X obj 167 316 cyclone/play~ \$0-violin;
#X obj 167 350 output~;
#X obj 29 241 cyclone/snapshot~ 1;
#X floatatom 29 272 9 0 0 0 - - - 12;
#X obj 240 232 cyclone/snapshot~ 1;
#X floatatom 240 263 9 0 0 0 - - - 12;
#X connect 0 0 1 0;
#X connect 1 0 10 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 1 1;
#X connect 4 0 14 0;
#X connect 5 0 0 0;
#X connect 5 0 12 0;
#X connect 6 0 5 0;
#X connect 10 0 11 0;
#X connect 12 0 13 0;
#X connect 14 0 15 0;
#X restore 443 229 pd signal control;
#N canvas 498 84 866 388 play 0;
#X obj 73 56 tgl 25 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000 0 1;
#X msg 105 143 stop;
#X msg 93 106 start;
#X text 107 54 'non zero' plays the array in original speed \, <0> 'stops' it, f 30;
#X text 141 137 same as 'zero': stops playing and outputs 0 (cannot be resumed), f 33;
#X text 137 106 by default \, same as 'non zero';
#X msg 121 182 pause;
#X msg 136 219 resume;
#X text 163 182 pauses playing;
#X text 180 219 resumes after being paused;
#X text 30 21 Basic control messages:;
#X text 622 194 play 1st second backwards at half the speed, f 25;
#X text 634 226 play 1st second twice as fast, f 15;
#X msg 527 233 start 0 1000 500;
#X msg 507 201 start 1000 0 2000;
#X text 395 14 Start message with arguments: 'start' takes 3 floats that specify: 1) starting point in the array (in ms) \, 2) end point (in ms) and 3) duration (in ms). You can then select different portions of the array and set also a different duration to read a sample with transposition (and interpolation)., f 62;
#X text 395 84 Default values are: 0 \, array length in ms \, original duration., f 62;
#X msg 470 132 start 1000;
#X text 541 126 play from 1 second at original speed, f 18;
#X obj 208 301 bng 25 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 605 303 bng 25 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X msg 490 168 start 250 750;
#X text 590 162 play half second from 250 ms at original speed, f 24;
#X obj 73 262 cyclone/play~ \$0-violin;
#X obj 470 265 cyclone/play~ \$0-violin;
#X obj 73 301 output~;
#X obj 470 303 output~;
#X obj 313 333 declare -stdpath ./;
#X connect 0 0 23 0;
#X connect 1 0 23 0;
#X connect 2 0 23 0;
#X connect 6 0 23 0;
#X connect 7 0 23 0;
#X connect 13 0 24 0;
#X connect 14 0 24 0;
#X connect 17 0 24 0;
#X connect 21 0 24 0;
#X connect 23 0 25 0;
#X connect 23 1 19 0;
#X connect 24 0 26 0;
#X connect 24 1 20 0;
#X restore 449 170 pd play control \; messages;
#X obj 5 570 cnv 3 550 3 empty empty attributes 8 12 0 13 #dcdcdc #000000 0;
#X text 148 578 @loop <f> | @loopinterp <f> | @interptime <f>;
#X obj 80 506 cnv 17 3 17 empty empty n+1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 153 507 bang;
#X text 350 245 finished;
#X text 353 257 playing;
#X text 185 348 -;
#N canvas 847 75 450 578 attributes 0;
#X msg 113 291 loop \$1;
#X obj 113 270 tgl 15 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 248 366 bng 25 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 176 270 tgl 15 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000 0 1;
#X msg 176 291 loopinterp \$1;
#X msg 272 301 interptime \$1;
#X obj 272 277 nbx 5 14 0 1000 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 275 254 hsl 128 15 0 1000 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 252 480 bng 25 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X msg 29 233 stop;
#X text 34 20 [play~] has 3 attributes:, f 62;
#X text 34 43 - loop: a non-zero enables looping at any given portion of the array \, 0 disables it (default is disabled), f 62;
#X obj 69 442 cyclone/play~ \$0-violin @loop 1 @loopinterp 1 @interptime 500, f 31;
#X obj 113 330 cyclone/play~ \$0-violin;
#X msg 69 233 start 800 1800;
#X obj 69 209 loadbang;
#X obj 176 241 loadbang;
#X text 34 78 - loopinterp: a non-zero enables crossfading when looping \, 0 disables it (default is disabled). This prevents clicks at looping points \, the fade in happens in the start point of the loop and the fade out after the end point of the loop., f 62;
#X text 34 137 - interptime: the crossfade time in ms when loop and loopinterp are enable (default is 50 ms) \, larger times introduce other effects besides preventing clicks., f 62;
#X obj 113 364 output~;
#X obj 70 496 output~;
#X connect 0 0 13 0;
#X connect 1 0 0 0;
#X connect 3 0 4 0;
#X connect 4 0 13 0;
#X connect 5 0 13 0;
#X connect 6 0 5 0;
#X connect 7 0 6 0;
#X connect 9 0 12 0;
#X connect 9 0 13 0;
#X connect 12 0 20 0;
#X connect 12 1 8 0;
#X connect 13 0 19 0;
#X connect 13 1 2 0;
#X connect 14 0 12 0;
#X connect 14 0 13 0;
#X connect 15 0 14 0;
#X connect 16 0 3 0;
#X connect 16 0 1 0;
#X restore 467 204 pd attributes;
#X text 185 393 - pauses at a particular point (can be resumed), f 60;
#X text 300 143 (same as non zero);
#X text 295 166 (same as zero);
#X text 185 507 - when it stops/finishes playing, f 60;
#X obj 221 191 cyclone/play~ \$0-violin;
#X obj 41 245 send \$0-array_size;
#X obj 41 221 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 186 551 - number of output channels (default 1 \, maximum 64), f 60;
#X text 86 83 [play~] plays any part of an array \, it can play at different speeds (with interpolation) and backwards. It may also loop with optional crossfading. The interpolation is the same as [tabread4~]'s.;
#X text 197 348 sets <beginning \, end \, duration> in ms and starts playing \, default values are the whole array in original speed, f 58;
#X obj 221 217 output~;
#X obj 0 2 ./header play~;
#X text 34 57 Array player;
#X connect 13 0 51 0;
#X connect 14 0 53 0;
#X connect 15 0 51 0;
#X connect 16 0 51 0;
#X connect 17 0 51 0;
#X connect 18 0 17 0;
#X connect 51 0 57 0;
#X connect 51 1 36 0;
#X connect 53 0 52 0;
