Skip to content

Yield every key of one hand in BrailleGrandSegment.yieldCombinedGroupingKeys - #2170

Merged
mscuthbert merged 4 commits into
cuthbertLab:masterfrom
float3:pr/braille-grand-segment-same-hand-keys-2
Nov 3, 2026
Merged

mscuthbert merged 4 commits into
cuthbertLab:masterfrom
float3:pr/braille-grand-segment-same-hand-keys-2

Conversation

@float3

@float3 float3 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

yieldCombinedGroupingKeys yields a stored key, paired with None, before the next key of the same hand replaces it, so a key and time signature in only the right hand of a keyboard part reach the heading.

…ingKeys

When two keys of the same hand came in a row, yieldCombinedGroupingKeys
replaced the stored key with the new one without yielding it, so that
grouping was never transcribed. A key and time signature in only the
right hand of a keyboard part lost the heading, and the playback-only
metronome mark of verdi/laDonnaEMobile was missing from the debug
output. The stored key is now yielded, paired with None, before the
next key of the same hand replaces it.

    score = stream.Score()
    for pitchName in ('C5', 'C3'):
        part = stream.PartStaff()
        m = stream.Measure(number=1)
        if pitchName == 'C5':
            m.append(key.KeySignature(2))
            m.append(meter.TimeSignature('4/4'))
        m.append(note.Note(pitchName, quarterLength=4.0))
        part.append(m)
        score.insert(0, part)
    braille.translate.keyboardPartsToBraille(score)
@coveralls

coveralls commented Nov 1, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 93.751% (+0.003%) from 93.748% — float3:pr/braille-grand-segment-same-hand-keys-2 into cuthbertLab:master

@mscuthbert mscuthbert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great -- just a small legibility request

Comment thread music21/braille/segment.py Resolved

@mscuthbert mscuthbert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mscuthbert
mscuthbert merged commit 4861986 into cuthbertLab:master Nov 3, 2026
8 checks passed
@float3
float3 deleted the pr/braille-grand-segment-same-hand-keys-2 branch November 3, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants