Skip to main content

Note

Enum Note 

Source
#[repr(u16)]
pub enum Note {
Show 59 variants FS3 = 185, G3 = 196, GS3 = 208, A3 = 220, AS3 = 233, B3 = 247, C4 = 262, CS4 = 277, D4 = 294, DS4 = 311, E4 = 330, F4 = 349, FS4 = 370, G4 = 392, GS4 = 415, A4 = 440, AS4 = 466, B4 = 494, C5 = 523, CS5 = 554, D5 = 587, DS5 = 622, E5 = 659, F5 = 698, FS5 = 740, G5 = 784, GS5 = 831, A5 = 880, AS5 = 932, B5 = 988, C6 = 1_047, CS6 = 1_109, D6 = 1_175, DS6 = 1_245, E6 = 1_319, F6 = 1_397, FS6 = 1_480, G6 = 1_568, GS6 = 1_661, A6 = 1_760, AS6 = 1_865, B6 = 1_976, C7 = 2_093, CS7 = 2_217, D7 = 2_349, DS7 = 2_489, E7 = 2_637, F7 = 2_794, FS7 = 2_960, G7 = 3_136, GS7 = 3_322, A7 = 3_520, AS7 = 3_729, B7 = 3_951, C8 = 4_186, CS8 = 4_435, D8 = 4_699, DS8 = 4_978, Rest = 0,
}
Expand description

Musical note frequencies in Hz.

Notes are named with the note letter, optional sharp (S), and octave number. For example, A4 is 440 Hz (standard tuning), CS5 is C# in octave 5.

Variants§

§

FS3 = 185

§

G3 = 196

§

GS3 = 208

§

A3 = 220

§

AS3 = 233

§

B3 = 247

§

C4 = 262

§

CS4 = 277

§

D4 = 294

§

DS4 = 311

§

E4 = 330

§

F4 = 349

§

FS4 = 370

§

G4 = 392

§

GS4 = 415

§

A4 = 440

§

AS4 = 466

§

B4 = 494

§

C5 = 523

§

CS5 = 554

§

D5 = 587

§

DS5 = 622

§

E5 = 659

§

F5 = 698

§

FS5 = 740

§

G5 = 784

§

GS5 = 831

§

A5 = 880

§

AS5 = 932

§

B5 = 988

§

C6 = 1_047

§

CS6 = 1_109

§

D6 = 1_175

§

DS6 = 1_245

§

E6 = 1_319

§

F6 = 1_397

§

FS6 = 1_480

§

G6 = 1_568

§

GS6 = 1_661

§

A6 = 1_760

§

AS6 = 1_865

§

B6 = 1_976

§

C7 = 2_093

§

CS7 = 2_217

§

D7 = 2_349

§

DS7 = 2_489

§

E7 = 2_637

§

F7 = 2_794

§

FS7 = 2_960

§

G7 = 3_136

§

GS7 = 3_322

§

A7 = 3_520

§

AS7 = 3_729

§

B7 = 3_951

§

C8 = 4_186

§

CS8 = 4_435

§

D8 = 4_699

§

DS8 = 4_978

§

Rest = 0

Silence (rest)

Implementations§

Source§

impl Note

Source

pub const fn frequency(&self) -> u16

Get the frequency in Hz.

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 Format for Note

Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
Source§

impl From<Note> for u16

Source§

fn from(note: Note) -> 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 · 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 Copy for Note

Source§

impl Eq for Note

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 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.