Version: 1.8.3 (from reading the source, the same code is on develop)
Summary
The renderer throws TypeError: Cannot read properties of undefined (reading 'length') in ScoreChordNoteHeadInfo._canShareNoteHead (called from _checkForGroupDisplacement) when three voices sound together on one staff, two of them in unison and the third a second away.
Minimal repro (alphaTex)
\track "P"
\staff {score} \tuning piano \clef G2 \ts (1 4)
\voice
:4 c5 |
\voice
:4 b4 |
\voice
:4 c5 |
Rendering with ScoreRenderer (SVG engine) at width 300 throws.
What seems to happen
Voices 2 and 3 form one stem-down group containing a second (B4 and C5), so C5 is moved into displacedNotes. The group's minimum step still accounts for it, but _canShareNoteHead looks up the bottom step in correctNotes only, gets undefined, and reads .length. A possible fix is to look in displacedNotes as well, or to return false when the lookup finds nothing.
The input is real engraving: Dvořák, Rêverie, bar 40, which has three voices on the upper staff.
Version: 1.8.3 (from reading the source, the same code is on
develop)Summary
The renderer throws
TypeError: Cannot read properties of undefined (reading 'length')inScoreChordNoteHeadInfo._canShareNoteHead(called from_checkForGroupDisplacement) when three voices sound together on one staff, two of them in unison and the third a second away.Minimal repro (alphaTex)
Rendering with
ScoreRenderer(SVG engine) at width 300 throws.What seems to happen
Voices 2 and 3 form one stem-down group containing a second (B4 and C5), so C5 is moved into
displacedNotes. The group's minimum step still accounts for it, but_canShareNoteHeadlooks up the bottom step incorrectNotesonly, getsundefined, and reads.length. A possible fix is to look indisplacedNotesas well, or to returnfalsewhen the lookup finds nothing.The input is real engraving: Dvořák, Rêverie, bar 40, which has three voices on the upper staff.