Paul E. Dworak
Fall 1995
© IEEE Computer Society Press.


A Data Structure for Enharmonic Relationships

This section employs the base 7 note representation discussed in Section 3. Figure 5.1 reproduces the spiral of fifths diagram presented in that section.

Figure 5.1. Spiral of fifths.

In this figure, every note is represented by two numbers drawn within angle brackets. For example, the values < 2,2> represent G-natural. The first digit represents the note's accidental and the second digit represents the note's name. Clockwise motion around the spiral of fifths causes the name digit to be incremented once for every node in the spiral visited. Motion from B to F in the spiral is equivalent to adding 1 to 6 using base 7 arithmetic. The result is 0, but the carry that is generated causes the accidental digit to be incremented. The note that follows B-flat < 1,6> in the spiral is F-natural < 2,0> .

Converting from a pitch class value to the accidental name/note name representation requires a data structure that maps correspondences between the above digit pairs and the pitch classes that they can represent. A structure suggested by Coxeter (1974) makes this possible. Coxeter uses frieze patterns to represent ratios inherent in the orthoschemes of polytopes in three or more dimensions. He defines the frieze pattern to be an arrangement of numbers identified by pairs of indices that are arranged in staggered rows, as follows:

Figure 5.2. The format of a frieze pattern.

The values < s-1,t> and < s,t+1> are consecutive entries in one row while < s-1,t+1> come between them in the next row. Coxeter associates the pairs of numbers < s,t> with values that follow the rule ad - bc = 1, where a, b, c, and d occupy the positions indicated below:

One frieze pattern that follows this rule is

Figure 5.3. A frieze pattern in which ad - bc = 1.

Note that ((2 * 2) - (3 * 1)) = 1 and ((1 * 2) - (1 * 1)) = 1 and ((1 * 3) - (1 * 2)) = 1. Note also that the pattern of numbers is periodic. The digits within the box on the left side of the figure recur on the right and would start the whole pattern of numbers over again if the frieze pattern were continued.

Although Coxeter's frieze patterns follow the rule ad - bc = 1, the constant on the right side of the equation can assume other values. Note in Figure 5.4 that s's of the same value fall in diagonals from upper left to lower right while t's are incremented on each step through these diagonals:

Figure 5.4. Diagonals of constant s and constant t.

In the following diagram, each position in the pattern takes the value of its s location:

Figure 5.5. A frieze pattern in which ad - bc = 0.

Note that, in this case, ad - bc = 0. For example, ((0 * 1) - (1 * 0)) = 0, ((1 * 2) - (2 * 1)) = 0, and ((2 * 3) - (3 * 2)) = 0. If, however, the pattern is shifted so that values in are imitated at <s+1,t+1> as follows, note that ad - bc = 1. For example, ((1 * 1) - (2 * 0)) = 1 and ((2 * 2) - (3 * 1)) = 1.

Figure 5.6. A frieze pattern in which ad - bc = 1.

If the value at s repeats at s - 2 as follows, note that ad - bc = -2. For example, ((1 * 4) - (2 * 3)) = -2, ((2 * 5) - (3 * 4)) = -2, and ((4 * 7) - (5 * 6)) = -2.

Figure 5.7. A frieze pattern in which ad - bc = -2.

Now, if the pairs < s,t> represent note values, with s's identifying accidental names and t's referring to note names, and if these < s,t> pairs are associated with the pitch class that they represent, the following frieze pattern emerges:

Figure 5.8. The frieze pattern of pitch classes.

Note that ad - bc = 5 or ad - bc = -7. In the mod 12 system that describes pitch class values, 5 and -7 are equivalent. This suggests that the pattern of pitch class values that increment with the s values in the t diagonals from lower left to upper right are shifted in each t diagonal either up by 5 or down by 7. This is expected because adjacent t diagonals represent note names that are a perfect fifth (interval class 7) apart. To get PC 7 in the same s diagonal as PC 0, the pattern of PC's has to be shifted down by seven. In any vertical column, only two different pitch class values are found, and these always differ by 6. By separating from one another those t diagonals that introduce the alternating pitch class values, the frieze pattern can be rearranged so that all vertical columns contain only one pitch class value.

Figure 5.9. Relating pitch classes and note spellings.

Later sections explain how this data structure facilitates converting pitch class values into accidental name/note name values. These in turn are used for generating musical notation that indicates which notes a student produced. The next section first explains how the pitch classes produced by a student singing or playing a keyboard are recognized in real time.


[ Index | Previous Paragraph | Next Paragraph ]