1 // really really bad cross synthesizer...
4 adc => FFT X => blackhole;
11 [ 66, 70, 73, 78, 84, 87] @=> int pitches[];
12 for( int i; i < blt.size(); i++ )
15 20 => blt[i].harmonics;
16 pitches[i] => Std.mtof => blt[i].freq;
20 4096 => X.size => Y.size => int FFT_SIZE;
22 FFT_SIZE / 8 => int HOP_SIZE;
23 // set window and window size
24 Windowing.hann(1024) => X.window;
25 Windowing.hann(1024) => Y.window;
26 // use this to hold contents
27 complex Z[FFT_SIZE/2];
37 for( int i; i < X.size()/2; i++ )
38 Math.sqrt((X.cval(i)$polar).mag) * Y.cval(i) => Z[i];
44 HOP_SIZE::samp => now;