# masterGroup-\>setPitch not working as expected

**URL:** <https://qa.fmod.com/t/mastergroup-setpitch-not-working-as-expected/18288>\
**Category:** FMOD Engine\
**Tags:** cpp\
**Created:** [January 29, 2022, 2:28pm UTC](https://qa.fmod.com/t/mastergroup-setpitch-not-working-as-expected/18288 "2022-01-29T14:28:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ed\_IT](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@Ed\_IT](https://qa.fmod.com/u/Ed_IT)\
**Post date:** [January 29, 2022, 2:28pm UTC](https://qa.fmod.com/t/mastergroup-setpitch-not-working-as-expected/18288/1 "2022-01-29T14:28:52Z")

</div>

Hello.

I’ve been messing around with the FMOD Core examples, and I’ve noticed that the pitch fade out present in `channel_groups.cpp` doesn’t work as expected.

It appears as if setPitch called on the master channel initiates a pitch sweep, with the speed somehow tied to the pitch parameter. (Depending on the sign of the argument, the pitch reaches the lowest possible value (0/stopped) or the max value).

I tried slightly altering the example code, to set an arbitrary pitch value and without calling `System::update()` periodically, and this effect still applies:

```auto
/*
	A little fade out over 2 seconds.
*/
{
	masterGroup->setPitch(0.5f);

	result = system->update();
	ERRCHECK(result);

	for (count = 0; count < 200; count++)
	{
		Common_Sleep(10);
	}
}

```

In this example I want all channels to be playing at half the speed, but I get an unwanted fast sweep to pitch 0. (You can try with 0.99f to get a slower, more noticeable, sweep).  
The same happens if I periodically call `system->update()` in the for loop.

---

<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:** [February 2, 2022, 5:30am UTC](https://qa.fmod.com/t/mastergroup-setpitch-not-working-as-expected/18288/2 "2022-02-02T05:30:13Z")

</div>

Thank you for flagging, I have passed this onto the Dev team to fix in a future release.  
It looks like it’s only occurring on the masterGroup and is working for individual channels. The pitch value seems to be spiraling down or up forever until it’s set back to 1. With that in mind, you can do something like this as a workaround:

```cpp
 masterGroup->setPitch(2.0f);
 Common_Sleep(10);
 masterGroup->setPitch(1.00f);

```

Changing your sleep and pitch as required.
