pub struct TranspositionChecker { /* private fields */ }Expand description
A set of pitches and its transpositions: music21’s
TranspositionChecker.
Implementations§
Source§impl TranspositionChecker
impl TranspositionChecker
Sourcepub fn transpositions(&self) -> Result<Vec<Vec<Pitch>>>
pub fn transpositions(&self) -> Result<Vec<Vec<Pitch>>>
The set moved up by each of 0 to 11 semitones, spelled as music21
spells a pitch moved by a number: music21’s getTranspositions.
§Errors
A pitch that cannot be moved.
Sourcepub fn normal_orders(&self) -> Result<Vec<Vec<u8>>>
pub fn normal_orders(&self) -> Result<Vec<Vec<u8>>>
The normal order of each transposition: music21’s
listNormalOrders.
§Errors
A pitch that cannot be moved.
Sourcepub fn distinct_normal_orders(&self) -> Result<Vec<Vec<u8>>>
pub fn distinct_normal_orders(&self) -> Result<Vec<Vec<u8>>>
The normal orders, each once, in the order first met: music21’s
listDistinctNormalOrders.
§Errors
A pitch that cannot be moved.
Sourcepub fn distinct_count(&self) -> Result<usize>
pub fn distinct_count(&self) -> Result<usize>
How many distinct transpositions the set has: music21’s
numDistinctTranspositions.
use music21_rs::{Pitch, analysis::transposition::TranspositionChecker};
let augmented = ["C4", "E4", "G#4"].iter().map(|n| n.parse()).collect::<Result<_, _>>()?;
assert_eq!(TranspositionChecker::new(augmented)?.distinct_count()?, 4);§Errors
A pitch that cannot be moved.
Trait Implementations§
Source§impl Clone for TranspositionChecker
impl Clone for TranspositionChecker
Source§impl Debug for TranspositionChecker
impl Debug for TranspositionChecker
Source§impl<'de> Deserialize<'de> for TranspositionChecker
Available on crate feature serde only.
impl<'de> Deserialize<'de> for TranspositionChecker
Available on crate feature
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TranspositionChecker
impl PartialEq for TranspositionChecker
Source§impl Serialize for TranspositionChecker
Available on crate feature serde only.
impl Serialize for TranspositionChecker
Available on crate feature
serde only.impl StructuralPartialEq for TranspositionChecker
Auto Trait Implementations§
impl Freeze for TranspositionChecker
impl RefUnwindSafe for TranspositionChecker
impl Send for TranspositionChecker
impl Sync for TranspositionChecker
impl Unpin for TranspositionChecker
impl UnsafeUnpin for TranspositionChecker
impl UnwindSafe for TranspositionChecker
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
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> ⓘ
Converts
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> ⓘ
Converts
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