Music for Indie Games: Loops, Moods and Licensing
A small game needs fewer tracks than you think, but each one has to loop well and match what the player is doing. Here is how to plan, place and license it.

Key takeaways
- Plan music by game state: title, gameplay, tension, victory and defeat. Four to eight pieces cover most small games.
- Loops must survive hundreds of repeats: keep them 1 to 3 minutes long, cut on the beat, and avoid a melody that nags.
- Change music with crossfades, stingers or layers, never hard cuts mid-phrase.
- Read the license of every track before you publish, especially for commercial use and streaming.
Most indie games need four to eight pieces of music: a title theme, one gameplay loop per distinct area or mode, a tension or boss track, and short victory and defeat stingers. Each gameplay track should loop cleanly for 1 to 3 minutes, match the energy of what the player is doing, and stay out of the way of sound effects. Plan the music by game state, decide how you will move between tracks, and check the license of every piece before you publish.
Plan music by game state
Do not start with "I need a soundtrack". Start with the states your game can be in, and ask what the player should feel in each:
- Title and menus: sets the identity of the game. Often the most melodic, memorable piece. Players hear it every time they open the game, so it should be pleasant on repeat.
- Core gameplay: the track heard most. Steady energy that supports concentration. Usually less melodic than the title theme.
- Tension: bosses, final waves, timers running low. Faster tempo, more percussion, more urgency.
- Calm or hub areas: shops, maps, cozy bases. Slower, lighter, room to breathe.
- Stingers: 2 to 6 second musical phrases for level complete, game over, new record, item unlocked. They punctuate rather than accompany.
A one-screen arcade game can get by with one gameplay loop, a title loop and two stingers. A level-based adventure might want a track per world. Scope accordingly: an extra track costs time, money or credits, while a better-placed track costs nothing. The rhythm game guide covers the case where the music is the level itself.
Making loops that survive repetition
Game music is heard far more often than an album track. A player might spend an hour in one area and hear a two minute loop thirty times. Guidelines that keep loops listenable:
- Length: 1 to 3 minutes for gameplay loops. Shorter than a minute becomes noticeable quickly unless it is very minimal.
- Clean loop point: the end must flow into the start with no gap, click or change in reverb. Cut on a bar line and make sure the last bar leads back into the first. Many loops include a short "intro" section that plays once before the looping body.
- No dramatic ending: the last bar should not resolve like a finale, or every loop will sound like the song ended and restarted.
- Restrained melody: a busy, catchy lead line becomes irritating on the twentieth repeat. Gameplay tracks often rely on rhythm, texture and harmony, saving big melodies for title themes.
- Leave room for effects: avoid heavy content in the frequency range of your important sound effects. If hits are crunchy mid-range sounds, keep the music's mid-range lighter.
Matching mood to the play, not just the theme
The theme of a level (a forest, space, a haunted house) suggests instruments, but the play suggests tempo and energy. A forest level where players sprint and dodge needs a faster pulse than a forest level where they solve calm puzzles. Some starting points by genre:
- Endless runners and arcade games: upbeat, 120 to 160 beats per minute, strong rhythm, often electronic or chiptune.
- Puzzle games: mid to slow tempo, gentle, few sudden changes. Music should help thinking, not compete with it.
- Platformers: bouncy and melodic, energy tied to the world's difficulty.
- Horror: often less music, not more. Ambient drones, sparse sounds, silence before a scare.
- Cozy and farming games: acoustic instruments, warm and slow, long loops to avoid fatigue over long sessions.
- Tower defense and strategy: steady, building tension, with a shift when waves get large.
Transitions and adaptive music
How music changes matters as much as which music plays. A hard cut from calm to boss music mid-phrase is jarring. Better techniques, in order of effort:
- 01Crossfade: fade one track out over 1 to 2 seconds while the next fades in. Simple and usually fine.
- 02Stinger bridge: play a short musical hit (a drum fill, a swell) to cover the change.
- 03Change on the beat: wait for the next bar line before switching. This requires knowing the track's tempo but sounds far more musical.
- 04Vertical layering: compose one track as several stems (drums, bass, pads, melody) that play in sync. Add layers as intensity rises: pads only while exploring, drums when enemies appear, full mix in combat. Many acclaimed adventure games use this so smoothly that players do not notice the music changing, only the mood.
- 05Horizontal sections: switch between composed sections (calm, alert, combat) of the same piece at musical boundaries.
Vertical layering is achievable in small web games: the stems must be the same length and tempo, and you start them together and change their volumes. It gives your game a sense of reacting to the player that one static loop cannot.
Fitting music into the mix
- Music usually sits below player feedback sounds and above ambience. See our sound effects guide for the full priority order.
- Give players separate music and effects volume sliders. Many players turn music down and keep effects up, or play their own music instead.
- Duck the music slightly under important moments (a boss roar, a level complete stinger).
- Start music on the first user interaction, since browsers block audio until then.
- Stream long tracks rather than loading them all at startup, so the game opens quickly on phones.
Licensing basics
Music is the asset most likely to cause legal trouble, because so much of it is easy to download. Before using any track you did not create, check:
- Commercial use: is it allowed if your game has ads, purchases or a price?
- Attribution: do you need to credit the composer, and where (in the game, on the page)?
- Modification: may you cut it into loops or stems?
- Streaming and video: will players who stream your game or post clips get copyright claims? Some licenses cover this, some do not.
- Exclusivity: royalty-free music is not exclusive, so other games may use the same track.
Commercial songs from artists you like are off limits without a license, regardless of how short the clip is. This article is general information, not legal advice; for anything with real money attached, read the license in full. AI-generated sound for games covers what generated music does well and where it falls short.
Generating music for your game
Generated music is a practical option for prototypes and small games. In Startbase, the agent can generate music and ambience up to two minutes long and put it to use in your game; it uses Build credits like other generated media. Describe the game state, tempo, instruments and loop behavior rather than just a genre:
Generate music for my underwater exploration game and wire it in. Title: a slow, dreamy theme with soft synth pads and a gentle bell melody, about 90 seconds, loopable. Gameplay: a calm loop at about 80 BPM with muffled percussion and bubbly arpeggios, about 2 minutes, no dramatic ending so it loops cleanly. Danger: the same mood but faster and darker, for when a shark appears; crossfade to it over 1.5 s and back when the shark leaves. Stingers: a 3 second treasure found jingle and a 4 second game over phrase. Add separate music and sound effect volume sliders to the settings screen.
Listen to each generated track on a loop before keeping it, and regenerate any with a noticeable seam or a nagging melody. For the broader process of building a game from a description, see how to make a game without coding, and for the visual half of the atmosphere, our low-poly art guide. For tension built with sound, see how to make a horror game.
Frequently asked questions
How many music tracks does an indie game need?
Many small games ship with four to eight pieces: a title theme, one or two gameplay loops, a tension or boss track, and short stingers for victory and defeat. Larger games add a track per area.
How long should a game music loop be?
Gameplay loops of 1 to 3 minutes work well. Shorter loops become noticeable quickly unless they are very minimal, and every loop should end in a way that flows back into its start without a gap or a final-sounding cadence.
Can I use popular songs in my game?
Not without a license from the rights holders, no matter how short the clip. Use music you made, generated, commissioned or licensed, and check whether the license covers commercial use and streaming.
What is adaptive music in games?
Music that changes with gameplay. Common methods are crossfading between tracks, switching sections at bar lines, and vertical layering, where synced stems are added or removed as intensity rises.

