# Visualizing statistical patterns in Schubert's song cycle, Die schöne Müllerin

by Kris Shaffer

After some time away (my wife and I just celebrated the birth of our third child!), I'm diving back into The Lieder Project again. I've been doing some data visualization and exploratory analysis of Die schöne Müllerin. Here's what I've found.

First, I imported the parsed text and music into the statistical analysis package R. There I used the plot tool to visualize potential relationships between different parameters in these songs ― pitch, duration, metric stress (both musical and poetic), vowel sounds, etc. Most relationships in this song cycle are very complex. However, a few of them lead in interesting directions.

First, here is a box graph showing the general pitch height of the notes in DSM.

Pitches are denoted by "diatonicNumber", a property in music21 that strips accidentals and assings a number to each letter name. Middle C (natural, sharp, or flat) is 36, B3 (natural, sharp, or flat) is 35, D4 (natural, sharp, or flat) is 37. The X axis represents the songs in the cycle (minus the three that are missing), in the order in which they are performed in the cycle. The boxes represent the middle two quartiles of pitches (the 25th to 75th percentiles), with the horizontal line representing the median pitch. The extended dashed lines show the outer quartiles. Dots represent outliers.

Note that for most songs, the median pitch is middle C. Though the quartiles vary somewhat, there is a lot of uniformity in pitch register. However, this chart counts each note once, regardless of duration. What happens when we represent notes by length? Does the register go up when those long, high melodic climaxes get extra weight?

A little bit. Here is a re-plot where each note is counted in proportion to its duration.

At first, this doesn't seem to tell us much other than Schubert doesn't alter the register much from song to song. However, it serves as a baseline for other analysis.

Let's look for some specific words. I asked R to plot the pitch height (weighted for duration) of all notes attached the the syllable grün. (By using the syllable, we get all forms of the word: grünen, grüne, etc.) Here is that plot.

The word mainly occurs in three songs: "Mit dem grüne Lautenbande," "Die liebe Farbe," and "Die böse Farbe." Note the differences in pitch height for grün- in these three songs. It seems that in "Mit dem grüne Lautenbande," the heightened psychological tension surrounding the color green (this is the song when the green ribbon the narrator gives to his beloved is fading in color) is reflected by the pitch height of the occurrences of the word green in the music. Likewise, the upwards motion in pitch height from "Die liebe Farbe" (the beloved color) to "Die böse Farbe" (the hateful color) seems to suggest a similar increase in tension. But are these observations significant?

That's where the baseline plot comes in. When compared to each other, the overall pitch content and the "grün" pitch content of "Die böse Farbe" match pretty well. The median pitch of "Die liebe Farbe" is 33 (G3) overall and 35 (B3) for grün, but with substantial overlap of the pitch ranges, there doesn't seem to be a substantial divergence from "normal" for "grün" there either. There does, however, seem to be a substantial difference between the overall pitch content of "Mit dem grünen Lautenbande" and the occurrences of grün in that song: every occurrence of grün in that song is at or above the overall median pitch. So the heightened emotional content surrounding the color green in this text seems to be reflected in the high pitch setting of the word "grün."

There are a number of other questions like these that we can ask the corpus. We can look at other words. We can use topic modeling on the text to suggest broader topics (sets of related words) to search for and gain a more nuanced view of some aspects of the text. We can also compare other feature sets of the song cycle: pitch duration, metric stress, strength of the beat (strong, weak, offbeat, etc.) ― both visually and through correlation and other statistical measures. And, of course, as we hone in on specific relationships, we can run the appropriate statistical tests to establish the specific associations and whether or not they rise to the level of statistical significance.

If you're into data science or digital humanities, download the corpus, import it into your favorite statistical analysis/visualization tool, and play around with it. Let us know if you find anything interesting!