#N canvas 401 82 748 768 12;
#X declare -stdpath ./;
#N canvas 0 0 450 300 (subpatch) 0;
#X array waveform12 131 float 1;
#A 0 -0.172615 -0.172615 -0.172615 -0.172615 -0.172615 -0.141231 -0.109846 -0.0941538 -0.0627692 -0.0470769 0.0156923 0.0784615 0.125538 0.188308 0.235385 0.298154 0.360923 0.392308 0.470769 0.533538 0.596308 0.643385 0.674769 0.721846 0.753231 0.784615 0.816 0.831692 0.847385 0.878769 0.894462 0.910154 0.910154 0.910154 0.910154 0.910154 0.894462 0.894462 0.894462 0.894462 0.878769 0.863077 0.816 0.800308 0.768923 0.737538 0.706154 0.674769 0.643385 0.596308 0.564923 0.533538 0.470769 0.423692 0.376615 0.313846 0.266769 0.204 0.172615 0.109846 0.0627692 0.0156923 0 -0.0313846 -0.0627692 -0.0784615 -0.0941538 -0.109846 -0.141231 -0.156923 -0.172615 -0.204 -0.219692 -0.219692 -0.235385 -0.235385 -0.235385 -0.219692 -0.219692 -0.219692 -0.204 -0.156923 -0.125538 -0.0784615 0 0.172615 0.313846 0.470769 0.564923 0.627692 0.690462 0.721846 0.737538 0.753231 0.768923 0.768923 0.753231 0.737538 0.706154 0.674769 0.612 0.580615 0.549231 0.517846 0.486462 0.423692 0.392308 0.360923 0.282462 0.219692 0.109846 -0.0156923 -0.0941538 -0.109846 -0.141231 -0.156923 -0.172615 -0.188308 -0.204 -0.204 -0.219692 -0.204 -0.204 -0.219692 -0.219692 -0.204 -0.204 -0.204 -0.204 -0.204 -0.188308;
#X coords 0 1.02 130 -1.02 258 130 1;
#X restore 424 120 graph;
#X obj 156 142 phasor~;
#X obj 156 231 tabread4~ waveform12;
#X obj 156 204 +~ 1;
#X floatatom 156 113 6 0 0 0 - \$0-frequency - 0;
#X floatatom 250 103 6 0 500 0 - \$0-squeeze - 0;
#X obj 250 151 line~;
#X obj 156 178 *~;
#X text 49 128 phase;
#X text 49 164 range;
#X text 250 82 squeeze;
#X text 133 87 frequency;
#N canvas 0 0 450 300 (subpatch) 0;
#X array wave-out12 441 float 0;
#X coords 0 1 440 -1 259 134 1;
#X restore 423 280 graph;
#X obj 250 175 +~ 128;
#X obj 157 363 output~;
#X obj 207 269 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X obj 250 127 pack f 50;
#X text 48 143 generation -->;
#X text 48 179 adjustment -->;
#X obj 63 27 cnv 5 5 25 empty empty A\ Wavetable\ Oscillator\ with\ [tabread4~]\ and\ [phasor~] 15 13 0 16 #dfdfdf #202020 0;
#X text 230 268 <-- graph once;
#X obj 234 296 tgl 19 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X text 258 295 <-- graph repeatedly, f 10;
#N canvas 146 130 450 300 graph 0;
#X obj 256 73 inlet;
#X obj 192 73 inlet;
#X obj 192 203 tabwrite~ wave-out12;
#X obj 256 137 metro 250;
#X obj 122 73 inlet~;
#X connect 0 0 3 0;
#X connect 1 0 2 0;
#X connect 3 0 2 0;
#X connect 4 0 2 0;
#X restore 181 326 pd graph;
#X text 66 656 You would use [tabread4~] (as opposed to [tabosc4~]) if you need direct control of the phase \, for instance to advance nonlinearly through the table. In the case shown here \, the "squeeze" factor makes the phase grow to a value at least \, and possibly much greater than \, 129 (to which [tabread4~] then limits it). So the resulting waveform is compressed in time. The graphing is now performed in the [pd graph] subpatch., f 86;
#N canvas 1002 256 319 305 init 0;
#X obj 93 90 loadbang;
#X obj 93 191 s \$0-frequency;
#X msg 93 143 220;
#X obj 140 159 s \$0-squeeze;
#X msg 140 131 50;
#X text 58 22 This subpatch initializes the patch and loads values into the number boxes, f 26;
#X obj 91 250 declare -stdpath ./;
#X connect 0 0 2 0;
#X connect 0 0 4 0;
#X connect 2 0 1 0;
#X connect 4 0 3 0;
#X restore 310 396 pd init;
#X obj 48 286 phasor~;
#X obj 48 310 cos~;
#X obj 65 371 osc~;
#X text 37 258 this...;
#X text 33 345 is the same as, f 12;
#X text 66 519 The [tabread4~] module is suited for situations requiring more control than [tabosc4~] offers. The relationship between the two is the same as between [cos~] and [osc~] \, although the units are different between [cos~] and [tabread4~]. The [cos~] object is a cosine table and assumes an input normalized from 0 to 1 as given by [phasor~] (although it will wrap around over this range as needed) \, while [tabread4~] takes values from 1 to n-2 where n is the number of points in the table -- for a 131-point table such as we have here with "waveform12" \, it's 1 to 129 \, but 129 is supposedly a copy of 1 (more details in the next example). This means it wraps at 129 to 1 (hence \, the "good" segment is actually just 128 samples long.), f 86;
#X text 67 453 The [phasor~] object generates phase ramps from 0 to 1 and repeats it at a frequency in Hz. This is a sawtooth like signal but not a proper sawtooth waveform for synthesis (which is in the range of -1 to 1). You can use [phasor~] to drive [cos~] and [tabread4~] to implement oscillators \, for instance., f 86;
#X connect 1 0 7 0;
#X connect 2 0 14 0;
#X connect 2 0 23 0;
#X connect 3 0 2 0;
#X connect 4 0 1 0;
#X connect 5 0 16 0;
#X connect 6 0 13 0;
#X connect 7 0 3 0;
#X connect 13 0 7 1;
#X connect 15 0 23 1;
#X connect 16 0 6 0;
#X connect 21 0 23 2;
#X connect 26 0 27 0;
