[][src]Trait tune::tuning::Tuning

pub trait Tuning<N> {
    fn pitch_of(&self, note_or_address: N) -> Pitch;
fn find_by_pitch(&self, pitch: Pitch) -> Approximation<N>; }

A Tuning maps notes or, in general, addresses of type N to a Pitch or vice versa.

Required methods

fn pitch_of(&self, note_or_address: N) -> Pitch

Finds the Pitch for the given note or address.

fn find_by_pitch(&self, pitch: Pitch) -> Approximation<N>

Finds the closest note or address for the given Pitch.

Loading content...

Implementations on Foreign Types

impl<S: Borrow<Scl>, K: Borrow<Kbm>> Tuning<PianoKey> for (S, K)[src]

impl<S: Borrow<Scl>, K: Borrow<Kbm>> Tuning<i32> for (S, K)[src]

impl Tuning<Note> for ()[src]

Convenience implementation enabling to write () instead of ConcertPitch::default().

Examples

assert_eq!(Pitch::from_hz(880.0).find_in(&()).approx_value, Note::from_midi_number(81));
Loading content...

Implementors

impl Tuning<Note> for ConcertPitch[src]

impl<'a, S: Scale> Tuning<i32> for SortedTuning<'a, S>[src]

Loading content...