// Envelope Follower Controlling Sine Oscillator // (Amplitude Theremin), by PRC 2008 // Rectify the signal (make it positive), and // leaky-integrate that into a low pass filter. // Map that extracted envelope to the pitch of a sine wave adc => FullRect r => OnePole p => blackhole; 0.999 => p.pole; SinOsc s => dac; while (1) { 0.05 :: second => now; // update every 50 ms 100.0 + p.last()*1000 => s.freq; // map it to a good frequency range }