# Converting FMOD Ex pitch values to FMOD Studio pitch values

**URL:** https://qa.fmod.com/t/converting-fmod-ex-pitch-values-to-fmod-studio-pitch-values/16920
**Category:** FMOD Engine
**Created:** [March 22, 2021, 2:04pm UTC](https://qa.fmod.com/t/converting-fmod-ex-pitch-values-to-fmod-studio-pitch-values/16920 "2021-03-22T14:04:28Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Scam](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@Scam](https://qa.fmod.com/u/Scam)
#### Post date: [March 22, 2021, 2:04pm UTC](https://qa.fmod.com/t/converting-fmod-ex-pitch-values-to-fmod-studio-pitch-values/16920/1 "2021-03-22T14:04:28Z")

</div>

I’m refactoring legacy code to use FMOD Studio `EventInstance` objects instead of FMOD Designer (FMOD Ex) `Event` object. The most common case is to have pitch set to 0.0 (i.e. normal pitch) which can be then set to be 1.0 in the new implementation.

In FMOD Designer API the call to [Event::setPitch()](https://documentation.help/FMOD-Ex/FMOD_Event_SetPitch.html) sets the overall pitch of an event . The default value of pitch is 0.0 ( = normal pitch). The pitch value can be negative as well.

FMOD Studio API call [EventInstance::setPitch()](https://documentation.help/FMOD-Studio-API/FMOD_Studio_EventInstance_SetPitch.html) sets the pitch multiplier for the event instance. The default value is 1.0 ( = normal pitch) and setting the value 0 means no sound at all.

- How should I interpret old pitch values outside of the normal pitch in the new code?
- What should I put as the value for `EventInstance` in the refactored code if the pitch for `Event` in the old implementation is for example -8.0?
- Can I even achieve same functionality in FMOD Studio?

In the legacy code the pitch for Events is described mostly in FMOD\_EVENT\_PITCHUNITS\_SEMITONES and sometimes in FMOD\_EVENT\_PITCHUNITS\_RAW.

Edit: [In this discussion](https://qa.fmod.com/t/pitch-shift/8603) a formula for calculating pitch from semitones was given: `pitch = 2 ^ ( semitone / 12.0f)`. I originally thought it would be the answer to my question but some sound still sound way off compared to the original implementation.

---

<div class="post-metadata">

### Author: ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)
#### Post date: [March 23, 2021, 4:45am UTC](https://qa.fmod.com/t/converting-fmod-ex-pitch-values-to-fmod-studio-pitch-values/16920/2 "2021-03-23T04:45:39Z")

</div>

After some investigation, it seems that the formula you found (`2^(x/12)=s`, where x is the FMOD Ex pitch adjustment expressed as a shift in octaves, and s is the FMOD Studio pitch adjustment measured as a linear value) should be correct.

Can you describe in more detail how the adjustment in FMOD Studio seems to be off when you compare it?

---

<div class="post-metadata">

### Author: ![Scam](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@Scam](https://qa.fmod.com/u/Scam)
#### Post date: [March 24, 2021, 9:33am UTC](https://qa.fmod.com/t/converting-fmod-ex-pitch-values-to-fmod-studio-pitch-values/16920/3 "2021-03-24T09:33:10Z")

</div>

It’s hard to describe because I’m not an audio engineer. The new implementation sounds like there was some kind of “metallic echo” in all the played sounds. My colleague wondered if there sounds had an reverb effect on, but closer examination proved that it wasn’t the case (`EventInstance::getReverbProperties` returned value 0).

We are now checking if the conversion from FMOD Designer project to FMOD Studio project made some changes to the sound parameters.

---

<div class="post-metadata">

### Author: ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)
#### Post date: [March 31, 2021, 12:34am UTC](https://qa.fmod.com/t/converting-fmod-ex-pitch-values-to-fmod-studio-pitch-values/16920/4 "2021-03-31T00:34:58Z")

</div>

> [@Scam](#):
>
> We are now checking if the conversion from FMOD Designer project to FMOD Studio project made some changes to the sound parameters.

Thanks, we’d be interested to hear what you discover.
