Skip to content

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

Merged
Danielku15 merged 10 commits into
CoderLine:developfrom
kulek1:feature/tuning-on-staff-lines
Jul 2, 2026
Merged

feat(rendering): display tuning on staff lines#2742
Danielku15 merged 10 commits into
CoderLine:developfrom
kulek1:feature/tuning-on-staff-lines

Conversation

@kulek1

@kulek1 kulek1 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

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
Contributor 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.

@Danielku15 Danielku15 self-assigned this Jul 2, 2026
@Danielku15

Copy link
Copy Markdown
Member

Thanks for your contribution. Made a small fix in the order of track name, tuning and brackets, added GP8 reading/exporting support and added some more tests. With this the feature is complete. 🥳

@Danielku15 Danielku15 merged commit b053b63 into CoderLine:develop Jul 2, 2026
8 of 9 checks passed
@Danielku15 Danielku15 linked an issue Jul 3, 2026 that may be closed by this pull request
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.

Display Tunings on staff lines.

2 participants