Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Interval

An Interval is the distance between two notes.

An interval has a (possibly null) number, a (possibly null) quality (e.g. major, minor, perfect, etc.), and a semitone count (which is never null).

The semitone count is an integer, and assumes twelve-tone equal temperament.

An interval may be simple (if it is eight scale degrees or fewer), or complex.

Only simple and complex tritones (TT) have a null number and quality.

Two intervals are equal (and therefore ===) if their numbers and qualities are equal (or, for tritones, their semitone counts are equal). For example, TT, augmented P4, and diminished P5 all have the same semitone count, but are distinct intervals. Intervals can be tested for enharmonic equivalence by comparing their semitone counts, e.g. i1.semitones ==== i2.semitones.

Intervals are interned. interned. This enables the use of the ECMAScript Set to implement sets of intervals.

See Wikipedia: Interval quality.

Hierarchy

  • Interval

Index

Properties

Static all

all: Readonly<object> = intervals.shorthandNames.reduce((acc: { [_: string]: Interval }, name, semitones) => {acc[name] = Interval.fromSemitones(semitones);return acc;},{},)

Static longNames

longNames: ReadonlyArray<string> = intervals.longIntervalNames

Static names

names: ReadonlyArray<string> = intervals.shorthandNames

Accessors

augment

diminish

inverse

  • The inverse interval, such that this interval and its inverse add to unison. For example, M3 and m6 are inverses, as are m3 and M6, P4 and P5, and TT and TT.

    Returns Interval

isComplex

  • get isComplex(): boolean

isSimple

  • get isSimple(): boolean

name

  • get name(): string

natural

number

  • get number(): number | null
  • The diatonic number, within the C major scale. For example M2, m2, d2, and D2 all have a diatonic number of 2. The tritone’s number is null.

    Returns number | null

semitones

  • get semitones(): number
  • The number of semitones. For example, A1 and m2 have one semitone.

    Returns number

Methods

add

toString

  • toString(): string

Static between

Static fromNumber

Static fromSemitones

  • fromSemitones(semitones: number): Interval
  • Semitones doesn't include narrowing or widening by quality.

    Parameters

    • semitones: number

    Returns Interval

Static fromString

Generated using TypeDoc