Skip to content

Intervals

Much like pitches, Meantonal stores intervals as two-dimensional vectors. In fact, intervals are simply differences between two pitches’ vectors:

C4=(25,10)E4=(27,10)\sf{C_4} = (25, 10) \quad \sf{E_4} = (27, 10)

E4C4=(2,0)\sf{E_4} - \sf{C_4} = (2, 0)

So (2,0)(2, 0) is the unique vector that defines a major third.

Internally, the Interval type is a struct identical to the Pitch type:

typedef struct {
int w;
int h;
} Interval;

Western music distinguishes between two types of semitones: diatonic semitones and chromatic semitones:

  • Diatonic semitones always span two different letters, such as C to D♭.
  • Chromatic semitones are defined as the difference between a whole step and a diatonic semitone, and are always between two different “flavours” of the same letter, such as C to C♯.

Since Meantonal defines the whole step as (1,0)(1, 0), and the diatonic semitone as (0,1)(0, 1) (they are chosen as its standard basis), the chromatic semitone is (1,1)(1, -1).

Different “qualities” of the same generic interval (such as major and minor thirds) are separated by chromatic semitones:

  • A major third was seen to be (2,0)(2, 0)
  • A minor third is (1,1)(1, 1), or (2,0)(1,1)(2, 0) - (1, -1)
  • An augmented third is (3,1)(3, -1), or (2,0)+(1,1)(2, 0) + (1, -1)
  • A diminished third is (0,2)(0, 2), or (2,0)2(1,1)(2, 0) - 2(1, -1)

The octave is given by (5,2)(5, 2), which results naturally from the WWHWWWH formula of the major scale. As such, it is possible to create compound or simple versions of intervals by adding or subtracting multiples of (5,2)(5, 2)

  • A perfect fifth is (3,1)(3, 1)
  • A perfect twelfth is (8,3)(8, 3), or (3,1)+(5,2)(3, 1) + (5, 2)

If subtracting or adding (5,2)(5, 2) causes an interval to cross to the other side of (0,0)(0, 0), it will be inverted at the octave.

  • An ascending major third (2,0)(2, 0) will invert to a descending minor sixth (3,2)(-3, -2) when (5,2)(5, 2) is subtracted.

The algorithm for constructing intervals from standard names like “A4” (for augmented fourth) or “m3” (for minor third) essentially works as follows:

  1. Split the name into its generic size and quality.

    “A4” \rightarrow (‘A’, 4)

  2. Subtract 1 from the generic size to get its stepspan. This is the number of diatonic steps it contains; essentially a zero-indexed representation of its size, which is more amenable to arithmetic than the 1-indexed sizes used in conventional interval names.

    41=34 - 1 = 3

  3. Divide by 7 using Euclidean division. The remainder will represent the simple interval size, and the quotient will represent the number of octaves.

    3÷7=0,  remainder  33 \div 7 = 0, \;\sf{remainder}\; 3

    This allows simple and compound intervals to be handled by a single procedure.

  4. The starting sizes of simple intervals follow a major scale:

    0(0,0)(0,0)
    1(1,0)(1,0)
    2(2,0)(2,0)
    3(2,1)(2,1)
    4(3,1)(3,1)
    5(4,1)(4,1)
    6(5,1)(5,1)

    Choose the corresponding vector and add the appropriate number of octaves obtained in the previous step:

    (2,1)+0(5,2)=(2,1)(2,1) + 0(5,2) = (2,1)

  5. Add the correct number of chromatic semitones to arrive at the correct quality.

    etc.
    AA22
    A11
    P or M00
    m1-1
    d1-1 if size is 00, 33 or 44; else 2-2
    dd2-2 if size is 00, 33 or 44; else 3-3
    etc.

    “A4” (2,1)+1(1,1)=(3,0)\rightarrow (2,1) + 1(1, -1) = (3, 0)