Dialogue-Driven Music in FMOD: Adaptive Scores for Cutscenes and NPC Conversations
One line index from the game. Every musical decision in FMOD.
Whitepaper · Interactive Music · FMOD Studio · Dialogue · 7 min read
Victor Hime · Doctor Audio
When the player presses Next to read each line, the length of a story scene belongs to the player. A linear score cannot know when the story turns.
In a shipped narrative game, we drove cutscene music from a single value, the index of the line on screen. FMOD Studio derives the music section from it, and NPC conversation music follows the quest state as it changes mid-conversation.
In this approach to adaptive music, which part of the score belongs to which moment of the text is an authoring decision in FMOD, not a rule in game code.
SKIP THE READ?
Make the music follow the story.
Building dialogue-heavy scenes where pacing changes with every player? Flutu can develop adaptive music systems in FMOD, keeping musical decisions with audio and integration predictable for the game team.
Let's Talk About Adaptive MusicTL;DR
- 01One value from the game
When the player presses Next, the game updates a line index. A reserved last value means skip.
- 02The mapping lives in FMOD
A stepped automation curve turns the line index into a music section.
- 03Turns land on musical points
Each section loops until the text moves on, then leaves through an exit the composer placed.
- 04One score for every language
Each localized dialogue event nests the same music event.
The player sets the pace
In voiced cutscenes and NPC conversations, the player reads at their own speed and presses Next to move on. Each cutscene score had a narrative shape: an opening mood, a turn when the story changes, and an ending.
As one linear cue, that shape matches the text at only one reading speed. A slow reader hears the turn before the line that motivates it. A fast reader reaches that line while the music is still in the previous mood.
| Approach | Follows the text | Musical continuity | Owner of the musical decision |
|---|---|---|---|
| Game sets a music state per line | Yes | Depends on the cues | Programming, through code and builds |
| One cue per line | Yes | No, music restarts at every line | Audio |
| One long cue with a fade | No | Yes | Audio |
| Line index with the mapping in FMOD | Yes | Yes | Audio, inside FMOD |
Localized voice-over adds a constraint: each language has its own dialogue, but all of them should share one score.
One boundary between game and music
We split the work at one boundary. The game reports where the reader is in the text. FMOD decides what the music does with it.
Game side
- On Next, update LineIndex with the index of the current line.
- On skip or at the end, send the reserved last value.
- Start and stop the scene.
FMOD side
- The dialogue event nests the music event, and both share LineIndex.
- Each music event has a section parameter automated by LineIndex. Code never sets it.
- Sections loop and change only at exit points chosen by the composer.
The boundary follows ownership. Programming implements a contract that does not change when the music does. The composer owns the mapping and the transitions in the tool where the music is written, and can audition a whole scene by stepping LineIndex in FMOD Studio, without a game build.
Every language has its own dialogue event, and all of them nest the same music event. The score and its link to the text are authored once.
Mapping lines to music sections
Each music event has a labeled section parameter with values such as A, B and C. An automation curve on its preset, driven by LineIndex, sets the value. With discrete values only, the curve is a lookup table: one section per line.
| Scene | Lines | Section A | Section B | Section C |
|---|---|---|---|---|
| Opening | 12 | Lines 1 to 11 | Line 12 and skip | — |
| Mid-game | 7 | Lines 1 to 3 | Lines 4 to 7 | Skip |
| Ending | 6 | Lines 1 to 2 | Lines 3 to 6 | Skip |
In the opening scene, Section B carries the closing passage. In the mid-game scene, the music turns on the fourth line. The composer can move that transition to the fifth line by adjusting one step of the curve and auditioning the change directly in FMOD.
Where the closing section is reached only through the end value, the curve holds its last value past the final point. A skip lands on the closing music with no extra rule in code.
Music that turns at the right moment
We prioritize musical phrasing over frame-accurate response. Each section is a loop region conditioned on its own value. It repeats while the reader stays in that part of the story and, when the value changes, leaves through one of these techniques.
| Technique | How it works | Used in |
|---|---|---|
| Play-through | The loop releases and the music continues as written | Ending, first turn |
| Exit markers | Transition markers at phrase ends jump to the next section, each with its own crossfade | Opening and mid-game turns |
| Exit region | A transition region jumps as soon as the condition is true, with a crossfade | Ending, into the closing section |
| Loop seam crossfade | A short crossfade hides the join when a section repeats | Section loops |
| Direct skip | The music event reads LineIndex, and the end value jumps to the closing section | Opening and mid-game |
The technique follows the dramatic need. The mid-game turn fades in slowly; the move into its closing section lands on the beat. The music responds at the next authored exit point. Adding more exit points reduces the wait but increases the number of transitions to author and validate.
Structure by scene
| Scene | Opening of the cue | First turn | Second turn |
|---|---|---|---|
| Opening | Ambient introduction, then a looping main section | Several exit markers lead into the ending | Ending plays once |
| Mid-game | Looping first section | Several exit markers at phrase ends, with long crossfades | A few exit markers with very short, on-beat transitions into the closing section |
| Ending | Short introduction, then a looping first section | Play-through into the second section | Exit region with a crossfade into the closing section |
NPC conversations: the story state as the signal
Main NPC conversations apply the same principle to a different signal: a quest state parameter, here called QuestStage, with the values intro, active and final.
The state changes while the conversation is open. When the player reads the lines that resolve the quest, the game updates QuestStage and the conversation music answers in place.
| Conversation structure | Before the quest resolves | When the quest resolves |
|---|---|---|
| Two-state theme | The NPC's theme loops while the player keeps reading | A transition region carries the music into a resolution cue, which settles into a closing loop |
| Single theme | The NPC's theme loops | The theme continues looping |
The transition regions span the whole theme, so the change lands wherever the player is in the cue. A single looping theme is enough where a conversation has no turn to follow; two of the main NPC conversations use that simpler structure.
Validating player-paced music
Validation targets the extremes of reading behavior. Step the parameters manually in FMOD Studio, then check the same scenarios in the game.
| Case | What we check |
|---|---|
| Fast reading | Sections still change at musical points, and no cue is left unfinished |
| Slow reading | Loops repeat without audible joins |
| Skip at every line | The end value reaches the closing music from any line |
| Every language | The same mapping holds with different line lengths |
| Quest resolution at any point | Each NPC transition works wherever it lands in the theme |
| Script changes | The mapping still matches the current line order |
Decisions to make early
Document the curve with the script
The programmer sees the line index rather than the musical mapping. Document the curve beside the dialogue script so audio, writing and programming can review the same decisions.
Agree on what skip means for the music
Where the closing section is reachable only through the end value, audio and programming agree on what that value means for the music, not only for the dialogue.
Plan the index for branching dialogue
The line index assumes a linear scene. Branching dialogue needs a different index scheme or one mapping per branch.
Use sections where the scene turns
A scene without a dramatic turn is better served by a single looping cue. The line-to-section mapping pays off when the text changes the meaning of the scene.
Applying the method
- Define the contract: one labeled line parameter, one value per line, a reserved end value, updated when the player advances.
- Nest the music event inside the dialogue event, and reuse it in every language.
- Compose sections that can loop, with exit points at phrase endings.
- Draw the stepped line-to-section curve and review it against the script with the writer or director.
- Where conversations resolve story progress, drive their music from a story state the game already tracks.
- Validate the extremes in FMOD Studio and in the game, in every language.
Questions we can answer
Why not set the music state from game code?
Setting the music state in game code moves the line-to-section mapping into programming. Keeping that mapping in FMOD lets the music change while the game-side parameter contract stays fixed.
Does the music cut when the player presses Next?
No. The section changes at the next exit point the composer placed, with a transition chosen for that moment.
How does one score serve several languages?
Each language has its own dialogue event, and all of them nest the same music event, which reads the same line index.
Why does Flutu publish these technical articles?
We publish game audio methods to make the decisions behind interactive sound easier to understand and discuss. For dialogue-driven music, that means showing how the game, FMOD and composition share responsibility for pacing, transitions and localization.
PUT IT INTO PRACTICE
Adaptive music that holds up in production.
From cutscene pacing to quest-driven conversations, we can help your team design, implement and validate a responsive score in FMOD.
Let's Talk About Adaptive MusicRelated services: Technical Audio, for FMOD implementation and adaptive music in a live project, and Game Audio Services. Related Doctor Audio publications: Scene Audio Debugger and Sound Call Models.