Enum music_note::Pitch
source · [−]#[repr(u8)]
pub enum Pitch {
C,
CSharp,
D,
DSharp,
E,
F,
FSharp,
G,
GSharp,
A,
ASharp,
B,
}Expand description
Pitch class that can be found on the chromatic scale.
Variants
C
CSharp
D
DSharp
E
F
FSharp
G
GSharp
A
ASharp
B
Implementations
sourceimpl Pitch
impl Pitch
sourcepub const fn natural(letter: Natural) -> Self
pub const fn natural(letter: Natural) -> Self
Returns the natural pitch for the given Natural.
use music_note::{Pitch, Natural};
let pitch = Pitch::natural(Natural::F);
assert_eq!(pitch, Pitch::F);pub const fn from_byte(byte: u8) -> Self
pub const fn add_interval(self, interval: Interval) -> Self
pub const fn sub_interval(self, interval: Interval) -> Self
pub const fn into_byte(self) -> u8
pub const fn sub(self, rhs: Self) -> Interval
pub fn transpose(self, key: Pitch, to: Pitch) -> Pitch
Trait Implementations
sourceimpl FromIterator<Pitch> for Set<Pitch, u16>
impl FromIterator<Pitch> for Set<Pitch, u16>
sourcefn from_iter<T: IntoIterator<Item = Pitch>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = Pitch>>(iter: T) -> Self
Creates a value from an iterator. Read more
sourceimpl Ord for Pitch
impl Ord for Pitch
sourceimpl PartialOrd<Pitch> for Pitch
impl PartialOrd<Pitch> for Pitch
sourcefn partial_cmp(&self, other: &Pitch) -> Option<Ordering>
fn partial_cmp(&self, other: &Pitch) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Copy for Pitch
impl Eq for Pitch
impl StructuralEq for Pitch
impl StructuralPartialEq for Pitch
Auto Trait Implementations
impl RefUnwindSafe for Pitch
impl Send for Pitch
impl Sync for Pitch
impl Unpin for Pitch
impl UnwindSafe for Pitch
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more