The base-40 system is a method for encoding pitches as integers in such a way that the diatonic interval with chromatic alteration is represented as the difference between any two numbers in the system. It can be used to encoding diatonic pitches names with chromatic alterations up to double sharps or flats. The base-40 pitch space can be built up from the property that a minor second is a difference of 5 between two pitch numbers, and major seconds are a difference of 6. The C chroma value is set to the value 2 rather than 0 so that the octave values for C♭ and C♭♭ remain in the same octave as C♮ just above these pitches when using division by the base to extract the octave number. Here is a complete table of the base-40 chroma, using C=2 as the reference:
|Base-40 chroma values (pitch classes)|
The "base-40" name for the system refers to the property that an octave is represented by the integer 40. C4 is 162 while C5 is 162+40=202. To extract the octave number from a pitch value, just divide by 40. To extract the chroma from the pitch value, subtract the octave times 40.
octave = value / 40
chroma = value - octave * 40
To calculate an absolute pitch such as G4 (The G above middle C), multiply the octave by 40 and add the chroma value for the G pitch-class:
pitch = octave * 40 + chroma
G4 = 4 * 40 + 25 = 160 + 25 = 185
Alternatively, G4 can be calculated by adding 3 half-steps (major seconds) and one minor second to C4 (represented as the number 162 in base-40):
G4 = C4 + 3 * M2 + m2 = 162 + 3 * 6 + 5 = 162 + 23 = 185
Note that base-40 pitch representations preserve chromatic alterations of diatonic pitch-classes (up to double sharps/flats). Therefore F♯4 (180) is not in the same as the base-40 pitch G♭4 (184).
A useful property of the base-40 system is that the difference between pitch numbers in the base-40 system represent one-to-one mappings with diatonic intervals with chromatic alterations:
|Base-40 interval classes (d=diminished, m=minor, M=major, P=perfect, A=augmented)|
As an example, consider the interval between E4 (174) and C4 (162) which is 174-162 = 12, representing a major third according to the table
shown above. All intervals can be constructed by observing that major seconds are 6 and minor seconds are 5, so note that a major third, consisting
of two major seconds, is 6 + 6 = 12. Below is an example segment of music with the pitches labeled in
the base-40 system. Try subtracting values and comparing the results to numbers in the base-40 interval-class table above.
Transposition of notes within the base-40 system is simple: just add a constant interval to the base-40 pitch numbers. Below is an example that transposes the music up a major second. In the base-40 system, a major second is represented by the integer 6, so add 6 to all of the pitch numbers in the original music to transpose them up a major second.
There are other higher-order bases that can be used to handle accidentals beyond double sharps and flats. Here is the equation to calculate the base according to the maximum number of sharp/flats on a note:
base = 7 * (2 * max + 1) + 5
For example, when max=2, then base=40. When max=3, then base=54. Another convent base is when max=42 and base=600.