[][src]Enum musictheory::types::PitchClass

pub enum PitchClass {
    Cn,
    Cs,
    Dn,
    Ds,
    En,
    Fn,
    Fs,
    Gn,
    Gs,
    An,
    As,
    Bn,
}

PitchClass is the unified representation of the 12 semitone harmonics used in western music.

X Axis on Note Table and the Matrix.

Variants

Cn

C Neutral

Cs

C Semitone

Dn

D Neutral

Ds

D Semitone

En

E Natural

Fn

F Natural

Fs

F Semitone

Gn

G Natural

Gs

G Semitone

An

A Natural

As

A Semitone

Bn

B Natural

Methods

impl PitchClass[src]

pub fn wholetone(&self) -> bool[src]

Is this PitchClass a wholetone.

pub fn semitone(&self) -> bool[src]

Is this PitchClass a semitone.

pub fn name(&self, n: Note) -> Option<Note>[src]

Get Note for a given PitchClass if available.

pub fn names(&self) -> &'static [Note][src]

Get a slice of Notes for a given PitchClass.

pub fn tones(&self) -> &'static [Pitch][src]

Get an slice of Pitches for a given PitchClasses.

pub fn group(&self) -> PitchGroup[src]

Get PitchGroup this PitchClasses is the root of.

pub fn groups(&self) -> [PitchGroup; 7][src]

Get an unordered array of PitchGroups this PitchClass is a member of.

pub fn advance(&self) -> PitchClass[src]

Advance to the next PitchClass.

pub fn distance(&self, other: &PitchClass) -> Steps[src]

Get the distance between two PitchClasses.

Trait Implementations

impl Add<Interval> for PitchClass[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Steps> for PitchClass[src]

type Output = Self

The resulting type after applying the + operator.

impl Clone for PitchClass[src]

impl Copy for PitchClass[src]

impl Debug for PitchClass[src]

impl Display for PitchClass[src]

impl Hash for PitchClass[src]

impl PartialEq<PitchClass> for PitchClass[src]

impl PartialEq<PitchClass> for PitchGroup[src]

impl PartialEq<PitchGroup> for PitchClass[src]

impl PartialOrd<PitchClass> for PitchClass[src]

impl StructuralPartialEq for PitchClass[src]

impl Sub<Interval> for PitchClass[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<Steps> for PitchClass[src]

type Output = Self

The resulting type after applying the - operator.

Auto Trait Implementations

impl RefUnwindSafe for PitchClass

impl Send for PitchClass

impl Sync for PitchClass

impl Unpin for PitchClass

impl UnwindSafe for PitchClass

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.