Skip to content

expose pedal/@number in mx::api::PedalLineData #411

Description

@webern

mx::api::PedalLineData carries only kind, tickTimePosition and positionData. MusicXML's
<pedal> also has a number attribute (number-level), which is what distinguishes concurrent
pedal lines on one staff -- a damper line and a sostenuto line overlapping, for example.

Today the number is dropped in both directions:

  • DirectionReader reads pedal.type(), pedal.line() and the position attributes, but never
    looks at pedal.number() (src/private/mx/impl/DirectionReader.cpp:676).
  • DirectionWriter::emitPedal sets type and line and never sets number
    (src/private/mx/impl/DirectionWriter.cpp:322).

So a score with two overlapping pedal lines round-trips into a single ambiguous run of events, and
an author using mx::api has no way to say which stop closes which start.

proposed

Give PedalLineData a SpannerNumber number field -- the same identity type wedges and curves
already use -- and wire it through the reader and through NumberResolver in the writer the way
emitWedgeStart / emitWedgeStop do.

deliberately not part of this

<pedal> has no line-type, dash-length, space-length or end-length attributes; it is not in
MusicXML's line-type or dashed-formatting attribute groups (see the generated core::Pedal in
src/private/mx/core/generated/Pedal.h). There is therefore no LineData for PedalLineData to
carry, and a consumer that wants pedal line styling has to pick it itself. Recording this here
because a consumer coming from an older fork that modelled pedals as generic SpannerStart /
SpannerStop will have had a lineData member and may expect one back; that member could never
have round-tripped.

<pedal> also has sign and abbreviated. mx currently uses them only to choose between the line
form (PedalLineData) and the sign form (MarkType::pedal / MarkType::damp). Round-tripping
abbreviated -- the short P / S signs versus the full Ped / Sost -- is a separate gap and
should be a separate issue if it is wanted.

related

Metadata

Metadata

Assignees

No one assigned

    Labels

    aiIssues opened by, or through, a coding agent.apiAffects the mx::api layerfeaturenew feature requestnon-breakingfixes or implementation that do not require breaking changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions