pub struct SliceWeigher(/* private fields */);Expand description
What a slice of a measure weighs, given its quarter length, the meter’s
accent where it starts, whether it is the last sounding slice of the
measure and whether it is consonant: music21’s weightAlgorithm.
use music21::analysis::reduce_chords::{ReductionOptions, SliceWeigher};
let mut options = ReductionOptions::default();
options.weight_algorithm = SliceWeigher::new(|quarter_length, _, _, _| quarter_length);
assert_eq!(options.weight_algorithm.weigh(2.0, 0.5, false, true), 2.0);Implementations§
Trait Implementations§
Source§impl Clone for SliceWeigher
impl Clone for SliceWeigher
Source§impl Debug for SliceWeigher
impl Debug for SliceWeigher
Auto Trait Implementations§
impl !RefUnwindSafe for SliceWeigher
impl !UnwindSafe for SliceWeigher
impl Forget for SliceWeigher
impl Freeze for SliceWeigher
impl Send for SliceWeigher
impl Sync for SliceWeigher
impl Unpin for SliceWeigher
impl UnsafeUnpin for SliceWeigher
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,
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