Calm music plays while exploring, and drums join when combat starts. When the fight ends, the drums recede and the quiet returns. Getting changes like that without restarting the song conveys a scene's tension even on the same map.
Here we build BGM that splits one song into instrument "layers" and raises or lowers how many you hear . MetaSounds plays two sounds simultaneously and Blueprint changes the drums' volume. The exercise triggers on entering and leaving a combat area, so you can try the audio change without building enemy AI.
What You'll Learn
- The difference between switching songs and layering instruments
- Preparing material that stays in rhythm when layered mid-song
- Simultaneous playback and smooth volume changes in MetaSounds
- The mechanism where drums join on entering a combat area and leave on exiting
We use Wave Player and Inputs from the MetaSounds introduction. If you have not tried it, play one sound first. The exercise assumes a UE5 Third Person template with one player.
- Think of BGM as layers
- Vertical layering and horizontal transitions
- Match the material's start position and length
- Play two layers in MetaSounds
- Bring only the drums in and out smoothly
- Hands-On: change it on entering and leaving the combat area
- Listen and confirm
- Bonus: good to know up front
- Summary
Think of BGM as layers
A finished BGM file contains melody, drums, bass, and more mixed together. Playing that back gives you no way to "pull just the drums out now". So we split files by instrument group in advance.
Those stacked sound groups are called layers . For instance, a calm accompaniment as the base, drums for combat, and stronger strings on top for a boss.

What matters is that layers you cannot hear keep playing underneath . With the exploration part halfway through the song, the drums having advanced to the same place means raising the volume layers in the continuation. Starting the drums from the song's beginning after combat begins misaligns the phrases.
In other words, this is less "switching to another song" and more "changing the same song's thickness" . Start the exercise with two layers, exploration and drums, where the difference is easy to hear.
Vertical layering and horizontal transitions
Beyond layering, music that responds to situations can also swap the song itself.

| Method | What changes | Example in a game |
|---|---|---|
| Vertical layering | The instrument combination in one song | Drums join when an enemy notices you |
| Horizontal transition | The song or phrase itself | Moving from a field track to a boss track |
We use vertical layering. Matching the material and playing it simultaneously means the only thing you operate on a scene change is volume. With the base still playing, the mood changes without the music breaking.
Horizontal transitions also mean deciding how to switch — immediately, or waiting until the current phrase ends. Considering it when you need "an effect that moves to another song" keeps the roles organized.
Match the material's start position and length
Prepare these two files split from the same song. Make both stereo WAVs, meaning two channels of audio.
| Name after importing into UE | Contents |
|---|---|
SW_Explore | Calm accompaniment. A base that works without drums, such as sustained tones |
SW_Combat | Drums written to fit that accompaniment |
Using a music program (a DAW ), write both parts in the same song and export them one at a time. Per-part material like this is also called stems . When using an asset library, choosing one with stems from the same song is easier to work with.

Export with the same start and end positions . For eight bars at 120 BPM in 4/4, for instance, both are 16 seconds from the song's start. BPM is beats per minute and a beat is the rhythmic pulse you count "1, 2, 3, 4". In 4/4, four beats make a bar, so a bar is two seconds in this example.
Even for material where drums enter partway, do not trim the leading silence. That silence is the time aligning it with the accompaniment. Match the ends too so both return to the same point and loop naturally.
Layer the two in your DAW first and listen through a few loops to confirm rhythm and seams. Two unrelated songs sharing a tempo do not simply fit. Use material whose phrase positions and chords also match.
Play two layers in MetaSounds
At first, confirm the audio in the MetaSound editor alone without connecting Blueprint.
Create the playback asset
- Import both WAVs into the Content Browser as
SW_ExploreandSW_Combat. - Right-click in the Content Browser and create a MetaSound Source under "Audio". Name it
MS_BattleMusic. If you cannot find it, enable MetaSound under "Edit → Plugins". - Open the asset and remove
UE.Source.OneShotunder "Interfaces". This is BGM that keeps playing, not a one-shot sound. - Choose "MetaSound" in the toolbar and set Output Format to Stereo in the Details panel. Confirm the graph's outputs became
Out LeftandOut Right.
Start playback from the same cue
Place two Wave Player (Stereo) nodes in the graph and specify the corresponding Sound Wave in each "Wave Asset". Turn "Loop" on for both and match these settings.
| Setting | Value for both | Meaning |
|---|---|---|
| Pitch Shift | 0 | Does not change pitch or playback speed |
| Start Time | 0 | Starts from the file's beginning |
| Loop Start | 0 | Returns to the beginning when looping |
| Loop Duration | -1 | Makes the loop range run to the file's end |

Wire lines from the graph's On Play into both Wave Players' Play . On Play is the cue that "this MetaSound's playback started". Passing the same cue to both starts your matched material simultaneously.
Gather left and right into a Mixer
Next add Stereo Mixer (2) . A Mixer combines several sounds, and "(2)" here means it takes two stereo pairs.

Connect left and right separately in this order. The diagram focuses on audio lines, but keep the On Play connections from before.
| Output source | Destination |
|---|---|
| The exploration Wave Player's Out Left / Out Right | The Mixer's In 0 L / In 0 R |
| The drum Wave Player's Out Left / Out Right | The Mixer's In 1 L / In 1 R |
| The Mixer's Out L / Out R | The graph output's Out Left / Out Right |
Set the Mixer's Gain 0 (Lin) to 1 and Gain 1 (Lin) to 0 . Gain is how much to multiply that input's sound; 0 is silent and 1 is the original level. Gain 0 handles exploration and Gain 1 the drums.
Save and audition with the editor's "Play", and you hear only the exploration part. Stop, set Gain 1 to 1, and audition again to hear drums too. Listening through a few loops with the rhythm aligned means the audio foundation is done. After checking, stop and return Gain 1 to 0. The next section makes this volume adjustable while playback continues.
Mixing two raises the overall level. Listen at a low audition volume first and lower the source material's level if it clips.
Bring only the drums in and out smoothly
Right now you change Gain directly. Next we build an Input for operating it from the game. An Input is this MetaSound's entry point for receiving values from outside.
- Drag from the Mixer's "Gain 1 (Lin)" and add InterpTo so its "Value" connects to Gain 1.
- Set InterpTo's Interp Time to 2.0 .
- Drag from InterpTo's "Target" and choose "Promote to Graph Input".
- Select the created Input and change "Input" in the Details to CombatIntensity with type Float and default 0 . Turn "Is Constructor Pin" off so it can change during playback.

InterpTo moves a value gradually toward a target. Passing 1 into CombatIntensity moves the drums' Gain toward 1 over two seconds, and 0 moves it toward 0. Raising and lowering volume smoothly like that is a fade.
What changes here is only the drums' Gain; exploration's Gain 0 stays at 1. Set the Input's Widget to Slider under "Editor Options" in the Details with a range of 0 to 1. Save, start auditioning, and move the Input's slider in the graph to change the value during playback.
Move it from 0 to 1, stop moving, and listen to the fade. Drums joining while the exploration part remains is success. Returning to 0 pulls only the drums back. After stopping the audition, return the Input's default to 0 and save.
From the game, Set Float Parameter sends the CombatIntensity value to the playing sound. There is no need to restart the audio.
Hands-On: change it on entering and leaving the combat area
Make a corner of the map a combat area. Drums join when the player enters and it returns to the exploration part alone when they leave.

Here we place just one Actor, BP_MusicZone . It bundles "the part that checks entering and leaving" and "the part that plays BGM", so no logic hunts for another Actor to hand things to.
Prepare the area and BGM
- Create a Blueprint with Actor as the parent class and name it
BP_MusicZone. - Add a Box Collision via "Add Component" and name it
BattleArea. That is the box volume checking whether the player overlaps. - Add an Audio component to the same Actor and name it
MusicAudio. That handles BGM playback.

Select BattleArea and configure it as follows. Box Extent is the distance from the box's center to its edge. X and Y of 400 give, at scale 1, 800 cm — 8 m — in width and depth.
| BattleArea setting | Value |
|---|---|
| Relative location | X=0, Y=0, Z=200 |
| Scale | X=1, Y=1, Z=1 |
| Box Extent | X=400, Y=400, Z=200 |
| Collision Presets | Custom |
| Collision Enabled | Query Only |
| Collision Responses | Set everything to Ignore first, then Pawn to Overlap |
| Generate Overlap Events | On |
Overlap reports an overlap rather than blocking on impact. Turn "Generate Overlap Events" on for the Third Person character's Capsule Component too. Leave the character's movement collision as it is.
Configure MusicAudio as follows. So distance-based attenuation is not confused with the drums coming and going, we make the BGM sound the same everywhere here.
| MusicAudio setting | Value |
|---|---|
| Sound | MS_BattleMusic |
| Auto Activate | On |
| Volume Multiplier | Start from 0.35 |
| Pitch Multiplier | 1.0 |
| Allow Spatialization | Off |
| Attenuation Settings | None |
| Override Attenuation | Off |
Do not assign Attenuation Settings on MS_BattleMusic either, and leave Pitch, which changes playback speed, at its default.
Compile, save, and place one BP_MusicZone on a walkable floor in the level. Keep the Actor's scale at 1 and put the Player Start outside BattleArea. The blue box in the diagram shows the detection volume and is invisible in game. For a marker, place a thin Cube on the floor. Auto Activate handles playing the audio, so no Play node needs adding to BeginPlay.
Check whether whoever entered is the player
Right-click in BP_MusicZone's event graph and add Event ActorBeginOverlap . That fires when another Actor enters this Actor's volume. Other Actor gives you whoever entered.

- Drag from Other Actor and add Equal (Object) , the comparison node shown as
==in the graph. - Add Get Player Character with Player Index 0 and connect its Return Value into the comparison's other input.
- Add a Branch . Connect the comparison result into "Condition" and ActorBeginOverlap's white exec line into the Branch's exec input.
Equal (Object) checks "are these two the same object" . Here it is True when the entering Actor is the player being controlled. Branch splits on that result, so write the drum-adding logic after True. Leave False unconnected to ignore non-players.
Send 1 to the playing MusicAudio
Drag MusicAudio from the "Components" list into the graph to place a reference node. That specifies the component on this Actor currently playing BGM .

- Drag from MusicAudio's blue output and add Set Float Parameter . Confirm MusicAudio connected into "Target".
- Connect the Branch's True into Set Float Parameter's exec input.
- Set In Name to CombatIntensity and In Float to 1.0 .
The Branch in the diagram continues from the previous comparison figure. Do not add a new one; use that same Branch's True. In Name is "which entry point to send to" and In Float is "which value to send". Specify the same name as the Input in the MetaSound. Now the instruction to add drums arrives only when the player enters.
Send 0 when they leave
Next add Event ActorEndOverlap , which fires when someone leaves the volume. Compare its Other Actor with Get Player Character the same way and connect to another Branch.

From the exit Branch's True, run another Set Float Parameter. Target is the same MusicAudio and In Name is the same CombatIntensity, with only In Float set to 0.0 .

Compile and save. All you send is 1 on entering and 0 on leaving; the work of moving the volume gradually belongs to InterpTo inside the MetaSound.
Listen and confirm
Stop the editor audition and run the level with "Play". Listen in this order first.
- Start outside the area : only the exploration part is audible.
- Walk inside : drums join over about two seconds. The exploration part continues.
- Walk out : the drums recede and only the exploration part remains.
- Go in and out a few times : it does not return to the song's start each time; you hear the continuation. Even after several loops, the instruments stay in rhythm.
Once comfortable, compare Interp Time at 0.2 and 3.0. Reacting quickly makes combat's start stand out and layering slowly builds tension. The same material leaves a different impression depending on the fade length.

| Stumble | Where to check first |
|---|---|
| Nothing is audible | MusicAudio's Sound and Auto Activate, Wave Asset, On Play, the Mixer-to-graph-output connections |
| Drums are audible from the start | Whether CombatIntensity's default is 0 and whether InterpTo's Value connects to Gain 1 |
| Entering the area changes nothing | Generate Overlap Events on both sides, BattleArea's Pawn=Overlap, the connections through the Branch |
| The event fires but the sound does not change | Whether Set Float Parameter's Target is MusicAudio and whether In Name matches the Input name |
| The drums do not line up rhythmically | The material's start position and length, both Wave Players' Loop settings, Pitch Shift |
| The song restarts or doubles on each round trip | Whether Play or Spawn Sound crept into the enter/exit logic, and whether multiple BP_MusicZones are placed |
Bonus: good to know up front
Volume 0 and stopping are different
In this setup, zeroing the drums' volume in the Mixer keeps the Wave Player advancing. That means the inaudible layer still needs playback processing. There is no fixed cap of "how many layers are safe"; it varies with material and environment. Confirm the effect with two layers and add instruments as needed.
To silence all BGM from a settings screen, setting MS_BattleMusic's "Virtualization Mode" to Play When Silent serves the case of advancing playback position while silent. It does not prevent an explicit Stop or concurrency limits, though.
Triggering on enemy detection
Once it works with an area, you can trigger on spotting and losing from AI Perception. The structure of sending values to the Audio Component already playing BGM stays the same.
In games with several enemies, "one lost sight, so send 0" can be premature. You may still be fighting another. Decide whether combat continues game-wide , such as by counting enemies in combat, before sending 1 or 0 to the BGM.
Presentation volume versus the player's volume setting
CombatIntensity is for presentation: how much drum comes through within the song. A settings screen's "BGM volume" applies to all BGM and is managed separately. Using Sound Class and Sound Mix lets you adjust overall BGM level while keeping the drums coming and going.
Summary
Layered BGM advances the music simultaneously and changes only how much you hear . Matching the material's start position and length and driving both Wave Players from On Play is the foundation.
On top of that, we drove the drums' Gain with CombatIntensity and smoothed it with InterpTo. What Blueprint decides is "should drums be added now". Start by walking in and out and feeling the same song's mood change.
Further Reading
- Epic: MetaSounds Quick Start — steps for stereo output, Mixer, and Inputs
- Epic: MetaSound function node reference — settings for Wave Player, Mixer, and InterpTo
- Epic: Blueprint Quick Start — comparing overlapping Actors and Branch