Meantonal has a very straightforward approach to “keys”, “modes” and chromaticism.
The basic principle is that a note like A♭ is the same pitch class regardless of tonal context, but in the key of A♭ major it represents scale degree 1^, whereas in a different key like C major it represents ♭6^. In some keys, like C♯ major, it may not be clear that a note like A♭ has any business appearing at all, even as a chromatically altered scale degree.
Let’s construct a simple context where notes represent scale degrees in the key of “D major”. Here’s a D major scale on the Meantonal grid (octaves are omitted):
D
G
A
B
C♯
D
E
F♯
These notes represent the following scale degrees in the key of D major:
1^
4^
5^
6^
7^
1^
2^
3^
Each of the 7 natural scale degrees in a key or mode can also be approached by diatonic semitone from either side, so we can extend the above set to a chromatic gamut of 17 notes:
A♭
B♭
C
D
E♭
F
G
A
B
C♯
D
E
F♯
G♯
A♯
B♯
C♯
D♯
E♯
These notes represent the following diatonic and chromatically raised/lowered scale degrees in the key of D major:
♭5^
♭6^
♭7^
1^
♭2^
♭3^
4^
5^
6^
7^
1^
2^
3^
♯4^
♯5^
♯6^
7^
♯1^
♯2^
Conveniently, this collection of notes forms a single chain of 17 fifths that partitions neatly into lowered, diatonic and raised degrees:
For any relative diatonic modes like D major and E dorian, the same chain of 17 fifths will result, but the scale degrees represented by these notes will be shifted up or down by a constant offset. Here are the relative modes of D major organised in descending fifths from G lydian to C# locrian:
A tonal context is entirely determined by a tonic and modal offset by which to construct the appropriate chain of fifths, against which we can reconcile pitches into their corresponding scale degrees.
So let’s say we have a note like E4, represented by the Pitch vector (27,10). How do we reconcile it against a tonal context of “D major”? First, let’s introduce a convenient function: the chroma function.
Simply put, Chroma(p) sends a Pitch vector p to a number, which represents the number of fifths (signed) separating it from C. It abstracts away octave information, which you can see by the fact (5,2) is in the null space of the above matrix, so E4, E5, E6 etc. are all sent to the same pitch chroma, namely 4.
If we take the chroma of all the pitches found in the previous table, we get the following:
The chroma of our tonic D is 2, so we can normalise the above to reflect this by subtracting 2 from each value, by defining a new function KeyChroma as follows:
Notes whose KeyChroma in the given tonal context is below −5 or above 11 cannot resolve by diatonic semitone to diatonic degrees, and are seen to be incompatible with that context (as in, they require modulation to gain a sensible reading).
If we now carry out floored division by 7, the above table tells us whether a given note is natural, raised or lowered in the key:
So we know whether a degree is diatonic, raised, lowered, or foreign to a given key. But we still don’t have a way to know what degree it actually represents.
This could be ascertained by taking our original definition of KeyChroma without worrying about modal offset, multiplying each note’s KeyChroma by 4 and then taking floored remainders modulo 7:
This gives correctly ordered scale degree numbering, indexed from 0 rather than 1.
It is, however, easier to simply keep a record of the letter name of the tonic as an offset from C:
C
D
E
F
G
A
B
0
1
2
3
4
5
6
This value can be found for any note by adding its coordinates modulo 7, or from the floored remainder of Chroma(p)÷7
Now all we have to do to ascertain the scale degree an arbitrary note represents is add its coordinates together and subtract the offset from the previous step, modulo 7:
E4=(27,10)→27+10−1=1(mod7)
We correctly arrive at E as degree 1 in D major (remember, these calculations produce 0-indexed scale degrees).