Debian Codegraph @

examples/follow.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac ;;;realtime audio out
5 ;-iadc ;;;uncomment -iadc if realtime audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ; -o follow.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 sr = 44100
12 ksmps = 32
13 nchnls = 2
14 0dbfs = 1
15
16 instr 1
17
18 asig soundin "drumsMlp.wav"
19 outs asig, asig
20
21 endin
22
23 instr 2 ;envelope follower
24
25 as soundin "drumsMlp.wav"
26 as = as*.7 ;reduce volume a bit
27 at tone as, 500 ;smooth estimated envelope
28 af follow at, p4
29 asin poscil3 .5, 440, 1
30 ; "drumsMlp.wav" provides amplitude for poscil
31 asig balance asin, af
32 outs asig, asig
33
34 endin
35 </CsInstruments>
36 <CsScore>
37 ;sine wave.
38 f 1 0 32768 10 1
39
40 i 1 0 2
41 i 2 2 2 0.001 ;follow quickly
42 i 2 5 3 0.2 ;follow slowly
43 e
44 </CsScore>
45 </CsoundSynthesizer>