samer@0: ;;; Modulate noise or sine wave with short-term energy of input audio signal samer@0: samer@0: (load "audio.scm") samer@0: (load "lineout.scm") samer@0: (load "synthesis.scm") samer@0: samer@0: samer@0: (put "regulated" #f) ; main loop will not be regulated, run as fast as possible. samer@0: samer@0: (tasks) ; creates regulator and main loop Task samer@0: samer@0: (define N 256) ; frame size for audio input, output, and hop size samer@0: (lineout (default-linesnk) samer@0: (gen->vector N (Product. ; generate N sample vector as product of two samer@0: ; (NormalisedGaussian.) ; signal generators: samer@0: (oscillator 0.5) ; a sinusoidal oscillator at 0.5 radians/sample samer@0: (FunctionOfGenerator. (Sqrt.) ; and the square root of samer@0: (filter-gen ; a filtered signal samer@0: (fir-filter (VVector. "coeffs" 32)) ; filter is fir with 32 taps samer@0: (filter-gen (EnergyOperator.) ; signal is energy samer@0: (Wavetable. (linein (default-linesrc) N N)))))))) ; of audio in samer@0: samer@0: (expose) ; shows GUI samer@0: (set "editor.plotter.type" 4) ; vector editors like bar chart rather than line samer@0: (exec (viewable "coeffs") "plotter editor")