In a 2D game I don’t need the distance attenuation / panning of 3D sound; I just want to set the left/right pan of the sfx’s. At the moment I am using a constant 3D_Attributes for the listener and all the sources of the sfx:
FMOD_3D_ATTRIBUTE = fmod._3D_ATTRIBUTES()
FMOD_3D_ATTRIBUTE.position = ZERO
FMOD_3D_ATTRIBUTE.velocity = ZERO
FMOD_3D_ATTRIBUTE.forward = FORWARD
FMOD_3D_ATTRIBUTE.up = UP
(This is lua for fmod-Defold.)
Then in FMOD Studio I have created a Pan parameter (with range -1, +1) and I have added a automation to the pan property of each sfx I want to pan; this automation is just a linear interpolation from (-1, +1) to (-100, +100). So I create a sfx with something similar to
local event_description = fmod.studio.system:get_event(name)
local event = event_description:create_instance()
event:set_3d_attributes(FMOD_3D_ATTRIBUTE)
event:set_parameter_by_name("Pan", pan, true)
event:start()
Is this the right way to exclude the 3D attenuation / panning and implement a simple left/right pan? Is there some simpler way? I may guess that the attenuation/speed/panning computations are being performed anyway by the fmod-runtime just wasting time…
Many thanks for any help!