#N canvas 551 23 665 661 12;
#X declare -stdpath ./;
#X floatatom 81 298 5 0 0 0 - - - 0;
#X obj 81 328 sig~ 100;
#X obj 40 18 tabosc4~;
#X text 186 370 message to switch tables;
#X obj 308 270 loadbang;
#X obj 81 502 output~;
#X text 17 596 see also:;
#X obj 91 597 osc~;
#X msg 139 423 0;
#X msg 176 423 0.5;
#X text 209 425 <= resets phase;
#X obj 130 597 phasor~;
#X obj 264 597 tabread4~;
#X text 43 152 For good results use 512 points for up to about 15 partials
\, or 32*npartials (rounded up to a power of 2) for more than 15 partials.
Don't send new "sinesum" messages to tables while you're running -
instead \, use "set" messages to switch between tables., f 77;
#X text 43 214 The frequency input can be either a float or a signal.
The right inlet resets the phase with values from 0 to 1 (where '1'
is the same as '0' and '0.5' is half the cycle)., f 77;
#X text 200 455 creation argument initializes the table name;
#X text 122 298 frequency (Hz.);
#X msg 308 297 \; wave1 sinesum 512 1 1 1 1 \, normalize \; wave2 cosinesum
512 0 1;
#X obj 81 455 tabosc4~ wave1;
#X msg 101 363 set wave1;
#X msg 111 389 set wave2;
#X obj 189 514 declare -stdpath ./;
#N canvas 978 194 574 404 Dealing_with_"\$0" 0;
#X text 36 33 '\$0' - the patch ID number used to force locality in
Pd - is widely used in send/receive names as well as array names. This
is specially useful in abstractions so each copy has local names instead
of global., f 70;
#X text 394 262 <= array with local name, f 13;
#X obj 262 261 array define \$0-x;
#X obj 178 279 f \$0;
#X msg 178 306 \; \$1-x sinesum 512 1 1 1 1 \, normalize;
#X obj 62 290 output~;
#X msg 133 205 set \$1;
#X obj 133 179 symbol \$0-x;
#X obj 133 156 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#X obj 62 189 sig~ 440;
#X obj 178 253 loadbang;
#X obj 62 240 tabosc4~;
#X text 240 185 You can also load '\$0' in a float object and send
it to a message that works like a send to send messages to an array.
, f 40;
#X text 152 153 click to set name;
#X text 36 86 You can use "\$0" in an array name and if you need to
set the array name you can load it in a symbol object \, since "\$0"
doesn't work in messages., f 70;
#X connect 3 0 4 0;
#X connect 6 0 11 0;
#X connect 7 0 6 0;
#X connect 8 0 7 0;
#X connect 9 0 11 0;
#X connect 10 0 3 0;
#X connect 11 0 5 0;
#X connect 11 0 5 1;
#X restore 435 536 pd Dealing_with_"\$0";
#X obj 451 360 array define wave1;
#X obj 451 384 array define wave2;
#X obj 24 626 array;
#X text 427 497 open subpatch to see how to deal with '\$0', f 21
;
#X obj 190 597 tabwrite~;
#N canvas 731 147 584 276 reference 0;
#X obj 18 52 cnv 5 550 5 empty empty INLETS: 8 18 0 13 #202020 #000000
0;
#X obj 18 174 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000
0;
#X obj 18 211 cnv 2 550 2 empty empty ARGUMENT: 8 12 0 13 #202020 #000000
0;
#X obj 17 248 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000
0;
#X text 119 91 signal -;
#X obj 17 136 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000
0;
#X obj 17 85 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000
0;
#X text 126 145 float -;
#X text 183 145 phase cycle reset (from 0 to 1)., f 46;
#X text 183 91 frequency value in Hz., f 46;
#X obj 50 18 tabosc4~;
#X text 77 110 set <symbol> -;
#X text 126 184 signal - wavetable oscillator output., f 54;
#X text 183 110 set table name with the waveform., f 46;
#X text 124 220 1) symbol - initializes the table name (default none).
, f 55;
#X text 120 19 - 4-point interpolating wavetable oscillator.;
#X restore 473 18 pd reference;
#X text 571 19 <= click;
#X obj 8 49 cnv 1 650 1 empty empty empty 8 12 0 13 #000000 #000000
0;
#X obj 8 580 cnv 1 650 1 empty empty empty 8 12 0 13 #000000 #000000
0;
#X text 428 607 updated for Pd version 0.33;
#N canvas 643 412 384 186 array-examples 0;
#N canvas 491 316 457 285 open 0;
#X obj 120 23 inlet;
#X obj 173 121 pdcontrol;
#X msg 173 94 dir;
#X obj 120 181 pack s s;
#X obj 173 64 loadbang;
#X msg 120 212 \; pd open \$1 \$2;
#X obj 173 151 makefilename %s/../2.control.examples;
#X connect 0 0 3 0;
#X connect 1 0 6 0;
#X connect 2 0 1 0;
#X connect 3 0 5 0;
#X connect 4 0 2 0;
#X connect 6 0 3 1;
#X restore 52 131 pd open;
#X msg 52 76 15.array.pd;
#X msg 62 102 16.more.arrays.pd;
#X text 144 77 <-- click to open examples.;
#X text 47 22 See also and the "array" examples from the section 2
of Pd's tutorial:, f 39;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X restore 73 626 pd array-examples;
#X text 110 19 - 4-point interpolating wavetable oscillator;
#X text 43 60 [tabosc4~] is a traditional computer music style wavetable
lookup oscillator using 4-point polynomial interpolation. The table
should have a power of two points plus three "guard points" \, one
at the beginning and two at the end \, which should be wraparound copies
of the last point and the first two points \, respectively. The "sinesum"
and "cosinesum" methods for arrays do this automatically for you if
you just want to specify partial strengths., f 77;
#X connect 0 0 1 0;
#X connect 1 0 18 0;
#X connect 4 0 17 0;
#X connect 8 0 18 1;
#X connect 9 0 18 1;
#X connect 18 0 5 0;
#X connect 18 0 5 1;
#X connect 19 0 18 0;
#X connect 20 0 18 0;
