Debian Codegraph @

examples/genarray.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -n
5 </CsOptions>
6 <CsInstruments>
7
8 sr = 44100
9 ksmps = 32
10 nchnls = 2
11 0dbfs = 1
12
13 instr 1
14
15 ;create and fill two arrays
16 iArr1[] genarray 1, 6
17 iArr2[] genarray 1, 6, 2/3
18
19 ;print the content of iArr1
20 printf "%s", 1, "iArr1: start=1, end=6, step=default\n"
21 kndx = 0
22 until kndx == lenarray(iArr1) do
23 printf "iArr[%d] = %f\n", kndx+1, kndx, iArr1[kndx]
24 kndx += 1
25 od
26
27 ;print the content of iArr2
28 printf "%s", 1, "iArr2: start=1, end=6, step=2/3\n"
29 kndx = 0
30 until kndx == lenarray(iArr2) do
31 printf "iArr[%d] = %f\n", kndx+1, kndx, iArr2[kndx]
32 kndx += 1
33 od
34
35 turnoff
36 endin
37
38 </CsInstruments>
39 <CsScore>
40 i 1 0 1
41 </CsScore>
42 </CsoundSynthesizer>
43