pub struct AccidentalMark {
pub part: usize,
pub staff: usize,
pub measure: usize,
pub voice: usize,
pub note_index: usize,
pub pitch_index: usize,
pub alter: i8,
}Expand description
A mandatory (non-courtesy) accidental that must be drawn beside a notehead.
Emitted the first time, within a measure, that a pitch (step + octave, scoped across all voices of a staff — accidentals do not carry across barlines) differs from the alteration established by the key signature or by an earlier note of the same step+octave earlier in the same measure. This is standard music engraving, not a rendering choice, so it is computed here rather than in a renderer.
When both an AccidentalMark and a CourtesyAccidental exist for the same
(part, staff, measure, voice, note_index, pitch_index), the mandatory mark takes
precedence: renderers should draw it plain and suppress the courtesy parentheses.
Fields§
§part: usize§staff: usize§measure: usize§voice: usize§note_index: usize§pitch_index: usizeIndex within note.pitches (0 for single-pitch notes, ≥1 for chords).
alter: i8Accidental to display: 0 = natural, 1 = sharp, -1 = flat, 2 = double-sharp, -2 = double-flat.
Trait Implementations§
Source§impl Clone for AccidentalMark
impl Clone for AccidentalMark
Source§fn clone(&self) -> AccidentalMark
fn clone(&self) -> AccidentalMark
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more