Dynamic music generation?

Started by
13 comments, last by smitty1276 15 years, 11 months ago
I was wondering if anyone knows of projects that use "dynamic" music generation. That is, the music in a game would always be unique and be spontaneously generated by an algorithm that looks at the state of the game (enemies on screen, health points, whatever) and produces music to the mood or tone of that state. I looked on Google and couldn't seem to find anything, so now I'm asking you =)
Advertisement
I really dont think that Idea is all together feasable. Wanting music genertated for a mood, seems like writing music for a mood. You'd need a huge function to tell a computer how to write music. I think more what you're looking for is a way to tell the computer which pre-recorded music to play based on the mood, computer generated sound isnt going to sound like music without alot of work to make it so.

Now, this is the point where I might just be spouting nonsense because Im no audio programmer, but if a different track for each mood combination seems unreasonable, you could have different mood affecting stats affect different parts of the music. Say, at a certain health % the music starts to speed up, getting slightly faster as the health drops.

I know there's a few games out there that switch music selection depending on some basic environment stuff -- it's usually more of the rudimentary "play A.mp3, unless you're being attacked, in which case fade to B.mp3" variety AFAIK however.

A more involved system would involve keeping the various mixer tracks of a piece seperated instead of mixing everything into a single final mp3, and playing with mixer or filter settings at runtime.
I did a little bit of looking into this a couple months ago, just out of interest and I was curious to know if it could be done. I came across a few university papers on the topic, and it seems that there really isn't anything out there yet that can purely generate music that would consistently sound like music, so much as noise.

While I am not fully sure of how feasible it is, as i have never done this myself, it seems like a better approach would be to work with an artist and generate a large library of beats and patterns which could be strung together to give the appearance of constantly unique audio.

I am sure there are many ways you could tackle this, I wonder if maybe the Music Genome project might hold a few clues as well.

Good luck.
I know there is a DigiPen game, Oasis Ostinato, that has done this. The game was a variation on a tower defense game. The music was randomly generated throughout playing the game. It would change the style of music based on how well you were doing, how many enemies were on the screen, and so on. It was pretty cool to see how well it fit the game.

Here is the link. Just as a note, the link does not function as of yet because the game has yet to be posted to the DigiPen gallery.
http://www.digipen.edu/main/Gallery_Games_2007#Oasis_Ostinato
i thought hellgate london used dynamic music generation? im sure i saw a blog about it somewhere
You can change some aspects of existing music (tempo, pitch, volume, fading, etc) which will be able to provide quite a bit of different flavors of the same thing. For example, if you just ate a Super Magic Shroom of Health and Hallucations, you can decrease the tempo and pitch, do some fading, place down some reverb and you might have yourself a decent yet basic "acid trip" variation. Or decrease the pitch, add a bit more bass and such and you can have an "in a different room" variation. If this is the route you want to go, I recommend checking out Audacity and the plugins for it. With a lot of time you can probably find the alterations you want.

As far as actually writing music, I can't really see that happening without a lot of work and being very basic. You will probably also have to generate the music from the notes rather than altering compiled music, which just throws in another huge challenge of getting decent quality.
NetGore - Open source multiplayer RPG engine
Hellgate London did do something dynamic. If memory serves, it works at the level of taking pieces of music and splicing them together intelligently based on context.

You can find some research in the academic field about dynamic music with varied results. I did some stuff at the individual note level with neural networks and transition tables with iffy results, and there's an article floating around about jazz music with genetic algorithms. There's also some stuff utilizing grammars. Wikipedia has an OK article on this stuff, but I don't remember the keywords that get to it.
Thanks for the replies everyone.

So far it appears that it would be difficult to "generate" music. I have known games that play different prerecorded bits and pieces of music depending on what you're doing, for example the Hitman series, or the games you mentioned. In terms of generating music, I think it would be easier (and provide a more pleasant gaming experience) to have more "ambient" music. Then it wouldn't have to be too structured, and be more of a backdrop, which is what I think game music should be. Recently I discovered Wolfram tones - http://tones.wolfram.com/
Not as high quality as hand-written music, of course, but it's the closest thing I've seen so far to purely generated music.
Halo 3 does something sort of like this, they talk about it a little on the special features DVD (
">YouTube). The music was still all scored by a composer and recorded, but different tracks are cued in and some details are adjusted depending on what is happening in the game.

Even way back in Mario Brothers we got faster music when time was running out, so the idea isn't exactly new, there doesn't seem to be a whole lot of information readily available on implementation of the most advanced techniques out there though.

- Jason Astle-Adams

This topic is closed to new replies.

Advertisement