You are on page 1of 10



and pressure were intrinsic, measurable properties


Our goal for this paper is to apply the method- of a system. Statistical mechanics came about after
ologies of statistical mechanics to develop exible the discovery that systems were in fact collections
tools for use in computational musicology. Classi- of tiny fundamental building blocks. Thus, a gas is
cal statistical mechanics is the study of extremely a collection of particles which interact in a speci c
information-rich particle systems. Large quantities way to exhibit the properties we associate with a
of information describing the position and velocity gas. In this way, our observables are, in fact, func-
of each particle may be compressed into a few de- tions of more fundamental variables characteristic
scriptive variables such as temperature and pres- of the particles.
sure. These variables are easily perceived by an
observer. In the same way, we will distill informa- In the model of statistical mechanics, a system
tion from the scores of musical compositions, pro- containing a classical gas can no longer be unam-
ducing new macroscopic quantities that describe biguously described by temperature, pressure, and
perceptible features of the music. volume. Even this very simple system contains
a huge amount of information. In order to per-
fectly describe such a system, one would need to
compile a list of the position and velocity of every
In the terminology of thermodynamics, a system is individual particle present in the system at every
the subset of the universe with which we are con- instant of time. This is called the microstate of
cerning ourselves (the remainder of the universe is the system. However, the observables seen by a
the environment ). Thermodynamics involves ob- human specify the state of the system. Many mi-
servable variables exhibited by a system, which are crostates can exhibit the same state when observed
called observables. Examples include temperature, on a higher scale. Statistical mechanics allows us
pressure, and volume. These observables provide to derive functions of the many independent vari-
an easy means of comparing di erent systems and ables, typically as averages over the particles, over
of quantifying perceived experiences. That is, a time, or over both. These functions distill the mi-
system feels hot because its temperature is higher crostate information to depict the large-scale state
than that of the observer's hand. A system has of the system. Examples of these functions corre-
high pressure because it compresses objects which spond with the human experiences of temperature
are placed within it. or pressure.
Thermodynamics was developed before the con- This idea of distilling microstate information into
cept of fundamental particles was widely accepted. macrostate information which is relevant to human
For early scholars of thermodynamics, temperature observations will prove to be key to the computa-
This work is in partial ful llment of the Jacob Price's de- tional musicology we describe in this paper. Before
gree requirements at Kalamazoo College. Eric Barth served we implement these ideas, it is necessary to discuss
as the research advisor. a few relevant concepts of musical scores and music
theory.
For the purposes of this paper, we are only con- In addition to the temporal relation between two
cerned with music composed in the western classi- notes, they are also separated by an interval in
cal tradition. the space of pitches, which we describe simply by
the number of semitones between the two pitches.
A piece of music comprises a nite collection of in- Some common intervals are expressed in Table 1.
dividual notes. Each note exhibits a certain pitch,
representing how high or low the note sounds to Half step One semitone
an observer. This is physically represented by the Step Two semitones
frequency of the sound (measured in Hertz (Hz)). Minor third Three semitones
A perceptual phenomenon, believed to be universal Major third Four semitones
to human experience, is that of pitch class or octave Perfect fth Seven semitones
equivalence. Consider the pitch with frequency 440 Octave Twelve semitones
Hz. We nd that a pitch with frequency 220 Hz |
exactly half of the frequency and one octave below Table 1: Common intervals in number of
| is perceived as being qualitatively similar to the semitones.
440 Hz pitch. We say that all pitches which possess
this same quality are in the \A" pitch class. Furthermore, gathering more than two pitches to-
gether creates the concept of harmony. Three pitches
How many pitch classes are there? Historically, form a triad. A triad constructed by a major third
this has been the subject of much debate [1]. In followed by a minor third is called a major triad.
the past, unique tunings have been constructed to A minor triad is constructed with a minor third
maintain the ratio of a perfect fth (3 : 2) as well stacked below a major third.
as possible. In modern Western music, the equal
temperament system divides the frequency range The set of twelve pitch class representatives com-
between one A (say 440 Hz) and the next A (at prises an octave. This comes from the concept of
880 Hz) into twelve uniform intervals, resulting in a scale: a sequence of pitch classes that begins and
twelve unique pitch classes. Each pitch in this oc- ends with the same pitch class. A scale may begin
tave is separated by one semitone (with two semi- on any of the twelve pitch classes. There are sev-
tones being designated a step). The mathemati- eral avors of scales which are determined by the
cal symmetry of equal temperament disrupts the sequence of intervals used to construct the notes
small-integer frequency ratios of the perfect inter- of the scale. For example, the major scale is con-
vals: the fourth (4:3) and the fth (3:2), leading structed with the following intervals: step, step,
to the aforementioned debate. For our purposes, semitone, step, step, step, semitone.
equal temperament is to be preferred because a
musical score in equal temperament designates un- Observe that this sums to twelve total semitones:
ambiguously the pitch of each note it contains. the scale returned to the pitch class at which it be-
gan. Note also that the most commonly heard scale
Other aspects of music manifest themselves in the contains eight notes (hence the term\octave"). Like
presence of more than one note. The time interval triads, scales can be major or minor. A composer
between the onsets of separate notes creates the will frequently designate a key signature for a piece,
perception of rhythm (how the notes of the piece indicating the scale from which the majority of the
are positioned in time). The unit of time for music pitches will come. If a piece is written in the key
is de ned as the beat. The meter determines the of A major, we call the A major chord the home
pattern of accented beats. The time signature of a key (I). Generally, a piece in a major key has a
piece de nes the unit of a beat and the pattern of brighter or happier sound than a piece in a minor
accents. The most common meters are 44 time and key, which often sounds somber or dramatic.
3 4
4 time. In 4 time, every fourth beat is accented
and we group the beats of the song in four beat long
measures. A classic example is \Twinkle, Twinkle
Little Star". A 34 time piece accents every third Recall from the statistical mechanics discussion, we
beat and the piece is divided into three beat long as human observers perceive temperature and pres-
measures. This is the time signature used by most sure. As physicists, our understanding of particle
waltzes. A famous example is \Amazing Grace". dynamics allowed us to explain the observed vari-
ables as functions of more basic variables.
For the musical analysis we describe here, we work the most pertinent rhythmic information.
in reverse. Analogous to the particle microstates
of position and velocity are the pitch and rhythm Third, for much of what follows, it is useful to dis-
information of each note in a piece of music. This tinguish notes played by di erent instruments, or
is provided to us in the form of the musical score as voices. MIDI format makes this very simple as
written by the composer. We will endeavor to dis- one of its stored variables designates the channel of
till the musical microstate information into func- each note. That is, which instrument played which
tions that describe broader features of the piece note. In some cases, such as keyboard works for
of music. We call these variables hearables in anal- which a single instrument e ectively plays several
ogy to the observables of statistical mechanics. We parts simultaneously, we simply designate all notes
propose that these hearables model the perception of pitch higher than middle C (60) as being one
of a listener. voice and all notes below middle C being another
voice.

For this study, we focus on musical compositions


which are encoded into the MIDI format [9]. The In the same way that the thermodynamic variables
MIDI format [8] was invented in 1983 as a way to of temperature and pressure correspond to features
store musical data taken from electronic keyboards. of a system that are relevant and easily observed by
It is a widely accepted protocol and contains data a human observer, our hearables ought to be easily
for all of the variables we wished to study. MIDI understandable and relatable to a listener. In this
les take the form of long strings of hexadecimal vein, we have considered our own listening habits
numbers specifying everything from the pitch, vol- and consulted with avid audiophiles and professors
ume, and onset time of each note in the piece to the of music theory to discover what it is that allows
time signature and comments like copyright data. us to classi es musical pieces. In this work, we de-
sign and implement algorithms that compute these
For the purposes of this study, we de ne three fea- hearables from MIDI les. The result is a suite of
tures of individual notes that we consider as ba- computer software that can detect the features of
sic variables. First is the pitch of the note | the music that listeners deem most representative of a
frequency of the note's sound wave | rounded to musical style, and perhaps can detect subtler fea-
the nearest pitch class in the western 12-note scale. tures not obvious to a casual or focused human
In MIDI, the note known as middle C on the pi- listener.
ano keyboard (256 Hz) is given a pitch value of
60. The unit of measurement is a semitone, so 61 One easily quanti able idea is the complexity of
corresponds to the C] above middle C and 72 cor- a piece. Di erent eras of music are known for in-
responds to the C an octave above middle C. In tricate rhythms, harmonies, and melodies, while
general the MIDI note number p corresponds to other eras are more stark and minimalistic. In
the frequency f of the pitch according the formula what follows, we quantify complexity as entropy.
f Another hearable relates to the idea of signature
p = 69 + 12 log2 :
patterns. Just as many literary authors have fa-
440
vorite turns of phrase or characteristic terminol-
ogy, composers exhibit signature ideas in several
Second, the MIDI onset time provides a rhythmic domains of musical composition. Within a piece, a
variable. Some manipulation of MIDI code allows composer might repeatedly develop a rhythmic or
us to represent the onset time of each note in terms melodic idea. In a broader sense, a composer might
of beats instead of milliseconds. A note that begins have a characteristic rhythm, melody, or harmonic
on the rst beat of the rst measure of the piece has progression that one would expect to nd in many
an onset time of 1. A note falling on the second half pieces by this composer. A listener who hears this
of beat two in measure one has an onset time of 2:5. \Mozart-like" rhythmic pattern can guess that the
In 44 time, beat one in measure 2 has onset time 5, piece was composed by Mozart.
while in 34 time, beat one in measure 2 has onset
time 4, and so on. We do not explicitly consider Finally, the harmonic structure of a piece is indica-
the duration of notes, and only concern ourselves tive of its era. Generally, composers grew more ad-
with the time at which notes begin, as this contains venturous with harmony over the centuries. Very
early compositions invoke only the harmonies of pitch.
the home key and very near neighbor keys. On
the other end of the spectrum, modern composers For the melodic entropy, we used two distributions
experiment with atonal music which does not con- to capture melodic complexity. One is the distri-
form to any well-de ned key. We visually present bution of pitch classes of a voice:
the distribution of harmonies in a given piece or number of occurrences of pitch class xi
collection of pieces as a harmonic landscape. Pm (xi ) =
number of notes in the piece

Sm =
Xn

Pm xi ( ) log(Pm (xi )):


i=1
Complexity can be quanti ed as a form of entropy.
Entropy, in the sense of statistical mechanics, might In this case, minimum entropy is given by the same
be said to characterize the unpredictability of a sys- pitch repeated constantly.
tem. A piece of music that is entirely predictable
is, by de nition, not very complex. Consider a Unfortunately, a simple musical scale would achieve
piece consisting solely of a single pitch played at maximum entropy with this measure (each note is
a constant rate. This is perfectly predictable (low a di erent pitch). Thus we also use the distribu-
entropy) and also very simple (low complexity). tion of intervals between two adjacent notes as an
indicator of melodic entropy:
Given a probability distribution P (xi ), we can cal- number of occurrences of interval xi
culate the entropy of the distribution with the fol- Pint (xi ) =

lowing equation: number of notes in the piece 1

S =
Xn

( ) log(P (xi )):


P xi
Sint =
Xn

Pint xi( ) log(Pint (xi )):


i=1
i=1

In order to evaluate the entropy or complexity of a In this case, a simple scale possesses minimum en-
piece, we only need to generate distributions which tropy.
represent the piece as heard by an observer. As
suggested by Madsen and Widmer [5], we sepa- We average these two quantities for a generalized
rately evaluate the melodic and rhythmic complex- melodic entropy. Thus, we calculate the rhythmic
ity of a single voice in a piece and average them and melodic entropy of a voice in a piece and then
to nd a total entropy for that voice. We give average these quantities to nd the entropy of that
the rhythmic and melodic entropy equal weight. voice. For pieces comprising more than one voice,
Melodic entropy is evaluated in two ways, by pitch we average over the n voices to represent the total
class and by intervals, which we again weight equally: complexity of the entire piece:
Smusical =
1
4
1
(Sm + Sint ) + (Sr ):
2 Stotal =
1 Xn

Smusical :
n
i=1

Our probability distribution for rhythm is the col-


lection of inter-onset times (that is, the time elapsed We did not implement a measure for harmonic en-
between two adjacent notes in a single voice of a tropy, nor did we consider harmonies in our calcu-
piece): lation of the net complexity of a voice or piece.
number of occurrences of inter-onset time xi
Pr (xi ) =
number of notes in the piece 1 Within a piece of music, rhythmic, melodic, and

Sr =
X
n

( ) log(Pr (xi )):


Pr xi
harmonic ideas are repeated and developed in in-
teresting ways. An excellent example can be found
in Beethoven's Fifth Symphony, in which the iconic
i=1
\Bum-bum-bum BUM" rhythm is repeated hun-
In this case, minimum entropy occurs when notes dreds of times, with di erent pitches, throughout
are played at some constant rate, independent of the rst movement of the piece. We have developed
a program to search MIDI les for these repeated in Beethoven's Fifth Symphony. Observe that line
patterns. thirteen contains the iconic \bum-bum-bum BUM"
rhythm. An additional output catalogs the mea-
At the lowest level, the program can be provided sures in which each of these rhythmic patterns ap-
a target rhythmic or intervallic pattern or a tar- pears (that is, if we look at line thirteen of the other
get harmonic progression. We search the given output data structure, we see which measures con-
piece for examples where the target pattern occurs. tained this rhythm). It should be noted that the
With an additional loop, the program uses each line number (13 here) merely indicates that this is
measure of each voice of a piece as a target and the 13th in an unordered list of identi ed patterns.
searches for duplicates located in any later mea-
sure in any voice. Any rhythmic or intervallic pat- Once these within-piece patterns have been found
tern that occurs two or more times in a piece is for a number of pieces by the same composer, we
recorded as a pattern for that piece. An additional can search for patterns which occur in two or more
input parameter is a tolerance, which allows for separate pieces - signature patterns. When given
pieces with exible rhythm (such as jazz improvi- a collection of pieces by the same composer, we
sation) to still present patterns. The program can locate the patterns found within each individual
also be instructed to consider only patterns that piece. Comparing these located patterns, we iden-
are shorter or longer than a single measure. Fi- tify the patterns that appear in more than one
nally, the melody pattern nder can be altered to piece. These signature programs again provide two
consider diatonic (within the scale) motion as iden- outputs. Each signature is written in an easily-read
tical even when the exact intervals di er slightly. format along with a count of the separate pieces
For example, in C major, C-D-E would be written exhibiting the associated pattern. The signature
as \+2; +2" whereas D-E-F would be \+2; +1" al- rhythm program groups pieces in triple time (three
though the two patterns are diatonically identical. or six beats per measure) separately from pieces
in duple time (the number of beats in a measure
The output for these pattern nder algorithms comes is a power of two) as the rhythmic language dif-
in two parts. The programs output the patterns in fers so greatly between the two. Similarly, for har-
an easily-read format, and also provide a tally ta- monic signatures, pieces in major and minor keys
ble indicating the measures in which each pattern are treated separately.
appears. Rhythmic patterns are written as a vec-
tor of the onset times of each note in the pattern.
Thus, Beethoven's well known pattern would read
in our format \1:5, 2, 2:5, 3."

Figure 2: Example output from signature


interval program. The leftmost column in-
dicates the number pieces in which the pat-
tern is found. Columns three through the
end depict the pattern of intervals. The 100s
are placeholders.
The example output shown in Figure 2 was gen-
erated by searching for interval patterns through-
Figure 1: Excerpt from violin part for rst out the complete collection of Mozart's string quar-
movement of Beethoven's Fifth Symphony tets. Observe that the pattern\ 2; 1; 1"occurs in
and example output from rhythm pattern four separate pieces in the collection. Similarly, a
nder program applied to this piece. Note descending octave ( 12) followed by ve repeated
the iconic rhythm in line 13. notes (0) occurs in two of the string quartets.
The example output shown in Figure 1 was gener-
ated by searching for four-beat rhythmic patterns
From the macroscopic pitch data, we assign a chord this context, we can aggregate harmonic counts be-
of best t to a collection of notes as an approxima- tween pieces. Thus, given a collection of pieces by
tion of harmony. Krumhansl and Kessler [3], in a composer, we generate normalized aggregate his-
their perceptual psychology study, cataloged how tograms presenting the frequency of each harmony
well each of the twelve pitch classes t within each relative to the given home key. We treat keys in
of the 24 major and minor chords. This generated major and minor keys separately to accommodate
24 distributions representing perceived goodness- the di ering harmonic languages.
of- t of each pitch class within each chord. Given
a collection of notes, we construct a distribution
of pitch classes. By comparing this distribution
to the self organizing map data of Krumhansl and As an application of the usefulness of the complex-
Toivenen [4], we identify the chord that ts best. ity measure, we explore how complexity varies over
The program has an adaptive feature that can iden- a period of time by nding the average complexity
tify the chord of best t at the nest appropriate of various composers from the Baroque and Classi-
temporal scale | the pitches within one beat, a cal periods. From the early Baroque period, Jean-
collection of beats, etc. Philippe Rameau (1683 1764) exhibits a com-
plexity of 2:2950 (standard deviation 0:2040) and
Once this has been done, we compute the distri- Francois Couperin (1668 1733) shows a complex-
bution of harmonies within the twenty-four major ity of 2:2980 (standard deviation 0:1688). We see
and minor keys. This data is illustratively pre- that these two composers present nearly identical
complexities. These complexities are the highest of
all the composers we investigated, as might be ex-
pected: Baroque music is characterized by complex
ornamentation, such as trills, which would serve to
arti cially increase the rhythmic and melodic en-
tropy of a piece.
From the late Baroque period, George Frideric Han-
del (1685 1759) presents a mean complexity of
1:8367 (standard deviation 0:1858), while Johann
Sebastian Bach (1685 1750) exhibits a complex-
ity of 1:7073 (standard deviation 0:1876). We see
that, for these slightly later composers, the com-
plexity is signi cantly lower than the early Baroque
composers. One wonders if this is indicative of a
rapid mentality shift with regards to complexity
Figure 3: Major and minor keys arranged in over the course of the Baroque period, or if this
a two dimensional Tonnetz. discrepancy can be explained by the geographic dif-
ferences of the composers (Rameau and Couperin
sented in a two dimensional histogram with the were French, while Handel and Bach were Ger-
twenty-four major and minor keys arranged in ac- man). This low complexity is consistent with a
cordance with the two-dimensional Tonnetz [2], a characterization of Bach's music as being largely
map of keys shown in Figure 3 in which keys with scalewise in motion, often with simple rhythmic
close harmonic relationship are also nearby geo- organization.
metrically. In this way, keys that are closely re-
lated harmonically are near to each other in our Finally, we have the string quartets of Classical
histogram. When considering collections of pieces, composers Joseph Haydn (1732 1809) and Wolf-
we transpose every piece into the same key | we gang Amadeus Mozart (1756 1791). Haydn's
replace the Tonnetz C major and c minor with the pieces average to a complexity of 1:8860 (standard
harmonic symbols I and i (that is the major chord deviation 0:1693), while Mozart's pieces exhibit a
of the rst note of the key, the minor chord of the mean complexity of 1:9465 (standard deviation 0:1613).
rst note of the key). Taken together, we see a fascinating trend of high
complexity in the early Baroque period, to very
Since the original key of the piece is unimportant in low complexity in the late Baroque, and a very
slight increase in complexity during the Classical the note one octave above the original note.
period. Obviously, much more data are needed to
form any conclusions about the long-term develop- The possibilities of signature patterns are very promis-
ment of complexity and there are also many com- ing. With so much cross-pollination of musical
plicating factors, such as geography. It appears ideas between pieces, if we were to more carefully
that this complexity measure could be useful as a analyze the vast amounts of data, we expect we
scalar descriptor of a piece of music. would nd certain rhythmic or melodic ideas that
are completely unique to a certain composer.
We have applied our signature pattern nders to
each of the aforementioned composers. Our early Finally, we aggregate the harmony distributions of
Baroque composers, Rameau and Couperin, present each composer to generate a major and minor har-
very few signature rhythms amongst their compo- monic landscape for each. These aggregated his-
sitions. Any recurring patterns seldom appear in tograms represent the probability distribution of
more than two pieces and are remarkable for their each harmony for a composer. The relative usage
irregular onset times suggestive of ornamentation of each chord can be easily observed in the his-
and grace notes. Essentially no signature interval- tograms.
lic patterns were found for either composer. This
paints the picture of composers who created variety I
with novel rhythms and melodies, without speci c 0.5

repetition or development thereof. 0.4 IV


vi VI
0.3
The change from the early Baroque period to the 0.2
iii III
VII
late Baroque is noteworthy. While Rameau and iv V vii IV#
Couperin seldom reuse any rhythmic or melodic
0.1
I# i iv#
v
ideas, the studied works of Handel and Bach con- 0 II 6
i# VIb ii
5
tain many rhythmic and melodic patterns used in 1 vib IIIb
4
separate pieces. From 109 keyboard pieces com- 2 iiib VIIb
3
3 viib
posed by Handel, our software located 504 rhyth- 4
2

mic patterns and 633 intervallic patterns repeated 1

between pieces. Some of these signatures were used I


in nearly forty di erent pieces, or almost 40%! The
patterns themselves are quite illuminating. As might
IV
vi

be expected, Bach's favored rhythmic patterns use 0.25


VI
iii III
Student Version of MATLAB

constant eighth or sixteenth note rhythms. His fa- 0.2 V


VII
IV#
vorite melodic patterns are mostly scalewise mo- 0.15 iv i
vii

tion, with the most frequent non-scalewise pattern


iv# 6
v ii II
0.1
taking the form of a simple arpeggio. 0.05 I#
5
VIb
4
IIIb
Classical composers Haydn and Mozart also present 0 i# VIIb
vib 3
hundreds of repeated rhythmic and melodic ideas 1
2
iiib
viib
2
| The two composers speak the same rhythmic 3
1
language. Melodically, however, we begin to see
4

some di erences. Mozart's repeated melodic pat-


terns vary in note length between three and eight Figure 4: The major harmonic landscapes
notes, while nearly all of Haydn's signature melodic of Rameau (top) and Couperin. Note the
patterns are exactly four notes long. Haydn is more steepness of the histograms. Both are heav- Student Version of MATLAB

prone to use simple arpeggios than Mozart as well. ily centered on the home key I.
Finally, we found one curiosity: one of Haydn's fa-
vorite melodic patterns comprises a note, then de-
scending exactly one octave and repeatedly playing As before, we begin with the early Baroque com-
the lower note. Mozart also enjoys this pattern, posers Rameau and Couperin. The most striking
however his version always takes on an ascending feature of the distributions shown in Figure 4, espe-
format: playing one note, then repeatedly playing cially Rameau, is the steepness of the histogram.
The home key (I) accounts for nearly half of the VI
harmonic distribution in Rameau. Distant keys III
VII
are completely unrepresented. Another curiosity
vi IV#
0.4 i iii
iv IV
is the prominence of the major fourth (IV) and the
vii 6
I iv#
0.3 V
absence of the major fth (V). In more modern 0.2
v II 5

music, the major fth is a very important chord I#


VIb
IIIb
ii 4
which is used to exibly move between keys. Pro- 0.1
VIIb

gressions involving the major fourth have a more 0 i#


vib
3

ancient sound. In fact, the fourth is a very impor- 1


iiib viib 2

tant chord in psalms and religious chanting.


2
3 1
4

vi I VI 0.4
0.4 III
IV
iii 0.3 i
VII VI
0.3 V iv III
vi
vii IV# 0.2 IV VII
Student Version of MATLAB
I iii IV#
0.2 iv v V vii
iv# 6 iv#
i 0.1
0.1 II I# VIb IIIb II 6
I# v ii ii
5 VIIb
VIb 0 i# 5
0 vib
i# 4 iiib 4
IIIb 1 viib
vib VIIb 2 3
1 3 3
iiib 2
2 4
viib 2 1
3
4 1

Figure 6: The minor harmonic landscapes


vi VI of Handel (top) and Bach. Note the explo-
0.4
IV I III ration of nearby major keys on the part of
Handel. Observe also that the minor fourth
iii
0.3 VII

(iv) is used much more than the fth (either


V viiStudent Version IV#
of MATLAB Student Version of MATLAB
0.2

V or v).
iv
i iv#
0.1 II 6
I# v ii
5
0 VIb
i#
IIIb 4
1
vib VIIb
3
V or v), revealing that the composers were more
comfortable with an ancient sound in their more
iiib
2
viib
somber pieces. We also see extensive exploration
3 2
4
of nearby major keys.
1

Figure 5: The major harmonic landscapes of Finally, for Haydn and Mozart the distributions
Handel (top) and Bach. Note that the major shown in Figure 7 represent a more modern sound,
fth (V) and the major fourth (IV) now rival as the major fth (V) has nally overtaken the ma-
jor fourth (IV) in usage. There is also exploration
Student Version of MATLAB

each other in usage. Observe also that the


distributions are less heavily centered on the of many nearby keys, most prominently the minor
home key (I). second (ii) and the relative minor (vi) again.
The minor harmony distributions of Haydn and
Investigating the late Baroque major-key works of Mozart (Figure 8) are remarkable for being very
Handel and Bach, we begin to see some develop- spread out. In particular, Haydn spends almost
ment in the distributions shown in Figure 5. The as much time in the relative major (III[ ) as in the
major fth (V) and the major fourth (IV) now rival home minor key (i). We begin to also see the mod-
each other in use. There is more exploration of dis- ern practice of using the major or dominant fth
tant keys, in particular the minor second (ii) and (V) in minor compositions rather than just major
the relative minor (vi) are becoming prominent. compositions.
In minor pieces, we nd some more surprising re-
sults. As seen in Figure 6, the minor fourth (iv) is
again used signi cantly more than the fth (either
i VI
VI I 0.2
vi III iv vi III
0.4 iii VII VII
IV IV# 0.15 IV iii V
V I
vii vii IV#
0.3 iv# 6 0.1 IIIb v
VIb iv#
iv II II
0.2 5 I# VIIb ii 6
i ii 0.05
v
5
0.1 I# 4 0 i# vib
VIb
IIIb iiib 4
0 i# VIIb 3 1
vib viib 3
iiib 2
1 viib 2
2 3 2
3 1 4
4 1

0.4

vi VII 0.3
i
III
0.4 IV iv VI
iii V VII 0.2 vi
IV# III
0.3 vii
Student Version of MATLAB IV Student Version of MATLAB
iii VII
iv# 6 0.1 I V
VIb vii IV#
0.2 iv II I#
i 5 v iv#
v ii 0 i# IIIb II 6
0.1 I#
VIb 4 vib ii
1 5
i# IIIb iiib VIIb
0 VIIb 3 4
vib 2 viib
iiib 3 3
1 2
2 viib 2
4
3 1
4 1

Figure 7: The major harmonic landscapes Figure 8: The minor harmonic landscapes of
of Haydn (top) and Mozart. Note the in- Haydn (top) and Mozart. Note the growing
creased prominence of the major fth (V) prominence of the major fth (V) and the Student Version of MATLAB

and the extensive exploration of nearby


Student Version of MATLAB
use of nearby major keys.
keys.
researchers to search an entire collection of works
for speci c rhythmic, melodic, or harmonic pat-
The focus of this research has been to develop ex- terns of interest. If one does not have a speci c
ible tools to simplify further research. The MAT- target in mind, the programs can adaptively cre-
LAB programs we developed for this purpose can ate these targets from the pieces themselves. This
be found at [10]. We believe we have succeeded allows us to very easily and quickly catalog even
in this aim and have only conducted preliminary the subtlest patterns of a composer within a piece.
inquiries with the tools to test their usability. The
potential for further study is both wide and fasci- The signature pattern nders are more promising
nating. still. By supplying the programs with ever more
pieces by the same composer, we can say with more
The calculation of the complexity of a piece is ex- and more con dence which patterns were preferred
ceedingly simple and quick, because repeated nested by that composer. As noted above, signature pat-
loops are not required as for the signature pat- terns could be invaluable in distinguishing between
tern nders. Running many pieces through the two similar composers such as Haydn and Mozart.
program, we can formulate a better idea of the
changes in complexity over time, as we began to see The algorithm for nding the chord of best t can
above. Additionally, small adjustments of the pro- be improved. Currently, it can only identify the
gram allow us to compare the complexity of each twenty-four major and minor keys. More modern
individual voice or only the melodic entropy. We music frequently uses other chord qualities, notably
could also consider harmonic entropy using the dis- chords of four notes. Most important among these
tribution of the twenty-four major and minor har- is the dominant seventh chord (given by the inter-
monies. vals: major third, minor third, minor third). A
similar psychological study to that of Krumhansl
The pattern nder tools can be adjusted to allow and Kessler [3] could be used to create reference
distributions for other chord qualities than the twenty and developments.
four major and minor chords. This would allow
more precision in our harmony identi cation (as it
is, dominant chords tend to manifest as either the [1] Bartlett, David. \The Mathematics of Tuning
major chord that makes up the bottom half of the and Temperament With audio examples."
chord or the minor chord that makes up the upper Acoustics, Music & Sound. 1998. 3 Oct. 2011.
half). http://www.pyxidium.u-net.com/
Acoustics/MusicMaths/MusicMaths.html.
A potential goal for the future would be the care- [2] Christensen, Thomas, ed. The Cambridge
ful collection of reference data from many di er- History of Western Music Theory.
ent composers. From this, we hope to be able to Cambridge: Cambridge University Press,
correctly guess the era or composer of a mystery 2002.
piece. Given an unknown MIDI le, we can calcu- [3] Kruhmhansl, Carol L., and Kessler, E. J.
late its complexity, nd any repeated patterns, and \Tracing the dynamic changes in perceived
generate its harmonic landscape. Each of these de- tonal organisation in spacial representation of
scriptors can then be compared to our collection musical keys." Psychological Review 89
of reference data to nd the best match for era or (1982): 334-368
composer. [4] Krumhansl, C. L., and Toiviainen, P.
\Measuring and modeling real-time responses
Two further questions might explore the social and to music: Tonality induction." Perception 32
geographic development of western music. Presently, (2003): 741-766.
we have only endeavored to note the changes in
complexity, signature patterns, and harmonic con- [5] Madsen, Soren Tjagvad, and Widmer,
struction over time. Another avenue of inquiry Gerhard. \Towards a Computational Model
would be to study how these variables change geo- of Melody Identi cation in Polyphonic
graphically in the same time period. Does Classi- Music." Proceedings of the 20th International
cal French music have a di erent characteristic har- Joint Conference on Arti cial Intelligence
monic distribution than Classical Germanic music? (IJCAI 2007) (2007).
[6] Liu, Yi-Wen, and Sapp, Craig. \The
Historically, some composers, such as Bach, were Haydn/Mozart String Quartet Quiz." 4 Oct.
known to compose pieces on commission. These 2011. http://qq.themefinder.org/.
pieces often took the form of expansions or vari- [7] \Musicology." The Columbia Electronic
ations on a previously existing melody and were Encyclopedia. 2007.
composed rather quickly. We wonder if we can dis- [8] \Tutorial: History of MIDI." MIDI
tinguish between these commissioned pieces and Manufacturer's Association. 2011. 2 Oct.
pieces composed over a long period of time with 2011. http://www.midi.org/aboutmidi/
the complete attention of the composer. Might tut_history.php.
these uncommissioned pieces contain more com- [9] Most midi les used in this work were
plex musical ideas or more signature touches? Per- obtained at http://www.kunstderfuge.com
haps they would contain more adventurous har- and http://qq.themefinder.org/
monic ideas? [10] The suite of matlab programs we developed
for this project can be downloaded from
We are also interested to apply our programs to http:
modern popular music. The MIDI les are readily //people.kzoo.edu/barth/music_matlab
available for most popular songs of the past fty
years. Many popular music software today such as
Apple's Genius and Pandora Internet Radio have
features which suggest artists considered similar to
other musical artists. Our musical analysis pro-
grams could provide quantitative comparisons be-
tween two di erent artists or two di erent songs.
Overall, the current work shows great promise and
suggests many further applications, re nements,

You might also like