Wednesday, July 23, 2014

Beethoven's Piano Sonatas: an Application of music21

[This is a guest post by Derek Klinge who uses music21 in his research on music and disability. I thank him for his contribution. - MSC]

I am a researcher within the Performing Arts Medicine Association. I was interested in looking at Beethoven's use of range over time in his piano sonatas. Although several previous studies have looked at the question of how Beethoven's compositions were affected by his hearing loss, the results were far less than conclusive. A study in the British Medical Journal counted the notes in the first movements of the first violin parts of Beethoven's string quartet's by hand. For a number of reasons, I thought it might be better to look at the piano sonatas, including that Beethoven wrote more piano sonatas than he did string quartets and symphonies, so the statistical power would be greater. Counting all of the notes in Beethoven's piano sonatas by hand would be a Herculean task for sure, but fortunately with scores available from the Center for Computer Assisted Humanities and music21 sufficient coding skills would do the job.

Why music21?

In addition to the number of high notes, I was also interested in Beethoven's overall use of range, the average note, average frequency, number of measures with high notes, and in calculating values based on the number of notes, as well as weighting those measures by the duration of notes. The methods available in music21 allow the collection of this data very quickly. To collect the majority of the data I needed from all 103 movements of Beethoven's piano sonatas, count over a quarter million individual notes, and organize the data into sonatas, and separating the data by movement number, takes about 11 minutes.

Some Interesting Findings

Beethoven's use of high notes was lowest around 1800 (for all the graphs below, the colors within the dots represent the Sonata Numbers, going from red to purple from 1-32):

The average frequency of each sonata follows a similar trend:

In general, as there are more notes per measure, there are more high notes per measure. This trend does not hold many of the sonatas written before 1802.

Also, the relationship between the use of high notes, and the average frequency was different between the earlier and later sonatas:


Technology like music21 is an invaluable tool for the empirical study of musicology. Relatively quickly, data gathered can be used to analyze the possible relationships between Beethoven's use of high notes and his overall range, and compare that with what we understand about his hearing loss. These data suggest that Beethoven was significantly affected by his hearing loss, though it seems that sometime around 1802 he developed strategies to cope with his progressing disability.


  1. I'd agree that analytical approaches as this one can be valuable. But for a useful conclusion, it should be noted that the keyboard range of the available instruments changed over time. Before 1803, Beethoven did not compose for a compass larger than five octaves simply because the usual instruments at the time did not possess a larger compass.
    Very roughly spoken, and based on the instruments he either possessed, or very clearly aimed at (taking into account what was available in Vienna at a given time) the sonatas need to be analysed by at least four blocks: five octaves ,F-f3 for everything up to 1803, five-and-a-half octaves ,F-c4 for music from c. 1803 to c. 1808, six or even six and a half octaves ,F-f4 or ,C-f4, up to Op. 101, and finally a re-lapse to another six octave range ,C-c4 in most of the late works for piano (reflecting the options of his English Broadwood piano he owned from 1817 until his death). Amateur pieces which use a smaller range in relatively 'later' blocks further complicate the picture.

    Another complication might be that compositional choices such as deciding upon averages of frequencies and top notes are no compensation measures for composers without a medical condition. Developments in musical style are largely spelled out by composers and musicians who have healthy hearing. The fact that Beethoven had a medical condition may trick us into believing that he was forced to compensate in some way, but as a professional musician, he might just as well have made choices of an aesthetic kind (according to the style of his time, and on behalf of his audiences and the buyers of his scores) that had nothing whatsoever to do with his hearing trouble.

  2. I agree that the change in the range of the piano is likely a factor in his increased use of high notes in the later years, but I don't think that explains the clear decrease in the use of high notes around 1800.

    It's not even just a decrease in the use of high notes, but he also used fewer notes in the lowest octaves (where human hearing is least sensitive to begin with). This too suggests an auditory feedback model of composition.

    I totally agree that it would be useful to compare this corpus to the piano sonatas or works of another composer, however I'm not aware of a corpus that is available in a format ready to be analyzed. The code I have written would make it relatively simple to apply this methodology to any body of piano works.

    Also, I put the "amateur" pieces in the early group which more reflects when they were actually written rather than when they were published.