pub struct Articulation { /* private fields */ }Expand description
An articulation: how a note is played, and the numbers that say it.
Two articulations are equal when they are of one kind, as music21’s are; where they sit and what else they say does not count.
use music21_rs::articulations::{Articulation, ArticulationKind};
let accent = Articulation::of_kind(ArticulationKind::StrongAccent);
assert_eq!(accent.name(), "strong accent");
assert!(accent.volume_shift() > 0.1);
assert!(accent.is_a("Accent"));Implementations§
Source§impl Articulation
impl Articulation
Sourcepub fn of_kind(kind: ArticulationKind) -> Self
pub fn of_kind(kind: ArticulationKind) -> Self
An articulation as music21’s class for kind starts out.
Sourcepub fn kind(&self) -> ArticulationKind
pub fn kind(&self) -> ArticulationKind
The kind of articulation this started as.
Sourcepub fn is_a(&self, class: &str) -> bool
pub fn is_a(&self, class: &str) -> bool
Whether this is an articulation of that music21 class or one below
it: is_a("Staccato") holds for a spiccato.
Sourcepub fn name(&self) -> String
pub fn name(&self) -> String
music21’s name: the class name as lower-case words, so a snap
pizzicato is "snap pizzicato".
Sourcepub fn placement(&self) -> Option<&str>
pub fn placement(&self) -> Option<&str>
Where the mark sits: "above", "below", or nothing said.
Sourcepub fn set_placement(&mut self, placement: Option<String>)
pub fn set_placement(&mut self, placement: Option<String>)
Says where the mark sits.
Sourcepub fn volume_shift(&self) -> FloatType
pub fn volume_shift(&self) -> FloatType
How much the mark shifts the note’s volume, between -1 and 1:
music21’s volumeShift, which crate::Volume::realized_with
adds.
Sourcepub fn set_volume_shift(&mut self, shift: FloatType)
pub fn set_volume_shift(&mut self, shift: FloatType)
Changes the volume shift, held between -1 and 1.
Sourcepub fn length_shift(&self) -> FloatType
pub fn length_shift(&self) -> FloatType
What the note’s sounding length is multiplied by: music21’s
lengthShift, 0.7 for a staccato.
Sourcepub fn set_length_shift(&mut self, shift: FloatType)
pub fn set_length_shift(&mut self, shift: FloatType)
Changes the length shift.
Sourcepub fn tie_attach(&self) -> &str
pub fn tie_attach(&self) -> &str
Which part of a note split across a tie keeps the mark: music21’s
tieAttach, "first", "last" or "all".
Sourcepub fn set_tie_attach(&mut self, attach: impl Into<String>)
pub fn set_tie_attach(&mut self, attach: impl Into<String>)
Changes which part keeps the mark.
Sourcepub fn display_text(&self) -> Option<&str>
pub fn display_text(&self) -> Option<&str>
Text written for the mark instead of its usual sign.
Sourcepub fn set_display_text(&mut self, text: Option<String>)
pub fn set_display_text(&mut self, text: Option<String>)
Changes the text written for the mark.
Sourcepub fn set_finger(&mut self, finger: Option<Finger>)
pub fn set_finger(&mut self, finger: Option<Finger>)
Changes the finger.
Sourcepub fn substitution(&self) -> bool
pub fn substitution(&self) -> bool
Whether a fingering or organ mark is a substitution.
Sourcepub fn set_substitution(&mut self, substitution: bool)
pub fn set_substitution(&mut self, substitution: bool)
Says whether it is a substitution.
Sourcepub fn set_alternate(&mut self, alternate: bool)
pub fn set_alternate(&mut self, alternate: bool)
Says whether it is an alternate.
Sourcepub fn number(&self) -> IntegerType
pub fn number(&self) -> IntegerType
A string or fret indication’s number: music21’s number, nought when
none is given.
Sourcepub fn set_number(&mut self, number: IntegerType)
pub fn set_number(&mut self, number: IntegerType)
Changes the string or fret number.
Sourcepub fn point_direction(&self) -> Option<&str>
pub fn point_direction(&self) -> Option<&str>
Which way a strong accent points: music21’s pointDirection.
Sourcepub fn set_point_direction(&mut self, direction: Option<String>)
pub fn set_point_direction(&mut self, direction: Option<String>)
Changes which way it points.
Sourcepub fn set_symbol(&mut self, symbol: Option<String>)
pub fn set_symbol(&mut self, symbol: Option<String>)
Changes the breath mark’s symbol.
Sourcepub fn harmonic_type(&self) -> Option<&str>
pub fn harmonic_type(&self) -> Option<&str>
A string harmonic’s type: "natural" unless said otherwise.
Sourcepub fn set_harmonic_type(&mut self, harmonic_type: Option<String>)
pub fn set_harmonic_type(&mut self, harmonic_type: Option<String>)
Changes the harmonic’s type.
Sourcepub fn pitch_type(&self) -> Option<&str>
pub fn pitch_type(&self) -> Option<&str>
Which pitch a string harmonic’s written note stands for.
Sourcepub fn set_pitch_type(&mut self, pitch_type: Option<String>)
pub fn set_pitch_type(&mut self, pitch_type: Option<String>)
Changes which pitch the written note stands for.
Sourcepub fn bend_alter(&self) -> Option<&ChromaticInterval>
pub fn bend_alter(&self) -> Option<&ChromaticInterval>
How far a fret bend bends the string: music21’s bendAlter.
Sourcepub fn set_bend_alter(&mut self, alter: Option<ChromaticInterval>)
pub fn set_bend_alter(&mut self, alter: Option<ChromaticInterval>)
Changes how far the string is bent.
Sourcepub fn set_pre_bend(&mut self, pre_bend: bool)
pub fn set_pre_bend(&mut self, pre_bend: bool)
Says whether the string is bent beforehand.
Sourcepub fn release(&self) -> Option<FloatType>
pub fn release(&self) -> Option<FloatType>
When the bend is released, in quarter lengths from the start of the note.
Sourcepub fn set_release(&mut self, release: Option<FloatType>)
pub fn set_release(&mut self, release: Option<FloatType>)
Changes when the bend is released.
Sourcepub fn set_with_bar(&mut self, with_bar: Option<String>)
pub fn set_with_bar(&mut self, with_bar: Option<String>)
Changes the whammy-bar movement.
Trait Implementations§
Source§impl Clone for Articulation
impl Clone for Articulation
Source§impl Debug for Articulation
impl Debug for Articulation
Source§impl<'de> Deserialize<'de> for Articulation
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Articulation
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>,
Source§impl PartialEq for Articulation
impl PartialEq for Articulation
Auto Trait Implementations§
impl Freeze for Articulation
impl RefUnwindSafe for Articulation
impl Send for Articulation
impl Sync for Articulation
impl Unpin for Articulation
impl UnsafeUnpin for Articulation
impl UnwindSafe for Articulation
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