# Changing pitch to ChannelGroup not working

**URL:** <https://qa.fmod.com/t/changing-pitch-to-channelgroup-not-working/14818>\
**Category:** Unity\
**Created:** [June 30, 2019, 11:26am UTC](https://qa.fmod.com/t/changing-pitch-to-channelgroup-not-working/14818 "2019-06-30T11:26:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlosvVk](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@carlosvVk](https://qa.fmod.com/u/carlosvVk)\
**Post date:** [June 30, 2019, 11:26am UTC](https://qa.fmod.com/t/changing-pitch-to-channelgroup-not-working/14818/1 "2019-06-30T11:26:29Z")

</div>

Hello!

I’m trying to change the pitch of a channel group, but the only thing I get is **ERR\_INVALID\_PARAM**

Here’s how I get the channelGroup:

```
 slowBus = FMODUnity.RuntimeManager.GetBus("Bus:/Fader/SFX/Boss");

    slowBus.getChannelGroup(out slowGroup);

```

And here’s how I change the pitch:

```
    public void SetPitch(float percentage)
{
    slowGroup.setPitch(percentage);
}

```

I’ve tried to lock and unlock the channelgroup, passing different parameter values, etc. Nothing works. I’ve also tried to get the name or the mute state of it and again the same error.

Many thanks if you can help!

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [July 8, 2019, 12:09am UTC](https://qa.fmod.com/t/changing-pitch-to-channelgroup-not-working/14818/2 "2019-07-08T00:09:52Z")

</div>

[ChannelGroup::setPitch](https://fmod.com/resources/documentation-api?version=2.0&page=core-api-channelcontrol.html#channelcontrol_setpitch) takes in a value:

> …where 0.5 represents half pitch (one octave down), 1.0 represents unmodified pitch and 2.0 represents double pitch (one octave up).

If the value is outside that range you will get `ERR_INVALID_PARAM`.

In 2.0, it is possible to automate the pitch on a Bus and control it using a global parameter.

---

<div class="post-metadata">

**Author:** ![carlosvVk](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@carlosvVk](https://qa.fmod.com/u/carlosvVk)\
**Post date:** [July 8, 2019, 8:54am UTC](https://qa.fmod.com/t/changing-pitch-to-channelgroup-not-working/14818/3 "2019-07-08T08:54:54Z")

</div>

I’ve tried passing values from 0.5 to 2.0 and the result is always `ERR_INVALID_PARAM`.

I think that the problem coul be the way I get the channel group? If not, can please tell me how to add a parameter to a Bus, maybe I can do the trick with that.

Thanks!

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [July 9, 2019, 3:35am UTC](https://qa.fmod.com/t/changing-pitch-to-channelgroup-not-working/14818/4 "2019-07-09T03:35:43Z")

</div>

[`Studio::Bus::lockChannelGroup`](https://fmod.com/resources/documentation-api?version=2.0&page=studio-api-bus.html#studio_bus_lockchannelgroup) is an asynchronous function and takes time for the ChannelGroup to be created, if it isn’t already.

> The channel group may not be available immediately after calling this function. When Studio has been initialized in asynchronous mode, the channel group will not be created until the command has been executed in the async thread. When Studio has been initialized with [FMOD\_STUDIO\_INIT\_SYNCHRONOUS\_UPDATE](https://fmod.com/resources/documentation-api?version=2.0&page=studio-api-system.html#fmod_studio_init_synchronous_update), the channel group will be created in the next [Studio::System::update](https://fmod.com/resources/documentation-api?version=2.0&page=studio-api-system.html#studio_system_update) call.
> 
> You can call [Studio::System::flushCommands](https://fmod.com/resources/documentation-api?version=2.0&page=studio-api-system.html#studio_system_flushcommands) to ensure the channel group has been created. Alternatively you can keep trying to obtain the channel group via [Studio:🚌:getChannelGroup](https://fmod.com/resources/documentation-api?version=2.0&page=studio-api-bus.html#studio_bus_getchannelgroup) until it is ready.

Otherwise you can find more information on how Global parameters can also be used in the [mixer](https://fmod.com/resources/documentation-studio?version=2.0&page=glossary.html#mixer), to control [bus](https://fmod.com/resources/documentation-studio?version=2.0&page=glossary.html#bus) properties in the [Parameters](https://fmod.com/resources/documentation-studio?version=2.0&page=parameters.html) chapeter of the Studio Docs.

---

<div class="post-metadata">

**Author:** ![carlosvVk](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@carlosvVk](https://qa.fmod.com/u/carlosvVk)\
**Post date:** [July 9, 2019, 8:40am UTC](https://qa.fmod.com/t/changing-pitch-to-channelgroup-not-working/14818/5 "2019-07-09T08:40:06Z")

</div>

Oh, I didn’t knew it was asynchronous. Also the documentation page I was using was different than this one, so that might be my mistake. Now it works, thank you very much!! 😁😁
