| 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 pvspitch.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
|
| 11 |
; by Richard Boulanger & Menno Knevel 2021 |
| 12 |
|
| 13 |
sr = 44100 |
| 14 |
ksmps = 32 |
| 15 |
nchnls = 2 |
| 16 |
0dbfs = 1 |
| 17 |
|
| 18 |
giwave ftgen 0, 0, 4096, 10, 1, 0.5, 0.333, 0.25, 0.2, 0.1666 |
| 19 |
|
| 20 |
instr 1 |
| 21 |
|
| 22 |
ifftsize = 1024 |
| 23 |
iwtype = 1 ; hanning window |
| 24 |
a1 soundin "flute.aiff" |
| 25 |
fsig pvsanal a1, ifftsize, ifftsize/4, ifftsize, iwtype |
| 26 |
kfr, kamp pvspitch fsig, p4 ; estimate pitch, use treshold settings |
| 27 |
adm poscil kamp, kfr, giwave ; sawtooth gets pitch from the flute |
| 28 |
outs adm, adm |
| 29 |
|
| 30 |
endin |
| 31 |
|
| 32 |
</CsInstruments> |
| 33 |
<CsScore> |
| 34 |
; treshold |
| 35 |
i 1 0 3 .1 |
| 36 |
i 1 3 3 .01 |
| 37 |
i 1 6 3 .001 |
| 38 |
e |
| 39 |
</CsScore> |
| 40 |
</CsoundSynthesizer> |