Skip to main content

Note

Struct Note 

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

Represents a midi note number

§Note

  • 12-tone english named note constants are calculated with 0 corresponding to C-2 and 127 to G8, C4 is 72

Implementations§

Source§

impl Note

Source

pub const C2m: Self

Source

pub const Cs2m: Self

Source

pub const D2m: Self

Source

pub const Ds2m: Self

Source

pub const E2m: Self

Source

pub const F2m: Self

Source

pub const Fs2m: Self

Source

pub const G2m: Self

Source

pub const Gs2m: Self

Source

pub const A2m: Self

Source

pub const As2m: Self

Source

pub const B2m: Self

Source

pub const C1m: Self

Source

pub const Cs1m: Self

Source

pub const D1m: Self

Source

pub const Ds1m: Self

Source

pub const E1m: Self

Source

pub const F1m: Self

Source

pub const Fs1m: Self

Source

pub const G1m: Self

Source

pub const Gs1m: Self

Source

pub const A1m: Self

Source

pub const As1m: Self

Source

pub const B1m: Self

Source

pub const C0: Self

Source

pub const Cs0: Self

Source

pub const D0: Self

Source

pub const Ds0: Self

Source

pub const E0: Self

Source

pub const F0: Self

Source

pub const Fs0: Self

Source

pub const G0: Self

Source

pub const Gs0: Self

Source

pub const A0: Self

Source

pub const As0: Self

Source

pub const B0: Self

Source

pub const C1: Self

Source

pub const Cs1: Self

Source

pub const D1: Self

Source

pub const Ds1: Self

Source

pub const E1: Self

Source

pub const F1: Self

Source

pub const Fs1: Self

Source

pub const G1: Self

Source

pub const Gs1: Self

Source

pub const A1: Self

Source

pub const As1: Self

Source

pub const B1: Self

Source

pub const C2: Self

Source

pub const Cs2: Self

Source

pub const D2: Self

Source

pub const Ds2: Self

Source

pub const E2: Self

Source

pub const F2: Self

Source

pub const Fs2: Self

Source

pub const G2: Self

Source

pub const Gs2: Self

Source

pub const A2: Self

Source

pub const As2: Self

Source

pub const B2: Self

Source

pub const C3: Self

Source

pub const Cs3: Self

Source

pub const D3: Self

Source

pub const Ds3: Self

Source

pub const E3: Self

Source

pub const F3: Self

Source

pub const Fs3: Self

Source

pub const G3: Self

Source

pub const Gs3: Self

Source

pub const A3: Self

Source

pub const As3: Self

Source

pub const B3: Self

Source

pub const C4: Self

Source

pub const Cs4: Self

Source

pub const D4: Self

Source

pub const Ds4: Self

Source

pub const E4: Self

Source

pub const F4: Self

Source

pub const Fs4: Self

Source

pub const G4: Self

Source

pub const Gs4: Self

Source

pub const A4: Self

Source

pub const As4: Self

Source

pub const B4: Self

Source

pub const C5: Self

Source

pub const Cs5: Self

Source

pub const D5: Self

Source

pub const Ds5: Self

Source

pub const E5: Self

Source

pub const F5: Self

Source

pub const Fs5: Self

Source

pub const G5: Self

Source

pub const Gs5: Self

Source

pub const A5: Self

Source

pub const As5: Self

Source

pub const B5: Self

Source

pub const C6: Self

Source

pub const Cs6: Self

Source

pub const D6: Self

Source

pub const Ds6: Self

Source

pub const E6: Self

Source

pub const F6: Self

Source

pub const Fs6: Self

Source

pub const G6: Self

Source

pub const Gs6: Self

Source

pub const A6: Self

Source

pub const As6: Self

Source

pub const B6: Self

Source

pub const C7: Self

Source

pub const Cs7: Self

Source

pub const D7: Self

Source

pub const Ds7: Self

Source

pub const E7: Self

Source

pub const F7: Self

Source

pub const Fs7: Self

Source

pub const G7: Self

Source

pub const Gs7: Self

Source

pub const A7: Self

Source

pub const As7: Self

Source

pub const B7: Self

Source

pub const C8: Self

Source

pub const Cs8: Self

Source

pub const D8: Self

Source

pub const Ds8: Self

Source

pub const E8: Self

Source

pub const F8: Self

Source

pub const Fs8: Self

Source

pub const G8: Self

Source

pub const MIN: Self = Self::C2m

The minimum note value

Source

pub const MAX: Self = Self::G8

The maximum note value

Source

pub const fn new(val: u8) -> Self

Create a new Note

§Arguments
  • val - the note number value
§Note
  • The val will be clamped so it is in the 0..127 valid range

Trait Implementations§

Source§

impl Clone for Note

Source§

fn clone(&self) -> Note

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Note

Source§

impl Debug for Note

Source§

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

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

impl Eq for Note

Source§

impl From<Note> for u8

Source§

fn from(value: Note) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Note

Source§

fn from(note: u8) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Note

Source§

fn eq(&self, other: &Note) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq 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 UnsafeUnpin 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<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, 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.