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() 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() 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 forEvent
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 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.