# Spiral array model

In music theory, the spiral array model is an extended type of pitch space. A mathematical model involving concentric helices (an "array of spirals"), it represents human perceptions of pitches, chords, and keys in the same geometric space. It was proposed in 2000 by Elaine Chew in her MIT doctoral thesis Toward a Mathematical Model of Tonality. Further research by Chew and others have produced modifications of the spiral array model, and, applied it to various problems in music theory and practice, such as key finding (symbolic and audio), pitch spelling, tonal segmentation, similarity assessment, and musical humor. The extensions and applications are described in Mathematical and Computational Modeling of Tonality: Theory and Applications.
The spiral array model can be viewed as a generalized tonnetz, which maps pitches into a two-dimensional lattice (array) structure. The spiral array wraps up the two-dimensional tonnetz into a three-dimensional lattice, and models higher order structures such as chords and keys in the interior of the lattice space. This allows the spiral array model to produce geometric interpretations of relationships between low- and high-level structures. For example, it is possible to model and measure geometrically the distance between a particular pitch and a particular key, both represented as points in the spiral array space. To preserve pitch spelling, because musically A# ≠ Bb in their function and usage, the spiral array does not assume enharmonic equivalence, i.e. it does not fold into a torus. The spatial relationships between pitches, between chords, and between keys agree with those in other representations of tonal space.
The model and its real-time algorithms have been implemented in the tonal visualization software MuSA.RT (Music on the Spiral Array . Real-Time) and a free app, MuSA_RT, both of which have been used in music education videos and in live performance.

## Structure of the spiral array

The model as proposed covers basic pitches, major chords, minor chords, major keys and minor keys, represented on five concentric helices. Starting with a formulation of the pitch helix, inner helices are generated as convex combinations of points on outer ones. For example, the pitches C, E, and G are represented as the Cartesian points P(0), P(1), and P(4) (see definitions in next section), which outline a triangle. The convex combination of these three points is a point inside the triangle, and represents their center of effect (ce). This interior point, C$_M$(0), represents the C major chord in the spiral array model. Similarly, keys may be constructed by the centers of effect of their I, IV, and V chords.
* The outer helix represents pitches classes. Neighboring pitch classes are a music interval of a perfect fifth, and spatially a quarter rotation, apart. The order of the pitch classes can be determined by the line of fifths. For example, C would be followed by G (C and G are a perfect fifth apart), which would be followed D (G and D are a perfect fifth apart), etc. As a result of this structure, and one of the important properties leading to its selection, vertical neighbors are a music interval of a major third apart. Thus, a pitch class's nearest neighbors and itself form perfect fifth and major third intervals.
* By taking every consecutive triads along the helix, and connecting their centers of effect, a second helix is formed inside the pitch helix, representing the major chords.
* Similarly, by taking the proper minor triads and connecting their centers of effect, a third helix is formed, representing the minor chords.
* The major key helix is formed by the centers of effect of the centers of effect of the I, IV, and V chords
* The minor key helix is formed by connecting similar combinations of the i, iv/IV, and V/v chords.

## Equations for pitch, chord, and key representations

In Chew's model, the pitch class helix, P, is represented in parametric form by:
$P(k)={\begin{bmatrix}x_{k}\\y_{k}\\z_{k}\\\end{bmatrix}}={\begin{bmatrix}r\sin(k\cdot \pi /2)\\r\cos(k\cdot \pi /2)\\kh\end{bmatrix}}$ where k is an integer representing the pitch's distance from C along the line of fifths, r is the radius of the spiral, and h is the "rise" of the spiral.
The major chord helix, C$_M$ is represented by:
    $C_{M}(k)=w_{1}\cdot P(k)+w_{2}\cdot P(k+1)+w_{3}\cdot P(k+4)$
where $w_{1}\geq w_{2}\geq w_{3}>0$ and ∑$_{i=1}$$^3$w$_i$=1{\textstyle \sum _{i=1}^{3}w_{i}=1}.
The weights "w" affect how close the center of effect are to the fundamental, major third, and perfect fifth of the chord. By changing the relative values of these weights, the spiral array model controls how "close" the resulting chord is to the three constituent pitches. Generally in western music, the fundamental is given the greatest weight in identifying the chord (w1), followed by the fifth (w2), followed by the third (w3).
The minor chord helix, C$_m$ is represented by:
    $C_{m}(k)=u_{1}\cdot P(k)+u_{2}\cdot P(k+1)+u_{3}\cdot P(k-3)$
where $u_{1}\geq u_{2}\geq u_{3}>0$ and $\sum _{i=1}^{3}u_{i}=1.$
The weights "u" function similarly to the major chord.
The major key helix, T$_M$ is represented by:
    $T_{M}(k)=\omega _{1}\cdot C_{M}(k)+\omega _{2}\cdot C_{M}(k+1)+\omega _{3}\cdot C_{M}(k-1)$
where $\omega _{1}\geq \omega _{2}\geq \omega _{3}>0$ and ∑$_{i=1}$$^3$ω$_i$=1{\textstyle \sum _{i=1}^{3}\omega _{i}=1}.
Similar to the weights controlling how close constituent pitches are to the center of effect of the chord they produce, the weights $\omega$ control the relative effect of the I, IV, and V chord in determining how close they are to the resultant key.
The minor key helix, T$_m$ is represented by:
    $T_{m}(k)=\nu _{1}\cdot C_{m}(k)+\nu _{2}\cdot (\alpha \cdot C_{M}(k+1)+(1-\alpha )\cdot C_{m}(k+1))+\nu _{3}\cdot (\beta *C_{m}(k-1)+(1-\beta )\cdot C_{M}(k-1)).$
where $\nu _{1}\geq \nu _{2}\geq \nu _{3}>0$ and $\nu _{1}+\nu _{2}+\nu _{3}=1$ and $0\geq \alpha \geq 1$ and $\beta \geq 1$.