pub enum Octave {
OctM2,
OctM1,
Oct0,
Oct1,
Oct2,
Oct3,
Oct4,
Oct5,
Oct6,
Oct7,
Oct8,
}Expand description
Musical octave number.
Represents the octave of a pitch, ranging from -2 to 8. Octave 3 contains middle C (C3 = MIDI note 60).
§Examples
let middle_octave = Octave::Oct3; // Contains middle C (MIDI note 60)
let low_octave = Octave::Oct0;
let high_octave = Octave::Oct8;Variants§
OctM2
Octave -2
OctM1
Octave -1
Oct0
Octave 0
Oct1
Octave 1
Oct2
Octave 2
Oct3
Octave 3
Oct4
Octave 4
Oct5
Octave 5
Oct6
Octave 6
Oct7
Octave 7
Oct8
Octave 8
Implementations§
Source§impl Octave
impl Octave
Sourcepub const BIAS_VALUE: i32 = 2i32
pub const BIAS_VALUE: i32 = 2i32
Bias value for internal calculations.
Sourcepub const fn from_score_offset(idx: i32) -> Result<Octave, OctaveError>
pub const fn from_score_offset(idx: i32) -> Result<Octave, OctaveError>
Trait Implementations§
Source§impl AddAssign<i32> for Octave
impl AddAssign<i32> for Octave
Source§fn add_assign(&mut self, rhs: i32)
fn add_assign(&mut self, rhs: i32)
Performs the
+= operation. Read moreSource§impl<'de> Deserialize<'de> for Octave
impl<'de> Deserialize<'de> for Octave
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl SubAssign<i32> for Octave
impl SubAssign<i32> for Octave
Source§fn sub_assign(&mut self, rhs: i32)
fn sub_assign(&mut self, rhs: i32)
Performs the
-= operation. Read moreimpl Copy for Octave
impl Eq for Octave
impl StructuralPartialEq for Octave
Auto Trait Implementations§
impl Freeze for Octave
impl RefUnwindSafe for Octave
impl Send for Octave
impl Sync for Octave
impl Unpin for Octave
impl UnwindSafe for Octave
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