Advertisement

Handling layered music

Started by August 08, 2010 02:08 AM
2 comments, last by Kylotan 14 years, 5 months ago
My question may not be too clear. I want to know how they handle layered music. I probably am not using the correct term.

My example would be in Banjo-Kazooie for the Nintendo 64. As you move about the game and shift into different areas or near an object, the music will change. It's basically the same melody and rhythm, but one part of the song will have faded away and a new part would have faded in that is relative to the location or object.

For instance, the overworld would have a melody accompanied by strings. As the player nears a cave, the strings fade, and a marimba part fades in.

My question is not how they wrote this but how they implemented it in the game. Perhaps this is geared toward programming?

Do they have all possible parts playing and increase volume on cue? i.e.

on Default:stringsPart.play(100); //100% volumemarimbaPart.play(0); //silencepercussionPart.play(100); on NearCave:stringsPart.fadeout();marimbaPart.fadein();


Any clarification would be great. It doesn't make sense to me to have it all playing in the background at once at different volumes. Wouldn't that make it liable to become out of sync? Or make it have too much going on for the game to handle?
Holy crap, you can read!
I'm not sure how it was done back in the day, but I've been implementing FMOD Designer into our game and it will be capable of doing this. FMOD Designer is a program where you specify complex audio events, then the programmer loads in the Designer project and can start events by name and interact with them using parameters.

You could have a parameter that controlled which track to play.

ex.
0.0 = play track1
0.5 = mix tracks
1.0 = play track2

FMOD takes care of syncing up the audio, and the FMOD Designer program makes it easy to compose these events.

Honestly I think that Designer has actually been easier to integrate with our program then a normal sound interface would be. So much of the customizing is controlled by FMOD Designer that I don't have to worry about having any in my sound engine.
Advertisement
That's really neat. I suppose that's one way to do it. But I'm still really intrigued on how they did it back then. Suppose someone isn't using FMOD Designer though. Any other ideas?
Holy crap, you can read!
When the system notices that the music needs to change, it sets a flag that says, "at the start of the next measure, play the new piece". You need to know the tempo of the music so that you know when the next measure is, that's all. 'Playing the new piece' might mean turning up the volume on a piece that is already playing or starting a piece that isn't playing - it doesn't matter, both have the same effect.

This topic is closed to new replies.

Advertisement