Mercurial > hg > jslab
comparison examples/sound/sampled/modulate.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 ;;; Modulate noise or sine wave with short-term energy of input audio signal | |
2 | |
3 (load "audio.scm") | |
4 (load "lineout.scm") | |
5 (load "synthesis.scm") | |
6 | |
7 | |
8 (put "regulated" #f) ; main loop will not be regulated, run as fast as possible. | |
9 | |
10 (tasks) ; creates regulator and main loop Task | |
11 | |
12 (define N 256) ; frame size for audio input, output, and hop size | |
13 (lineout (default-linesnk) | |
14 (gen->vector N (Product. ; generate N sample vector as product of two | |
15 ; (NormalisedGaussian.) ; signal generators: | |
16 (oscillator 0.5) ; a sinusoidal oscillator at 0.5 radians/sample | |
17 (FunctionOfGenerator. (Sqrt.) ; and the square root of | |
18 (filter-gen ; a filtered signal | |
19 (fir-filter (VVector. "coeffs" 32)) ; filter is fir with 32 taps | |
20 (filter-gen (EnergyOperator.) ; signal is energy | |
21 (Wavetable. (linein (default-linesrc) N N)))))))) ; of audio in | |
22 | |
23 (expose) ; shows GUI | |
24 (set "editor.plotter.type" 4) ; vector editors like bar chart rather than line | |
25 (exec (viewable "coeffs") "plotter editor") |