Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grace note overlaps with the previous note #1210

Closed
1 task done
Reiji777 opened this issue Jul 3, 2023 · 3 comments
Closed
1 task done

Grace note overlaps with the previous note #1210

Reiji777 opened this issue Jul 3, 2023 · 3 comments
Assignees

Comments

@Reiji777
Copy link

Reiji777 commented Jul 3, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The grace note is unnecessarily overlapping with the previous note, though the bar still has room to display the notes properly.

I found a similar issue (#1094), but seems the bug persists after the fix.

Screenshot 2023-07-03 at 9 53 45 AM

Expected Behavior

The grace note shouldn't overlap with the previous note.

Steps To Reproduce

It can be reproduced by uploading the tab to the demo player on alphatab.net

Please find attached the example gp file for reference.
grace-note.gp.zip

Link to jsFiddle, CodePen, Project

No response

Found in Version

1.3-alpha

Platform

Web

Environment

- **OS**: MacOS
- **Browser**: Chrome 114.0.5735.198
- **.net Version**:

Anything else?

No response

@Reiji777 Reiji777 added the state-needs-triage Bug not triaged yet. label Jul 3, 2023
@Danielku15 Danielku15 added state-needs-discussion 💬 type-bug 🕷️ area-rendering Everything related to the rendering and removed state-needs-triage Bug not triaged yet. labels Jul 3, 2023
@Danielku15
Copy link
Member

What exact version of alphaTab are you using? I cannot reproduce your shown example in either 1.2.3 (released) and 1.3.0-alpha.684.

1.2.3 (page layout) - tested on alphatab.net
image

1.2.3 (horizontal layout)
image

1.3.0-alpha.684 (page layout) - tested on next.alphatab.net
image

1.3.0-alpha.684 (horizontal layout)
image

@Reiji777
Copy link
Author

Reiji777 commented Jul 3, 2023

I wrote a simple script to demonstrate the issue. I'm using the version alphatab@1.3.0-alpha.684

https://stackblitz.com/edit/web-platform-8bu4vd?file=index.html

The issue happens when the screen width is small (e.g. 300px, which is common for a mobile phone). For example, in the second line of the following screenshot, the grace note has overlapping issue; the third line doesn't have any display issue while having the same amount of notes.

Screenshot 2023-07-03 at 10 35 47 PM

When there's enough width, the overlapping issue won't occur.
Screenshot 2023-07-03 at 10 19 35 PM

@Danielku15
Copy link
Member

This is the expected behavior. If there is simply not enough space for the notes to be placed, there must be overlaps. For each note a minimum size is calculated it requires. This size then influences the general spacing in the bar according to the time they are played (in a more-or less logarithmic scale). According to this notes are then placed. Grace notes are treated special: they are "sticking" to the next note following them.

There is always room for improvement (especially with grace notes) but I prefer not to touch this area currently unless it is really a misbehavior. In this case we could try adding a mechanism which would prefer a correct time position but rather avoid collisions. Not a straight forward thing.

For such small sizes I would recommend to switch to horizontal layouts or reduce the scale dynamically.

@Danielku15 Danielku15 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants