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) -> Aspn
Sourcepub fn from_pitch(pitch: usize) -> Aspn
pub fn from_pitch(pitch: usize) -> Aspn
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 Aspn
pub fn set_octave(&mut self, octave: Octave) -> &mut Aspn
set the octave of the note
Sourcepub fn with_class(self, class: usize) -> Aspn
pub fn with_class(self, class: usize) -> Aspn
consumes the current instance to create another with the given pitch class
Sourcepub fn with_octave(self, octave: Octave) -> Aspn
pub fn with_octave(self, octave: Octave) -> Aspn
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 Ord for Aspn
impl Ord for Aspn
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 moreimpl Copy for Aspn
impl Eq for Aspn
impl StructuralPartialEq for Aspn
Auto Trait Implementations§
impl Freeze for Aspn
impl RefUnwindSafe for Aspn
impl Send for Aspn
impl Sync for Aspn
impl Unpin for Aspn
impl UnwindSafe for Aspn
Blanket Implementations§
Source§impl<T> AsWeight<T> for Twhere
T: Clone + IntoWeight<T>,
impl<T> AsWeight<T> for Twhere
T: Clone + IntoWeight<T>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more