| 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 |
;-iadc ;;;uncomment -iadc if realtime audio input is needed too |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o pvread.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
|
| 11 |
sr = 44100 |
| 12 |
ksmps = 32 |
| 13 |
0dbfs = 1 |
| 14 |
nchnls = 2 |
| 15 |
|
| 16 |
; by Menno Knevel 2021 |
| 17 |
|
| 18 |
gilen filelen "fox.wav" ; get length of impulse soundfile |
| 19 |
|
| 20 |
; analyze sound file and output result to pvoc-ex file |
| 21 |
ires system_i 1,{{ pvanal fox.wav fox1.pvx }} ; default settings |
| 22 |
|
| 23 |
instr 1 ; untreated signal |
| 24 |
asig diskin2 "fox.wav", 1 |
| 25 |
prints "\n---***YOU NOW HEAR THE UNTREATED SOUND SAMPLE***---\n" |
| 26 |
outs asig, asig |
| 27 |
endin |
| 28 |
|
| 29 |
instr 2 |
| 30 |
|
| 31 |
prints "\n---***YOU NOW HEAR THE RESULT OF THIS ANALYZED FILE:***---\n" |
| 32 |
ibin = p4 |
| 33 |
ktime line 0, p3, 2.8 |
| 34 |
kfreq, kamp pvread ktime, "fox1.pvx", ibin ;read data from 7th analysis bin. |
| 35 |
asig poscil kamp, kfreq |
| 36 |
outs asig*5, asig*5 ;compensate loss of volume |
| 37 |
|
| 38 |
endin |
| 39 |
</CsInstruments> |
| 40 |
<CsScore> |
| 41 |
|
| 42 |
i1 0 2.76 ; original sample |
| 43 |
s |
| 44 |
i2 0 2.76 7 ; 3 different bins |
| 45 |
i2 + 2.76 15 |
| 46 |
i2 + 2.76 25 |
| 47 |
s |
| 48 |
i2 2 6 7 ; slow chord |
| 49 |
i2 2 6 50 |
| 50 |
i2 2 2 75 |
| 51 |
e |
| 52 |
</CsScore> |
| 53 |
</CsoundSynthesizer> |