[][src]Enum tonality::interval::Interval

pub enum Interval {
    Dim2,
    Dim6,
    Dim3,
    Dim7,
    Dim4,
    Dim1,
    Dim5,
    Min2,
    Min6,
    Min3,
    Min7,
    P4,
    Unison,
    P5,
    Maj2,
    Maj6,
    Maj3,
    Maj7,
    Aug4,
    Aug1,
    Aug5,
    Aug2,
    Aug6,
    Aug3,
    Aug7,
}

An interval relates two tonal pitch classes to each other. Note: Intervals are ordered by distance on the line of fifth, not by the number of semitones.

assert!(Interval::P5 < Interval::Aug4);

Variants

Dim2
Dim6
Dim3
Dim7
Dim4
Dim1
Dim5
Min2
Min6
Min3
Min7
P4
Unison
P5
Maj2
Maj6
Maj3
Maj7
Aug4
Aug1
Aug5
Aug2
Aug6
Aug3
Aug7

Implementations

impl Interval[src]

pub const MAX: Interval[src]

The biggest interval is an augmented seventh

pub const MIN: Interval[src]

The smallest interval is a diminished second

pub const DELTA_ENHARMONIC: i8[src]

The number of steps along the line of fifths to an enharmonic variant

#[must_use]pub fn enharmonic(self, other: Interval) -> bool[src]

Whether the two intervals are enharmonic, i.e. represent the same distance in semitones in twelve tone equal temperament.

assert!(Interval::Aug4.enharmonic(Interval::Dim5));
assert!(Interval::Aug2.enharmonic(Interval::Min3));
assert!(!Interval::Unison.enharmonic(Interval::Aug1));

Trait Implementations

impl Add<Interval> for Interval[src]

type Output = Option<Self>

The resulting type after applying the + operator.

impl Add<Interval> for Tpc[src]

type Output = Option<Tpc>

The resulting type after applying the + operator.

impl Clone for Interval[src]

impl Copy for Interval[src]

impl Debug for Interval[src]

impl Default for Interval[src]

impl Eq for Interval[src]

impl FromPrimitive for Interval[src]

impl Ord for Interval[src]

impl PartialEq<Interval> for Interval[src]

impl PartialOrd<Interval> for Interval[src]

impl StructuralEq for Interval[src]

impl StructuralPartialEq for Interval[src]

impl Sub<Interval> for Interval[src]

type Output = Option<Self>

The resulting type after applying the - operator.

impl Sub<Interval> for Tpc[src]

type Output = Option<Tpc>

The resulting type after applying the - operator.

Auto Trait Implementations

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, 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.