Mercurial > hg > jslab
comparison examples/sound/sampled/firfilter.scm @ 0:bf79fb79ee13
Initial Mercurial check in.
author | samer |
---|---|
date | Tue, 17 Jan 2012 17:50:20 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:bf79fb79ee13 |
---|---|
1 ; Take audio from line in, | |
2 ; apply FIR filter defined in the frequency domain, | |
3 ; and send out | |
4 (load "audio.scm") | |
5 (load "synthesis.scm") | |
6 | |
7 (put "regulated" #f) | |
8 (put "map.symmetric" #t) | |
9 | |
10 (tasks) | |
11 (define fmt (mono 22050)) | |
12 (define N 512) | |
13 | |
14 | |
15 ; update filter whenever spectrum changes | |
16 | |
17 (lineout (linesnk fmt) | |
18 (gen->vector N (filter-gen | |
19 (fir-filter (spectral-fir 64 (VVector. "spectrum" 33))) | |
20 (Wavetable. (linein (linesrc fmt) N N))))) | |
21 | |
22 (expose) | |
23 (set "editor.plotter.type" 4) | |
24 (exec (viewable "coeffs") "plotter editor") | |
25 (exec (viewable "spectrum") "plotter editor") | |
26 | |
27 ;; the viewable "spectrum" is actually the vector created a few lines up | |
28 ;; the plotter-editor allows the user to draw the desired frequency | |
29 ;; response, which is then translated into the appropriate FIR filter. | |
30 |