| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
|
| 4 |
; Select flags here |
| 5 |
; realtime audio out |
| 6 |
-o dac |
| 7 |
; file ouput |
| 8 |
; -o hrtf.wav |
| 9 |
|
| 10 |
</CsOptions> |
| 11 |
<CsInstruments> |
| 12 |
|
| 13 |
nchnls = 2 |
| 14 |
|
| 15 |
gasrc init 0 ;global |
| 16 |
|
| 17 |
instr 1 ;a plucked string, distorted and filtered |
| 18 |
|
| 19 |
iamp = 15000 |
| 20 |
icps = cpspch(p4) |
| 21 |
|
| 22 |
a1 pluck iamp, icps, icps, 0, 1 |
| 23 |
adist distort1 a1, 10, .5, 0, 0 |
| 24 |
afilt moogvcf2 adist, 8000, .5 |
| 25 |
aout linen afilt, 0, p3, .01 |
| 26 |
|
| 27 |
gasrc = gasrc + aout |
| 28 |
|
| 29 |
endin |
| 30 |
|
| 31 |
instr 10 ;uses output from instr1 as source |
| 32 |
|
| 33 |
;simple path for source |
| 34 |
kx line 2, p3, 9 |
| 35 |
|
| 36 |
;early reflections, room default 1 |
| 37 |
aearlyl,aearlyr, irt60low, irt60high, imfp hrtfearly gasrc, kx, 5, 1, 5, 1, 1, "hrtf-44100-left.dat", "hrtf-44100-right.dat", 1 |
| 38 |
|
| 39 |
;later reverb, uses outputs from above |
| 40 |
arevl, arevr, idel hrtfreverb gasrc, irt60low, irt60high, "hrtf-44100-left.dat", "hrtf-44100-right.dat", 44100, imfp |
| 41 |
|
| 42 |
;delayed and scaled |
| 43 |
alatel delay arevl * .1, idel |
| 44 |
alater delay arevr * .1, idel |
| 45 |
|
| 46 |
outs aearlyl + alatel, aearlyr + alater |
| 47 |
|
| 48 |
gasrc = 0 |
| 49 |
|
| 50 |
endin |
| 51 |
|
| 52 |
</CsInstruments> |
| 53 |
<CsScore> |
| 54 |
|
| 55 |
; Play Instrument 1: a simple arpeggio |
| 56 |
i1 0 .2 8.00 |
| 57 |
i1 + .2 8.04 |
| 58 |
i1 + .2 8.07 |
| 59 |
i1 + .2 8.11 |
| 60 |
i1 + .2 9.02 |
| 61 |
i1 + 1.5 8.11 |
| 62 |
i1 + 1.5 8.07 |
| 63 |
i1 + 1.5 8.04 |
| 64 |
i1 + 1.5 8.00 |
| 65 |
i1 + 1.5 7.09 |
| 66 |
i1 + 4 8.00 |
| 67 |
|
| 68 |
; Play Instrument 10 for 13 seconds. |
| 69 |
i10 0 13 |
| 70 |
|
| 71 |
</CsScore> |
| 72 |
</CsoundSynthesizer> |
| 73 |
|
| 74 |
|