Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411588 Posts in 69386 Topics- by 58443 Members - Latest Member: Mansreign

May 06, 2024, 08:14:02 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperAudioDynamic music?
Pages: [1]
Print
Author Topic: Dynamic music?  (Read 2513 times)
Lez
Level 0
**



View Profile
« on: July 12, 2012, 07:20:54 AM »

This is something as a designer I’ve always wanted in my games but never had the code experience or audio experience to make or even fully understand. So can we talk about games with dynamic music or how to do dynamic music?

I’m thinking like in wind waker, every strike against an enemy is a beat or how getting close to an enemy just has the music switch from peaceful to violent entirely naturally.
 
It would be great to have music that just naturally changes with the flow of battle and can almost predict when something will happen to the point that players could dodge based on what they hear. Like you see in the films, hero standing up over evil, they won when suddenly the villain attacks them from behind. The music is all uplifting and then a sinister note before the crash and the change in theme, if the hero could hear the 4th wall (5th? I have no idea) they would have been able to avoid such an issue.
Logged
GavinHarrisonSounds
Level 1
*


View Profile WWW
« Reply #1 on: July 12, 2012, 01:47:29 PM »

Best way would be with some sort of middleware audio tool, such as WWise...
Logged

Petethegoat
Level 1
*


Pete Goodfellow


View Profile WWW
« Reply #2 on: July 12, 2012, 03:40:57 PM »

There's an old blog post by Chris Delay, where he briefly explains how dynamic audio in Subversion works. And a video:



And there's also a Wolfire blog post, where Anton Riehl talks about the music for Reciever, which works similarly.

I think the basic idea is to compose some short clips of music, and then fade them in and out depending on the player's state in the game. It's something I'm fairly keen to experiment with myself, but for a lack of music.
Logged
Allansona
Level 0
**



View Profile WWW
« Reply #3 on: July 12, 2012, 03:53:04 PM »

I think the best way to do it would make sure all of your clips can harmonize with each other by being in the same key, and to know what is happening with the texture of the music (at the point it switches audio files) so that the mood changes don't seem awkward. You could try to have an ambient score thats always present that can work as the background for the type of mood that needs to be conveyed on screen? It's possible... but it would be a lot of work for the composer. I hope what I said made sense lol
Logged

- Without craftsmanship, inspiration is a mere reed shaken in the wind. - Johannes Brahms
raigan
Level 5
*****


View Profile
« Reply #4 on: July 13, 2012, 12:33:24 PM »

I would suggest taking a look at Dyad when it comes out next week: http://www.dyadgame.com/

IIRC what's happening with the audio is that each "song" is make of several hundred different loops (of various lengths) which work together (e.g sound good/harmonize); these are faded in/out and run through various DSP effects in response to the values of various game parameters (e.g player speed).

I know that Shawn (the programmer) and David (the musician) spent a lot of time tuning and tweaking and iterating on the mixing and rules and loops themselves.

You could ask Shawn on twitter, he's pretty friendly Smiley @dyadgame

Logged
dlt.fm
Level 0
**


I make atmospheric music.


View Profile WWW
« Reply #5 on: August 28, 2012, 09:44:59 AM »

I know I'm coming a bit late to this thread, but here it is.

There are a lot of different compositional/programming approaches depending on what you're looking to do.  Usually it will involve a pretty close collaboration between the audio programmer and the composer.

For your example of the music changing as the character enters a dangerous area, here are just a couple of ways you could do it:

A. - Radius / Transitions Trigger

You could set up a radius around your enemy.  When the character steps into this radius, the change in music will be immediately triggered.  This trigger could then (as a hypothetical example):

1. Immediately start fading out the ambient game loop over 0.5 seconds.
2. Immediately trigger a 1- or 2-second transition piece of music.
3. Upon completion of the transition, immediately begin the danger loop.

The transition piece solely exists to set up the danger loop - it could be a crash, then a buildup into the loop itself.  Musically, there are a lot of options, but the transition into danger should be absolutely seamless.  The listener should have no idea they're already in the danger loop. 

The responsibility for making this happen falls on the composer - the music should be built so that putting one sample back-to-back with another (even without the benefit of programmed crossfades) will result in zero audible quirks.

So, in this example, there could be 4 pieces of music:

   * Ambient game state loop
   * Transition to danger 1-shot
   * Danger game state loop
   * Transition to ambient 1-shot

...which if you put into a seamless looping player and looped back to back, would seem like a single uninterrupted piece of music.


B. - Synchronized Loops

With this method, you keep a number of game state loops synchronized during game play.  Each of the loops should be at the same (or relative) tempo, and in the same (or relative) meter, so that at any moment they can be crossfaded or cut to another loop.

(To limit the load on your audio engine, a given loop can be loaded within a given radius of that game state actually occurring.  No use loading a boss battle loop at the beginning of a huge level...)

When a character passes into a new game state, you have at least two options:

Option 1: Trigger the other game state on the next "measure" or "bar".

Provided your music has a consistent tempo, you can program music state changes so that they trigger on the beat, or at the beginning of the next bar.  So, for example, when you pass into a danger zone, a delayed trigger will be set that cuts to the danger loop at the very next bar.


Ambient Loop: | 1 - 2 - 3 - 4 | 1 - 2 - 3 - 4 | = - = - = - = | etc
Radius breach:                     *..........
Trigger point:                                *
Danger Loop:  | = - = - = - = | = - = - = - = | 1 - 2 - 3 - 4 | etc


The benefit of this method is that your game state loops can be totally different from one another sonically.  They could even be in different tempos, provided the engine is aware of the tempo of each loop (to get the trigger points right).

Option 2: Crossfade from one game state loop to another. 

This requires that each of the game states that could potentially bump into each other should be alike enough harmonically that for the duration of the crossfade, it sounds like a single piece of music. 

This also allows you to have more than 1 loop playing simultaneously.  So for example, your ambient game state loop might continue to play while your battle loop just contains other elements that increase the intensity. 

You could extend this even further by having separate layers of music representing each of a number of game variables (whether health is low, whether rage is high, whether danger is near, etc), and fading them up programmatically as those variables change.  While this becomes much more complicated for the composer, it gives you a lot of flexibility in creating a rich and varied soundtrack from what are essentially static musical loops.



The punchline is that your music can be as organic as your composer and audio engine allow.  Work closely together and you'll come up with something awesome.

Whew! Hope that helps!
Logged

David Lopez Tichy - dlt.fm
Composer for film & interactive

soundcloud: davidlopeztichy
jamesprimate
Level 10
*****


wave emoji


View Profile WWW
« Reply #6 on: August 30, 2012, 04:03:50 PM »

^ fantastic read, thanks!

Dynamic audio had always been something I have wanted to play with, and I hope some day to get the opportunity to explore it in some depth. I do feel that in most games I have seen it done, it feels a bit "clunky" in the execution: either the transitions feel awkward, or the mechanism is too obvious or it seems like the length and variety  of the music was sacrificed for budget or channel reasons.. Does anybody have any really well-executed examples that I should check out?
Logged

lamontx
Level 0
***


I don't even know who Kuppo is. Kupo.


View Profile
« Reply #7 on: August 30, 2012, 04:20:17 PM »

Hearing music change from pleasant to violent exactly when you are fighting a monster (without the white noise sweeps or the cracking window thing) would be very interesting! Personally I'm pretty cool with this idea, in FFXII there's a track called Giza Plains and it does exactly that -- it alternates pleasant music with violent music. I highly recommend a listen. The problem(for me) is at how many bars of music something like this happens. Or rhythm, to be specific. Modulation is fairly easy to handle, but changing suddenly can be a problem to my ears.

For this reason alone I am much more inclined to play the traditional games where the screen cracks and you're taken to a battle screen, switching from nice orchestral music to awesome techno stuff.
Logged
Azure Lazuline
Level 2
**



View Profile WWW
« Reply #8 on: August 31, 2012, 05:35:10 PM »

Rare did this a ton in their N64 games. Banjo-Kazooie levels all had about 4 or 5 different music variations based on whether you were in a cave, underwater, or stuff like that. One example that really stands out is

in DKR, which has 3 different themes depending on where you are, keeping the music fresh even though it's a really short loop for all of them. (The main theme song of that game also has 8 variations, one for each character!)

Zelda also does this a decent amount, with the bazaar in Skyward Sword coming immediately to mind. It sets the personality of each shop extremely well without abrupt transitions at all.

Metal Gear Solid does this exactly once that I know of, but it's a nice usage of it: when you're discovered, the dramatic music starts playing (you've all heard it before). That's just a normal transition, though, with the cool effect happening when you're leaving the alert mode - the melody fades out, leaving only muffled drums for about 10 seconds while you catch your breath, then it slowly fades into the normal sneaking music as the enemies forget about your presence.

Also, the ultimate example is Rez. Just go play it or watch a video, since I can't describe it.
Logged

dlt.fm
Level 0
**


I make atmospheric music.


View Profile WWW
« Reply #9 on: September 01, 2012, 01:59:17 PM »

I compiled an example set on SoundCloud demonstrating the radius/transition method (for anyone who's interested):
http://soundcloud.com/davidlopeztichy/sets/video-game-music/s-9GpUW

 Coffee

I'll probably put one together for the other 2 methods as well, since I have a few tracks laying about that fit that structure.

Also, allow me to add Dead Space to the pile of amazing dynamic music (and sound, in general), although that's pretty far from an indie game.  This is a pretty great interview talking about how the music was done:
http://www.jasongraves.com/press/pdfs/Dead-Space-Graves-FSM.pdf
Logged

David Lopez Tichy - dlt.fm
Composer for film & interactive

soundcloud: davidlopeztichy
dlt.fm
Level 0
**


I make atmospheric music.


View Profile WWW
« Reply #10 on: September 02, 2012, 08:20:57 AM »

As promised, here's the other SoundCloud set demonstrating crossfaded synchronized loops:

http://soundcloud.com/davidlopeztichy/sets/video-game-music-techniques
Logged

David Lopez Tichy - dlt.fm
Composer for film & interactive

soundcloud: davidlopeztichy
lamontx
Level 0
***


I don't even know who Kuppo is. Kupo.


View Profile
« Reply #11 on: September 02, 2012, 08:31:23 AM »

As promised, here's the other SoundCloud set demonstrating crossfaded synchronized loops:

http://soundcloud.com/davidlopeztichy/sets/video-game-music-techniques
This is pretty cool. I can see it being used in a flash-y kinda game from Newgrounds or perhaps a normal sidescrolling-platformer type of game. Personally though, I don't compose this kinda stuff since I prefer RPGs and Strategies(Even though this style could actually fit some strategies, when I think about it), but I respect composers who can make this kinda stuff  Smiley good job.
Logged
jamiebell
Guest
« Reply #12 on: September 02, 2012, 05:33:32 PM »

I'm loving the stuff you've put together, David!

You've given me the idea to put together a Soundcloud track demoing the synchronized loop technique Smiley I feel like it's a much more natural way of approaching it, as opposed to having "stingers" or "transitions" and that sort of thing, though there's a bit of a struggle with keeping the music from sounding too "samey."

Great demo, great post on implementation Smiley do you do that stuff in Wwise or Fmod?

Also, for what it's worth, this is what I feel the "audio" subforum should be full of, instead of portfolios and music writing competitions Smiley
Logged
dlt.fm
Level 0
**


I make atmospheric music.


View Profile WWW
« Reply #13 on: September 02, 2012, 08:42:52 PM »

I'm loving the stuff you've put together, David!
[...]
Great demo, great post on implementation Smiley do you do that stuff in Wwise or Fmod?

Thanks much for the kudos.  I'm primarily a Mac guy, so I haven't really dug too deep into Wwise yet.  I've been waiting for Fmod Studio FOR EVER, though.  I actually usually audition things in AudioMulch, which, while it isn't an audio engine/simulator per se, is pretty damn useful in many more applications.

Worth a look if you haven't seen it before:
http://www.audiomulch.com/info/what-is-audiomulch

Also, for what it's worth, this is what I feel the "audio" subforum should be full of, instead of portfolios and music writing competitions Smiley

Amen, brother.
Logged

David Lopez Tichy - dlt.fm
Composer for film & interactive

soundcloud: davidlopeztichy
Eatingburger
Level 0
**



View Profile
« Reply #14 on: September 15, 2012, 11:33:13 AM »

Does anyone know of any examples of games where the player ends up creating (somewhat original) music through gameplay?
Logged
Lauchsuppe
Level 3
***


hruabp


View Profile
« Reply #15 on: September 15, 2012, 04:25:08 PM »

Does anyone know of any examples of games where the player ends up creating (somewhat original) music through gameplay?

Azure Lazuline already mentioned Rez. That'd be a good example. I have another good one in mind, but I don't remember the name right now. Will edit this later on if it comes to mind.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic