abcjs icon indicating copy to clipboard operation
abcjs copied to clipboard

Changing key does not follow through to the next line when using ABCJS.renderAbc() with wrapping

Open Godless- opened this issue 5 years ago • 1 comments

I am trying to get this function: ABCJS.renderAbc( [div id] , [abc notation text] , { staffwidth: 800, wrap: true, ... } ) to display the score, with line breaks (wrap: true), properly. It does work as intended for most instances, but what breaks it is a situation with a key or clef change in the middle of the piece. What happens is the key/clef change is properly interpreted, but in systems below the change - the old key/clef is being displayed instead of the new one (like so: https://i.imgur.com/57xj9lK.png - the second system does not feature a key change back to Ebmaj in the source abc code).

This does not happen when the score has manual line breaks, only with the automatic wrapping.

A simple example for 4 measures per line:

X: 1
T: Key change test
M: 4/4
L: 1/4
K: Gmaj
| CDEF | GABc | CDEF | [K:F] BGEC | BGEC | B,4 | GBGD | B,4

This still occurs with the version 5.12.0.

Godless- avatar Jun 12 '20 14:06 Godless-

Thanks for the bug report. I'll work on it sometime soon.

paulrosen avatar Jun 13 '20 21:06 paulrosen