Debian Codegraph @

examples/chanctrl.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 ; Audio out No messages MIDI in
5 -odac -d -M0 ;;;RT audio I/O with MIDI in
6 ;-iadc ;;;uncomment -iadc if RT audio input is needed too
7 ; For Non-realtime ouput leave only the line below:
8 ; -o chanctrl.wav -W ;;; for file output any platform
9 </CsOptions>
10 <CsInstruments>
11
12 sr = 44100
13 ksmps = 32
14 nchnls = 2
15 0dbfs = 1
16
17 instr 1 ; press your midi keyboard and move your midi controller to see result
18
19 ichnl = 1 ;MIDI note inputs on channel 1
20 ictlno = 7 ;use midi volume controller
21 kch chanctrl ichnl, 7 ;to control amplitude of oscil
22 printk2 kch
23
24 asig oscil kch*(1/127), 220, 1
25 outs asig, asig
26 endin
27
28 </CsInstruments>
29 <CsScore>
30 ;Dummy f-table to give time for real-time MIDI events
31 f 0 30
32 ;sine wave.
33 f 1 0 16384 10 1
34 e
35
36 </CsScore>
37 </CsoundSynthesizer>