Skip to content

Maps

Maps are where meantonal’s vector representation really shines. Before we can properly explore them, let’s review some basic facts about the sets our musical information lives in:

  • Pitch is 1-dimensional: frequencies are measured in real numbers, using units such as Hertz/CPS.
    • That is: they live in R\R.
  • Meantonal’s Pitch and Interval vectors are discrete and 2-dimensional.
    • That is: they live in Z2\Z^2.
  • Tuning systems like 12-tone equal temperament have a finite number of pitches per octave.
    • That is, they live in Z\Z.
  • Abstractions like “12 tone pitch class” or “scale degree” have a finite total number of values, and work by modular arithmetic.
    • That is, they live in Zn\Z_n for some integer nn.

Most of Meantonal’s information querying is done via linear maps from Z2\Z^2 to Z\Z via multiplication with a 1×21\times2 mapping matrix, or division/remainder operations on the integers resulting from these maps.

Let’s make things more concrete with an example: extracting information from an arbitrary Pitch vector.

Information like a Pitch’s MIDI number can usually be queried via a matrix multiplication.

No linear map from Z2\Z^2 to Z\Z is invertible. If C4\sf{C}\sharp_4 and D4\sf{D}\flat_4 are both sent to the MIDI number 61, the mapping was not one-to-one. No inverse map can exist. This means we can convert a Meantone Pitch vector into MIDI, but we cannot simply convert from MIDI.

Modular information like 12-tone pitch class can be queried by taking remainders after regular Euclidean division.

No map from Z\Z to Zn\Z_n is invertible. If MIDI numbers 65 and 77 are both sent to the 12-tone pitch class 5 the function was not one-to-one. No inverse function can exist.

We can recover the letter name from a Pitch vector quite easily. The diatonic mapping matrix [1,1][1, 1] tells us how many diatonic steps separate a Pitch from C1\sf{C}_{-1}; taking remainders after dividing by 7 then gives us a value we can map to the note’s letter.

As with the previous examples, there is no inverse map back to Pitch vectors from just letter names.

The sorts of maps demonstrated above are called semantically destructive in Meantonal.

Meantonal tries to preserve semantic information. This is achieved by keeping data in vector format wherever possible, and then simply extracting lower-dimensional representations when they are required.

This means you will generally want to place any 1-dimensional pitch handling downstream of vector-based data structures and operations. Query MIDI or pitch class values, and operate them directly if possible, before continuing to operate on the original Pitch or Interval vectors the information was extracted from.

You might be wondering after reading the above why the MIDI matrix or the diatonic matrix “work”. Or maybe you’re wondering how we arrive at those specific matrices for our operations?

Buckle up, because this is the most magical aspect of Meantonal’s vector representation: we can pick and choose which notes we want to partition into equivalence classes, then construct a matrix that will make the difference between them simply disappear.

Meantonal’s Pitch and Interval vectors are 2-dimensional. A 1×21\times2 matrix maps from two dimensions down to one. That means we’re throwing away a dimension. Every 1×21\times2 matrix has a non-empty null space (also called its “kernel”), which represents all the vectors it sends to zero. You can think of this as where our lost dimension “goes”.

How can we use this?

Consider the problem of measuring the generic interval between two notes in terms of diatonic steps. We want the distance from any flavour of C4\sf{C}_4 to any flavour of E4\sf{E}_4 to produce the same result here: C4\sf{C}\sharp_4 to E4\sf{E}_4 and C4\sf{C}_4 to E4\sf{E}_4 are both generic “thirds”, even if their quality is different.

What if we could make the difference between C4\sf{C}_4, C4\sf{C}\sharp_4 and C4\sf{C}\flat_4 etc. disappear? Every variant of the letter name "C"\sf{"C"} is separated by some number of chromatic semitones, and the chromatic semitone’s Interval vector is (1,1)(1, -1). Then [1,1][1, 1] is a matrix which has the chromatic semitone in its null space.

That means if we apply [1,1][1, 1] as a linear map, the chromatic semitone is sent to 0, and any notes separated by it are mapped to the same number:

C4=(25,10)35\sf{C}_4 = (25, 10) \rightarrow 35 C4=(26,9)35\sf{C}\sharp_4 = (26, 9) \rightarrow 35 C4=(24,11)35\sf{C}\flat_4 = (24, 11) \rightarrow 35

The diatonic map is a linear map that makes chromatic semitones disappear. Or, for another view: the chromatic semitone is defined as the difference between a whole step and a half step (diatonic semitone). If we make the chromatic semitone disapper, then there is no difference between whole steps and half steps, and we simply end up with generic diatonic “steps”.

What about the MIDI/12TET map? The distinguising feature of 12-tone equal temperament is that it makes diatonic and chromatic semitones the same size. C# and Db map to the same number. That means the difference between the chromatic semitone (1,1)(1, -1) and the diatonic semitone (0,1)(0, 1), also known as the enharmonic diesis (1,2)(1, -2), is what we want to make disappear. Then [2,1][2, 1] is a matrix which has the enharmonic diesis in its null space.

C4=(26,9)61\sf{C}\sharp_4 = (26, 9) \rightarrow 61 D4=(25,11)61\sf{D}\flat_4 = (25, 11) \rightarrow 61

For another extremely useful example: what if we want to abstract away octave information and nothing else? We already looked at how to map from Pitch vectors to 12-tone pitch classes, but that’s not quite the same thing: octave information was abstracted away by the remainder operation, but we also lost the distinction between C\sf{C}\sharp and D\sf{D}\flat. No, what we want is a linear map that has the octave (5,2)(5, 2) in its null space: the chroma map [2,5][2, -5].

This map partitions C2\sf{C}\sharp_2, C3\sf{C}\sharp_3, C4\sf{C}\sharp_4 etc. into an equivalence class, and D2\sf{D}\flat_2, D3\sf{D}\flat_3, D4\sf{D}\flat_4 etc. into a different one. But it has another remarkably useful property: it also orders pitch class names in a series of perfect 5ths.

C4=(25,10)0\sf{C}_4 = (25, 10) \rightarrow 0 G4=(28,11)1\sf{G}_4 = (28, 11) \rightarrow 1 D4=(26,10)2\sf{D}_4 = (26, 10) \rightarrow 2 A4=(29,11)3\sf{A}_4 = (29, 11) \rightarrow 3 E4=(27,10)4\sf{E}_4 = (27, 10) \rightarrow 4

The chroma map is one of the most versatile tools in Meantonal’s arsenal, as we can use quotients and remainders with various dividends to extract all kinds of information. For example, if we divide by 7, the remainder gives us the letter name in much the same way as the [1,1][1, 1] diatonic map, while the quotient is a way to retrieve the accidental.

Two notes are enharmonically equivalent in 12TET if they have the same remainder when we divide their chroma by 12. This can also be generalised to other tuning systems: they are enharmonic in 31TET if they have the same remainder when dividing their chroma by 31.

The previous section looked at how to make Pitch and Interval vectors vanish. Another way to think of matrices is in terms of how “big” they make the whole step and half step. This is particularly useful when creating maps to alternative tuning systems, and makes the matrices intuitive to construct.

  • In 12-tone equal temperament, a whole step is twice the size of a half step. [2,1][2, 1] is the 12TET map.
  • In 19EDO, a whole step is three EDO-steps while a half step is two. [3,2][3, 2] is the 19EDO map.
  • In 31EDO, the ratio is 5 to 3. [5,3][5, 3] is the 31EDO map.
  • In 7EDO, the ratio is 1 to 1: [1,1][1, 1] is the 7EDO map.

So far we’ve only looked at 1×21\times2 matrices. 2×22\times2 also have utility as a way to effect a change of basis. In particular, we can change our coordinate system from (whole  step,half  step)(\sf{whole\; step}, \sf{half\; step}) to something else like (whole  step,perfect  fifth)(\sf{whole\; step}, \sf{perfect\; fifth}), which is the mapping used in the Wicki-Hayden keyboard layout.

We could also map to/from a coordinate system where one axis increments in perfect 5ths, and the other in octaves. Why might we want to do this? Various meantone tuning systems like quarter-comma or golden meantone have an infinite number of pitches, and are generated by their octave and fifth. Expressing Pitch vectors in this coordinate system would allow us to do something like the following:

[x,1200¢][2513]P[x, 1200¢] \begin{bmatrix} 2 & -5 \\ -1 & 3 \end{bmatrix}P

Where x is the desired width of the perfect 5th in cents, and P is a Pitch vector.

This allows us to create different meantone tunings by simply specifying the width of a perfect 5th in the system, and map any Pitch vector to its corresponding frequency in the tuning.