pub struct Unpitched { /* private fields */ }Expand description
A note with no pitch, as a drum stroke: music21’s note.Unpitched.
use music21_rs::percussion::Unpitched;
let stroke = Unpitched::new();
assert_eq!((stroke.display_step(), stroke.display_octave()), ('B', 4));
let low = Unpitched::from_display_name("D5")?;
assert_eq!(low.display_name(), "D5");Implementations§
Source§impl Unpitched
impl Unpitched
Sourcepub fn new() -> Self
pub fn new() -> Self
A stroke displayed on the middle line, B4, which is where music21
puts one that says nothing.
Sourcepub fn from_display_name(name: &str) -> Result<Self>
pub fn from_display_name(name: &str) -> Result<Self>
A stroke displayed where this pitch would stand in treble clef. An accidental in the name is dropped, since a display position has none, and a name with no octave is displayed in the fourth.
Sourcepub fn displayed_at(step: char, octave: IntegerType) -> Result<Self>
pub fn displayed_at(step: char, octave: IntegerType) -> Result<Self>
A stroke displayed at this step and octave.
Sourcepub fn display_step(&self) -> char
pub fn display_step(&self) -> char
The letter of the line or space it is displayed on: music21’s
displayStep.
Sourcepub fn display_octave(&self) -> IntegerType
pub fn display_octave(&self) -> IntegerType
The octave it is displayed in: music21’s displayOctave.
Sourcepub fn display_pitch(&self) -> &Pitch
pub fn display_pitch(&self) -> &Pitch
Where it is displayed, as a pitch, which never has an accidental:
music21’s displayPitch.
Sourcepub fn display_name(&self) -> String
pub fn display_name(&self) -> String
Where it is displayed, as a name: music21’s displayName.
Sourcepub fn set_display(&mut self, step: char, octave: IntegerType) -> Result<()>
pub fn set_display(&mut self, step: char, octave: IntegerType) -> Result<()>
Moves it to another line or space.
Sourcepub fn with_duration(self, duration: Duration) -> Self
pub fn with_duration(self, duration: Duration) -> Self
The same stroke lasting this long.
Sourcepub fn stored_instrument(&self) -> Option<&Instrument>
pub fn stored_instrument(&self) -> Option<&Instrument>
The instrument that plays it, where one is kept on the stroke itself:
music21’s storedInstrument.
Sourcepub fn written(&self) -> &Note
pub fn written(&self) -> &Note
Everything written about the stroke – its length, stem, notehead, beams, tie, lyrics, expressions – as a note standing where it is displayed. The note’s pitch is that position and nothing sounds it.
Sourcepub fn written_mut(&mut self) -> &mut Note
pub fn written_mut(&mut self) -> &mut Note
What is written about the stroke, for editing. Changing the pitch moves where it is displayed.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Unpitched
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Unpitched
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 From<Unpitched> for PercussionNote
impl From<Unpitched> for PercussionNote
Source§impl From<Unpitched> for StreamElement
impl From<Unpitched> for StreamElement
Auto Trait Implementations§
impl Freeze for Unpitched
impl RefUnwindSafe for Unpitched
impl Send for Unpitched
impl Sync for Unpitched
impl Unpin for Unpitched
impl UnsafeUnpin for Unpitched
impl UnwindSafe for Unpitched
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