pub struct Note { /* private fields */ }Implementations§
Source§impl Note
impl Note
pub fn new(octave: Octave, pitch: impl IntoPitch) -> Self
Sourcepub fn from_pitch(pitch: impl IntoPitch) -> Self
pub fn from_pitch(pitch: impl IntoPitch) -> Self
Returns a new instance of the note with the given pitch; the note’s octave is set to the default octave (4).
Sourcepub fn class(&self) -> Pitches
pub fn class(&self) -> Pitches
Returns an instance of the note’s PitchClass. Each pitch class is a synmoblic representation of a group of frequencies, which are separated by a factor of 2^(1/12).
Sourcepub fn octave_mut(&mut self) -> &mut Octave
pub fn octave_mut(&mut self) -> &mut Octave
Returns a mutable reference to the note’s octave
Sourcepub fn set_octave(&mut self, octave: Octave)
pub fn set_octave(&mut self, octave: Octave)
Sets the note’s octave
Sourcepub fn with_octave(self, octave: Octave) -> Self
pub fn with_octave(self, octave: Octave) -> Self
Returns a new instance of the note with the given octave
Sourcepub fn with_pitch(self, Pitch: Pitch) -> Note
pub fn with_pitch(self, Pitch: Pitch) -> Note
Returns a new instance of the note with the given pitch
Trait Implementations§
Source§impl AddAssign<Intervals> for Note
impl AddAssign<Intervals> for Note
Source§fn add_assign(&mut self, rhs: Intervals)
fn add_assign(&mut self, rhs: Intervals)
Performs the
+= operation. Read moreSource§impl AddAssign for Note
impl AddAssign for Note
Source§fn add_assign(&mut self, rhs: Note)
fn add_assign(&mut self, rhs: Note)
Performs the
+= operation. Read moreSource§impl<'de> Deserialize<'de> for Note
impl<'de> Deserialize<'de> for Note
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 DivAssign<Intervals> for Note
impl DivAssign<Intervals> for Note
Source§fn div_assign(&mut self, rhs: Intervals)
fn div_assign(&mut self, rhs: Intervals)
Performs the
/= operation. Read moreSource§impl DivAssign for Note
impl DivAssign for Note
Source§fn div_assign(&mut self, rhs: Note)
fn div_assign(&mut self, rhs: Note)
Performs the
/= operation. Read moreSource§impl IntervalOps for Note
impl IntervalOps for Note
type Output = Note
Source§fn add_interval<I: IntoInterval>(&self, interval: I) -> Self::Output
fn add_interval<I: IntoInterval>(&self, interval: I) -> Self::Output
Add an interval to the given object
Source§fn sub_interval<I: IntoInterval>(&self, interval: I) -> Self::Output
fn sub_interval<I: IntoInterval>(&self, interval: I) -> Self::Output
Subtract an interval from the given object
fn add_semitone(&self) -> Self::Output
fn sub_semitone(&self) -> Self::Output
fn add_tone(&self) -> Self::Output
fn sub_tone(&self) -> Self::Output
fn add_major_third(&self) -> Self::Output
fn sub_major_third(&self) -> Self::Output
fn add_minor_third(&self) -> Self::Output
fn sub_minor_third(&self) -> Self::Output
fn add_perfect_fifth(&self) -> Self::Output
fn sub_perfect_fifth(&self) -> Self::Output
fn add_augmented_fifth(&self) -> Self::Output
fn sub_augmented_fifth(&self) -> Self::Output
fn add_diminished_fifth(&self) -> Self::Output
fn sub_diminished_fifth(&self) -> Self::Output
fn add_augmented_seventh(&self) -> Self::Output
fn sub_augmented_seventh(&self) -> Self::Output
fn add_diminished_seventh(&self) -> Self::Output
fn sub_diminished_seventh(&self) -> Self::Output
fn add_major_seventh(&self) -> Self::Output
fn sub_major_seventh(&self) -> Self::Output
fn add_minor_seventh(&self) -> Self::Output
fn sub_minor_seventh(&self) -> Self::Output
fn add_octave(&self) -> Self::Output
fn sub_octave(&self) -> Self::Output
Source§impl MulAssign<Intervals> for Note
impl MulAssign<Intervals> for Note
Source§fn mul_assign(&mut self, rhs: Intervals)
fn mul_assign(&mut self, rhs: Intervals)
Performs the
*= operation. Read moreSource§impl MulAssign for Note
impl MulAssign for Note
Source§fn mul_assign(&mut self, rhs: Note)
fn mul_assign(&mut self, rhs: Note)
Performs the
*= operation. Read moreSource§impl Ord for Note
impl Ord for Note
Source§impl PartialOrd for Note
impl PartialOrd for Note
Source§impl RemAssign<Intervals> for Note
impl RemAssign<Intervals> for Note
Source§fn rem_assign(&mut self, rhs: Intervals)
fn rem_assign(&mut self, rhs: Intervals)
Performs the
%= operation. Read moreSource§impl RemAssign for Note
impl RemAssign for Note
Source§fn rem_assign(&mut self, rhs: Note)
fn rem_assign(&mut self, rhs: Note)
Performs the
%= operation. Read moreSource§impl SubAssign<Intervals> for Note
impl SubAssign<Intervals> for Note
Source§fn sub_assign(&mut self, rhs: Intervals)
fn sub_assign(&mut self, rhs: Intervals)
Performs the
-= operation. Read moreSource§impl SubAssign for Note
impl SubAssign for Note
Source§fn sub_assign(&mut self, rhs: Note)
fn sub_assign(&mut self, rhs: Note)
Performs the
-= operation. Read moreimpl Copy for Note
impl Eq for Note
impl Send for Note
impl StructuralPartialEq for Note
impl Sync for Note
Auto Trait Implementations§
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