| 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 lorisread.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
|
| 11 |
sr = 44100 |
| 12 |
ksmps = 32 |
| 13 |
nchnls = 2 |
| 14 |
0dbfs = 1 |
| 15 |
|
| 16 |
; Play the partials in clarinet.sdif from 0 to 3 sec with 1 ms fadetime |
| 17 |
; and no frequency , amplitude, or bandwidth modification. |
| 18 |
|
| 19 |
instr 1 |
| 20 |
|
| 21 |
ktime linseg 0, p3, 3 ; linear time function from 0 to 3 seconds |
| 22 |
lorisread ktime, "clarinet.sdif", 1, 1, 1, 1, .001 |
| 23 |
asig lorisplay 1, 1, 1, 1 |
| 24 |
outs asig, asig |
| 25 |
endin |
| 26 |
|
| 27 |
|
| 28 |
; Play the partials in clarinet.sdif from 0 to 3 sec with 1 ms fadetime |
| 29 |
; adding tuning and vibrato, increasing the "breathiness" (noisiness) and overall |
| 30 |
; amplitude, and adding a highpass filter. |
| 31 |
|
| 32 |
instr 2 |
| 33 |
|
| 34 |
ktime linseg 0, p3, 3 ; linear time function from 0 to 3 seconds |
| 35 |
; compute frequency scale for tuning |
| 36 |
ifscale = cpspch(p4)/cpspch(8.08) ; (original pitch was G#4) |
| 37 |
; make a vibrato envelope |
| 38 |
kvenv linseg 0, p3/6, 0, p3/6, .02, p3/3, .02, p3/6, 0, p3/6, 0 |
| 39 |
kvib oscil kvenv, 4, 1 ; table 1, sinusoid |
| 40 |
kbwenv linseg 1, p3/6, 1, p3/6, 2, 2*p3/3, 2 ;lots of noise |
| 41 |
lorisread ktime, "clarinet.sdif", 1, 1, 1, 1, .001 |
| 42 |
a1 lorisplay 1, ifscale+kvib, 2, kbwenv |
| 43 |
asig atone a1, 1000 ; highpass filter, cutoff 1000 Hz |
| 44 |
outs asig, asig |
| 45 |
endin |
| 46 |
|
| 47 |
</CsInstruments> |
| 48 |
<CsScore> |
| 49 |
; a sinus |
| 50 |
f 1 0 4096 10 1 |
| 51 |
|
| 52 |
i 1 0 3 |
| 53 |
i 1 + 1 |
| 54 |
i 1 + 6 |
| 55 |
s |
| 56 |
|
| 57 |
; pitch |
| 58 |
i 2 1 3 8.08 |
| 59 |
i 2 3.5 1 8.04 |
| 60 |
i 2 4 6 8.00 |
| 61 |
i 2 4 6 8.07 |
| 62 |
e |
| 63 |
</CsScore> |
| 64 |
</CsoundSynthesizer> |