Debian Codegraph @

examples/tabmorphi.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 tabmorphi.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 giSine ftgen 0, 0, 8193, 10, 1 ;sine wave
17 giSquare ftgen 0, 0, 8193, 7, 1, 4096, 1, 0, -1, 4096, -1 ;square wave
18 giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ;triangle wave
19 giSaw ftgen 0, 0, 8193, 7, 1, 8192, -1 ;sawtooth wave, downward slope
20
21 instr 1
22
23 iamp = .7
24 kindex phasor 440 ;read table value at this index
25 kindex = kindex*8192 ;for all 8192 index points
26 kweightpoint = 0.5 ;set weightpoint
27 ktabnum1 line 0, p3, 3 ;morph through all tables
28 ktabnum2 = 2 ;set to triangle wave
29 ksig tabmorphi kindex, kweightpoint, ktabnum1, ktabnum2, giSine, giSquare, giTri, giSaw
30 ksig = ksig*iamp
31 asig interp ksig ;convert to audio signal
32 outs asig, asig
33
34 endin
35 </CsInstruments>
36 <CsScore>
37
38 i1 0 5
39 e
40 </CsScore>
41 </CsoundSynthesizer>