feat: model pedal number so overlapping pedal lines keep their identity - #460
Merged
Merged
Conversation
webern
force-pushed
the
m/mxdev-pedalnum
branch
from
September 19, 2026 14:05
0d719c4 to
a80d6d5
Compare
Add api::PedalLineData::number and read <pedal>'s number attribute, so two pedal lines held down at once stay distinguishable on read. The writer emits the attribute through SpannerResolver, which now gives pedals their own number pool like every other spanner family; an authored identity is assigned a level from serialization order and an explicit level is written verbatim. A single pedal line is unchanged and writes no number.
webern
force-pushed
the
m/mxdev-pedalnum
branch
from
September 19, 2026 14:27
a80d6d5 to
be615d1
Compare
webern
commented
Sep 19, 2026
Signed-off-by: Matthew James Briggs <matthew.james.briggs@gmail.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human Summary
The ability to specify the line level for pedal lines was missing. Added here.
Summary
mx::api::PedalLineDatanow carries aSpannerNumber number, and both translation directionshonour MusicXML's
<pedal number="...">attribute. The field is the same identity type wedges,curves and wavy lines already use: leave it unspecified for a lone pedal line, give an explicit
level to write that level verbatim, or give the events of one line a shared identity label and the
writer assigns a level from serialization order.
The reader takes the number off the element in
DirectionReader::parsePedal. The writer emits itfrom
DirectionWriter::emitPedalthroughSpannerResolver, which now gives pedal lines their ownpool of numbers 1..16 like every other spanner family. A pedal line opens with
start,sostenutoor
resumeand closes withstopordiscontinue;changeandcontinueLinehappen while theline stays open.
Nothing changes for an ordinary score: a single pedal line with no number writes no number
attribute, and every other spanner family keeps its own pool and assignments.
Deliberately left out, as separate gaps:
pedal/@signandpedal/@abbreviated(the sign form ismodelled through
MarkType::pedal/MarkType::damp), the font and color half ofprint-style-alignon<pedal>, and numbers on the pedal sign form.Testing
<pedal type="start" line="yes" number="2">reads asPedalLineKind::startwith explicit level 2; a pedal with no number reads as unspecifiednumberattributemake api-test: all pass (5909 assertions in 664 test cases)make api-roundtrip: 414 passed, 0 failed (of 414 pinned)make api-roundtrip-discover: 414 PASS, 426 FAIL, 0 LOADFAIL/GETDATAFAIL/CREATEFAIL -- no file unlocked, so no baseline pin.synthetic/pedal.3.1.xmlstill fails because its pedal also carriesabbreviated, font and color attributes thatmx::apidoes not modelmake test-all,make fmt-checkReferences
mx::api::PedalLineData#411