abcjs icon indicating copy to clipboard operation
abcjs copied to clipboard

Display problems numbered brackets in new line

Open narrenfrei opened this issue 4 years ago • 3 comments

The workaround for repeatings and numbered brackets in new lines from #170 results in a not so nice double brackets when there are more than one voice grouped into one staff:

X:1
T:Die Vöglein schlafen schon im Wald
%%score (1 | 2)
L:1/4
Q:1/4=120
M:4/4
K:D
V:1
 A |: d A F B | 
w: 1.~Die|Vög- lein schla- fen|
w: |ist schon Zeit zum|
 A G/F/ G A3/4 A/4 |
w: schon im _ Wåld, gua- te|
w: Schla- fen- * gehn, gua- te|
 [|]1 F z z A :|
w: Nåcht! Es|
w: |
 [|]2 F z A d [|] |
w: Nåcht! Ei- ne|
w: |
 A/ G/ F/ G/ A G | 
w: schö- ne gua- te Nåcht, herz-|
w: |
 F/ E/ F/ G/ A B3/4 A/4 | 
w: tau- send- schö- ner Schåtz, gua- te|
w: |
 A G3/4 F/4 G A | 
w: Nåcht, gua- te Nåcht, mein|
w: |
 F z |] 
w: Schåtz!|
w: |
V:2
 A |: F F D G | 
 F E/D/ E F3/4 F/4 |
 [|]1 D z z A :|
 [|]2 D z F A [|] |
 F/ E/ D/ E/ F E | 
 D/ C/ D/ E/ !breath!F G3/4 F/4 | 
 F E3/4 D/4 E F | 
 D z |] 
Bildschirmfoto 2021-07-13 um 20 36 57

narrenfrei avatar Jul 13 '21 18:07 narrenfrei

If you take the second set of repeats off it looks better:

 [|] D z z A :|
 [|] D z F A [|] |

paulrosen avatar Jul 17 '21 14:07 paulrosen

Yes (I already know), but then the generated MIDI file is wrong.

narrenfrei avatar Jul 17 '21 19:07 narrenfrei

I think your ABC is correct and this is a bug in abcjs for drawing. I've put it on my list, but I'm backed up right now.

I'll accept a pull request is someone wants to look into this.

In the meantime, here's an ugly hack you can use:

renderAbc("paper", abcString, { add_classes: true})
var endings = document.querySelectorAll("#paper .abcjs-ending.abcjs-v1")
for (var i = 0; i < endings.length; i++) {
  endings[i].setAttribute("style", "display: none")
}

paulrosen avatar Jul 19 '21 01:07 paulrosen