Debian Codegraph @

examples/ATSadd-2.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -odac -d -m1
4 </CsOptions>
5 <CsInstruments>
6 ;example by joachim heintz (& Menno Knevel)
7 sr = 44100
8 ksmps = 32
9 nchnls = 2
10 0dbfs = 1
11
12 ;ATSA wants a mono file!
13 ires system_i 1,{{ atsa -h.1 -c2 fox.wav fox.ats }} ; only 2 cycles and small hop size
14
15 giSine ftgen 0, 0, 1024, 10, 1
16
17 instr AllTheTones
18 Sfile = "fox.ats"
19 prints "Resynthesizing with all the tones.\n"
20 iDur ATSinfo Sfile, 7
21 p3 = iDur
22 iNumParts ATSinfo Sfile, 3
23 prints "Overall number of partials = %d\n", iNumParts
24 ktime line 0, iDur, iDur
25 asig ATSadd ktime, 1, Sfile, giSine, iNumParts
26 outs asig, asig
27
28 ;start next instr
29 event_i "i", "TonesInBandsOfTen", iDur+1, iDur, 0, iNumParts
30 endin
31
32 instr TonesInBandsOfTen
33 Sfile = "fox.ats"
34 iOffset = p4 ;start at this partial
35 iNumParts = p5 ;overall number of partials
36 prints "Resynthesizing with partials %d - %d.\n", iOffset+1, iOffset+10
37 ktime line 0, p3, p3
38 asig ATSadd ktime, 1, Sfile, giSine, 10, iOffset
39 outs asig, asig
40
41 ;start next instance until there are enough partials left
42 if iOffset+20 < iNumParts then
43 event_i "i", "TonesInBandsOfTen", p3+1, p3, iOffset+10, iNumParts
44 else
45 event_i "i", "End", p3, 1
46 endif
47 endin
48
49 instr End
50 exitnow
51 endin
52 </CsInstruments>
53 <CsScore>
54 i "AllTheTones" 0 1
55 e 999
56 </CsScore>
57 </CsoundSynthesizer>