#N canvas 596 44 518 540 12;
#X declare -stdpath ./;
#X obj 23 12 cos~;
#X obj 86 338 snapshot~;
#X obj 86 241 sig~;
#X floatatom 86 364 10 0 0 0 - - - 0;
#X floatatom 86 210 10 0 0 0 - - - 0;
#X text 10 503 see also:;
#X obj 152 503 osc~;
#X obj 188 503 tabread4~;
#X obj 80 503 cos;
#X obj 109 503 expr~;
#X msg 348 279 \; pd dsp \$1;
#X obj 7 43 cnv 1 500 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#N canvas 683 179 572 208 reference 0;
#X obj 10 44 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0;
#X obj 10 96 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000 0;
#X obj 10 146 cnv 2 550 2 empty empty ARGUMENT: 8 12 0 13 #202020 #000000 0;
#X obj 10 183 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0;
#X obj 28 15 cos~;
#X text 75 14 - cosine wavetable.;
#X text 88 64 signal(s) - input from 0-1 (wraps into 0-1 if outside this range)., f 67;
#X text 88 113 signal(s) - cosine output according to the input., f 63;
#X text 157 156 1) float - sets a single input value.;
#X restore 396 12 pd reference;
#X obj 7 487 cnv 1 500 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X text 328 11 click =>;
#X obj 86 282 cos~;
#X text 263 181 <-- scroll to set input value, f 16;
#X text 64 11 - cosine wavetable;
#X obj 89 182 hsl 162 19 0 1 0 0 empty empty empty -2 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X text 30 127 For a proper cosine function with input in radians and other trigonometric functions \, see [expr~]., f 64;
#X obj 348 243 set-dsp-tgl;
#X text 379 247 DSP on/off;
#N canvas 748 225 517 356 phasemod 0;
#X obj 102 137 +~;
#X obj 102 184 cos~;
#X obj 102 232 output~;
#X obj 97 310 declare -stdpath ./;
#X floatatom 102 57 5 0 0 0 - - - 0;
#X obj 102 98 phasor~ 400;
#X obj 217 98 osc~ 50;
#X obj 217 149 *~;
#X obj 294 173 line~;
#X msg 294 144 \$1 10;
#X floatatom 294 113 8 0 0 0 - - - 0;
#X obj 297 84 hsl 162 19 0 1 0 0 empty empty empty -2 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X obj 294 27 loadbang;
#X msg 294 56 0.5;
#X floatatom 217 57 5 0 0 0 - - - 0;
#X text 96 36 carrier;
#X text 203 34 modulator;
#X text 356 114 index;
#X text 283 222 This is a simple phase modulation patch., f 22;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 4 0 5 0;
#X connect 5 0 0 0;
#X connect 6 0 7 0;
#X connect 7 0 0 1;
#X connect 8 0 7 1;
#X connect 9 0 8 0;
#X connect 10 0 9 0;
#X connect 11 0 10 0;
#X connect 12 0 13 0;
#X connect 13 0 11 0;
#X connect 14 0 6 0;
#X restore 364 455 pd phasemod;
#X obj 142 296 r bang;
#N canvas 788 169 396 460 multichannel 0;
#X obj 86 173 snake~ in;
#X obj 86 261 snake~ out;
#X obj 98 301 r bang;
#X obj 164 350 snapshot~;
#X floatatom 164 389 13 0 0 0 - - - 0;
#X obj 86 350 snapshot~;
#X floatatom 86 389 9 0 0 0 - - - 0;
#X floatatom 86 106 5 0 0 0 - - - 0;
#X floatatom 156 106 5 0 0 0 - - - 0;
#X obj 266 260 metro 100;
#X obj 266 233 loadbang;
#X obj 266 291 s bang;
#X obj 86 133 sig~ 0.5;
#X obj 156 133 sig~ 0.75;
#X obj 86 218 cos~;
#X text 65 29 [cos~] works with multichannel signals \, here's an example., f 31;
#X msg 263 179 \; pd dsp \$1;
#X obj 263 143 set-dsp-tgl;
#X text 294 147 DSP on/off;
#X connect 0 0 14 0;
#X connect 1 0 5 0;
#X connect 1 1 3 0;
#X connect 2 0 3 0;
#X connect 2 0 5 0;
#X connect 3 0 4 0;
#X connect 5 0 6 0;
#X connect 7 0 12 0;
#X connect 8 0 13 0;
#X connect 9 0 11 0;
#X connect 10 0 9 0;
#X connect 12 0 0 0;
#X connect 13 0 0 1;
#X connect 14 0 1 0;
#X connect 17 0 16 0;
#X restore 365 353 pd multichannel;
#X text 214 338 mutichannel signal support ----------->, f 20;
#X text 309 505 updated for Pd version 0.54;
#X obj 260 503 wrap~;
#X text 30 50 The [cos~] object is a cosine wavetable reader. The input is a linear index from 0 to 1 and you can also consider it a cosine trigonometric function of the input multiplied by two pi. Values outside the 0-1 range get wrapped inside this range like in the [wrap~] object., f 64;
#X text 42 405 You can use [cos~] in conjunction with [phasor~] to implement an osicllator just like [osc~] \, but you then have access to the phase signal and this way you can also achieve phase modulation \, see example in the subpatch -->, f 61;
#X connect 1 0 3 0;
#X connect 2 0 15 0;
#X connect 4 0 2 0;
#X connect 15 0 1 0;
#X connect 18 0 4 0;
#X connect 20 0 10 0;
#X connect 23 0 1 0;
