pub struct Measure {Show 25 fields
pub number: u32,
pub time_sig: Option<TimeSignature>,
pub key_sig: Option<KeySignature>,
pub clef: Option<Clef>,
pub tempo: Option<u16>,
pub tempo_ramp_to: Option<u16>,
pub instrument_change: Option<InstrumentDefinition>,
pub tablature_change: Option<TablatureConfig>,
pub barline_left: Barline,
pub barline_right: Barline,
pub volta: Option<VoltaBracket>,
pub tempo_text: Option<String>,
pub rehearsal: Option<String>,
pub navigation: Option<String>,
pub expression_text: Option<String>,
pub texts: Vec<StyledText>,
pub figured_bass: Vec<FiguredBassFigure>,
pub harp_pedal_diagrams: Vec<HarpPedalDiagram>,
pub multi_rest_count: Option<u8>,
pub system_break: bool,
pub page_break: bool,
pub section_break: bool,
pub voices: [Vec<Note>; 4],
pub source_voice_numbers: [Option<u32>; 4],
pub actual_length: Option<MeasureLength>,
}Fields§
§number: u32§time_sig: Option<TimeSignature>§key_sig: Option<KeySignature>§clef: Option<Clef>§tempo: Option<u16>§tempo_ramp_to: Option<u16>Optional target BPM at this measure’s end. The playback contract linearly interpolates
BPM across the measure; None keeps a constant tempo until the next change.
instrument_change: Option<InstrumentDefinition>Instrument semantics beginning at this staff-local measure boundary.
tablature_change: Option<TablatureConfig>Tablature tuning/capo beginning at this staff-local measure boundary.
barline_left: Barline§barline_right: Barline§volta: Option<VoltaBracket>§tempo_text: Option<String>§rehearsal: Option<String>Navigation mark: “Segno” | “Coda” | “Fine” | “DaCapo” | “DaCapoAlFine” | “DaCapoAlCoda” | “DalSegno” | “DalSegnoAlFine” | “DalSegnoAlCoda” | “ToCoda”
expression_text: Option<String>Expression / performance text (“dolce”, “espressivo”, “con fuoco”, etc.).
texts: Vec<StyledText>§figured_bass: Vec<FiguredBassFigure>Structured MusicXML figured-bass figures in source order.
harp_pedal_diagrams: Vec<HarpPedalDiagram>Concert-harp pedal diagrams declared by MusicXML <harp-pedals> directions.
multi_rest_count: Option<u8>When ≥ 2, this measure is displayed as a multi-measure rest spanning N measures.
system_break: boolForce a new system (row) after this measure.
page_break: boolForce a new page after this measure.
section_break: boolSemantic section boundary beginning at this measure. Unlike system and page breaks, this is an editor/navigation marker and has no layout implication.
voices: [Vec<Note>; 4]Up to 4 voices; voice 0 is the primary voice.
source_voice_numbers: [Option<u32>; 4]Original positive MusicXML voice numbers associated with the four editable slots.
None retains the legacy convention that slot n serializes as voice n + 1.
This lets import preserve sparse source identifiers such as voices 1 and 5 without
changing the established fixed-slot editing API.
actual_length: Option<MeasureLength>Authored length when it differs from the time signature (pickup or irregular bar).
None means the measure lasts exactly one bar of its time signature.
Implementations§
Source§impl Measure
impl Measure
pub fn empty(numerator: u8, denominator: u8) -> Self
Sourcepub fn duration_beats(&self, time_signature: &TimeSignature) -> f64
pub fn duration_beats(&self, time_signature: &TimeSignature) -> f64
Beats this measure lasts: its actual_length when present and
valid, otherwise its own time signature, otherwise time_signature (the one in effect).