You sit down to watch your favorite movie, television show or stage play. Your ass imprints deeply into your seat. Your mouth is a flurry of chewing as it commits untold destruction on a bag of baked corn puffs. The hero suddenly begins to make his big speech, your blood pressure raises. Your jowls clap and shudder like twin lightening bolts of shimmering, drooping adipose. Sweat builds down your neck as the music hits its highest notes, heroic trumpets blazoning while the hero delivers the strongest words of his speech, rallying his allies and winning the day. Your bowels involuntarily void themselves.
What you just experienced was what is most commonly known as background music or soundtrack. In something like a TV show or a video game, it's the background music that helps drive home the atmosphere of the imagery and dialogue and accent their effect. When the hero is powering up, suddenly turning the tables on the villain, you're probably bombarded with a swift and powerful musical track that accompanies the action. When the hero holds his dying friends in his arms, the two exchanging their final words together, more sombre and quiet music usually plays to further the emotional mood.
Background music is very powerful, sometimes going so far as to provide more mood setting and atmosphere than the actual imagery or dialogue themselves. Classic examples of this are iconic themes like the fantastical and uplifting Jurassic Park suite or the rousing and foreboding Imperial March from Star Wars. While music often stresses and compliments the emotions or feelings a scene is trying to get across (and, again, sometimes even going beyond simply complimenting and instead becomes the thing that primarily sets the mood), there are times when music itself can be an important and powerful tool in telling a story. The most normal way of doing this is when the music ceases to be simple background noise and instead takes the form of what is known as a leitmotif.
So just what the fuck IS a leitmotif? Is it shit?
A leitmotif is, basically put, the theme you hear playing when a certain character, event or idea is happening. Normally this means the leitmotif is going to be reoccurring through the story, but a leitmotif can play as few as only a couple of times (if done correctly). What makes a leitmotif so important is that it's one of the only organic tools that, outside the medium of writing, a storyteller has when it comes to telling the audience something that the characters don't know.
Basically, a leitmotif is a way of telling the audience something without telling the characters. Background music, after all, isn't something the characters are hearing. When the hero makes his epic speech that's punctuated by heroic music, the only thing the characters are hearing is the hero yelling like an idiot. They're not aware any music is playing; why the hell would they be? So in this, you have music as a tool for talking directly to the audience.
Using music to talk to the audience takes a bit of tact. It would be hamfisted and stupid if, for example, you wanted to try and tell the audience that “something bad is about to happen” despite the fact the characters are all sitting together talking happily in a field. If the characters are talking while the music starts turning grim and threatening right before someone's head explodes, most people in the audience would find your use of musical buildup to be pretty god damn horrible. So how do you properly utilize your music?
As explained before, a leitmotif (in its basic essence) is your standard “character theme”. It's the theme that plays when the bad guy twirls his mustache. It's the theme that plays when the supporting character speaks encouraging words to the hero. Classic examples of these leitmotifs would be the Indiana Jones theme or perhaps Superman's theme, not only do both play when their titular hero is doing something bold and noteworthy, but they also sound exactly the fucking same.
But a true leitmotif goes a step beyond just being “a character's theme song”. You can utilize a leitmotif for the purposes of foreshadowing, or, in its most brilliant of usages, put straight up retroactive spoilers into your story. Remember, a leitmotif is a way of telling the audience something the characters don't hear. Unlike a book, where you can simply state things in the narrative or in character's internal monologues, doing the same in a TV show or movie is hard to make seem not clunky. Books, however, don't have musical accompaniment.
A perfect example of a retroactive leitmotif is found in HBO's Game of Thrones. In a bid not to spoil anything for anyone who is smart enough to not watch Game of Thrones, I'll explain in a spoiler-free manner just why this leitmotif usage is excellent.
Ignoring the shit quality of the provided clip, this is a scene from the very first episode of the Game of Thrones television series. What we learn in this scene is that a character who was previously assumed to have died from an illness is now, reportedly by the words of a letter, revealed to have been murdered. This is a pretty big reveal for the plot and it's what sets basically everything else in the story into motion, making it a major plot point. However, as it turns out, the letter does not reveal the true murderer (Oops! Spoiler warning) and instead is a lie. The real murder is revealed by only the slightest hints of their leitmotif beginning to play at around 2:40 into the video. Now, this character has not yet been on the show, so their leitmotif has never played before this point. It's only after you hear their leitmotif and associate it with this character that you can go back and, retroactively, realize that the show exposed the mystery from the very moment it posed it.
This is an excellent use of leitmotif. Not only does it work to set a foreboding mood, but it's subtle enough that only someone truly paying attention to the music is ever going to hear the faint inklings of the true murder's leitmotif begin to play. The characters within the scene, of course, are totally oblivious to the music playing around them. The leitmotif provided a truly unique way of telling the audience of an incredibly important plot element that couldn't have really been exposed to them in any other way.
Using a leitmotif in this way actually utilizes music as a form of storytelling, only unlike other form of storytelling available to a television show or movie (outside of a tacked on voice-over narration), leitmotifs are a way of explicitly telling the audience something that none of the characters are able to hear. This makes a proper leitmotif among one of the most powerful storytelling tools you have when setting up a scene.
Leitmotifs are, like described above with the Game of Thrones scene, generally used to tell the audience something before any of the characters state it. It doesn't have to be as subtle or nuanced as Game of Thrones usage was, either. For instance, let's say you have a scene where something horrible has happened. The characters approach the scene while the villain's theme begins playing. Immediately, before any character can say “THIS WAS THE WORK OF SEPHIROTHDORF THE SHADOW HEDGEHOG”, you're already fully aware of who has done the dirty deed- thanks to the music you hear.
Leitmotifs can also be used to basically “transfer” the ideals and values you relate to a character into a scene. If you have a character who is super heroic and strong and infallible, you may have their leitmotif begin to play during a scene where other characters are beating back an evil army. While that character themself is not involved with the situation or has anything to really do with it, the same emotions and values that they posses can now be sort of transferred into this particular scene. Basically, you'll find the musical accompaniment to be a lot 'cooler' if it's related to a character you know exemplifies the mood of a situation as opposed to if the music playing were just a more generic and characterless tune.
So, there you go. A leitmotif isn't just something that adds some cool feeling to a scene or is as basic as simply serving as a character's theme song. Utilized in the right ways, you can use leitmotifs to actually tell parts of the story or clue the audience in to something that the characters can't be privy to. Leitmotifs don't have to be full songs, by the way. A leitmotif can be as simple as only a few notes from a fuller song playing, sometimes even used in combination with other leitmotifs to make some kind of fucked up motif inception. If you aspire to create video games or movies and tell a story through those mediums, the proper and most effective ways of using a leitmotif will be imperative to telling a masterfully laid out tale.