Debian Codegraph @

examples/filelen.csd

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