Enum persichetti::primitives::IntervalQuality[][src]

pub enum IntervalQuality {
    Diminished(usize),
    Augmented(usize),
    Minor,
    Major,
    Perfect,
}

Represents a chromatic alteration up or down that is applied to a pure IntervalSize.

Similar to Accidental, Diminished or Augmented are zero-indexed.

Due to a quirk of nomenclature, the value of Diminished(n) will vary depending on whether an interval is Perfect or Major. For example, a diminished fifth has an alteration of −1, but a diminished third has an alteration of −2.

QualitySizeChromatic Alteration
MajorSecond, Third, Sixth, Seventh0
MinorSecond, Third, Sixth, Seventh−1
PerfectUnison, Fourth, Fifth0
Diminished(N)Second, Third, Sixth, Seventh−(N+2)
Diminished(N)Unison, Fourth, Fifth−(N+1)
Augmented(N)All IntervalsN+1

Variants

Diminished(usize)
Augmented(usize)
Minor
Major
Perfect

Implementations

impl IntervalQuality[src]

pub fn from_chromatic_span(size: &IntervalSize, span: isize) -> IntervalQuality[src]

Given the interval size, (how many note names are between the top and bottom) calculate an interval quality that will make the Interval span the correct number of whole steps.

Trait Implementations

impl Clone for IntervalQuality[src]

fn clone(&self) -> IntervalQuality[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for IntervalQuality[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Display for IntervalQuality[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Hash for IntervalQuality[src]

fn hash<__H: Hasher>(&self, state: &mut __H)[src]

Feeds this value into the given Hasher. Read more

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given Hasher. Read more

impl PartialEq<IntervalQuality> for IntervalQuality[src]

fn eq(&self, other: &IntervalQuality) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &IntervalQuality) -> bool[src]

This method tests for !=.

impl Eq for IntervalQuality[src]

impl StructuralEq for IntervalQuality[src]

impl StructuralPartialEq for IntervalQuality[src]

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.