Struct midi_types::Note

source ·
pub struct Note(_);
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 copy 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 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<Note> for Note

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Note

source§

impl Eq for Note

source§

impl StructuralEq for Note

source§

impl StructuralPartialEq for Note

Auto Trait Implementations§

§

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.