Created
November 4, 2014 04:36
-
-
Save christhompson/8bee80ad23c0391f8da6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<CsoundSynthesizer> | |
<CsOptions> | |
; non-realtime output | |
-o hrtf.wav | |
</CsOptions> | |
<CsInstruments> | |
sr = 44100 ; standard sample rates | |
kr = 4410 | |
ksmps = 10 | |
nchnls = 2 ; final output is stereo | |
instr 10 | |
kaz line 0, p3, 180 ; move azimuth from front around right to back | |
kelev line 50, p3, -30 ; move elevation in arc from 50 to -30 deg | |
; (above you to below you) | |
ain soundin "fast_tone.wav" ; input sound | |
; set left and right channels to results of the hrtfmove2 opcode | |
; this has less clicking, especially when used for real-time synthesis | |
; this processes ain, with azimuth 0, the predefined elevation arc, | |
; and the two HRTF data files (that contain the impule responses) | |
; aleft,aright hrtfmove2 ain, 0, kelev, "hrtf-44100-left.dat","hrtf-44100-right.dat" | |
; This does the same, but with the predefined azimuth arc and an | |
; elevation of zero. | |
aleft,aright hrtfmove2 ain, kaz, 0, "hrtf-44100-left.dat","hrtf-44100-right.dat" | |
outs aleft, aright | |
endin | |
</CsInstruments> | |
<CsScore> | |
i10 0 20 ; play for 20 seconds | |
e | |
</CsScore> | |
</CsoundSynthesizer> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment