Beatmatching using FMOD Studio

I’m in the process of setting up transitions between various pieces of background music in my game.

They all have slightly different BPM, so I had the idea of adjusting the speed of the song I’m transitioning into to match the old one, to then slowly return to the intended BPM.

In DJ terms I believe this is called beatmatching. Usually when I have an idea for something that involves FMOD Studio, there’s a neat way to do it already, but I can’t find a single thing about it.

I realize I can query the BPM from code and maybe set up a pitch modifier and try to sync the beats, but I was hoping there was an easier way. Do you have any clever suggestions?

It is technically possible to implement the beat-matching behavior you describe as a static behavior (“every time you transition from music A to music B, the transition happens at the start of the same bar and plays out in the exact same way”), but would be impractically labor-intensive to implement as a dynamic behavior (“you can transition from music A to music B at the start of any bar, and the transition will be dynamically beatmatched via automated pitch stretching”), because BPM in FMOD Studio is defined by tempo markers, and there is currently no mechanism in FMOD Studio to automate the position or BPM of a tempo marker to automatically account for dynamic shifts in the play speed of individual instruments.

That being said, there are mechanisms in FMOD Studio to allow you to transition on-beat from a song in one tempo to the equivalent beat in a song in another tempo, to allow you to dynamically adjust the pitch and speed of a song on the fly or in a repeatable manner, and to alter the time signature and BPM of a song at specific positions along its waveform. If you have questions about any of these features, we will be happy to answer them.

Rather than attempting to implement a dynamic beat-matching system, it might be easier just to adjust the play speed of your music files to be the same in a DAW. Doing so would allow you to quantize your transitions to the beat without having to dynamically adjust the pitch in real time.