Debian Codegraph @

examples/atsa.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac -m0 --limiter=.95 ;;;realtime audio out, with limiter protection
5 ; For Non-realtime ouput leave only the line below:
6 ; -o atsa.wav -W ;;; for file output any platform
7 </CsOptions>
8 <CsInstruments>
9
10 sr = 44100
11 ksmps = 32
12 nchnls = 2
13 0dbfs = 1
14
15 ; by Menno Knevel 2021
16
17 gilen filelen "fox.wav" ; get length of soundfile
18
19 ; analyze sound file and output result to 3 ats files. ATSA wants a mono file!
20 ires1 system_i 1,{{ atsa fox.wav fox1.ats }} ; default settings
21 ires2 system_i 1,{{ atsa -h.8 fox.wav fox2.ats }} ; some smearing
22 ires3 system_i 1,{{ atsa -h.1 -c2 fox.wav fox3.ats }} ; only 2 cycles
23
24 instr 1 ; untreated signal
25 asig diskin2 "fox.wav", 1
26 prints "\n---***YOU NOW HEAR THE UNTREATED SOUND SAMPLE***---\n"
27 prints "---*duration of soundfile is %f seconds*---\\n",gilen
28 outs asig, asig
29 endin
30
31 instr 2
32 prints "\n---***YOU NOW HEAR THE RESULT OF THIS ANALYZED FILE:***---\n"
33 ktime line 0, p3, gilen ; timepointer = equal to soundfile duration
34 asig ATSsinnoi ktime, 1, .4, 1, p4, 167 ; maximum # of partials = 167
35 outs asig, asig
36 endin
37
38 </CsInstruments>
39 <CsScore>
40
41 i1 2 2.76 ; original sample
42
43 i2 5 2.76 "fox1.ats" ; whole sentence
44 i2 10 2.76 "fox2.ats" ; whole sentence, but analyzed with different settings
45 i2 15 2.76 "fox3.ats" ; whole sentence, and again analyzed with different settings
46 e
47 </CsScore>
48 </CsoundSynthesizer>