Adaptive music

In video games, adaptive music (also called dynamic or interactive music) is background music whose volume, rhythm or tune changes in response to specific events in the game.

History
Adaptive music was first used in the video game Frogger by Konami (1981), where the music would abruptly change once the player reached a safe point in the game.

Many of LucasArts' games used the iMUSE dynamic music system, from Monkey Island 2 onwards and including games like Dark Forces, Star Wars: TIE Fighter, Full Throttle and Grim Fandango. The iMUSE system is notable in that it segues seamlessly between different pieces of music rather than having an abrupt cut.

Later games which made notable use of similar dynamic music systems include the Deus Ex and Freespace series of games.

It is also a staple of the role-playing game genre, often being used to change the music when the player is in combat, such as in The Elder Scrolls III: Morrowind or Kingdom Come: Deliverance

Horizontal and vertical techniques
The music in video or computer games and certain films is meant to draw the audience through a storyline using two distinct techniques: horizontal re-sequencing and vertical re-orchestration.

Horizontal re-sequencing is the method by which pre-composed segments of music can be re-shuffled according to a player’s choice of where they go in a storyline or environment. The most basic re-sequencing technique is to simply crossfade between two cues immediately. When the scenario changes, the first cue is faded out while the second cue fades in. A more elaborated technique when using this method is phrase branching. In this case the change to the next segment starts when the current musical phrase is ended. A more sophisticated and flexible technique are dedicated transitions. Transitions are triggered when switching between different segments. These transitional elements make the changes musically fluent and therefore keep up the flow of music.

Vertical re-orchestration is the technique of changing the mix of separate parts of an ongoing loop of music in relation to a player’s movement within the narrative of a game. Games, such as Halo 2, employ a mixture of these techniques in the creation of their soundtracks. Street Fighter II and Mario Kart DS are examples of games which change the music's tempo under certain circumstances.

Algorithmic music
Instead of relying on individual tracks of audio such as in horizontal re-sequencing and vertical re-orchestration, some games automatically generate their content on the fly, such as the case of Spore, which uses an embedded version of the music software Pure Data to generate music to certain cues such as the addition of parts to your creature throughout the game. Ape Out is another notable example, with a procedurally generated jazz percussion soundtrack that changes based on the intensity of the gameplay, as well as the actions and movement of the player.

Soundtrack switching
Games may also employ two soundtracks and mix between them, as in the case of FTL: Faster Than Light, which has an "explore" and "battle" version of each track. When the player is in battle with another ship, the audio fades into the "battle" version. This "battle" version is usually similar to the "explore" version with the addition of drums and similar dark timbres. Because of this, the transition is rather smooth and doesn't ruin the player's immersion. This is in contrast to the invincibility theme in the Super Mario series which aims to stick out, making the change sudden and obvious.

Interactive blending of music and sound effects
Some video games, such as Rez and Extase, use sound effects triggered by the player's actions that are automatically delayed to stay in synchronization with the background music and that blend well with the music. Dead Space 2 is another example of this, in which the music during gameplay appears to be arranged into four layers, each are a stereo track identifying with a distinct level of fear. Each layer of music is then either individually or collectively mixed "on-the-fly" depending on a variety of variables in the game, such as distance the player is from Necromorphs. This creates an interactive musical landscape in which the player's actions actively and instantaneously take part, enhance, shape and influence the music. On the box of Extase, such a music system, created by Stéphane Picq, was advertised with a sticker as "Interactive Music System."

As goal of the game
Music games such as Sound Shapes use adaptive music as the goal of the game. As the player gets better at the game (and collects more 'coins'), the soundtrack (which is entirely composed of the melodies and beats created by these 'coins') intensifies as a sign that they're doing well.

Other occurrences
Adaptive music was used notably in theatre in 2010 in the play 'Dom Duardos' from Gil Vicente, co-produced by Companhia Contigo Teatro and Grupo de Mímica e Teatro Oficina Versus, with music by Pedro Macedo Camacho.