pub struct Modifier { /* private fields */ }Expand description
The accidental written beside a figure: music21’s Modifier.
Figured bass has its own marks — a + raises and a / lowers — so the
string it was written with is kept alongside the accidental it means.
Implementations§
Source§impl Modifier
impl Modifier
Sourcepub fn new(written: Option<&str>) -> Result<Self>
pub fn new(written: Option<&str>) -> Result<Self>
Reads one, which may be nothing at all: neither None nor the empty
string says anything about how the note is spelled.
Sourcepub fn accidental(&self) -> Option<&Accidental>
pub fn accidental(&self) -> Option<&Accidental>
The accidental it stands for, and nothing where nothing was written.
Sourcepub fn modify(&self, pitch: &Pitch) -> Result<Pitch>
pub fn modify(&self, pitch: &Pitch) -> Result<Pitch>
The same note spelled as this modifier asks.
A written natural replaces whatever was there; anything else is added to it, so a sharp against a flattened note raises it to a natural.
Sourcepub fn modify_pitch_name(&self, name: &str) -> Result<String>
pub fn modify_pitch_name(&self, name: &str) -> Result<String>
The name of a pitch spelled as this modifier asks: music21’s
modifyPitchName, so a sharp makes D into D#.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Modifier
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Modifier
Available on crate feature
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Modifier
Auto Trait Implementations§
impl Freeze for Modifier
impl RefUnwindSafe for Modifier
impl Send for Modifier
impl Sync for Modifier
impl Unpin for Modifier
impl UnsafeUnpin for Modifier
impl UnwindSafe for Modifier
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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