Skip to content

fix(rendering): rhythm stems for slashed beats on tab staves - #2916

Merged
Danielku15 merged 6 commits into
developfrom
fix/2888-tab-rhythm-slashed-beats
Oct 6, 2026
Merged

Danielku15 merged 6 commits into
developfrom
fix/2888-tab-rhythm-slashed-beats

Conversation

@Danielku15

Copy link
Copy Markdown
Member

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 (ShowWithBars or ShowWithBeams).

Root cause: TabBeatGlyph draws slashed beats as a SlashNoteHeadGlyph instead of fret numbers. For those beats:

  • it reserved no collision slot, so TabBarRenderer.paintBeamingStem crashed on an empty slot list;
  • every Y query returned 0, which put stems, beams and augmentation dots at the top of the staff.

Fixes

  • Slashes on tab staves reserve their area. They resolve Y positions and attach the stem at the SMuFL stem anchor, as on the standard notation and slash staves.
  • A slashed beat that contains tied notes is now rendered as a slash on tab staves too. Before, it fell back to fret numbers while standard notation showed a slash, and the hidden tied note pulled the stem up to its string.
  • A tremolo on a slashed tab beat sits on the stem, which matches Guitar Pro. If the stem is hidden, the tremolo still sits where the stem would be. Whole-note slashes keep it centred.

Refactoring
Done to avoid adding another copy of the position logic:

  • NoteHeadGlyphBase provides 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, SlashBeatGlyph and TabBeatGlyph resolve rest positions through one shared helper. This also fixes tab rests resolving Bottom to their top.
  • The visual suite shows no pixel differences from the refactoring.

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

  • I consent that this change becomes part of alphaTab under its current or any future open source license
  • This PR is linked to an accepted issue (see above)
  • Changes are implemented
  • New tests were added
  • I have read AGENTS.md if an AI helped draft any part of this PR

New visual tests GuitarTabs/rhythm-slashed and GuitarTabs/rhythm-with-beams-slashed render beat-slash.gp with both rhythm modes. The beat-slash reference changes because of the tied slashed beat in bar 5.

AI authorship disclosure

  • No AI agent authored any part of this PR (description, code, tests, or commit messages)
  • An AI agent contributed to this PR. The AI-authored disclosure block
    (alphatab-ai-authored-v1) is present at the top of this body, and I have
    personally reviewed every change and can explain each one

Further details

  • This is a breaking change
  • This change will require update of the documentation/website

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.
@Danielku15
Danielku15 merged commit 25ef76d into develop Oct 6, 2026
6 checks passed
@Danielku15
Danielku15 deleted the fix/2888-tab-rhythm-slashed-beats branch October 6, 2026 16:33
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.

Tablature rendering crashes on slash-notation beats with rhythm stems enabled in 1.8.4

1 participant