Take the 2-minute tour ×
Musical Practice & Performance Stack Exchange is a question and answer site for musicians, students, and enthusiasts. It's 100% free, no registration required.

I'm writing the music for a video game. Much of the music is going to be looped indefinitely. How can I arrange my music and bounce audio files that can be looped effectively?

A naïve technique is to write the piece so that the end can loop immediately to the beginning, then bounce it. The two downsides to this are:

  1. When the loop occurs, all of the reverb and release from the last notes in the loop will be abruptly cut off.
  2. There's no way to write an introduction to the song that doesn't loop.

What's a more intelligent approach?

share|improve this question
    
Not "naïve", obvious. The obvious solution to your quandry would be to not add a ton of reverb to the mix and to write something that doesn't have an introduction. I'd recommend ending with a breakdown or bridge so when the piece is looped, the material coming back in sounds appropriate. Just to reiterate, you don't need an introduction. –  jjmusicnotes Apr 19 at 19:46
1  
The MOD (Tracker) format used to be used in games extensively, because the instrument data and song data are stored independently, without long loopable audio tracks. Tools like FMOD are used for interactive game music, since they have programming APIs so the music can respond to game events. www.fmod.org –  Lee Kowalkowski Jun 30 at 8:28
add comment

3 Answers 3

up vote 7 down vote accepted

You will probably need the help of the game's audio designer to learn the exact requirements and limitations; with a powerful enough audio engine in-game, you can really do anything imaginable.

Presuming that you are not pushing the boundaries of video game music, though, you do still have a bit of freedom as a writer.

You just need to think in terms of loopable sections instead of loopable tracks.

For example, your suggestion amounts to this:

|: A   B   C   D :|

But you could instead write

| Intro |: A   B :| outro |

(Where looping is designated by |: :| and audio tracks are separated by |)

If you needed to make the transitions seamless (with regard to reverb and the like), you could do something like this:

| Intro   A   B |: A   B :| outro |

That way, the looped version of A only ever comes after B.

share|improve this answer
    
You would need to be careful with "intro / outro" material because a listener could construe that as "oh, now the piece is beginning again" which is the precise effect you don't want. –  jjmusicnotes Apr 19 at 19:47
    
yeah, ask whoever's writing the code for the game if it'll take seperate midi tracks for motifs and swapping styles in regenerating the background track from chord symbols. If it's coded well enough, you could have a lot more control over how things are arranged. –  Stephen Hazel Apr 20 at 0:05
add comment

Firstly, video game music is a very deep topic, and people have done very sophisticated things with it. Nowadays it runs the full gamut from simply playing one MP3 in a loop, to procedurally generating full arrangements on the fly. One example from the early 90s is LucasArts' iMuse system, which seamlessly arranges music to fit with gameplay.

You have choices that you can discuss with your programmer. For example you could potentially solve your problem with reverb by having some basic multitracking in the game's audio engine, and reverb added at playback time.

However, let's assume for now that you're restricted to providing ready-mixed music samples, and all the game engine can do is sequence the order in which they're played.

Let's say you have three sections, A (intro), B (intended to loop), C (ending).

The first task is to make sure that B loops cleanly. To do that, if B is 16 bars long, record 48 bars, and take the middle 16 as your loop. When it loops, the reverb from the first discarded part will convincingly work as the reverb for the end of what you've kept. You may need to tweak the wave a little -- but less often than you'd imagine. Let's call this sample B0

The second task is to get a clean transition from A into B. Perform a take of A transitioning into B. Use A. Use B - let's call it B1.

So now to get a clean piece of music, the programmer needs to schedule A, B1, loop(B0)

If we do something similar with the outtro, the programmer needs to, when the level is ending, move from B0 to B2, to C. To get to the ending sooner, he could switch (or fade) from B0 to the corresponding part of B1.

You could actually get all these sections by making a recording of A,B,B,B,C and slicing that up. You can probably see that by chopping into smaller sections, you could have less repetition in the sections, and so use less memory.

You can pretty much guarantee a loopable sample if you record a section dry, loop it, add reverb etc. at mixdown, and slice your sample out of that mixdown.

It's worth noting that in some kinds of game, jolting musical changes are acceptable. When you cross the finish line in Sonic the Hedgehog, it cuts instantly to a fanfare with no regard for the rhythm of the music that was playing before. When you pick up the star in Mario, the star fanfare plays immediately, then the double-speed music starts with no regard for where the tune was previously.

share|improve this answer
add comment

If you do want an introduction, remember that you can make the introduction function as a transition between the ending and the beginning of your loop as well.

The first few seconds of the original Super Mario Bros. tune is an excellent example of this. It very obviously starts with an introduction (that quirky first measure). The music goes on and on, and the loop ends with something that perfectly transitions into the introduction again, without the listener/gamer/player even noticing a seam. I do understand that such a thing is not easy to compose, but it may be able to make your music sound really great.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.