Debian Codegraph @

examples/cpstuni.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 cpstuni.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 ; Use Table #1.
29 ifn = 1
30
31 ; If the base key (note #60) is C, then 9 notes
32 ; above it (note #60 + 9 = note #69) should be A.
33 index = 69
34
35 i1 cpstuni index, ifn
36
37 print i1
38 endin
39
40
41 </CsInstruments>
42 <CsScore>
43
44 ; Play Instrument #1 for one second.
45 i 1 0 1
46 e
47
48
49 </CsScore>
50 </CsoundSynthesizer>