Skip to content

feat(rendering): display tuning on staff lines#2742

Open
kulek1 wants to merge 4 commits into
CoderLine:developfrom
kulek1:feature/tuning-on-staff-lines
Open

feat(rendering): display tuning on staff lines#2742
kulek1 wants to merge 4 commits into
CoderLine:developfrom
kulek1:feature/tuning-on-staff-lines

Conversation

@kulek1

@kulek1 kulek1 commented Jun 21, 2026

Copy link
Copy Markdown

Issues

#2446

Proposed changes

Screenshot 2026-06-21 at 09 22 09 Screenshot 2026-06-21 at 09 28 23 Screenshot 2026-06-21 at 09 28 48

Activation:

score.stylesheet.tuningDisplayMode = model.TuningDisplayMode.Staff;

Activation in alphaTex:

\tuningDisplayMode staff

Padding is configurable:

display.inlineTuningPaddingRight = 8;

Checklist

  • I consent that this change becomes part of alphaTab under it's current or any future open source license
  • Changes are implemented
  • New tests were added

Further details

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

@Danielku15

Copy link
Copy Markdown
Member

Good job. Seeing the overall code I just have some small performance concern as we additionally loop all staves and tracks to compute things.

It would feel a lot cleaner if we would encapsulate the staff-tuning display into a glyph and wire it like this:

  1. during "layout phase" create the glyphs for staves which would need it.
  2. the new glyph does the tuning layout and size calculations once within its scope
  3. during "render phase" we just draw the glyphs we have created.

I think this mostly a mechanical refactoring, functionally things can mostly stay as they are (just the duplicated checks will vanish as they are all wired into the glyph creation phase).

I'm happy if you attempt this refactoring, otherwise I can also take it from here 😉

@kulek1

kulek1 commented Jun 21, 2026

Copy link
Copy Markdown
Author

@Danielku15 thanks for the feedback! I've addressed your comment - I hope it looks better now. If you see any other things to improve then feel free to commit to this branch.

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.

2 participants