pub struct SegmentMatcher {
pub matching: Matching,
pub repetitions: Repetitions,
pub include_chords: bool,
}Expand description
Finds the runs of a stream’s notes and chords that are segments or
sets of pitch classes searched for: music21’s SegmentMatcher and the
matchers built on it, chosen by Matching.
Fields§
§matching: MatchingHow a run is told the same as a segment searched for.
repetitions: RepetitionsHow repeated pitch classes are read.
include_chords: boolWhether chords may be in a run.
Implementations§
Source§impl SegmentMatcher
impl SegmentMatcher
Sourcepub fn new(
matching: Matching,
repetitions: Repetitions,
include_chords: bool,
) -> Self
pub fn new( matching: Matching, repetitions: Repetitions, include_chords: bool, ) -> Self
A matcher of this kind, reading repetitions so, chords included or not.
Sourcepub fn find<'a>(
&self,
stream: &'a Stream,
search: &[Vec<IntegerType>],
) -> Result<Vec<ContiguousSegment<'a>>>
pub fn find<'a>( &self, stream: &'a Stream, search: &[Vec<IntegerType>], ) -> Result<Vec<ContiguousSegment<'a>>>
Each run that matches one of the segments searched for, by the
first it matches, in the order searched and found: music21’s find.
A segment the same as one searched for already is passed over. A run
matching two segments is listed for each, as music21 lists the one
run twice, both times as it was matched last.
§Errors
Sourcepub fn label(
&self,
stream: &Stream,
named: &[(String, Vec<IntegerType>)],
convention: Option<TransformationConvention>,
) -> Result<Stream>
pub fn label( &self, stream: &Stream, named: &[(String, Vec<IntegerType>)], convention: Option<TransformationConvention>, ) -> Result<Stream>
A copy of the stream with each run found marked, as music21’s
labelSegments and its kin mark them: a line spanner from its first
note to its last, in its part, and the name of the segment it matched
as a lyric of its first note, unless the note already carries that
lyric. Runs are marked part by part, measure by measure, offset by
offset. With a convention, as music21’s labelTransformedSegments
takes one, each name is followed by the transformations taking the
segment to the run, as ,T0 or ,P0.
§Errors
Trait Implementations§
Source§impl Clone for SegmentMatcher
impl Clone for SegmentMatcher
impl Copy for SegmentMatcher
Source§impl Debug for SegmentMatcher
impl Debug for SegmentMatcher
Auto Trait Implementations§
impl Freeze for SegmentMatcher
impl RefUnwindSafe for SegmentMatcher
impl Send for SegmentMatcher
impl Sync for SegmentMatcher
impl Unpin for SegmentMatcher
impl UnsafeUnpin for SegmentMatcher
impl UnwindSafe for SegmentMatcher
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,
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