many times, we only need to change the width of the current beat #1654
Replies: 2 comments
-
Generally: alphaTab is using an adapted version of "Gourlays' Algorithm For Spacing" for placing music notation. See 4.5.1 Spacing. Every note defines what exact space it needs as minimum to place its glyphs and then the notes are aligned in a way that they are correctly placed to the time when they are played. If a note has accidentals (or any glyph like spacings) this is registered as "minimum space needed". Hence all glyphs influence in some way the spacing and alignment. But assuming there is enough space alphaTab should align notes as expected not scaling unnecessarily bigger (see below). On your screenshot The general size is calculated by the Gourlay algorithm respecting the "stretch force" option of alphaTab. The stretch force basically describes how strong the "springs" are and how wide the bars are stretching due to this. I agree that maybe sometimes in alphaTab the exact spaces/paddings between the glyph are not very optimized. The general glyph sizing, alignments and paddings are somthing which could use a larger refactoring but generally they should be correct. Beats will receive widening as the bar is stretched to ensure correct placement. Here a example showing how spacing works in some different products AlphaTab: we nicely scale the bars without unnecessary spacing keeping the timely alignment if possible. Guitar Pro 8: it scales the bar with accidentals slightly bigger. MuseScore 4: like alphaTab it keeps the alignment on beat times if possible (no Jianpu but you get the idea): I hope I was able to cover your question with this. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
think the method this.addGlyph(new SpacingGlyph(0, 0, 4 * this.scale)); changes the width of all the beats inside the entire bar. However, many times, we only need to change the width of the current beat, for example, when there are grace notes or accidentals in front of it, while other beats do not require widening.
Beta Was this translation helpful? Give feedback.
All reactions