pub struct Mos { /* private fields */ }Expand description
How many large and small steps a moment of symmetry has.
This is the pattern with no tuning attached — 5L 2s is the diatonic
scale whether its whole tone is 200 cents or 193, and 2L 5s is mavila’s
anti-diatonic, where the pattern is the same shape but the two step sizes
have traded places.
use music21_rs::tuningsystem::Mos;
let diatonic: Mos = "5L 2s".parse()?;
assert_eq!(diatonic.notes(), 7);
assert_eq!(diatonic.brightest_word(), "LLLsLLs");Implementations§
Source§impl Mos
impl Mos
Sourcepub fn new(
large: UnsignedIntegerType,
small: UnsignedIntegerType,
) -> Result<Self>
pub fn new( large: UnsignedIntegerType, small: UnsignedIntegerType, ) -> Result<Self>
Builds a pattern of large large steps and small small ones.
Errors when neither kind is present, since a scale with no steps at all is not a scale.
Sourcepub fn large(self) -> UnsignedIntegerType
pub fn large(self) -> UnsignedIntegerType
How many large steps the pattern has.
Sourcepub fn small(self) -> UnsignedIntegerType
pub fn small(self) -> UnsignedIntegerType
How many small steps the pattern has.
Sourcepub fn notes(self) -> UnsignedIntegerType
pub fn notes(self) -> UnsignedIntegerType
How many notes there are to a period, which is every step counted.
Sourcepub fn inverted(self) -> Self
pub fn inverted(self) -> Self
The pattern with its two step sizes traded.
5L 2s is the diatonic scale and 2L 5s is mavila’s anti-diatonic:
the same seven notes generated the same way, with the fifth flat enough
that what was the large step became the small one.
Sourcepub fn brightest_word(self) -> String
pub fn brightest_word(self) -> String
The brightest mode’s step word, L for a large step and s for a small.
Brightest is the mode whose large steps come earliest, which for 5L 2s
is Lydian — LLLsLLs, the diatonic scale from F with no accidentals.
Trait Implementations§
impl Copy for Mos
Source§impl<'de> Deserialize<'de> for Mos
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Mos
serde only.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>,
impl Eq for Mos
Source§impl Ord for Mos
impl Ord for Mos
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Mos
impl PartialOrd for Mos
impl StructuralPartialEq for Mos
Auto Trait Implementations§
impl Freeze for Mos
impl RefUnwindSafe for Mos
impl Send for Mos
impl Sync for Mos
impl Unpin for Mos
impl UnsafeUnpin for Mos
impl UnwindSafe for Mos
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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