pub struct PartReduction {
pub part_groups: Option<Vec<PartGroup>>,
pub fill_by_measure: bool,
pub segment_by_target: bool,
pub normalize: bool,
pub normalize_by_part: bool,
}Expand description
When and how loudly each part, or group of parts, of a score plays:
music21’s PartReduction, whose getGraphHorizontalBarWeightedData
PartReduction::weighted_spans answers.
Fields§
§part_groups: Option<Vec<PartGroup>>The groups drawn, or each part on its own where there are none.
fill_by_measure: boolWhether a part plays the whole of each measure it has a note in,
rather than each run of notes: music21’s fillByMeasure. A score
with a part holding no measures is read by its runs of notes.
segment_by_target: boolWhether each stretch is cut where a dynamic changes, each piece as
loud as its dynamic: music21’s segmentByTarget.
normalize: boolWhether the weights are scaled so the loudest is one: music21’s
normalize.
normalize_by_part: boolWhether each part’s loudest is one, rather than the score’s:
music21’s normalizeByPart.
Implementations§
Source§impl PartReduction
impl PartReduction
Sourcepub fn weighted_spans(&self, score: &Stream) -> Result<Vec<PartActivity>>
pub fn weighted_spans(&self, score: &Stream) -> Result<Vec<PartActivity>>
Each group’s stretches of playing and their weights: music21’s
process and getGraphHorizontalBarWeightedData.
Each stretch is a measure with a note in it, from its start for its bar’s length, or a run of notes. Its weight is the mean loudness of the dynamics starting in it; cut by dynamic, each piece runs from a dynamic to the next, as loud as it, and the piece before the first is as loud as the last dynamic before the stretch. A stretch with no dynamic takes the weight of the last that had one, and the first, with none before it, a hundredth.
§Errors
A stream that is not a score, a group’s parts with fewer measures than its first, or notes whose runs cannot be found.
Trait Implementations§
Source§impl Clone for PartReduction
impl Clone for PartReduction
Source§impl Debug for PartReduction
impl Debug for PartReduction
Source§impl Default for PartReduction
impl Default for PartReduction
Source§impl<'de> Deserialize<'de> for PartReduction
Available on crate feature serde only.
impl<'de> Deserialize<'de> for PartReduction
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 PartReduction
Source§impl PartialEq for PartReduction
impl PartialEq for PartReduction
Source§impl Serialize for PartReduction
Available on crate feature serde only.
impl Serialize for PartReduction
serde only.impl StructuralPartialEq for PartReduction
Auto Trait Implementations§
impl Freeze for PartReduction
impl RefUnwindSafe for PartReduction
impl Send for PartReduction
impl Sync for PartReduction
impl Unpin for PartReduction
impl UnsafeUnpin for PartReduction
impl UnwindSafe for PartReduction
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