How do audio based games such as Audiosurf and Beat Hazard work?
- by The Communist Duck
Note: I am not asking how to make a clone of one of these. I am asking about how they work.
I'm sure everyone's seen the games where you use your own music files (or provided ones) and the games produce levels based on them, such as Audiosurf and Beat Hazard.
Here is a video of Audiosurf in action, to show what I mean.
If you provide a heavy metal song, you would get a completely different set of obstacles, enemies, and game experience from something like Vivaldi.
What does interest me is how these games work. I do not know much about audio (well, data-side), but how do they process the song to understand when it is settling down or when it's speeding up? I guess they could just feed the pitch values (assuming those sorts of things exist in audio files) to form a level, but it wouldn't fully explain it.
I'm either looking for an explanation, some links to articles about this sort of thing (I'm sure there's a term or terms for it), or even an open-source implementation of this kind of thing ;-)
EDIT: After some searching and a little help, I found out about FFT (Fast Fourier Transform). This maybe a step in the right direction, but it is something that does not make any sense to me..or fits with my physics knowledge of waves.