The Mathematics of Twelve Tone Music
Bethany Shears
1      Introduction
Throughout history, musical conventions have been manipulated, broken, and
rewritten to reflect the changing values of the eras in which they are established.
Around the turn of the 20th century, Western music went through such a period of
musical experimentation. A push towards stretching the boundaries of what could
be considered “music” and how it could be produced lead to the development of
revolutionary atonal music strategies. This paper is a companion piece to an
earlier paper, “The Mathematics of Music Composition,” and for that reason
assumes that some basic understanding of musical terminologies and their
translation to mathematical notation is inherent. It serves as an attempt to explore
twelve tone music composition through a mathematical lens, and to break down
its key concepts in a way that is accessible to even those without a background in
music.
2      Recapitulation and Background
Despite assuming a certain fluency in the concepts described by the preceding
paper, there is some terminology that is particularly useful for this discussion.
Hence, the following provides an overview of some fundamental concepts
without expanding upon them in great detail, before introducing the main subject
material. For a more thorough understanding of these conventions, please refer to
“The Mathematics of Music Composition”.
2.1    Recapitulation of Necessary Terminology
There is some important musical terminology to review before discussing twelve
tone music in detail. A semitone is the smallest value in Western music. The space
between each successive pitch on the keyboard is a semitone. An interval is the
number of semitones (or the “space”) between two pitches. There is an
assumption in Western music that there are only twelve distinct pitches, which
can be played at higher or lower frequencies. For our purposes, we will consider
these twelve distinct pitches a set of 12 elements, as follows:
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
                                         1
Each of these elements is to be considered modulo 12. Another way to think of
this is mapping each of the 12 distinct pitches to a number 0-11, as follows in
Figure 1.
 C ↦ 0           C#/Db ↦ 1           D ↦ 2             D#/Eb ↦ 3       E ↦ 4               F ↦ 5
 F#/Gb ↦ 6       G ↦ 7               G#/Ab ↦ 8         A ↦ 9           A#/Bb ↦ 10          B ↦ 11
              Figure 1: Mapping Pitches to Distinct Numerical Elements
Finally, it is important to recall that to find an interval above a given pitch, we add
the number of semitones associated with the interval to the number associated
with the pitch, and reduce modulo 12. (Similarly, to find an interval below a given
pitch, we instead subtract the number of semitones associated with the interval).
Figure 2 details the intervals as they relate to a number of semitones.
  Interval      # of        Interval        # of          Interval       # of        Interval        # of
   Name       Semitones      Name         Semitones        Name        Semitones      Name         Semitones
 minor 2      1            Major 3        4           Perfect 5        7            minor 7       10
 Major 2      2            Perfect 4      5           minor 6          8            Major 7       11
 minor 3      3            Tritone        6           Major 6          9            Perfect 8     12
                               Figure 2: Values of the Intervals
2.2       A Brief History of Twelve Tone Music
Traditional Western music theory conventions are used to describe tonal music, or
music that is centered around a certain key. These practices are rooted in a
dedication to create constant music that is pleasing to the ear. Around the turn of
the 20th century, however, there was a push towards more experimental and
dissonant music composition, inspired by the increasingly chromatic pieces
written by Romantic Era composers such as Franz Liszt.
                                                      2
             Figure 3: Photograph of Arnold Schoenberg (1874-1951)
Austrain composer Arnold Schoenberg (Figure 3) was inspired by the
increasingly dissonant pieces of the Late Romantic period to experiment with
methods of creating music that, instead of relying on the ordering of pitches
within a certain key, gave equal importance to each one of the twelve distinct
pitches throughout a composition. This musical philosophy eventually gave rise to
the establishment of the twelve tone technique, a formulaic approach to music
composition that attempts to give each pitch equal weight, and the often-cited
beginning of the serialist movement in post-tonal musical composition.
3      Translating Twelve Tone Composition to Mathematics
Twelve tone technique is different from traditional Western techniques not only in
its rejection of a tonal center, but also in the relative rigidity of the structure it
creates. Whereas traditional Western music has a lot of freedom in the ordering of
pitches and the ways they can be manipulated, twelve tone compositions are
limited to a certain pattern and usage of pitches. This arises from a series of
transformations upon an original pattern of pitches, and follows quite
formulaically.
3.1    The Tone Row
The aspect of twelve tone compositions that arguably provides the most
originality to a piece comes from the creation of an original Tone Row. The Tone
Row, (or “Note Row,” in Europe), is an ordering of all twelve distinct pitches in
any way that is desired by the composer. Each pitch can be included only once.
Generally, the more arbitrary the ordering of pitches within the Tone Row is, the
more atonal and eclectic the produced composition will sound.
                                          3
                          Figure 4: Example Tone Row
Figure 4 uses a 12-element array to represent an example Tone Row using the
numerical notation for pitches that was previously established. This original
ordering of the Tone Row is referred to as “Prime Form,” and is often denoted by
P.
3.2    Manipulation of the Tone Row
The Tone Row now serves as the basis for creating all possible patterns of pitches
that can be utilized in a composition. There are three basic operations that can be
performed upon the Prime Form (P) of a Tone Row to create said patterns,
namely: Retrograde (denoted by R), Inversion (denoted by I), and Retrograde
Inversion (RI).
                 Figure 5: Retrograde Compared to Prime Form
The first operation that can be performed upon the Prime Form of the Tone Row
is the Retrograde. The Retrograde takes the order of elements of the Prime Form
array and flips it to create a new ordering of the Tone Row, as exemplified in
Figure 5.
                  Figure 6: Inversion Compared to Prime Form
The next operation that can be performed upon the Prime Form of the Tone Row
is the Inversion. The Inversion takes the elements of the Prime Form array and
functionally inverts the intervals between each pitch, as exemplified in Figure 6.
Recalling that finding an interval above or below a given pitch requires adding or
subtracting a number of semitones, it becomes obvious that the Inversion of the
Prime Form will require some formula to manipulate the original pattern of
pitches. The formula to create an Inversion is as follows:
                                         4
P1: Stays the same
Pi: [12 - (Pi - P1) + P1] (mod12)
Here, the subscript associated with P refers to the position of the element in the
array, with P1 being the first element in the array and i being a natural number
such that 1 < i < 13.
      Figure 7: Retrograde Inversion Compared to Prime Form and Inversion
The final operation that can be performed upon the Prime Form of the Tone Row
is the Retrograde Inversion. The Retrograde Inversion takes the order of elements
of the Inversion array and flips it to create a new ordering of the Tone Row, as
exemplified in Figure 7.
3.3     The Twelve Tone Matrix
The real significance of the Tone Row is that, in creating an ordering of all twelve
possible pitches, it establishes a pattern of intervals between said pitches.
Therefore, it is possible to recreate this pattern of intervals starting with any of the
twelve distinct pitches. Essentially, this is transposing the pattern to begin on a
different pitch. In order to create and keep track of these new iterations of the
Tone Row, a Twelve Tone Matrix is utilized. The term “matrix,” in this sense,
may be somewhat of an abuse of the term; in reality, a 12x12 grid is created and
filled with the possible arrays representing the Tone Rows. However, this process
is not arbitrary, and there are a number of rules to follow when establishing a
Twelve Tone Matrix.
                                            5
                  Figure 8: The Beginnings of a Twelve Tone Matrix
After creating a blank 12x12 grid, the first step in creating a Twelve Tone Matrix
is to fill in the first row with the Prime Form array of the original Tone Row.
Then, the first column can be filled in with the Inversion of the Prime Form (see
Figure 8). These two arrays create a basis for filling in the remaining entries in the
grid. Each remaining row is then filled in according to the following formula:
Pa1: Stays the same
Pai: [(Pa1 - P11) + P1i] (mod12)
Here, the subscript associated with P refers to the position of the element in the
grid, with P11 being the first element in the first row, Pa1 being the first element in
the ath row, and P1i being the ith element in the 1st row. Then, both a and i are
natural numbers such that 1 < i <13 and 1 < a < 13. Once this process has been
completed for each row, the Twelve Tone Matrix is complete (see Figure 9).
                                             6
                    Figure 9: Completed Twelve Tone Matrix
Notice that each pitch is repeated only once in every row and column of the
Twelve Tone Matrix. This speaks to the purpose of creating music where each
pitch receives equal weight in a composition.
                  Figure 10: Utilizing the Twelve Tone Matrix
This configuration is also useful because it reveals the Prime Form, Retrograde,
Inversion, and Retrograde Inversion of every possible iteration of the Tone Row
(see Figure 10). Reading the rows left to right gives the Prime Form, while right
to left gives the Retrograde. Reading the columns top to bottom give the
Inversion, while bottom to top gives the Retrograde Inversion.
                                         7
3.4    The Rules for Composition
Having created a Tone Row and utilized it to establish a Twelve Tone Matrix, all
the tools for composing a piece of music according to the twelve tone technique
are now in place. There are a few rules for composing in this style, which, when
conformed to, make the composition process follow naturally. First, select any
row (or column) in the Twelve Tone Matrix, in any format (Prime Form,
Retrograde, Inversion, or Retrograde Inversion). Once a row has begun to be used
in a composition, it must be followed to completion. All of the pitches must be
played in order, and none may be repeated or skipped. Notes may be played in
any octave and for any duration. Pitches may also be played simultaneously, as
long as they occur sequentially within the row. Finally, any number of rows (or
columns) may be played concurrently, and can have varying lengths and formats.
Following these rules exactly to the conclusion of a composition will create a
piece of music in conformation with the twelve tone technique.
4      Why This Technique Makes Mathematical Sense
In his essay “Mathematics and the Twelve Tone System: Past, Present, and
Future,” American composer and music theorist Robert Morris beautifully
explained the mathematical intentions of Schoenberg in creating twelve tone
music:
       “Schoenberg’s phrase, ‘The unity of musical space,’ while subject to many
       interpretations, suggests that he was well aware of the symmetries of the
       system ... he understood that there was a singular two-dimensional ‘space’
       in which his music lived … Indeed, the basic transformations of the row,
       retrograde and inversion, plus retrograde-inversion for closure (and P as
       the identity) were ... shown to form a Klein four-group.”
As Morris implies, the Prime Form, Retrograde, Inversion, and Retrograde
Inversion operations on the Tone Row have been proven to conform to the
conventions of the Klein four-group, as is demonstrated in Figure 11.
                                       8
                Figure 11: Association with the Klein Four-Group
Unsurprisingly, the properties of the Klein four-group seem to lend themselves to
creating a system for formulating music in which every pitch gets equal weight in
composition. Every element of this group is its own inverse, and the product of
two (non-identity) elements produces the remaining non-identity element.
Additionally, the Klein four-group can be visualized by performing
transformations on a rectangle. Just like the symmetries of a rectangle, the Prime
Form (P) can be transformed using reflection (left-right flip), inversion (up-down
flip), or a combination of these (rotation through 180°). These symmetries can be
observed when examining Prime Form, Retrograde, Inversion, and Retrograde
Inversion forms of the Tone Row in their standard musical notation (see Figure
12).
              Figure 12: Visualization of the Tone Row Operations
                                        9
5      Conclusions
The goal of this paper was to make twelve tone music composition seem more
accessible to those without a background or interest in music, and to examine the
mathematical connections within twelve tone technique. It was preceded by a
presentation of the aforementioned material, and resulted in a few notable
addendums.
5.1    Addendums
Following the presentation given in preparation for this work, an excellent
question was raised about whether or not twelve tone music is truly atonal. The
majority of the time, if a Tone Row has truly been chosen arbitrarily (as was,
arguably, the intention of Schoenberg), the resulting piece is atonal. However,
because a Tone Row establishes a pattern of intervals between notes, it could
theoretically be manipulated in such a way that the resulting intervals correspond
to the intervals inherent within chords and keys associated with traditional
Western music theory. For that reason, while twelve tone music is intended to be
atonal, it is technically possible to create twelve tone music that gives an illusion
of tonality. Still, the method by which it is produced and the purpose of the
composition makes twelve tone music distinct from traditional Western
compositions.
5.2    Conclusions
Just as examining traditional Western music theory in conjunction with
mathematics begins to dismantle the barriers between these two fields, twelve
tone technique brings mathematics even further into the musical realm. Perhaps
an even more direct application of mathematics than traditional music theories,
twelve tone music and serialism question whether an increased formulization of
the musical process can create sounds that are still considered music. The further
implications of this process beg questions about whether art can be mechanized,
or if artificial intelligence can be used to create art. Mathematics and music are so
fundamentally entwined that the connections between the two are limitless; it is
upon closely examining and expanding their similarities that more complex and
beautiful art can be created.
                                         10
References
[1]   “Klein 4-Group.” Art of Problem Solving,
      artofproblemsolving.com/wiki/index.php/Klein_4-group.
[2]   “The Klein 4-Group.” ThatsMaths, 13 Feb. 2015,
      thatsmaths.com/2015/02/12/the-klein-4-group/.
[3]   Lozano, Carolyn. “How to Write a 12-Tone Composition.” The
      Carolingian Realm,
      carolingianrealm.blog/HowToWriteA12ToneComposition.php.
[4]   Morris, Robert. “Mathematics and the Twelve-Tone System: Past, Present,
      and Future.” Perspectives of New Music, vol. 45, no. 2, 2007, pp. 76–107.
      JSTOR, www.jstor.org/stable/25164658. Accessed 12 Nov. 2020.
[5]   “Twelve Tone Technique - Music Composition.” YouTube, Music
      Matters, 11 July 2019,
      www.youtube.com/watch?v=wa_vhGPRuhs&t=627s.
                                      11