Interval class final

Distance between two notes.


See also:

Implemented types
Annotations
  • @immutable

Constructors

Interval.fromQualitySemitones(Size size, int semitones)
Creates a new Interval from size and Quality.semitones.
factory
Interval.fromSemitones(Size size, int semitones)
Creates a new Interval from size and Interval.semitones.
factory
Interval.imperfect(Size size, ImperfectQuality quality)
Creates a new Interval allowing only imperfect quality sizes.
const
Interval.parse(String source)
Parse source as an Interval and return its value.
factory
Interval.perfect(Size size, [PerfectQuality quality = PerfectQuality.perfect])
Creates a new Interval allowing only perfect quality sizes.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
inverted Interval
The inverted of this Interval.
no setter
isCompound bool
Whether this Interval is greater than Size.octave.
no setter
isDescending bool
Whether this Interval is descending.
no setter
isDissonant bool
Whether this Interval is dissonant.
no setter
quality Quality
The quality of this Interval.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semitones int
The number of semitones of this Interval.
no setter
simple Interval
The simplified version of this Interval.
no setter
size Size
Number of lines and spaces (or alphabet letters) spanning the two notes, including the beginning and end.
final

Methods

circleFrom<T extends Scalable<T>>(T scalable, {required int distance}) Iterable<T>
The circle of this Interval from scalable up to distance.
compareTo(Interval other) int
Compares this object to another object.
override
descending({bool isDescending = true}) Interval
Returns a copy of this Interval based on isDescending.
distanceBetween<T extends Scalable<T>>(T scalable1, T scalable2) → (int, {List<Scalable<T>> notes})
The iteration distance of this Interval between scalable1 and scalable2, including all visited notes.
isEnharmonicWith(ClassMixin<IntervalClass> other) bool
Whether Class is enharmonically equivalent to other.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
respellBySize(Size size) Interval
This Interval respelled by size while keeping the same number of semitones.
toClass() IntervalClass
Creates a new IntervalClass from semitones.
toString({IntervalNotation system = IntervalNotation.standard}) String
The string representation of this Interval based on system.
override

Operators

operator +(Interval other) Interval
Adds other to this Interval.
operator <(Interval other) bool
Whether this Interval is smaller than other, regardless of their direction (ascending or descending).
operator <=(Interval other) bool
Whether this Interval is smaller than or equal to other, regardless of their direction (ascending or descending).
operator ==(Object other) bool
The equality operator.
override
operator >(Interval other) bool
Whether this Interval is larger than other, regardless of their direction (ascending or descending).
operator >=(Interval other) bool
Whether this Interval is larger than or equal to other, regardless of their direction (ascending or descending).
operator unary-() Interval
The negation of this Interval.

Constants

A1 → const Interval
An augmented unison Interval.
A2 → const Interval
An augmented second Interval.
A3 → const Interval
An augmented third Interval.
A4 → const Interval
An augmented fourth Interval.
A5 → const Interval
An augmented fifth Interval.
A6 → const Interval
An augmented sixth Interval.
A7 → const Interval
An augmented seventh Interval.
A8 → const Interval
An augmented octave Interval.
A9 → const Interval
An augmented ninth Interval.
A11 → const Interval
An augmented eleventh Interval.
A13 → const Interval
An augmented thirteenth Interval.
d1 → const Interval
A diminished unison Interval.
d2 → const Interval
A diminished second Interval.
d3 → const Interval
A diminished third Interval.
d4 → const Interval
A diminished fourth Interval.
d5 → const Interval
A diminished fifth Interval.
d6 → const Interval
A diminished sixth Interval.
d7 → const Interval
A diminished seventh Interval.
d8 → const Interval
A diminished octave Interval.
d9 → const Interval
A diminished ninth Interval.
d11 → const Interval
A diminished eleventh Interval.
d13 → const Interval
A diminished thirteenth Interval.
M2 → const Interval
A major second Interval.
m2 → const Interval
A minor second Interval.
M3 → const Interval
A major third Interval.
m3 → const Interval
A minor third Interval.
M6 → const Interval
A major sixth Interval.
m6 → const Interval
A minor sixth Interval.
M7 → const Interval
A major seventh Interval.
m7 → const Interval
A minor seventh Interval.
M9 → const Interval
A major ninth Interval.
m9 → const Interval
A minor ninth Interval.
M13 → const Interval
A major thirteenth Interval.
m13 → const Interval
A minor thirteenth Interval.
P1 → const Interval
A perfect unison Interval.
P4 → const Interval
A perfect fourth Interval.
P5 → const Interval
A perfect fifth Interval.
P8 → const Interval
A perfect octave Interval.
P11 → const Interval
A perfect eleventh Interval.