Debian Codegraph @

examples/cpstun.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 ; Audio out Audio in
5 -odac -iadc ;;;RT audio I/O
6 ; For Non-realtime ouput leave only the line below:
7 ; -o cpstun.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 ; Initialize the global variables.
12 sr = 44100
13 kr = 4410
14 ksmps = 10
15 nchnls = 1
16
17 ; Table #1, a normal 12-tone equal temperament scale.
18 ; numgrades = 12 (twelve tones)
19 ; interval = 2 (one octave)
20 ; basefreq = 261.659 (Middle C)
21 ; basekeymidi = 60 (Middle C)
22 gitemp ftgen 1, 0, 64, -2, 12, 2, 261.659, 60, 1.00, \
23 1.059, 1.122, 1.189, 1.260, 1.335, 1.414, \
24 1.498, 1.588, 1.682, 1.782, 1.888, 2.000
25
26 ; Instrument #1.
27 instr 1
28 ; Set the trigger.
29 ktrig init 1
30
31 ; Use Table #1.
32 kfn init 1
33
34 ; If the base key (note #60) is C, then 9 notes
35 ; above it (note #60 + 9 = note #69) should be A.
36 kindex init 69
37
38 k1 cpstun ktrig, kindex, kfn
39
40 printk2 k1
41 endin
42
43
44 </CsInstruments>
45 <CsScore>
46
47 ; Play Instrument #1 for one second.
48 i 1 0 1
49 e
50
51
52 </CsScore>
53 </CsoundSynthesizer>