Skip to content

feat: model all pedal types in mx::api - #364

Merged
webern merged 2 commits into
mainfrom
claude/pedal-types-modeling-s6eab2
Jul 19, 2026
Merged

feat: model all pedal types in mx::api#364
webern merged 2 commits into
mainfrom
claude/pedal-types-modeling-s6eab2

Conversation

@webern

@webern webern commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Human Summary

Changes the way pedals are modeled into two different things. Pedal marks, which are the old fashioned Ped and * marks, and a separate type for more modern lines.

Summary

DirectionReader::parsePedal handled only PedalType start/stop and silently dropped
sostenuto, change, continue, discontinue, and resume, even though core::PedalType
carries all seven tags. This was the last unmodeled item in #324.

The shape decision (called for in #324) was to store the pedal type as one fact in one field
rather than scatter it across start/stop/other vectors. This replaces the pedalStarts /
pedalStops spanner vectors on DirectionData with a single std::vector<PedalData> pedals,
where each PedalData carries a PedalKind enum covering every pedal-line type. Each pedal event
stands on its own and is placed at its own tick, so the model has no neighbor-dependent meaning.

  • New PedalData.h: the PedalKind enum (start, stop, sostenuto, change, continueLine,
    discontinue, resume) and the PedalData struct.
  • Reader: line pedals (line="yes", plus the inherently line-formatting types
    sostenuto/change/continue/discontinue/resume) go to pedals; sign start/stop still
    route through MarkData as MarkType::pedal / damp, unchanged.
  • Writer: a single emitPedal maps PedalKind back to core::PedalType, emits line="yes", and
    emits nothing for an unspecified kind.

Only two corpus files use these types (lysuite/ly31a_Directions.xml, lysuite/ly33a_Spanners.xml)
and both fail first on unrelated features, so this does not flip any file to PASS. It is validated
by a focused unit test that round-trips each pedal type through the api.

This is a breaking change: it reshapes DirectionData's pedal fields.

Testing

  • New PedalAllKinds round-trips all seven pedal types through the api; PedalPlacement covers
    placement (*Pedal*: 44 assertions in 5 test cases)
  • Full unit suite passes (5130 assertions in 451 test cases)
  • api round-trip regression unchanged (284 passed, 0 failed of 284 pinned)

References

DirectionReader::parsePedal previously handled only PedalType start/stop and
silently dropped sostenuto, change, continue, discontinue, and resume. Replace
the DirectionData::pedalStarts / pedalStops spanner vectors with a single
std::vector<PedalData> pedals, where PedalData carries a PedalKind enum covering
all seven pedal-line types. Line pedals (line="yes", plus the inherently
line-formatting types) go to pedals; sign start/stop still route through
MarkData as MarkType::pedal / damp.

This is a breaking reshape of DirectionData's pedal fields. Part of #324.
@webern webern added feature new feature request breaking fixes or implementation that require breaking changes api Affects the mx::api layer impl Affects the mx::impl layer ai Issues opened by, or through, a coding agent. labels Jul 19, 2026 — with Claude
@webern
webern merged commit 91133c3 into main Jul 19, 2026
7 checks passed
@webern
webern deleted the claude/pedal-types-modeling-s6eab2 branch July 19, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Issues opened by, or through, a coding agent. api Affects the mx::api layer breaking fixes or implementation that require breaking changes feature new feature request impl Affects the mx::impl layer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

api: many direction-type subtypes are unmodeled stubs (percussion, metronome extras, harp-pedals, scordatura, ...)

1 participant