An interval is a measure of the distance between two pitches. E.g. a "perfect fifth".
Get the interval between two pitches:
betweenPitches Pitch.c4 Pitch.g4 == perfectFifthCheck whether two intervals are equivalent:
isEqualTo augmentedFourth diminishedFifth == TrueCheck whether the distance of one interval is greater than another:
isGreaterThan perfectFifth perfectUnison == TrueCheck whether the distance of one interval is less than another:
isLessThan perfectFifth perfectUnison == FalseAdd two intervals together:
add majorSecond majorThird == augmentedFourthSubtract two intervals:
subtract majorSecond minorThird == minorSecondConvert any interval to its simple form. A simple interval is one that spans an octave or less.
simplify majorThirteenth == majorSixthAdd an octave to an interval:
addOctave majorSecond == majorNinthIntervals have direction: a perfect fifth up is different from a perfect fifth down.
Reverse the direction of an interval
Find out whether an interval is in the "up" direction:
isUp majorThird == TrueFind out whether an interval is in the "down" direction:
isDown (reverse majorThird) == TrueGet the short name of an interval:
toString perfectFifth == "P5"Intervals in the "down" direction are shown with a negative sign:
toString (reverse perfectFifth) == "-P5"Create a range of intervals:
range perfectUnison perfectFifth
== { min = perfectUnison
, max = perfectFifth
}