<CsoundSynthesizer>

<CsOptions>

-A -o /Volumes/temp/kyklos/binaural_test1.aiff -s -m519 -R 

</CsOptions>


<CsInstruments>

/***************************************************

	binaural panning test

***************************************************/

sr = 44100
kr =  4410
ksmps = 10
nchnls = 2

instr 1

	iatt		=		p4
	imax		=		p5
	idecay	=		p6
	isustain	=		p3 - (iatt+idecay)

	istartpitch	=		p7
	iendpitch	=		p8

	kamp		linseg	0, iatt, imax, isustain, imax, idecay, 0
	kpitch	linseg	istartpitch, p3*.25, istartpitch, p3*.25, iendpitch, p3*.25, iendpitch, p3*.25, istartpitch

	kazimuth	linseg	0, p3*.25, 0, p3*.25, 360, p3*.25, 360, p3*.25, -360
	kelevation	linseg	0, p3*.25, 0, p3*.25, 30, p3*.25, -30, p3*.25, 0 


	a1		oscili	kamp*.3, kpitch, 1
	a2		oscili	kamp*.3, kpitch*.9999, 1
	a3		oscili	kamp*.3, kpitch*.0001, 1


	asum		=		a1+a2+a3
	
	al, ar	hrtfmove2	asum, kazimuth, kelevation, "hrtf-44100-left.dat","hrtf-44100-right.dat"
	
			outs		al, ar		

	endin

</CsInstruments>
<CsScore>

f1 0 4096 10 317811 196418 121393 75025 46368 28657 17711 10946 6765 4181 2584 1597 987 610 377 233 144 89  55  34  21  13  8  5  3  2  1  1

i1 0 120 5 20000 10 110 220
e 

</CsScore>

</CsoundSynthesizer>

/******************************************************************

Result when rendered:

Office-G4:/volumes/temp/kyklos Joe$ csound binaural_test.csd
PortMIDI real time MIDI plugin for Csound
PortAudio real-time audio module for Csound
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 5.10 (float samples) Dec 18 2008
libsndfile-1.0.16
UnifiedCSD:  binaural_test.csd
STARTING FILE
Creating options
Creating orchestra
Creating score
orchname:  /tmp/tmp.0.61ipnT.orc
scorename: /tmp/tmp.1.saWJ9u.sco
rtaudio: PortAudio module enabled ... using callback interface
rtmidi: PortMIDI module enabled
orch compiler:
38 lines read
        instr   1
sorting score ...
        ... done
Csound version 5.10 (float samples) Dec 18 2008
0dBFS level = 32768.0
orch now loaded
audio buffered in 1024 sample-frame blocks
writing 4096-byte blks of shorts to /Volumes/temp/kyklos/binaural_test1.aiff (AIFF)
SECTION 1:
ftable 1:
new alloc for instr 1:
file hrtf-44100-left.dat (376832 bytes) loaded into memory
file hrtf-44100-right.dat (376832 bytes) loaded into memory
B  0.000 ..120.000 T120.000 TT120.000 M:      inf      inf
         number of samples out of range:    79179   156144
Score finished in csoundPerform().
inactive allocs returned to freespace
end of score.              overall amps:      inf      inf
           overall samples out of range:    79179   156144
0 errors in performance
5168 4096-byte soundblks of shorts written to /Volumes/temp/kyklos/binaural_test1.aiff (AIFF)


*******************************************************/