pub struct TimespanTree<'a> { /* private fields */ }Expand description
The timespans of a stream in time, each answer in music21’s order: by
where they start, then where they end, then as the stream holds them:
music21’s TimespanTree.
Implementations§
Source§impl<'a> TimespanTree<'a>
impl<'a> TimespanTree<'a>
Sourcepub fn timespans(&self) -> &[ElementTimespan<'a>]
pub fn timespans(&self) -> &[ElementTimespan<'a>]
Every timespan, in order.
Sourcepub fn lowest_position(&self) -> Option<FloatType>
pub fn lowest_position(&self) -> Option<FloatType>
Where the earliest timespan starts: music21’s lowestPosition.
Sourcepub fn highest_position(&self) -> Option<FloatType>
pub fn highest_position(&self) -> Option<FloatType>
Where the latest starts: music21’s highestPosition.
Sourcepub fn all_offsets(&self) -> Vec<FloatType> ⓘ
pub fn all_offsets(&self) -> Vec<FloatType> ⓘ
Each offset a timespan starts at, once, in order: music21’s
allOffsets.
Sourcepub fn all_time_points(&self) -> Vec<FloatType> ⓘ
pub fn all_time_points(&self) -> Vec<FloatType> ⓘ
Each offset a timespan starts or ends at, once, in order: music21’s
allTimePoints.
Sourcepub fn position_after(&self, offset: FloatType) -> Option<FloatType>
pub fn position_after(&self, offset: FloatType) -> Option<FloatType>
The first offset after this one a timespan starts at: music21’s
getPositionAfter.
Sourcepub fn position_before(&self, offset: FloatType) -> Option<FloatType>
pub fn position_before(&self, offset: FloatType) -> Option<FloatType>
The last offset before this one a timespan starts at: music21’s
getPositionBefore.
Sourcepub fn starting_at(&self, offset: FloatType) -> Vec<&ElementTimespan<'a>>
pub fn starting_at(&self, offset: FloatType) -> Vec<&ElementTimespan<'a>>
The timespans starting at an offset: music21’s elementsStartingAt.
Sourcepub fn stopping_at(&self, offset: FloatType) -> Vec<&ElementTimespan<'a>>
pub fn stopping_at(&self, offset: FloatType) -> Vec<&ElementTimespan<'a>>
The timespans ending at an offset: music21’s elementsStoppingAt.
Sourcepub fn overlapping(&self, offset: FloatType) -> Vec<&ElementTimespan<'a>>
pub fn overlapping(&self, offset: FloatType) -> Vec<&ElementTimespan<'a>>
The timespans sounding across an offset, started before it and
ending after: music21’s elementsOverlappingOffset.
Sourcepub fn overlap_time_points(&self, include_stop_points: bool) -> Vec<FloatType> ⓘ
pub fn overlap_time_points(&self, include_stop_points: bool) -> Vec<FloatType> ⓘ
The offsets a timespan starts at, or with include_stop_points also
ends at, where another sounds across: music21’s
overlapTimePoints.
Sourcepub fn verticality_at(&self, offset: FloatType) -> Verticality<'_, 'a>
pub fn verticality_at(&self, offset: FloatType) -> Verticality<'_, 'a>
What starts, stops and sounds across an offset: music21’s
getVerticalityAt.
Sourcepub fn verticality_at_or_before(
&self,
offset: FloatType,
) -> Option<Verticality<'_, 'a>>
pub fn verticality_at_or_before( &self, offset: FloatType, ) -> Option<Verticality<'_, 'a>>
The verticality at an offset where something starts there, or the
one before: music21’s getVerticalityAtOrBefore.
Sourcepub fn verticalities(&self) -> Vec<Verticality<'_, 'a>>
pub fn verticalities(&self) -> Vec<Verticality<'_, 'a>>
The verticality at each offset a timespan starts at, in order:
music21’s iterateVerticalities.
Sourcepub fn maximum_overlap(&self) -> Option<usize>
pub fn maximum_overlap(&self) -> Option<usize>
The most timespans starting at or sounding across any one offset a
timespan starts at, nothing for an empty tree: music21’s
maximumOverlap.
Sourcepub fn remove_timespan(&mut self, index: usize) -> Option<ElementTimespan<'a>>
pub fn remove_timespan(&mut self, index: usize) -> Option<ElementTimespan<'a>>
Takes out the timespan at a place in timespans
and hands it back: music21’s removeTimespan. Nothing is taken
out past the last.
Sourcepub fn remove_timespan_list(&mut self, indices: &[usize])
pub fn remove_timespan_list(&mut self, indices: &[usize])
Takes out the timespans at these places, each read as the tree
stood before any was taken out: music21’s removeTimespanList.
Sourcepub fn all_parts(&self) -> Vec<&'a Stream>
pub fn all_parts(&self) -> Vec<&'a Stream>
The parts the timespans are in, each once: music21’s allParts.
Those of the stream the tree was read from come first, in its
order, and any other after them by id, those with none last. A
timespan in no part is passed over.
Sourcepub fn to_partwise_timespan_trees(&self) -> Vec<TimespanTree<'a>>
pub fn to_partwise_timespan_trees(&self) -> Vec<TimespanTree<'a>>
A tree for each part the timespans are in, holding that part’s
timespans and read from it, in the order of
all_parts: music21’s toPartwiseTimespanTrees.
Sourcepub fn split_at(&mut self, offsets: &[FloatType])
pub fn split_at(&mut self, offsets: &[FloatType])
Cuts every timespan sounding across one of these offsets in two
there: music21’s splitAt. The pieces come after what already
starts and ends where each does.
Sourcepub fn verticalities_nwise(
&self,
n: usize,
reverse: bool,
pad_end: bool,
) -> Result<Vec<Vec<Verticality<'_, 'a>>>>
pub fn verticalities_nwise( &self, n: usize, reverse: bool, pad_end: bool, ) -> Result<Vec<Vec<Verticality<'_, 'a>>>>
Runs of n verticalities, each starting one after the last, in
order or reversed: music21’s iterateVerticalitiesNwise. Where
there are fewer than n, or with pad_end at the end, a run is
filled out with an empty verticality at the tree’s end.
§Errors
A run of no verticalities.
Sourcepub fn consonance_bounded_verticalities(
&self,
) -> Result<Vec<Vec<Verticality<'_, 'a>>>>
pub fn consonance_bounded_verticalities( &self, ) -> Result<Vec<Vec<Verticality<'_, 'a>>>>
Each run of verticalities from one whose chord is consonant to the
next that is, with at least one between: music21’s
iterateConsonanceBoundedVerticalities.
§Errors
A verticality whose pitches make no chord.
Sourcepub fn next_in_same_part(
&self,
timespan: &ElementTimespan<'a>,
) -> Option<&ElementTimespan<'a>>
pub fn next_in_same_part( &self, timespan: &ElementTimespan<'a>, ) -> Option<&ElementTimespan<'a>>
The next timespan after this one, starting at a later offset, in the
same part: music21’s findNextPitchedTimespanInSameStreamByClass.
Sourcepub fn previous_in_same_part(
&self,
timespan: &ElementTimespan<'a>,
) -> Option<&ElementTimespan<'a>>
pub fn previous_in_same_part( &self, timespan: &ElementTimespan<'a>, ) -> Option<&ElementTimespan<'a>>
The timespan before this one, starting at an earlier offset, in the
same part: music21’s findPreviousPitchedTimespanInSameStreamByClass.
Trait Implementations§
Source§impl<'a> Clone for TimespanTree<'a>
impl<'a> Clone for TimespanTree<'a>
Auto Trait Implementations§
impl<'a> Forget for TimespanTree<'a>
impl<'a> Freeze for TimespanTree<'a>
impl<'a> RefUnwindSafe for TimespanTree<'a>
impl<'a> Send for TimespanTree<'a>
impl<'a> Sync for TimespanTree<'a>
impl<'a> Unpin for TimespanTree<'a>
impl<'a> UnsafeUnpin for TimespanTree<'a>
impl<'a> UnwindSafe for TimespanTree<'a>
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