[][src]Enum musictheory::types::Interval

pub enum Interval {
    First(PerfectQuality),
    Second(MajorQuality),
    Third(MajorQuality),
    Fourth(PerfectQuality),
    Fifth(PerfectQuality),
    Sixth(MajorQuality),
    Seventh(MajorQuality),
    Octave(PerfectQuality),
    Ninth(MajorQuality),
    Tenth(MajorQuality),
    Eleventh(PerfectQuality),
    Twelfth(PerfectQuality),
    Thirteenth(MajorQuality),
    Fourteenth(MajorQuality),
}

Interval is the distance between two PitchClasses.

Variants

First(PerfectQuality)
Second(MajorQuality)
Third(MajorQuality)
Fourth(PerfectQuality)
Fifth(PerfectQuality)
Sixth(MajorQuality)
Seventh(MajorQuality)
Octave(PerfectQuality)
Ninth(MajorQuality)
Tenth(MajorQuality)
Eleventh(PerfectQuality)
Twelfth(PerfectQuality)
Thirteenth(MajorQuality)
Fourteenth(MajorQuality)

Methods

impl Interval[src]

pub fn degree(&self) -> Degree[src]

Degrees are matched to Interval.

pub fn steps(&self) -> Steps[src]

Get Steps measurement for this Interval.

pub fn distance(l: Note, r: Note) -> Option<Interval>[src]

Interval Mappings for Notes

pub fn cents(&self) -> Cents[src]

Get Cents measurement for this Interval.

Trait Implementations

impl Add<Interval> for Note[src]

type Output = Option<Self>

The resulting type after applying the + operator.

impl Add<Interval> for Pitch[src]

type Output = Option<Self>

The resulting type after applying the + operator.

impl Add<Interval> for PitchClass[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Interval> for Tone[src]

type Output = Option<Self>

The resulting type after applying the + operator.

impl Clone for Interval[src]

impl Copy for Interval[src]

impl Debug for Interval[src]

impl Display for Interval[src]

impl PartialEq<Interval> for Interval[src]

impl PartialOrd<Interval> for Interval[src]

impl StructuralPartialEq for Interval[src]

impl Sub<Interval> for Note[src]

type Output = Option<Self>

The resulting type after applying the - operator.

impl Sub<Interval> for Pitch[src]

type Output = Option<Self>

The resulting type after applying the - operator.

impl Sub<Interval> for PitchClass[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<Interval> for Tone[src]

type Output = Option<Self>

The resulting type after applying the - operator.

Auto Trait Implementations

impl RefUnwindSafe for Interval

impl Send for Interval

impl Sync for Interval

impl Unpin for Interval

impl UnwindSafe for Interval

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.