pub struct Placement<M, H> {
pub position_measure: Option<M>,
pub measure_position: FloatType,
pub open_slurs: Vec<OpenSlur<M, H>>,
pub tied_steps: Vec<TiedStep<M>>,
}Expand description
The translator’s placing state: music21’s positionMeasure and
measurePosition, openSlurs and tiedSteps.
Fields§
§position_measure: Option<M>The measure placed in last: music21’s positionMeasure.
measure_position: FloatTypeWhere the next object goes in it: music21’s measurePosition.
Read only while the measure placed in is position_measure.
open_slurs: Vec<OpenSlur<M, H>>Slurs begun and not yet joined.
tied_steps: Vec<TiedStep<M>>Ties begun.
Implementations§
Source§impl<M, H> Placement<M, H>
impl<M, H> Placement<M, H>
Sourcepub fn position<T>(
&mut self,
music: &T,
measure: &M,
) -> Result<FloatType, T::Error>where
T: Placing<Measure = M, Handle = H>,
pub fn position<T>(
&mut self,
music: &T,
measure: &M,
) -> Result<FloatType, T::Error>where
T: Placing<Measure = M, Handle = H>,
music21’s currentPosition: the end of what the measure holds the
first time it is asked in a measure, then where the notes placed
last moved it on to.
§Errors
What the measure’s highest_time raises.
Sourcepub fn mark<T>(
&mut self,
music: &mut T,
measure: &M,
element: T::Element,
) -> Result<(), T::Error>where
T: Placing<Measure = M, Handle = H>,
pub fn mark<T>(
&mut self,
music: &mut T,
measure: &M,
element: T::Element,
) -> Result<(), T::Error>where
T: Placing<Measure = M, Handle = H>,
Sourcepub fn tie<T>(
&mut self,
music: &mut T,
measure: &M,
element: &mut T::Element,
steps: &[((char, IntegerType), bool)],
) -> Result<(), T::Error>where
T: Placing<Measure = M, Handle = H>,
pub fn tie<T>(
&mut self,
music: &mut T,
measure: &M,
element: &mut T::Element,
steps: &[((char, IntegerType), bool)],
) -> Result<(), T::Error>where
T: Placing<Measure = M, Handle = H>,
music21’s setTieFromPitchInfo: the ties of an element about to go
at the current position, from the staff step of each of its notes
and whether the note is tied on. A note is tied from one on the
same step that ends where it starts.
§Errors
What the measure or the element raises.
Sourcepub fn place<T>(
&mut self,
music: &mut T,
measure: &M,
elements: Vec<(T::Element, bool)>,
) -> Result<(), T::Error>where
T: Placing<Measure = M, Handle = H>,
pub fn place<T>(
&mut self,
music: &mut T,
measure: &M,
elements: Vec<(T::Element, bool)>,
) -> Result<(), T::Error>where
T: Placing<Measure = M, Handle = H>,
music21’s appendSimultaneous: notes, chords or rests, each with
whether it is slurred, starting together at the current position,
which then moves on by the shortest of them. Where several start
together, or the measure has voices, each goes in a voice free
there, the longest of them first, or a new one; the notes the
measure holds become its first voice where it has none.
§Errors
What the measure raises.
Sourcepub fn slurs<T>(
&mut self,
music: &mut T,
measure: &M,
group: &[(H, bool, FloatType)],
) -> Result<(), T::Error>where
T: Placing<Measure = M, Handle = H>,
pub fn slurs<T>(
&mut self,
music: &mut T,
measure: &M,
group: &[(H, bool, FloatType)],
) -> Result<(), T::Error>where
T: Placing<Measure = M, Handle = H>,
music21’s setSlurs, for notes just placed together at the current
position, each with whether it is slurred and how long it lasts: a
slurred note is slurred to the next note starting once it has
ended, the one in the same place in its group if there is one, else
the first slurred one, else the first. Slurred notes in a row make
one slur.
§Errors
What the measure raises.
Trait Implementations§
Auto Trait Implementations§
impl<M, H> Forget for Placement<M, H>
impl<M, H> Freeze for Placement<M, H>
impl<M, H> Move for Placement<M, H>
impl<M, H> RefUnwindSafe for Placement<M, H>where
Option<M>: RefUnwindSafe,
Vec<OpenSlur<M, H>>: RefUnwindSafe,
Vec<TiedStep<M>>: RefUnwindSafe,
impl<M, H> Send for Placement<M, H>
impl<M, H> Sync for Placement<M, H>
impl<M, H> Unpin for Placement<M, H>
impl<M, H> UnsafeUnpin for Placement<M, H>
impl<M, H> UnwindSafe for Placement<M, H>
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