Commit 52dca0f9 authored by Miller Puckette's avatar Miller Puckette
Browse files

set up git repository

parents
#N canvas 534 115 698 613 12;
#X obj 157 408 cos~;
#X floatatom 204 198 4 0 100 0 - - -;
#X obj 204 222 / 10;
#X text 461 275 --- 0.02 seconds ---;
#X obj 157 378 *~;
#X obj 204 294 line~;
#X obj 204 246 max 0;
#N canvas 0 0 450 300 graph3 0;
#X array F08-carrier 882 float 0;
#X coords 0 2 881 -2 200 140 1;
#X restore 447 123 graph;
#X floatatom 57 295 4 0 0 0 - - -;
#X text 53 251 fundamental;
#X text 53 270 frequency;
#X obj 199 408 cos~;
#X obj 240 321 wrap~;
#X obj 204 348 -~;
#X obj 199 378 +~;
#X obj 204 445 -~;
#X obj 219 475 *~;
#X obj 197 500 +~;
#X obj 204 270 pack 0 50;
#X text 254 408 synthesize the two partials;
#X text 447 590 updated for Pd version 0.37;
#X obj 198 526 hip~;
#X obj 199 552 output~;
#X text 26 29 The other \, spiffier way is to make a sum of cosines
to interpolate between adjacent harmonics. Suppose for example we want
a center frequency of 5.3 (in units of the fundamental.) We just take
partial 5 with amplitude 0.7 and partial 6 with amplitude 0.3:;
#X obj 286 552 tabwrite~ F08-carrier;
#X text 316 528 <-graph;
#X obj 284 527 bng 18 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 57 319 phasor~ 100;
#X text 83 149 center frequency (in;
#X text 82 169 tenths of fundamental);
#X text 125 3 MOVABLE CENTER FREQUENCY BY ADDING TWO COSINES;
#X text 295 320 the fractional part "q";
#X text 253 347 subtract to get the integer part "k";
#X text 249 380 multiply phase by k and k+1;
#X text 252 444 c2 - c1;
#X text 267 473 q * (c2 - c1);
#X text 236 500 q * c2 + (1-q) * c1;
#X connect 0 0 15 1;
#X connect 0 0 17 0;
#X connect 1 0 2 0;
#X connect 2 0 6 0;
#X connect 4 0 0 0;
#X connect 4 0 14 0;
#X connect 5 0 13 0;
#X connect 5 0 12 0;
#X connect 6 0 18 0;
#X connect 8 0 27 0;
#X connect 11 0 15 0;
#X connect 12 0 13 1;
#X connect 12 0 16 1;
#X connect 13 0 4 1;
#X connect 14 0 11 0;
#X connect 15 0 16 0;
#X connect 16 0 17 1;
#X connect 17 0 21 0;
#X connect 17 0 24 0;
#X connect 18 0 5 0;
#X connect 21 0 22 0;
#X connect 21 0 22 1;
#X connect 26 0 24 0;
#X connect 27 0 4 0;
#X connect 27 0 14 1;
#N canvas 10 49 579 665 12;
#X obj 130 481 cos~;
#X obj 130 451 *~;
#X obj 172 481 cos~;
#X obj 214 397 wrap~;
#X obj 177 402 -~;
#X obj 172 451 +~;
#X obj 172 516 -~;
#X obj 192 548 *~;
#X obj 170 573 +~;
#X obj 204 159 loadbang;
#X obj 204 185 metro 400;
#X obj 216 209 del 200;
#X obj 252 326 samphold~;
#N canvas 0 0 405 406 switch 0;
#X obj 15 383 outlet~;
#X obj 8 193 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1
;
#X obj 329 195 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 18 99 loadbang;
#X obj 18 131 1;
#X obj 53 261 sel 1;
#X obj 53 287 0;
#X obj 339 259 sel 1;
#X obj 339 288 0;
#X obj 47 316 inlet~;
#X obj 15 344 *~;
#X obj 340 312 inlet~;
#X obj 308 340 *~;
#X connect 1 0 5 0;
#X connect 1 0 10 1;
#X connect 2 0 7 0;
#X connect 2 0 12 1;
#X connect 3 0 4 0;
#X connect 4 0 1 0;
#X connect 5 0 6 0;
#X connect 6 0 2 0;
#X connect 7 0 8 0;
#X connect 8 0 1 0;
#X connect 9 0 10 0;
#X connect 10 0 0 0;
#X connect 11 0 12 0;
#X connect 12 0 0 0;
#X coords 0 0 1 1 80 35 1;
#X restore 177 351 pd switch;
#X text 31 2 CHANGING THE CENTER FREQUENCY QUICKLY;
#X text 34 27 Since in the previous patch the amplitudes of the two
cosines depend on "center frequency" we can't change that discontinuously
without clicking \, as you hear in this patch. The fix is to use a
samphold~ object to keep the center frequency frozen except at phase
crossings. At the phase crossings the two weighted cosines add to one
\, so we can discontinuously change the frequencies and weights there.
;
#X text 266 365 <--toggles to select which one;
#X text 369 384 is actually used;
#X obj 171 602 output~;
#X floatatom 225 264 3 0 50 0 - - -;
#X obj 178 263 pack;
#X text 258 263 <--gliss time;
#X text 324 647 updated for Pd version 0.37;
#X obj 178 287 line~;
#X msg 216 239 13.5;
#X msg 178 239 4;
#X obj 70 287 phasor~ 80;
#X connect 0 0 6 1;
#X connect 0 0 8 0;
#X connect 1 0 0 0;
#X connect 1 0 5 0;
#X connect 2 0 6 0;
#X connect 3 0 4 1;
#X connect 3 0 7 1;
#X connect 4 0 1 1;
#X connect 5 0 2 0;
#X connect 6 0 7 0;
#X connect 7 0 8 1;
#X connect 8 0 18 0;
#X connect 8 0 18 1;
#X connect 9 0 10 0;
#X connect 10 0 25 0;
#X connect 10 0 11 0;
#X connect 11 0 24 0;
#X connect 12 0 13 1;
#X connect 13 0 4 0;
#X connect 13 0 3 0;
#X connect 19 0 20 1;
#X connect 20 0 23 0;
#X connect 23 0 13 0;
#X connect 23 0 12 0;
#X connect 24 0 20 0;
#X connect 25 0 20 0;
#X connect 26 0 1 0;
#X connect 26 0 5 1;
#X connect 26 0 12 1;
#N canvas 60 64 834 697 12;
#X obj 168 476 cos~;
#X obj 168 430 *~;
#X obj 211 478 cos~;
#X obj 252 379 wrap~;
#X obj 215 378 -~;
#X obj 211 455 +~;
#X obj 209 513 -~;
#X obj 230 539 *~;
#X obj 215 348 samphold~;
#X text 167 6 APPLYING TWO-COSINE CARRIER TO FM;
#X floatatom 232 228 4 0 200 0 - - -;
#X obj 232 251 / 10;
#X text 232 147 center;
#X obj 232 300 line~;
#X text 232 167 freq. (in;
#X text 232 187 tenths of;
#X text 232 207 fundamental);
#X obj 232 277 pack 0 50;
#X obj 121 283 phasor~;
#X floatatom 121 260 4 0 0 0 - - -;
#X text 106 207 fundamental;
#X text 106 227 (= mod freq);
#X text 435 254 index;
#X text 435 274 (percent);
#X floatatom 435 295 4 0 500 0 - - -;
#X obj 385 361 cos~;
#X obj 435 364 line~;
#X obj 385 384 *~;
#X obj 435 318 / 100;
#X obj 435 341 pack 0 50;
#X obj 168 453 +~;
#X text 388 410 modulating;
#X text 388 430 oscillator;
#X text 40 452 both phases-->;
#X text 9 435 add modulator to;
#X obj 233 632 output~;
#X obj 232 601 hip~;
#N canvas 122 211 558 609 fft 0;
#X obj 23 55 inlet~;
#X obj 210 303 inlet;
#X obj 27 215 rfft~;
#X obj 27 248 *~;
#X obj 58 248 *~;
#X obj 27 278 sqrt~;
#X obj 334 200 block~ 4096 1;
#X obj 27 304 biquad~ 0 0 0 0 1;
#X text 91 216 Fourier series;
#X text 96 269 magnitude;
#X text 94 254 calculate;
#X text 21 3 This subpatch computes the spectrum of the incoming signal
with a (rectangular windowed) FFT. FFTs aren't properly introduced
until much later.;
#X text 83 61 signal to analyze;
#X text 195 255 delay two samples;
#X text 193 273 for better graphing;
#X obj 292 79 samplerate~;
#X obj 240 352 metro 500;
#X obj 240 329 inlet;
#X text 293 327 toggle to graph repeatedly;
#X text 264 303 bang to graph once;
#X obj 27 328 /~ 4096;
#X obj 292 54 bang~;
#X msg 211 413 \; pd dsp 1;
#X obj 237 390 tabwrite~ F10-spectrum;
#X obj 292 102 / 4096;
#X obj 58 135 osc~;
#X obj 58 163 +~ 1;
#X obj 28 188 *~;
#X text 113 138 hanning window;
#X obj 254 79 0.5;
#X connect 0 0 27 0;
#X connect 1 0 22 0;
#X connect 1 0 23 0;
#X connect 2 0 3 0;
#X connect 2 0 3 1;
#X connect 2 1 4 0;
#X connect 2 1 4 1;
#X connect 3 0 5 0;
#X connect 4 0 5 0;
#X connect 5 0 7 0;
#X connect 7 0 20 0;
#X connect 15 0 24 0;
#X connect 16 0 23 0;
#X connect 17 0 16 0;
#X connect 17 0 22 0;
#X connect 20 0 23 0;
#X connect 21 0 15 0;
#X connect 21 0 29 0;
#X connect 24 0 25 0;
#X connect 25 0 26 0;
#X connect 26 0 27 1;
#X connect 27 0 2 0;
#X connect 29 0 25 1;
#X restore 286 601 pd fft;
#X obj 346 580 bng 18 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 346 601 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#X text 367 600 <-- repeatedly;
#X text 368 580 <-- graph once;
#X text 580 663 updated for Pd version 0.37;
#N canvas 0 0 450 300 graph1 0;
#X array F10-spectrum 259 float 0;
#X coords 0 0.51 258 -0.008 256 130 1;
#X restore 560 386 graph;
#X text 552 517 0;
#X obj 207 565 +~;
#X text 31 30 We can apply the two-cosine method to FM synthesis to
get FM spectra which slide up and down: we just treat the cosines like
carrier signals in an FM instrument. This doesn't work as well as you'd
wish \, because the phases of the partials of the two FM instruments
don't line up \, so that \, for indices of modulation above about 20%
\, you get beating effects as the center frequency goes up and down.
;
#X text 614 527 -- frequency --;
#X text 792 518 2700;
#X connect 0 0 6 1;
#X connect 0 0 45 0;
#X connect 1 0 30 0;
#X connect 2 0 6 0;
#X connect 3 0 4 1;
#X connect 3 0 7 1;
#X connect 4 0 1 1;
#X connect 5 0 2 0;
#X connect 6 0 7 0;
#X connect 7 0 45 1;
#X connect 8 0 4 0;
#X connect 8 0 3 0;
#X connect 10 0 11 0;
#X connect 11 0 17 0;
#X connect 13 0 8 0;
#X connect 17 0 13 0;
#X connect 18 0 8 1;
#X connect 18 0 25 0;
#X connect 18 0 1 0;
#X connect 18 0 5 1;
#X connect 19 0 18 0;
#X connect 24 0 28 0;
#X connect 25 0 27 0;
#X connect 26 0 27 1;
#X connect 27 0 30 1;
#X connect 28 0 29 0;
#X connect 29 0 26 0;
#X connect 30 0 5 0;
#X connect 30 0 0 0;
#X connect 36 0 35 0;
#X connect 36 0 35 1;
#X connect 38 0 37 1;
#X connect 39 0 37 2;
#X connect 45 0 36 0;
#X connect 45 0 37 0;
#N canvas 60 64 790 527 12;
#X obj 122 381 cos~;
#X floatatom 173 184 4 0 200 0 - - -;
#X obj 173 207 / 10;
#X text 173 103 center;
#X text 173 123 freq. (in;
#X text 173 143 tenths of;
#X text 173 163 fundamental);
#X floatatom 70 192 4 0 0 0 - - -;
#X text 46 145 fundamental;
#X text 46 165 (= mod freq);
#X text 251 208 index;
#X text 251 228 (percent);
#X floatatom 251 249 4 0 500 0 - - -;
#X obj 251 318 line~;
#X obj 201 338 *~;
#X obj 251 272 / 100;
#X obj 251 295 pack 0 50;
#X obj 122 358 +~;
#X text 204 364 modulating;
#X text 209 381 oscillator;
#X obj 123 459 output~;
#X obj 122 428 hip~;
#N canvas 122 211 558 609 fft 0;
#X obj 23 55 inlet~;
#X obj 210 303 inlet;
#X obj 27 215 rfft~;
#X obj 27 248 *~;
#X obj 58 248 *~;
#X obj 27 278 sqrt~;
#X obj 334 200 block~ 4096 1;
#X obj 27 304 biquad~ 0 0 0 0 1;
#X text 91 216 Fourier series;
#X text 96 269 magnitude;
#X text 94 254 calculate;
#X text 21 3 This subpatch computes the spectrum of the incoming signal
with a (rectangular windowed) FFT. FFTs aren't properly introduced
until much later.;
#X text 83 61 signal to analyze;
#X text 195 255 delay two samples;
#X text 193 273 for better graphing;
#X obj 292 79 samplerate~;
#X obj 240 352 metro 500;
#X obj 240 329 inlet;
#X text 293 327 toggle to graph repeatedly;
#X text 264 303 bang to graph once;
#X obj 27 328 /~ 4096;
#X obj 292 54 bang~;
#X msg 211 413 \; pd dsp 1;
#X obj 292 102 / 4096;
#X obj 58 135 osc~;
#X obj 58 163 +~ 1;
#X obj 28 188 *~;
#X text 113 138 hanning window;
#X obj 254 79 0.5;
#X obj 240 390 tabwrite~ F11-spectrum;
#X connect 0 0 26 0;
#X connect 1 0 22 0;
#X connect 1 0 29 0;
#X connect 2 0 3 0;
#X connect 2 0 3 1;
#X connect 2 1 4 0;
#X connect 2 1 4 1;
#X connect 3 0 5 0;
#X connect 4 0 5 0;
#X connect 5 0 7 0;
#X connect 7 0 20 0;
#X connect 15 0 23 0;
#X connect 16 0 29 0;
#X connect 17 0 16 0;
#X connect 17 0 22 0;
#X connect 20 0 29 0;
#X connect 21 0 15 0;
#X connect 21 0 28 0;
#X connect 23 0 24 0;
#X connect 24 0 25 0;
#X connect 25 0 26 1;
#X connect 26 0 2 0;
#X connect 28 0 24 1;
#X restore 176 428 pd fft;
#X obj 236 407 bng 18 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 236 428 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X text 257 427 <-- repeatedly;
#X text 258 407 <-- graph once;
#X text 530 479 updated for Pd version 0.37;
#N canvas 0 0 450 300 graph1 0;
#X array F11-spectrum 259 float 0;
#X coords 0 0.51 258 -0.008 256 130 1;
#X restore 514 291 graph;
#X text 506 422 0;
#X text 568 432 -- frequency --;
#X text 743 427 2700;
#X obj 173 256 *;
#X obj 173 233 t b f;
#X obj 201 315 osc~;
#X obj 122 322 phasor~;
#X text 31 30 Here's what happens if you just slide the carrier frequency
around. The spectrum moves up and down all right \, but is only periodic
at the original period when the center frequency roosts on a harmonic.
;
#X text 50 308 carrier;
#X text 24 325 oscillator;
#X text 167 6 HOW NOT TO APPLY TWO-COSINE CARRIER TO FM;
#X connect 0 0 21 0;
#X connect 0 0 22 0;
#X connect 1 0 2 0;
#X connect 2 0 33 0;
#X connect 7 0 32 0;
#X connect 7 0 34 0;
#X connect 12 0 15 0;
#X connect 13 0 14 1;
#X connect 14 0 17 1;
#X connect 15 0 16 0;
#X connect 16 0 13 0;
#X connect 17 0 0 0;
#X connect 21 0 20 0;
#X connect 21 0 20 1;
#X connect 23 0 22 1;
#X connect 24 0 22 2;
#X connect 32 0 35 0;
#X connect 33 0 32 0;
#X connect 33 1 32 1;
#X connect 34 0 14 0;
#X connect 35 0 17 0;
#N canvas 262 0 692 819 12;
#X obj 38 593 cos~;
#X obj 38 570 *~;
#X obj 81 593 cos~;
#X obj 137 527 wrap~;
#X obj 101 527 -~;
#X obj 81 570 +~;
#X obj 74 623 -~;
#X obj 94 655 *~;
#X obj 56 655 +~;
#X obj 100 500 samphold~;
#X floatatom 159 378 4 0 500 0 - - -;
#X obj 159 401 / 10;
#X text 157 311 center;
#X obj 159 449 line~;
#X text 157 359 fundamental);
#X obj 159 426 pack 0 50;
#X obj 39 446 phasor~;
#X floatatom 39 425 4 0 0 0 - - -;
#X text 19 398 fundamental;
#X text 303 460 index;
#X text 303 477 (percent);
#X floatatom 303 498 4 0 500 0 - - -;
#X obj 303 544 line~;
#X obj 224 564 *~;
#X obj 303 521 pack 0 50;
#N canvas 0 0 450 300 graph4 0;
#X array bell-curve 200 float 1;
#A 0 1.12535e-07 1.54727e-07 2.12059e-07 2.89706e-07 3.94519e-07 5.35535e-07
7.24633e-07 9.77371e-07 1.31404e-06 1.76105e-06 2.35258e-06 3.13275e-06
4.15832e-06 5.50199e-06 7.25659e-06 9.54016e-06 1.25023e-05 1.63317e-05
2.1266e-05 2.76026e-05 3.57128e-05 4.60584e-05 5.92113e-05 7.58768e-05
9.69224e-05 0.00012341 0.000156634 0.000198167 0.000249912 0.000314163
0.000393669 0.000491721 0.000612231 0.000759842 0.000940028 0.00115923
0.00142498 0.00174605 0.00213263 0.00259648 0.00315111 0.00381201 0.00459678
0.0055254 0.0066204 0.00790705 0.0094136 0.0111714 0.013215 0.0155826
0.0183156 0.0214592 0.0250621 0.0291763 0.0338573 0.0391639 0.0451575
0.0519019 0.0594631 0.0679081 0.0773047 0.0877205 0.0992216 0.111872
0.125732 0.140858 0.1573 0.1751 0.194291 0.214896 0.236928 0.260383
0.285247 0.311486 0.339053 0.367879 0.397882 0.428956 0.46098 0.493812
0.527292 0.561244 0.595473 0.62977 0.663916 0.697676 0.730811 0.763074
0.794216 0.823987 0.852144 0.878447 0.902668 0.924595 0.944027 0.960789
0.974725 0.985703 0.99362 0.998401 1 0.998401 0.99362 0.985703 0.974725
0.960789 0.944027 0.924595 0.902668 0.878447 0.852144 0.823987 0.794216
0.763074 0.730811 0.697676 0.663916 0.62977 0.595473 0.561244 0.527292
0.493812 0.46098 0.428956 0.397882 0.367879 0.339053 0.311486 0.285247
0.260383 0.236928 0.214896 0.194291 0.1751 0.1573 0.140858 0.125732
0.111872 0.0992216 0.0877205 0.0773047 0.0679081 0.0594631 0.0519019
0.0451575 0.0391639 0.0338573 0.0291763 0.0250621 0.0214592 0.0183156
0.0155826 0.013215 0.0111714 0.0094136 0.00790705 0.0066204 0.0055254
0.00459678 0.00381201 0.00315111 0.00259648 0.00213263 0.00174605 0.00142498
0.00115923 0.000940028 0.000759842 0.000612231 0.000491721 0.000393669
0.000314163 0.000249912 0.000198167 0.000156634 0.00012341 9.69224e-05
7.58768e-05 5.92113e-05 4.60584e-05 3.57128e-05 2.76026e-05 2.1266e-05
1.63317e-05 1.25023e-05 9.54016e-06 7.25659e-06 5.50199e-06 4.15832e-06
3.13275e-06 2.35258e-06 1.76105e-06 1.31404e-06 9.77371e-07 7.24633e-07
5.35535e-07 3.94519e-07 2.89706e-07 2.12059e-07 1.54727e-07;
#X coords 0 1 199 0 200 140 1;
#X restore 443 555 graph;
#N canvas 94 264 600 388 make-table 0;
#X msg 81 44 bang;
#X obj 81 73 t b b;
#X obj 159 142 f;
#X obj 197 142 + 1;
#X msg 175 112 0;
#X obj 81 102 until;
#X obj 161 177 t f f;
#X obj 76 306 tabwrite bell-curve;
#X obj 52 270 expr exp(-$f1*$f1);
#X obj 63 168 sel 199;
#X obj 51 241 expr ($f1-100)/25;
#X connect 0 0 1 0;
#X connect 1 0 5 0;
#X connect 1 1 4 0;
#X connect 2 0 3 0;
#X connect 2 0 6 0;
#X connect 2 0 9 0;
#X connect 3 0 2 1;
#X connect 4 0 2 1;
#X connect 5 0 2 0;
#X connect 6 0 10 0;
#X connect 6 1 7 1;
#X connect 8 0 7 0;
#X connect 9 0 5 1;
#X connect 10 0 8 0;
#X restore 507 515 pd make-table;
#X obj 224 541 cos~;
#X obj 224 518 -~ 0.25;
#X obj 224 587 +~ 100;
#X obj 224 610 tabread4~ bell-curve;
#X obj 95 684 *~;
#X text 131 682 <--ring mod step;
#X text 256 635 waveshaper;
#X text 425 791 updated for Pd version 0.37;
#X text 157 326 frequency;
#X text 157 342 (tenths of;
#X text 441 698 0;
#X text 632 697 200;
#N canvas 0 0 450 300 graph1 0;
#X array F12-spectrum 259 float 0;
#X coords 0 0.51 258 -0.008 256 130 1;
#X restore 421 308 graph;
#X text 418 440 0;
#X text 475 444 -- frequency --;
#X text 644 441 2700;
#X obj 95 756 output~;
#X obj 94 725 hip~;
#N canvas 122 211 558 609 fft 0;
#X obj 23 55 inlet~;
#X obj 210 303 inlet;
#X obj 27 215 rfft~;
#X obj 27 248 *~;
#X obj 58 248 *~;
#X obj 27 278 sqrt~;
#X obj 334 200 block~ 4096 1;
#X obj 27 304 biquad~ 0 0 0 0 1;
#X text 91 216 Fourier series;
#X text 96 269 magnitude;
#X text 94 254 calculate;
#X text 21 3 This subpatch computes the spectrum of the incoming signal
with a (rectangular windowed) FFT. FFTs aren't properly introduced
until much later.;
#X text 83 61 signal to analyze;
#X text 195 255 delay two samples;
#X text 193 273 for better graphing;
#X obj 292 79 samplerate~;
#X obj 240 352 metro 500;
#X obj 240 329 inlet;
#X text 293 327 toggle to graph repeatedly;
#X text 264 303 bang to graph once;
#X obj 27 328 /~ 4096;
#X obj 292 54 bang~;
#X msg 211 413 \; pd dsp 1;
#X obj 292 102 / 4096;
#X obj 58 135 osc~;
#X obj 58 163 +~ 1;
#X obj 28 188 *~;
#X text 113 138 hanning window;
#X obj 254 79 0.5;
#X obj 240 390 tabwrite~ F12-spectrum;
#X connect 0 0 26 0;
#X connect 1 0 22 0;
#X connect 1 0 29 0;
#X connect 2 0 3 0;
#X connect 2 0 3 1;
#X connect 2 1 4 0;
#X connect 2 1 4 1;
#X connect 3 0 5 0;
#X connect 4 0 5 0;
#X connect 5 0 7 0;
#X connect 7 0 20 0;
#X connect 15 0 23 0;
#X connect 16 0 29 0;
#X connect 17 0 16 0;
#X connect 17 0 22 0;
#X connect 20 0 29 0;
#X connect 21 0 15 0;
#X connect 21 0 28 0;
#X connect 23 0 24 0;
#X connect 24 0 25 0;
#X connect 25 0 26 1;
#X connect 26 0 2 0;
#X connect 28 0 24 1;
#X restore 148 725 pd fft;
#X obj 208 704 bng 18 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 208 725 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#X text 229 724 <-- repeatedly;
#X text 230 704 <-- graph once;
#X text 17 21 Instead of using the two cosines as FM carrier oscillators
\, we can use them as ring modulators for a natural or synthetic tone.
Here we use waveshaping - to wit \, a sinusoid looking up a Gaussian
bell curve. This has the nice properties that the partials are always
positive cosines in phase \, and the spectrum spreads out smoothly
as the index changes.;
#X text 98 1 PAF: TWO-COSINE RING MODULATOR FOR WAVESHAPER;
#X text 17 253 Then with ~* we do the ring modulation and we're done.
This is the PAF (phase-aligned formant) synthesis algorithm (patented
1993 by IRCAM).;
#X obj 224 492 *~ 0.5;
#X text 17 129 For phase coherency \, the waveshaper and the cosine
pair are driven from the same phasor~ object. Since the waveshaping
is done using a symmetric curve \, its output is at double the frequency
of the input. So for each cycle of the phasor we compute a half-cycle
of the sine function (by multiplying by 0.5 and subtracting 0.25 before
the cosine lookup). We center the cosine output for lookup in a 200-point
table containing a bell curve.;
#X connect 0 0 6 1;
#X connect 0 0 8 0;
#X connect 1 0 5 0;
#X connect 1 0 0 0;
#X connect 2 0 6 0;