pub enum ValidationError {
Show 21 variants
EmptyScore,
PartWithoutStaves {
part: usize,
},
StaffWithoutMeasures {
part: usize,
staff: usize,
},
MeasureCountMismatch {
part: usize,
staff: usize,
expected: usize,
found: usize,
},
InvalidTimeSignature {
part: usize,
staff: usize,
measure: usize,
numerator: u8,
denominator: u8,
},
BeatCount {
part: usize,
staff: usize,
measure: usize,
voice: usize,
expected_beats: f64,
found_beats: f64,
},
OutOfRange {
part_index: usize,
staff_index: usize,
measure_index: usize,
note_index: usize,
pitch_midi: u8,
instrument_range: (u8, u8),
},
InvalidTablature {
part: usize,
staff: usize,
reason: TablatureValidationReason,
},
InvalidStaffPresentation {
part: usize,
staff: usize,
reason: StaffPresentationValidationReason,
},
InvalidInstrumentDefinition {
part: usize,
reason: InstrumentDefinitionValidationReason,
},
InvalidPercussionInstrument {
part: usize,
instrument: usize,
id: String,
reason: PercussionInstrumentValidationReason,
},
InvalidScoreView {
index: usize,
id: String,
reason: ScoreViewValidationReason,
},
InvalidScoreStyleOverride {
property: ViewStyleProperty,
value: f32,
},
InvalidObjectStyleOverride {
index: usize,
reason: ObjectStyleValidationReason,
},
TabPositionOutOfRange {
part: usize,
staff: usize,
measure: usize,
voice: usize,
note: usize,
string: u8,
lines: u8,
},
MicrotoneOutOfRange {
part: usize,
staff: usize,
measure: usize,
voice: usize,
note: usize,
pitch: usize,
microtone_cents: i16,
},
InvalidGuitarBendCurve {
part: usize,
staff: usize,
measure: usize,
voice: usize,
note: usize,
reason: GuitarBendCurveValidationReason,
},
InvalidHarmonyRange {
part: usize,
staff: usize,
measure: usize,
voice: usize,
note: usize,
end: NoteAddr,
},
InvalidSpannerId {
index: usize,
id: String,
},
DuplicateSpannerId {
first: usize,
duplicate: usize,
id: String,
},
InvalidSpannerEndpoint {
index: usize,
id: String,
kind: NotationSpannerKind,
endpoint: SpannerEndpoint,
address: NoteAddr,
},
}Expand description
A structural error found by validate.
Variants§
EmptyScore
The score has no parts to validate.
PartWithoutStaves
A part has no staves.
StaffWithoutMeasures
A staff has no measures.
MeasureCountMismatch
Staves in one part do not cover the same number of measures.
InvalidTimeSignature
A time signature has an unsupported numerator or denominator.
BeatCount
Beat-count mismatch: the notes in a voice don’t fill the time signature.
OutOfRange
A note pitch lies outside the practical range for the part’s GM instrument.
Fields
InvalidTablature
Tablature staff metadata is internally inconsistent.
InvalidStaffPresentation
Renderer-independent staff presentation is internally inconsistent.
InvalidInstrumentDefinition
A part’s stable instrument semantics are internally inconsistent.
InvalidPercussionInstrument
An editable percussion-kit entry is internally inconsistent.
InvalidScoreView
InvalidScoreStyleOverride
A score-wide presentation default is outside the portable style range.
InvalidObjectStyleOverride
An object-attached presentation override has an invalid target, value, or provenance.
TabPositionOutOfRange
A note’s explicit string is not present on its tablature staff.
MicrotoneOutOfRange
A pitch’s microtonal cents component is outside the canonical -99..99 range.
Fields
InvalidGuitarBendCurve
Fields
reason: GuitarBendCurveValidationReasonInvalidHarmonyRange
A harmony continuation points to a note address that does not exist.
InvalidSpannerId
A typed notation span must have a non-empty unique stable identity.
DuplicateSpannerId
A typed notation span has a duplicate stable identity.
InvalidSpannerEndpoint
A typed notation span endpoint does not point to a canonical note.