FMOD Ex to FMOD Studio pitch values

Hello,

I’m trying to migrate a project using FMOD Ex to FMOD Studio but I have some problems with the Event::setPitch() method. What is the equivalent FMOD_EVENT_PITCHUNITS setting in FMOD Studio?

How can I convert the parameter using FMOD_EVENT_PITCHUNITS_OCTAVES to FMOD Studio?

EventInstance::setPitch() takes only 1 parameter (linear pitch).

Thank you

The setPitch() linear pitch value is based on 1.0 being the base. 100.0 is 100x the pitch.

You can use something like http://www.sengpielaudio.com/calculator-centsratio.htm to get semitones or other such values.

0.5 would be down one octave, 2.0 would be up one octave, 4.0 would be up two octaves, etc

Linear is calculated as 2 to the power of semitones difference / 12 … ie -12 semitones = 2 ^ -1 = 0.5

2 ^ (24/12) = 4x multiplier