# ChannelControl::setPan and FMOD\_DSP\_PAN\_MODE

**URL:** <https://qa.fmod.com/t/channelcontrol-setpan-and-fmod-dsp-pan-mode/19007>\
**Category:** FMOD Engine\
**Tags:** cpp\
**Created:** [July 16, 2022, 11:47pm UTC](https://qa.fmod.com/t/channelcontrol-setpan-and-fmod-dsp-pan-mode/19007 "2022-07-16T23:47:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)\
**Post date:** [July 16, 2022, 11:47pm UTC](https://qa.fmod.com/t/channelcontrol-setpan-and-fmod-dsp-pan-mode/19007/1 "2022-07-16T23:47:31Z")

</div>

What is the difference between `ChannelControl::setPan` and `FMOD_DSP_PAN_2D_STEREO_POSITION`?

I tested them myself:

```auto
	FMOD_System_PlaySound(g_System, g_Sound, NULL, TRUE, &channelA);
	FMOD_System_PlaySound(g_System, g_Sound, NULL, TRUE, &channelB);

	FMOD_Channel_SetPan(channelA, -0.5f);

	FMOD_DSP* panDSP;
	FMOD_System_CreateDSPByType(g_System, FMOD_DSP_TYPE_PAN, &panDSP);
	FMOD_DSP_SetParameterInt(panDSP, FMOD_DSP_PAN_MODE, FMOD_DSP_PAN_MODE_STEREO);
	FMOD_DSP_SetParameterFloat(panDSP, FMOD_DSP_PAN_2D_STEREO_POSITION, -50.0f);
	FMOD_Channel_AddDSP(channelB, FMOD_CHANNELCONTROL_DSP_TAIL, panDSP);
	// This is called to match the volume levels.
	FMOD_Channel_SetVolume(channelB, 0.7f);

	FMOD_Channel_SetPaused(channelA, FALSE);
	FMOD_Channel_SetPaused(channelB, FALSE);

	FMOD_Channel_SetMute(channelB, TRUE);

```

The reason why I lowered the volume of the second channel is it was much louder when `FMOD_DSP_TYPE_PAN` and `FMOD_DSP_PAN_2D_STEREO_POSITION` are applied.

I compared two channels switching between them, and I didn’t like the sound from the channel with `FMOD_DSP_TYPE_PAN`.

I don’t know how to describe it, but the first one felt more smooth and natural.  
On the other hand, the sound via `FMOD_DSP_PAN_2D_STEREO_POSITION` doesn’t seem to be distributed to the left and right speakers smoothly as the first one.

1. Why is this? Why the first one is quieter but more natural compared to the second one?
2. Which one is better performance-wise?  
(In the case where the pan setting is very frequently adjusted, and in another case where the different pan settings are applied to a lot of sound sources.)

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [July 22, 2022, 12:29am UTC](https://qa.fmod.com/t/channelcontrol-setpan-and-fmod-dsp-pan-mode/19007/2 "2022-07-22T00:29:08Z")

</div>

`ChannelControl::setPan` internally uses [`ChannelControl::setMixLevelsOutput`](https://fmod.com/docs/2.02/api/core-api-channelcontrol.html#channelcontrol_setmixlevelsoutput) to change the left and right levels of the channel.  
`FMOD_DSP_PAN_2D_STEREO_POSITION` uses the [Pan Effect](https://fmod.com/docs/2.02/api/effects-reference.html#pan), which uses more sophisticated mechanisms to pan between multiple speakers.

> [@jiyongman](#):
>
> Why is this? Why the first one is quieter but more natural compared to the second one?

The Pan Effect uses a different algorithm to compute the left/right balance, with the goal of producing an even and accurate result across a range of different speaker configurations. `ChannelControl::setPan` just makes one channel quieter and the other louder in a balanced way. As for why it sounds more natural, that is a bit subjective but I’m happy to speculate- perhaps as the simpler panning algorithm, it is the more common one in audio software and the behavior feels more familiar?

> [@jiyongman](#):
>
> Which one is better performance-wise?

Profiling yourself is always the best way to know for sure, but going on heursitics and the relative complexity of `FMOD_DSP_PAN_2D_STEREO_POSITION`, I would guess `ChannelControl::setPan` takes less cpu cycles.

---

<div class="post-metadata">

**Author:** ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)\
**Post date:** [July 22, 2022, 2:09pm UTC](https://qa.fmod.com/t/channelcontrol-setpan-and-fmod-dsp-pan-mode/19007/3 "2022-07-22T14:09:38Z")

</div>

Thank you very much! 😊
