Debian Codegraph @

examples/copyf2array.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 ;8 points sine wave function table
14 giSine ftgen 0, 0, 8, 10, 1
15
16
17 instr 1
18 ;create array
19 kArr[] init 8
20
21 ;copy table values in it
22 copyf2array kArr, giSine
23
24 ;print values
25 kndx = 0
26 until kndx == lenarray(kArr) do
27 printf "kArr[%d] = %f\n", kndx+1, kndx, kArr[kndx]
28 kndx += 1
29 od
30
31 ;turn instrument off
32 turnoff
33 endin
34
35 </CsInstruments>
36 <CsScore>
37 i 1 0 0.1
38 </CsScore>
39 </CsoundSynthesizer>