pub struct TurnRecognizer {
pub acceptable_intervals: Vec<Interval>,
}Expand description
Recognizes busy notes as a turn: music21’s TurnRecognizer.
Fields§
§acceptable_intervals: Vec<Interval>The steps a turn may take: music21’s acceptableIntervals, minor,
major and augmented seconds up and down.
Implementations§
Source§impl TurnRecognizer
impl TurnRecognizer
Sourcepub fn is_acceptable_interval(&self, step: &Interval) -> bool
pub fn is_acceptable_interval(&self, step: &Interval) -> bool
Whether a turn may take this step: music21’s isAcceptableInterval.
Sourcepub fn recognize(
&self,
busy: &[StreamElement],
simple: &[StreamElement],
) -> Result<Option<Ornament>>
pub fn recognize( &self, busy: &[StreamElement], simple: &[StreamElement], ) -> Result<Option<Ornament>>
The turn the busy notes play, or nothing: music21’s recognize.
Four notes a second apart, the second and fourth sounding the same pitch, the first two steps one way and the last the other way, are a turn where they start above and an inverted turn where they start below. Given a simple note, it must sound the turn’s main pitch and last as long as the four notes, within a tenth of a quarter.
§Errors
A busy note or a simple note that is not a note, as music21 cannot read its pitch.
Trait Implementations§
Source§impl Clone for TurnRecognizer
impl Clone for TurnRecognizer
Source§impl Debug for TurnRecognizer
impl Debug for TurnRecognizer
Source§impl Default for TurnRecognizer
impl Default for TurnRecognizer
Source§impl<'de> Deserialize<'de> for TurnRecognizer
Available on crate feature serde only.
impl<'de> Deserialize<'de> for TurnRecognizer
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
Source§impl PartialEq for TurnRecognizer
impl PartialEq for TurnRecognizer
Source§impl Serialize for TurnRecognizer
Available on crate feature serde only.
impl Serialize for TurnRecognizer
Available on crate feature
serde only.impl StructuralPartialEq for TurnRecognizer
Auto Trait Implementations§
impl Freeze for TurnRecognizer
impl RefUnwindSafe for TurnRecognizer
impl Send for TurnRecognizer
impl Sync for TurnRecognizer
impl Unpin for TurnRecognizer
impl UnsafeUnpin for TurnRecognizer
impl UnwindSafe for TurnRecognizer
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