| 1 |
// our UGen/UAna patch |
| 2 |
SinOsc s => FFT fft =^ Flux flux => blackhole; |
| 3 |
|
| 4 |
// compute sample rate |
| 5 |
second / samp => float srate; |
| 6 |
// set a nice frequency to minimize flux across frames |
| 7 |
srate / 8 => s.freq; |
| 8 |
// set fft size |
| 9 |
1024 => fft.size; |
| 10 |
// set window (optional here) |
| 11 |
Windowing.hann( 1024 ) => fft.window; |
| 12 |
|
| 13 |
// infinite time loop |
| 14 |
while( true ) |
| 15 |
{ |
| 16 |
// propogate the analysis computations (example: optional usage of blob) |
| 17 |
flux.upchuck() @=> UAnaBlob blob; |
| 18 |
// print it (should always be 0) |
| 19 |
<<< blob.fval(0) >>>; |
| 20 |
|
| 21 |
// hop along |
| 22 |
512::samp => now; |
| 23 |
} |