pub struct Note {Show 50 fields
pub id: String,
pub is_rest: bool,
pub is_unpitched: bool,
pub instrument_id: Option<String>,
pub offset_x: Option<f64>,
pub offset_y: Option<f64>,
pub relative_x: Option<f64>,
pub relative_y: Option<f64>,
pub pitches: Vec<Pitch>,
pub tab_position: Option<TabPosition>,
pub tab_positions: Vec<TabPosition>,
pub duration: Duration,
pub dot_count: u8,
pub tie_start: bool,
pub tie_end: bool,
pub pitch_tie_starts: Vec<bool>,
pub pitch_tie_ends: Vec<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 additional_lyrics: Vec<VerseLyric>,
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 glissando_start: bool,
pub glissando_end: bool,
pub cross_staff: Option<CrossStaff>,
pub fingering: Option<u8>,
pub fingerings: Vec<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>,
pub guitar_bend_alter_cents: Option<i16>,
pub guitar_bend_curve: Vec<GuitarBendPoint>,
}Fields§
§id: String§is_rest: bool§is_unpitched: boolMusicXML unpitched note; pitches then stores display placement only.
instrument_id: Option<String>Optional source instrument identifier (for example MusicXML note-level instrument@id).
offset_x: Option<f64>Horizontal nudge in tenths from the note’s computed (rhythmic) position, set by hosts.
MusicXML import does not fill it from default-x, which is an absolute position in the
source engraver’s layout; MusicXML export writes it as part of relative-x.
offset_y: Option<f64>Vertical nudge in tenths from the note’s staff position; see offset_x.
relative_x: Option<f64>MusicXML note-level horizontal adjustment in tenths.
relative_y: Option<f64>MusicXML note-level vertical adjustment in tenths.
pitches: Vec<Pitch>Single note: one pitch. Chord: multiple pitches (same duration).
tab_position: Option<TabPosition>§tab_positions: Vec<TabPosition>One tablature position per pitch; the first entry mirrors tab_position.
This is populated for chords so each pitch can occupy a distinct string.
duration: Duration§dot_count: u8§tie_start: bool§tie_end: bool§pitch_tie_starts: Vec<bool>Per-pitch tie starts, parallel to pitches, for a chord whose notes are not all tied.
Empty (the usual case) means tie_start applies to every pitch. A vector whose length
differs from pitches is ignored in favour of tie_start; see Note::pitch_tie_start.
pitch_tie_ends: Vec<bool>Per-pitch tie ends, parallel to pitches; empty means tie_end applies to every pitch.
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: boolAcciaccatura: true (slash through stem). Appoggiatura: false.
ottava_start: Option<OttavaKind>§ottava_end: bool§lyric: Option<Lyric>§additional_lyrics: Vec<VerseLyric>Lyrics for verse 2 and later, in ascending verse order; verse 1 is 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.).
glissando_start: bool§glissando_end: bool§cross_staff: Option<CrossStaff>§fingering: Option<u8>Left-hand fingering number (0 = open / thumb, 1–5 = fingers).
fingerings: Vec<u8>Alternate left-hand fingering candidates, in source order. The first
entry mirrors fingering when present.
string_number: Option<u8>String number for plucked/bowed string instruments (1 = highest string).
note_head: NoteHead§is_cue: boolCue note (small-sized, does not count toward beat total).
trill_line_start: boolStart of a multi-note trill line span.
trill_line_end: boolEnd of a multi-note trill line span.
guitar_technique: Option<GuitarTechnique>Guitar-specific playing technique (bend, slide, hammer-on, pull-off).
guitar_bend_alter_cents: Option<i16>MusicXML bend amount in cents when supplied by the source.
guitar_bend_curve: Vec<GuitarBendPoint>Ordered bend curve points. Position is relative note time in per-mille (0..=1000).
Implementations§
Source§impl Note
impl Note
Sourcepub fn select_fingering(&self, policy: FingeringSelectionPolicy) -> Option<u8>
pub fn select_fingering(&self, policy: FingeringSelectionPolicy) -> Option<u8>
Select one authored fingering candidate without changing the score.
pub fn new(pitch: Pitch, duration: Duration) -> Self
pub fn rest(duration: Duration) -> Self
Sourcepub fn repeated_copy(&self) -> Note
pub fn repeated_copy(&self) -> Note
Copy for a repeated measure: a fresh id and the same sounding content, without ties, slurs, lines, lyrics, chord symbol, or dynamic, which belong to the written original.
Sourcepub fn pitch_tie_start(&self, index: usize) -> bool
pub fn pitch_tie_start(&self, index: usize) -> bool
Whether the pitch at index starts a tie: its own flag when per-pitch ties are recorded,
otherwise the chord-level tie_start.
Sourcepub fn pitch_tie_end(&self, index: usize) -> bool
pub fn pitch_tie_end(&self, index: usize) -> bool
Whether the pitch at index ends a tie; see Note::pitch_tie_start.
Sourcepub fn set_pitch_ties(&mut self, starts: &[bool], ends: &[bool])
pub fn set_pitch_ties(&mut self, starts: &[bool], ends: &[bool])
Record which pitches of this note start (starts) and end (ends) a tie. The chord-level
flags become “any pitch”, and per-pitch vectors are kept only when the pitches differ, so a
uniformly tied chord stays in the plain form. Slices whose length is not the pitch count
are ignored.
Sourcepub fn pitch_tie_starts_or_uniform(&self) -> Vec<bool>
pub fn pitch_tie_starts_or_uniform(&self) -> Vec<bool>
Per-pitch tie starts as a full vector (chord-level flag repeated when not recorded).
Sourcepub fn pitch_tie_ends_or_uniform(&self) -> Vec<bool>
pub fn pitch_tie_ends_or_uniform(&self) -> Vec<bool>
Per-pitch tie ends as a full vector (chord-level flag repeated when not recorded).
Sourcepub fn is_plain_whole_rest(&self) -> bool
pub fn is_plain_whole_rest(&self) -> bool
A plain whole rest, the form MusicXML <rest measure="yes"/> and MuseScore
durationType=measure import to. Alone in a voice it is a measure rest; see
voice_duration_beats.