// analysis adc => FFT fft =^ Centroid centroid => blackhole; // synthesis SinOsc s => dac; .1 => s.gain; // figure sample rate second / samp => float srate; // set fft size 1024 => fft.size; // set hop size 1024 => int hopSize; // variable float freq_target; float freq; // spork spork ~ interp(); // go while( true ) { // compute centroid (should cascade up the upchuck chain) centroid.upchuck().fval(0)*srate/2 => freq_target; // hop hopSize::samp => now; } fun void interp() { .1 => float slew; while( true ) { // control sine (freq_target - freq)*slew + freq => freq => s.freq; // hop 512::samp => now; } }