Pitch class

Because octave-related pitches belong to the same class, when an octave is reached, the numbers begin again at zero.

This cyclical system is referred to as modular arithmetic and, in the usual case of chromatic twelve-tone scales, pitch-class numbering is "modulo 12" (customarily abbreviated "mod 12" in the music-theory literature)—that is, every twelfth member is identical.

One can map a pitch's fundamental frequency f (measured in hertz) to a real number p using the equation This creates a linear pitch space in which octaves have size 12, semitones (the distance between adjacent keys on the piano keyboard) have size 1, and middle C (C4) is assigned the number 0 (thus, the pitches on piano are −39 to +48).

These numbers provide numerical alternatives to the letter names of elementary music theory: and so on.

One advantage of this system is that it ignores the "spelling" of notes (B♯, C♮ and D are all 0) according to their diatonic functionality.

Both this and the issue in the paragraph directly above may be viewed as disadvantages (though mathematically, an element "4" should not be confused with the function "+4").

If a and b are two positive rational numbers, they belong to the same pitch class if and only if for some integer n. Therefore, we can represent pitch classes in this system using ratios ⁠p/q⁠ where neither p nor q is divisible by 2, that is, as ratios of odd integers.

Alternatively, we can represent just intonation pitch classes by reducing to the octave, 1 ≤ ⁠p/q⁠ < 2.

For example, one can label the pitch classes of n-tone equal temperament using the integers 0 to n − 1.

Labeling these pitch classes {0, 1, 2, 3 ..., 18} simplifies the arithmetic used in pitch-class set manipulations.

The disadvantage of the scale-based system is that it assigns an infinite number of different names to chords that sound identical.