[][src]Struct musictheory::types::Pitch

pub struct Pitch(_);

Pitch is the unique Combination of PitchClass and Octave.

Midi Note Table

CnCsDnDsEnFnFsGnGsAnAsBn
-101234567891011
0121314151617181920212223
1242526272829303132333435
2363738394041424344454647
3484950515253545556575859
4606162636465666768697071
5727374757677787980818283
6848586878889909192939495
796979899100101102103104105106107
8108109110111112113114115116117118119
9120122123124125126127128!129!130!131!132!
10133!134!135!136!137!138!139!140!141!142!143!144!

Note: Pitches marked with a ! are not translatable to Midi

Methods

impl Pitch[src]

pub fn note(&self) -> Note[src]

Get Natural Note for this Pitch

pub fn tone(&self) -> Tone[src]

Get Natural Tone for this Pitch

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

Get Notes for this Pitch.

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

Get PitchClass of this Pitch

pub fn octave(&self) -> Octave[src]

Get Octave of this Pitch

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

Get the semitone steps between two Pitches.

pub fn frequency(&self, tuning: Tuning) -> f32[src]

Get Frequency of Pitch.

Trait Implementations

impl Add<Interval> for Pitch[src]

type Output = Option<Self>

The resulting type after applying the + operator.

impl Add<Steps> for Pitch[src]

type Output = Option<Self>

The resulting type after applying the + operator.

impl Clone for Pitch[src]

impl Copy for Pitch[src]

impl Debug for Pitch[src]

impl From<u8> for Pitch[src]

impl Hash for Pitch[src]

impl PartialEq<Pitch> for Pitch[src]

impl StructuralPartialEq for Pitch[src]

impl Sub<Interval> for Pitch[src]

type Output = Option<Self>

The resulting type after applying the - operator.

impl Sub<Steps> for Pitch[src]

type Output = Option<Self>

The resulting type after applying the - operator.

Auto Trait Implementations

impl RefUnwindSafe for Pitch

impl Send for Pitch

impl Sync for Pitch

impl Unpin for Pitch

impl UnwindSafe for Pitch

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.