pub enum Solfa {
C,
D,
E,
F,
G,
A,
B,
}Expand description
Musical note names (solfège syllables).
Represents the seven natural notes in Western music: C, D, E, F, G, A, B. These correspond to the white keys on a piano.
§Examples
let middle_c = Solfa::C;
let a_note = Solfa::A;Variants§
Implementations§
Source§impl Solfa
impl Solfa
Sourcepub const fn score_offset(self) -> i32
pub const fn score_offset(self) -> i32
Returns the position on the musical staff (0-6).
C=0, D=1, E=2, F=3, G=4, A=5, B=6
Sourcepub const fn pitch_offset(self) -> i32
pub const fn pitch_offset(self) -> i32
Returns the pitch offset in semitones from C (0-11).
This represents the number of semitones above C within an octave. C=0, D=2, E=4, F=5, G=7, A=9, B=11
Sourcepub fn from_score_offset(offset: i32) -> Solfa
pub fn from_score_offset(offset: i32) -> Solfa
Creates a solfa from a staff position offset.
Values outside the valid range (0-6) are clamped to C or B.
§Arguments
offset- The staff position (0-6).
Trait Implementations§
Source§impl AddAssign<i32> for Solfa
impl AddAssign<i32> for Solfa
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 Solfa
impl<'de> Deserialize<'de> for Solfa
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 Solfa
impl SubAssign<i32> for Solfa
Source§fn sub_assign(&mut self, rhs: i32)
fn sub_assign(&mut self, rhs: i32)
Performs the
-= operation. Read moreimpl Copy for Solfa
impl Eq for Solfa
impl StructuralPartialEq for Solfa
Auto Trait Implementations§
impl Freeze for Solfa
impl RefUnwindSafe for Solfa
impl Send for Solfa
impl Sync for Solfa
impl Unpin for Solfa
impl UnwindSafe for Solfa
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