<figure><img src="image_1.png" /></figure>

HAL
open science

# A Walk Through Tonal Space: Charting the Establishing of the Key of a Melody

Elaine Chew

► To cite this version:

Elaine Chew. A Walk Through Tonal Space: Charting the Establishing of the Key of a Melody. 13th International Conference on Systems Research, Informatics and Cybernetics, International Institute for Advanced Studies in Systems Research and Cybernetics, Jul 2001, Baden-Baden, Germany. hal-04833419

HAL Id: hal-04833419

https://hal.science/hal-04833419v1

Submitted on 12 Dec 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# A Walk Through Tonal Space: Charting the Establishing of the Key of a Melody

Elaine Chew (echew@usc.edu)

University of Southern California

Integrated Media Systems Center

Department of Industrial and Systems Engineering

Los Angeles, CA 90089-1450

USA

## ABSTRACT

In the western tonal music tradition, when we listen to a melody, our minds generate a system of hierarchical relations among the musical pitches that we hear. This system of relations is known as *tonality*. The developing of the pitch relations can be visualized as the generating of a tonal space. We propose a spatial analogue for this tonal space, which we call a Spiral Array. In this geometric representation, spatial proximity designates perceptually close relations among the represented musical entities. As a melody unfolds, the accumulating musical information can be charted in the Spiral Array as a walk through this tonal space. Over time, the hierarchical relations that determine the perceived relative stability among the pitches become more settled, and a key (designated by the most stable pitch) is established. We demonstrate that this establishing of key can be derived from the walk within the Spiral Array.

## Introduction

When presented with a melodic fragment, even an untrained listener can make consistent judgments about whether the piece could end with any given note. This is because as the melody unfolds, the notes or pitch events generate a system of hierarchical relations, also known as tonality. Perceptually, a musical passage does not sound like it has ended until a phrase ends on the most stable pitch (the tonic), where stability relations (and musical key) are established over time. This stable pitch serves as the focal point for all other pitches in the melody. Our goal is to model the evolving musical relations spatially.

We propose that tonal music defines a space, and that the establishing of key can be charted on this space. We first propose a spatial model, the Spiral Array, which captures the inter-relations among pitches, chords and keys. The spiral representation corresponds to a mental model of tonality in that spatial proximity represents perceptually close relations among the represented musical entities. Next, we show that as a melody unfolds, the accumulating musical information can be modeled as a walk through this tonal space. Furthermore, since spatial distance mirrors perceived closeness in the Spiral Array, the establishing of the key can be graphed as the dynamically changing distances between the CE and each key representation over time.

## The Spiral Array

The Spiral Array model is a representation for tonal relations inspired by an earlier model called the *tonnetz* or harmonic network. The *tonnetz* was first described by the mathematician Euler,
and is currently used by the music theorists to visualize triadic progressions in music (see, for example, Cohn, 1997). The *tonnetz* represents musical pitches on a grid in the following fashion: pitches related by an interval of a perfect fifth are lined up along the x-axis, and pitches related by an interval of a major third are lined up along the y-axis (see Figure 1). It has been shown that the *tonnetz* is a useful tool for machine recognition of keys since the pitches in each key are positioned close to one another and define a compact region on the grid (see Longuet-Higgins & Steedman, 1971).

<figure><img src="image_3.png" /><figcaption>**Figure 1:** Rolling up the *tonnetz* to form a spiral.</figcaption></figure>

The observation that inherent in the *tonnetz* is a spiral array structure inspired the Spiral Array representation (Chew, 2000). Figure 1 shows how the *tonnetz* grid can be “rolled-up” to form a spiral. If one assumes enharmonic equivalence (that is to say, if E# were equivalent to F), then the structure becomes a torus. For the purposes of this paper, we shall stick with the spiral.

<figure><img src="image_4.png" /><figcaption>**Figure 2:** The *tonnetz* in a spiral configuration.</figcaption></figure>
The *tonnetz* is shown in its spiral configuration in Figure 2. Each quarter turn of the spiral links the representations of two pitches that are separated by an interval of a perfect fifth. After four quarter-turns, pitches stacked vertically atop each other are related by major third intervals.

<figure><img src="image_5.png" /><figcaption>**Figure 3:** Example of a triad representation in the Spiral Array.</figcaption></figure>

We now arrive at the point of departure between the *tonnetz* and the Spiral Array representations. In the Spiral Array, we also define representations for triads and keys. The pitches in a triad outline a triangle in the *tonnetz*, and can be uniquely represented by a point on this triangle (see Figure 3). The position of the triad representation is strategically chosen to correspond to perceived relations between a triad and its component pitches (for details, see Chew, 2000).

<figure><img src="image_6.png" /><figcaption>**Figure 4:** Example of a key representation in the Spiral Array.</figcaption></figure>

Extending the idea to the note material in a key: three consecutive triads on the *tonnetz* uniquely define all pitches in a major key. The representations for the three triads also form a triangle, and the key can hence be uniquely represented by a point in this higher level triangle (see Figure
4 for an example). Again the positioning of the key is chosen to correspond to perceived relations among the entities (again, see Chew, 2000, for details).

## A Walk Through Tonal Space

Having defined the Spiral Array structure, we now introduce the representation of musical information within this structure. In particular, we will show how the unfolding of a melody over time maps to a walk within this tonal space.

A melody comprises a sequence of notes or pitch events. Each note consists of two properties: pitch and duration. Each pitch corresponds to a position on the outermost spiral; and, each position can be assigned a weight that matches the duration of the pitch. The weighted position represents the pitch event and contains information about the pitch identity and duration. At any given time, the musical information up to that point in time can be represented spatially as the sum of the weighted positions that correspond to the notes that have been heard thus far. We call this summary point the Center of Effect (CE). In mathematical notation:

$$ce_{now} = \sum_{t=1}^{now} (pitch_t \times weight_t), \quad \text{where} \quad weight_t = \frac{duration_t}{\sum_{q=1}^{now} duration_q}.$$

As the melody unfolds and more pitch events occur, more information is imputed to the CE and its position is updated. The sequence of summary points forms a walk in the tonal space defined by the Spiral Array. Thus, we can think of a melody as a center of effect generator (CEG), and its evolution over time as a walk through tonal space.

## An Example

<figure><img src="image_7.png" /><figcaption>Figure 5: Simple Gifts</figcaption></figure>

We shall demonstrate the walk using the Shaker melody, “Simple Gifts” (shown in Figure 5). At the time the first note is sounded, the summary point is simply at the pitch representation for C. On the second note, the summary point moves to the midpoint between C and F. On the third note, the summary point is now updated to 3/5 of the way from C to F. The process continues throughout the length of the melody, and the walk is shown in Figure 6.
<figure><img src="image_8.png" /><figcaption>**Figure 6:** A bird's eye view of the changing centers as “Simple Gifts” unfolds.</figcaption></figure>

Charting the Establishing of Key

One of the Spiral Array's design goals is to concur with listener perceptions of tonal relations. As a result, the CE's distance from each key spatially represents its affinity to that key. The most likely key is positioned closest to the CE, while less likely keys are farther away. As the CE evolves, different keys may vie for the closest position.

For example, when the first note C is sounded, the CE is closest to the C major representation, and F major and F minor are close seconds. On the second note F, the CE has now shifted closer to the F major and F minor representations. The melody as shown in Figure 5 is in the key of F major. Over time, the CE's gravitate toward the F major representation as the melody unfolds (see Figure 7). At the middle of the melody, C major vies for first place (and does not quite succeed) as the melody dwells on the note material of the dominant key, but F major triumphs in the end.
<figure><img src="image_9.png" /><figcaption>**Figure 7:** Distance from F major as “Simple Gifts” unfolds.</figcaption></figure>

## Concluding Remarks

We introduced a spatial model for tonality and showed how it could be used to chart the accumulation of musical information over time as a melody unfolds. The distance between the Center of Effect and the various keys also indicate the melody's affinity to each key. This method of charting key affinities suggests a spatial analogue for the mental process of key-finding. More research needs to be done to validate the psychological reality of the method. In the meantime, the algorithm is computationally efficient and can be used in real-time systems for computer-aided music analysis.

## References

Chew, Elaine (2000). Towards a Mathematical Model of Tonality. Doctoral dissertation, Operations Research Center, MIT, Cambridge, MA.

Cohn, Richard (1997). "Neo-Riemannian Operations, Parsimonious Trichords, and their Tonnetz Representations." Journal of Music Theory, 41:1, 1--66.

Longuet-Higgins, H. C. & Steedman, M. J. (1971). "On Interpreting Bach." Machine Intelligence, 6, 22.