Skip to main content

Note

Struct Note 

Source
pub struct Note {
Show 33 fields pub id: String, pub is_rest: bool, pub pitches: Vec<Pitch>, pub duration: Duration, pub dot_count: u8, pub tie_start: bool, pub tie_end: bool, pub beam: BeamState, pub articulations: Vec<Articulation>, pub dynamic: Option<Dynamic>, pub stem_up: Option<bool>, pub hairpin_start: Option<HairpinKind>, pub hairpin_end: bool, pub tuplet: Option<TupletInfo>, pub chord_symbol: Option<ChordSymbol>, pub is_grace: bool, pub grace_slash: bool, pub ottava_start: Option<OttavaKind>, pub ottava_end: bool, pub lyric: Option<Lyric>, pub pedal_start: bool, pub pedal_end: bool, pub slur_start: bool, pub slur_end: bool, pub arpeggiate: Option<bool>, pub technique_text: Option<String>, pub fingering: Option<u8>, pub string_number: Option<u8>, pub note_head: NoteHead, pub is_cue: bool, pub trill_line_start: bool, pub trill_line_end: bool, pub guitar_technique: Option<GuitarTechnique>,
}

Fields§

§id: String§is_rest: bool§pitches: Vec<Pitch>

Single note: one pitch. Chord: multiple pitches (same duration).

§duration: Duration§dot_count: u8§tie_start: bool§tie_end: bool§beam: BeamState§articulations: Vec<Articulation>§dynamic: Option<Dynamic>§stem_up: Option<bool>§hairpin_start: Option<HairpinKind>§hairpin_end: bool§tuplet: Option<TupletInfo>§chord_symbol: Option<ChordSymbol>§is_grace: bool§grace_slash: bool

Acciaccatura: true (slash through stem). Appoggiatura: false.

§ottava_start: Option<OttavaKind>§ottava_end: bool§lyric: Option<Lyric>§pedal_start: bool§pedal_end: bool§slur_start: bool§slur_end: bool§arpeggiate: Option<bool>

Arpeggiate direction: Some(true) = up, Some(false) = down, None = none.

§technique_text: Option<String>

Technique/style instruction attached to this note (“pizz.”, “arco”, “con sord.”, etc.).

§fingering: Option<u8>

Left-hand fingering number (0 = open / thumb, 1–5 = fingers).

§string_number: Option<u8>

String number for plucked/bowed string instruments (1 = highest string).

§note_head: NoteHead§is_cue: bool

Cue note (small-sized, does not count toward beat total).

§trill_line_start: bool

Start of a multi-note trill line span.

§trill_line_end: bool

End of a multi-note trill line span.

§guitar_technique: Option<GuitarTechnique>

Guitar-specific playing technique (bend, slide, hammer-on, pull-off).

Implementations§

Source§

impl Note

Source

pub fn new(pitch: Pitch, duration: Duration) -> Self

Source

pub fn rest(duration: Duration) -> Self

Source

pub fn beats(&self) -> f64

Trait Implementations§

Source§

impl Clone for Note

Source§

fn clone(&self) -> Note

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Note

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Note

Source§

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 Serialize for Note

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Note

§

impl RefUnwindSafe for Note

§

impl Send for Note

§

impl Sync for Note

§

impl Unpin for Note

§

impl UnsafeUnpin for Note

§

impl UnwindSafe for Note

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.