| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
; Audio out Audio in No messages |
| 5 |
-odac -iadc ;;;-d RT audio I/O |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o pvsarp.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
; additions by Menno Knevel 2021 |
| 11 |
sr = 44100 |
| 12 |
ksmps = 32 |
| 13 |
nchnls = 2 |
| 14 |
0dbfs = 1 |
| 15 |
nchnls_i = 1 ; number of input channels |
| 16 |
|
| 17 |
instr 1 |
| 18 |
|
| 19 |
asig diskin2 "flute.aiff", 1, 0, 1 ; get the sample in |
| 20 |
idepth = p4 |
| 21 |
prints "\n--**here the sample is used**--\n" |
| 22 |
fsig pvsanal asig, 1024, 256, 1024, 1 ; analyse it |
| 23 |
kbin oscili 0.1, 0.05, 1 ; ftable 1 in the 0-1 range |
| 24 |
ftps pvsarp fsig, kbin+0.01, idepth, 7 ; arpeggiate it (range 220.5 - 2425.5) |
| 25 |
atps pvsynth ftps ; synthesise it |
| 26 |
outs atps, atps |
| 27 |
|
| 28 |
endin |
| 29 |
|
| 30 |
instr 2 |
| 31 |
|
| 32 |
asig in ; get the (microphone?) signal in |
| 33 |
idepth = p4 |
| 34 |
prints "\n--**please use microphone**--\n" |
| 35 |
prints "--**if no input is given, there will be only silence...\n" |
| 36 |
fsig pvsanal asig, 1024, 256, 1024, 1 ; analyse it |
| 37 |
kbin oscili 0.1, 0.3, 1 ; ftable 1 in the 0-1 range |
| 38 |
ftps pvsarp fsig, kbin+0.01, idepth, 7 ; arpeggiate it (range 220.5 - 2425.5) |
| 39 |
atps pvsynth ftps ; synthesise it |
| 40 |
outs atps, atps |
| 41 |
|
| 42 |
endin |
| 43 |
|
| 44 |
</CsInstruments> |
| 45 |
<CsScore> |
| 46 |
f 1 0 4096 10 1 ;sine wave |
| 47 |
s |
| 48 |
i 1 0 10 0.5 ; notes for the flute sample |
| 49 |
i 1 + 10 1 |
| 50 |
s |
| 51 |
i 2 0 10 0.9 ; notes for the microphone |
| 52 |
i 2 + 10 0.5 |
| 53 |
e |
| 54 |
</CsScore> |
| 55 |
</CsoundSynthesizer> |