Repository navigation
feat(render): place lyrics above or below the staff, or hide them - #3019
Merged
Merged
Conversation
The new RenderStylesheet.lyricsPlacement chooses between the current placement (Auto: above the tab staff, below staves without tabs), Below (below the last staff of the track, leaving the space above the tabs to bends, whammy bar and vibrato) and Hidden. alphaTex sets it with \lyricsPlacement auto|below|hidden and exports it when not Auto. Lyrics are created by one effect per placement; only the one matching the stylesheet creates glyphs, so the default rendering is unchanged. Refs #2776
Lyrics placement follows the Guitar Pro stylesheet: Below (default) or Above the standard notation staff, or Hidden. Without standard notation the lyrics move to the next shown staff in the cascade (tablature, slash, numbered), so tab-only tracks show them below the tabs. Guitar Pro files map System/hideLyrics to Hidden and System/drawLyricsUpside to Above; the exporter writes both keys. Refs #2776
MusicXML places each lyric on its own; the score-wide lyricsPlacement becomes Above only when every lyric of the file is placed above, so files mixing above and below keep the default. The Guitar Pro stylesheet keys are read with the casts the other keys use, which the C# target requires. Refs #2776
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 #2776
Proposed changes
Lyrics always sat in a fixed place: between standard notation and tabs, above the staff for tab-only tracks, and below the staff for tracks without tabs. On guitar tracks, the space above the tab staff is where bends, whammy bar, vibrato and technique texts go, so lyrics there collide with them or need a lot of vertical space. Guitar Pro has a stylesheet setting for this (Above Staff / Below Staff / Hide). This PR adds the same option.
Model
RenderStylesheet.lyricsPlacementwith the new enumLyricsPlacement:Below(default),Above,Hidden.Rendering
Importers / exporters
\lyricsPlacement below|above|hidden(score metadata). It is exported when notBelow.System/hideLyricsmaps toHiddenandSystem/drawLyricsUpsidemaps toAbove;Hiddenwins if both are set. The exporter writes both keys. The mapping was checked against files saved in Guitar Pro 8 with each option; theStaff/variants of these keys did not change.<lyric>. The score becomesAboveonly when every lyric hasplacement="above". Files that mix above and below (e.g. test suite 42a and 43f) keepBelow. There is no MusicXML exporter.UI
Visual change for existing scores
Known difference to Guitar Pro
Above, lyrics stack outside tempo, marker and chord texts, following the existing row ordering of effect bands. Guitar Pro draws them below the tempo marking.Tests
EffectPlacement.test.ts: which staff and side gets the lyrics for every placement and staff combination, including the cascade order (slash + tabs → tabs) andHidden.AlphaTexImporter.test.ts: parsing, export round-trip, and the error for invalid values.Gp8Importer.test.ts: four new Guitar Pro 8 files, one per option. The existing GP8 export round-trip covers them as well.MusicXmlImporter.test.ts: all above, mixed, no placement, and the 42a/43f test suite files.EffectsAndAnnotations.test.ts: below/above with score+tab, tab only and score only, plus hidden. Two existing references (font-fallback,overlay-rod-multi-staff-aggregation) were updated for the moved lyrics.Checklist
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
website/