Debian Codegraph @

src/Examples/FLOSS Manual Examples/05 Sound Modification/05K02_atsread.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -o dac
4 </CsOptions>
5 <CsInstruments>
6 sr = 44100
7 ksmps = 32
8 nchnls = 1
9 0dbfs = 1
10
11 instr 1
12 iamp = p4 ;amplitude scaler
13 ifreq = p5 ;frequency scaler
14 ipar = p6 ;partial required
15 itab = p7 ;audio table
16 iatsfile = p8 ;ats file
17
18 idur ATSinfo iatsfile, 7 ;get duration
19
20 ktime line 0, p3, idur ;time pointer
21
22 kfreq, kamp ATSread ktime, iatsfile, ipar ;get frequency and amplitude values
23 aamp interp kamp ;interpolate amplitude values
24 afreq interp kfreq ;interpolate frequency values
25 aout oscil3 aamp*iamp, afreq*ifreq, itab ;synthesize with amp and freq scaling
26
27 out aout
28 endin
29
30 </CsInstruments>
31 <CsScore>
32 ; sine wave table
33 f 1 0 16384 10 1
34 #define atsfile #"flute-A5.ats"#
35
36 ; start dur amp freq par tab atsfile
37 i1 0 3 1 1 1 1 $atsfile
38 i1 0 . .1 . 2 . $atsfile
39 i1 0 . 1 . 3 . $atsfile
40 i1 0 . .1 . 4 . $atsfile
41 i1 0 . 1 . 5 . $atsfile
42 i1 0 . .1 . 6 . $atsfile
43 i1 0 . 1 . 7 . $atsfile
44 i1 0 . .1 . 8 . $atsfile
45 i1 0 . 1 . 9 . $atsfile
46 i1 0 . .1 . 10 . $atsfile
47 e
48 </CsScore>
49 </CsoundSynthesizer>
50 ;example by Oscar Pablo Di Liscia