[][src]Struct tune::tuning::ConcertPitch

pub struct ConcertPitch { /* fields omitted */ }

Implementations

impl ConcertPitch[src]

let c4 = Note::from_midi_number(60);
let a4 = Note::from_midi_number(69);

let standard_tuning = ConcertPitch::from_a4_pitch(Pitch::from_hz(440.0));
assert_approx_eq!(standard_tuning.pitch_of(c4).as_hz(), 261.625565);
assert_approx_eq!(standard_tuning.pitch_of(a4).as_hz(), 440.0);

let healing_tuning = ConcertPitch::from_a4_pitch(Pitch::from_hz(432.0));
assert_approx_eq!(healing_tuning.pitch_of(c4).as_hz(), 256.868737);
assert_approx_eq!(healing_tuning.pitch_of(a4).as_hz(), 432.0);

pub fn from_a4_pitch(a4_pitch: impl Pitched) -> Self[src]

pub fn from_note_and_pitch(note: Note, pitched: impl Pitched) -> Self[src]

let c4 = Note::from_midi_number(60);
let a4 = Note::from_midi_number(69);

let fixed_c4_tuning = ConcertPitch::from_note_and_pitch(c4, Pitch::from_hz(260.0));
assert_approx_eq!(fixed_c4_tuning.pitch_of(c4).as_hz(), 260.0);
assert_approx_eq!(fixed_c4_tuning.pitch_of(a4).as_hz(), 437.266136);

pub fn a4_pitch(self) -> Pitch[src]

Trait Implementations

impl Clone for ConcertPitch[src]

impl Copy for ConcertPitch[src]

impl Debug for ConcertPitch[src]

impl Default for ConcertPitch[src]

The default ConcertPitch is A4 sounding at 440 Hz.

Examples

assert_approx_eq!(ConcertPitch::default().a4_pitch().as_hz(), 440.0);

impl PartialEq<ConcertPitch> for ConcertPitch[src]

impl PartialOrd<ConcertPitch> for ConcertPitch[src]

impl StructuralPartialEq for ConcertPitch[src]

impl Tuning<Note> for ConcertPitch[src]

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.