#N canvas 428 23 561 663 10;
#X declare -stdpath ./;
#X obj 5 634 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X obj 5 287 cnv 3 550 3 empty empty inlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 8 478 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 9 515 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 70 298 cnv 17 3 147 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 70 451 cnv 17 3 17 empty empty 1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 89 488 cnv 17 3 17 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 176 487 signal;
#X obj 231 186 cyclone/cycle~ 440;
#X text 142 451 float/signal;
#X text 142 297 float/signal;
#X text 196 347 set;
#X text 223 347 - only a "set" message sets to the default cosine wave;
#X text 113 520 1) float;
#X text 113 535 2) symbol;
#X text 113 563 3) float;
#X text 189 563 - sets offset within the given array (default 0);
#X obj 231 158 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 290 157 frequency in hertz;
#X text 124 380 setall <symbol>;
#X text 124 397 buffer <symbol>;
#X text 225 380 - sets an array using its entire length;
#X text 224 364 - sets array name and offset (reads only 512 points);
#X text 225 397 - sets array (analogous to the setall message);
#X text 223 296 - sets frequency in hertz (negative values allowed);
#X text 223 312 - sets frequency in hertz;
#X text 82 430 buffer_sizeinsamps <f>;
#X obj 9 586 cnv 3 550 3 empty empty attributes 8 12 0 13 #dcdcdc #000000 0;
#X text 139 594 @frequency <float> | @phase <float> | @buffer <symbol>;
#X text 139 609 @buffer_offset <float> | @buffer_sizeinsamps <float>;
#N canvas 482 85 817 620 attributes 0;
#X text 37 100 This is different than the "set" message or setting the array name as the second argument \, in which cases [cycle~] only reads 512 points from the buffer. This is because [cycle~] could historically only read 512 \, so it still works that way for backwards compatibility issues.;
#X text 37 23 @buffer:;
#X text 35 185 @buffer_offset:;
#X text 435 10 @buffer_sizeinsamps:;
#X text 433 37 This attribute allows other buffer sizes than 512 points (when using the set message or by specifying the buffer as the second argument) or the entire array (via the setall message or the buffer attribute).;
#X text 434 98 Thus \, the @buffer_sizeinsamps attribute (also setable via the "buffer_sizeinsamps" message) sets to size values in powers of two from 16 to 65536 (13 values from 2^4 to 2^16).;
#X obj 512 147 cnv 15 200 84 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X text 522 148 Possible values \; - 16 \; - 32 \; - 64 \; - 128 \; - 256 \; - 512;
#X text 642 147 - 1024 \; - 2048 \; - 4096 \; - 8192 \; - 16384 \; - 32768 \; - 65536;
#X text 37 213 The @buffer_offset attribute (also as the "buffer_offset" message) followed by a float sets the sample offset into the buffer. If your offset is too large and close to the end of the table) \, the remainder is filled with zeros.;
#X text 37 44 The @buffer attribute (also setable via the "buffer" message) is analogous to the "setall" message. This means that the buffer attribute followed by an array name sets that entire array to be used as the waveform., f 60;
#X obj 441 236 cnv 15 364 33 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X text 448 239 Other possible values are: "-1" \, which sets to the entire buffer's length \, and "0" \, which sets to 512 samples.;
#X text 446 283 Below we have [cycle~] reading 4096 points from the buffer with an offset of 1 sample. This means it doesn't read the first and the last 2 samples from this 4099 points buffer \, which are \, by the way \, the guardpoints generated by the "sineseum" command for interpolation in the other subpatch ([pd set/setall]).;
#X text 470 576 Other attributes are: @frequency (nothing special about it) and @phase (see the next subpatch example on phase)., f 56;
#X obj 484 425 cyclone/scope~ 272 140 6 3 128 -1 1 100 0 0 0 205 229 232 74 79 77 96 98 102 0 empty;
#X obj 183 436 cyclone/scope~ 272 140 6 3 128 -1 1 100 0 0 0 205 229 232 74 79 77 96 98 102 0 empty;
#X msg 62 346 buffer_offset \$1;
#X obj 65 297 hsl 128 15 0 4096 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 62 322 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 149 323 offset;
#X obj 484 376 cyclone/cycle~ 110 \$0-saw @buffer_offset 1 @buffer_sizeinsamps 4096;
#X obj 62 375 cyclone/cycle~ 110 @buffer \$0-saw;
#X obj 62 470 output~;
#X connect 17 0 22 0;
#X connect 18 0 19 0;
#X connect 19 0 17 0;
#X connect 21 0 15 0;
#X connect 22 0 16 0;
#X connect 22 0 23 0;
#X restore 463 233 pd attributes;
#N canvas 429 45 819 587 phase 0;
#X obj 545 430 *~;
#X msg 626 418 \$1 10;
#X obj 626 438 line~;
#X obj 626 395 nbx 4 14 0 10 0 1 empty indice empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 629 373 hsl 128 15 0 2 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X text 641 373 Modulation Index;
#X text 21 19 The second inlet in [cycle~] can set a phase offset with values between 0 and 1 (but values over this boundaries are wrapped internally to the 0-1 range).;
#X obj 203 374 cyclone/cycle~;
#X obj 284 344 phasor~ 440;
#X msg 654 159 \; pd dsp 0 \, dsp 1;
#X text 426 310 Phase modulation:;
#X text 455 343 [cycle~] conveniently allows phase modulation with its second inlet.;
#X obj 545 400 cycle~ 50;
#X obj 440 464 cyclone/cycle~ 220;
#X text 406 401 mod frequency (50 Hz);
#X text 560 465 carrier frequency (220 hz);
#X obj 77 531 cyclone/cycle~ @frequency 440 @phase 0.5;
#X text 38 503 Frequency and phase set as attributes:;
#X text 428 20 To resset the phase of [cycle~] you can turn the DSP off and then on again;
#X text 429 264 The phase is also resset in many operations in edit mode - so nevermind if you hear "clicks" when editing the patch!;
#X text 42 344 [cycle~] being driven by phase only =>;
#X obj 170 138 cyclone/cycle~ 440;
#X msg 297 117 \$1 10;
#X obj 297 138 line~;
#X obj 297 97 nbx 4 14 0 10 0 1 empty indice empty 0 -8 0 10 #dcdcdc #000000 #000000 0.125984 256;
#X obj 300 76 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X text 341 75 phase;
#X obj 26 138 cyclone/cycle~ 440;
#X obj 488 71 cyclone/cycle~ 0.5;
#X obj 488 107 cyclone/scope~ 130 130 256 3 128 -1 1 0 0 0 0 205 229 232 74 79 77 96 98 102 0 empty;
#X obj 26 170 cyclone/scope~ 151 134 6 3 24 -1 1 0 0 0 0 205 229 232 74 79 77 96 98 102 0 empty;
#X obj 440 510 output~;
#X obj 203 417 output~;
#X connect 0 0 13 1;
#X connect 1 0 2 0;
#X connect 2 0 0 1;
#X connect 3 0 1 0;
#X connect 4 0 3 0;
#X connect 7 0 32 0;
#X connect 8 0 7 1;
#X connect 12 0 0 0;
#X connect 13 0 31 0;
#X connect 21 0 30 1;
#X connect 22 0 23 0;
#X connect 23 0 21 1;
#X connect 24 0 22 0;
#X connect 25 0 24 0;
#X connect 27 0 30 0;
#X connect 28 0 29 0;
#X restore 405 255 pd phase;
#X text 63 84 [cycle~] is a linear interpolating oscillator* that reads repeatedly through one cycle of a waveform. The default internal waveform is one cycle of a cosine wave (16k in size \, 64 bits) \, but you can set other waveforms from given arrays.;
#X text 100 363 set <symbol \, float>;
#X text 136 330 phase <float>;
#X text 112 313 frequency <float>;
#X text 88 414 buffer_offset <float>;
#X text 225 487 - a periodically repeating waveform;
#X text 189 520 - sets frequency in Hz (default 0);
#X text 225 430 - changes the buffer size to powers of 2 (16 to 65536);
#X text 189 535 -;
#X text 201 535 sets array used as the wavetable (but only reads 512 points from the buffer) \, default: internal cosine table, f 58;
#X text 20 200 *;
#X text 31 195 [cyclone/wave~] provides other interpolation types., f 26;
#X obj 497 71 cyclone/dsponoff~;
#N canvas 874 112 403 264 [buffer~] 0;
#X msg 137 81 open;
#X text 15 15 The [cycle~] object works with any kind of array set in Pd as well with arrays set in the [buffer~] object. In the case of a multi channel [buffer~] \, [cycle~] will only read its first channel.;
#X obj 86 131 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 174 109 cyclone/buffer~ \$0-sine @samps 512;
#X obj 174 81 cyclone/loadmess fill sin;
#X obj 86 158 cyclone/cycle~ 440 \$0-sine;
#X obj 86 192 output~;
#X connect 0 0 3 0;
#X connect 2 0 5 0;
#X connect 4 0 3 0;
#X connect 5 0 6 0;
#X restore 463 255 pd [buffer~];
#X text 223 329 - sets phase offset;
#X text 225 414 - sets offset into buffer;
#X text 225 451 - phase offset;
#N canvas 486 23 880 723 set/setall 0;
#X obj 28 378 hsl 396 22 0 4096 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X text 156 481 sets buffer and offset;
#X obj 26 235 cnv 15 398 138 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#N canvas 0 50 450 250 (subpatch) 0;
#X array \$0-wavetable 4099 float 4;
#X coords 0 1 4098 -1 400 140 1;
#X restore 25 234 graph;
#N canvas 317 53 392 189 generate 0;
#X obj 44 102 send \$0-wavetable;
#X obj 44 54 loadbang;
#X msg 44 77 sinesum 4096 0 0 0 1 0.7 1 0.4 1 1 1 \, normalize;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X restore 301 218 pd generate waveform;
#X obj 93 426 nbx 9 18 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 192 428 Offset;
#X msg 52 490 set;
#X text 12 469 internal;
#X text 15 489 wave;
#X obj 217 556 cyclone/scope~ 272 140 6 3 128 -1 1 100 0 0 0 205 229 232 74 79 77 96 98 102 0 empty;
#X obj 93 521 cyclone/cycle~ 440 \$0-wavetable 512;
#X text 34 17 The set message with no arguments sets the internal waveform (16k cosine \, 64 bits). A set message followed by a symbol sets the array to be used as a waveform. After the name \, you can also optionally set an offset for that table.;
#X obj 93 454 cyclone/prepend set \$0-wavetable;
#X obj 110 481 print;
#X text 36 113 If you have an array with more than 512 samples \, you can scroll through the array with an offset index value \, but it'll only read 512 samples from it. If not enough table points are available (as if you have a table smaller than 512 samples or if your offset is too large and close to the end of the table) \, the remainder is filled with zeros. Below we have a table with 4099 points to use with [cycle~].;
#X text 36 70 With the set message \, [cycle~] reads only 512 points in a table (because historically it could only deal with 512 points tables - other new messages allow more points).;
#X obj 594 528 cyclone/scope~ 272 140 6 3 128 -1 1 100 0 0 0 205 229 232 74 79 77 96 98 102 0 empty;
#X obj 586 316 cyclone/loadmess setall \$0-saw;
#X obj 586 375 cyclone/cycle~ 110;
#N canvas 927 315 441 227 generate-saw 0;
#X obj 44 46 loadbang;
#X msg 44 77 sinesum 4096 1 0.5 0.333333 0.25 0.2 0.166667 0.125 \, normalize;
#X obj 44 129 send \$0-saw;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X restore 769 138 pd generate-saw;
#X obj 464 155 cnv 15 398 138 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#N canvas 0 50 450 250 (subpatch) 0;
#X array \$0-saw 4099 float 4;
#X coords 0 1 4098 -1 400 140 1 0 0;
#X restore 463 154 graph;
#X obj 594 490 cyclone/cycle~ 110 @buffer \$0-saw;
#X obj 605 347 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 483 45 The "setall" message behaves the same as the buffer method or attribute. Hence \, followed by an array name \, it sets that entire array to be used as a waveform (a 4099 points wavetable in this case). This is quite different than the "set" message or the second argument \, which only reads 512 points from the buffer.;
#X text 390 491 Same as the "@buffer" attribute:;
#X obj 93 592 output~;
#X obj 586 408 output~;
#X connect 0 0 5 0;
#X connect 5 0 13 0;
#X connect 7 0 11 0;
#X connect 11 0 10 0;
#X connect 11 0 27 0;
#X connect 13 0 11 0;
#X connect 13 0 14 0;
#X connect 18 0 19 0;
#X connect 19 0 28 0;
#X connect 23 0 17 0;
#X connect 24 0 19 0;
#X restore 375 233 pd set/setall;
#X obj 231 224 output~;
#X obj 1 5 ./header cycle~;
#X text 19 58 Wavetable oscillator;
#X obj 54 254 declare -stdpath ./;
#X connect 8 0 50 0;
#X connect 17 0 8 0;
