Debian Codegraph @

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

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -odac -m128
4 </CsOptions>
5 <CsInstruments>
6 sr = 44100
7 nchnls = 2
8 0dbfs = 1
9 ksmps = 32
10
11 gi_Arr_1[] fillarray 1, 2, 3, 4, 5
12 gi_Arr_2[] fillarray 5, 4, 3, 2, 1
13
14 instr Select
15 if p4==1 then
16 iArr[] = gi_Arr_1
17 else
18 iArr[] = gi_Arr_2
19 endif
20 index = 0
21 while index < lenarray(iArr) do
22 schedule("Play",index/2,1,iArr[index])
23 index += 1
24 od
25 endin
26
27 instr Play
28 aImp mpulse 1, p3
29 iFreq = mtof:i(60 + (p4-1)*2)
30 aTone mode aImp,iFreq,100
31 out aTone, aTone
32 endin
33
34 </CsInstruments>
35 <CsScore>
36 i "Select" 0 4 1
37 i "Select" + . 2
38 </CsScore>
39 </CsoundSynthesizer>
40 ;example by joachim heintz