| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
--env:SADIR+=../../SourceMaterials |
| 4 |
-odac |
| 5 |
</CsOptions> |
| 6 |
<CsInstruments> |
| 7 |
sr = 44100 |
| 8 |
ksmps = 32 |
| 9 |
nchnls = 2 |
| 10 |
0dbfs = 1 |
| 11 |
|
| 12 |
giSine ftgen 0, 0, 2\^12, 10, 1 ; sine wave |
| 13 |
giLFOShape ftgen 0, 0, 131072, 19, 0.5,1,180,1 ; U-shape parabola |
| 14 |
|
| 15 |
gS_HRTF_left = "hrtf-44100-left.dat" |
| 16 |
gS_HRTF_right = "hrtf-44100-right.dat" |
| 17 |
|
| 18 |
instr 1 |
| 19 |
; create an audio signal (noise impulses) |
| 20 |
krate oscil 30,0.2,giLFOShape ; rate of impulses |
| 21 |
; amplitude envelope: a repeating pulse |
| 22 |
kEnv loopseg krate+3,0, 0,1, 0.05,0, 0.95,0,0 |
| 23 |
aSig pinkish kEnv ; noise pulses |
| 24 |
|
| 25 |
; -- apply binaural 3d processing -- |
| 26 |
; azimuth (direction in the horizontal plane) |
| 27 |
kAz linseg 0, 8, 360 |
| 28 |
; elevation (held horizontal for 8 seconds then up, then down, then horizontal |
| 29 |
kElev linseg 0, 8, 0, 4, 90, 8, -40, 4, 0 |
| 30 |
; apply hrtfmove2 opcode to audio source - create stereo ouput |
| 31 |
aLeft, aRight hrtfmove2 aSig, kAz, kElev, gS_HRTF_left, gS_HRTF_right |
| 32 |
outs aLeft, aRight ; audio to outputs |
| 33 |
endin |
| 34 |
|
| 35 |
</CsInstruments> |
| 36 |
<CsScore> |
| 37 |
i 1 0 24 ; instr 1 plays a note for 24 seconds |
| 38 |
</CsScore> |
| 39 |
</CsoundSynthesizer> |
| 40 |
;example by Iain McCurdy |