Debian Codegraph @

examples/cpstmid.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac -M0 ;;;RT audio I/O with MIDI in
5 ;-iadc ;;;uncomment -iadc if RT audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ; -o cpstmid.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10 ; after an example from Kevin Conder
11 sr = 44100
12 ksmps = 32
13 nchnls = 2
14 0dbfs = 1
15
16 ; Table #1, a normal 12-tone equal temperament scale.
17 ; numgrades = 12 (twelve tones)
18 ; interval = 2 (one octave)
19 ; basefreq = 261.659 (Middle C)
20 ; basekeymidi = 60 (Middle C)
21 gitemp ftgen 1, 0, 64, -2, 12, 2, 261.659, 60, 1.00, \
22 1.059, 1.122, 1.189, 1.260, 1.335, 1.414, \
23 1.498, 1.588, 1.682, 1.782, 1.888, 2.000
24
25 instr 1
26
27 ifn = 1
28 icps cpstmid ifn
29 print icps
30 asig oscil 0.6, icps, 2
31 outs asig, asig
32
33 endin
34
35
36 </CsInstruments>
37 <CsScore>
38 f 0 20
39 ;sine wave.
40 f 2 0 16384 10 1
41
42 e
43
44 </CsScore>
45 </CsoundSynthesizer>