skip to main
|
skip to sidebar
General Photographics
● 写真のはなし
2011年12月5日月曜日
Speak FFT a Little in PD
Pure Data で FFT について。
貼付けたら結構長くなりましが、以下ソースです。
#N canvas 89 22 910 751 10; #X obj 0 -1 cnv 15 300 600 empty empty empty 20 12 0 14 -233017 -66577 0; #X obj 303 -1 cnv 15 300 600 empty empty empty 20 12 0 14 -233017 -66577 0; #X obj 606 -1 cnv 15 300 600 empty empty empty 20 12 0 14 -233017 -66577 0; #X obj 606 602 cnv 15 300 120 empty empty Modules 20 12 0 14 -228856 -191407 0; #X obj 1 602 cnv 15 602 120 empty empty Controller 20 12 0 14 -228856 -191407 0; #N canvas 968 286 450 300 INITIALIZE 0; #X obj 12 7 loadbang; #X obj 83 8 bng 15 250 50 0 empty SET_DEFAULTS_MESSAGE_ SET_DEFAULTS 17 7 0 10 -262144 -1 -1; #N canvas 80 135 450 300 DSP_BLOCK_SIZE 0; #X obj 12 22 inlet; #X msg 12 64 \; DSP_BLOCK_SIZE_INITIALIZE_MESSAGE_ \$1; #X msg 12 43 6; #X connect 0 0 2 0; #X connect 2 0 1 0; #X restore 12 187 pd DSP_BLOCK_SIZE; #N canvas 594 164 450 300 TABLES 0; #X obj 8 11 inlet; #N canvas 801 469 454 350 WAVE 0; #X obj 7 5 inlet; #X msg 7 35 256 512; #X msg 7 62 \; WAVE_1_FREQUENCY_INITIALIZE_MESSAGE_ \$1 \; WAVE_2_FREQUENCY_INITIALIZE_MESSAGE_ \$2 \;; #X obj 11 127 nbx 5 14 -1e+37 1e+37 0 0 empty DSP_BLOCK_SIZE_MESSAGE_ DSP_BLOCK_SIZE 0 -8 0 10 -262144 -1 -1 64 256; #X obj 11 181 pack f f; #X msg 11 215 \; Wave resize \$1 \; Wave_1 resize \$1 \; Wave_2 resize \$1 \; Wave bounds 0 1 \$2 -1 \; Wave_1 bounds 0 1 \$2 -1 \; Wave_2 bounds 0 1 \$2 -1 \;; #X obj 11 145 expr $f1 \; $f1 - 1 \;; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 3 0 6 0; #X connect 4 0 5 0; #X connect 6 0 4 0; #X connect 6 1 4 1; #X restore 8 50 pd WAVE; #N canvas 340 371 450 300 AMPLITUDE 0; #X obj 16 28 nbx 5 14 -1e+37 1e+37 0 0 empty DSP_BLOCK_SIZE_MESSAGE_ DSP_BLOCK_SIZE 0 -8 0 10 -262144 -1 -1 64 256; #X obj 16 82 pack f f; #X obj 16 46 expr $f1 \; $f1 - 1 \;; #X msg 16 107 \; Amplitude resize \$1 \; Amplitude bounds 0 1 \$2 0 \;; #X connect 0 0 2 0; #X connect 1 0 3 0; #X connect 2 0 1 0; #X connect 2 1 1 1; #X restore 8 69 pd AMPLITUDE; #N canvas 340 371 450 300 Phase 0; #X obj 16 28 nbx 5 14 -1e+37 1e+37 0 0 empty DSP_BLOCK_SIZE_MESSAGE_ DSP_BLOCK_SIZE 0 -8 0 10 -262144 -1 -1 64 256; #X obj 16 82 pack f f; #X obj 16 46 expr $f1 \; $f1 - 1 \;; #X msg 16 107 \; Phase resize \$1 \; Phase bounds 0 3.14159 \$2 -3.14159 \;; #X connect 0 0 2 0; #X connect 1 0 3 0; #X connect 2 0 1 0; #X connect 2 1 1 1; #X restore 8 88 pd Phase; #N canvas 107 61 450 300 WINDOW 0; #X obj 26 38 nbx 5 14 -1e+37 1e+37 0 0 empty DSP_BLOCK_SIZE_MESSAGE_ DSP_BLOCK_SIZE 0 -8 0 10 -262144 -1 -1 64 256; #X obj 26 92 pack f f; #X obj 26 56 expr $f1 \; $f1 - 1 \;; #X msg 26 117 \; Window resize \$1 \; Window bounds 0 1 \$2 0 \;; #X connect 0 0 2 0; #X connect 1 0 3 0; #X connect 2 0 1 0; #X connect 2 1 1 1; #X restore 8 109 pd WINDOW; #X connect 0 0 1 0; #X restore 35 164 pd TABLES; #X connect 0 0 2 0; #X connect 0 0 3 0; #X connect 1 0 2 0; #X connect 1 0 3 0; #X restore 625 632 pd INITIALIZE; #X obj 102 634 tgl 15 0 DSP_ON_OFF_MESSAGE_ empty POWER...ON/OFF 19 7 0 10 -262144 -260097 -128992 1 1; #N canvas 649 312 450 300 POWER 0; #X obj 19 15 tgl 15 0 empty DSP_ON_OFF_MESSAGE_ empty 17 7 0 10 -262144 -1 -1 1 1; #X msg 19 36 \; pd dsp \$1; #X connect 0 0 1 0; #X restore 625 656 pd POWER; #N canvas 0 22 450 300 (subpatch) 0; #X array Wave 64 float 0; #X coords 0 1 63 -1 256 140 1; #X restore 21 38 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array Amplitude 64 float 0; #X coords 0 1 63 0 256 140 1; #X restore 326 38 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array Phase 64 float 0; #X coords 0 3.14159 63 -3.14159 256 140 1; #X restore 630 38 graph; #N canvas 812 458 518 269 OSCILLATOR 0; #X obj 341 23 nbx 5 14 -1e+37 1e+37 0 0 empty DSP_BLOCK_SIZE_MESSAGE_ DSP_BLOCK_SIZE 0 -8 0 10 -262144 -1 -1 64 256; #X msg 341 45 set \$1 1 1; #X obj 341 70 block~; #X obj 25 26 osc~; #X obj 130 26 osc~; #X obj 25 9 nbx 5 14 -1e+37 1e+37 0 0 empty WAVE_1_FREQUENCY_MESSAGE_ Wave_1_Frequency 0 -8 0 10 -262144 -1 -1 2637.18 256; #X obj 130 9 nbx 5 14 -1e+37 1e+37 0 0 empty WAVE_2_FREQUENCY_MESSAGE_ Wave_2_Frequency 0 -8 0 10 -262144 -1 -1 6773.57 256; #X obj 25 156 tabsend~ Wave_1; #X obj 130 46 tabsend~ Wave_2; #X obj 79 133 tabsend~ Wave; #X obj 79 79 /~ 2; #N canvas 810 50 516 381 FFT 0; #X obj 223 31 nbx 5 14 -1e+37 1e+37 0 0 empty DSP_BLOCK_SIZE_MESSAGE_ DSP_BLOCK_SIZE 0 -8 0 10 -262144 -1 -1 64 256; #X msg 223 53 set \$1 1 1; #X obj 223 78 block~; #X obj -176 74 rfft~; #X obj 41 163 expr~ atan2($v2 \, $v1); #X obj 41 182 tabsend~ Phase; #X obj -176 264 tabsend~ Amplitude; #X obj -176 12 inlet~; #X obj 133 46 sig~; #N canvas 802 219 386 284 WINDOW 0; #N canvas 0 22 450 300 (subpatch) 0; #X array Window 64 float 0; #X coords 0 1 63 0 140 140 1; #X restore 10 16 graph; #X obj 160 17 nbx 5 14 -1e+37 1e+37 0 0 empty DSP_BLOCK_SIZE_MESSAGE_ DSP_BLOCK_SIZE 0 -8 0 10 -262144 -1 -1 64 256; #X obj 160 67 samplerate~; #X obj 160 92 /; #X obj 160 146 osc~; #X obj 160 39 t b f b; #X msg 199 117 0; #X msg 284 42 set \$1 1 1; #X obj 284 67 block~; #X obj 160 221 tabsend~ Window; #X obj 160 169 *~ -0.46; #X obj 160 196 +~ 0.54; #X connect 1 0 5 0; #X connect 1 0 7 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 10 0; #X connect 5 0 2 0; #X connect 5 1 3 1; #X connect 5 2 6 0; #X connect 6 0 4 1; #X connect 7 0 8 0; #X connect 10 0 11 0; #X connect 11 0 9 0; #X restore 212 248 pd WINDOW; #X obj -161 33 tabreceive~ Window; #X obj -176 54 *~; #X obj -177 244 expr~ sqrt($v1 * $v1 + $v2 * $v2) / sqrt($v3); #X connect 0 0 1 0; #X connect 0 0 8 0; #X connect 1 0 2 0; #X connect 3 0 4 0; #X connect 3 0 12 0; #X connect 3 1 4 1; #X connect 3 1 12 1; #X connect 4 0 5 0; #X connect 7 0 11 0; #X connect 8 0 12 2; #X connect 10 0 11 1; #X connect 11 0 3 0; #X connect 12 0 6 0; #X restore 100 107 pd FFT; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 3 0 7 0; #X connect 3 0 10 0; #X connect 4 0 8 0; #X connect 4 0 10 0; #X connect 5 0 3 0; #X connect 6 0 4 0; #X connect 10 0 9 0; #X connect 10 0 11 0; #X restore 748 659 pd OSCILLATOR; #X obj 502 613 bng 15 250 50 0 SET_DEFAULTS_MESSAGE_ empty SET_DEFAULTS 19 7 0 10 -262144 -260097 -128992; #N canvas 0 22 450 300 (subpatch) 0; #X array Wave_1 64 float 0; #X coords 0 1 63 -1 256 140 1; #X restore 21 220 graph; #N canvas 0 22 450 300 (subpatch) 0; #X array Wave_2 64 float 0; #X coords 0 1 63 -1 256 140 1; #X restore 21 415 graph; #X obj 24 360 hsl 251 15 1 22050 0 0 WAVE_1_FREQUENCY_MESSAGE_ WAVE_1_FREQUENCY_INITIALIZE_MESSAGE_ Wave_1_Frequency 5 7 0 10 -228856 -260097 -128992 2989 1; #X obj 24 555 hsl 251 15 1 22050 0 0 WAVE_2_FREQUENCY_MESSAGE_ WAVE_2_FREQUENCY_INITIALIZE_MESSAGE_ Wave_2_Frequency 5 7 0 10 -228856 -260097 -128992 7679 1; #N canvas 938 500 331 222 DSP_BLOCK_SIZE 0; #X obj 27 -46 nbx 5 14 -1e+37 1e+37 0 0 empty DSP_PRE_BLOCK_SIZE_MESSAGE_ DSP_BLOCK_SIZE 0 -8 0 10 -262144 -1 -1 6 256; #X obj 27 51 nbx 5 14 -1e+37 1e+37 0 0 DSP_BLOCK_SIZE_MESSAGE_ empty empty 0 -8 0 10 -262144 -1 -1 64 256; #X obj 27 -26 expr pow(2 \, int($f1)); #X connect 0 0 2 0; #X connect 2 0 1 0; #X restore 625 674 pd DSP_BLOCK_SIZE; #X obj 20 652 hsl 95 15 6 15 0 0 DSP_PRE_BLOCK_SIZE_MESSAGE_ DSP_BLOCK_SIZE_INITIALIZE_MESSAGE_ DSP_BlOCK_SIZE 5 8 0 10 -262144 -260097 -128992 0 1; #X obj 120 653 nbx 5 14 -1e+37 1e+37 0 0 empty DSP_BLOCK_SIZE_MESSAGE_ empty 0 -8 0 10 -228856 -128992 -1 64 256;
0 件のコメント:
コメントを投稿
次の投稿
前の投稿
ホーム
登録:
コメントの投稿 (Atom)
ラベル
apt
(1)
Bindings
(1)
BPF (Berkeley Packet Filter)
(2)
CGColor
(1)
Color Gamut
(1)
ColorSync
(1)
ColorSync Manager API
(2)
Core Graphics
(2)
Core Image Kernel Language
(1)
Debian
(4)
Dispatch Queues
(1)
dpkg
(2)
Dump
(1)
FFT
(1)
Grand Central Dispatch (GCD)
(1)
I/O Kit
(1)
IEEE 802.3
(1)
ioctl
(3)
iPhone
(1)
JavaScript
(1)
launchd.plist
(1)
libpcap
(1)
Linux
(4)
Mac OSX
(1)
Mandelbrot Set
(1)
Master for iTunes Droplet
(1)
Maverics
(1)
Network Interface
(2)
Node.js
(1)
NSBitmapImageRep
(3)
NSBundle
(1)
NSCalendar
(1)
NSColor
(1)
NSDate
(1)
NSDateComponents
(1)
NSGraphicsContext
(1)
NSMenu
(1)
NSProgressIndicator
(1)
NSTableView
(1)
NSThread
(1)
NSUserDefaults
(1)
Objective-C
(8)
Objective-C Runtime API
(2)
OpenBSD
(2)
pd
(7)
Quartz
(1)
Soft Proofing
(1)
SoundCloud
(1)
SyntaxHighlighter
(2)
TIFF
(1)
update-alternatives
(1)
vImage
(2)
Wi-Fi
(1)
Yosemite
(1)
Yxy 表色系
(1)
イメージを描画する
(12)
0 件のコメント:
コメントを投稿