123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|660|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Art and Sound -> Analyzing music / visualization

Sun, 06 Apr 2008, 11:23
HoboBen
I just tried out the demo of Audiosurf, which I was quite tempted to buy (considering the $ to £ exchange rate is so sweet*) but honestly I'm quite happy looking at my music play with a visualization plugin turned on.

Which got me wondering - how is this done? Is the file analyzed in advance by reading the mp3 data or something, or is it done on-the-fly? If it's the latter case, where do I get that information from - is it provided by the sound card or through something like an API to Microsoft's DirectSound or Creative's OpenAL?


* I bought HL2: Episode One instead. £5!

-=-=-
blog | work | code | more code
Sun, 06 Apr 2008, 14:55
Jayenkai
Usualy vis's do it on the fly, but Audiosurf does a pre-calc stuff.
You see it flying through the files when they first load up.
It checks the bpm, scans for a decent beat, finds channel left/right stuff, finds how complex the sound is, and more.
My guess is that they've got their own mp3/wma/etc readers, and are using those to input the info, and work out what everything is..

If you want to do things in Blitz, there used to be a Blitz Bass dll, that did all sorts of vis type stuff.
If you want to be more precise, it's best to start the music playing silently in bass.dll, read the incoming info, use it, then play a duplicate version (full volume) a couple of seconds later.
This gives you a couple of secs to decode what's coming in, play about with the data, and give the player/user something nice to see/play with!

Here is a nicely working copy of BlitzBass.
There's a whole host of license gubbins, so best to only do this with freeware stuff. Other than that, have a play
(link was found here)

-=-=-
''Load, Next List!''
Sun, 06 Apr 2008, 18:21
Stealth
Here is a demo I did a few years ago with Blitz Bass (source included). It shows in example how to use the Blitz Bass system.

www.thestealthnetwork.com/stealthsoftware/the_music_visualizer_demo.zip

I have a much more complex visualizer used it PlayIt!, but the code is cluttered, messy, and uncommented.

-=-=-
Quit posting and try Google.
Mon, 07 Apr 2008, 07:46
HoboBen
Cool, thank you both

Oh by the way, if anyone downloads the audiosurf demo from Steam it has the entire Orange Box soundtrack (Half Life, HL2, HL2 episode 1 & 2, Portal, Team Fortress 2) in mp3 format if you poke around in the Steam directory.

Edit: On the subject of Half Life, HL2 Episode 1 was great - better than even the original HL2 in my opinion! The commentary option was also amazing, and I got a lot of ideas from it!

-=-=-
blog | work | code | more code
Mon, 07 Apr 2008, 08:18
Jayenkai
You're adding commentary to your game?!


Yeah, as nice as it is to have the whole OB soundtrack, hardly any of it works with Audiosurf! Kinda sucks!

Jay's suggestion, the soundtrack to Vib Ribbon.

-=-=-
''Load, Next List!''
Mon, 07 Apr 2008, 08:41
HoboBen
I played it with Ozric Tentacles - it meant the three games you're allowed to play in the demo were each half an hour long, and intense as hell!

-=-=-
blog | work | code | more code