samer@0: ; Take audio from line in, samer@0: ; apply FIR filter defined in the frequency domain, samer@0: ; and send out samer@0: (load "audio.scm") samer@0: (load "synthesis.scm") samer@0: samer@0: (put "regulated" #f) samer@0: (put "map.symmetric" #t) samer@0: samer@0: (tasks) samer@0: (define fmt (mono 22050)) samer@0: (define N 512) samer@0: samer@0: samer@0: ; update filter whenever spectrum changes samer@0: samer@0: (lineout (linesnk fmt) samer@0: (gen->vector N (filter-gen samer@0: (fir-filter (spectral-fir 64 (VVector. "spectrum" 33))) samer@0: (Wavetable. (linein (linesrc fmt) N N))))) samer@0: samer@0: (expose) samer@0: (set "editor.plotter.type" 4) samer@0: (exec (viewable "coeffs") "plotter editor") samer@0: (exec (viewable "spectrum") "plotter editor") samer@0: samer@0: ;; the viewable "spectrum" is actually the vector created a few lines up samer@0: ;; the plotter-editor allows the user to draw the desired frequency samer@0: ;; response, which is then translated into the appropriate FIR filter. samer@0: