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 .
- Meantonal’s
PitchandIntervalvectors are discrete and 2-dimensional.- That is: they live in .
- Tuning systems like 12-tone equal temperament have a finite number of pitches per octave.
- That is, they live in .
- 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 for some integer .
Most of Meantonal’s information querying is done via linear maps from to via multiplication with a mapping matrix, or division/remainder operations on the integers resulting from these maps.
Querying Information
Section titled “Querying Information”Let’s make things more concrete with an example: extracting information from an arbitrary Pitch vector.
Extracting MIDI
Section titled “Extracting MIDI”Information like a Pitch’s MIDI number can usually be queried via a matrix multiplication.
No linear map from to is invertible. If and 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.
Extracting Pitch Class
Section titled “Extracting Pitch Class”Modular information like 12-tone pitch class can be queried by taking remainders after regular Euclidean division.
No map from to 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.
Extracting Letter Name
Section titled “Extracting Letter Name”We can recover the letter name from a Pitch vector quite easily. The diatonic mapping matrix tells us how many diatonic steps separate a Pitch from ; 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.
Information Loss
Section titled “Information Loss”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.
Another View on Maps
Section titled “Another View on Maps”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.
Null Spaces
Section titled “Null Spaces”Meantonal’s Pitch and Interval vectors are 2-dimensional. A matrix maps from two dimensions down to one. That means we’re throwing away a dimension. Every 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 to any flavour of to produce the same result here: to and to are both generic “thirds”, even if their quality is different.
What if we could make the difference between , and etc. disappear? Every variant of the letter name is separated by some number of chromatic semitones, and the chromatic semitone’s Interval vector is . Then is a matrix which has the chromatic semitone in its null space.
That means if we apply as a linear map, the chromatic semitone is sent to 0, and any notes separated by it are mapped to the same number:
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 and the diatonic semitone , also known as the enharmonic diesis , is what we want to make disappear. Then is a matrix which has the enharmonic diesis in its null space.
Octave Abstraction
Section titled “Octave Abstraction”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 and . No, what we want is a linear map that has the octave in its null space: the chroma map .
This map partitions , , etc. into an equivalence class, and , , etc. into a different one. But it has another remarkably useful property: it also orders pitch class names in a series of perfect 5ths.
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 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.
Yet Another View
Section titled “Yet Another View”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. is the 12TET map.
- In 19EDO, a whole step is three EDO-steps while a half step is two. is the 19EDO map.
- In 31EDO, the ratio is 5 to 3. is the 31EDO map.
- In 7EDO, the ratio is 1 to 1: is the 7EDO map.
Changing Basis
Section titled “Changing Basis”So far we’ve only looked at matrices. also have utility as a way to effect a change of basis. In particular, we can change our coordinate system from to something else like , 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:
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.