I am looking at the web audio API spec and the panning node uses three values to create a 3D spectrum for sound. I was wondering if in order to create a basic 2D "equal power" panner the programmer needs to do the formulaic programming to scale this ... or if I am over thinking it and there is a simpler way to do it.
EDIT
here's an even simpler (less formulaic?) way to achieve 2D panning:
( full code here )
I can still get a panning effect by changing only the first argument to setPosition() and keeping other arguments zero.
But to get a natural panning effect, you need to specify the third argument as well.
The panner node defaults to "HRTF" (Head Related Transfer Function) which is a stereo convolution engine and it is designed for 3D sound.
In order to have basic panning functionality and lower resource usage you need to set panningModel attribute to "equalpower".
Check the documentation for more details.