#[repr(u8)]pub enum Intervals {
Semitone = 1,
Tone = 2,
Thirds(Third),
Fourths(Fourth),
Fifths(Fifth),
Sevenths(Seventh),
Octave = 12,
}Expand description
Intervals enumerates the various intervals used within music theory. The system considers a semitone to be the smallest interval, while the octave describe the maximum distance between any two pitches.
Variants§
Implementations§
Source§impl Intervals
impl Intervals
Sourcepub const fn is_semitone(&self) -> bool
pub const fn is_semitone(&self) -> bool
Returns true if the enum is Intervals::Semitone otherwise false
Sourcepub const fn is_tone(&self) -> bool
pub const fn is_tone(&self) -> bool
Returns true if the enum is Intervals::Tone otherwise false
Sourcepub const fn is_thirds(&self) -> bool
pub const fn is_thirds(&self) -> bool
Returns true if the enum is Intervals::Thirds otherwise false
Sourcepub const fn is_fourths(&self) -> bool
pub const fn is_fourths(&self) -> bool
Returns true if the enum is Intervals::Fourths otherwise false
Sourcepub const fn is_fifths(&self) -> bool
pub const fn is_fifths(&self) -> bool
Returns true if the enum is Intervals::Fifths otherwise false
Sourcepub const fn is_sevenths(&self) -> bool
pub const fn is_sevenths(&self) -> bool
Returns true if the enum is Intervals::Sevenths otherwise false
Source§impl Intervals
impl Intervals
pub fn dist(a: impl IntoPitch, b: impl IntoPitch) -> Self
pub fn new<A, B, C>(lhs: A, rhs: B) -> Self
Sourcepub fn from_value(value: impl IntoPitch) -> Self
pub fn from_value(value: impl IntoPitch) -> Self
Use the difference between two pitches to determine the interval.
Sourcepub fn octave() -> Self
pub fn octave() -> Self
A convenience method for constructing a new instance of the Octave variant.
Sourcepub fn semitone() -> Self
pub fn semitone() -> Self
A convenience method for constructing a new instance of the Semitone variant.
Sourcepub fn tone() -> Self
pub fn tone() -> Self
A convenience method for constructing a new instance of the Tone variant.
Sourcepub fn third(third: Third) -> Self
pub fn third(third: Third) -> Self
A convenience method for constructing a new variant, Thirds.
pub fn major_third() -> Self
pub fn minor_third() -> Self
Sourcepub fn fourth(fourth: Fourth) -> Self
pub fn fourth(fourth: Fourth) -> Self
A convenience method for constructing a new variant, Fourths.
pub fn perfect_fourth() -> Self
Sourcepub fn fifth(fifth: Fifth) -> Self
pub fn fifth(fifth: Fifth) -> Self
A convenience method for constructing a new variant, Fifths.
pub fn augmented_fifth() -> Self
pub fn diminished_fifth() -> Self
pub fn perfect_fifth() -> Self
Sourcepub fn seventh(seventh: Seventh) -> Self
pub fn seventh(seventh: Seventh) -> Self
A convenience method for constructing a new variant, Sevenths.
pub fn augmented_seventh() -> Self
pub fn diminished_seventh() -> Self
pub fn major_seventh() -> Self
pub fn minor_seventh() -> Self
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)
+= operation. Read moreSource§impl<'de> Deserialize<'de> for Intervals
impl<'de> Deserialize<'de> for Intervals
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 DivAssign<Intervals> for Note
impl DivAssign<Intervals> for Note
Source§fn div_assign(&mut self, rhs: Intervals)
fn div_assign(&mut self, rhs: Intervals)
/= operation. Read moreSource§impl IntervalKind for Intervals
impl IntervalKind for Intervals
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)
*= operation. Read moreSource§impl Ord for Intervals
impl Ord for Intervals
Source§impl PartialOrd for Intervals
impl PartialOrd for Intervals
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)
%= 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)
-= operation. Read more