#[repr(u8)]pub enum Pitch {
C = 0,
CSharp = 1,
D = 2,
DSharp = 3,
E = 4,
F = 5,
FSharp = 6,
G = 7,
GSharp = 8,
A = 9,
ASharp = 10,
B = 11,
}
Expand description
Pitch class that can be found on the chromatic scale.
Variants§
Implementations§
Source§impl 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§
Source§impl Ord for Pitch
impl Ord for Pitch
Source§impl PartialOrd for Pitch
impl PartialOrd for Pitch
impl Copy for Pitch
impl Eq for Pitch
impl StructuralPartialEq for Pitch
Auto Trait Implementations§
impl Freeze for Pitch
impl RefUnwindSafe for Pitch
impl Send for Pitch
impl Sync for Pitch
impl Unpin for Pitch
impl UnwindSafe for Pitch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more