Repository navigation
fix(rendering): rhythm stems for slashed beats on tab staves - #2916
Merged
Merged
Conversation
Slashed beats on tab staves had no reserved collision slot and answered all note Y queries with 0. With tab rhythm stems enabled this crashed the stem painting and placed stems, beams and dots at the top of the staff. The slash now reserves its area, answers the Y positions like fret numbers do, and attaches the stem at the SMuFL stem anchor like on the score and slash staves. Fixes #2888
Slashed beats containing tied notes fell back to fret numbers on tab staves while standard notation shows a slash. The hidden tied note then pulled the rhythm stem up to its string.
Like Guitar Pro, the tremolo sits on the (potentially hidden) stem of the slash, beats without stems keep it centered.
Note heads resolve their own positions and stem attachment points from the SMuFL anchors. Standard notation chords, slash beats and slashes on tab staves use them instead of individual copies of the calculation. The tab beat glyph resolves the stem ends in the rhythm area once for fret numbers and slashes.
Standard notation, slash and tab beats resolve rest positions through a single helper. This also fixes the bottom position of tab rests which resolved to the top of the rest.
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.
Note
AI-authored disclosure (
alphatab-ai-authored-v1)Portions of this content were authored by an AI agent. The agent has read
AGENTS.md and the human submitter accepts responsibility for
compliance with the rules in that document.
Issues
Fixes #2888
Proposed changes
Rendering a tab staff that contains slashed beats crashed whenever tab rhythm stems were enabled (
ShowWithBarsorShowWithBeams).Root cause:
TabBeatGlyphdraws slashed beats as aSlashNoteHeadGlyphinstead of fret numbers. For those beats:TabBarRenderer.paintBeamingStemcrashed on an empty slot list;0, which put stems, beams and augmentation dots at the top of the staff.Fixes
Refactoring
Done to avoid adding another copy of the position logic:
NoteHeadGlyphBaseprovides the note head positions and stem attachment points from the SMuFL anchors. Standard notation chords, the slash staff and tab slashes use them instead of separate copies. The stem end positions stay specific to each staff type.ScoreBeatGlyph,SlashBeatGlyphandTabBeatGlyphresolve rest positions through one shared helper. This also fixes tab rests resolvingBottomto their top.Known limitation, not addressed here: on tab staves, a hidden tied note pulls the rhythm stem up to its string in normal chords too. That is independent of slashes and should be handled separately.
Checklist
New visual tests
GuitarTabs/rhythm-slashedandGuitarTabs/rhythm-with-beams-slashedrenderbeat-slash.gpwith both rhythm modes. Thebeat-slashreference changes because of the tied slashed beat in bar 5.AI authorship disclosure
(
alphatab-ai-authored-v1) is present at the top of this body, and I havepersonally reviewed every change and can explain each one
Further details