Skip to content

fix(model): skip tie-destination beats when applying lyrics#2760

Open
AvaTheArchitect wants to merge 1 commit into
CoderLine:developfrom
AvaTheArchitect:fix/lyrics-continuation-beats
Open

fix(model): skip tie-destination beats when applying lyrics#2760
AvaTheArchitect wants to merge 1 commit into
CoderLine:developfrom
AvaTheArchitect:fix/lyrics-continuation-beats

Conversation

@AvaTheArchitect

Copy link
Copy Markdown

Issues

Related to #2728

Proposed changes

This PR fixes lyric chunks being assigned to beats whose notes are all tie destinations.

Before this change, Track.applyLyrics() skipped empty and rest beats, but pure tie-destination beats were still treated as lyric-eligible. This could cause lyric syllables to appear on tied continuation notes / held-note destinations instead of the next fresh note attack.

Changes included:

  • Added a private helper in Track to detect beats where all notes are tie destinations.
  • Updated Track.applyLyrics() to skip those beats when distributing lyric chunks.
  • Added a focused regression test using AlphaTex:
\track "V" 3.3.4 -.3.4 5.3.4 |

The Test Verifies:

* the first lyric lands on the first fresh note
* the tie-destination beat receives no lyrics
* the next lyric lands on the next fresh note

### Checklist
- [x] I consent that this change becomes part of alphaTab under it's current or any future open source license
- [x] Changes are implemented
- [x] 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

This PR breaks compatibility with the Guitar Pro behavior. In Guitar Pro also tied notes get a lyric chunk applied.

image

@AvaTheArchitect

AvaTheArchitect commented Jul 4, 2026 via email

Copy link
Copy Markdown
Author

@AvaTheArchitect

AvaTheArchitect commented Jul 4, 2026 via email

Copy link
Copy Markdown
Author

@Danielku15

Copy link
Copy Markdown
Member

If somebody writes Guitar Pro files, they write lyrics in a way, using the syntax to ensure the lyrics are assigned as intended. alphaTab ensures that we follow the same logic as Guitar Pro to match the authors intent.

There is no reason why Guitar Pro or alphaTab should actively prevent that somebody can put some sort of lyrics to a tied note beat. If you want no syllable on the tied note, you will write the lyrics accordingly (e.g. adding an additional space).

As the Arobas support says: doing things different in alphaTab would cause a inconsistency with the files written in Guitar Pro.

Here an example: It's a bit hard to recognize, but there are simply two spaces after far to account for the tied note. If somebody would like to write fa ar to indicate the stretch that's also possible.
image

Technically you might add some "effects" to the second beat (like a bend, accentuation, vibrato) to indicate special singing styles at the second half of a word. You write is a tied note to indicate that the continuous singing of the word without pause, but on the second half you would sing it differently.

alphaTab has two paths for GP6-8 files: if lyrics are already applied to the beats (splitting happened in GP), we take the information as-is from the file:

case 'Lyrics':
beat.lyrics = this._parseBeatLyrics(c);
this._skipApplyLyrics = true;
break;

Only if there are not lyrics explicitly assigned to beats, we do the assignment on our own.

track.applyLyrics(lyrics);

That said: I think there is no bug or misbehavior (neither GP nor alphaTab) but it is by-design to allow placing syllables on tied notes. People author the files accordingly and alphaTab respects all details as good as possible. If you find any discrepancies between GP and alphatab I'm happy to fix things to be aligned.

@AvaTheArchitect

AvaTheArchitect commented Jul 5, 2026 via email

Copy link
Copy Markdown
Author

@Danielku15

Copy link
Copy Markdown
Member

You still didn't clearly explain where alphaTab would be doing anything wrong. We use the parsed lyric information from Guitar Pro files if they are embedded. And when we apply things we respect the special syntax constructs of Guitar Pro.

If you think there is a problem. Please prepare a minimal example with concrete references what is wrong. Keep things concise and focus on the concrete problems. No guessing what the theory, alphaTab or Guitar Pro might or might not be doing, no deep analysis. Just show a single concrete example.

Without a single example where we are inconsistent with Guitar Pro I cannot analyze anything

@AvaTheArchitect

AvaTheArchitect commented Jul 5, 2026 via email

Copy link
Copy Markdown
Author

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