pub struct Spanner { /* private fields */ }Expand description
A mark joining several notes: music21’s Spanner.
Implementations§
Source§impl Spanner
impl Spanner
Sourcepub fn new(kind: SpannerKind, spanned: Vec<usize>) -> Self
pub fn new(kind: SpannerKind, spanned: Vec<usize>) -> Self
A spanner of a kind joining the elements at these positions.
Sourcepub fn with_unplaced(kind: SpannerKind, spanned: Vec<Option<usize>>) -> Self
pub fn with_unplaced(kind: SpannerKind, spanned: Vec<Option<usize>>) -> Self
A spanner of a kind joining elements some of which stand nowhere: a score read from a file may leave a spanner holding a note no stream holds. It still counts that note among its own, so the ends and the length are those of the whole list.
Sourcepub fn glissando(spanned: Vec<usize>) -> Self
pub fn glissando(spanned: Vec<usize>) -> Self
A glissando over the elements at these positions, drawn as a wavy line and played chromatically, as music21’s starts out.
Sourcepub fn glissando_details(&self) -> Option<&Glissando>
pub fn glissando_details(&self) -> Option<&Glissando>
How a glissando is played and what is written along it.
Sourcepub fn set_glissando_details(&mut self, glissando: Option<Glissando>)
pub fn set_glissando_details(&mut self, glissando: Option<Glissando>)
Says how a glissando is played and what is written along it.
Sourcepub fn tremolo(marks: u8, spanned: Vec<usize>) -> Result<Self>
pub fn tremolo(marks: u8, spanned: Vec<usize>) -> Result<Self>
A tremolo alternating between the elements at these positions, with so many strokes through the stems.
§Errors
More than eight strokes, as music21’s TremoloException.
Sourcepub fn number_of_marks(&self) -> Option<u8>
pub fn number_of_marks(&self) -> Option<u8>
How many strokes a tremolo between notes is written with: music21’s
numberOfMarks.
Sourcepub fn set_number_of_marks(&mut self, marks: Option<u8>) -> Result<()>
pub fn set_number_of_marks(&mut self, marks: Option<u8>) -> Result<()>
Says how many strokes a tremolo between notes is written with.
§Errors
More than eight, as music21’s TremoloException.
Sourcepub fn offset(&self) -> FloatType
pub fn offset(&self) -> FloatType
Where the spanner itself stands in the stream holding it: nought for one a score is read with. A pedal mark drawn as a sign and a line says where its line resumes by it.
Sourcepub fn set_offset(&mut self, offset: FloatType)
pub fn set_offset(&mut self, offset: FloatType)
Says where the spanner itself stands in the stream holding it.
Sourcepub fn arpeggio_mark(arpeggio: ArpeggioType, spanned: Vec<usize>) -> Self
pub fn arpeggio_mark(arpeggio: ArpeggioType, spanned: Vec<usize>) -> Self
One arpeggio across the chords at these positions.
Sourcepub fn arpeggio(&self) -> ArpeggioType
pub fn arpeggio(&self) -> ArpeggioType
Which way an arpeggio across several chords is spread.
Sourcepub fn set_arpeggio(&mut self, arpeggio: ArpeggioType)
pub fn set_arpeggio(&mut self, arpeggio: ArpeggioType)
Says which way an arpeggio across several chords is spread.
Sourcepub fn line(spanned: Vec<usize>) -> Self
pub fn line(spanned: Vec<usize>) -> Self
A line over the elements at these positions, solid with a tick down at each end, as music21’s starts out.
Sourcepub fn pedal_mark(pedal: Pedal, spanned: Vec<usize>) -> Self
pub fn pedal_mark(pedal: Pedal, spanned: Vec<usize>) -> Self
A pedal held under the elements at these positions.
Sourcepub fn set_pedal(&mut self, pedal: Option<Pedal>)
pub fn set_pedal(&mut self, pedal: Option<Pedal>)
Says which pedal a pedal mark holds and how it is drawn.
Sourcepub fn ottava(shift: OctaveShift, spanned: Vec<usize>) -> Self
pub fn ottava(shift: OctaveShift, spanned: Vec<usize>) -> Self
An octave line over the elements at these positions, drawn above them as music21’s starts out.
Sourcepub fn shift(&self) -> Option<OctaveShift>
pub fn shift(&self) -> Option<OctaveShift>
How far and which way an octave line moves its notes.
Sourcepub fn set_shift(&mut self, shift: Option<OctaveShift>)
pub fn set_shift(&mut self, shift: Option<OctaveShift>)
Says how far and which way an octave line moves its notes.
Sourcepub fn wedge(kind: SpannerKind, spanned: Vec<usize>) -> Self
pub fn wedge(kind: SpannerKind, spanned: Vec<usize>) -> Self
A hairpin over the elements at these positions, drawn below them and opening fifteen tenths wide, as music21’s starts out.
Sourcepub fn spread(&self) -> Option<FloatType>
pub fn spread(&self) -> Option<FloatType>
How wide a hairpin opens, in tenths of a staff space: music21’s
spread.
Sourcepub fn set_spread(&mut self, spread: Option<FloatType>)
pub fn set_spread(&mut self, spread: Option<FloatType>)
Says how wide a hairpin opens.
Sourcepub fn kind(&self) -> SpannerKind
pub fn kind(&self) -> SpannerKind
Which kind of spanner this is.
Sourcepub fn spanned(&self) -> &[Option<usize>]
pub fn spanned(&self) -> &[Option<usize>]
The positions of the elements it joins, first to last, nothing for one that stands in no stream.
Sourcepub fn is_first(&self, position: usize) -> bool
pub fn is_first(&self, position: usize) -> bool
Whether the element at a position is the first it joins: music21’s
isFirst.
Sourcepub fn is_last(&self, position: usize) -> bool
pub fn is_last(&self, position: usize) -> bool
Whether the element at a position is the last it joins: music21’s
isLast.
Sourcepub fn placement(&self) -> Option<Placement>
pub fn placement(&self) -> Option<Placement>
Which side of the notes it is drawn on, where the score says.
Sourcepub fn set_placement(&mut self, placement: Option<Placement>)
pub fn set_placement(&mut self, placement: Option<Placement>)
Says which side of the notes it is drawn on.
Sourcepub fn line_type(&self) -> Option<&str>
pub fn line_type(&self) -> Option<&str>
How its line is drawn where that is not solid, dashed or dotted:
music21’s style.lineType.
Sourcepub fn set_line_type(&mut self, line_type: Option<String>)
pub fn set_line_type(&mut self, line_type: Option<String>)
Says how its line is drawn.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Spanner
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Spanner
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 Spanner
impl StructuralPartialEq for Spanner
Auto Trait Implementations§
impl Freeze for Spanner
impl RefUnwindSafe for Spanner
impl Send for Spanner
impl Sync for Spanner
impl Unpin for Spanner
impl UnsafeUnpin for Spanner
impl UnwindSafe for Spanner
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