#N canvas 389 32 568 692 10;
#X declare -stdpath ./;
#X obj 6 669 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X obj 7 362 cnv 3 550 3 empty empty inlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 7 547 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 7 598 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 82 369 cnv 17 3 172 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 82 555 cnv 17 3 17 empty empty 0-n 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 143 385 signal;
#X text 143 555 signal;
#X text 125 621 2) float;
#X text 125 605 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 457 243 pd multichannel;
#X text 187 555 - the playback of a channel, f 60;
#X text 188 604 - table name (required), f 60;
#X obj 223 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 43 182 pd load \; sample;
#X msg 264 166 stop;
#X msg 262 142 start;
#X msg 164 160 loop \$1;
#X obj 164 138 tgl 15 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000 0 1;
#X text 149 368 float;
#X text 187 402 - sets array name, f 60;
#X text 107 402 set <symbol>;
#X text 143 447 <stop>;
#X text 137 463 <pause>;
#X text 131 479 <resume>;
#X text 89 418 start <f \, f \, f>;
#X text 187 385 - playback position in ms, f 60;
#X text 187 447 - stops playing and outputs 0 (cannot be resumed), f 60;
#X text 187 368 - non zero plays the array in original speed \, <0> stops it, f 60;
#X text 187 479 - resumes playing after being paused, f 60;
#X text 131 495 loop <f>;
#X text 95 511 loopinterp <f>;
#X text 187 511 - non zero enables crossfading when looping \, <0> disables it;
#X text 187 495 - non zero enables looping \, <0> disables it, f 60;
#X text 95 527 interptime <f>;
#X text 187 527 - sets crossfading time in ms (default 50), f 60;
#X obj 358 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 445 219 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 451 160 pd play control \; messages;
#X obj 7 640 cnv 3 550 3 empty empty attributes 8 12 0 13 #dcdcdc #000000 0;
#X text 150 648 @loop <f> | @loopinterp <f> | @interptime <f>;
#X obj 82 576 cnv 17 3 17 empty empty n+1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 155 577 bang;
#X text 352 245 finished;
#X text 355 257 playing;
#X text 187 418 -;
#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 469 194 pd attributes;
#X text 187 463 - pauses at a particular point (can be resumed), f 60;
#X text 302 143 (same as non zero);
#X text 297 166 (same as zero);
#X text 187 577 - when it stops/finishes playing, f 60;
#X obj 223 191 cyclone/play~ \$0-violin;
#X obj 43 245 send \$0-array_size;
#X obj 43 221 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 188 621 - number of output channels (default 1 \, maximum 64), f 60;
#X text 88 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 199 418 sets <beginning \, end \, duration> in ms and starts playing \, default values are the whole array in original speed, f 58;
#X obj 223 217 output~;
#X obj 2 2 ./header play~;
#X text 36 57 Array player;
#X obj 433 337 open-else;
#X text 504 291 click;
#X text 19 315 see also:;
#X obj 87 314 tabplay~;
#X msg 433 291 tabplayer~;
#X text 149 302 Plugdata users or those with ELSE can also use [else/tabplayer~] or the more convenient [else/player~] as alternatives, f 44;
#X msg 443 314 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;
#X connect 64 0 60 0;
#X connect 66 0 60 0;
