Debian Codegraph @

src/Examples/FLOSS Manual Examples/03 Csound Language/03C23_Timeloop_Internal_Clock.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -odac -m0
4 </CsOptions>
5 <CsInstruments>
6 sr = 44100
7 ksmps = 32
8 nchnls = 2
9 0dbfs = 1
10
11 instr TimeLoop
12 //set desired time for time loop
13 kLoopTime = 1/2
14 //set kTime to zero at start
15 kTime init 0
16 //trigger event if zero has reached ...
17 if kTime <= 0 then
18 event "i", "Play", 0, .3
19 //... and reset time
20 kTime = kLoopTime
21 endif
22 //subtract time for each control cycle
23 kTime -= 1/kr
24 endin
25
26 instr Play
27 aEnv transeg 1, p3, -10, 0
28 aSig poscil .2*aEnv, 400
29 out aSig, aSig
30 endin
31
32 </CsInstruments>
33 <CsScore>
34 i "TimeLoop" 0 10
35 </CsScore>
36 </CsoundSynthesizer>
37 ;example by joachim heintz