[−][src]Enum tonality::interval::Interval
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
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.
fn add(self, rhs: Interval) -> Self::Output
[src]
impl Add<Interval> for Tpc
[src]
type Output = Option<Tpc>
The resulting type after applying the +
operator.
fn add(self, rhs: Interval) -> Self::Output
[src]
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]
fn from_i64(n: i64) -> Option<Self>
[src]
fn from_u64(n: u64) -> Option<Self>
[src]
fn from_isize(n: isize) -> Option<Self>
[src]
fn from_i8(n: i8) -> Option<Self>
[src]
fn from_i16(n: i16) -> Option<Self>
[src]
fn from_i32(n: i32) -> Option<Self>
[src]
fn from_i128(n: i128) -> Option<Self>
[src]
fn from_usize(n: usize) -> Option<Self>
[src]
fn from_u8(n: u8) -> Option<Self>
[src]
fn from_u16(n: u16) -> Option<Self>
[src]
fn from_u32(n: u32) -> Option<Self>
[src]
fn from_u128(n: u128) -> Option<Self>
[src]
fn from_f32(n: f32) -> Option<Self>
[src]
fn from_f64(n: f64) -> Option<Self>
[src]
impl Ord for Interval
[src]
fn cmp(&self, other: &Interval) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Interval> for Interval
[src]
impl PartialOrd<Interval> for Interval
[src]
fn partial_cmp(&self, other: &Interval) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[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.
fn sub(self, rhs: Interval) -> Self::Output
[src]
impl Sub<Interval> for Tpc
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,