Tuesday, August 10, 2010

Two C Major Preludes

In an earlier post, I briefly described a computational method that can be used to classify and visualize perceived tonality in a piece of music.  I'm interested in using techniques like this to extract mathematical information from musical compositions.

Here I will look at two piano works:  The C major prelude from Book 1 of  J. S. Bach's Well Tempered Clavier, and the C major prelude from Shostakovich's  24 Preludes and Fugues, opus 87.  The story is often told that Shostakovich composed this work after being inspired by Bach's W.T.C. during a  1950 commemoration of  the 200th anniversary of Bach's death .

Separated by two hundred years, it is easy to discern that these two pieces are harmonically very different from one another.  I am curious to quantify that difference in some way.

Here is a video showing the tonality map along with a performance of the Bach prelude:





And a corresponding video for the Shostakovich prelude:




In these visualizations, what characteristics distinguish the pieces from one another?  The Shostakovich features a wider variety of tonal centers, tonal centers which are sometimes less distinct --  less pronounced dark red  regions on the map, and tonal centers that move by greater distances from measure to measure.  This last point suggests a way to characterize the harmony of the pieces:  the distribution harmonic distance.  Here is a plot that shows the harmonic distance, measured on the tonality map, for the  Bach and Shostakovich pieces.
It is striking that distances 5, 7, and 9 are especially pronounced in the Bach prelude.  These distances on the tonality map correspond, for the most part, to  occurrences of the  ii7 -- V7 -- I  sequence of chords.  This harmonic cadence establishes a tonality in the I key very strongly.   The Shostakovich harmonies avoid this progression.  This comes as no surprise to the listener, who clearly  gets a weaker sense of tonality and systematic modulation between tonal centers.

Monday, August 9, 2010

Percussion Instruments

A version of the following will appear in the 2011 volume "Encyclopedia of Mathematics in Society".



Percussion instruments are characterized by vibrations initiated by striking a tube, rod, membrane, bell, or similar object.  Percussion instruments are almost certainly the oldest form of musical instrument in human history.  The archeological record of percussion instruments, in particular the bianzhong bells of ancient China, give clues to the history of music theory.   From a mathematical point of view, percussion instruments are of special interest because unlike other types of instruments such as strings and winds, the resonant overtones typically do not follow the harmonic series. (See Harmonics entry in this volume.)   In the last fifty years, a question of great interest in applied mathematics has been the famous inverse problem:  Can one hear the shape of a drum? 

Rods and Bars

Some percussion instruments produce a distinct pitch by the vibration of a rod or bar.  Examples included the tuning fork (a U-shaped metal rod suspended at its center), a music box (a metal bar suspended at one end) and the melodic percussion instruments such as the xylophone and marimba (suspended at two non-vibrating points or nodes along the length of metal or wooden bars).   Like vibrating strings, the frequency of the bar’s vibration, and hence the pitch of the musical sound it produces, are determined by its physical dimensions.  In contrast to the string, in which the frequency varies inversely with the length, the vibrating bar has a frequency that varies with the square of the length.  The resonant overtone frequencies fn of the vibrating bar are related to the fundamental frequency f1 by the formula
fn = a(n+1/2)2 f1,
where the constant a is determined by the shape and material of the bar.  In contrast with the harmonic overtone series of vibrating strings
fn = n f1,
these inharmonic overtones give percussion instruments their distinct metallic timbre.  The overtones of vibrating bars decay at different rates, with rapid dissipation of the higher overtones responsible for the sharp, metallic attack, while the lower overtones persist longer. The bars of the marimba are often thinned at the center, effectively lowering the pitch of the certain overtones, in accord with the harmonic series.

Bells

Like the vibrating bar instruments, the classic church bell possesses highly non-harmonic overtones.  These are typically tuned by thinning the walls of the bell along the circumference at certain heights.  A distinctive feature in the sound comes from the fact that apart from the fundamental pitch, the predominant overtone of the church bell sounds as the minor third above the prevailing tone.  This accounts for the somber nature of the sound.

The bianzhong bells of ancient China were constructed in a manner that produced two pitches for each bell, depending on the location at which it was struck.   In the 1970s, a set of 65 such bells were discovered during the excavation of the tomb of Marquis Yi  in Hubei Provence.  The inscriptions on the bells make it clear that octave equivalence and scale theory were known in China as early as 460 BCE.

Membranes

Drums are perhaps the most common percussion instrument.  Consisting of vibrating membranes (the drum heads) stretched over one or both ends of a circular cylinder, drums exhibit a unique mode of vibration which accounts for their characteristic sound.  Mathematical models of vibrating drumheads provide a fascinating application of partial differential equations.  The inharmonic overtone frequencies are distributed more densely than for vibrating strings or rods.  Further, each overtone is associated with a particular vibration pattern of the drum head.  These regions can be characterized by the  non-vibrating curves (nodes) that arrange themselves in concentric circles and diameters of the drum head. 

An important question in the study of partial differential equations asks “Can one hear the shape of a drum?” That is, can mathematical techniques be used to work backwards from the overtone frequencies to determine the shape of the drum head that caused the vibration?  The answer, as it turns out, is “not always”.


FURTHER READINGS:

Cipra, Barry.  ”You Can’t Always Hear the Shape of a Drum” in What’s Happening in the Mathematical Sciences, volume 1. New Haven: American Mathematical Society, 1993. 

Jing, M.A Theoretical Study of the Vibration and Acoustics of Ancient Chinese Bells.”
Journal of the Acoustical Society of America.  (v.114/3, 2003).

Rossing, Thomas, D. The Science of Percussion Instruments. Hackensack, NJ: World Scientific, 2000

Sundberg, Johan. The Science of Musical Sounds. San Diego: Academic Press, 1991

Wind Instruments

A version of the following will appear in the 2011 volume "Encyclopedia of Mathematics in Society".


Wind instruments convert the energy of moving air into sound energy --- vibrations that are perceptible to the human ear.  Under this definition, wind instruments include the human voice, pipe organs, woodwind instruments such as the clarinet, oboe, and flute, and brass instruments like the trumpet.  The nature of this vibration and of the associated resonator tube are responsible for the unique timbre of each type of wind instrument.

The sources of vibrations

In the human voice, the flow of air from the lungs causes the vocal cords (also called vocal folds) in the larynx to open and close in rapid vibration.  This periodic stopping of the air stream creates oscillatory pulses of air pressure, or sound.  The frequency of this vibration and thus the pitch of the resulting sound are determined by the length and tension of the cords.  The singer controls these factors using the musculature of the larynx. 

The rapid open-close vibration of the vocal cords is present in many wind instruments.  In brass instruments such as the trumpet, trombone, French horn and tuba, the lips of the performer form a small aperture that opens and closes in response to air pressure.  These are sometimes called lip-reed instruments.  In single-reed instruments like the clarinet and saxophone, a thin cane reed vibrates in oscillatory contact with a specially shaped structure (the mouthpiece) to bring about the open-close effect.  .  The oboe and bassoon utilize two cane reeds held closely together with a small space between them that opens and closes in response to flowing air, controlled by the muscles of the lips. 

A third important mechanism for converting the energy of moving air into vibration utilized in the flute and the so-called flue pipes of the pipe organ.  In these instruments vibration occurs when flowing air passes over an object with a distinct edge that splits the airstream.  The resulting turbulence gives rise to oscillatory vibration. In the modern flute, the performer’s lip muscles actively control the interaction between the airstream and the edge.  In the recorder and other whistle-type instruments, as well as flue pipes of the organ, this is controlled by the mechanical design of the instrument alone.

Tube resonators and overtones

With the exception of the human voice, all of the wind instruments described above are constructed with a tube resonator enclosing a column of air that functions in much the same way as the vibrating string.  Oscillations in air pressure inside the tube reflect from the ends, resulting in significant feedback with the primary vibrating medium. In the Harmonics entry in this volume, the relationship between the vibration frequency and length of a string fixed at both ends is explained.  In that idealized setting, changing the string length by small integer factors (1/2, 1/3, 1/4,  for example) results in frequency changes that are recognizable as musical intervals (an octave, an octave plus a fifth, two octaves, respectively).  The resonating air column in wind instruments behaves similarly to a vibrating string.

An important performance practice on most wind instruments is overblowing. Not to be confused with simply playing overly loudly, overblowing refers to the fact that changes in the airflow can cause  the resonating air column to vibrate at an overtone above its fundamental frequency.  This allows performers on modern instruments to achieve a large range of pitches (often two octaves or more) from a relatively compact resonating tube.  Instruments with cylindrical tubes open at both ends (e.g. the flute) overblow at the octave, as do conical instruments that are closed at one end such as the oboe and saxophone.  On the other hand, cylindrical tubes closed at one end (such as the clarinet) overblow at the twelfth:  an octave plus a fifth.   The relative weakness of the overtone at the octave and other even-numbered overtones account for the particular timbre of the clarinet.

Altering the tube length in performance

Just as the length of a vibrating string determines the frequency/pitch of the vibration, the length of the resonating air column accounts for the pitch of notes played by a wind instrument.  In reed instruments, the resonating tube is perforated along its length with holes.  By systematically covering some of these holes but not others, the performer effectively changes the length of the resonating column.  This in turn causes the vibrating reed assembly to assume the frequency of the air column.   Most brass instruments have secondary lengths of tubing which are brought into play by mechanical valves by which the performer alters the length, and hence the fundamental frequency of the vibrating air column.  The exception to this is the slide trombone, which features a concentric tube arrangement by which the outer tube can move to lengthen the air column resonator.



FURTHER READINGS:

Sundberg, Johan. The Science of Musical Sounds. San Diego: Academic Press, 1991

Wood, Alexander. The Physics of Music, seventh edition. London: Chapman and Hall,  1975

Sunday, July 4, 2010

How we perceive chords






Over the last two decades, the work of psychologist Carol Krumhansl has illuminated the way we hear musical harmony.  Using the technique of Krumhansl and Petri Toiviainen, I've made this video.  All twenty four major and minor tonal centers are represented regions in this plane.  Starting with a midi file of the Bach G major prelude from the cello suites, I generated the images---one per measure.  The red regions correspond to the perceived tonal center, based on the Krumhansl's data.  I then matched the images to a performance of the prelude by Mstislav Rostropovich.

Tuesday, June 15, 2010

Futbol Sounds

Was there ever a less melodious B flat than the drone of the vuvuzela throughout the World Cup matches this year?

Vuvuzela Sound Clip

The BBC is considering filtering the sound from its broadcasts.

You can see in the spectrum plot that the peaks approximately follow the harmonic series from the fundamental pitch of B flat below middle C (228 Hz): an out of tune octave above (440Hz), about fifth above that (629 Hz), another B flat (907 Hz), then D a third above that (1191 Hz).

A  mathy workaround for television viewers is described in
this short article from  Gizmodo about the vuvuzela.

Using the notch filter in Audacity, here are the results of removing the overtones one at a time:
Original sound clip
Fundamental removed
Two overtones removed
Three overtones removed

The remaining buzz seems to be a bunch of non-harmonic noise that is not so easily filtered out.

Monday, May 31, 2010

Geometry of Music

A version of the following will appear in the 2011 volume "Encyclopedia of Mathematics in Society".

Geometry is the study of shapes.  Musical information can often be represented naturally by shapes, allowing insights to be gained from geometric techniques.   One indication of the close connection between music and geometry comes from the fact that Euclid, whose Elements of Geometry (300 B.C.E)  is the founding document of modern geometry, also wrote a comprehensive treatise on the mathematics of musical pitches called Theory of Intervals.  The great 18th century mathematician Leonhard Euler also developed geometric tools for music analysis.

Symmetry is one of the most powerful ideas in geometry.  No less so in the geometry of music, where symmetries abound.  Geometric techniques can be applied to musical scales, chords, and melodic lines.   Due to the concept of octave equivalence, the twelve pitches of the equally tempered chromatic scale are inherently cyclic in nature.  Thus the geometric theory of cyclic groups plays a major role in the mathematical description of scales and chords. 
Similarly, geometry can play a role in the analysis of musical rhythm, particular in musical forms based upon a repeating rhythmic motif.  In twentieth century atonal music, geometric ideas have been proposed as unifying theoretic structures to fill the role once played by tonal harmonic concepts. 

Symmetries in the Twelve Pitches of the Equally Tempered Scale

Two fundamental principles of modern musical analysis are octave equivalence and equal temperament.  Octave equivalence refers to the perception, believed to be universal in developed music cultures, that two pitches separated by an octave are members of the same pitch class.  Equal temperament refers to the system of musical intonation by which the twelve chromatic half steps within the octave represent uniform frequency scaling:  given a pitch with frequency f, the pitch one half step above has frequency 21/12 f.    In the equally tempered scale, enharmonically spelled notes such as C# and Db represent the same pitch. 

The twelve pitch classes are inherently cyclic.  This is represented in the left view of Figure 1.  Notice that this is identical to an analog clock face, with the traditional “12” replaced by “0”.   The diatonic scale (discussed in the Scales entry of this volume) is represented by the vertices of the inscribed polygon in the center view of Figure 1.  This arrangement of the seven diatonic pitches is the most even spacing possible for seven pitches in the twelve tone octave.  The evident symmetry about the 2—8 axis puts the complicated diatonic sequence of half steps and whole steps into a simpler conceptual framework. The figure illustrates that the Dorian Mode (which begins and ends on the second diatonic scale degree, given here as “D” or “2”) is unique among the diatonic modes in that it follows the same sequence of intervals both ascending and descending.

The six pairs of diametrically opposite pitch classes in the clock representation are separated by the interval of a tritone, so named because it contains three whole steps. In tonal music, the tritone is considered the most dissonant-sounding interval.  If the three odd numbered pitch class pairs on the clock face are reflected diametrically, the result is the circle of fifths shown in the right view of Figure 1.  The circle of fifths is familiar to music students as a mnemonic device for learning the musical key signatures:  the number of sharps increases by one (or alternatively, the number of flats decreases by one) at each step in the clockwise direction, while the number of flats increases (or sharps increase) at each step in the counterclockwise direction.   The circle of fifths is used extensively as an analytical tool for twentieth century music in the work of the American composer and music theorist Howard Hanson.



Figure 1 Top: The twelve pitches of the equally tempered chromatic scale arranged on a circle.  Center: The vertices of the inscribed polygon represent the pitches of the diatonic scale.  The diatonic arrangement is the most evenly spaced distribution of seven vertices in a twelve-sided figure.  Note the symmetry inherent in the Dorian mode, which begins and ends on pitch 2 (D).  Bottom: Diametric reflection of the odd numbered pitches results in the circle of fifths.

Tonnetz:  Representing Harmonic Structure in Two Dimensions

Beginning with the musical writings of the 18th century mathematician Leonhard Euler, and continuing at least through the work of the influential music theorist Hugo Riemann (not to be confused with the mathematician Bernhard Riemann) in the 19th century, the representation of harmonic concepts in a two dimensional array called a Tonnetz (Tonal Network) has guided the understanding of tonal harmony.  In the tonnetz shown in Figure 2, the rows are simply the entries of the circle of fifths, while the columns are the twelve diatonic pitch classes arranged chromatically (by half steps).  The result is that the diagonals are made up of pitch classes separated by minor thirds (in the southeast direction) and major thirds (northeast).  In this arrangement, the sonorities of tonal harmony can be represented by polygonal groupings of the adjacent symbols:  triangles for major and minor triads, parallelograms for major and minor seventh chords, and similar structures for diminished, augmented and dominant seventh chords.  The musical theory of modulation (changing from one tonal center to another in the course of a musical composition) is aided by the geometric perspective of a tonnetz.  Tonal networks such as the one shown here are precursors of the contemporary musical theory of pitch class spaces.



C      G      D      A      E       B     F#     Db    Ab    Eb    Bb         F         C
     Eb    Bb    F      C      G      D      A       E       B     F#      Db     Ab
B       F#    Db   Ab    Eb    Bb     F      C       G      D      A         E          B
      D      A      E       B      F#    Db   Ab    Eb    Bb     F        C          G  
 Bb      F      C       G      D      A       E     B     F#    Db    Ab      Eb        Bb
      Db    Ab    Eb     Bb     F       C     G      D     A       E        B        F#      

Figure 2  The first six rows of a Tonnetz (or Tone Network).  The pitch classes of the circle of fifths are arranged horizontally.  The vertical alignment of the pitch classes is chromatic.  Diagonals in the southeast direction progress by intervals of the minor third.  Northeast diagonals progress by major thirds.  All tonal sonorities are given in this representation by polygons containing adjacent pitches.  For example, major triads are given by triangles with vertex at top and minor triads are given by triangles with a vertex at the bottom, as shown above for the C major (C E G) and A minor (A C E) triads. 


Rhythmic Symmetry

Like the twelve pitch classes, the metrical organization of music in time is also highly cyclic, allowing similar geometric techniques to be applied to rhythm.  The left view of Figure 3 shows the eighth-note subdivisions of a 4/4 measure.  The vertices of the inscribed polygon represent the rhythmic placement within the measure of the hand-clap rhythm from the iconic 1956 Elvis Presley recording of “Hound Dog”.  This complicated rhythm has a simple symmetric structure when viewed geometrically.  Similarly, the center view in Figure 3 shows the clave rhythm familiar to listeners of Afro-Cuban music, with its line of symmetry.  The left view of Figure 3 shows a characteristic bossa nova rhythm (which can be heard on the cowbell in Quincy Jones’s “Soul Bossa Nova”) and its line of symmetry.



Figure 3  Eighth-note subdivisions of rhythmic units arranged around a circle.  Top: The vertices of the inscribed polygon represent the hand-clap rhythm heard in the Elvis Presley recording of “Hound Dog”.  Center: The vertices of the inscribed polygon represent the well-known clave rhythm heard in Afro-Cuban music.  Bottom: The bossa nova cowbell rhythm heard in Quincy Jones’s “Soul Bossa Nova”.

FURTHER READINGS:

Archibald, R.C. “Mathematicians and Music.” American Mathematical Monthly, (v. 31/1, 1924).

Buena Vista Social Club. The Buena Vista Social Club, Nonesuch, 1997

Demaine, E. D., Gomez-Martin, F., Meijer, H., Rappaport, D., Taslakian, P., Toussaint, G. T., Winograd, T., and Wood, D. R. “The Distance Geometry of Music,” Computational Geometry: Theory and Applications, (v. 42/5, 2009).

Hanson, Howard.  Harmonic Materials of Modern Music: Resources of the Tempered Scale.        New York:  Appleton, 1960

Johnson, Timothy. Foundations of Diatonic Theory: A Mathematically Based Approach to Music Fundamentals, Lanham, Maryland:  2008

Jones, Quincy. The Reel Quincy Jones, Hip-O Records, 1999

Nolan, Catherine. “Music Theory and Mathematics,” in The Cambridge History of Western Music Theory, ed. Thomas Christensen.  Cambridge:  Cambridge University Press, 2002

Presley, Elvis.  Elvis 75, RCA/Legacy, 2010





Composing

A version of the following will appear in the 2011 volume "Encyclopedia of Mathematics in Society".

Throughout the history of western music, composers have utilized mathematical techniques in creating musical works.  From Pythagoras, Plato, and Ptolemy in ancient Greece to the sixth century music theorist Boethius, music was thought to be a corollary of arithmetic.  With the widespread development of written musical notation beginning in the Renaissance Age, compositional craft became more and more highly developed.  Especially prized were compositions intertwined with mathematical patterns.  The eighteenth century composer and theorist Jean-Philippe Rameau was unequivocal in his views on the connection between mathematics and music in his 1722 Treatise on Harmony: “Music is a science which should have definite rules; these rules should be drawn from an evident principle; and this principle cannot really be known to us without the aid of mathematics.”  With fugal composition techniques in the high baroque period, mathematical techniques in musical composition reached a high point. The classical and romantic eras, characterized by a movement away from polyphonic music, produced less obvious mathematically oriented composition technique.  In the twentieth century however, mathematical formalisms were fundamental as replacements for the outdated tonal structures of the romantic era.

The Renaissance Canon

During the Renaissance Age, as musical craft was becoming highly prized, mathematical devices were developed to a considerable degree by Northern European composers. In the canons of Johannes Ockeghem a single melodic voice provides the basis by which one or more additional voices are composed according to various mathematical transformations of the original: mirror reflection of musical intervals (inversion), time translation, mirror reflection in time (retrograde), or a non-unit time scaling (mensuration canon).  Composers of this period understood the word canon to mean a rule by which secondary voices could be derived from a given melody, in contrast to our modern usage of the word meaning a simple duplication with later onset time, as in the nursery rhyme round “Row, Row, Row Your Boat”.

Bach: The Canon Master

J.S. Bach was undoubtedly a master of canonic composition.  Bach’s canons challenged performers to solve puzzles he set before them.  Examples abound in A Musical Offering (BWV 1079), a collection of pieces written for King Frederick the Great of Prussia in 1747.  At that time, Frederick was the employer of Bach’s son C.P.E. Bach.   The first of two Canon a 2 (canon for two voices) from Musical Offering appears to be written for a single voice, but with two different clef symbols: one at the beginning of the first measure, and one at the end of the last.  The canon, then, is to be performed with one voice reading from beginning to end, the other voice reading from end to end.  In this small piece, Bach provides an example of retrograde or cancrizan (crab) canon.  The puzzle in the second Canon a 2 is even more cleverly concealed:  a single line with two clef signs in the first measure, one upside down.  The cryptic instruction Quaerendo invenietis "Seek and ye shall find” is inscribed at the top of the manuscript. After deducing that the second, inverted clef sign indicates that the second voice of the canon is to proceed in inversion, the performer is left to “seek” the appropriate time translation at which the second voice should begin.

Other examples of Bach’s masterful canonic treatment are BWV 1074: Kanon zu vier Stimmen, which with its numerous key signatures, clefs, and repeat signs can be played from any viewing angle, and BWV 1072: Trias Harmonica, a single line of manuscript that when fully realized yields an eight-voice canon.


A late example of the technical canonic craft is the Der Spiegel-Duett (mirror duet) for two violins, attributed to Mozart, which maintains the retrograde inversion transformation for its entire 63 measures.  An example of table canon, the sheet of music for this piece is placed on a table between two violinists.  The players read the music from opposite sides:  one right side up from beginning to end, and the other upside down from end to beginning.  The musical artistry in this mechanistic device lies in the harmonic consistency that is maintained throughout the work.

A General Representation of Mathematical Transformations in Composition

A musical composition can be represented as a sequence of points from the module M over the cyclic groups of integers Zp:
M = Zp1 ×  Zp2  ×  Zp3 ×  Zp4

with the coordinates representing (respectively) onset time, pitch, duration, and loudness.  For example, the twelve notes of the chromatic scale would be represented in the second coordinate by Z12.   In this schematic, a point  (x1, x2, x3, x4)  in a musical motif  would be represented as (x1+a, x2, x3, x4+β) in a later repetition of that motif at a different volume level.  Similarly, a point in the transposed motif would be (x1, x2+a, x3, x4).  Retrograde is represented as (μ-x1, x2, x3, x4).  Inversion takes the form (x1, 2a-x2, x3, x4).  Mensuration, as in the canons of Ockegham, is written (x1, x2, a×x3, x4).  Transformations of this form were used extensively in the Renaissance and Baroque eras and, as we will see, played a fundamental role in post-tonal era of the twentieth-century.

Mathematical Structure in Atonal Music

At the turn of the twentieth century, as musical composition moved further from traditional concepts of tonality, music theorists and composers looked for new organizing principles on which atonal music could be structured.  Older formalisms emphasized tonal center, repetition and development of themes.  In a conscious movement away from such notions, the groundbreaking composer Arnold Schoenberg turned to the idea of serialism, in which a given permutation of the twelve chromatic pitches constitutes the basis for a composition.  The new organizing principle called for the twelve pitches of this tone row to be used, singly or as chords at the discretion of the composer, always in the order specified by the row.  When the notes of the row have been used, the process repeats from the beginning of the row.  Composers like Webern, Boulez, and Stockhausen consciously used geometric transformations of onset time, pitch, duration, and loudness as mechanisms for applying the tone row in compositions.  In the latter half of the twentieth century, set theoretic methods on pitch class sets dominated the theoretical discussion.  Predicated on the notions of octave equivalence and the equally tempered scale, Howard Hanson and Allen Forte developed mathematical analysis tools that brought a sense of theoretical cohesion to seemingly intractable modern compositions. 

Another mathematical approach to composition without tonality is known as Aleatoric Music, or chance music.  This technique encompasses a wide range of spontaneous influences in both composition and performance.  One notable exploration of aleatoric music can be seen in the stochastic compositions of Iannis Xenakis from the 1950s.  Xenakis’s stochastic composition technique, in which musical scores are produced by following various probability models, was realized in the orchestral works “Metastasis” and “Pithoprakta” which were subsequently performed as ballet music in a work by George Ballanchine.



FURTHER READINGS:

Beran, Jan. Statistics in Musicology. Boca Raton: Chapman & Hall/CRC, 2003.

Forte, Allen.  The Structure of Atonal Music.  New Haven:  Yale University Press, 1973

Grout, Donald Jay. A History of Western Music. New York: Norton, 1980.

Xenakis, Iannis. Formalized Music: Thought and Mathematics in Composition.   Hillsdale, NY: Pendragon Press, 1992

Harmonics

A version of the following will appear in the 2011 volume "Encyclopedia of Mathematics in Society"

Harmonics are components of a musical sound with well-defined frequency relationships to one another. For a pitch of frequency f, typically measured in units of cycles per second or Hertz (Hz), the nth harmonic has frequency n × f.   In this context the frequency f  is referred to as the fundamental frequency.  Harmonics are closely related to overtones (or equivalently partials), which are defined to be secondary pitches that audibly resonate when a fundamental pitch sounds.  The number and strength of these secondary pitches are responsible for the distinct timbres perceived in different instruments or voices.  The Overtone Series in music (also called the Harmonic Series at the risk of confusion with the infinite sum of the same name) refers to the sequence of ascending harmonics with frequencies f, 2f, 3f, 4f….  With only a few exceptions, the pitches of the lower harmonics match well with the frequencies of twelve pitches of the equally tempered scale.   Further along the overtone series, the pitch spacing becomes very small --- smaller than the traditional half step --- and these upper harmonics, if heard, would sound distinctly out of tune.  With the discovery of the overtone series by Jean-Philippe Rameau in the eighteenth century, the notion of musical consonance as the exclusive natural and rational sonic phenomenon --- pursued by mathematicians from Pythagorus to Euler --- began to fade.  There is a close physical relationship between the harmonic frequencies and the length of the vibrating medium.  This is exploited in the performance practices of musical instruments.  

Vibrating Media and the Overtone Series

For vibrating strings (e.g. violins and guitars) and open vibrating air columns (the western concert flute and some organ pipes) the words harmonic, partial, and overtone are essentially synonymous, with a slight difference in the enumeration:  the  fundamental pitch (frequency f ) is referred to as the 1st harmonic.  The first overtone (frequency 2f ) refers to the 2nd harmonic, etc. In stopped air columns (the clarinet and some organ pipes), the overtone series omits certain harmonic frequencies.  For vibrating membranes (percussion instruments), overtones may exist at non-harmonic frequencies. 

It is therefore a slight abuse of terminology to refer, as is commonly done, to the sequence of harmonics as the overtone series. Physically, the overtone series is seen by observing the motion of a vibrating string of length L and natural frequency f.  If forced to vibrate at frequencies n × f (for n = 2,3,…) , n-1 stationary points (nodes) appear along the string, at intervals of L/n.  In effect, the string moves as n strings of length L/n joined end to end.  String performers utilize this fact by lightly stopping the string at lengths L/2, L/3, etc to produce flute-like harmonic tones (sometimes called flageolet tones).

From the overtone perspective, only lower harmonics are perceptible to the hearer of a fundamental pitch.  The first six harmonics are perceived by the modern hearer as in tune within the twelve pitches of the equally tempered scale, in which the octave (the distance between the first and second harmonic) is divided into 12 equal half step intervals.  The frequency difference between successive pitches in this twelve-tone system is given by fn+1= 21/12 fn.  The 2nd, 4th, 8th, harmonics, at octaves above the fundamental, sound perfectly in tune..  Upper harmonics can sound significantly out of tune however.  The 7th harmonic sounds uncomfortably flat compared to its nearest corresponding equal temperament pitch.  The 11th harmonic has a frequency almost equidistant between adjacent notes of the equally tempered scale, causing it to sound very out of tune --- likewise for the 13th and 14th harmonics.  These considerations are significant for period instrument brass performers, whose instruments, like the so-called natural trumpet, are nothing more than long tubes without the length-changing system of valves of modern trumpets.  Performers play tunes on these instruments by producing overtones, typically between the 3rd and 16th in the series.  While skillful performers can compensate for the most problematic overtones, composers in the baroque era typically avoided these notes or used their sonic character for special effect.  Modern composers have experimented with specially tuned pianos and electronic instruments to directly explore the sonorities of harmonics.

The first twenty-four harmonics are listed in the table with fundamental pitch taken as the A below middle C.  Harmonics with frequencies that differ significantly from the equally tempered scale are indicated in bold.

Other uses of the word Harmonic in Mathematics

In mathematics, the word harmonic appears in a number of contexts, all of which trace their origins to the overtone series and associated physical vibrations.  A harmonic progression is defined as the term by term reciprocal of an arithmetic progression.  For example, the arithmetic sequence a1=1, a2=2, a3=3, … gives rise to the harmonic sequence h1=1, h2=1/2, h3=1/3, ... . In this example, the arithmetic sequence gives the frequency multiples for the overtone series, and the harmonic sequence corresponds to the wavelengths of the respective overtones.  The harmonic mean is the reciprocal of the arithmetic mean of reciprocals.  For example the harmonic mean of two numbers x and y is defined as 2(1/x + 1/y)–1.    The harmonic series in mathematics is the infinite sum 1+1/2+1/3+…, providing the canonical example of a series whose terms approach zero, but nevertheless the sum diverges. The harmonic oscillator is a differential equation whose solutions are sinusoidal functions that can be used to model musical sounds.  Harmonic analysis is the study of functions (or signals) by decomposition into fundamental component functions by means of the Fourier transform or other techniques. In the study of complex variables, harmonic functions are generalizations of the sinusoidal functions that model fundamental vibrations.



FURTHER READINGS:

Cohen, H.F. Quantifying Music:  The Science of Music at the First Stage of the Scientific Revolution, 1580—1650. Dordrecht: D. Reidel Publishing Company, 1984

Gouk, Penelope. “The Role of Harmonics in the Scientific Revolution,” in The Cambridge History of Western Music Theory, ed. Thomas Christensen.  Cambridge:  Cambridge University Press, 2002

Johnston, Ben.  Suite for Microtonal Piano. Robert Miller, piano; New World Records, 80203-2.

Sundberg, Johan. The Science of Musical Sounds. San Diego: Academic Press, 1991


Scales


A version of the following will appear in the 2011 volume "Encyclopedia of Mathematics in Society"

Western music is based on a system of twelve pitches within each octave.  The interval between adjacent pitches in this twelve-tone system is called a half step or semitone.  Pitches separated by two successive semitones are said to be at the interval of a whole step, or a tone.  Based on a variety of theoretical underpinnings, the concept and sound of tones and semitones have evolved throughout the history of western music.  In modern music practice, a uniform division of the octave into twelve equally spaced pitches, known as Equal Temperament, holds sway.  Scales are arrangements of half and whole step intervals in the octave.  Denoting a half step as h and a whole step as w, the familiar diatonic major scale is defined by the sequence wwhwwwh.  The diatonic natural minor scale is whwwhww.  Twenty-four distinct diatonic scales result from beginning these patterns from each of the twelve pitches.  This suggests a set-theoretic description, by which each major scale can be represented as a transposition (in algebra this would be called a translation) of the set of pitches C-D-E-F-G-A-B-C.  In the twentieth century, such mathematical formalisms have led to the conceptualization of non-diatonic scales with special transposition properties.

Octave Equivalence

Fundamental to understanding musical scales is the concept of octave:  the musical interval between notes with frequencies that differ by a factor of two.   In western music notation, pitches separated by an octave are given the same note name.  The piano keyboard provides a visual representation of this phenomenon. Counting up the white keys from middle C as “1”, the 8th key in the sequence is again called C.  This eight-note distance explains the etymology of the word octave.  The perception and conceptualization of such pairs of pitches as higher or lower versions of the same essential pitch is called octave equivalence. Octave equivalence is thought to be common to all systematic musical cultures.  Evidence of octave equivalence is found in ancient Greek and Chinese music.  Recent psycho-acoustic research suggests a neurological basis for octave equivalence in auditory perception.

The mathematical explanation of octave equivalence comes from the fact that the sound of a musical pitch is a combination of periodic waveforms that can be modeled as sinusoidal functions of time. In the two periodic functions f (t)=sin(t) and g(t)=sin(2t), with frequencies 2p and p, every peak of the lower frequency function coincides with a peak of the high-frequency function. In sonic terms, this is the highest degree of consonance possible for two pitches of different frequencies.

History of Scales

As western music developed from the middle ages through the twentieth century, the central construct was the diatonic scale.   This arrangement spans an octave with seven distinct pitches arranged in a combination of five whole steps and two half steps.  It is important to note that the pattern of intervals (and not the absolute pitch of the starting note) was the only distinguishing feature of scales until the rise of tonal harmony in the seventeenth century. The pitch-specific examples given here are intended illustrate the interval patterns in terms familiar to the modern reader.

The diatonic scale traces its origins to the ancient Greek genus of the same name, referring to a particular tuning of the four-stringed lyre (tetrachord) consisting of two whole steps and one half step in descending succession.  An example of this can be constructed with the pitches A-G-F-E.   Concatenization of two diatonic tetrachords [A-G-F-{E]-D-C-B} produces the pitches of the diatonic scale (the piano white keys).  In medieval European musical practice, the distinct Church Modes (Lydian, Phrygian, etc.) developed from the diatonic scale by the assignment of a tonal anchor or final tone.  For example, the Dorian mode is characterized by the sequence of ascending half and whole steps in the diatonic scale whwwwhw, e.g. D-E-F-G-A-B-C-D, while the Phrygian mode is hwwwhww: E-F-G-A-B-C-D-E.  The diatonic major scale wwhwwwh  (C-D-E-F-G-A-B-C) came into widespread use in the seventeenth century.  The diatonic natural minor scale is whwwhww (A-B-C-D-E-F-G-A). 

Intervals, Ratios and Equal Temperament

The simplest musical interval is the octave.  The frequency ratio between pitches separated by an octave is 2:1.  The interval of a perfect fifth has frequency ratio 3:2.    Using these two ratios, pitches and corresponding intervals for the diatonic scale can be assigned according to the Pythagorean Tuning.  Simpler diatonic scales based on ratios of small integers are known as Just Tunings.  Western music in the modern era uses a symmetric assignment of intervals known as Equal Temperament.  In equal temperament, the twelve half steps that comprise the frequency doubling octave each have frequency ratio 21/12 ≈ 1.0595.   For these three tuning schemes, frequency ratios relative to the starting pitch and intervals between adjacent scale notes are illustrated and compared in the Table 1.



Modern Scales

In contrast to the idiosyncratic pattern of intervals that comprise the diatonic scales, the chromatic scale hhhhhhhhhhh is perfectly symmetric.  In particular, the set of pitches that form the chromatic scale is unchanged by transposition --- there is only one set of pitches with this intervallic pattern.  We could refer to this set of pitches as having order 1.  The elements of the pitch set forming a diatonic scale, which as we have seen generates twelve diatonic scales by transposition, has order 12.  This point of view suggests other scales of interest with respect to transposition.  The set of six pitches in a whole-tone scale wwwwww  (e.g. C-D-E-F#-G#-A#-C) are unchanged by transposition by an even number of half steps.  A transposition by an odd number of half steps results in the whole tone scale containing the remaining six pitches (C#-D#-F-G-A-B- C#).  Thus, the set of pitches in the whole-tone scale has order 2. Whole-tone scales are a characteristic feature in much of the music of Claude Debussy.  The twentieth-century composer and music theorist Olivier Messiaen codified a number of eight-tone “scales of limited transposition”.  Among these are the order 3 scales hwhwhwhw and whwhwhwh, which are called octatonic scales in the music of Stravinsky and sometimes referred to as diminished scales in jazz performance. It can be seen that transposition by one and two half steps produce new diminished scales, but transposition by 3 half steps leaves the original set of pitches unchanged. 


FURTHER READINGS:

Grout, Donald Jay. A History of Western Music. New York: Norton, 1980.

Hanson, Howard. Harmonic Materials of Modern Music: Resources of the Tempered Scale. New York: Appleton-Century-Crofts, 1960.
Johnson, Timothy. Foundations of Diatonic Theory: A Mathematically Based Approach to Music Fundamentals, Lanham, Maryland:  2008

Pope, Anthony. “Messiaen’s Musical Language: An Introduction.,” in The Messiaen Companion, ed. Peter Hill.  Portland: Amadeus Press, 1995

Sundberg, Johan. The Science of Musical Sounds. San Diego: Academic Press, 1991