Skip to content

Tablature rendering crashes on slash-notation beats with rhythm stems enabled in 1.8.4 #2888

Description

@zyk-mjzs

Is there an existing issue for this?

  • I have searched the existing issues

I have read the contribution rules

AI authorship

Written by a human, no AI assistance

Current Behavior

AlphaTab 1.8.4 fails to render tablature containing slash-notation beats when rhythm stems are enabled.

The GP file imports successfully, but rendering fails with:

[AlphaTab][Worker] An unexpected error occurred in worker
TypeError: Cannot read properties of undefined (reading 'bottomY')

The stack trace points to TabBarRenderer.paintBeamingStem.

This reproduces with both ShowWithBars and ShowWithBeams, across the ScoreTab, Tab, and TabMixed stave profiles. Setting rhythmMode to Hidden avoids the crash.

The apparent cause is that slash-notation beats can have no reserved fret-number collision slots. The method handles holes.length === 1, but when holes is empty it accesses holes[holes.length - 1].bottomY.

Locally, changing the guard from holes.length === 1 to holes.length <= 1 prevents the crash in both a minimal synthetic example and the original GP file.

Expected Behavior

Slash-notation beats should render successfully on tablature staves with rhythm stems enabled, without throwing an exception or interrupting score rendering.

Steps To Reproduce

  1. Install @coderline/alphatab@1.8.4.
  2. Save the following code as reproduce.mjs.
  3. Run node reproduce.mjs.
  4. Observe the bottomY TypeError.
import * as alphaTab from '@coderline/alphatab';

const settings = new alphaTab.Settings();
settings.core.engine = 'svg';
settings.core.enableLazyLoading = false;
settings.display.staveProfile = alphaTab.StaveProfile.Tab;
settings.notation.rhythmMode = alphaTab.TabRhythmMode.ShowWithBars;

const score = alphaTab.importer.ScoreLoader.loadAlphaTex(
  '(4.2 6.3).8 (4.2 6.3).8 r.8 4.2.8',
  settings
);

score.tracks[0].staves[0].bars[0].voices[0].beats[1].slashed = true;

const renderer = new alphaTab.rendering.ScoreRenderer(settings);
renderer.width = 1000;
renderer.error.on(error => console.error(error));
renderer.renderScore(score, [0]);

Changing rhythmMode to alphaTab.TabRhythmMode.Hidden avoids the error.

Link to jsFiddle, CodePen, Project

No response

Version and Environment

AlphaTab: @coderline/alphatab 1.8.4 from npm
OS: macOS
Renderer: SVG
Original application: Vue + Vite, using the AlphaTab rendering worker

Also reproduced independently in Node.js using ScoreRenderer, with both the ESM and CommonJS package entries. The minimal reproduction above does not require Vue, Vite, a browser, or the original GP file.

Platform

Web

Anything else?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

Priority

Medium

Effort

Low

Area

Rendering

Platform

All / Multiple

Work State

Accepted

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions