Enum Note

Source
#[repr(u8)]
pub enum Note {
Show 128 variants C1n = 0, Cs1n = 1, D1n = 2, Ds1n = 3, E1n = 4, F1n = 5, Fs1n = 6, G1n = 7, Gs1n = 8, A1n = 9, As1n = 10, B1n = 11, C0 = 12, Cs0 = 13, D0 = 14, Ds0 = 15, E0 = 16, F0 = 17, Fs0 = 18, G0 = 19, Gs0 = 20, A0 = 21, As0 = 22, B0 = 23, C1 = 24, Cs1 = 25, D1 = 26, Ds1 = 27, E1 = 28, F1 = 29, Fs1 = 30, G1 = 31, Gs1 = 32, A1 = 33, As1 = 34, B1 = 35, C2 = 36, Cs2 = 37, D2 = 38, Ds2 = 39, E2 = 40, F2 = 41, Fs2 = 42, G2 = 43, Gs2 = 44, A2 = 45, As2 = 46, B2 = 47, C3 = 48, Cs3 = 49, D3 = 50, Ds3 = 51, E3 = 52, F3 = 53, Fs3 = 54, G3 = 55, Gs3 = 56, A3 = 57, As3 = 58, B3 = 59, C4 = 60, Cs4 = 61, D4 = 62, Ds4 = 63, E4 = 64, F4 = 65, Fs4 = 66, G4 = 67, Gs4 = 68, A4 = 69, As4 = 70, B4 = 71, C5 = 72, Cs5 = 73, D5 = 74, Ds5 = 75, E5 = 76, F5 = 77, Fs5 = 78, G5 = 79, Gs5 = 80, A5 = 81, As5 = 82, B5 = 83, C6 = 84, Cs6 = 85, D6 = 86, Ds6 = 87, E6 = 88, F6 = 89, Fs6 = 90, G6 = 91, Gs6 = 92, A6 = 93, As6 = 94, B6 = 95, C7 = 96, Cs7 = 97, D7 = 98, Ds7 = 99, E7 = 100, F7 = 101, Fs7 = 102, G7 = 103, Gs7 = 104, A7 = 105, As7 = 106, B7 = 107, C8 = 108, Cs8 = 109, D8 = 110, Ds8 = 111, E8 = 112, F8 = 113, Fs8 = 114, G8 = 115, Gs8 = 116, A8 = 117, As8 = 118, B8 = 119, C9 = 120, Cs9 = 121, D9 = 122, Ds9 = 123, E9 = 124, F9 = 125, Fs9 = 126, G9 = 127,
}
Expand description

A note representable in a 7 bit unsigned int. The subscript ‘s’ to a note means sharp. The subscript ‘n’ to an octave means negate, so Cs2n = C# in octave -2.

Because it only uses the least significant 7 bits, any value can be interpreted as either an i8 or a u8 for free (as the representation is the same in both)

This implements both From, Into, From and Into so the names can be completely ignored if prefered

Variants§

§

C1n = 0

§

Cs1n = 1

§

D1n = 2

§

Ds1n = 3

§

E1n = 4

§

F1n = 5

§

Fs1n = 6

§

G1n = 7

§

Gs1n = 8

§

A1n = 9

§

As1n = 10

§

B1n = 11

§

C0 = 12

§

Cs0 = 13

§

D0 = 14

§

Ds0 = 15

§

E0 = 16

§

F0 = 17

§

Fs0 = 18

§

G0 = 19

§

Gs0 = 20

§

A0 = 21

Start of 88-note piano keyboard range

§

As0 = 22

§

B0 = 23

§

C1 = 24

§

Cs1 = 25

§

D1 = 26

§

Ds1 = 27

§

E1 = 28

§

F1 = 29

§

Fs1 = 30

§

G1 = 31

§

Gs1 = 32

§

A1 = 33

§

As1 = 34

§

B1 = 35

§

C2 = 36

Start of 5 octave synth range

§

Cs2 = 37

§

D2 = 38

§

Ds2 = 39

§

E2 = 40

§

F2 = 41

§

Fs2 = 42

§

G2 = 43

§

Gs2 = 44

§

A2 = 45

§

As2 = 46

§

B2 = 47

§

C3 = 48

§

Cs3 = 49

§

D3 = 50

§

Ds3 = 51

§

E3 = 52

§

F3 = 53

§

Fs3 = 54

§

G3 = 55

§

Gs3 = 56

§

A3 = 57

§

As3 = 58

§

B3 = 59

§

C4 = 60

Middle C

§

Cs4 = 61

§

D4 = 62

§

Ds4 = 63

§

E4 = 64

§

F4 = 65

§

Fs4 = 66

§

G4 = 67

§

Gs4 = 68

§

A4 = 69

§

As4 = 70

§

B4 = 71

§

C5 = 72

§

Cs5 = 73

§

D5 = 74

§

Ds5 = 75

§

E5 = 76

§

F5 = 77

§

Fs5 = 78

§

G5 = 79

§

Gs5 = 80

§

A5 = 81

§

As5 = 82

§

B5 = 83

§

C6 = 84

§

Cs6 = 85

§

D6 = 86

§

Ds6 = 87

§

E6 = 88

§

F6 = 89

§

Fs6 = 90

§

G6 = 91

§

Gs6 = 92

§

A6 = 93

§

As6 = 94

§

B6 = 95

§

C7 = 96

end of 5 octave synth range

§

Cs7 = 97

§

D7 = 98

§

Ds7 = 99

§

E7 = 100

§

F7 = 101

§

Fs7 = 102

§

G7 = 103

§

Gs7 = 104

§

A7 = 105

§

As7 = 106

§

B7 = 107

§

C8 = 108

end of 88-note piano keyboard range

§

Cs8 = 109

§

D8 = 110

§

Ds8 = 111

§

E8 = 112

§

F8 = 113

§

Fs8 = 114

§

G8 = 115

§

Gs8 = 116

§

A8 = 117

§

As8 = 118

§

B8 = 119

§

C9 = 120

§

Cs9 = 121

§

D9 = 122

§

Ds9 = 123

§

E9 = 124

§

F9 = 125

§

Fs9 = 126

§

G9 = 127

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 i8

Source§

fn from(note: Note) -> Self

Converts to this type from the input type.
Source§

impl From<Note> for u8

Source§

fn from(note: Note) -> u8

Converts to this type from the input type.
Source§

impl From<Note> for usize

Source§

fn from(note: Note) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for Note

Source§

fn from(n: i8) -> Note

Converts to this type from the input type.
Source§

impl From<u8> for Note

Source§

fn from(n: u8) -> Note

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