pub struct Placed<'a> { /* private fields */ }Expand description
One element of a stream with its place in it: its offset, its offset in the measure holding it and that measure’s number, and the key signature, metre and tempo in force where it stands.
Implementations§
Source§impl<'a> Placed<'a>
impl<'a> Placed<'a>
Sourcepub fn element(&self) -> &'a StreamElement
pub fn element(&self) -> &'a StreamElement
The element itself.
Sourcepub fn measure_offset(&self) -> Option<FloatType>
pub fn measure_offset(&self) -> Option<FloatType>
The offset from the start of the measure holding the element, or
None outside any measure.
Sourcepub fn measure_number(&self) -> Option<IntegerType>
pub fn measure_number(&self) -> Option<IntegerType>
The number of the innermost measure holding the element, or None
outside any measure: music21’s measureNumber.
Sourcepub fn key_signature(&self) -> Option<&'a KeySignature>
pub fn key_signature(&self) -> Option<&'a KeySignature>
The key signature in force where the element stands.
Sourcepub fn time_signature(&self) -> Option<&'a TimeSignature>
pub fn time_signature(&self) -> Option<&'a TimeSignature>
The metre in force where the element stands.
Sourcepub fn metronome_mark(&self) -> Option<&'a MetronomeMark>
pub fn metronome_mark(&self) -> Option<&'a MetronomeMark>
The tempo in force where the element stands.
Sourcepub fn bar_offset(&self) -> Option<FloatType>
pub fn bar_offset(&self) -> Option<FloatType>
Where the element falls in the bar of the meter in force: music21’s
getMeasureOffsetOrMeterModulusOffset. Inside a measure that is its
place in it, padding included; outside one, the meter’s bars are
counted on from where the meter stands. None with no meter.
3/4 at 0, no measures: note at 4.0 -> bar offset 1.0
4/4 pickup, padding 3: note at 0.0 -> bar offset 3.0Sourcepub fn beat(&self) -> Result<Option<FloatType>>
pub fn beat(&self) -> Result<Option<FloatType>>
The beat the element falls on, counted from 1 with the progress
through it as a fraction: music21’s beat. None with no meter,
where music21 answers nan.
§Errors
An offset the meter cannot place, where music21 raises.
Sourcepub fn beat_string(&self) -> Result<Option<String>>
pub fn beat_string(&self) -> Result<Option<String>>
Sourcepub fn beat_duration(&self) -> Result<Option<Duration>>
pub fn beat_duration(&self) -> Result<Option<Duration>>
How long the beat holding the element is: music21’s beatDuration.
None with no meter, where music21 answers a duration of nothing.
§Errors
As Placed::beat.
Sourcepub fn beat_strength(&self) -> Result<Option<FloatType>>
pub fn beat_strength(&self) -> Result<Option<FloatType>>
The metrical accent of the element’s place: music21’s
beatStrength, which weighs a place that starts no partition at
half the smallest weight. None with no meter.
§Errors
As Placed::beat.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for Placed<'a>
impl<'a> Freeze for Placed<'a>
impl<'a> RefUnwindSafe for Placed<'a>
impl<'a> Send for Placed<'a>
impl<'a> Sync for Placed<'a>
impl<'a> Unpin for Placed<'a>
impl<'a> UnsafeUnpin for Placed<'a>
impl<'a> UnwindSafe for Placed<'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