[−][src]Struct simple_tones::NotePitch
Represents the pitch of a note as defined here.
Implementations
impl NotePitch
[src]
pub fn new(typ: NoteType, n: i32) -> Self
[src]
pub fn frequency(&self) -> u32
[src]
Converts this NotePitch
to its frequency according to the list of piano key frequencies.
Example
use simple_tones::NotePitch; let note_pitch: NotePitch = "A4".parse().unwrap(); assert_eq!(note_pitch.frequency(), 440);
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for NotePitch
[src]
impl Send for NotePitch
[src]
impl Sync for NotePitch
[src]
impl Unpin for NotePitch
[src]
impl UnwindSafe for NotePitch
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,