Debian Codegraph @

examples/tival.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 tival.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 idur = abs(p3) ;make p3 positive even if p3 is negative in score
19 itiv tival
20 i1 = -1 ;assume this is tied note, so keep fase of oscili
21 tigoto slur ;no reinitialisation on tied notes
22 i1 = 0 ;first note, so reset phase
23 aatt line p4, idur, 0 ;primary envelope
24
25 slur:
26 if itiv==0 kgoto note ;no expression on first and second note
27 aslur linseg 0, idur*.3, p4, idur*.7, 0 ;envelope for slurred note
28 aatt = aatt + aslur
29
30 note:
31 asig oscili aatt, p5, 1, i1
32 outs asig, asig
33
34 endin
35 </CsInstruments>
36 <CsScore>
37 f1 0 4096 10 1 ;sine wave
38
39 i1 0 -5 .8 451 ;p3 = 5 seconds
40 i1 1.5 -1.5 .1 512
41 i1 3 2 .7 440 ;3 notes together--> duration = 5 seconds
42
43 e
44 </CsScore>
45 </CsoundSynthesizer>