Toward the end of the medieval era, artists started making all this art about the dance of death, an artistic comment on how it doesn't matter who you are, how old or young you are, we all join the dance of death.
Fast-forward to the Romantic era in the 19th century, and artists once again seized upon the idea of the dance of death.
In 1830, Hector Berlioz premiered his first symphony, called Symphonie Fantastique. In the final movement, he quotes the melody from a medieval chant called the "Dies Irae", which comes from the 13th century. It is part of the Catholic Requiem Mass for the Dead.
Composer Franz Liszt was in the audience the night of the premiere of Symphonie Fantastique. He heard Berlioz use the "Dies Irae" melody, and that inspired Liszt to use it periodically throughout his career.
Most famously, perhaps, Liszt used "Dies Irae" as the theme in a piece called Totentanz, which means "Dance of Death".
Liszt wasn't just inspired by Berlioz, he was also inspired by a mural called "Triumph of Death" by Francesco Traini. You can view that mural by clicking this link; the mural is found in the interior of the Camposanto cemetery in Pisa, Italy.
Totentanz is a theme and variations. The "Dies Irae" is the theme, and everything that comes after is some sort of variation on that melody.
In 1872, French composer Camille Saint-Saëns wrote a song called Danse macabre for voice and piano. He turned it into an orchestra piece two years later, and it is one of the most popular pieces to hear during the Halloween season.
Danse macabre is a tone poem - that means it's a continuous piece of music (there aren't separate movements, that is), that describes something literary or a painting (or just something non-musical). Essentially, it's a piece of music intended to describe something.
Program music also tells a story, but tone poems and program music differ significantly in that a tone poem describes something non-musical, but does not have accompanying text to explain the story.
The tone poem by Saint-Saëns, Danse macabre, is based on a literary poem by Henri Cazalis, called Egalité, Fraternité....
French superstition says that Death comes out at the stroke of midnight each Halloween, summoning the dead to join in a dance.
Saint-Saëns paints this musically in a number of creative ways. The piece opens with a harp, plucking the 12 chimes of midnight.
And then he gets a bit radical with his depiction of Death, using a sonority used to strike fear into the heart of the listener.
Solo violin depicts Death. When the violin starts, you're hearing an interval called a "tritone". In the history of music, that interval is also known as "diabolus in musica", or "the devil in music".
For hundreds of years, composers avoided that interval at all costs. Here's why.
It's an unusual interval for its harmonic instability. It can either collapse into itself and resolve to a major third, or expand outward and resolve to a minor sixth.*
This is important because when you hear a tritone, you want it to go somewhere. Anywhere. Whether you know it or not. So when Camille Saint-Saëns uses it in the beginning of Danse macabre, it's particularly unsettling because it doesn't resolve to anything initially.
A tritone is dissonant, yet it's symmetrical. The two notes that form the interval are exactly 6 half-steps apart.
Now normally, if you flip an interval upside down, it'll change. If you flip a major third upside down, it turns into a minor sixth. If you invert a major seventh, it becomes a minor second. But the symmetrical tritone never changes.
Additionally, if you interlock two tritones, you get a diminished seventh chord. The sonority of a diminished seventh chord often symbolizes something scary.
Many composers toyed with the idea of a Dance of Death. Gustav Mahler frequently wrote music about death. In the second movement of his fourth symphony, Mahler asks the violin to tune itself higher than normal and play a death dance.
Shostakovich wrote a tiny and predictably clever-as-heck "Danse Macabre" of his own, as part of a larger work titled Aphorisms. He also incorporates the "Dies Irae" melody. Twice, in fact, in a piece that's only 58 seconds long.
*Those resolutions are for a major key. If you resolve a tritone in a minor key, the inward resolution would result in a minor third, and the outward resolution would create a major sixth.