The documentation for Event::setPitch says "Pitch level of the event. 1.0 = normal pitch (default).", but if I set it to 1.0, the sound comes out at a really high frequency, but sounds correct if I set it to 0.0 instead.
Is this just a documentation (or code) error or is something else affecting it (the EventGroup Pitch is set to 0.0 by default)?
- crouton asked 12 years ago
Just come across this myself, is there any real reason for it to be no change at 0.0? Given that 1.0 means no change for applying effects to channels and categories why is it different for events? Also what scaling is in effect for this as 1.0 sounds like more than doubled and what value will result in the pitch being halved?
- identitycrisisuk answered 11 years ago
[quote="identitycrisisuk":3cf5mj34] Also what scaling is in effect for this as 1.0 sounds like more than doubled and what value will result in the pitch being halved?[/quote:3cf5mj34]
It would be useful to have an answer to this, and preferably get the information added to future versions of the API documentation.
So basically what are the units of the pitch value for the Event::setPitch function? Or if it doesn’t really correspond to a well-defined unit of measurement, then what does a value of 1.0 represent? And -1.0? etc.
- dlomas answered 11 years ago
This has been addressed in the 4.11 branch which has FMOD_EVENT_PITCHUNITS to allow you to choose what units to set/get pitch in.
For pre-4.11 branches, 1.0f = 4 octaves higher than original pitch, -1.0f = 4 octaves lower than original pitch. So, double pitch = 1.0f / 4.0f and half pitch = -1.0f / 4.0f.
don’t confuse the low level channelgroup api with the event api. The docs are correct. It was originally designed to say 1.0 = normal pitch (it is a multiplier) for programmers. Octaves were used in designer because they are more sound designer friendly.
Please login first to submit.