Pitch-up compensated with pitch-down - resampling?

I’ve had some cases where a sound needs to retain its pitch but play a shorter cut of it when a parameter changes. I did this by raising the pitch of the event master (timeline goes faster), then pitching down the multi-sound. Result: pitch stays the same, but the playback is shorter. Or, you can make it longer by doing the opposite; or trigger more frequently with a loop, you get the idea. In any case, there are two pitch changes (master vs content) that cancel each other out.

Caveat: pitching sounds up a lot leads to longer buffer reads = expensive.

So I’d like to know: what happens to buffer reads if the whole event pitches up, but all multi-sounds inside it pitch down? The pitch doesn’t change, but does the scheduler still need to do a longer buffer read “just in case”, thus making the event more expensive to play back?

The pitch is resolved at the channel level, meaning if you have an overall pitch value of 1 there will be no extra cost involved. Once the pitch is greater than one, FMOD will need to read more data to fill the same length of time.

1 Like