#[repr(C)]pub struct Aspn { /* private fields */ }
Expand description
An american scientific pitch notation (Aspn
) representation of a musical note; this
standard is used to represent notes in a way that is consistent with the
American scientific pitch notation system, which uses a combination of a pitch class
(represented as an integer) and an octave (represented as an Octave
) to uniquely
identify a musical note. The pitch class is the note’s position in the chromatic scale,
while the octave indicates the note’s position in the musical range.
Implementations§
Source§impl Aspn
impl Aspn
pub fn new(class: usize, Octave: Octave) -> Self
Sourcepub fn from_pitch(pitch: usize) -> Self
pub fn from_pitch(pitch: usize) -> Self
returns a new note from a pitch value
Sourcepub fn class_mut(&mut self) -> &mut usize
pub fn class_mut(&mut self) -> &mut usize
returns a mutable reference to the index of the note’s class
Sourcepub const fn octave_mut(&mut self) -> &mut Octave
pub const fn octave_mut(&mut self) -> &mut Octave
returns a mutable reference to the current octave
Sourcepub fn set_octave(&mut self, octave: Octave) -> &mut Self
pub fn set_octave(&mut self, octave: Octave) -> &mut Self
set the octave of the note
Sourcepub fn with_class(self, class: usize) -> Self
pub fn with_class(self, class: usize) -> Self
consumes the current instance to create another with the given pitch class
Sourcepub fn with_octave(self, octave: Octave) -> Self
pub fn with_octave(self, octave: Octave) -> Self
consumes the current instance to create another with the given octave
Trait Implementations§
Source§impl AddAssign<usize> for Aspn
impl AddAssign<usize> for Aspn
Source§fn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
+=
operation. Read moreSource§impl AddAssign for Aspn
impl AddAssign for Aspn
Source§fn add_assign(&mut self, rhs: Aspn)
fn add_assign(&mut self, rhs: Aspn)
+=
operation. Read moreSource§impl<'de> Deserialize<'de> for Aspn
impl<'de> Deserialize<'de> for Aspn
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>,
Source§impl Ord for Aspn
impl Ord for Aspn
Source§impl PartialOrd<Aspn> for usize
impl PartialOrd<Aspn> for usize
Source§impl PartialOrd<usize> for Aspn
impl PartialOrd<usize> for Aspn
Source§impl PartialOrd for Aspn
impl PartialOrd for Aspn
Source§impl SubAssign<usize> for Aspn
impl SubAssign<usize> for Aspn
Source§fn sub_assign(&mut self, rhs: usize)
fn sub_assign(&mut self, rhs: usize)
-=
operation. Read more