Debian Codegraph @

examples/filenchnls.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac ;;;realtime audio out
5 ;-iadc ;;;uncomment -iadc if realtime audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ;-o filenchnls.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 sr = 44100
12 ksmps = 32
13 nchnls = 2
14 0dbfs = 1
15
16 ; by Menno Knevel 2022
17
18 instr 1 ; choose between mono or stereo file
19
20 ichn filenchnls p4 ; check number of channels
21 prints "\nnumber of channels = %d\n\n", ichn
22
23 if (ichn == 1) then
24 asig diskin2 p4, 1 ; mono signal
25 outs asig, asig
26 else
27 aL, aR diskin2 p4, 1 ; stereo signal
28 outs aL, aR
29 endif
30
31 endin
32
33 </CsInstruments>
34 <CsScore>
35
36 i 1 0 3 "fox.wav" ;mono signal
37 i 1 5 4 "drumsSlp.wav" ;stereo signal
38 e
39 </CsScore>
40 </CsoundSynthesizer>