Debian Codegraph @

examples/nsamp.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 nsamp.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 ; slightly adapted example from Jonathan Murphy Dec 2006
12 ; by Menno Knevel 2022
13
14 sr = 44100
15 ksmps = 32
16 nchnls = 2
17 0dbfs = 1
18
19 instr 1
20
21 ifn = p4 ; table number
22 ilen = nsamp(ifn)
23 prints "\nactual numbers of samples = %d\n\n", ilen
24 itrns = 1 ; no transposition
25 ilps = 0 ; loop starts at index 0
26 ilpe = ilen ; ends at value returned by nsamp above
27 imode = 1 ; loops forward
28 istrt = 0 ; commence playback at index 0 samples
29 ; lphasor provides index into f1
30 alphs lphasor itrns, ilps, ilpe, imode, istrt
31 atab tablei alphs, ifn
32 outs atab, atab
33
34 endin
35 </CsInstruments>
36 <CsScore>
37 f 1 0 262144 1 "drumsSlp.wav" 0 4 1 ;stereo file in table, with lots of zeroes
38 f 2 0 262144 1 "fox.wav" 0 4 1 ;mono file in table, with lots of zeroes
39
40 i1 0 10 1
41 i1 + 10 2
42 e
43 </CsScore>
44 </CsoundSynthesizer>