Debian Codegraph @

examples/notnum.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac -M0 -+rtmidi=virtual ;;;realtime audio out with virtual MIDI in
5 </CsOptions>
6 <CsInstruments>
7
8 sr = 44100
9 ksmps = 32
10 nchnls = 2
11 0dbfs = 1
12
13 massign 1, 1 ; set MIDI channel 1 to play instr 1
14
15 instr 1
16
17 iNum notnum
18 print iNum
19 ; Convert MIDI note number to Hz
20 iHz = (440.0*exp(log(2.0)*((iNum)-69.0)/12.0))
21 aosc oscil 0.6, iHz, 1
22 outs aosc, aosc
23
24 endin
25 </CsInstruments>
26 <CsScore>
27 f 1 0 16384 10 1 ;sine wave
28
29 f 0 60 ;play 60 seconds
30
31 e
32 </CsScore>
33 </CsoundSynthesizer>