MusicTheory Documentation

Enumeration Interval

public enum Interval: Comparable  

A custom musical interval.

%21 Interval Interval CustomStringConvertible CustomStringConvertible Interval->CustomStringConvertible Comparable Comparable Interval->Comparable

Conforms To

Comparable
CustomStringConvertible

Initializers

init?(semitone:​)

public init?(semitone: Int)  

Create interval based on the number of semitones contained in it.

Enumeration Cases

octave

case octave

A musical interval that contains 0 or 12 semitones.

m2

case m2

A musical interval that contains 1 semitones.

M2

case M2

A musical interval that contains 2 semitones.

m3

case m3

A musical interval that contains 3 semitones.

M3

case M3

A musical interval that contains 4 semitones.

p4

case p4

A musical interval that contains 5 semitones.

tritone

case tritone

A musical interval that contains 6 semitones.

p5

case p5

A musical interval that contains 7 semitones.

m6

case m6

A musical interval that contains 8 semitones.

M6

case M6

A musical interval that contains 9 semitones.

m7

case m7

A musical interval that contains 10 semitones.

M7

case M7

A musical interval that contains 11 semitones.

Properties

description

public var description: String  

String representation of the interval.

semitones

public var semitones: Int  

Semitones contained in this interval.

is​Consonant

public var isConsonant: Bool