Note

Struct Note 

Source
pub struct Note(/* private fields */);
Expand description

Note pitch representation

Ranges from C-0 to B-9, only exact pitches can be represented.

Implementations§

Source§

impl Note

Source

pub fn freq(self) -> f32

Convert note into its frequency in A=440Hz tuning

Source§

impl Note

Source

pub const C_0: Note

Source

pub const Cs0: Note

Source

pub const D_0: Note

Source

pub const Ds0: Note

Source

pub const E_0: Note

Source

pub const F_0: Note

Source

pub const Fs0: Note

Source

pub const G_0: Note

Source

pub const Gs0: Note

Source

pub const A_0: Note

Source

pub const As0: Note

Source

pub const B_0: Note

Source

pub const C_1: Note

Source

pub const Cs1: Note

Source

pub const D_1: Note

Source

pub const Ds1: Note

Source

pub const E_1: Note

Source

pub const F_1: Note

Source

pub const Fs1: Note

Source

pub const G_1: Note

Source

pub const Gs1: Note

Source

pub const A_1: Note

Source

pub const As1: Note

Source

pub const B_1: Note

Source

pub const C_2: Note

Source

pub const Cs2: Note

Source

pub const D_2: Note

Source

pub const Ds2: Note

Source

pub const E_2: Note

Source

pub const F_2: Note

Source

pub const Fs2: Note

Source

pub const G_2: Note

Source

pub const Gs2: Note

Source

pub const A_2: Note

Source

pub const As2: Note

Source

pub const B_2: Note

Source

pub const C_3: Note

Source

pub const Cs3: Note

Source

pub const D_3: Note

Source

pub const Ds3: Note

Source

pub const E_3: Note

Source

pub const F_3: Note

Source

pub const Fs3: Note

Source

pub const G_3: Note

Source

pub const Gs3: Note

Source

pub const A_3: Note

Source

pub const As3: Note

Source

pub const B_3: Note

Source

pub const C_4: Note

Source

pub const Cs4: Note

Source

pub const D_4: Note

Source

pub const Ds4: Note

Source

pub const E_4: Note

Source

pub const F_4: Note

Source

pub const Fs4: Note

Source

pub const G_4: Note

Source

pub const Gs4: Note

Source

pub const A_4: Note

Source

pub const As4: Note

Source

pub const B_4: Note

Source

pub const C_5: Note

Source

pub const Cs5: Note

Source

pub const D_5: Note

Source

pub const Ds5: Note

Source

pub const E_5: Note

Source

pub const F_5: Note

Source

pub const Fs5: Note

Source

pub const G_5: Note

Source

pub const Gs5: Note

Source

pub const A_5: Note

Source

pub const As5: Note

Source

pub const B_5: Note

Source

pub const C_6: Note

Source

pub const Cs6: Note

Source

pub const D_6: Note

Source

pub const Ds6: Note

Source

pub const E_6: Note

Source

pub const F_6: Note

Source

pub const Fs6: Note

Source

pub const G_6: Note

Source

pub const Gs6: Note

Source

pub const A_6: Note

Source

pub const As6: Note

Source

pub const B_6: Note

Source

pub const C_7: Note

Source

pub const Cs7: Note

Source

pub const D_7: Note

Source

pub const Ds7: Note

Source

pub const E_7: Note

Source

pub const F_7: Note

Source

pub const Fs7: Note

Source

pub const G_7: Note

Source

pub const Gs7: Note

Source

pub const A_7: Note

Source

pub const As7: Note

Source

pub const B_7: Note

Source

pub const C_8: Note

Source

pub const Cs8: Note

Source

pub const D_8: Note

Source

pub const Ds8: Note

Source

pub const E_8: Note

Source

pub const F_8: Note

Source

pub const Fs8: Note

Source

pub const G_8: Note

Source

pub const Gs8: Note

Source

pub const A_8: Note

Source

pub const As8: Note

Source

pub const B_8: Note

Source

pub const C_9: Note

Source

pub const Cs9: Note

Source

pub const D_9: Note

Source

pub const Ds9: Note

Source

pub const E_9: Note

Source

pub const F_9: Note

Source

pub const Fs9: Note

Source

pub const G_9: Note

Source

pub const Gs9: Note

Source

pub const A_9: Note

Source

pub const As9: Note

Source

pub const B_9: Note

Trait Implementations§

Source§

impl Clone for Note

Source§

fn clone(&self) -> Note

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Note

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Note

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Note> for u8

Source§

fn from(note: Note) -> u8

Converts to this type from the input type.
Source§

impl Index<&Note> for SampleMap

Source§

type Output = Option<SampleId>

The returned type after indexing.
Source§

fn index(&self, index: &Note) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<Note> for SampleMap

Source§

type Output = Option<SampleId>

The returned type after indexing.
Source§

fn index(&self, index: Note) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl TryFrom<u8> for Note

Source§

type Error = OutOfRangeError<0, 119>

The type returned in the event of a conversion error.
Source§

fn try_from(raw: u8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for Note

Auto Trait Implementations§

§

impl Freeze for Note

§

impl RefUnwindSafe for Note

§

impl Send for Note

§

impl Sync for Note

§

impl Unpin for Note

§

impl UnwindSafe for Note

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<I, C> Get<&I> for C
where C: Get<I>, I: Copy,

Source§

type Output = <C as Get<I>>::Output

Source§

fn get(&self, index: &I) -> Option<&<C as Get<&I>>::Output>

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.