diff options
Diffstat (limited to 'pd/doc/4.fft.examples')
-rw-r--r-- | pd/doc/4.fft.examples/00.INTRO.txt | 65 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/01.fftanalysis.pd | 143 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/02.noisefft.pd | 267 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/03.denoise.pd | 364 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/04.shifts.pd | 27 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/05.sheepgoat.pd | 395 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/06.sheepgoat2.pd | 365 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/07.tinbell.pd | 248 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/08.convobros.pd | 344 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/09.pvoc.pd | 397 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/10.phaselockedvoc.pd | 444 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/11.pianorev.pd | 378 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/12.sinedecomposer.pd | 308 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/13.partialtracer.pd | 783 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/14.waveformgrab.pd | 385 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/add-trace.pd | 152 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/osc-voice.pd | 54 | ||||
-rw-r--r-- | pd/doc/4.fft.examples/x.wav | bin | 0 -> 8864 bytes |
18 files changed, 5119 insertions, 0 deletions
diff --git a/pd/doc/4.fft.examples/00.INTRO.txt b/pd/doc/4.fft.examples/00.INTRO.txt new file mode 100644 index 00000000..b5218793 --- /dev/null +++ b/pd/doc/4.fft.examples/00.INTRO.txt @@ -0,0 +1,65 @@ +These patches demonstrate how to use Pd's short-time Fourier transform objects, +rfft~ and rifft~, to do a variety of things. The patches can be quite +expensive; the phase vocoder, for instance, requires a 300MHz Pentium 2 to run +at 44100 Hz. By default Pd runs at 44100 Hz, but you can specify a different +sample rate on the command line, for instance: + +pd -r 16000 09.pvoc.pd + +On SGI, Pd will check whether your audio system is running at the correct +sample rate and will print out a warning if not. In NT or W95, Pd's behavior +will depend on your audio driver. In Linux Pd usually tries to set the rate +of the conversion hardware. + +Included in this directory are: + +01.fftanalysis.pd -- does a windowed FFT analysis and resynthesis of a sine +tone, showing how to specify block size and overlap. + +02.noisefft.pd -- Fourier analysis of white noise. This patch also shows how +you can average power spectra over time. + +03.denoise.pd -- using the technique from the previous patch, finds the noise +floor in a recorded sample and attempts to scrub it away. + +04.shifts.pd -- tests the leftshift and rightshift "externs" used in the next +patch. + +05.sheepgoat.pd -- tries to discriminate between "pitched" and "unpitched" +components of a sound. + +06.sheepgoat2.pd -- another attempt at the same thing. + +07.tinbell.pd -- a spectral flattener, which can make the sound of a large bell +turn into the sound of a tamtam. + +08.convobros.pd -- spectral cross synthesis between two sounds + +09.pvoc.pd -- phase vocoder + +---------- after this point, the patches haven't been cleaned up ----------- + +10.phaselockedvoc.pd -- phase locked vocoder; see Laroche&Dolson in ICMC97 for +a discussion of something that works better than this. + +11.pianorev.pd -- an attempt at a phase-coherent reverberation algorithm to +imitate the "piano reverb" obtained by putting a speaker under the sound board +of a piano and picking up the sympathetic vibrations. + +12.sinedecomposer.pd -- estimate the frequencies and amplitudes of the +components of a sound + +13.tracemaker.pd -- show how to use Pd to combine snapshots of a spectrum into +continuous spectral traces. + +14.partialtracer.pd -- sinusoidal analysis/resynthesis of a time-verying sound. + +15.waveformgrab.pd -- bash a sample into phase-coherent windows and make a +pitched resynthesis. + + + + + + + diff --git a/pd/doc/4.fft.examples/01.fftanalysis.pd b/pd/doc/4.fft.examples/01.fftanalysis.pd new file mode 100644 index 00000000..9b5e1e4c --- /dev/null +++ b/pd/doc/4.fft.examples/01.fftanalysis.pd @@ -0,0 +1,143 @@ +#N canvas 11 0 944 595 12; +#X text 60 368 frequency; +#X obj 20 238 tabwrite~ array2; +#X msg 141 117 0; +#N canvas 245 0 864 679 fft-analysis 0; +#X obj 57 75 *~; +#X obj 98 191 *~; +#X graph graph1 0 -1 256 1 397 304 797 4; +#X array array1 256 float 0; +#X pop; +#X graph graph2 0 -1 256 1 397 631 797 331; +#X array array2 256 float 0; +#X pop; +#X obj 57 4 inlet~; +#X obj 57 192 *~; +#X obj 57 310 tabsend~ array1; +#X msg 442 673 \; array1 resize 256 \; array2 resize 256; +#X obj 76 48 tabreceive~ array2; +#X obj 57 136 rfft~; +#X obj 57 222 rifft~; +#X obj 80 283 outlet~; +#X obj 229 216 print~; +#X msg 229 188 bang; +#X obj 94 632 block~ 256 2; +#X text 82 30 Hanning window; +#X text 61 106 forward real FFT; +#X text 74 243 inverse real FFT; +#X text 121 126 renormalize by 1/256; +#X obj 120 144 sig~ 0.0039; +#X connect 0 0 9 0; +#X connect 1 0 10 1; +#X connect 4 0 0 0; +#X connect 5 0 10 0; +#X connect 8 0 0 1; +#X connect 9 0 5 0; +#X connect 9 0 12 0; +#X connect 9 1 1 0; +#X connect 10 0 11 0; +#X connect 10 0 6 0; +#X connect 13 0 12 0; +#X connect 19 0 5 1; +#X connect 19 0 1 1; +#X restore 133 430 pd fft-analysis; +#X floatatom 133 379 0 0 0; +#X obj 134 525 dac~; +#X graph graph1 0 -1 256 1 352 461 608 261; +#X array array3 256 float 0; +#X pop; +#X obj 141 462 tabwrite~ array3; +#X msg 77 442 bang; +#X obj 133 324 * 44100; +#X obj 133 352 / 256; +#X floatatom 133 298 0 0 0; +#X text 71 165 sample rate / 256; +#X text 17 23 CLICK HERE TO; +#X text 15 41 CALCULATE HANNING; +#X text 14 58 WINDOW TABLE; +#X msg 20 79 bang \; pd dsp 1; +#X text 40 289 frequency; +#X text 50 305 in bins; +#X text 62 385 in Hz.; +#X text 14 440 scope; +#X text 236 23 A patch to test the rfft~ and rifft~ modules. An incoming +sine wave is Hanning windowed and transformed. The inverse transform +is then output.; +#X text 235 70 The block size (256) and overlap (2) are set by the +block~ object in the sub-patch. The output is automatically overlap-added +by the outlet~ object.; +#X floatatom 778 111 0 0 0; +#N canvas 194 37 397 591 output 0; +#X obj 72 249 t b; +#X obj 72 173 f; +#X obj 73 89 inlet; +#X text 86 54 mute; +#X obj 72 280 f; +#X msg 149 292 0; +#X msg 72 125 bang; +#X obj 73 197 moses 1; +#X obj 149 263 t b f; +#X obj 109 543 outlet; +#X msg 108 503 set \$1; +#X obj 92 337 s master-amp; +#X obj 206 153 r master-amp; +#X obj 107 424 r master-amp; +#X obj 206 186 moses 1; +#X obj 249 494 dbtorms; +#X obj 251 520 pack 0 100; +#X obj 252 548 s master-out; +#X connect 0 0 4 0; +#X connect 1 0 7 0; +#X connect 2 0 6 0; +#X connect 4 0 11 0; +#X connect 5 0 11 0; +#X connect 6 0 1 0; +#X connect 7 0 0 0; +#X connect 7 1 8 0; +#X connect 8 0 5 0; +#X connect 10 0 9 0; +#X connect 12 0 1 1; +#X connect 12 0 14 0; +#X connect 13 0 10 0; +#X connect 13 0 15 0; +#X connect 14 1 4 1; +#X connect 15 0 16 0; +#X connect 16 0 17 0; +#X restore 778 83 pd output; +#X msg 778 55 mute; +#X text 821 115 AMPLITUDE; +#X obj 778 142 s master-amp; +#X obj 191 522 line~; +#X obj 134 495 *~; +#X text 236 124 You can close the sub-patch if table updates are interfering +with your audio output.; +#X obj 191 495 r master-out; +#X obj 36 166 osc~; +#X obj 35 118 samplerate~; +#X obj 36 142 / 256; +#X obj 36 189 *~ -0.5; +#X obj 36 209 +~ 0.5; +#X obj 133 405 osc~; +#X connect 2 0 32 1; +#X connect 3 0 7 0; +#X connect 3 0 29 0; +#X connect 4 0 37 0; +#X connect 8 0 7 0; +#X connect 9 0 10 0; +#X connect 10 0 4 0; +#X connect 11 0 9 0; +#X connect 16 0 1 0; +#X connect 16 0 2 0; +#X connect 16 0 33 0; +#X connect 23 0 27 0; +#X connect 24 0 23 0; +#X connect 25 0 24 0; +#X connect 28 0 29 1; +#X connect 29 0 5 0; +#X connect 31 0 28 0; +#X connect 32 0 35 0; +#X connect 33 0 34 0; +#X connect 34 0 32 0; +#X connect 35 0 36 0; +#X connect 36 0 1 0; +#X connect 37 0 3 0; diff --git a/pd/doc/4.fft.examples/02.noisefft.pd b/pd/doc/4.fft.examples/02.noisefft.pd new file mode 100644 index 00000000..65b4d92f --- /dev/null +++ b/pd/doc/4.fft.examples/02.noisefft.pd @@ -0,0 +1,267 @@ +#N canvas 24 0 884 580 12; +#X obj 279 320 sig~; +#X obj 187 375 *~; +#X floatatom 279 274 0 0 0; +#X floatatom 183 273 0 0 0; +#X obj 183 319 sig~; +#X text 10 246 frequency; +#N canvas 45 63 925 609 fft-analysis 0; +#X obj 241 228 + 1; +#X msg 313 322 0; +#X obj 127 190 *~; +#X obj 38 69 *~; +#X obj 37 38 *~; +#X obj 72 436 *~; +#X graph graph1 0 0 1024 1 476 244 876 44; +#X array fftout 1024 float 0; +#X pop; +#X obj 37 4 inlet~; +#X obj 37 436 *~; +#X obj 94 271 tabsend~ fftout; +#X obj 76 38 tabreceive~ hanning; +#X obj 38 116 rfft~; +#X obj 37 461 rifft~; +#X obj 37 517 outlet~; +#X text 88 21 Hanning window; +#X text 31 94 forward real FFT; +#X text 52 479 inverse real FFT; +#X obj 36 555 block~ 1024 2; +#X obj 72 69 sig~ 0.03125; +#X graph graph1 0 0 1024 1 476 554 876 354; +#X array mask 1024 float 0; +#X pop; +#X obj 94 190 *~; +#X obj 94 214 +~; +#X floatatom 241 253 0 0 0; +#X msg 247 105 0; +#X obj 175 184 float; +#X obj 226 184 + 1; +#X obj 175 123 bang~; +#X obj 175 148 spigot; +#X floatatom 303 86 0 0 0; +#X obj 101 314 tabreceive~ mask; +#X obj 241 277 t b b f; +#X obj 266 322 /; +#X msg 266 298 1; +#X obj 78 344 -~; +#X obj 266 358 sig~; +#X obj 313 298 sel 0; +#X obj 247 388 *~; +#X obj 212 419 +~; +#X obj 227 446 tabsend~ mask; +#X floatatom 313 358 0 0 0; +#X obj 175 209 t f f; +#X text 100 231 power is square; +#X text 100 245 modulus of FFT; +#X obj 303 36 loadbang; +#X obj 298 181 <; +#X msg 253 36 bang; +#X text 237 11 click to make an average; +#X obj 91 408 sig~ 0.03125; +#X text 574 249 power spectrum of this window; +#X text 338 70 Set the number; +#X text 340 85 of frames to; +#X text 342 101 average; +#X text 593 573 average power spectrum; +#X text 272 253 current frame; +#X text 284 378 weight of new; +#X text 275 391 frame in moving; +#X text 304 404 average; +#X msg 303 61 100; +#X connect 0 0 22 0; +#X connect 1 0 34 0; +#X connect 1 0 39 0; +#X connect 2 0 21 1; +#X connect 3 0 11 0; +#X connect 4 0 3 0; +#X connect 5 0 12 1; +#X connect 7 0 4 0; +#X connect 8 0 12 0; +#X connect 10 0 4 1; +#X connect 11 0 8 0; +#X connect 11 0 20 0; +#X connect 11 0 20 1; +#X connect 11 1 5 0; +#X connect 11 1 2 0; +#X connect 11 1 2 1; +#X connect 12 0 13 0; +#X connect 18 0 3 1; +#X connect 20 0 21 0; +#X connect 21 0 9 0; +#X connect 21 0 33 0; +#X connect 22 0 30 0; +#X connect 23 0 24 1; +#X connect 23 0 44 0; +#X connect 24 0 40 0; +#X connect 24 0 25 0; +#X connect 25 0 24 1; +#X connect 26 0 27 0; +#X connect 27 0 24 0; +#X connect 28 0 44 1; +#X connect 29 0 33 1; +#X connect 29 0 37 1; +#X connect 30 1 32 0; +#X connect 30 2 31 1; +#X connect 31 0 34 0; +#X connect 31 0 39 0; +#X connect 32 0 31 0; +#X connect 33 0 36 0; +#X connect 34 0 36 1; +#X connect 35 0 1 0; +#X connect 36 0 37 0; +#X connect 37 0 38 0; +#X connect 40 0 44 0; +#X connect 40 1 0 0; +#X connect 43 0 57 0; +#X connect 44 0 27 1; +#X connect 44 0 35 0; +#X connect 45 0 23 0; +#X connect 47 0 8 1; +#X connect 47 0 5 1; +#X connect 57 0 28 0; +#X restore 99 412 pd fft-analysis; +#X obj 99 275 sig~; +#X obj 99 297 phasor~; +#X obj 99 319 cos~; +#X floatatom 99 253 0 0 0; +#X graph graph1 0 -1 1024 1 431 525 687 325; +#X array scope 1024 float 0; +#X pop; +#X obj 105 439 tabwrite~ scope; +#X msg 49 418 bang; +#X obj 99 230 / 256; +#X floatatom 98 165 0 0 0; +#X text 10 155 frequency; +#X text 21 175 in bins; +#X text 16 259 in Hz.; +#X text 42 398 scope; +#N canvas 84 23 767 580 hanning-window 0; +#X obj 92 198 phasor~; +#X obj 92 234 cos~; +#X obj 23 328 tabwrite~ hanning; +#X obj 30 252 -~; +#X obj 28 218 sig~ 1; +#X msg 37 171 0; +#X text 48 59 CALCULATE HANNING; +#X text 45 71 WINDOW TABLE; +#X graph graph1 0 -1 1024 1 290 509 690 209; +#X array hanning 1024 float 0; +#X pop; +#X msg 290 521 \; hanning resize 1024; +#X obj 114 145 / 1024; +#X obj 114 168 sig~; +#X text 175 148 sample rate / window size; +#X msg 23 94 bang; +#X obj 66 269 sig~ 0.5; +#X obj 49 300 *~; +#X obj 22 38 loadbang; +#X obj 113 117 samplerate~; +#X connect 0 0 1 0; +#X connect 1 0 3 1; +#X connect 3 0 15 0; +#X connect 4 0 3 0; +#X connect 5 0 0 1; +#X connect 10 0 11 0; +#X connect 11 0 0 0; +#X connect 13 0 2 0; +#X connect 13 0 5 0; +#X connect 13 0 17 0; +#X connect 14 0 15 1; +#X connect 15 0 2 0; +#X connect 16 0 13 0; +#X connect 17 0 10 0; +#X restore 328 203 pd hanning-window; +#X obj 99 346 *~; +#X text 177 250 oscillator; +#X obj 166 349 noise~; +#X text 278 249 noise; +#X obj 99 374 +~; +#X text 214 232 amplitudes; +#X msg 26 84 \; pd dsp 1; +#X obj 98 207 *; +#X obj 135 181 loadbang; +#X obj 135 205 samplerate~; +#X text 22 51 CLICK HERE; +#X floatatom 673 67 0 0 0; +#N canvas 194 37 397 591 output 0; +#X obj 61 212 t b; +#X obj 61 147 f; +#X obj 62 76 inlet; +#X text 73 46 mute; +#X obj 61 238 f; +#X msg 127 248 0; +#X msg 61 106 bang; +#X obj 62 167 moses 1; +#X obj 127 224 t b f; +#X obj 93 462 outlet; +#X msg 92 428 set \$1; +#X obj 78 286 s master-amp; +#X obj 175 130 r master-amp; +#X obj 91 360 r master-amp; +#X obj 175 158 moses 1; +#X obj 212 420 dbtorms; +#X obj 213 442 pack 0 100; +#X obj 214 466 s master-out; +#X connect 0 0 4 0; +#X connect 1 0 7 0; +#X connect 2 0 6 0; +#X connect 4 0 11 0; +#X connect 5 0 11 0; +#X connect 6 0 1 0; +#X connect 7 0 0 0; +#X connect 7 1 8 0; +#X connect 8 0 5 0; +#X connect 10 0 9 0; +#X connect 12 0 1 1; +#X connect 12 0 14 0; +#X connect 13 0 10 0; +#X connect 13 0 15 0; +#X connect 14 1 4 1; +#X connect 15 0 16 0; +#X connect 16 0 17 0; +#X restore 673 43 pd output; +#X msg 673 19 mute; +#X text 710 70 AMPLITUDE; +#X obj 673 93 s master-amp; +#X text 241 9 NOISE FLOOR MEASUREMENT; +#X text 149 31 This patch shows how you can average the RMS spectra +of many windows of an incoming "noise floor" signal to estimate its +spectrum. We'll use this in the "denoiser" patch \, next.; +#X text 30 65 TO START; +#X obj 99 515 dac~; +#X obj 132 467 r master-out; +#X text 148 100 The controls below let you send a mixture of a sine +wave and white noise. The analysis is done in a subwindow.; +#X obj 132 490 line~; +#X obj 99 490 *~; +#X obj 183 295 dbtorms; +#X obj 279 297 dbtorms; +#X connect 0 0 1 1; +#X connect 1 0 25 1; +#X connect 2 0 46 0; +#X connect 3 0 45 0; +#X connect 4 0 21 1; +#X connect 6 0 12 0; +#X connect 6 0 44 0; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X connect 9 0 21 0; +#X connect 10 0 7 0; +#X connect 13 0 12 0; +#X connect 14 0 10 0; +#X connect 15 0 28 0; +#X connect 21 0 25 0; +#X connect 23 0 1 0; +#X connect 25 0 6 0; +#X connect 28 0 14 0; +#X connect 29 0 30 0; +#X connect 30 0 28 1; +#X connect 32 0 36 0; +#X connect 33 0 32 0; +#X connect 34 0 33 0; +#X connect 41 0 43 0; +#X connect 43 0 44 1; +#X connect 44 0 40 0; +#X connect 44 0 40 1; +#X connect 45 0 4 0; +#X connect 46 0 0 0; diff --git a/pd/doc/4.fft.examples/03.denoise.pd b/pd/doc/4.fft.examples/03.denoise.pd new file mode 100644 index 00000000..09e1244e --- /dev/null +++ b/pd/doc/4.fft.examples/03.denoise.pd @@ -0,0 +1,364 @@ +#N canvas 54 36 882 556 12; +#X floatatom 306 344; +#X floatatom 68 337; +#N canvas 72 0 896 679 fft-analysis 0; +#X obj 140 447 *~; +#X obj 54 705 *~; +#X obj 139 612 *~; +#X floatatom 206 267; +#X obj 185 349 *~; +#X obj 356 188 + 1; +#X msg 447 257 0; +#X obj 173 181 *~; +#X obj 57 89 *~; +#X obj 95 641 *~; +#X obj 57 49 inlet~; +#X obj 54 642 *~; +#X obj 126 68 tabreceive~ hanning; +#X obj 57 136 rfft~; +#X obj 54 672 rifft~; +#X obj 55 743 outlet~; +#X text 132 50 Hanning window; +#X text 63 115 forward real FFT; +#X text 72 721 inverse real FFT; +#X graph graph1 0 0 1024 20 491 631 891 331; +#X array mask 1024 float; +#X pop; +#X obj 134 180 *~; +#X obj 134 209 +~; +#X msg 447 132 0; +#X obj 317 129 float; +#X obj 377 149 + 1; +#X obj 318 72 bang~; +#X obj 318 101 spigot; +#X obj 449 186 < 10; +#X floatatom 497 185; +#X obj 256 306 tabreceive~ mask; +#X obj 357 267 /; +#X msg 357 237 1; +#X obj 230 350 -~; +#X obj 370 331 sig~; +#X obj 447 232 sel 0; +#X obj 348 356 *~; +#X obj 331 387 +~; +#X obj 330 412 tabsend~ mask; +#X floatatom 448 287; +#X obj 316 156 t f f; +#X obj 446 56 r make-mask; +#X obj 206 296 sig~; +#X obj 206 241 r mask-level; +#X obj 140 414 /~; +#X obj 356 212 t b f; +#X obj 177 612 sig~ 0.001; +#X obj 29 781 block~ 1024 4; +#X obj 663 76 r window-size; +#X obj 447 84 t b f; +#X obj 676 137 t b f; +#X obj 663 171 /; +#X obj 661 194 * 250; +#X text 728 202 hop size in msec; +#X obj 497 107 /; +#X text 497 206 number of; +#X text 505 221 frames; +#X text 439 12 calculate a mask using N msec of; +#X text 438 30 background noise; +#X obj 176 415 sig~ 1e-20; +#X text 152 467 multiply the signal by the; +#X text 153 485 quantity s/(s+m) where "s"; +#X text 152 505 is signal power and "m" is mask.; +#X text 153 527 The multiplier is close to 1 if; +#X text 155 549 s>>m \, but close to 0 if s<<m.; +#X text 157 572 We gratuitously square it.; +#X floatatom 657 237; +#X obj 699 109 r srate; +#X connect 0 0 2 0; +#X connect 1 0 15 0; +#X connect 2 0 11 1; +#X connect 2 0 9 1; +#X connect 3 0 41 0; +#X connect 4 0 43 1; +#X connect 5 0 44 0; +#X connect 6 0 38 0; +#X connect 7 0 21 1; +#X connect 8 0 13 0; +#X connect 9 0 14 1; +#X connect 10 0 8 0; +#X connect 11 0 14 0; +#X connect 12 0 8 1; +#X connect 12 0 1 1; +#X connect 13 0 11 0; +#X connect 13 0 20 0; +#X connect 13 0 20 1; +#X connect 13 1 9 0; +#X connect 13 1 7 0; +#X connect 13 1 7 1; +#X connect 14 0 1 0; +#X connect 20 0 21 0; +#X connect 21 0 32 0; +#X connect 21 0 43 0; +#X connect 21 0 43 1; +#X connect 22 0 23 1; +#X connect 22 0 27 0; +#X connect 23 0 39 0; +#X connect 23 0 24 0; +#X connect 24 0 23 1; +#X connect 25 0 26 0; +#X connect 26 0 23 0; +#X connect 27 0 26 1; +#X connect 27 0 34 0; +#X connect 28 0 27 1; +#X connect 29 0 32 1; +#X connect 29 0 4 0; +#X connect 29 0 36 0; +#X connect 30 0 38 0; +#X connect 31 0 30 0; +#X connect 32 0 35 0; +#X connect 33 0 35 1; +#X connect 34 0 6 0; +#X connect 35 0 36 1; +#X connect 36 0 37 0; +#X connect 38 0 33 0; +#X connect 39 0 27 0; +#X connect 39 1 5 0; +#X connect 40 0 48 0; +#X connect 41 0 4 1; +#X connect 42 0 3 0; +#X connect 43 0 0 0; +#X connect 43 0 0 1; +#X connect 44 0 31 0; +#X connect 44 1 30 1; +#X connect 45 0 2 1; +#X connect 47 0 50 0; +#X connect 48 0 22 0; +#X connect 48 1 53 0; +#X connect 49 0 50 0; +#X connect 49 1 50 1; +#X connect 50 0 51 0; +#X connect 51 0 53 1; +#X connect 51 0 65 0; +#X connect 53 0 28 0; +#X connect 58 0 43 1; +#X connect 66 0 49 0; +#X restore 67 412 pd fft-analysis; +#X obj 67 470 dac~; +#N canvas 99 31 767 592 hanning-window 0; +#X obj 108 242 phasor~; +#X obj 108 275 cos~; +#X obj 27 386 tabwrite~ hanning; +#X obj 35 297 -~; +#X obj 33 257 sig~ 1; +#X msg 44 212 0; +#X text 166 16 CALCULATE HANNING; +#X text 166 32 WINDOW TABLE; +#X graph graph1 0 -1 1024 1 308 538 708 238; +#X array hanning 1024 float; +#X pop; +#X msg 308 550 \; hanning resize 1024; +#X obj 109 154 / 1024; +#X obj 109 201 sig~; +#X text 206 174 sample rate / window size; +#X msg 27 169 bang; +#X obj 78 316 sig~ 0.5; +#X obj 58 353 *~; +#X obj 79 113 samplerate~; +#X obj 29 27 r window-size; +#X obj 29 62 t b f; +#X connect 0 0 1 0; +#X connect 1 0 3 1; +#X connect 3 0 15 0; +#X connect 4 0 3 0; +#X connect 5 0 0 1; +#X connect 10 0 11 0; +#X connect 11 0 0 0; +#X connect 13 0 2 0; +#X connect 13 0 5 0; +#X connect 14 0 15 1; +#X connect 15 0 2 0; +#X connect 16 0 10 0; +#X connect 17 0 18 0; +#X connect 18 0 16 0; +#X connect 18 0 13 0; +#X connect 18 1 10 1; +#X restore 459 435 pd hanning-window; +#X text 157 311 noise; +#X text 91 289 amplitudes; +#X obj 476 467 loadbang; +#N canvas 132 255 634 335 insample 0; +#X graph graph1 0 -1 155947 1 200 170 600 20; +#X array sample 155948 float; +#X pop; +#X obj 21 78 r read-sample; +#X obj 21 106 unpack s f; +#X obj 59 134 s insamprate; +#X obj 21 190 soundfiler; +#X msg 21 163 read -resize \$1 sample; +#X obj 21 223 s insamplength; +#X msg 397 219 \; sample resize 220500 \; insamplength 220500; +#X connect 1 0 2 0; +#X connect 2 0 5 0; +#X connect 2 1 3 0; +#X connect 4 0 6 0; +#X connect 5 0 4 0; +#X restore 459 407 pd insample; +#X obj 306 369 s mask-level; +#X obj 119 474 line~; +#X obj 67 442 *~; +#X obj 476 495 samplerate~; +#X obj 476 523 s srate; +#X floatatom 164 338; +#X obj 676 312 hip~ 5; +#X obj 676 284 adc~ 1; +#X msg 749 248 bang; +#X obj 782 284 r srate; +#X obj 749 284 f; +#X obj 749 312 s insamprate; +#X msg 24 209 \; window-size 1024 \; pd dsp 1; +#X obj 676 340 tabwrite~ sample; +#X msg 451 343 \; play-sample 0 5000; +#X floatatom 451 277; +#X floatatom 691 80; +#N canvas 194 37 397 591 output 0; +#X obj 95 230 t b; +#X obj 95 174 f; +#X obj 95 118 inlet; +#X text 101 94 mute; +#X obj 95 258 f; +#X msg 154 284 0; +#X msg 95 146 bang; +#X obj 95 202 moses 1; +#X obj 154 256 t b f; +#X obj 107 490 outlet; +#X msg 107 462 set \$1; +#X obj 228 182 moses 1; +#X obj 249 493 dbtorms; +#X obj 249 521 pack 0 100; +#X obj 228 154 r master-lvl; +#X obj 107 424 r master-lvl; +#X obj 95 315 s master-lvl; +#X obj 249 549 s master-out; +#X connect 0 0 4 0; +#X connect 1 0 7 0; +#X connect 2 0 6 0; +#X connect 4 0 16 0; +#X connect 5 0 16 0; +#X connect 6 0 1 0; +#X connect 7 0 0 0; +#X connect 7 1 8 0; +#X connect 8 0 5 0; +#X connect 10 0 9 0; +#X connect 11 1 4 1; +#X connect 12 0 13 0; +#X connect 13 0 17 0; +#X connect 14 0 1 1; +#X connect 14 0 11 0; +#X connect 15 0 10 0; +#X connect 15 0 12 0; +#X restore 691 52 pd output; +#X msg 691 24 mute; +#X obj 119 446 r master-out; +#X text 734 71 MASTER; +#X text 733 85 LEVEL; +#X obj 691 108 s master-lvl; +#X msg 305 314 6; +#X text 306 291 on; +#X text 351 292 off; +#X text 23 189 click here first; +#X text 301 189 read a sample; +#X text 670 221 record your own sample; +#X text 305 270 masking; +#X text 481 322 play sample back; +#X text 290 5 DENOISER; +#X text 74 22 This patch attempts to scrub the noise floor from a sample in two steps. First using the "make-mask" message (which is caught in the "fft-analysis" window) \, you estimate the background spectrum. Do this while only the background noise is playing.; +#X msg 350 315 0; +#X obj 451 301 metro 2000; +#X msg 201 213 \; read-sample ../sound/bell.aiff 44100; +#N canvas 190 43 534 552 test-signal 0; +#X obj 149 326 tabread4~ sample; +#X obj 149 298 line~; +#X obj 106 162 f; +#X obj 204 137 r insamprate; +#X obj 356 422 *~; +#X obj 151 389 *~; +#X obj 359 290 noise~; +#X obj 151 441 +~; +#X obj 182 390 dbtorms; +#X obj 384 422 dbtorms; +#X obj 182 365 inlet; +#X obj 384 398 inlet; +#X obj 359 375 *~; +#X obj 359 315 bp~ 2000 7; +#X obj 151 499 outlet~; +#X obj 122 109 r insamplength; +#X msg 149 274 0 \, \$1 \$2; +#X obj 149 246 pack 0 0; +#X obj 200 221 /; +#X obj 204 163 * 0.001; +#X obj 200 190 t b f; +#X text 347 260 nasty non-flat noise; +#X obj 151 469 hip~ 5; +#X obj 100 8 loadbang; +#X text 269 15 sample playback; +#X msg 100 30 1; +#X obj 99 74 metro 1000; +#X floatatom 99 51; +#X obj 385 349 phasor~ 3000; +#X connect 0 0 5 0; +#X connect 1 0 0 0; +#X connect 2 0 17 0; +#X connect 2 0 18 0; +#X connect 3 0 19 0; +#X connect 4 0 7 1; +#X connect 5 0 7 0; +#X connect 6 0 13 0; +#X connect 7 0 22 0; +#X connect 8 0 5 1; +#X connect 9 0 4 1; +#X connect 10 0 8 0; +#X connect 11 0 9 0; +#X connect 12 0 4 0; +#X connect 13 0 12 0; +#X connect 15 0 2 1; +#X connect 16 0 1 0; +#X connect 17 0 16 0; +#X connect 18 0 17 1; +#X connect 18 0 26 1; +#X connect 19 0 20 0; +#X connect 20 0 18 0; +#X connect 20 1 18 1; +#X connect 22 0 14 0; +#X connect 23 0 25 0; +#X connect 25 0 27 0; +#X connect 26 0 2 0; +#X connect 27 0 26 0; +#X connect 28 0 12 1; +#X restore 70 375 pd test-signal; +#X text 56 310 sampler; +#X msg 507 213 \; make-mask 1000; +#X msg 564 492 \; window-size 1024; +#X text 488 186 calculate noise mask; +#X text 74 98 Then turn both the sample and the noise on together \, set the "mask-level" to 6 or so and enjoy the result. Alternatively \, you could try to mask the bell out of the noise...; +#X connect 0 0 9 0; +#X connect 1 0 45 0; +#X connect 2 0 11 0; +#X connect 7 0 12 0; +#X connect 7 0 48 0; +#X connect 10 0 11 1; +#X connect 11 0 3 0; +#X connect 11 0 3 1; +#X connect 12 0 13 0; +#X connect 14 0 45 1; +#X connect 15 0 22 0; +#X connect 16 0 15 0; +#X connect 17 0 19 0; +#X connect 17 0 22 0; +#X connect 18 0 19 1; +#X connect 19 0 20 0; +#X connect 24 0 43 0; +#X connect 25 0 31 0; +#X connect 26 0 25 0; +#X connect 27 0 26 0; +#X connect 28 0 10 0; +#X connect 32 0 0 0; +#X connect 42 0 0 0; +#X connect 43 0 23 0; +#X connect 45 0 2 0; diff --git a/pd/doc/4.fft.examples/04.shifts.pd b/pd/doc/4.fft.examples/04.shifts.pd new file mode 100644 index 00000000..9a03efbf --- /dev/null +++ b/pd/doc/4.fft.examples/04.shifts.pd @@ -0,0 +1,27 @@ +#N canvas 213 9 614 383 12; +#X msg 225 315 bang; +#X obj 201 341 print~; +#X graph graph1 0 -1 63 1 367 335 567 185; +#X array array1 64 float; +#X pop; +#X msg 155 317 bang; +#X obj 45 206 tabreceive~ array1; +#X obj 131 343 print~; +#X text 48 110 click here first; +#X msg 74 314 bang; +#X obj 50 340 print~; +#X text 93 23 This is a test of the "lrshift~" object \, which can be used for calculations that compare neighboring bins of an FFT. The "tabreceive~" picks up the contents of "array1' (consisting of 0 \, 1 \, 0 \, 0 \, ...) and the three print~ objects show the input and the two outputs.; +#X text 155 224 shift left; +#X text 182 260 shift right; +#X obj 128 240 ../../extra/lrshift~ 1; +#X obj 149 276 ../../extra/lrshift~ -1; +#X msg 49 131 \; pd dsp 1 \; array1 1 1; +#X text 223 5 SAMPLE SHIFTS; +#X connect 0 0 1 0; +#X connect 3 0 5 0; +#X connect 4 0 8 0; +#X connect 4 0 12 0; +#X connect 4 0 13 0; +#X connect 7 0 8 0; +#X connect 12 0 5 0; +#X connect 13 0 1 0; diff --git a/pd/doc/4.fft.examples/05.sheepgoat.pd b/pd/doc/4.fft.examples/05.sheepgoat.pd new file mode 100644 index 00000000..255b2a14 --- /dev/null +++ b/pd/doc/4.fft.examples/05.sheepgoat.pd @@ -0,0 +1,395 @@ +#N canvas 69 23 831 481 12; +#X floatatom 189 254; +#N canvas 31 3 710 622 fft-analysis 0; +#X obj 58 523 *~; +#X obj 306 397 +~; +#X obj 264 397 +~; +#X obj 232 427 *~; +#X obj 197 427 *~; +#X obj 197 452 +~; +#X obj 197 477 sqrt~; +#X obj 528 342 *~; +#X obj 493 342 *~; +#X obj 493 367 +~; +#X obj 399 256 *~; +#X obj 269 147 *~; +#X obj 234 147 *~; +#X obj 199 147 *~; +#X obj 163 147 *~; +#X obj 163 172 +~; +#X obj 21 573 *~; +#X obj 368 141 *~; +#X obj 80 80 *~; +#X obj 71 289 *~; +#X obj 99 56 inlet~; +#X obj 6 289 *~; +#X obj 28 32 tabreceive~ hanning; +#X obj 80 105 rfft~; +#X obj 21 548 rifft~; +#X obj 21 597 outlet~; +#X text 34 16 Hanning window; +#X text 106 88 forward real FFT; +#X obj 333 141 *~; +#X obj 333 167 +~; +#X obj 43 263 sig~ 0.001; +#X obj 601 576 block~ 2048 4; +#X obj 271 51 tabreceive~ last-real; +#X text 368 23 previous analysis; +#X obj 449 51 tabreceive~ last-imag; +#X obj 333 192 rsqrt~; +#X text 388 192 inverse modulus; +#X obj 234 172 -~; +#X obj 347 256 *~; +#X text 435 254 encoded as a single complex number; +#X text 435 229 amplitude and phase change; +#X obj 165 240 *~; +#X obj 128 289 tabsend~ last-real; +#X obj 165 266 tabsend~ last-imag; +#X text 191 240 sic; +#X text 543 393 modulus; +#X obj 493 448 +~; +#X text 522 447 sum of moduli; +#X obj 493 393 sqrt~; +#X text 244 472 modulus of sum; +#X obj 197 503 /~; +#X obj 197 529 -~; +#X obj 197 554 *~; +#X obj 197 579 clip~ 0 1; +#X obj 83 321 r threshold; +#X obj 83 371 t b f; +#X obj 83 422 -; +#X msg 83 397 1; +#X obj 83 472 sig~; +#X obj 10 523 *~; +#X obj 251 509 sig~ 1.5e-20; +#X obj 350 512 r flip; +#X obj 350 538 sel 0; +#X msg 350 563 1e+20; +#X msg 395 563 -1e+20; +#X floatatom 83 447; +#X obj 83 346 / 100; +#X obj 136 373 lrshift~ 1; +#X obj 210 373 lrshift~ -1; +#X obj 331 373 lrshift~ 1; +#X obj 405 373 lrshift~ -1; +#X obj 510 419 lrshift~ 1; +#X obj 593 422 lrshift~ -1; +#X connect 0 0 24 1; +#X connect 1 0 3 0; +#X connect 1 0 3 1; +#X connect 2 0 4 0; +#X connect 2 0 4 1; +#X connect 3 0 5 1; +#X connect 4 0 5 0; +#X connect 5 0 6 0; +#X connect 6 0 50 0; +#X connect 7 0 9 1; +#X connect 8 0 9 0; +#X connect 9 0 48 0; +#X connect 10 0 7 1; +#X connect 10 0 1 0; +#X connect 10 0 7 0; +#X connect 10 0 69 0; +#X connect 10 0 70 0; +#X connect 11 0 37 1; +#X connect 12 0 37 0; +#X connect 13 0 15 1; +#X connect 14 0 15 0; +#X connect 15 0 38 0; +#X connect 16 0 25 0; +#X connect 17 0 29 1; +#X connect 18 0 23 0; +#X connect 19 0 0 0; +#X connect 20 0 18 1; +#X connect 21 0 59 0; +#X connect 22 0 16 1; +#X connect 22 0 18 0; +#X connect 23 0 12 0; +#X connect 23 0 14 0; +#X connect 23 0 42 0; +#X connect 23 0 21 0; +#X connect 23 1 13 0; +#X connect 23 1 11 0; +#X connect 23 1 43 0; +#X connect 23 1 19 0; +#X connect 24 0 16 0; +#X connect 28 0 29 0; +#X connect 29 0 35 0; +#X connect 30 0 21 1; +#X connect 30 0 19 1; +#X connect 32 0 14 1; +#X connect 32 0 11 1; +#X connect 32 0 28 0; +#X connect 32 0 28 1; +#X connect 34 0 13 1; +#X connect 34 0 12 1; +#X connect 34 0 17 0; +#X connect 34 0 17 1; +#X connect 35 0 10 1; +#X connect 35 0 38 1; +#X connect 35 0 41 0; +#X connect 37 0 10 0; +#X connect 38 0 8 0; +#X connect 38 0 8 1; +#X connect 38 0 2 1; +#X connect 38 0 67 0; +#X connect 38 0 68 0; +#X connect 41 0 43 0; +#X connect 41 0 42 0; +#X connect 46 0 50 1; +#X connect 48 0 46 0; +#X connect 48 0 71 0; +#X connect 48 0 72 0; +#X connect 50 0 51 0; +#X connect 51 0 52 0; +#X connect 52 0 53 0; +#X connect 53 0 0 1; +#X connect 53 0 59 1; +#X connect 54 0 66 0; +#X connect 55 0 57 0; +#X connect 55 1 56 1; +#X connect 56 0 65 0; +#X connect 57 0 56 0; +#X connect 58 0 51 1; +#X connect 59 0 24 0; +#X connect 60 0 50 1; +#X connect 61 0 62 0; +#X connect 62 0 63 0; +#X connect 62 1 64 0; +#X connect 63 0 52 1; +#X connect 64 0 52 1; +#X connect 65 0 58 0; +#X connect 66 0 55 0; +#X connect 67 0 2 0; +#X connect 68 0 2 0; +#X connect 69 0 1 1; +#X connect 70 0 1 1; +#X connect 71 0 46 1; +#X connect 72 0 46 1; +#X restore 106 400 pd fft-analysis; +#X obj 106 468 dac~; +#X obj 106 443 *~; +#N canvas 211 72 625 525 previous-analysis 0; +#X graph graph1 0 -1 2048 1 310 246 510 96; +#X array last-real 2048 float; +#X pop; +#X graph graph2 0 -1 2048 1 309 433 509 283; +#X array last-imag 2048 float; +#X pop; +#X msg 67 202 \; last-real resize 2048 \; last-imag resize 2048; +#X restore 649 457 pd previous-analysis; +#X obj 189 279 s threshold; +#X obj 149 468 line~; +#X floatatom 622 72; +#N canvas 194 37 397 591 output 0; +#X obj 66 202 t b; +#X obj 66 152 f; +#X obj 66 102 inlet; +#X text 71 80 mute; +#X obj 66 228 f; +#X msg 134 244 0; +#X msg 66 127 bang; +#X obj 66 177 moses 1; +#X obj 134 219 t b f; +#X obj 96 441 outlet; +#X msg 96 416 set \$1; +#X obj 185 163 moses 1; +#X obj 224 444 dbtorms; +#X obj 224 469 pack 0 100; +#X obj 185 138 r master-lvl; +#X obj 96 382 r master-lvl; +#X obj 83 285 s master-lvl; +#X obj 224 494 s master-amp; +#X connect 0 0 4 0; +#X connect 1 0 7 0; +#X connect 2 0 6 0; +#X connect 4 0 16 0; +#X connect 5 0 16 0; +#X connect 6 0 1 0; +#X connect 7 0 0 0; +#X connect 7 1 8 0; +#X connect 8 0 5 0; +#X connect 10 0 9 0; +#X connect 11 1 4 1; +#X connect 12 0 13 0; +#X connect 13 0 17 0; +#X connect 14 0 1 1; +#X connect 14 0 11 0; +#X connect 15 0 10 0; +#X connect 15 0 12 0; +#X restore 622 47 pd output; +#X msg 622 22 mute; +#X text 661 64 MASTER; +#X text 660 78 LEVEL; +#X obj 622 98 s master-lvl; +#X obj 149 443 r master-amp; +#X obj 571 310 loadbang; +#X obj 571 336 samplerate~; +#X text 27 215 click here first; +#X obj 470 364 hip~ 5; +#X obj 470 338 adc~ 1; +#X msg 535 306 bang; +#X obj 535 338 f; +#X obj 535 364 s insamprate; +#X obj 470 389 tabwrite~ sample; +#X text 476 279 record your own sample; +#N canvas 132 61 699 413 hanning-window 0; +#X obj 97 218 phasor~; +#X obj 97 247 cos~; +#X obj 24 347 tabwrite~ hanning; +#X obj 31 267 -~; +#X obj 30 231 sig~ 1; +#X msg 40 191 0; +#X text 149 14 CALCULATE HANNING; +#X text 149 29 WINDOW TABLE; +#X graph graph1 0 -1 2047 1 454 213 654 63; +#X array hanning 2048 float; +#X pop; +#X obj 98 139 / 1024; +#X obj 98 181 sig~; +#X text 185 156 sample rate / window size; +#X msg 24 152 bang; +#X obj 70 284 sig~ 0.5; +#X obj 52 318 *~; +#X obj 71 102 samplerate~; +#X obj 26 24 r window-size; +#X obj 26 56 t b f; +#X msg 468 265 \; hanning resize 2048; +#X connect 0 0 1 0; +#X connect 1 0 3 1; +#X connect 3 0 14 0; +#X connect 4 0 3 0; +#X connect 5 0 0 1; +#X connect 9 0 10 0; +#X connect 10 0 0 0; +#X connect 12 0 2 0; +#X connect 12 0 5 0; +#X connect 13 0 14 1; +#X connect 14 0 2 0; +#X connect 15 0 9 0; +#X connect 16 0 17 0; +#X connect 17 0 15 0; +#X connect 17 0 12 0; +#X connect 17 1 9 1; +#X restore 649 432 pd hanning-window; +#X text 190 0 PITCHED/UNPITCHED SEPARATION; +#X text 99 18 This is the first of two attempts to separate "pitched" sound from noisy sound. We perform the usual windowed FFT \, and estimate the frequency of the signal in each bin \, If a bin's frequency agrees with those of its two neighbors \, we conclude that that bin belongs to a "pitched" sound.; +#X floatatom 320 258; +#X obj 320 283 s flip; +#X msg 320 230 0; +#X text 324 192 select:; +#X text 293 211 pitched; +#X text 365 211 noisy; +#X msg 365 231 1; +#X text 182 204 threshold; +#X text 186 217 (range; +#X text 190 229 0-100); +#X text 97 90 A low threshold means to let only very coherent signals through. A high one permits more of the signal to be considered "pitched". You can select either to hear the pitched or the noisy part.; +#X text 97 147 You might agree with me that the subsequent patch works better than this one...; +#X msg 22 238 \; window-size 2048 \; flip 0 \; pd dsp 1; +#X floatatom 104 339; +#X text 184 316 noise; +#X text 125 296 amplitudes; +#X floatatom 191 340; +#N canvas 190 43 534 552 test-signal 0; +#X obj 134 293 tabread4~ sample; +#X obj 134 268 line~; +#X obj 95 146 f; +#X obj 184 123 r insamprate; +#X obj 320 380 *~; +#X obj 136 350 *~; +#X obj 323 261 noise~; +#X obj 136 397 +~; +#X obj 164 351 dbtorms; +#X obj 346 380 dbtorms; +#X obj 164 328 inlet; +#X obj 346 358 inlet; +#X obj 323 337 *~; +#X obj 323 283 bp~ 2000 7; +#X obj 136 449 outlet~; +#X obj 110 98 r insamplength; +#X msg 134 247 0 \, \$1 \$2; +#X obj 134 221 pack 0 0; +#X obj 180 199 /; +#X obj 184 147 * 0.001; +#X obj 180 171 t b f; +#X text 312 234 nasty non-flat noise; +#X obj 136 422 hip~ 5; +#X obj 90 7 loadbang; +#X text 242 13 sample playback; +#X msg 90 27 1; +#X obj 89 67 metro 1000; +#X floatatom 89 46; +#X obj 346 314 phasor~ 3000; +#X connect 0 0 5 0; +#X connect 1 0 0 0; +#X connect 2 0 17 0; +#X connect 2 0 18 0; +#X connect 3 0 19 0; +#X connect 4 0 7 1; +#X connect 5 0 7 0; +#X connect 6 0 13 0; +#X connect 7 0 22 0; +#X connect 8 0 5 1; +#X connect 9 0 4 1; +#X connect 10 0 8 0; +#X connect 11 0 9 0; +#X connect 12 0 4 0; +#X connect 13 0 12 0; +#X connect 15 0 2 1; +#X connect 16 0 1 0; +#X connect 17 0 16 0; +#X connect 18 0 17 1; +#X connect 18 0 26 1; +#X connect 19 0 20 0; +#X connect 20 0 18 0; +#X connect 20 1 18 1; +#X connect 22 0 14 0; +#X connect 23 0 25 0; +#X connect 25 0 27 0; +#X connect 26 0 2 0; +#X connect 27 0 26 0; +#X connect 28 0 12 1; +#X restore 106 373 pd test-signal; +#X text 94 315 sampler; +#N canvas 132 255 634 331 insample 0; +#X graph graph1 0 -1 155947 1 180 168 580 18; +#X array sample 155948 float; +#X pop; +#X obj 19 70 r read-sample; +#X obj 19 95 unpack s f; +#X obj 53 121 s insamprate; +#X obj 19 171 soundfiler; +#X msg 19 147 read -resize \$1 sample; +#X obj 19 201 s insamplength; +#X msg 357 197 \; sample resize 220500 \; insamplength 220500; +#X connect 1 0 2 0; +#X connect 2 0 5 0; +#X connect 2 1 3 0; +#X connect 4 0 6 0; +#X connect 5 0 4 0; +#X restore 647 409 pd insample; +#X text 536 219 read a sample; +#X msg 446 240 \; read-sample ../sound/bell.aiff 44100; +#X connect 0 0 5 0; +#X connect 1 0 3 0; +#X connect 3 0 2 0; +#X connect 3 0 2 1; +#X connect 6 0 3 1; +#X connect 7 0 12 0; +#X connect 8 0 7 0; +#X connect 9 0 8 0; +#X connect 13 0 6 0; +#X connect 14 0 15 0; +#X connect 15 0 20 1; +#X connect 17 0 22 0; +#X connect 18 0 17 0; +#X connect 19 0 20 0; +#X connect 19 0 22 0; +#X connect 20 0 21 0; +#X connect 27 0 28 0; +#X connect 29 0 27 0; +#X connect 33 0 27 0; +#X connect 40 0 44 0; +#X connect 43 0 44 1; +#X connect 44 0 1 0; diff --git a/pd/doc/4.fft.examples/06.sheepgoat2.pd b/pd/doc/4.fft.examples/06.sheepgoat2.pd new file mode 100644 index 00000000..b62cc7a5 --- /dev/null +++ b/pd/doc/4.fft.examples/06.sheepgoat2.pd @@ -0,0 +1,365 @@ +#N canvas 5 22 761 478 12; +#N canvas 6 0 911 637 fft-analysis 0; +#X obj 581 379 *~; +#X obj 542 379 *~; +#X obj 542 407 -~; +#X obj 62 529 *~; +#X obj 318 304 *~; +#X obj 243 145 *~; +#X obj 279 144 *~; +#X obj 205 144 *~; +#X obj 166 144 *~; +#X obj 166 172 +~; +#X obj 25 597 *~; +#X floatatom 643 486; +#X obj 357 221 *~; +#X obj 94 77 *~; +#X obj 114 50 inlet~; +#X obj 37 21 tabreceive~ hanning; +#X obj 94 101 rfft~; +#X obj 25 573 rifft~; +#X obj 25 623 outlet~; +#X text 43 3 Hanning window; +#X text 123 84 forward real FFT; +#X obj 318 220 *~; +#X obj 318 249 +~; +#X obj 783 612 block~ 2048 4; +#X obj 283 45 tabreceive~ last-real; +#X text 390 13 previous analysis; +#X obj 478 45 tabreceive~ last-imag; +#X obj 318 276 rsqrt~; +#X text 390 224 inverse modulus; +#X obj 244 173 -~; +#X obj 260 304 *~; +#X obj 146 453 *~; +#X obj 100 505 tabsend~ last-real; +#X obj 138 481 tabsend~ last-imag; +#X text 174 449 sic; +#X obj 626 559 -~; +#X obj 627 586 *~; +#X obj 628 612 clip~ 0 1; +#X obj 644 435 r threshold; +#X obj 14 548 *~; +#X text 328 145 quotient (current/last); +#X obj 643 510 t f f; +#X obj 643 535 *; +#X obj 277 510 tabsend~ precess-real; +#X obj 535 327 tabreceive~ precess-real; +#X obj 724 327 tabreceive~ precess-imag; +#X obj 317 480 tabsend~ precess-imag; +#X text 621 364 imaginary part of quotient; +#X obj 539 440 *~; +#X obj 643 462 / 100; +#X text 374 270 normalized quotient \, which encodes the phase precession in the bin between two successive analyses.; +#X text 623 381 of successive phase precession; +#X text 621 397 values gives pitch stability; +#X obj 731 492 r flip; +#X obj 731 517 sel 0; +#X msg 798 547 1e+20; +#X msg 731 548 -1e+20; +#X obj 9 370 *~ 0.001; +#X obj 73 371 *~ 0.001; +#X connect 0 0 2 1; +#X connect 1 0 2 0; +#X connect 2 0 31 0; +#X connect 2 0 48 0; +#X connect 2 0 48 1; +#X connect 3 0 17 1; +#X connect 4 0 46 0; +#X connect 4 0 1 0; +#X connect 5 0 29 0; +#X connect 6 0 29 1; +#X connect 7 0 9 1; +#X connect 8 0 9 0; +#X connect 9 0 30 0; +#X connect 9 0 21 0; +#X connect 9 0 21 1; +#X connect 10 0 18 0; +#X connect 11 0 41 0; +#X connect 12 0 22 1; +#X connect 13 0 16 0; +#X connect 14 0 13 1; +#X connect 15 0 10 1; +#X connect 15 0 13 0; +#X connect 16 0 6 0; +#X connect 16 0 8 0; +#X connect 16 0 32 0; +#X connect 16 0 57 0; +#X connect 16 1 7 0; +#X connect 16 1 5 0; +#X connect 16 1 33 0; +#X connect 16 1 58 0; +#X connect 17 0 10 0; +#X connect 21 0 22 0; +#X connect 22 0 27 0; +#X connect 24 0 8 1; +#X connect 24 0 5 1; +#X connect 26 0 7 1; +#X connect 26 0 6 1; +#X connect 27 0 4 1; +#X connect 27 0 30 1; +#X connect 29 0 4 0; +#X connect 29 0 12 0; +#X connect 29 0 12 1; +#X connect 30 0 43 0; +#X connect 30 0 0 0; +#X connect 31 0 33 0; +#X connect 31 0 32 0; +#X connect 31 0 43 0; +#X connect 31 0 46 0; +#X connect 35 0 36 0; +#X connect 36 0 37 0; +#X connect 37 0 3 1; +#X connect 37 0 39 1; +#X connect 38 0 49 0; +#X connect 39 0 17 0; +#X connect 41 0 42 0; +#X connect 41 1 42 1; +#X connect 42 0 35 1; +#X connect 44 0 1 1; +#X connect 45 0 0 1; +#X connect 48 0 35 0; +#X connect 49 0 11 0; +#X connect 53 0 54 0; +#X connect 54 0 56 0; +#X connect 54 1 55 0; +#X connect 55 0 36 1; +#X connect 56 0 36 1; +#X connect 57 0 39 0; +#X connect 58 0 3 0; +#X restore 58 368 pd fft-analysis; +#X floatatom 207 217; +#X obj 58 416 dac~; +#X obj 58 388 *~; +#N canvas 662 12 796 785 previous-analysis 0; +#X graph graph1 0 -1 2048 1 344 407 744 107; +#X array last-real 2048 float; +#X pop; +#X graph graph2 0 -1 2048 1 349 719 749 419; +#X array last-imag 2048 float; +#X pop; +#X msg 43 217 \; last-real resize 2048 \; last-imag resize 2048; +#X restore 262 368 pd previous-analysis; +#X obj 207 245 s threshold; +#X obj 106 421 line~; +#X floatatom 553 78; +#N canvas 194 37 397 591 output 0; +#X obj 73 225 t b; +#X obj 73 169 f; +#X obj 73 113 inlet; +#X text 79 89 mute; +#X obj 73 253 f; +#X msg 149 271 0; +#X msg 73 141 bang; +#X obj 73 197 moses 1; +#X obj 149 243 t b f; +#X obj 107 490 outlet; +#X msg 107 462 set \$1; +#X obj 206 181 moses 1; +#X obj 249 493 dbtorms; +#X obj 249 521 pack 0 100; +#X obj 206 153 r master-lvl; +#X obj 107 424 r master-lvl; +#X obj 92 317 s master-lvl; +#X obj 249 549 s master-amp; +#X connect 0 0 4 0; +#X connect 1 0 7 0; +#X connect 2 0 6 0; +#X connect 4 0 16 0; +#X connect 5 0 16 0; +#X connect 6 0 1 0; +#X connect 7 0 0 0; +#X connect 7 1 8 0; +#X connect 8 0 5 0; +#X connect 10 0 9 0; +#X connect 11 1 4 1; +#X connect 12 0 13 0; +#X connect 13 0 17 0; +#X connect 14 0 1 1; +#X connect 14 0 11 0; +#X connect 15 0 10 0; +#X connect 15 0 12 0; +#X restore 553 50 pd output; +#X msg 553 22 mute; +#X text 596 69 MASTER; +#X text 596 84 LEVEL; +#X obj 553 106 s master-lvl; +#X obj 106 393 r master-amp; +#X obj 582 277 loadbang; +#X obj 582 305 samplerate~; +#X text 30 161 click here first; +#X obj 472 334 hip~ 5; +#X obj 472 306 adc~ 1; +#X msg 545 265 bang; +#X obj 545 306 f; +#X obj 545 334 s insamprate; +#X obj 472 362 tabwrite~ sample; +#X text 465 235 record your own sample; +#N canvas 190 37 605 462 hanning-window 0; +#X obj 108 242 phasor~; +#X obj 108 275 cos~; +#X obj 27 386 tabwrite~ hanning; +#X obj 35 297 -~; +#X obj 33 257 sig~ 1; +#X msg 44 212 0; +#X text 166 16 CALCULATE HANNING; +#X text 166 32 WINDOW TABLE; +#X graph graph1 0 -1 2047 1 369 373 569 223; +#X array hanning 2048 float; +#X pop; +#X obj 109 154 / 1024; +#X obj 109 201 sig~; +#X text 171 152 sample rate / window size; +#X msg 27 169 bang; +#X obj 78 316 sig~ 0.5; +#X obj 58 353 *~; +#X obj 79 113 samplerate~; +#X obj 29 27 r window-size; +#X obj 29 62 t b f; +#X msg 385 402 \; hanning resize 2048; +#X connect 0 0 1 0; +#X connect 1 0 3 1; +#X connect 3 0 14 0; +#X connect 4 0 3 0; +#X connect 5 0 0 1; +#X connect 9 0 10 0; +#X connect 10 0 0 0; +#X connect 12 0 2 0; +#X connect 12 0 5 0; +#X connect 13 0 14 1; +#X connect 14 0 2 0; +#X connect 15 0 9 0; +#X connect 16 0 17 0; +#X connect 17 0 15 0; +#X connect 17 0 12 0; +#X connect 17 1 9 1; +#X restore 262 340 pd hanning-window; +#X text 121 15 PITCHED/UNPITCHED SEPARATION; +#X floatatom 356 205; +#X obj 356 233 s flip; +#X msg 356 177 0; +#X text 363 129 select:; +#X text 326 157 pitched; +#X text 391 156 noisy; +#X msg 391 176 1; +#X text 198 155 threshold; +#X text 204 171 (range; +#X text 207 189 0-100); +#X text 21 73 A low threshold means to let only very coherent signals through. A high one permits more of the signal to be considered "pitched". You can select either to hear the pitched or the noisy part.; +#N canvas 0 0 843 816 phase-precession 0; +#X graph graph1 0 -1 2048 1 349 423 749 123; +#X array precess-real 2048 float; +#X pop; +#X graph graph2 0 -1 2048 1 348 749 748 449; +#X array precess-imag 2048 float; +#X pop; +#X msg 45 91 \; precess-real resize 2048 \; precess-imag resize 2048; +#X restore 262 396 pd phase-precession; +#X msg 23 182 \; window-size 2048 \; flip 0 \; pd dsp 1; +#X text 20 35 Another patch to separate pitched from unpitched signals. This one does a frequency estimate for each bin and checks whether the frequency seems to be changing quickly or not.; +#X floatatom 58 323; +#X text 143 302 noise; +#X text 84 282 amplitudes; +#X floatatom 143 319; +#N canvas 190 43 534 552 test-signal 0; +#X obj 134 293 tabread4~ sample; +#X obj 134 268 line~; +#X obj 95 146 f; +#X obj 184 123 r insamprate; +#X obj 320 380 *~; +#X obj 136 350 *~; +#X obj 323 261 noise~; +#X obj 136 397 +~; +#X obj 164 351 dbtorms; +#X obj 346 380 dbtorms; +#X obj 164 328 inlet; +#X obj 346 358 inlet; +#X obj 323 337 *~; +#X obj 323 283 bp~ 2000 7; +#X obj 136 449 outlet~; +#X obj 110 98 r insamplength; +#X msg 134 247 0 \, \$1 \$2; +#X obj 134 221 pack 0 0; +#X obj 180 199 /; +#X obj 184 147 * 0.001; +#X obj 180 171 t b f; +#X text 312 234 nasty non-flat noise; +#X obj 136 422 hip~ 5; +#X obj 90 7 loadbang; +#X text 242 13 sample playback; +#X msg 90 27 1; +#X obj 89 67 metro 1000; +#X floatatom 89 46; +#X obj 346 314 phasor~ 3000; +#X connect 0 0 5 0; +#X connect 1 0 0 0; +#X connect 2 0 17 0; +#X connect 2 0 18 0; +#X connect 3 0 19 0; +#X connect 4 0 7 1; +#X connect 5 0 7 0; +#X connect 6 0 13 0; +#X connect 7 0 22 0; +#X connect 8 0 5 1; +#X connect 9 0 4 1; +#X connect 10 0 8 0; +#X connect 11 0 9 0; +#X connect 12 0 4 0; +#X connect 13 0 12 0; +#X connect 15 0 2 1; +#X connect 16 0 1 0; +#X connect 17 0 16 0; +#X connect 18 0 17 1; +#X connect 18 0 26 1; +#X connect 19 0 20 0; +#X connect 20 0 18 0; +#X connect 20 1 18 1; +#X connect 22 0 14 0; +#X connect 23 0 25 0; +#X connect 25 0 27 0; +#X connect 26 0 2 0; +#X connect 27 0 26 0; +#X connect 28 0 12 1; +#X restore 58 345 pd test-signal; +#X text 53 301 sampler; +#X text 549 158 read a sample; +#X msg 459 179 \; read-sample ../sound/bell.aiff 44100; +#N canvas 132 255 634 335 insample 0; +#X graph graph1 0 -1 155947 1 180 168 580 18; +#X array sample 155948 float; +#X pop; +#X obj 19 70 r read-sample; +#X obj 19 95 unpack s f; +#X obj 53 121 s insamprate; +#X obj 19 171 soundfiler; +#X msg 19 147 read -resize \$1 sample; +#X obj 19 201 s insamplength; +#X msg 357 197 \; sample resize 220500 \; insamplength 220500; +#X connect 1 0 2 0; +#X connect 2 0 5 0; +#X connect 2 1 3 0; +#X connect 4 0 6 0; +#X connect 5 0 4 0; +#X restore 261 310 pd insample; +#X connect 0 0 3 0; +#X connect 1 0 5 0; +#X connect 3 0 2 0; +#X connect 3 0 2 1; +#X connect 6 0 3 1; +#X connect 7 0 12 0; +#X connect 8 0 7 0; +#X connect 9 0 8 0; +#X connect 13 0 6 0; +#X connect 14 0 15 0; +#X connect 15 0 20 1; +#X connect 17 0 22 0; +#X connect 18 0 17 0; +#X connect 19 0 20 0; +#X connect 19 0 22 0; +#X connect 20 0 21 0; +#X connect 26 0 27 0; +#X connect 28 0 26 0; +#X connect 32 0 26 0; +#X connect 40 0 44 0; +#X connect 43 0 44 1; +#X connect 44 0 0 0; diff --git a/pd/doc/4.fft.examples/07.tinbell.pd b/pd/doc/4.fft.examples/07.tinbell.pd new file mode 100644 index 00000000..59ca1970 --- /dev/null +++ b/pd/doc/4.fft.examples/07.tinbell.pd @@ -0,0 +1,248 @@ +#N canvas 175 36 759 457 12; +#N canvas 147 -3 718 530 fft-analysis 0; +#X obj 138 257 *~; +#X obj 122 286 *~; +#X obj 87 286 *~; +#X obj 86 71 *~; +#X obj 117 71 inlet~; +#X obj 86 94 rfft~; +#X obj 60 351 *~; +#X obj 190 136 *~; +#X obj 63 40 tabreceive~ hanning; +#X obj 87 309 rifft~; +#X obj 60 374 outlet~; +#X obj 156 136 *~; +#X obj 156 159 +~; +#X obj 166 257 sig~ 0.001; +#X obj 185 349 block~ 1024 4; +#X obj 156 184 rsqrt~; +#X obj 217 187 sig~ 1e-20; +#X obj 156 211 clip~; +#X text 37 2 What does this do?; +#X floatatom 462 156; +#X obj 462 67 r squelch; +#X obj 462 177 moses; +#X msg 461 207 0; +#X obj 461 90 t f f; +#X obj 462 113 *; +#X obj 462 134 * 0.01; +#X connect 0 0 1 1; +#X connect 0 0 2 1; +#X connect 1 0 9 1; +#X connect 2 0 9 0; +#X connect 3 0 5 0; +#X connect 4 0 3 1; +#X connect 5 0 11 0; +#X connect 5 0 11 1; +#X connect 5 0 2 0; +#X connect 5 1 7 0; +#X connect 5 1 7 1; +#X connect 5 1 1 0; +#X connect 6 0 10 0; +#X connect 7 0 12 1; +#X connect 8 0 3 0; +#X connect 8 0 6 0; +#X connect 9 0 6 1; +#X connect 11 0 12 0; +#X connect 12 0 15 0; +#X connect 13 0 0 1; +#X connect 15 0 17 0; +#X connect 16 0 15 0; +#X connect 17 0 0 0; +#X connect 19 0 21 0; +#X connect 20 0 23 0; +#X connect 21 0 22 0; +#X connect 21 1 17 2; +#X connect 22 0 17 2; +#X connect 23 0 24 0; +#X connect 23 0 24 1; +#X connect 24 0 25 0; +#X connect 25 0 19 0; +#X restore 74 366 pd fft-analysis; +#X floatatom 192 206; +#X obj 74 414 dac~; +#X obj 74 390 *~; +#X obj 119 414 line~; +#X floatatom 587 68; +#N canvas 194 37 397 591 output 0; +#X obj 62 191 t b; +#X obj 62 144 f; +#X obj 62 96 inlet; +#X text 67 76 mute; +#X obj 62 215 f; +#X msg 127 230 0; +#X msg 62 120 bang; +#X obj 62 167 moses 1; +#X obj 127 207 t b f; +#X obj 91 417 outlet; +#X msg 91 393 set \$1; +#X obj 175 154 moses 1; +#X obj 212 419 dbtorms; +#X obj 212 443 pack 0 100; +#X obj 175 130 r master-lvl; +#X obj 91 360 r master-lvl; +#X obj 78 269 s master-lvl; +#X obj 212 467 s master-amp; +#X connect 0 0 4 0; +#X connect 1 0 7 0; +#X connect 2 0 6 0; +#X connect 4 0 16 0; +#X connect 5 0 16 0; +#X connect 6 0 1 0; +#X connect 7 0 0 0; +#X connect 7 1 8 0; +#X connect 8 0 5 0; +#X connect 10 0 9 0; +#X connect 11 1 4 1; +#X connect 12 0 13 0; +#X connect 13 0 17 0; +#X connect 14 0 1 1; +#X connect 14 0 11 0; +#X connect 15 0 10 0; +#X connect 15 0 12 0; +#X restore 587 44 pd output; +#X msg 587 20 mute; +#X text 624 60 MASTER; +#X text 623 74 LEVEL; +#X obj 587 92 s master-lvl; +#X obj 119 390 r master-amp; +#X obj 664 177 loadbang; +#X obj 664 201 samplerate~; +#X text 30 187 click here first; +#X text 361 166 read a sample; +#X obj 562 225 hip~ 5; +#X obj 562 201 adc~ 1; +#X msg 624 170 bang; +#X obj 624 201 f; +#X obj 624 225 s insamprate; +#X obj 562 248 tabwrite~ sample; +#N canvas 107 33 607 436 hanning-window 0; +#X obj 92 206 phasor~; +#X obj 92 234 cos~; +#X obj 23 328 tabwrite~ hanning; +#X obj 30 252 -~; +#X obj 28 218 sig~ 1; +#X msg 37 180 0; +#X text 141 13 CALCULATE HANNING; +#X text 141 27 WINDOW TABLE; +#X graph graph1 0 -1 1024 1 295 345 495 195; +#X array hanning 1024 float; +#X pop; +#X msg 304 374 \; hanning resize 1024; +#X obj 93 131 / 1024; +#X obj 93 171 sig~; +#X text 175 148 sample rate / window size; +#X msg 23 144 bang; +#X obj 66 269 sig~ 0.5; +#X obj 49 300 *~; +#X obj 67 96 samplerate~; +#X obj 25 23 r window-size; +#X obj 25 53 t b f; +#X connect 0 0 1 0; +#X connect 1 0 3 1; +#X connect 3 0 15 0; +#X connect 4 0 3 0; +#X connect 5 0 0 1; +#X connect 10 0 11 0; +#X connect 11 0 0 0; +#X connect 13 0 2 0; +#X connect 13 0 5 0; +#X connect 14 0 15 1; +#X connect 15 0 2 0; +#X connect 16 0 10 0; +#X connect 17 0 18 0; +#X connect 18 0 16 0; +#X connect 18 0 13 0; +#X connect 18 1 10 1; +#X restore 521 332 pd hanning-window; +#X msg 24 205 \; window-size 1024 \; pd dsp 1; +#X obj 192 230 s squelch; +#X text 116 3 BOOSTING SMALL AMPLITUDES; +#X text 614 146 record; +#X floatatom 75 316; +#N canvas 190 43 405 461 test-signal 0; +#X obj 134 293 tabread4~ sample; +#X obj 134 268 line~; +#X obj 95 146 f; +#X obj 254 46 r insamprate; +#X obj 136 350 *~; +#X obj 164 351 dbtorms; +#X obj 164 328 inlet; +#X obj 135 415 outlet~; +#X obj 146 33 r insamplength; +#X msg 134 247 0 \, \$1 \$2; +#X obj 134 221 pack 0 0; +#X obj 209 190 /; +#X obj 299 99 * 0.001; +#X obj 135 388 hip~ 5; +#X obj 33 5 loadbang; +#X text 242 13 sample playback; +#X msg 33 25 1; +#X obj 33 69 metro 1000; +#X floatatom 33 48; +#X obj 255 75 t b b f; +#X obj 161 84 t b f; +#X connect 0 0 4 0; +#X connect 1 0 0 0; +#X connect 2 0 10 0; +#X connect 3 0 19 0; +#X connect 4 0 13 0; +#X connect 5 0 4 1; +#X connect 6 0 5 0; +#X connect 8 0 20 0; +#X connect 9 0 1 0; +#X connect 10 0 9 0; +#X connect 11 0 10 1; +#X connect 11 0 17 1; +#X connect 12 0 11 1; +#X connect 13 0 7 0; +#X connect 14 0 16 0; +#X connect 16 0 18 0; +#X connect 17 0 2 0; +#X connect 18 0 17 0; +#X connect 19 0 16 0; +#X connect 19 1 11 0; +#X connect 19 2 12 0; +#X connect 20 0 16 0; +#X connect 20 1 11 0; +#X connect 20 1 2 1; +#X restore 75 339 pd test-signal; +#X text 76 294 amplitude; +#N canvas 132 255 634 331 insample 0; +#X graph graph1 0 -1 155947 1 199 168 599 18; +#X array sample 155948 float; +#X pop; +#X obj 19 70 r read-sample; +#X obj 19 95 unpack s f; +#X obj 53 121 s insamprate; +#X obj 19 171 soundfiler; +#X msg 19 147 read -resize \$1 sample; +#X obj 19 201 s insamplength; +#X msg 357 197 \; sample resize 220500 \; insamplength 220500; +#X connect 1 0 2 0; +#X connect 2 0 5 0; +#X connect 2 1 3 0; +#X connect 4 0 6 0; +#X connect 5 0 4 0; +#X restore 521 357 pd insample; +#X msg 282 189 \; read-sample ../sound/bell.aiff 44100; +#X text 38 27 the "fft analysis" window here simply divides each complex bin of the FFT by its own magnitude to "flatten" the spectrum. The "squelch" control limits the amplitude boost the algorithm will apply. If infinite \, you'll get a white spectrum \; if less \, the louder parts of the spectrum will be flattened but the quieter ones will only be boosetd by the squelch value.; +#X msg 281 229 \; read-sample ../sound/voice.wav 32000; +#X connect 0 0 3 0; +#X connect 1 0 24 0; +#X connect 3 0 2 0; +#X connect 3 0 2 1; +#X connect 4 0 3 1; +#X connect 5 0 10 0; +#X connect 6 0 5 0; +#X connect 7 0 6 0; +#X connect 11 0 4 0; +#X connect 12 0 13 0; +#X connect 13 0 19 1; +#X connect 16 0 21 0; +#X connect 17 0 16 0; +#X connect 18 0 19 0; +#X connect 18 0 21 0; +#X connect 19 0 20 0; +#X connect 27 0 28 0; +#X connect 28 0 0 0; diff --git a/pd/doc/4.fft.examples/08.convobros.pd b/pd/doc/4.fft.examples/08.convobros.pd new file mode 100644 index 00000000..8e49ef3d --- /dev/null +++ b/pd/doc/4.fft.examples/08.convobros.pd @@ -0,0 +1,344 @@ +#N canvas 16 29 916 517 12; +#N canvas 147 -3 669 492 fft-analysis 0; +#X obj 265 254 *~; +#X obj 249 284 *~; +#X obj 214 284 *~; +#X obj 114 120 *~; +#X obj 80 114 *~; +#X obj 80 137 +~; +#X obj 213 68 *~; +#X obj 245 68 inlet~; +#X obj 213 91 rfft~; +#X obj 59 304 *~; +#X floatatom 462 156 0 0 0; +#X obj 317 133 *~; +#X obj 80 68 *~; +#X obj 113 68 inlet~; +#X obj 61 34 tabreceive~ hanning; +#X obj 80 91 rfft~; +#X obj 214 307 rifft~; +#X obj 59 327 outlet~; +#X text 37 2 Hanning window; +#X obj 284 133 *~; +#X obj 284 156 +~; +#X obj 293 254 sig~ 0.001; +#X text 129 165 modulus; +#X obj 80 160 sqrt~; +#X obj 265 231 *~; +#X obj 462 67 r squelch; +#X obj 313 346 block~ 1024 4; +#X obj 284 182 rsqrt~; +#X obj 344 184 sig~ 1e-20; +#X obj 284 208 clip~; +#X obj 462 177 moses; +#X msg 457 221 0; +#X obj 461 90 t f f; +#X obj 462 113 *; +#X obj 462 134 * 0.01; +#X connect 0 0 1 1; +#X connect 0 0 2 1; +#X connect 1 0 16 1; +#X connect 2 0 16 0; +#X connect 3 0 5 1; +#X connect 4 0 5 0; +#X connect 5 0 23 0; +#X connect 6 0 8 0; +#X connect 7 0 6 1; +#X connect 8 0 19 0; +#X connect 8 0 19 1; +#X connect 8 0 2 0; +#X connect 8 1 11 0; +#X connect 8 1 11 1; +#X connect 8 1 1 0; +#X connect 9 0 17 0; +#X connect 10 0 30 0; +#X connect 11 0 20 1; +#X connect 12 0 15 0; +#X connect 13 0 12 1; +#X connect 14 0 12 0; +#X connect 14 0 6 0; +#X connect 14 0 9 0; +#X connect 15 0 4 0; +#X connect 15 0 4 1; +#X connect 15 1 3 0; +#X connect 15 1 3 1; +#X connect 16 0 9 1; +#X connect 19 0 20 0; +#X connect 20 0 27 0; +#X connect 21 0 0 1; +#X connect 23 0 24 0; +#X connect 24 0 0 0; +#X connect 25 0 32 0; +#X connect 27 0 29 0; +#X connect 28 0 27 0; +#X connect 29 0 24 1; +#X connect 30 0 31 0; +#X connect 30 1 29 2; +#X connect 31 0 29 2; +#X connect 32 0 33 0; +#X connect 32 0 33 1; +#X connect 33 0 34 0; +#X connect 34 0 10 0; +#X restore 119 405 pd fft-analysis; +#X floatatom 190 159 0 0 0; +#X obj 119 453 dac~; +#X obj 119 429 *~; +#X obj 164 453 line~; +#X floatatom 587 68 0 0 0; +#N canvas 194 37 397 591 output 0; +#X obj 62 191 t b; +#X obj 62 144 f; +#X obj 62 96 inlet; +#X text 67 76 mute; +#X obj 62 215 f; +#X msg 127 230 0; +#X msg 62 120 bang; +#X obj 62 167 moses 1; +#X obj 127 207 t b f; +#X obj 91 417 outlet; +#X msg 91 393 set \$1; +#X obj 175 154 moses 1; +#X obj 212 419 dbtorms; +#X obj 212 443 pack 0 100; +#X obj 175 130 r master-lvl; +#X obj 91 360 r master-lvl; +#X obj 78 269 s master-lvl; +#X obj 212 467 s master-amp; +#X connect 0 0 4 0; +#X connect 1 0 7 0; +#X connect 2 0 6 0; +#X connect 4 0 16 0; +#X connect 5 0 16 0; +#X connect 6 0 1 0; +#X connect 7 0 0 0; +#X connect 7 1 8 0; +#X connect 8 0 5 0; +#X connect 10 0 9 0; +#X connect 11 1 4 1; +#X connect 12 0 13 0; +#X connect 13 0 17 0; +#X connect 14 0 1 1; +#X connect 14 0 11 0; +#X connect 15 0 10 0; +#X connect 15 0 12 0; +#X restore 587 44 pd output; +#X msg 587 20 mute; +#X text 624 61 MASTER; +#X text 624 75 LEVEL; +#X obj 587 92 s master-lvl; +#X obj 164 429 r master-amp; +#X obj 424 420 loadbang; +#X obj 424 443 samplerate~; +#X obj 424 467 s srate; +#X text 31 137 click here first; +#X obj 724 237 hip~ 5; +#X obj 724 213 adc~ 1; +#X msg 786 182 bang; +#X obj 814 213 r srate; +#X obj 786 213 f; +#X obj 786 237 s insamprate; +#X obj 724 260 tabwrite~ sample; +#N canvas 275 71 767 761 hanning-window 0; +#X obj 92 206 phasor~; +#X obj 92 234 cos~; +#X obj 23 328 tabwrite~ hanning; +#X obj 30 252 -~; +#X obj 28 218 sig~ 1; +#X msg 37 180 0; +#X text 141 13 CALCULATE HANNING; +#X text 141 27 WINDOW TABLE; +#X graph graph1 0 -1 1024 1 275 581 675 281; +#X array hanning 1024 float 0; +#X pop; +#X msg 275 547 \; hanning resize 1024; +#X obj 93 131 / 1024; +#X obj 93 171 sig~; +#X text 175 148 sample rate / window size; +#X msg 23 144 bang; +#X obj 66 269 sig~ 0.5; +#X obj 49 300 *~; +#X obj 67 96 samplerate~; +#X obj 25 23 r window-size; +#X obj 25 53 t b f; +#X connect 0 0 1 0; +#X connect 1 0 3 1; +#X connect 3 0 15 0; +#X connect 4 0 3 0; +#X connect 5 0 0 1; +#X connect 10 0 11 0; +#X connect 11 0 0 0; +#X connect 13 0 2 0; +#X connect 13 0 5 0; +#X connect 14 0 15 1; +#X connect 15 0 2 0; +#X connect 16 0 10 0; +#X connect 17 0 18 0; +#X connect 18 0 16 0; +#X connect 18 0 13 0; +#X connect 18 1 10 1; +#X restore 419 387 pd hanning-window; +#X msg 25 155 \; window-size 1024 \; pd dsp 1; +#X obj 190 183 s squelch; +#X obj 725 388 hip~ 5; +#X obj 725 364 adc~ 1; +#X msg 787 333 bang; +#X obj 815 364 r srate; +#X obj 787 364 f; +#X obj 787 388 s insamprate; +#X obj 725 412 tabwrite~ sample2; +#X text 177 6 CORT&ZACK's SECRET; +#X text 190 137 range 1-100; +#N canvas 190 43 743 445 test-signal 0; +#X obj 78 265 tabread4~ sample; +#X obj 78 244 line~; +#X obj 78 158 f; +#X obj 238 62 r insamprate; +#X obj 79 369 outlet~; +#X obj 130 54 r insamplength; +#X msg 78 223 0 \, \$1 \$2; +#X obj 78 202 pack 0 0; +#X obj 175 196 /; +#X obj 283 111 * 0.001; +#X obj 79 346 hip~ 5; +#X obj 25 29 loadbang; +#X text 150 24 sample playback; +#X msg 25 55 1; +#X obj 25 93 metro 1000; +#X floatatom 25 75 0 0 0; +#X obj 239 87 t b b f; +#X obj 134 105 t b f; +#X obj 445 256 line~; +#X obj 445 170 f; +#X obj 446 381 outlet~; +#X msg 445 235 0 \, \$1 \$2; +#X obj 445 214 pack 0 0; +#X obj 542 208 /; +#X obj 650 123 * 0.001; +#X obj 446 358 hip~ 5; +#X obj 392 41 loadbang; +#X msg 392 67 1; +#X obj 392 105 metro 1000; +#X floatatom 392 87 0 0 0; +#X obj 606 99 t b b f; +#X obj 501 117 t b f; +#X obj 445 277 tabread4~ sample2; +#X obj 497 66 r insamplength2; +#X obj 605 74 r insamprate2; +#X connect 0 0 10 0; +#X connect 1 0 0 0; +#X connect 2 0 7 0; +#X connect 3 0 16 0; +#X connect 5 0 17 0; +#X connect 6 0 1 0; +#X connect 7 0 6 0; +#X connect 8 0 7 1; +#X connect 8 0 14 1; +#X connect 9 0 8 1; +#X connect 10 0 4 0; +#X connect 11 0 13 0; +#X connect 13 0 15 0; +#X connect 14 0 2 0; +#X connect 15 0 14 0; +#X connect 16 0 13 0; +#X connect 16 1 8 0; +#X connect 16 2 9 0; +#X connect 17 0 13 0; +#X connect 17 1 8 0; +#X connect 17 1 2 1; +#X connect 18 0 32 0; +#X connect 19 0 22 0; +#X connect 21 0 18 0; +#X connect 22 0 21 0; +#X connect 23 0 22 1; +#X connect 23 0 28 1; +#X connect 24 0 23 1; +#X connect 25 0 20 0; +#X connect 26 0 27 0; +#X connect 27 0 29 0; +#X connect 28 0 19 0; +#X connect 29 0 28 0; +#X connect 30 0 27 0; +#X connect 30 1 23 0; +#X connect 30 2 24 0; +#X connect 31 0 27 0; +#X connect 31 1 23 0; +#X connect 31 1 19 1; +#X connect 32 0 25 0; +#X connect 33 0 31 0; +#X connect 34 0 30 0; +#X restore 117 371 pd test-signal; +#N canvas 132 255 634 327 insample 0; +#X graph graph1 0 -1 155947 1 199 168 599 18; +#X array sample 155948 float 0; +#X pop; +#X obj 19 70 r read-sample; +#X obj 19 95 unpack s f; +#X obj 53 121 s insamprate; +#X obj 19 171 soundfiler; +#X msg 19 147 read -resize \$1 sample; +#X obj 19 201 s insamplength; +#X msg 357 197 \; sample resize 220500 \; insamplength 220500; +#X connect 1 0 2 0; +#X connect 2 0 5 0; +#X connect 2 1 3 0; +#X connect 4 0 6 0; +#X connect 5 0 4 0; +#X restore 417 332 pd insample; +#N canvas 0 0 647 284 insample2 0; +#X obj 19 95 unpack s f; +#X obj 19 171 soundfiler; +#X msg 357 197 \; sample resize 220500 \; insamplength 220500; +#X graph graph2 0 -1 63023 1 207 159 607 19; +#X array sample2 63024 float 0; +#X pop; +#X obj 53 121 s insamprate2; +#X msg 19 147 read -resize \$1 sample2; +#X obj 19 201 s insamplength2; +#X obj 19 70 r read-sample2; +#X connect 0 0 5 0; +#X connect 0 1 4 0; +#X connect 1 0 6 0; +#X connect 5 0 1 0; +#X connect 7 0 0 0; +#X restore 418 358 pd insample2; +#X msg 19 230 \; read-sample ../sound/bell.aiff 44100; +#X msg 357 230 \; read-sample2 ../sound/bell.aiff 44100; +#X text 247 364 filter; +#X text 249 379 input; +#X text 51 401 source; +#X text 53 362 filter; +#X text 52 382 control; +#X text 719 158 record sample; +#X text 720 309 record sample2; +#X text 37 60 To get sound \, you have to "click here first" \, set +squelch to 10 or so \, read or record two samples \, and ease up the +master volume.; +#X msg 20 274 \; read-sample ../sound/voice.wav 32000; +#X msg 358 274 \; read-sample2 ../sound/voice.wav 32000; +#X text 37 27 This is an FFT based vocoder such as the one the Convo +bros showed at the Ann Arbor ICMC.; +#X connect 0 0 3 0; +#X connect 1 0 25 0; +#X connect 3 0 2 0; +#X connect 3 0 2 1; +#X connect 4 0 3 1; +#X connect 5 0 10 0; +#X connect 6 0 5 0; +#X connect 7 0 6 0; +#X connect 11 0 4 0; +#X connect 12 0 13 0; +#X connect 13 0 14 0; +#X connect 16 0 22 0; +#X connect 17 0 16 0; +#X connect 18 0 20 0; +#X connect 18 0 22 0; +#X connect 19 0 20 1; +#X connect 20 0 21 0; +#X connect 26 0 32 0; +#X connect 27 0 26 0; +#X connect 28 0 30 0; +#X connect 28 0 32 0; +#X connect 29 0 30 1; +#X connect 30 0 31 0; +#X connect 35 0 0 0; +#X connect 35 1 0 1; diff --git a/pd/doc/4.fft.examples/09.pvoc.pd b/pd/doc/4.fft.examples/09.pvoc.pd new file mode 100644 index 00000000..495fd535 --- /dev/null +++ b/pd/doc/4.fft.examples/09.pvoc.pd @@ -0,0 +1,397 @@ +#N canvas 100 38 719 544 12; +#X floatatom 283 336; +#X msg 569 149 bang; +#X floatatom 197 329; +#X floatatom 90 330; +#N canvas 0 2 986 683 fft-analysis 0; +#X obj 261 297 *~; +#X obj 230 297 *~; +#X obj 230 319 -~; +#X obj 326 298 *~; +#X obj 295 298 *~; +#X obj 295 320 +~; +#X obj 340 128 *~; +#X obj 309 128 *~; +#X obj 281 128 *~; +#X obj 250 128 *~; +#X obj 250 150 +~; +#X obj 220 179 *~; +#X obj 86 556 *~; +#X obj 366 251 rfft~; +#X obj 387 53 rfft~; +#X obj 477 637 *~; +#X obj 685 288 r window-size; +#X obj 751 201 r sample-rate; +#X obj 609 234 f; +#X obj 603 52 r sample-rate; +#X obj 578 29 r window-size; +#X obj 601 98 t b f; +#X obj 578 121 /; +#X obj 507 637 *~; +#X obj 87 536 *~; +#X obj 103 513 rifft~; +#X obj 87 582 outlet~; +#X obj 625 446 print~; +#X msg 624 418 bang; +#X text 152 513 inverse real FFT; +#X obj 589 210 bang~; +#X obj 516 424 line~; +#X obj 578 143 * 1000; +#X text 630 136 window size (msec); +#X obj 603 76 * 4; +#X obj 632 159 r speed; +#X obj 709 160 r location; +#X obj 640 235 +; +#X obj 633 200 *; +#X msg 710 188 0; +#X obj 609 341 +; +#X obj 600 298 t f f; +#X msg 516 396 \$1 \, \$2 \$3; +#X obj 516 369 pack 0 0 0; +#X obj 752 229 / 1000; +#X obj 609 269 *; +#X text 639 270 reading location (samples); +#X obj 637 381 / 4; +#X text 669 386 hop size (samples); +#X obj 564 464 sig~; +#X obj 534 463 +~; +#X text 638 82 (overlap times parent SR); +#X text 638 69 local sample rate; +#X obj 23 51 tabreceive~ phase-real; +#X obj 190 179 *~; +#X obj 190 201 +~; +#X obj 190 225 rsqrt~; +#X obj 309 150 -~; +#X obj 231 255 *~; +#X obj 291 255 *~; +#X obj 198 51 tabreceive~ phase-imag; +#X obj 105 381 sig~; +#X obj 88 311 t b f; +#X msg 88 332 1; +#X obj 102 355 /; +#X obj 227 436 tabsend~ phase-real; +#X obj 256 408 tabsend~ phase-imag; +#X obj 104 133 sig~ 1.5e-20; +#X obj 632 180 * 0.01; +#X obj 691 212 s speed; +#X obj 468 251 s see-location; +#X obj 598 618 block~ 2048 4; +#X floatatom 672 360; +#X obj 670 339 *; +#X obj 829 234 r transpo; +#X obj 829 256 * 0.01; +#X obj 831 277 + 69; +#X obj 832 298 mtof; +#X obj 832 320 / 440; +#X obj 689 316 t b f; +#X obj 88 290 r window-size; +#X floatatom 835 353; +#X obj 551 543 tabreceive~ hanning; +#X obj 536 488 tabread4~ sample; +#X obj 502 513 tabread4~ sample; +#X connect 0 0 2 1; +#X connect 1 0 2 0; +#X connect 2 0 65 0; +#X connect 2 0 25 0; +#X connect 3 0 5 1; +#X connect 4 0 5 0; +#X connect 5 0 66 0; +#X connect 5 0 25 1; +#X connect 6 0 57 1; +#X connect 7 0 57 0; +#X connect 8 0 10 1; +#X connect 9 0 10 0; +#X connect 10 0 58 1; +#X connect 10 0 54 0; +#X connect 10 0 54 1; +#X connect 11 0 55 1; +#X connect 12 0 26 0; +#X connect 13 0 1 1; +#X connect 13 0 3 1; +#X connect 13 1 0 1; +#X connect 13 1 4 1; +#X connect 14 0 9 1; +#X connect 14 0 7 1; +#X connect 14 1 6 1; +#X connect 14 1 8 1; +#X connect 15 0 14 0; +#X connect 16 0 73 0; +#X connect 17 0 44 0; +#X connect 18 0 37 0; +#X connect 18 0 45 0; +#X connect 18 0 70 0; +#X connect 19 0 34 0; +#X connect 20 0 22 0; +#X connect 21 0 22 0; +#X connect 21 1 22 1; +#X connect 22 0 32 0; +#X connect 23 0 13 0; +#X connect 24 0 12 0; +#X connect 25 0 24 1; +#X connect 28 0 27 0; +#X connect 30 0 18 0; +#X connect 31 0 27 0; +#X connect 31 0 50 0; +#X connect 31 0 84 0; +#X connect 32 0 43 2; +#X connect 32 0 38 1; +#X connect 34 0 21 0; +#X connect 35 0 68 0; +#X connect 36 0 39 0; +#X connect 36 0 18 1; +#X connect 37 0 18 1; +#X connect 38 0 37 1; +#X connect 39 0 69 0; +#X connect 40 0 43 1; +#X connect 41 0 43 0; +#X connect 41 1 40 0; +#X connect 42 0 31 0; +#X connect 43 0 42 0; +#X connect 44 0 45 1; +#X connect 45 0 41 0; +#X connect 47 0 49 0; +#X connect 49 0 50 1; +#X connect 50 0 83 0; +#X connect 53 0 9 0; +#X connect 53 0 6 0; +#X connect 54 0 55 0; +#X connect 55 0 56 0; +#X connect 56 0 58 0; +#X connect 56 0 59 0; +#X connect 57 0 59 1; +#X connect 57 0 11 0; +#X connect 57 0 11 1; +#X connect 58 0 1 0; +#X connect 58 0 4 0; +#X connect 59 0 0 0; +#X connect 59 0 3 0; +#X connect 60 0 7 0; +#X connect 60 0 8 0; +#X connect 61 0 24 0; +#X connect 62 0 63 0; +#X connect 62 1 64 1; +#X connect 63 0 64 0; +#X connect 64 0 61 0; +#X connect 67 0 10 0; +#X connect 68 0 38 0; +#X connect 72 0 47 0; +#X connect 72 0 40 1; +#X connect 73 0 72 0; +#X connect 74 0 75 0; +#X connect 75 0 76 0; +#X connect 76 0 77 0; +#X connect 77 0 78 0; +#X connect 78 0 79 0; +#X connect 78 0 81 0; +#X connect 79 0 73 0; +#X connect 79 1 73 1; +#X connect 80 0 62 0; +#X connect 82 0 23 1; +#X connect 82 0 15 1; +#X connect 82 0 12 1; +#X connect 83 0 23 0; +#X connect 84 0 15 0; +#X restore 43 402 pd fft-analysis; +#X obj 43 488 dac~; +#N canvas 260 23 647 768 phase-tables 0; +#X graph graph2 0 -1 4096 1 172 590 572 290; +#X array phase-imag 4096 float; +#X pop; +#X graph graph3 0 -1 4096 1 170 317 570 17; +#X array phase-real 4096 float; +#X pop; +#X msg 167 564 \; phase-real resize 4096 \; phase-imag resize 4096; +#X restore 425 441 pd phase-tables; +#X obj 43 428 hip~ 5; +#X obj 43 458 *~; +#N canvas 249 280 600 398 loc&precess 0; +#X floatatom 160 229; +#X msg 270 175 set \$1; +#X obj 269 207 outlet; +#X obj 83 267 outlet; +#X obj 171 71 r location; +#X msg 82 235 set \$1; +#X obj 269 149 r speed; +#X obj 55 70 r see-location; +#X obj 67 102 t b f; +#X obj 82 214 f; +#X obj 54 127 int; +#X obj 54 151 sel 0; +#X msg 153 102 1; +#X msg 201 101 0; +#X obj 110 179 del 300; +#X connect 1 0 2 0; +#X connect 4 0 8 0; +#X connect 5 0 3 0; +#X connect 6 0 1 0; +#X connect 7 0 8 0; +#X connect 8 0 10 0; +#X connect 8 1 9 1; +#X connect 9 0 5 0; +#X connect 10 0 11 0; +#X connect 11 0 12 0; +#X connect 11 0 14 0; +#X connect 12 0 10 1; +#X connect 13 0 10 1; +#X connect 14 0 13 0; +#X connect 14 0 9 0; +#X restore 90 302 pd loc&precess; +#N canvas 0 0 600 400 setlocprecess 0; +#X obj 173 82 inlet; +#X obj 73 80 inlet; +#X obj 169 105 s speed; +#X obj 74 105 s location; +#X connect 0 0 2 0; +#X connect 1 0 3 0; +#X restore 90 353 pd setlocprecess; +#X msg 47 313 0; +#X obj 612 162 adc~; +#X obj 283 361 s transpo; +#X obj 283 285 r transpo; +#X msg 283 311 set \$1; +#X msg 423 268 \; location 0 \; speed 200; +#N canvas 138 111 767 761 hanning-window 0; +#X obj 92 206 phasor~; +#X obj 92 234 cos~; +#X obj 23 328 tabwrite~ hanning; +#X obj 30 252 -~; +#X obj 28 218 sig~ 1; +#X msg 37 180 0; +#X text 141 13 CALCULATE HANNING; +#X text 141 27 WINDOW TABLE; +#X graph graph1 0 -1 4096 1 275 581 675 281; +#X array hanning 4096 float; +#X pop; +#X obj 93 171 sig~; +#X text 175 148 sample rate / window size; +#X msg 23 144 bang; +#X obj 66 269 sig~ 0.5; +#X obj 49 300 *~; +#X obj 94 80 samplerate~; +#X obj 25 23 r window-size; +#X obj 25 53 t b f; +#X msg 275 547 \; hanning resize 4096; +#X obj 93 132 /; +#X connect 0 0 1 0; +#X connect 1 0 3 1; +#X connect 3 0 13 0; +#X connect 4 0 3 0; +#X connect 5 0 0 1; +#X connect 9 0 0 0; +#X connect 11 0 2 0; +#X connect 11 0 5 0; +#X connect 12 0 13 1; +#X connect 13 0 2 0; +#X connect 14 0 18 0; +#X connect 15 0 16 0; +#X connect 16 0 14 0; +#X connect 16 0 11 0; +#X connect 16 1 18 1; +#X connect 18 0 9 0; +#X restore 423 464 pd hanning-window; +#X msg 31 172 \; window-size 2048 \; transpo 0 \; pd dsp 1; +#X floatatom 587 68; +#N canvas 194 37 397 591 output 0; +#X obj 62 191 t b; +#X obj 62 144 f; +#X obj 62 96 inlet; +#X text 67 76 mute; +#X obj 62 215 f; +#X msg 127 230 0; +#X msg 62 120 bang; +#X obj 62 167 moses 1; +#X obj 127 207 t b f; +#X obj 91 417 outlet; +#X msg 91 393 set \$1; +#X obj 175 154 moses 1; +#X obj 212 419 dbtorms; +#X obj 212 443 pack 0 100; +#X obj 175 130 r master-lvl; +#X obj 91 360 r master-lvl; +#X obj 78 269 s master-lvl; +#X obj 212 467 s master-amp; +#X connect 0 0 4 0; +#X connect 1 0 7 0; +#X connect 2 0 6 0; +#X connect 4 0 16 0; +#X connect 5 0 16 0; +#X connect 6 0 1 0; +#X connect 7 0 0 0; +#X connect 7 1 8 0; +#X connect 8 0 5 0; +#X connect 10 0 9 0; +#X connect 11 1 4 1; +#X connect 12 0 13 0; +#X connect 13 0 17 0; +#X connect 14 0 1 1; +#X connect 14 0 11 0; +#X connect 15 0 10 0; +#X connect 15 0 12 0; +#X restore 587 44 pd output; +#X msg 587 20 mute; +#X text 624 60 MASTER; +#X text 623 74 LEVEL; +#X obj 587 92 s master-lvl; +#X text 41 153 click here first; +#X text 261 3 PHASE VOCODER; +#X obj 87 486 line~; +#X obj 87 462 r master-amp; +#X text 108 30 This is a Fourier-based analysis/resynthesis tool.; +#X text 55 251 set location; +#X text 54 265 and stop; +#X text 54 279 precession; +#X text 172 250 precession; +#X text 171 266 speed in; +#X text 171 280 hundredths; +#X text 281 244 transposition; +#X text 282 262 in cents; +#X text 491 223 examples; +#X text 428 248 contraction; +#X text 542 247 expansion; +#X msg 531 270 \; location 0 \; speed 10; +#X obj 425 340 loadbang; +#X obj 429 363 samplerate~; +#X obj 425 385 s sample-rate; +#N canvas 132 255 634 327 insample 0; +#X graph graph1 0 -1 155947 1 199 168 599 18; +#X array sample 155948 float; +#X pop; +#X obj 19 70 r read-sample; +#X obj 19 95 unpack s f; +#X obj 53 121 s insamprate; +#X obj 19 171 soundfiler; +#X msg 19 147 read -resize \$1 sample; +#X obj 19 201 s insamplength; +#X msg 357 197 \; sample resize 220500 \; insamplength 220500; +#X connect 1 0 2 0; +#X connect 2 0 5 0; +#X connect 2 1 3 0; +#X connect 4 0 6 0; +#X connect 5 0 4 0; +#X restore 425 415 pd insample; +#X msg 196 146 \; read-sample ../sound/bell.aiff \; transpo 0; +#X msg 196 197 \; read-sample ../sound/voice.wav \; transpo -530; +#X text 107 99 The second soundfile read button sets the transposition to correct for the 32000 sample rate of the file.; +#X text 108 50 You can move forward or backward in the sample \, or "freeze" at any point using the "precession" and "location" controls. Transposition is in hundredths of a half-tone.; +#X obj 569 184 tabwrite~ sample; +#X connect 0 0 13 0; +#X connect 1 0 50 0; +#X connect 2 0 10 1; +#X connect 3 0 10 0; +#X connect 4 0 7 0; +#X connect 7 0 8 0; +#X connect 8 0 5 0; +#X connect 8 0 5 1; +#X connect 9 0 3 0; +#X connect 9 1 2 0; +#X connect 11 0 3 0; +#X connect 12 0 50 0; +#X connect 14 0 15 0; +#X connect 15 0 0 0; +#X connect 19 0 24 0; +#X connect 20 0 19 0; +#X connect 21 0 20 0; +#X connect 27 0 8 1; +#X connect 28 0 27 0; +#X connect 42 0 43 0; +#X connect 43 0 44 0; diff --git a/pd/doc/4.fft.examples/10.phaselockedvoc.pd b/pd/doc/4.fft.examples/10.phaselockedvoc.pd new file mode 100644 index 00000000..7eea2f57 --- /dev/null +++ b/pd/doc/4.fft.examples/10.phaselockedvoc.pd @@ -0,0 +1,444 @@ +#N canvas 117 53 719 544 12; +#X floatatom 279 354 0 0 0; +#X msg 563 169 bang; +#X floatatom 186 351 0 0 0; +#X floatatom 84 350 0 0 0; +#N canvas 5 5 986 679 fft-analysis 0; +#X obj 177 242 *~; +#X obj 146 242 *~; +#X obj 146 264 -~; +#X obj 242 243 *~; +#X obj 211 243 *~; +#X obj 211 265 +~; +#X obj 256 73 *~; +#X obj 225 73 *~; +#X obj 197 73 *~; +#X obj 166 73 *~; +#X obj 166 95 +~; +#X obj 136 124 *~; +#X obj 49 560 *~; +#X obj 365 179 rfft~; +#X obj 291 34 rfft~; +#X obj 490 598 *~; +#X obj 685 288 r window-size; +#X obj 751 201 r sample-rate; +#X obj 609 234 f; +#X obj 603 52 r sample-rate; +#X obj 578 29 r window-size; +#X obj 601 98 t b f; +#X obj 578 121 /; +#X obj 520 598 *~; +#X obj 50 540 *~; +#X obj 66 517 rifft~; +#X obj 50 586 outlet~; +#X obj 625 446 print~; +#X msg 624 418 bang; +#X text 115 517 inverse real FFT; +#X obj 589 210 bang~; +#X obj 516 424 line~; +#X obj 578 143 * 1000; +#X text 630 136 window size (msec); +#X obj 603 76 * 4; +#X obj 632 159 r speed; +#X obj 709 160 r location; +#X obj 640 235 +; +#X obj 633 200 *; +#X msg 710 188 0; +#X obj 609 341 +; +#X obj 600 298 t f f; +#X msg 516 396 \$1 \, \$2 \$3; +#X obj 516 369 pack 0 0 0; +#X obj 752 229 / 1000; +#X obj 609 269 *; +#X text 639 270 reading location (samples); +#X obj 637 381 / 4; +#X text 669 386 hop size (samples); +#X obj 564 464 sig~; +#X obj 534 463 +~; +#X text 638 82 (overlap times parent SR); +#X text 638 69 local sample rate; +#X obj 103 10 tabreceive~ phase-real; +#X obj 106 124 *~; +#X obj 106 146 +~; +#X obj 106 170 rsqrt~; +#X obj 225 95 -~; +#X obj 147 200 *~; +#X obj 207 200 *~; +#X obj 266 9 tabreceive~ phase-imag; +#X obj 31 481 sig~; +#X obj 14 411 t b f; +#X msg 14 432 1; +#X obj 28 455 /; +#X obj 187 496 tabsend~ phase-real; +#X obj 288 474 tabsend~ phase-imag; +#X obj 50 71 sig~ 1.5e-20; +#X obj 632 180 * 0.01; +#X obj 691 212 s speed; +#X obj 474 263 s see-location; +#X obj 598 618 block~ 2048 4; +#X floatatom 672 360 0 0 0; +#X obj 670 339 *; +#X obj 829 234 r transpo; +#X obj 829 256 * 0.01; +#X obj 831 277 + 69; +#X obj 832 298 mtof; +#X obj 832 320 / 440; +#X obj 689 316 t b f; +#X obj 14 390 r window-size; +#X floatatom 835 353 0 0 0; +#X obj 551 543 tabreceive~ hanning; +#X obj 534 489 tabread4~ sample; +#X obj 516 515 tabread4~ sample; +#X obj 145 422 -~; +#X obj 249 385 r lock; +#X obj 162 291 ../../extra/lrshift~ 1; +#X obj 154 315 ../../extra/lrshift~ -1; +#X obj 227 339 ../../extra/lrshift~ 1; +#X obj 219 363 ../../extra/lrshift~ -1; +#X obj 210 432 -~; +#X obj 161 397 *~ 0; +#X obj 226 408 *~ 0; +#X connect 0 0 2 1; +#X connect 1 0 2 0; +#X connect 2 0 87 0; +#X connect 2 0 88 0; +#X connect 2 0 85 0; +#X connect 3 0 5 1; +#X connect 4 0 5 0; +#X connect 5 0 89 0; +#X connect 5 0 90 0; +#X connect 5 0 91 0; +#X connect 6 0 57 1; +#X connect 7 0 57 0; +#X connect 8 0 10 1; +#X connect 9 0 10 0; +#X connect 10 0 58 1; +#X connect 10 0 54 0; +#X connect 10 0 54 1; +#X connect 11 0 55 1; +#X connect 12 0 26 0; +#X connect 13 0 1 1; +#X connect 13 0 3 1; +#X connect 13 1 0 1; +#X connect 13 1 4 1; +#X connect 14 0 9 1; +#X connect 14 0 7 1; +#X connect 14 1 6 1; +#X connect 14 1 8 1; +#X connect 15 0 14 0; +#X connect 16 0 73 0; +#X connect 17 0 44 0; +#X connect 18 0 37 0; +#X connect 18 0 45 0; +#X connect 18 0 70 0; +#X connect 19 0 34 0; +#X connect 20 0 22 0; +#X connect 21 0 22 0; +#X connect 21 1 22 1; +#X connect 22 0 32 0; +#X connect 23 0 13 0; +#X connect 24 0 12 0; +#X connect 25 0 24 1; +#X connect 28 0 27 0; +#X connect 30 0 18 0; +#X connect 31 0 27 0; +#X connect 31 0 50 0; +#X connect 31 0 84 0; +#X connect 32 0 43 2; +#X connect 32 0 38 1; +#X connect 34 0 21 0; +#X connect 35 0 68 0; +#X connect 36 0 39 0; +#X connect 36 0 18 1; +#X connect 37 0 18 1; +#X connect 38 0 37 1; +#X connect 39 0 69 0; +#X connect 40 0 43 1; +#X connect 41 0 43 0; +#X connect 41 1 40 0; +#X connect 42 0 31 0; +#X connect 43 0 42 0; +#X connect 44 0 45 1; +#X connect 45 0 41 0; +#X connect 47 0 49 0; +#X connect 49 0 50 1; +#X connect 50 0 83 0; +#X connect 53 0 9 0; +#X connect 53 0 6 0; +#X connect 54 0 55 0; +#X connect 55 0 56 0; +#X connect 56 0 58 0; +#X connect 56 0 59 0; +#X connect 57 0 59 1; +#X connect 57 0 11 0; +#X connect 57 0 11 1; +#X connect 58 0 1 0; +#X connect 58 0 4 0; +#X connect 59 0 0 0; +#X connect 59 0 3 0; +#X connect 60 0 7 0; +#X connect 60 0 8 0; +#X connect 61 0 24 0; +#X connect 62 0 63 0; +#X connect 62 1 64 1; +#X connect 63 0 64 0; +#X connect 64 0 61 0; +#X connect 67 0 10 0; +#X connect 68 0 38 0; +#X connect 72 0 47 0; +#X connect 72 0 40 1; +#X connect 73 0 72 0; +#X connect 74 0 75 0; +#X connect 75 0 76 0; +#X connect 76 0 77 0; +#X connect 77 0 78 0; +#X connect 78 0 79 0; +#X connect 78 0 81 0; +#X connect 79 0 73 0; +#X connect 79 1 73 1; +#X connect 80 0 62 0; +#X connect 82 0 23 1; +#X connect 82 0 15 1; +#X connect 82 0 12 1; +#X connect 83 0 23 0; +#X connect 84 0 15 0; +#X connect 85 0 65 0; +#X connect 85 0 25 0; +#X connect 86 0 93 1; +#X connect 86 0 92 1; +#X connect 87 0 92 0; +#X connect 88 0 92 0; +#X connect 89 0 93 0; +#X connect 90 0 93 0; +#X connect 91 0 66 0; +#X connect 91 0 25 1; +#X connect 92 0 85 1; +#X connect 93 0 91 1; +#X restore 37 422 pd fft-analysis; +#X obj 37 508 dac~; +#N canvas 260 23 647 768 phase-tables 0; +#N canvas 0 0 450 300 graph2 0; +#X array phase-imag 4096 float 0; +#X coords 0 1 4096 -1 400 300 1; +#X restore 172 290 graph; +#N canvas 0 0 450 300 graph3 0; +#X array phase-real 4096 float 0; +#X coords 0 1 4096 -1 400 300 1; +#X restore 170 17 graph; +#X msg 167 564 \; phase-real resize 4096 \; phase-imag resize 4096 +; +#X restore 419 489 pd phase-tables; +#X obj 37 448 hip~ 5; +#X obj 37 478 *~; +#N canvas 249 280 600 398 loc&precess 0; +#X floatatom 160 229 0 0 0; +#X msg 270 175 set \$1; +#X obj 269 207 outlet; +#X obj 83 267 outlet; +#X obj 171 71 r location; +#X msg 82 235 set \$1; +#X obj 269 149 r speed; +#X obj 55 70 r see-location; +#X obj 67 102 t b f; +#X obj 82 214 f; +#X obj 54 127 int; +#X obj 54 151 sel 0; +#X msg 153 102 1; +#X msg 201 101 0; +#X obj 110 179 del 300; +#X connect 1 0 2 0; +#X connect 4 0 8 0; +#X connect 5 0 3 0; +#X connect 6 0 1 0; +#X connect 7 0 8 0; +#X connect 8 0 10 0; +#X connect 8 1 9 1; +#X connect 9 0 5 0; +#X connect 10 0 11 0; +#X connect 11 0 12 0; +#X connect 11 0 14 0; +#X connect 12 0 10 1; +#X connect 13 0 10 1; +#X connect 14 0 13 0; +#X connect 14 0 9 0; +#X restore 84 322 pd loc&precess; +#N canvas 0 0 600 400 setlocprecess 0; +#X obj 173 82 inlet; +#X obj 73 80 inlet; +#X obj 169 105 s speed; +#X obj 74 105 s location; +#X connect 0 0 2 0; +#X connect 1 0 3 0; +#X restore 84 373 pd setlocprecess; +#X msg 41 333 0; +#X obj 606 182 adc~; +#X obj 279 379 s transpo; +#X obj 277 305 r transpo; +#X msg 277 331 set \$1; +#X msg 404 287 \; location 0 \; speed 200; +#N canvas 138 111 767 761 hanning-window 0; +#X obj 92 206 phasor~; +#X obj 92 234 cos~; +#X obj 23 328 tabwrite~ hanning; +#X obj 30 252 -~; +#X obj 28 218 sig~ 1; +#X msg 37 180 0; +#X text 141 13 CALCULATE HANNING; +#X text 141 27 WINDOW TABLE; +#N canvas 0 0 450 300 graph1 0; +#X array hanning 4096 float 0; +#X coords 0 1 4096 -1 400 300 1; +#X restore 275 281 graph; +#X obj 93 171 sig~; +#X text 175 148 sample rate / window size; +#X msg 23 144 bang; +#X obj 66 269 sig~ 0.5; +#X obj 49 300 *~; +#X obj 94 80 samplerate~; +#X obj 25 23 r window-size; +#X obj 25 53 t b f; +#X msg 275 547 \; hanning resize 4096; +#X obj 93 132 /; +#X connect 0 0 1 0; +#X connect 1 0 3 1; +#X connect 3 0 13 0; +#X connect 4 0 3 0; +#X connect 5 0 0 1; +#X connect 9 0 0 0; +#X connect 11 0 2 0; +#X connect 11 0 5 0; +#X connect 12 0 13 1; +#X connect 13 0 2 0; +#X connect 14 0 18 0; +#X connect 15 0 16 0; +#X connect 16 0 14 0; +#X connect 16 0 11 0; +#X connect 16 1 18 1; +#X connect 18 0 9 0; +#X restore 417 512 pd hanning-window; +#X msg 25 192 \; window-size 2048 \; transpo 0 \; pd dsp 1; +#X floatatom 587 68 0 0 0; +#N canvas 194 37 397 591 output 0; +#X obj 62 191 t b; +#X obj 62 144 f; +#X obj 62 96 inlet; +#X text 67 76 mute; +#X obj 62 215 f; +#X msg 127 230 0; +#X msg 62 120 bang; +#X obj 62 167 moses 1; +#X obj 127 207 t b f; +#X obj 91 417 outlet; +#X msg 91 393 set \$1; +#X obj 175 154 moses 1; +#X obj 212 419 dbtorms; +#X obj 212 443 pack 0 100; +#X obj 175 130 r master-lvl; +#X obj 91 360 r master-lvl; +#X obj 78 269 s master-lvl; +#X obj 212 467 s master-amp; +#X connect 0 0 4 0; +#X connect 1 0 7 0; +#X connect 2 0 6 0; +#X connect 4 0 16 0; +#X connect 5 0 16 0; +#X connect 6 0 1 0; +#X connect 7 0 0 0; +#X connect 7 1 8 0; +#X connect 8 0 5 0; +#X connect 10 0 9 0; +#X connect 11 1 4 1; +#X connect 12 0 13 0; +#X connect 13 0 17 0; +#X connect 14 0 1 1; +#X connect 14 0 11 0; +#X connect 15 0 10 0; +#X connect 15 0 12 0; +#X restore 587 44 pd output; +#X msg 587 20 mute; +#X text 624 60 MASTER; +#X text 623 74 LEVEL; +#X obj 587 92 s master-lvl; +#X text 35 173 click here first; +#X obj 81 506 line~; +#X obj 81 482 r master-amp; +#X text 49 271 set location; +#X text 48 285 and stop; +#X text 48 299 precession; +#X text 166 270 precession; +#X text 165 286 speed in; +#X text 165 300 hundredths; +#X text 275 264 transposition; +#X text 276 282 in cents; +#X text 512 242 examples; +#X text 407 266 contraction; +#X text 623 265 expansion; +#X msg 612 288 \; location 0 \; speed 10; +#X obj 419 360 loadbang; +#X obj 423 383 samplerate~; +#X obj 419 405 s sample-rate; +#N canvas 132 255 846 368 insample 0; +#N canvas 0 0 450 300 graph1 0; +#X array sample 92615 float 0; +#X coords 0 1 92614 -1 400 150 1; +#X restore 406 155 graph; +#X obj 12 19 r read-sample; +#X obj 12 132 unpack s f; +#X obj 46 158 s insamprate; +#X obj 12 208 soundfiler; +#X msg 12 184 read -resize \$1 sample; +#X obj 12 238 s insamplength; +#X msg 20 289 \; sample resize 220500 \; insamplength 220500; +#X obj 22 46 inlet; +#X obj 22 73 openpanel; +#X obj 22 101 pack s 50; +#X connect 1 0 2 0; +#X connect 2 0 5 0; +#X connect 2 1 3 0; +#X connect 4 0 6 0; +#X connect 5 0 4 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X connect 10 0 2 0; +#X restore 419 463 pd insample; +#X msg 190 163 \; read-sample ../sound/bell.aiff \; transpo 0; +#X msg 190 217 \; read-sample ../sound/voice.wav \; transpo -530; +#X obj 563 204 tabwrite~ sample; +#X obj 583 411 s lock; +#X floatatom 583 386 0 0 0; +#X msg 584 359 0; +#X msg 618 358 1; +#X text 135 18 PHASE LOCKING VOCODER; +#X text 32 46 This is a spin on the phase vocoder which prevents beating +between adjacent channels of the FFT. This is described in "Phase Locked +Vocoder" (reprinted on MSP's web page) and further improved by Laroche +and Dolson \, reported in ICMC97.; +#X obj 419 440 bng 15 250 50 0 empty empty read-sample 20 8 0 12 -262144 +-1 -1; +#X text 528 265 normal; +#X msg 507 288 \; location 0 \; speed 100; +#X connect 0 0 13 0; +#X connect 1 0 46 0; +#X connect 2 0 10 1; +#X connect 3 0 10 0; +#X connect 4 0 7 0; +#X connect 7 0 8 0; +#X connect 8 0 5 0; +#X connect 8 0 5 1; +#X connect 9 0 3 0; +#X connect 9 1 2 0; +#X connect 11 0 3 0; +#X connect 12 0 46 0; +#X connect 14 0 15 0; +#X connect 15 0 0 0; +#X connect 19 0 24 0; +#X connect 20 0 19 0; +#X connect 21 0 20 0; +#X connect 26 0 8 1; +#X connect 27 0 26 0; +#X connect 40 0 41 0; +#X connect 41 0 42 0; +#X connect 48 0 47 0; +#X connect 49 0 48 0; +#X connect 50 0 48 0; +#X connect 53 0 43 0; diff --git a/pd/doc/4.fft.examples/11.pianorev.pd b/pd/doc/4.fft.examples/11.pianorev.pd new file mode 100644 index 00000000..ad7f8e7f --- /dev/null +++ b/pd/doc/4.fft.examples/11.pianorev.pd @@ -0,0 +1,378 @@ +#N canvas 48 26 570 543 12; +#N canvas 52 71 774 520 previous-analysis 0; +#X graph graph1 0 -1 2048 1 103 165 303 15; +#X array last-real 2048 float; +#X pop; +#X graph graph2 0 -1 2048 1 497 156 697 6; +#X array last-imag 2048 float; +#X pop; +#X graph graph1 0 -1 2048 1 105 335 305 185; +#X array phase-real 2048 float; +#X pop; +#X graph graph2 0 -1 2048 1 501 328 701 178; +#X array phase-imag 2048 float; +#X pop; +#X msg 106 541 \; last-real resize 2048 \; last-imag resize 2048 \; phase-real resize 2048 \; phase-imag resize 2048 \; inc-real resize 2048 \; inc-imag resize 2048; +#X graph graph1 0 -1 2048 1 105 507 305 357; +#X array inc-real 2048 float; +#X pop; +#X graph graph2 0 -1 2048 1 503 492 703 342; +#X array inc-imag 2048 float; +#X pop; +#X restore 411 384 pd previous-analysis; +#N canvas 29 2 866 679 fft 0; +#X obj 14 640 *~; +#X obj 422 576 *~; +#X obj 396 576 *~; +#X obj 480 576 *~; +#X obj 455 576 *~; +#X obj 455 598 +~; +#X obj 395 601 -~; +#X obj 138 480 *~; +#X obj 531 332 -~; +#X obj 505 528 +~; +#X obj 531 528 *~; +#X obj 458 330 -~; +#X obj 431 526 +~; +#X obj 458 526 *~; +#X obj 159 336 -~; +#X obj 133 373 +~; +#X obj 159 373 *~; +#X obj 201 138 *~; +#X obj 172 138 *~; +#X obj 172 159 +~; +#X obj 351 288 *~; +#X obj 325 288 *~; +#X obj 404 115 *~; +#X obj 379 115 *~; +#X obj 336 116 *~; +#X obj 311 116 *~; +#X obj 181 408 *~; +#X obj 154 409 *~; +#X obj 198 37 *~; +#X obj 14 662 outlet~; +#X obj 14 615 *~; +#X obj 18 16 tabreceive~ hanning-window; +#X obj 537 561 block~ 2048 4; +#X obj 214 12 inlet~; +#X obj 198 58 rfft~; +#X obj 30 591 rifft~; +#X obj 30 99 tabsend~ last-real; +#X obj 30 130 tabsend~ last-imag; +#X obj 154 431 rsqrt~; +#X obj 311 138 +~; +#X obj 379 137 -~; +#X obj 35 255 tabreceive~ inc-real; +#X obj 69 278 tabreceive~ inc-imag; +#X obj 430 202 tabreceive~ phase-real; +#X obj 502 225 tabreceive~ phase-imag; +#X obj 325 309 +~; +#X obj 75 335 -~; +#X obj 354 40 tabreceive~ last-real; +#X obj 414 62 tabreceive~ last-imag; +#X obj 48 372 +~; +#X obj 75 372 *~; +#X obj 51 479 *~; +#X obj 191 454 r gain; +#X obj 46 560 tabsend~ inc-real; +#X obj 64 519 tabsend~ inc-imag; +#X obj 391 649 tabsend~ phase-real; +#X obj 453 620 tabsend~ phase-imag; +#X obj 52 618 sig~ 0.0002; +#X obj 60 217 *~ 0; +#X obj 154 453 *~ 0; +#N canvas 167 161 699 396 decision 0; +#X obj 63 32 inlet~; +#X obj 64 272 outlet~; +#X obj 64 114 -~; +#X obj 64 157 clip~ 0 1; +#X obj 64 135 *~ 1e+20; +#X obj 135 31 inlet~; +#X text 139 136 1 if new sig; +#X text 138 147 stronger than; +#X text 140 159 old one; +#X obj 245 130 -~; +#X obj 259 105 ../../extra/lrshift~ 1; +#X obj 245 178 clip~ 0 1; +#X obj 245 156 *~ 1e+20; +#X obj 421 130 -~; +#X obj 421 178 clip~ 0 1; +#X obj 421 156 *~ 1e+20; +#X obj 435 105 ../../extra/lrshift~ -1; +#X obj 64 214 *~; +#X obj 64 243 *~; +#X connect 0 0 2 0; +#X connect 0 0 10 0; +#X connect 0 0 9 0; +#X connect 0 0 13 0; +#X connect 0 0 16 0; +#X connect 2 0 4 0; +#X connect 3 0 17 0; +#X connect 4 0 3 0; +#X connect 5 0 2 1; +#X connect 9 0 12 0; +#X connect 10 0 9 1; +#X connect 11 0 17 1; +#X connect 12 0 11 0; +#X connect 13 0 15 0; +#X connect 14 0 18 1; +#X connect 15 0 14 0; +#X connect 16 0 13 1; +#X connect 17 0 18 0; +#X connect 18 0 1 0; +#X restore 253 334 pd decision; +#X obj 391 626 +~ 1e-15; +#X obj 46 540 +~ 1e-15; +#X connect 0 0 29 0; +#X connect 1 0 6 1; +#X connect 2 0 6 0; +#X connect 3 0 5 1; +#X connect 4 0 5 0; +#X connect 5 0 56 0; +#X connect 6 0 61 0; +#X connect 7 0 54 0; +#X connect 7 0 1 0; +#X connect 7 0 3 0; +#X connect 8 0 10 0; +#X connect 9 0 35 1; +#X connect 9 0 1 1; +#X connect 9 0 4 1; +#X connect 10 0 9 1; +#X connect 11 0 13 0; +#X connect 12 0 35 0; +#X connect 12 0 2 1; +#X connect 12 0 3 1; +#X connect 13 0 12 1; +#X connect 14 0 16 0; +#X connect 15 0 26 0; +#X connect 15 0 26 1; +#X connect 15 0 7 0; +#X connect 16 0 15 1; +#X connect 17 0 19 1; +#X connect 18 0 19 0; +#X connect 19 0 60 0; +#X connect 20 0 45 1; +#X connect 21 0 45 0; +#X connect 22 0 40 1; +#X connect 23 0 40 0; +#X connect 24 0 39 1; +#X connect 25 0 39 0; +#X connect 26 0 38 0; +#X connect 27 0 38 0; +#X connect 28 0 34 0; +#X connect 30 0 0 0; +#X connect 31 0 28 0; +#X connect 31 0 30 0; +#X connect 33 0 28 1; +#X connect 34 0 25 0; +#X connect 34 0 22 0; +#X connect 34 0 18 0; +#X connect 34 0 18 1; +#X connect 34 0 11 0; +#X connect 34 0 36 0; +#X connect 34 1 24 0; +#X connect 34 1 23 0; +#X connect 34 1 17 0; +#X connect 34 1 17 1; +#X connect 34 1 8 0; +#X connect 34 1 37 0; +#X connect 35 0 30 1; +#X connect 38 0 59 0; +#X connect 39 0 46 0; +#X connect 39 0 58 0; +#X connect 40 0 14 0; +#X connect 41 0 49 0; +#X connect 41 0 46 1; +#X connect 42 0 15 0; +#X connect 42 0 14 1; +#X connect 43 0 21 0; +#X connect 43 0 21 1; +#X connect 43 0 12 0; +#X connect 43 0 11 1; +#X connect 44 0 20 0; +#X connect 44 0 20 1; +#X connect 44 0 9 0; +#X connect 44 0 8 1; +#X connect 45 0 60 1; +#X connect 46 0 50 0; +#X connect 47 0 25 1; +#X connect 47 0 23 1; +#X connect 48 0 24 1; +#X connect 48 0 22 1; +#X connect 49 0 27 0; +#X connect 49 0 27 1; +#X connect 49 0 51 0; +#X connect 50 0 49 1; +#X connect 51 0 2 0; +#X connect 51 0 4 0; +#X connect 51 0 62 0; +#X connect 52 0 59 1; +#X connect 57 0 0 1; +#X connect 58 0 37 0; +#X connect 58 0 36 0; +#X connect 59 0 51 1; +#X connect 59 0 7 1; +#X connect 60 0 50 1; +#X connect 60 0 16 1; +#X connect 60 0 13 1; +#X connect 60 0 10 1; +#X connect 61 0 55 0; +#X connect 62 0 53 0; +#X restore 203 438 pd fft; +#X floatatom 47 260; +#X obj 202 518 dac~; +#N canvas 58 75 719 400 hanning-window 0; +#X obj 99 231 phasor~; +#X obj 99 267 cos~; +#X obj 45 284 -~; +#X obj 43 250 sig~ 1; +#X msg 53 212 0; +#X graph graph1 0 -1 2047 1 393 274 593 124; +#X array hanning-window 2048 float; +#X pop; +#X obj 101 117 r sample-rate; +#X obj 216 119 r window-size; +#X obj 124 145 t b f; +#X obj 101 167 /; +#X obj 99 204 sig~; +#X obj 39 71 r make-window; +#X msg 38 145 bang; +#X obj 31 349 tabwrite~ hanning-window; +#X floatatom 184 204; +#X obj 47 311 *~ 0.5; +#X msg 371 303 \; hanning-window resize 2048; +#X connect 0 0 1 0; +#X connect 1 0 2 1; +#X connect 2 0 15 0; +#X connect 3 0 2 0; +#X connect 4 0 0 1; +#X connect 6 0 9 0; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X connect 8 1 9 1; +#X connect 9 0 10 0; +#X connect 10 0 0 0; +#X connect 11 0 12 0; +#X connect 12 0 4 0; +#X connect 12 0 13 0; +#X connect 15 0 13 0; +#X restore 411 355 pd hanning-window; +#X obj 410 419 loadbang; +#X obj 202 487 *~; +#X obj 262 464 line~; +#X obj 47 464 s gain; +#X msg 47 336 0; +#X msg 410 445 \; sample-rate 44100 \; window-size 2048 \; make-window bang \; gain 0 \;; +#X obj 92 341 t b b f; +#X obj 119 394 /; +#X msg 89 394 1; +#X obj 89 417 -; +#X floatatom 47 442; +#X obj 47 288 * 0.1; +#X floatatom 480 78; +#N canvas 194 37 397 591 output 0; +#X obj 62 191 t b; +#X obj 62 144 f; +#X obj 62 96 inlet; +#X text 67 76 mute; +#X obj 62 215 f; +#X msg 127 230 0; +#X msg 62 120 bang; +#X obj 62 167 moses 1; +#X obj 127 207 t b f; +#X obj 91 417 outlet; +#X msg 91 393 set \$1; +#X obj 175 154 moses 1; +#X obj 212 419 dbtorms; +#X obj 212 443 pack 0 100; +#X obj 175 130 r master-lvl; +#X obj 91 360 r master-lvl; +#X obj 78 269 s master-lvl; +#X obj 212 467 s master-amp; +#X connect 0 0 4 0; +#X connect 1 0 7 0; +#X connect 2 0 6 0; +#X connect 4 0 16 0; +#X connect 5 0 16 0; +#X connect 6 0 1 0; +#X connect 7 0 0 0; +#X connect 7 1 8 0; +#X connect 8 0 5 0; +#X connect 10 0 9 0; +#X connect 11 1 4 1; +#X connect 12 0 13 0; +#X connect 13 0 17 0; +#X connect 14 0 1 1; +#X connect 14 0 11 0; +#X connect 15 0 10 0; +#X connect 15 0 12 0; +#X restore 480 54 pd output; +#X msg 480 30 mute; +#X text 517 70 MASTER; +#X text 516 84 LEVEL; +#X obj 480 102 s master-lvl; +#X obj 262 437 r master-amp; +#X obj 203 339 osc~; +#X obj 282 394 line~; +#X msg 270 268 bang; +#X floatatom 203 316; +#X obj 203 415 *~; +#X obj 271 343 pack 1 0; +#X obj 316 370 pack 0 0; +#X obj 301 316 del; +#X floatatom 338 283; +#X obj 203 293 mtof; +#X floatatom 203 269; +#X obj 203 364 cos~; +#X obj 202 461 hip~ 5; +#X obj 203 388 hip~ 20; +#X obj 48 313 moses 0.1; +#X msg 114 366 0.005; +#X text 131 9 PIANO REVERB; +#X text 42 29 This is intended as an imitation of how the strings of a piano can act as a reverberator. The sound is more "pitched" and less "whispered" than a standard delay-based reverberator (or for that matter \, than a reverberant room.); +#X text 41 88 Many pieces in the literature call for just this effect \, notably Boulez's Dialogue de l'ombre double.; +#X text 40 118 This particular algorithm is actually TOO clean sounding and would have to be chorused to make a serviceable imitation. However \, it might be interesting in its own right.; +#X text 39 173 The technique is to run a phase vocoder \, but only to "punch" the incoming sound into channels where (1) there's a peak \, and (2) the incoming sound drowns out whatever might already be there.; +#X text 27 238 reverb time; +#X text 179 248 test pitch; +#X text 267 249 trigger; +#X text 334 264 duration; +#X connect 1 0 36 0; +#X connect 2 0 16 0; +#X connect 5 0 10 0; +#X connect 6 0 3 0; +#X connect 6 0 3 1; +#X connect 7 0 6 1; +#X connect 9 0 15 0; +#X connect 11 0 13 0; +#X connect 11 1 39 0; +#X connect 11 2 12 1; +#X connect 12 0 14 1; +#X connect 13 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 8 0; +#X connect 16 0 38 0; +#X connect 17 0 22 0; +#X connect 18 0 17 0; +#X connect 19 0 18 0; +#X connect 23 0 7 0; +#X connect 24 0 35 0; +#X connect 25 0 28 1; +#X connect 26 0 29 0; +#X connect 26 0 31 0; +#X connect 27 0 24 0; +#X connect 28 0 1 0; +#X connect 29 0 25 0; +#X connect 30 0 25 0; +#X connect 31 0 30 0; +#X connect 32 0 31 1; +#X connect 32 0 29 1; +#X connect 32 0 30 1; +#X connect 33 0 27 0; +#X connect 34 0 33 0; +#X connect 35 0 37 0; +#X connect 36 0 6 0; +#X connect 37 0 28 0; +#X connect 38 0 9 0; +#X connect 38 1 11 0; +#X connect 39 0 12 0; diff --git a/pd/doc/4.fft.examples/12.sinedecomposer.pd b/pd/doc/4.fft.examples/12.sinedecomposer.pd new file mode 100644 index 00000000..52fb5eb9 --- /dev/null +++ b/pd/doc/4.fft.examples/12.sinedecomposer.pd @@ -0,0 +1,308 @@ +#N struct peak-template float x float y float amp float ampreal float +ampimag; +#N canvas 251 262 858 492 12; +#X msg 501 258 bang; +#X obj 30 360 pack 0 100; +#X obj 30 384 line~; +#X obj 30 336 dbtorms; +#N canvas 95 102 724 400 fft 0; +#X obj 64 67 inlet~; +#X obj 134 107 print~; +#X msg 137 71 bang; +#X obj 64 104 rfft~; +#N canvas 0 0 450 300 graph3 0; +#X array array3 4096 float 0; +#X coords 0 100 4096 -100 400 150 1; +#X restore 254 14 graph; +#N canvas 0 0 450 300 graph4 0; +#X array array4 4096 float 0; +#X coords 0 100 4096 -100 400 150 1; +#X restore 256 165 graph; +#X obj 9 185 tabsend~ array3; +#X obj 50 158 tabsend~ array4; +#X msg 37 246 \; array3 resize 4096 \; array4 resize 4096; +#X obj 62 38 block~ 4096 1; +#X connect 0 0 1 0; +#X connect 0 0 3 0; +#X connect 2 0 1 0; +#X connect 3 0 6 0; +#X connect 3 1 7 0; +#X restore 134 409 pd fft; +#X obj 30 408 *~; +#X obj 29 435 dac~; +#X obj 476 231 adc~; +#N canvas 204 36 521 368 analysis 0; +#X obj 206 37 inlet; +#X msg 207 68 bang; +#X obj 275 52 r snapshot; +#X msg 220 169 4096 array3 array4 50; +#X obj 127 252 print; +#X obj 206 103 t b b b; +#X obj 122 140 s done-analysis; +#X obj 248 133 s start-analysis; +#X obj 220 219 s found-peak; +#X obj 154 194 r loud; +#X obj 128 226 spigot; +#X obj 220 193 ../../extra/pique; +#X connect 0 0 1 0; +#X connect 1 0 5 0; +#X connect 2 0 1 0; +#X connect 3 0 11 0; +#X connect 5 0 6 0; +#X connect 5 1 3 0; +#X connect 5 2 7 0; +#X connect 9 0 10 1; +#X connect 10 0 4 0; +#X connect 11 0 8 0; +#X connect 11 0 10 0; +#X restore 613 295 pd analysis; +#X obj 30 313 r loop-amp; +#X msg 613 271 snapshot; +#X text 10 215 click here first; +#X text 613 247 analysis; +#N canvas 36 255 884 389 peak-saver 0; +#X floatatom 710 310 0 0 0; +#X floatatom 633 309 0 0 0; +#X floatatom 560 305 0 0 0; +#X floatatom 484 303 0 0 0; +#X obj 406 251 pointer; +#X obj 354 150 pointer; +#X msg 374 60 bang; +#X obj 142 243 rmstodb; +#X obj 10 244 * 0.1; +#X obj 141 268 * -3; +#X floatatom 416 300 0 0 0; +#X obj 353 36 r start-analysis; +#X obj 354 89 t b b; +#X msg 29 89 50 60 70; +#X obj 28 120 append peak-template x y amp; +#X msg 426 225 next; +#X obj 402 276 get peak-template x y amp ampreal ampimag; +#X obj 9 293 append peak-template x y amp ampreal ampimag; +#X obj 116 167 r found-peak; +#X obj 117 196 unpack 0 0 0 0 0; +#X msg 76 244 330; +#X msg 400 87 \; pd-peak-list clear; +#X msg 354 125 traverse pd-peak-list \, bang; +#X msg 408 201 traverse pd-peak-list \, next; +#X connect 4 0 16 0; +#X connect 5 0 14 3; +#X connect 5 0 17 5; +#X connect 6 0 12 0; +#X connect 7 0 9 0; +#X connect 8 0 17 0; +#X connect 9 0 17 2; +#X connect 11 0 12 0; +#X connect 12 0 22 0; +#X connect 12 1 21 0; +#X connect 13 0 14 0; +#X connect 15 0 4 0; +#X connect 16 0 10 0; +#X connect 16 1 3 0; +#X connect 16 2 2 0; +#X connect 16 3 1 0; +#X connect 16 4 0 0; +#X connect 18 0 19 0; +#X connect 19 1 8 0; +#X connect 19 2 20 0; +#X connect 19 2 7 0; +#X connect 19 3 17 3; +#X connect 19 4 17 4; +#X connect 20 0 17 1; +#X connect 22 0 5 0; +#X connect 23 0 4 0; +#X restore 339 378 pd peak-saver; +#N canvas 231 169 656 237 peak-template 0; +#X obj 45 90 filledpolygon 3 3 3 0 0 0 amp 0 0; +#X obj 37 16 struct peak-template float x float y float amp float ampreal +float ampimag; +#X restore 339 402 pd peak-template; +#N canvas 0 0 600 382 peak-list 1; +#X scalar peak-template 6.54702 330 -153.451 -0.00206937 -0.00295808 +\;; +#X scalar peak-template 13.0873 330 -226.384 0.0527068 -0.0271798 \; +; +#X scalar peak-template 26.0747 330 -193.145 -0.004041 0.0160602 \; +; +#X scalar peak-template 35.3241 330 -136.068 -0.00162406 0.000891527 +\;; +#X scalar peak-template 39.3259 330 -172.59 0.00700493 0.00274829 \; +; +#X scalar peak-template 50.8632 330 -126.917 0.000847277 0.000991251 +\;; +#X scalar peak-template 58.0851 330 -130.284 -0.00125865 -0.000785961 +\;; +#X scalar peak-template 61.7223 330 -118.759 -0.000665894 -0.000682444 +\;; +#X scalar peak-template 64.533 330 -123.671 -1.31387e-05 0.00115121 +\;; +#X scalar peak-template 70.7855 330 -192.911 -0.0156921 0.00481118 +\;; +#X scalar peak-template 83.2529 330 -128.585 0.00138656 -0.000101125 +\;; +#X scalar peak-template 87.7921 330 -102.858 -0.00011618 -0.000504767 +\;; +#X scalar peak-template 94.7598 330 -96.8563 -6.587e-06 -0.000411354 +\;; +#X scalar peak-template 238.251 330 -157.634 -0.00175515 0.00385829 +\;; +#X scalar peak-template 120.177 330 -149.995 -0.000220136 -0.00315404 +\;; +#X scalar peak-template 127.613 330 -115.813 0.000761733 0.000380684 +\;; +#X scalar peak-template 133.372 330 -93.2528 -7.56087e-05 -0.000350204 +\;; +#X scalar peak-template 140.63 330 -114.426 0.000604011 0.000535798 +\;; +#X scalar peak-template 147.903 330 -101.806 -0.000357742 0.000345682 +\;; +#X scalar peak-template 151.501 330 -102.007 0.000501161 -1.29982e-05 +\;; +#X scalar peak-template 156.14 330 -133.049 -0.00152793 -0.00062287 +\;; +#X scalar peak-template 168.988 330 -98.4353 1.06068e-05 0.000436979 +\;; +#X scalar peak-template 176.71 330 -80.3132 7.61609e-05 -0.000204315 +\;; +#X scalar peak-template 189.731 330 -124.879 -0.00119891 -0.000129939 +\;; +#X scalar peak-template 202.531 330 -84.7508 -0.000188934 0.000176472 +\;; +#X scalar peak-template 210.532 330 -103.669 -0.000493027 -0.000206012 +\;; +#X scalar peak-template 224.973 330 -86.5866 -0.000200658 -0.000191542 +\;; +#X restore 339 426 pd peak-list; +#X msg 37 235 \; pd dsp 1; +#X floatatom 720 273 0 0 0; +#X obj 720 296 s loud; +#X floatatom 557 77 0 0 0; +#N canvas 194 37 730 728 output 0; +#X obj 77 218 t b; +#X obj 77 154 f; +#X obj 66 71 inlet; +#X text 73 46 mute; +#X obj 77 244 f; +#X msg 156 235 0; +#X msg 69 102 bang; +#X obj 77 189 moses 1; +#X obj 169 33 r loop-amp; +#X obj 78 286 s loop-amp; +#X obj 156 179 t b f; +#X obj 93 462 outlet; +#X msg 92 428 set \$1; +#X obj 93 400 r loop-amp; +#X connect 0 0 4 0; +#X connect 1 0 7 0; +#X connect 2 0 6 0; +#X connect 4 0 9 0; +#X connect 5 0 9 0; +#X connect 6 0 1 0; +#X connect 7 0 0 0; +#X connect 7 1 10 0; +#X connect 8 0 1 1; +#X connect 10 0 5 0; +#X connect 10 1 4 1; +#X connect 12 0 11 0; +#X connect 13 0 12 0; +#X restore 557 53 pd output; +#X obj 557 104 s loop-amp; +#X msg 557 30 mute; +#X text 593 80 AMPLITUDE; +#X text 539 189 live sample; +#X text 719 234 print out; +#X text 720 249 peak list; +#X text 168 7 SPECTRAL SNAPSHOTS.; +#X text 15 18 This patch reads a soundfile or records a live sound. +When you click on "snapshot" the peak-list window shows a list of the +sinusoidal peaks that were found at that instant in the sound. You +can also ask for the peak lists to be printed out.; +#N canvas 132 255 634 331 insample 0; +#N canvas 0 0 450 300 graph1 0; +#X array sample 155948 float 0; +#X coords 0 1 155947 -1 400 150 1; +#X restore 199 18 graph; +#X obj 19 70 r read-sample; +#X obj 19 95 unpack s f; +#X obj 53 121 s insamprate; +#X obj 19 171 soundfiler; +#X msg 19 147 read -resize \$1 sample; +#X obj 19 201 s insamplength; +#X msg 357 197 \; sample resize 220500 \; insamplength 220500; +#X connect 1 0 2 0; +#X connect 2 0 5 0; +#X connect 2 1 3 0; +#X connect 4 0 6 0; +#X connect 5 0 4 0; +#X restore 336 350 pd insample; +#X floatatom 134 363 0 0 0; +#N canvas 190 43 405 461 test-signal 0; +#X obj 135 296 tabread4~ sample; +#X obj 135 271 line~; +#X obj 95 146 f; +#X obj 254 46 r insamprate; +#X obj 136 350 *~; +#X obj 171 350 dbtorms; +#X obj 171 327 inlet; +#X obj 135 415 outlet~; +#X obj 146 33 r insamplength; +#X msg 134 247 0 \, \$1 \$2; +#X obj 134 221 pack 0 0; +#X obj 209 190 /; +#X obj 299 99 * 0.001; +#X obj 135 388 hip~ 5; +#X obj 33 5 loadbang; +#X text 242 13 sample playback; +#X msg 33 25 1; +#X obj 33 69 metro 1000; +#X floatatom 33 48 0 0 0; +#X obj 255 75 t b b f; +#X obj 161 84 t b f; +#X connect 0 0 4 0; +#X connect 1 0 0 0; +#X connect 2 0 10 0; +#X connect 3 0 19 0; +#X connect 4 0 13 0; +#X connect 5 0 4 1; +#X connect 6 0 5 0; +#X connect 8 0 20 0; +#X connect 9 0 1 0; +#X connect 10 0 9 0; +#X connect 11 0 10 1; +#X connect 11 0 17 1; +#X connect 12 0 11 1; +#X connect 13 0 7 0; +#X connect 14 0 16 0; +#X connect 16 0 18 0; +#X connect 17 0 2 0; +#X connect 18 0 17 0; +#X connect 19 0 16 0; +#X connect 19 1 11 0; +#X connect 19 2 12 0; +#X connect 20 0 16 0; +#X connect 20 1 11 0; +#X connect 20 1 2 1; +#X restore 134 386 pd test-signal; +#X text 135 341 amplitude; +#X text 204 212 read a sample; +#X msg 128 231 \; read-sample ../sound/bell.aiff 44100; +#X text 12 97 The active ingredient is "pique" in the "analysis" subwindow +\, which is in the "extras" directory in the Pd release.; +#X msg 124 275 \; read-sample ../sound/voice.wav 32000; +#X obj 458 295 tabwrite~ sample; +#X connect 0 0 37 0; +#X connect 1 0 2 0; +#X connect 2 0 5 0; +#X connect 3 0 1 0; +#X connect 5 0 6 0; +#X connect 5 0 6 1; +#X connect 7 0 37 0; +#X connect 9 0 3 0; +#X connect 10 0 8 0; +#X connect 17 0 18 0; +#X connect 19 0 21 0; +#X connect 20 0 19 0; +#X connect 22 0 20 0; +#X connect 30 0 31 0; +#X connect 31 0 4 0; +#X connect 31 0 5 1; diff --git a/pd/doc/4.fft.examples/13.partialtracer.pd b/pd/doc/4.fft.examples/13.partialtracer.pd new file mode 100644 index 00000000..5458f900 --- /dev/null +++ b/pd/doc/4.fft.examples/13.partialtracer.pd @@ -0,0 +1,783 @@ +#N canvas 234 52 720 591 12; +#X floatatom 598 72; +#N canvas 516 98 663 557 boo 0; +#X obj 79 108 outlet; +#X msg 78 80 set \$1; +#X obj 79 57 r osc-amp; +#X connect 1 0 0 0; +#X connect 2 0 1 0; +#X restore 598 52 pd; +#X obj 598 93 s osc-amp; +#X obj 93 513 pack 0 100; +#X obj 94 533 line~; +#X obj 93 493 dbtorms; +#X obj 94 573 *~; +#X floatatom 624 225; +#X msg 514 269 0; +#X floatatom 567 225; +#X floatatom 645 290; +#X floatatom 498 71; +#N canvas 516 98 663 555 boo 0; +#X obj 79 108 outlet; +#X msg 78 80 set \$1; +#X obj 79 57 r grain-amp; +#X connect 1 0 0 0; +#X connect 2 0 1 0; +#X restore 498 51 pd; +#N canvas 201 90 556 354 analysis 0; +#X obj 220 45 r snapshot; +#X obj 62 283 print; +#X obj 106 154 t b b b; +#X obj 20 189 s done-analysis; +#X obj 209 149 s start-analysis; +#X obj 161 261 s found-peak; +#X obj 107 263 r loud; +#X obj 63 262 spigot; +#X msg 138 101 1; +#X obj 31 99 r fft-done; +#X obj 31 129 spigot; +#X msg 110 101 0; +#X obj 222 84 del 0.01; +#X msg 221 66 bang; +#X text 183 103 Wait for the next FFT to come by before doing the peak search.; +#X obj 341 176 r errthresh; +#X msg 343 219 errthresh \$1; +#X floatatom 341 199; +#X obj 212 173 r window-size; +#X obj 169 190 f; +#X msg 162 211 \$1 fft-real fft-imag 10; +#X obj 162 231 pique; +#X connect 0 0 13 0; +#X connect 2 0 3 0; +#X connect 2 1 19 0; +#X connect 2 2 4 0; +#X connect 2 2 11 0; +#X connect 6 0 7 1; +#X connect 7 0 1 0; +#X connect 8 0 10 1; +#X connect 9 0 10 0; +#X connect 10 0 2 0; +#X connect 11 0 10 1; +#X connect 12 0 8 0; +#X connect 13 0 12 0; +#X connect 15 0 17 0; +#X connect 16 0 21 0; +#X connect 17 0 16 0; +#X connect 18 0 19 1; +#X connect 19 0 20 0; +#X connect 20 0 21 0; +#X connect 21 0 5 0; +#X connect 21 0 7 0; +#X restore 270 411 pd analysis; +#N canvas 168 244 411 214 peak-template 0; +#X obj 62 52 filledpolygon 3 3 3 0 0 0 amp 0 0; +#X obj 57 10 template float x float y float amp float ampreal float ampimag float used; +#X restore 270 516 pd peak-template; +#N canvas 0 0 600 386 peak-list 0; +#X restore 270 454 pd peak-list; +#N canvas 20 23 472 426 trace-list 1; +#X restore 270 494 pd trace-list; +#N canvas 56 84 527 179 trace-template 0; +#X obj 93 72 plot bazoo 0 1 0 500 5; +#X obj 96 36 template float x float y float voiceno array bazoo point-template; +#X text 93 93 This template describes a pitch/amplitude trace. The array "bazoo" holds the actual points. In this template \, y is always 0 and x is the starting location in pixels. There are 5 pixels per point.; +#X restore 270 537 pd trace-template; +#N canvas 96 258 494 158 point-template 0; +#X text 98 56 This template describes a single point on a pitch trace (cf. trace-template w describes the trace itself.); +#X obj 163 14 template float y float amp; +#X text 98 89 "y" is the field that is shown on the graph \; it's - 4 * pitch. You also get an "amp" field in dB \, which you can't see as a plot (yet).; +#X restore 270 557 pd point-template; +#X msg 574 506 bang; +#X obj 6 425 pack 0 100; +#X obj 6 449 line~; +#X obj 6 405 dbtorms; +#X floatatom 419 70; +#N canvas 194 37 730 722 output 0; +#X obj 227 76 t b f; +#X obj 220 100 +; +#X obj 396 207 f; +#X obj 409 165 f; +#X obj 276 210 f; +#X obj 64 179 t b; +#X obj 63 127 f; +#X obj 55 58 inlet; +#X text 60 37 mute; +#X obj 64 201 f; +#X msg 181 153 0; +#X msg 57 84 bang; +#X obj 64 155 moses 1; +#X obj 178 69 t b f; +#X obj 171 93 +; +#X obj 139 27 r loop-amp; +#X obj 304 26 r osc-amp; +#X obj 64 236 s loop-amp; +#X obj 276 235 s osc-amp; +#X obj 455 125 print; +#X obj 143 148 f; +#X obj 288 168 f; +#X obj 173 120 t b b; +#X obj 425 23 r grain-amp; +#X obj 397 232 s grain-amp; +#X connect 0 0 1 0; +#X connect 0 1 1 1; +#X connect 1 0 6 1; +#X connect 2 0 24 0; +#X connect 3 0 2 1; +#X connect 4 0 18 0; +#X connect 5 0 9 0; +#X connect 5 0 4 0; +#X connect 5 0 2 0; +#X connect 6 0 12 0; +#X connect 7 0 11 0; +#X connect 9 0 17 0; +#X connect 10 0 17 0; +#X connect 10 0 18 0; +#X connect 10 0 24 0; +#X connect 11 0 6 0; +#X connect 12 0 5 0; +#X connect 12 1 22 0; +#X connect 13 0 14 0; +#X connect 13 1 14 1; +#X connect 14 0 1 0; +#X connect 15 0 14 0; +#X connect 15 0 20 1; +#X connect 16 0 13 0; +#X connect 16 0 21 1; +#X connect 20 0 9 1; +#X connect 21 0 4 1; +#X connect 22 0 10 0; +#X connect 22 1 20 0; +#X connect 22 1 21 0; +#X connect 22 1 3 0; +#X connect 23 0 3 1; +#X connect 23 0 0 0; +#X restore 631 69 pd output; +#N canvas 516 98 663 559 /SUBPATCH/ 0; +#X obj 79 108 outlet; +#X msg 78 80 set \$1; +#X obj 79 57 r loop-amp; +#X connect 1 0 0 0; +#X connect 2 0 1 0; +#X restore 419 50 pd; +#N canvas 209 96 518 375 fft 0; +#X floatatom 235 194; +#X obj 349 160 r sample-rate; +#X obj 349 180 t b f; +#X obj 234 169 r window-size; +#X obj 203 38 r sample-rate; +#X obj 183 16 r window-size; +#X obj 203 58 t b f; +#X obj 183 83 /; +#X obj 131 103 bang~; +#X obj 130 175 line~; +#X obj 183 104 * 1000; +#X text 229 104 window size (msec); +#X obj 129 281 rfft~; +#X obj 131 337 tabsend~ fft-real; +#X obj 159 307 tabsend~ fft-imag; +#X obj 330 140 r location; +#X obj 330 205 *; +#X obj 330 228 * 0.001; +#X text 383 228 location (samples); +#X obj 130 129 f; +#X msg 130 152 0 \, 1 \$1; +#X obj 87 201 *~; +#X obj 87 224 -~; +#X obj 62 301 *~; +#X obj 62 324 outlet~; +#X floatatom 330 252; +#X obj 41 127 s fft-done; +#X obj 51 31 block~ 2048 1; +#X obj 129 255 tabread4~ sample; +#X obj 130 211 *~ 0; +#X obj 129 232 +~ 0; +#X connect 1 0 2 0; +#X connect 2 0 16 0; +#X connect 2 1 16 1; +#X connect 3 0 0 0; +#X connect 3 0 29 1; +#X connect 4 0 6 0; +#X connect 5 0 7 0; +#X connect 6 0 7 0; +#X connect 6 1 7 1; +#X connect 7 0 10 0; +#X connect 8 0 19 0; +#X connect 8 0 26 0; +#X connect 9 0 21 0; +#X connect 9 0 21 1; +#X connect 9 0 22 1; +#X connect 9 0 29 0; +#X connect 10 0 19 1; +#X connect 12 0 13 0; +#X connect 12 1 14 0; +#X connect 15 0 16 0; +#X connect 16 0 17 0; +#X connect 17 0 25 0; +#X connect 17 0 30 1; +#X connect 19 0 20 0; +#X connect 20 0 9 0; +#X connect 21 0 22 0; +#X connect 22 0 23 0; +#X connect 23 0 24 0; +#X connect 28 0 12 0; +#X connect 28 0 23 1; +#X connect 29 0 30 0; +#X connect 30 0 28 0; +#X restore 17 470 pd fft; +#X obj 6 493 *~; +#X obj 7 544 hip~ 5; +#X obj 7 571 dac~; +#X obj 580 529 adc~; +#X obj 419 91 s loop-amp; +#X msg 631 48 mute; +#X text 13 127 click here first; +#X text 570 489 live sample; +#X text 521 25 AMPLITUDES; +#N canvas 5 1 864 622 make-trace 0; +#X obj 143 220 * -0.33333; +#X obj 70 216 * 10; +#X obj 91 136 pointer; +#X msg 91 115 next; +#X obj 91 97 until; +#X obj 298 134 pointer; +#X msg 299 108 next; +#X obj 154 330 unpack; +#X obj 196 332 s amp; +#X obj 218 378 s frequency; +#X obj 231 361 s pitch; +#X obj 193 375 f 0; +#X obj 154 348 t b b b b f; +#X obj 601 133 pointer; +#X obj 572 602 setsize trace-template bazoo; +#X obj 572 514 random 200; +#X obj 572 532 + 100; +#X obj 659 526 pointer; +#X obj 168 532 pointer; +#X floatatom 274 524; +#X floatatom 228 550; +#X msg 158 509 bang; +#X floatatom 83 461; +#X floatatom 31 509; +#X floatatom 118 590; +#X floatatom 397 556; +#X floatatom 274 489; +#X floatatom 513 511; +#X obj 370 464 pointer; +#X msg 391 447 next; +#X floatatom 409 512; +#X obj 397 539 getsize trace-template bazoo; +#X obj 98 563 get point-template y; +#X obj 31 533 set point-template y; +#X obj 78 486 element trace-template bazoo; +#X obj 228 580 setsize trace-template bazoo; +#X obj 274 507 set trace-template x; +#X obj 274 542 set trace-template y; +#X msg 572 497 bang; +#X obj 572 549 append trace-template x; +#X obj 399 489 get trace-template x y; +#X obj 572 567 t b p; +#X msg 572 584 5; +#X obj 628 93 s clear-traces; +#X obj 602 155 s last-in-list; +#X msg 600 43 bang; +#X obj 600 60 t b b; +#X obj 573 156 f 0; +#X obj 572 176 s nframe; +#X obj 342 337 r nframe; +#X obj 330 356 f; +#X obj 330 373 + 1; +#X obj 330 391 s nframe; +#X obj 330 296 r done-frame; +#X obj 336 315 s done-adding-traces; +#X obj 15 309 r component; +#X obj 15 326 unpack; +#X obj 56 331 s amp; +#X obj 80 370 s frequency; +#X obj 92 354 s pitch; +#X obj 54 388 s added-to-trace; +#X obj 54 370 f 0; +#X obj 48 408 s add-to-trace; +#X obj 15 344 t b b b b f; +#X obj 600 25 r clear-all; +#X obj 154 311 r component2; +#X obj 193 393 s started-new-trace; +#X obj 185 414 s start-new-trace; +#X obj 273 41 r done-analysis; +#X obj 273 62 t b b b b; +#X obj 225 176 r added-to-trace; +#X obj 299 89 until; +#X obj 351 172 get peak-template x amp; +#X obj 425 195 * -0.33333; +#X obj 351 190 * 10; +#X obj 351 210 pack; +#X obj 351 226 s component; +#X obj 92 337 ftom; +#X obj 298 155 t b p p; +#X obj 197 196 set peak-template used; +#X obj 199 176 f; +#X obj 232 344 ftom; +#X msg 135 31 \; done-frame bang; +#X obj 16 178 get peak-template used x amp; +#X obj 27 236 pack 0 0 0; +#X obj 27 255 route 0; +#X obj 27 272 s component2; +#X obj 422 260 print x1; +#X obj 174 276 print x2; +#X obj 559 255 add-trace 1; +#X obj 560 274 add-trace 2; +#X obj 560 291 add-trace 3; +#X obj 559 309 add-trace 4; +#X obj 560 328 add-trace 5; +#X obj 560 345 add-trace 6; +#X obj 560 363 add-trace 7; +#X obj 561 381 add-trace 8; +#X obj 561 399 add-trace 9; +#X obj 561 417 add-trace 10; +#X msg 372 111 traverse pd-peak-list; +#X msg 601 115 traverse pd-trace-list \, bang; +#X msg 641 59 \; pd-trace-list clear; +#X msg 370 430 traverse pd-trace-list \, next; +#X msg 659 509 traverse pd-trace-list \, bang; +#X connect 0 0 84 2; +#X connect 1 0 84 1; +#X connect 2 0 83 0; +#X connect 2 1 4 1; +#X connect 3 0 2 0; +#X connect 4 0 3 0; +#X connect 5 0 78 0; +#X connect 5 1 71 1; +#X connect 6 0 5 0; +#X connect 7 0 12 0; +#X connect 7 1 8 0; +#X connect 11 0 66 0; +#X connect 12 2 67 0; +#X connect 12 3 11 0; +#X connect 12 4 81 0; +#X connect 12 4 9 0; +#X connect 13 0 44 0; +#X connect 15 0 16 0; +#X connect 16 0 39 0; +#X connect 17 0 39 1; +#X connect 18 0 32 0; +#X connect 19 0 37 0; +#X connect 20 0 35 0; +#X connect 21 0 18 0; +#X connect 22 0 34 0; +#X connect 23 0 33 0; +#X connect 26 0 36 0; +#X connect 28 0 35 1; +#X connect 28 0 36 1; +#X connect 28 0 37 1; +#X connect 28 0 34 1; +#X connect 28 0 40 0; +#X connect 28 0 31 0; +#X connect 29 0 28 0; +#X connect 31 0 25 0; +#X connect 32 0 24 0; +#X connect 34 0 18 0; +#X connect 34 0 33 1; +#X connect 38 0 15 0; +#X connect 39 0 41 0; +#X connect 40 0 30 0; +#X connect 40 1 27 0; +#X connect 41 0 42 0; +#X connect 41 1 14 1; +#X connect 42 0 14 0; +#X connect 45 0 46 0; +#X connect 46 0 100 0; +#X connect 46 0 47 0; +#X connect 46 1 101 0; +#X connect 46 1 43 0; +#X connect 47 0 48 0; +#X connect 49 0 50 1; +#X connect 50 0 51 0; +#X connect 51 0 52 0; +#X connect 53 0 50 0; +#X connect 53 0 54 0; +#X connect 55 0 56 0; +#X connect 56 0 63 0; +#X connect 56 1 57 0; +#X connect 61 0 60 0; +#X connect 63 2 62 0; +#X connect 63 3 61 0; +#X connect 63 4 77 0; +#X connect 63 4 58 0; +#X connect 64 0 45 0; +#X connect 65 0 7 0; +#X connect 68 0 69 0; +#X connect 69 0 82 0; +#X connect 69 1 4 0; +#X connect 69 2 71 0; +#X connect 69 3 99 0; +#X connect 70 0 80 1; +#X connect 71 0 6 0; +#X connect 72 0 74 0; +#X connect 72 1 73 0; +#X connect 73 0 75 1; +#X connect 74 0 75 0; +#X connect 75 0 76 0; +#X connect 77 0 59 0; +#X connect 78 0 80 0; +#X connect 78 1 79 1; +#X connect 78 2 72 0; +#X connect 80 0 79 0; +#X connect 81 0 10 0; +#X connect 83 0 84 0; +#X connect 83 1 1 0; +#X connect 83 2 0 0; +#X connect 84 0 85 0; +#X connect 85 0 86 0; +#X connect 99 0 5 0; +#X connect 99 0 2 0; +#X connect 100 0 13 0; +#X connect 102 0 28 0; +#X connect 103 0 17 0; +#X restore 270 474 pd make-trace; +#X floatatom 4 289; +#N canvas 0 0 955 721 arrays 0; +#X msg 30 202 \; fft-real resize 4096 \; fft-imag resize 4096; +#X graph graph1 0 -1 4096 1 332 341 732 41; +#X array fft-real 4096 float; +#X pop; +#X graph graph2 0 -1 4096 1 322 565 722 265; +#X array fft-imag 4096 float; +#X pop; +#X restore 439 515 pd arrays; +#X obj 4 309 s location; +#X obj 95 412 r loop-amp; +#X obj 567 288 f; +#X obj 4 248 r location; +#X msg 4 268 set \$1; +#X obj 598 288 +; +#X obj 567 309 moses 900; +#X msg 535 329 0; +#X msg 534 247 1; +#X msg 566 335 \; location \$1 \; snapshot bang; +#X msg 504 177 bang \; location 0 \; clear-all bang; +#X floatatom 504 305; +#X obj 504 225 t b b; +#X obj 645 270 r incr; +#X obj 6 385 r grain-amp; +#X obj 93 473 r osc-amp; +#X obj 110 553 catch~ osc-sum; +#N canvas 102 67 751 619 osc-bank 0; +#X obj 239 433 osc-voice; +#X obj 223 451 osc-voice; +#X obj 207 471 osc-voice; +#X obj 191 490 osc-voice; +#X obj 175 510 osc-voice; +#X obj 159 528 osc-voice; +#X obj 143 547 osc-voice; +#X obj 127 566 osc-voice; +#X obj 111 586 osc-voice; +#X obj 95 410 route 1 2 3 4 5 6 7 8 9 10; +#X msg 290 269 0; +#X obj 560 489 pointer; +#X floatatom 652 417; +#X obj 479 351 pointer; +#X msg 422 491 next; +#X floatatom 479 419; +#X obj 178 111 pointer; +#X floatatom 283 104; +#X floatatom 238 129; +#X msg 168 88 bang; +#X floatatom 92 40; +#X floatatom 41 88; +#X floatatom 127 169; +#X floatatom 420 137; +#X floatatom 283 69; +#X floatatom 523 90; +#X obj 425 43 pointer; +#X msg 447 27 next; +#X floatatom 419 92; +#X obj 420 120 getsize trace-template bazoo; +#X obj 108 142 get point-template y; +#X obj 41 113 set point-template y; +#X obj 87 66 element trace-template bazoo; +#X obj 238 159 setsize trace-template bazoo; +#X obj 283 86 set trace-template x; +#X obj 283 121 set trace-template y; +#X obj 409 68 get trace-template x y; +#X floatatom 403 312; +#X msg 403 288 1; +#X msg 434 288 0; +#X obj 479 451 <; +#X obj 479 398 get trace-template x voiceno; +#X obj 479 374 t p p; +#X obj 302 337 until; +#X obj 477 233 r start-resynth; +#X obj 481 255 t b b; +#X obj 388 353 f; +#X obj 388 372 sel 0 1; +#X obj 514 436 r synth-index; +#X obj 478 555 pack f p; +#X obj 479 470 sel 0 1; +#X obj 235 230 r step-resynth; +#X obj 291 288 f; +#X obj 291 308 s synth-index; +#X obj 489 523 f; +#X obj 322 289 + 5; +#X obj 478 490 t b b b; +#X obj 235 252 t b b b; +#X obj 216 301 s osc-tick; +#X obj 95 604 osc-voice; +#X msg 425 10 traverse pd-trace-list \, next; +#X msg 478 288 traverse pd-trace-list \, next; +#X connect 9 0 59 0; +#X connect 9 1 8 0; +#X connect 9 2 7 0; +#X connect 9 3 6 0; +#X connect 9 4 5 0; +#X connect 9 5 4 0; +#X connect 9 6 3 0; +#X connect 9 7 2 0; +#X connect 9 8 1 0; +#X connect 9 9 0 0; +#X connect 10 0 52 0; +#X connect 11 0 49 1; +#X connect 13 0 42 0; +#X connect 13 1 39 0; +#X connect 13 1 43 1; +#X connect 14 0 13 0; +#X connect 15 0 40 0; +#X connect 16 0 30 0; +#X connect 17 0 35 0; +#X connect 18 0 33 0; +#X connect 19 0 16 0; +#X connect 20 0 32 0; +#X connect 21 0 31 0; +#X connect 24 0 34 0; +#X connect 26 0 33 1; +#X connect 26 0 34 1; +#X connect 26 0 35 1; +#X connect 26 0 32 1; +#X connect 26 0 36 0; +#X connect 26 0 29 0; +#X connect 27 0 26 0; +#X connect 29 0 23 0; +#X connect 30 0 22 0; +#X connect 32 0 16 0; +#X connect 32 0 31 1; +#X connect 36 0 28 0; +#X connect 36 1 25 0; +#X connect 37 0 46 1; +#X connect 38 0 37 0; +#X connect 39 0 37 0; +#X connect 40 0 50 0; +#X connect 41 0 15 0; +#X connect 41 1 54 1; +#X connect 42 0 41 0; +#X connect 42 1 11 1; +#X connect 43 0 46 0; +#X connect 44 0 45 0; +#X connect 45 0 61 0; +#X connect 45 1 38 0; +#X connect 45 1 10 0; +#X connect 46 0 47 0; +#X connect 47 0 43 1; +#X connect 47 1 15 0; +#X connect 48 0 40 1; +#X connect 49 0 9 0; +#X connect 50 0 43 1; +#X connect 50 1 56 0; +#X connect 51 0 57 0; +#X connect 52 0 53 0; +#X connect 52 0 55 0; +#X connect 54 0 49 0; +#X connect 55 0 52 1; +#X connect 56 0 14 0; +#X connect 56 1 54 0; +#X connect 56 2 11 0; +#X connect 57 0 58 0; +#X connect 57 1 43 0; +#X connect 57 2 52 0; +#X connect 60 0 26 0; +#X connect 61 0 13 0; +#X restore 439 494 pd osc-bank; +#X obj 498 92 s grain-amp; +#N canvas 31 70 662 326 save-list 0; +#X floatatom 584 255; +#X floatatom 521 254; +#X floatatom 461 251; +#X floatatom 398 250; +#X obj 335 206 pointer; +#X obj 236 121 pointer; +#X msg 252 47 bang; +#X obj 117 200 rmstodb; +#X obj 8 201 * 0.1; +#X obj 116 220 * -3; +#X floatatom 342 247; +#X obj 234 27 r start-analysis; +#X obj 235 71 t b b; +#X msg 351 185 next; +#X obj 331 227 get peak-template x y amp ampreal ampimag; +#X obj 7 241 append peak-template x y amp ampreal ampimag; +#X obj 96 138 r found-peak; +#X obj 97 161 unpack 0 0 0 0 0; +#X msg 62 201 330; +#X msg 274 69 \; pd-peak-list clear; +#X msg 235 100 traverse pd-peak-list \, bang; +#X msg 336 166 traverse pd-peak-list \, next; +#X connect 4 0 14 0; +#X connect 5 0 15 5; +#X connect 6 0 12 0; +#X connect 7 0 9 0; +#X connect 8 0 15 0; +#X connect 9 0 15 2; +#X connect 11 0 12 0; +#X connect 12 0 20 0; +#X connect 12 1 19 0; +#X connect 13 0 4 0; +#X connect 14 0 10 0; +#X connect 14 1 3 0; +#X connect 14 2 2 0; +#X connect 14 3 1 0; +#X connect 14 4 0 0; +#X connect 16 0 17 0; +#X connect 17 1 8 0; +#X connect 17 2 18 0; +#X connect 17 2 7 0; +#X connect 17 3 15 3; +#X connect 17 4 15 4; +#X connect 18 0 15 1; +#X connect 20 0 5 0; +#X connect 21 0 4 0; +#X restore 270 431 pd save-list; +#X msg 6 144 \; pd dsp 1 \; window-size 2048 \; sample-rate 44100 \; f-threshold 40 \; incr 10 \; clear-all bang; +#X obj 567 245 metro 150; +#X floatatom 242 309; +#X floatatom 290 309; +#X msg 107 349 \; start-resynth bang; +#X msg 242 350 \; step-resynth bang; +#X obj 242 329 metro 100; +#X msg 368 350 \; osc-stop bang; +#X text 605 107 resynth; +#X text 491 106 analyzed grains; +#X text 423 106 original; +#X text 502 158 ... and here third to analyze; +#N canvas 0 0 276 216 test 0; +#X floatatom 43 120; +#X obj 43 141 s loud; +#X msg 38 84 \; clear-all bang; +#X msg 39 52 \; snapshot bang; +#X connect 0 0 1 0; +#X restore 438 538 pd test; +#X text 244 140 read a sample; +#X msg 165 163 \; read-sample ../sound/bell.aiff 44100; +#X msg 164 200 \; read-sample ../sound/voice.wav 32000; +#N canvas 190 43 405 461 test-signal 0; +#X obj 134 293 tabread4~ sample; +#X obj 134 268 line~; +#X obj 95 146 f; +#X obj 254 46 r insamprate; +#X obj 136 350 *~; +#X obj 164 351 dbtorms; +#X obj 164 328 inlet; +#X obj 135 415 outlet~; +#X obj 146 33 r insamplength; +#X msg 134 247 0 \, \$1 \$2; +#X obj 134 221 pack 0 0; +#X obj 209 190 /; +#X obj 299 99 * 0.001; +#X obj 135 388 hip~ 5; +#X obj 33 5 loadbang; +#X text 242 13 sample playback; +#X msg 33 25 1; +#X obj 33 69 metro 1000; +#X floatatom 33 48; +#X obj 255 75 t b b f; +#X obj 161 84 t b f; +#X connect 0 0 4 0; +#X connect 1 0 0 0; +#X connect 2 0 10 0; +#X connect 3 0 19 0; +#X connect 4 0 13 0; +#X connect 5 0 4 1; +#X connect 6 0 5 0; +#X connect 8 0 20 0; +#X connect 9 0 1 0; +#X connect 10 0 9 0; +#X connect 11 0 10 1; +#X connect 11 0 17 1; +#X connect 12 0 11 1; +#X connect 13 0 7 0; +#X connect 14 0 16 0; +#X connect 16 0 18 0; +#X connect 17 0 2 0; +#X connect 18 0 17 0; +#X connect 19 0 16 0; +#X connect 19 1 11 0; +#X connect 19 2 12 0; +#X connect 20 0 16 0; +#X connect 20 1 11 0; +#X connect 20 1 2 1; +#X restore 96 436 pd test-signal; +#N canvas 132 255 634 331 insample 0; +#X graph graph1 0 -1 55408 1 199 168 599 18; +#X array sample 55409 float; +#X pop; +#X obj 19 70 r read-sample; +#X obj 19 95 unpack s f; +#X obj 53 121 s insamprate; +#X obj 19 171 soundfiler; +#X msg 19 147 read -resize \$1 sample; +#X obj 19 201 s insamplength; +#X msg 357 197 \; sample resize 220500 \; insamplength 220500; +#X connect 1 0 2 0; +#X connect 2 0 5 0; +#X connect 2 1 3 0; +#X connect 4 0 6 0; +#X connect 5 0 4 0; +#X restore 438 559 pd insample; +#X obj 572 553 tabwrite~ sample; +#X text 117 0 SINUSOID TRACKING; +#X text 99 259 to resynthesize \, "start" once and "step" ad lib. To stop \, stop stepping and hit osc-stop. Note resynth ampliture control above.; +#X text 3 17 This patch tries to reconstruct sinusoidal "tracks" from a sampled sound using pique~ and the data structure facilities. It turns out to be quite hard \, not least because pique~ 0.1 puts out all sorts of spurious peaks.; +#X connect 0 0 2 0; +#X connect 1 0 0 0; +#X connect 3 0 4 0; +#X connect 4 0 6 0; +#X connect 5 0 3 0; +#X connect 6 0 28 0; +#X connect 7 0 60 1; +#X connect 8 0 41 1; +#X connect 9 0 60 0; +#X connect 10 0 44 1; +#X connect 11 0 57 0; +#X connect 12 0 11 0; +#X connect 19 0 77 0; +#X connect 20 0 21 0; +#X connect 21 0 27 0; +#X connect 22 0 20 0; +#X connect 23 0 31 0; +#X connect 25 0 23 0; +#X connect 26 0 27 1; +#X connect 27 0 28 0; +#X connect 28 0 29 0; +#X connect 28 0 29 1; +#X connect 30 0 77 0; +#X connect 32 0 24 0; +#X connect 37 0 39 0; +#X connect 40 0 75 0; +#X connect 41 0 44 0; +#X connect 41 0 45 0; +#X connect 41 0 50 0; +#X connect 42 0 43 0; +#X connect 43 0 37 0; +#X connect 44 0 41 1; +#X connect 45 0 48 0; +#X connect 45 1 46 0; +#X connect 46 0 9 0; +#X connect 47 0 9 0; +#X connect 49 0 51 0; +#X connect 51 0 47 0; +#X connect 51 1 8 0; +#X connect 52 0 10 0; +#X connect 53 0 22 0; +#X connect 54 0 5 0; +#X connect 55 0 6 1; +#X connect 60 0 41 0; +#X connect 61 0 65 0; +#X connect 62 0 65 1; +#X connect 65 0 64 0; +#X connect 75 0 28 0; diff --git a/pd/doc/4.fft.examples/14.waveformgrab.pd b/pd/doc/4.fft.examples/14.waveformgrab.pd new file mode 100644 index 00000000..a9d17bed --- /dev/null +++ b/pd/doc/4.fft.examples/14.waveformgrab.pd @@ -0,0 +1,385 @@ +#N canvas 59 19 701 580 12; +#X msg 415 337 set \$1; +#X floatatom 596 337; +#N canvas 81 37 483 329 fft 0; +#X obj 102 155 *~; +#X obj 70 155 *~; +#X obj 70 98 *~; +#X obj 70 52 inlet~; +#X obj 70 127 rfft~; +#X obj 70 182 sqrt~; +#X obj 70 209 *~; +#X obj 70 261 rifft~; +#X obj 70 287 tabwrite~ grab; +#X obj 86 74 tabreceive~ half-sine; +#X obj 70 235 /~ 512; +#X obj 137 191 tabreceive~ alternator; +#X obj 162 259 r do-grab; +#X obj 368 310 block~ 1024 2; +#X connect 0 0 5 0; +#X connect 1 0 5 0; +#X connect 2 0 4 0; +#X connect 3 0 2 0; +#X connect 4 0 1 0; +#X connect 4 0 1 1; +#X connect 4 1 0 0; +#X connect 4 1 0 1; +#X connect 5 0 6 0; +#X connect 6 0 10 0; +#X connect 7 0 8 0; +#X connect 9 0 2 1; +#X connect 10 0 7 0; +#X connect 11 0 6 1; +#X connect 12 0 8 0; +#X restore 186 422 pd fft; +#X floatatom 511 360; +#X floatatom 415 360; +#X obj 186 398 hip~ 5; +#X obj 99 544 dac~; +#N canvas 0 0 600 273 in-sample 0; +#X graph graph1 0 -1 440999 1 160 166 560 16; +#X array grab 441000 float; +#X pop; +#X msg 186 208 \; grab resize 441000; +#X obj 38 224 soundfiler; +#X msg 38 191 write x.wav grab; +#X msg 353 212 \; grab resize 4410; +#X connect 3 0 2 0; +#X restore 371 446 pd in-sample; +#X obj 116 491 hip~ 5; +#X obj 99 515 *~; +#N canvas 59 0 781 602 regenerate 0; +#X obj 90 400 r invblk; +#X obj 50 463 *~; +#X obj 67 443 clip~ 1 1000; +#X floatatom 31 41; +#X floatatom 221 117; +#X obj 430 368 *~; +#X obj 558 345 samphold~; +#X obj 672 345 samphold~; +#X obj 467 345 samphold~; +#X obj 446 493 clip~ -0.5 0.5; +#X obj 446 516 cos~; +#X obj 674 389 +~; +#X obj 565 443 -~; +#X obj 550 463 *~; +#X obj 602 491 +~; +#X obj 585 558 *~; +#X obj 37 373 *~; +#X obj 169 338 samphold~; +#X obj 311 343 samphold~; +#X obj 116 181 sig~; +#X obj 221 230 phasor~; +#X obj 330 180 wrap~; +#X obj 221 92 r pitch; +#X obj 221 161 mtof; +#X obj 116 157 r sample-rate; +#X obj 314 156 line~; +#X text 360 153 read location in blocks; +#X obj 314 234 -~; +#X text 374 179 fractional part; +#X text 338 234 integer part; +#X text 71 128 spectral stretch; +#X obj 66 335 samphold~; +#X obj 319 256 sig~ 0.5; +#X text 294 357 middle of block; +#X obj 413 34 t b f; +#X obj 413 80 /; +#X obj 413 56 1; +#X obj 51 488 clip~ -0.5 0.5; +#X obj 51 510 cos~; +#X obj 294 396 +~; +#X obj 173 450 -~; +#X obj 155 471 *~; +#X obj 162 494 +~; +#X obj 145 550 *~; +#X text 68 365 offset into; +#X text 78 376 sample; +#X text 128 243 samples; +#X text 128 228 period in; +#X text 175 353 weight for; +#X text 174 364 next block; +#X obj 640 193 wrap~; +#X obj 413 102 s invblk; +#X text 411 118 one over block size; +#X obj 483 406 r invblk; +#X obj 145 574 send~ outsig; +#X floatatom 328 87; +#X obj 328 112 pack 0 100; +#X obj 413 11 r window-size; +#X obj 454 239 r window-size; +#X obj 31 17 r specshift; +#X text 103 270 grain size in samples; +#X obj 314 37 r loco; +#X obj 444 472 *~; +#X obj 460 450 clip~ 1 1000; +#X text 91 347 grain; +#X obj 221 141 - 12; +#X obj 173 421 tabread4~ grab; +#X obj 294 422 tabread4~ grab; +#X obj 565 414 tabread4~ grab; +#X obj 674 415 tabread4~ grab; +#X obj 31 64 * 0.01; +#X obj 31 88 + 69; +#X obj 31 111 mtof; +#X obj 31 134 / 440; +#X obj 70 272 *~ 1; +#X obj 640 168 +~ 0.5; +#X obj 67 422 *~ 1; +#X obj 460 429 *~ 1; +#X obj 446 538 +~ 1; +#X obj 51 533 +~ 1; +#X obj 116 208 /~ 1; +#X obj 314 282 *~ 1; +#X obj 173 398 +~ 0; +#X obj 565 392 +~ 0; +#X obj 16 334 -~ 0.5; +#X obj 413 345 -~ 0.5; +#X msg 328 64 set \$1; +#X connect 0 0 76 1; +#X connect 1 0 37 0; +#X connect 2 0 1 1; +#X connect 3 0 70 0; +#X connect 4 0 65 0; +#X connect 5 0 11 0; +#X connect 6 0 13 0; +#X connect 7 0 11 1; +#X connect 8 0 5 1; +#X connect 8 0 77 0; +#X connect 9 0 10 0; +#X connect 10 0 78 0; +#X connect 11 0 69 0; +#X connect 11 0 83 0; +#X connect 12 0 13 1; +#X connect 13 0 14 0; +#X connect 14 0 15 1; +#X connect 15 0 54 0; +#X connect 16 0 39 0; +#X connect 17 0 41 0; +#X connect 18 0 39 1; +#X connect 19 0 80 0; +#X connect 20 0 31 1; +#X connect 20 0 18 1; +#X connect 20 0 17 1; +#X connect 20 0 75 0; +#X connect 20 0 84 0; +#X connect 21 0 27 1; +#X connect 21 0 17 0; +#X connect 21 0 6 0; +#X connect 22 0 4 0; +#X connect 23 0 20 0; +#X connect 23 0 80 1; +#X connect 24 0 19 0; +#X connect 25 0 21 0; +#X connect 25 0 27 0; +#X connect 27 0 81 0; +#X connect 31 0 16 1; +#X connect 31 0 76 0; +#X connect 32 0 81 0; +#X connect 34 0 36 0; +#X connect 34 1 35 1; +#X connect 35 0 51 0; +#X connect 36 0 35 0; +#X connect 37 0 38 0; +#X connect 38 0 79 0; +#X connect 39 0 67 0; +#X connect 39 0 82 0; +#X connect 40 0 41 1; +#X connect 41 0 42 0; +#X connect 42 0 43 1; +#X connect 43 0 54 0; +#X connect 50 0 8 1; +#X connect 50 0 6 1; +#X connect 50 0 7 1; +#X connect 50 0 85 0; +#X connect 53 0 77 1; +#X connect 55 0 56 0; +#X connect 56 0 25 0; +#X connect 57 0 34 0; +#X connect 58 0 81 1; +#X connect 58 0 82 1; +#X connect 58 0 83 1; +#X connect 59 0 3 0; +#X connect 61 0 25 0; +#X connect 61 0 86 0; +#X connect 62 0 9 0; +#X connect 63 0 62 1; +#X connect 65 0 23 0; +#X connect 66 0 40 0; +#X connect 67 0 40 1; +#X connect 67 0 42 1; +#X connect 68 0 12 0; +#X connect 69 0 12 1; +#X connect 69 0 14 1; +#X connect 70 0 71 0; +#X connect 71 0 72 0; +#X connect 72 0 73 0; +#X connect 73 0 74 1; +#X connect 74 0 31 0; +#X connect 74 0 8 0; +#X connect 75 0 50 0; +#X connect 76 0 2 0; +#X connect 77 0 63 0; +#X connect 78 0 15 0; +#X connect 79 0 43 0; +#X connect 80 0 74 0; +#X connect 81 0 18 0; +#X connect 81 0 7 0; +#X connect 82 0 66 0; +#X connect 83 0 68 0; +#X connect 84 0 16 0; +#X connect 84 0 1 0; +#X connect 85 0 5 0; +#X connect 85 0 62 0; +#X connect 86 0 55 0; +#X restore 371 495 pd regenerate; +#X obj 115 464 receive~ outsig; +#X obj 43 467 line~; +#X obj 416 383 s specshift; +#X obj 575 386 s loco; +#X obj 512 383 s pitch; +#X obj 511 319 r pitch; +#X msg 511 339 set \$1; +#X obj 415 317 r specshift; +#X floatatom 553 64; +#N canvas 194 37 397 591 output 0; +#X obj 58 180 t b; +#X obj 58 135 f; +#X obj 58 90 inlet; +#X text 63 71 mute; +#X obj 58 202 f; +#X msg 119 217 0; +#X msg 58 113 bang; +#X obj 58 158 moses 1; +#X obj 119 194 t b f; +#X obj 86 392 outlet; +#X msg 86 370 set \$1; +#X obj 165 145 moses 1; +#X obj 199 394 dbtorms; +#X obj 199 417 pack 0 100; +#X obj 165 122 r master-lvl; +#X obj 86 339 r master-lvl; +#X obj 74 254 s master-lvl; +#X obj 199 439 s master-amp; +#X connect 0 0 4 0; +#X connect 1 0 7 0; +#X connect 2 0 6 0; +#X connect 4 0 16 0; +#X connect 5 0 16 0; +#X connect 6 0 1 0; +#X connect 7 0 0 0; +#X connect 7 1 8 0; +#X connect 8 0 5 0; +#X connect 10 0 9 0; +#X connect 11 1 4 1; +#X connect 12 0 13 0; +#X connect 13 0 17 0; +#X connect 14 0 1 1; +#X connect 14 0 11 0; +#X connect 15 0 10 0; +#X connect 15 0 12 0; +#X restore 553 42 pd output; +#X msg 553 19 mute; +#X text 587 57 MASTER; +#X text 586 69 LEVEL; +#X obj 553 86 s master-lvl; +#X obj 44 442 r master-amp; +#N canvas 93 44 649 449 window 0; +#X graph graph1 0 -1 1023 1 435 170 635 20; +#X array half-sine 1024 float; +#X pop; +#X obj 108 88 r window-size; +#X obj 108 110 t b f; +#X obj 72 136 /; +#X obj 25 16 r make-window; +#X msg 25 36 bang; +#X msg 109 136 -0.25; +#X obj 70 181 osc~; +#X obj 84 66 samplerate~; +#X graph graph2 0 -1 1023 1 439 331 639 191; +#X array alternator 1024 float; +#X pop; +#X obj 21 249 r make-window; +#X msg 21 269 bang; +#X obj 80 299 samplerate~; +#X obj 451 372 r window-size; +#X msg 451 397 \; half-sine resize \$1 \; alternator resize \$1; +#X obj 80 325 / 2; +#X obj 239 12 r make-window; +#X obj 80 351 phasor~; +#X obj 21 425 tabwrite~ alternator; +#X obj 256 106 switch~; +#X msg 239 70 1; +#X obj 277 44 del 500; +#X msg 277 70 0; +#X obj 80 373 -~ 0.5; +#X obj 25 224 tabwrite~ half-sine; +#X obj 72 160 / 2; +#X obj 80 396 *~ 4; +#X msg 124 325 0.75; +#X obj 68 203 *~; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 2 1 3 1; +#X connect 3 0 25 0; +#X connect 4 0 5 0; +#X connect 5 0 6 0; +#X connect 5 0 8 0; +#X connect 5 0 24 0; +#X connect 6 0 7 1; +#X connect 7 0 28 0; +#X connect 7 0 28 1; +#X connect 8 0 3 0; +#X connect 10 0 11 0; +#X connect 11 0 27 0; +#X connect 11 0 12 0; +#X connect 11 0 18 0; +#X connect 12 0 15 0; +#X connect 13 0 14 0; +#X connect 15 0 17 0; +#X connect 16 0 20 0; +#X connect 16 0 21 0; +#X connect 17 0 23 0; +#X connect 20 0 19 0; +#X connect 21 0 22 0; +#X connect 22 0 19 0; +#X connect 23 0 26 0; +#X connect 25 0 7 0; +#X connect 26 0 18 0; +#X connect 27 0 17 1; +#X connect 28 0 24 0; +#X restore 371 471 pd window; +#X obj 186 370 readsf~; +#X text 38 285 CLICK HERE FIRST; +#X msg 576 312 0 \, 250 10000; +#X msg 28 309 \; pd dsp 1 \; sample-rate 44100 \; window-size 1024 \; make-window bang \; pitch 48 \; specshift 0 \;; +#X obj 596 360 pack 0 100; +#X text 196 292 analyze from soundfile; +#X text 118 10 WAVEFORM GRABBER; +#X text 21 27 This patch takes an incoming sound does an overlap-2 FFT analysis of it \, and bashes the phases of the spectra to known values. In this way you can use samples as waveforms and cross-fade them at will without getting phase modulation.; +#X text 19 93 This might be useful for making synthetic instruments that mimic the spectral variation of recorded sounds. Here we analyze a soundfile \, but you can replace "readsf~" by "adc~" to analyze on the fly. The result is a massaged sample suitable for reading via the "regenerate" subpatch.; +#X text 18 169 Since the analysis is done with an overlap of 2 \, the analyzed sample is twice the length of the original sound.; +#X text 18 199 When you aren't busy doing analyses \, you can turn the "FFT" window off by replacing the block~ with a switch~.; +#X msg 186 322 open ../sound/voice.wav \, 1 \; specshift -720 \; do-grab bang; +#X text 15 231 The resynthesized sound seems to be skewed slightly north spectrally. The recorded sample should just need -530 cents of correction (because of the different sample rate) but my ears prefer -720; +#X connect 0 0 4 0; +#X connect 1 0 31 0; +#X connect 3 0 15 0; +#X connect 4 0 13 0; +#X connect 5 0 2 0; +#X connect 8 0 9 1; +#X connect 9 0 6 0; +#X connect 9 0 6 1; +#X connect 11 0 8 0; +#X connect 12 0 9 0; +#X connect 16 0 17 0; +#X connect 17 0 3 0; +#X connect 18 0 0 0; +#X connect 19 0 24 0; +#X connect 20 0 19 0; +#X connect 21 0 20 0; +#X connect 25 0 12 0; +#X connect 27 0 5 0; +#X connect 29 0 14 0; +#X connect 31 0 14 0; +#X connect 38 0 27 0; diff --git a/pd/doc/4.fft.examples/add-trace.pd b/pd/doc/4.fft.examples/add-trace.pd new file mode 100644 index 00000000..c04c855a --- /dev/null +++ b/pd/doc/4.fft.examples/add-trace.pd @@ -0,0 +1,152 @@ +#N canvas 222 113 821 785 10; +#X obj 405 551 r amp; +#X obj 466 531 element trace-template bazoo; +#X obj 365 578 set point-template y amp; +#X obj 382 454 r pitch; +#X obj 366 496 f; +#X obj 366 520 * -4; +#X obj 442 417 pointer; +#X obj 443 608 f 1; +#X obj 326 252 f; +#X obj 326 191 f; +#X obj 326 215 sel 0; +#X floatatom 201 220 0; +#X obj 24 72 r add-to-trace; +#X obj 326 143 r start-new-trace; +#X obj 341 305 r nframe; +#X floatatom 203 100 0; +#X obj 22 419 r pitch; +#X obj 75 245 r frequency; +#X obj 68 561 r amp; +#X text 141 200 current pitch; +#X obj 24 262 mtof; +#X obj 24 190 sel 1; +#X obj 24 214 t b b; +#X obj 24 286 -; +#X obj 24 310 abs; +#X obj 24 334 <; +#X obj 79 314 r f-threshold; +#X obj 24 358 sel 1; +#X obj 21 461 f; +#X obj 59 268 f; +#X obj 24 238 f; +#X text 34 374 if this happens \, add to the trace; +#X obj 533 114 r done-adding-traces; +#X obj 533 165 sel 0; +#X obj 583 89 - 1; +#X obj 14 45 f 2; +#X obj 13 385 t b b; +#X obj 203 34 r clear-traces; +#X obj 203 58 f 0; +#X obj 24 166 f; +#X obj 533 141 f; +#X obj 93 403 pointer; +#X text 160 397 current trace; +#X obj 115 454 getsize trace-template bazoo; +#X obj 155 504 + 1; +#X obj 155 528 setsize trace-template bazoo; +#X obj 126 557 element trace-template bazoo; +#X obj 115 478 t f f; +#X obj 21 586 set point-template y amp; +#X obj 93 427 t b p p; +#X obj 21 485 * -4; +#X obj 13 633 s added-to-trace; +#X obj 13 609 f 1; +#X obj 40 97 r added-to-trace; +#X obj 24 118 f; +#X obj 24 142 sel 0; +#X obj 342 170 r started-new-trace; +#X obj 326 276 sel 0; +#X obj 443 633 s started-new-trace; +#X text 535 482 last trace in list; +#X text 514 411 reentrancy protection \; should go away; +#X obj 541 464 s last-in-list; +#X obj 615 350 r last-in-list; +#X obj 443 474 t b b p; +#X obj 465 507 f 0; +#X obj 326 357 * 5; +#X obj 326 332 f; +#X obj 292 300 f 2; +#X text 238 52 "state" -- 0 if free \, 1 if making a trace \, and 2 if we've added a point for the current frame; +#X obj 546 307 f \$1; +#X text 585 306 voice number; +#X obj 442 391 append trace-template x voiceno; +#X obj 516 278 t f b; +#X connect 0 0 2 1; +#X connect 1 0 2 2; +#X connect 3 0 4 1; +#X connect 4 0 5 0; +#X connect 4 0 11 0; +#X connect 5 0 2 0; +#X connect 6 0 63 0; +#X connect 6 0 41 1; +#X connect 7 0 58 0; +#X connect 8 0 57 0; +#X connect 9 0 10 0; +#X connect 10 0 8 0; +#X connect 11 0 30 1; +#X connect 12 0 54 0; +#X connect 13 0 9 0; +#X connect 14 0 66 1; +#X connect 15 0 39 1; +#X connect 15 0 40 1; +#X connect 15 0 8 1; +#X connect 16 0 28 1; +#X connect 17 0 29 1; +#X connect 18 0 48 1; +#X connect 20 0 23 0; +#X connect 21 0 22 0; +#X connect 22 0 30 0; +#X connect 22 1 29 0; +#X connect 23 0 24 0; +#X connect 24 0 25 0; +#X connect 25 0 27 0; +#X connect 26 0 25 1; +#X connect 27 0 36 0; +#X connect 28 0 50 0; +#X connect 28 0 11 0; +#X connect 29 0 23 1; +#X connect 30 0 20 0; +#X connect 32 0 40 0; +#X connect 33 1 34 0; +#X connect 34 0 15 0; +#X connect 35 0 15 0; +#X connect 36 0 35 0; +#X connect 36 0 52 0; +#X connect 36 1 41 0; +#X connect 37 0 38 0; +#X connect 38 0 15 0; +#X connect 39 0 21 0; +#X connect 40 0 33 0; +#X connect 41 0 49 0; +#X connect 43 0 47 0; +#X connect 44 0 45 0; +#X connect 46 0 48 2; +#X connect 47 0 46 0; +#X connect 47 1 44 0; +#X connect 49 0 28 0; +#X connect 49 1 43 0; +#X connect 49 2 45 1; +#X connect 49 2 46 1; +#X connect 50 0 48 0; +#X connect 52 0 51 0; +#X connect 53 0 54 1; +#X connect 54 0 55 0; +#X connect 55 0 39 0; +#X connect 56 0 9 1; +#X connect 57 0 66 0; +#X connect 57 0 67 0; +#X connect 62 0 71 2; +#X connect 63 0 4 0; +#X connect 63 0 7 0; +#X connect 63 1 64 0; +#X connect 63 2 1 1; +#X connect 63 2 61 0; +#X connect 64 0 1 0; +#X connect 65 0 72 0; +#X connect 66 0 65 0; +#X connect 67 0 15 0; +#X connect 69 0 71 1; +#X connect 71 0 6 0; +#X connect 72 0 71 0; +#X connect 72 1 69 0; diff --git a/pd/doc/4.fft.examples/osc-voice.pd b/pd/doc/4.fft.examples/osc-voice.pd new file mode 100644 index 00000000..02a8bde5 --- /dev/null +++ b/pd/doc/4.fft.examples/osc-voice.pd @@ -0,0 +1,54 @@ +#N canvas 230 103 972 643 10; +#X obj 261 279 element trace-template bazoo; +#X floatatom 320 207 0; +#X obj 297 163 getsize trace-template bazoo; +#X obj 429 466 line~; +#X obj 276 49 inlet; +#X obj 424 357 dbtorms; +#X obj 264 396 mtof; +#X obj 264 476 phasor~; +#X obj 258 513 cos~; +#X obj 265 547 *~; +#X obj 265 587 throw~ osc-sum; +#X obj 185 163 f; +#X obj 245 167 + 1; +#X obj 262 240 moses; +#X obj 261 319 get point-template y amp; +#X obj 426 401 pack 0 30; +#X msg 356 432 0 30; +#X obj 276 89 t b p; +#X msg 225 120 0; +#X obj 96 60 r osc-tick; +#X obj 264 356 * -0.25; +#X obj 81 307 print no; +#X obj 264 436 sig~; +#X msg 609 357 0; +#X obj 616 326 r osc-stop; +#X connect 0 0 14 0; +#X connect 1 0 13 1; +#X connect 2 0 1 0; +#X connect 3 0 9 1; +#X connect 4 0 17 0; +#X connect 5 0 15 0; +#X connect 6 0 22 0; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X connect 11 0 12 0; +#X connect 11 0 13 0; +#X connect 12 0 11 1; +#X connect 13 0 0 0; +#X connect 13 1 16 0; +#X connect 14 0 20 0; +#X connect 14 1 5 0; +#X connect 15 0 3 0; +#X connect 16 0 3 0; +#X connect 17 0 18 0; +#X connect 17 1 0 1; +#X connect 17 1 2 0; +#X connect 18 0 11 1; +#X connect 19 0 11 0; +#X connect 20 0 6 0; +#X connect 22 0 7 0; +#X connect 23 0 15 0; +#X connect 24 0 23 0; diff --git a/pd/doc/4.fft.examples/x.wav b/pd/doc/4.fft.examples/x.wav Binary files differnew file mode 100644 index 00000000..3a2fd446 --- /dev/null +++ b/pd/doc/4.fft.examples/x.wav |