Debian Codegraph @

examples/gentanh.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 gentanh.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 aswp linseg 0.01, p3*.5, .49, p3*.5, 0.01 ;index sweep function
19 aindex poscil aswp, 110, 1 ;sound to waveshape
20 atable tablei aindex, p4, 1, .5 ;waveshape index
21 aenv linen 0.8, .01, p3, .02 ;amplitude envelope
22 asig = (atable*aenv)*p5 ;impose envelope and scale
23 asig dcblock2 asig ;get rid of DC
24 outs asig, asig
25
26 endin
27 </CsInstruments>
28 <CsScore>
29 f 1 0 8192 10 1 ;sine wave
30 f 2 0 8192 "tanh" -100 100 0 ;symmetrical transfer fuction
31 f 3 0 8192 "tanh" -10 10 0 ;symmetrical
32 f 4 0 8192 "tanh" 0 10 0 ;not symmetrical
33
34 i1 0 3 2 1
35 i1 + 3 3 1
36 i1 + 3 4 2
37
38 e
39 </CsScore>
40 </CsoundSynthesizer>
41