ssb22 / jianpu-ly

Jianpu in Lilypond
http://ssb22.user.srcf.net/mwrhome/jianpu-ly.html
Apache License 2.0
70 stars 18 forks source link

minims, semibreves `WithStaff` rendered as tied crotchets #11

Closed BertrandSim closed 3 years ago

BertrandSim commented 3 years ago

Hi Silas,

Thanks for this program, I'm finding it easy to generate simple scores with this!

One thing I've noticed however, is that when a western staff is added (WithStaff), the minims, dotted minims, and semibreves are rendered as two, three, and four crotchets that are tied together. For example, 1 - is rendered as two crotchets tied together. My take is that these should be rendered as minims, dotted minims, and semibreves.

A similar thing can be said for rests. For example, 0 - is rendered as two crotchet rests, instead of a minim rest.

Here's a full(er) example

4/4  
WithStaff  

1 - 0 -
1 - - 2
0 - - 2
1 - - -
0 - - -

Could you have a look?

Thank you, Bertrand

ssb22 commented 3 years ago

Hi Bertrand, thanks for letting me know about this. jianpu-ly is indeed supposed to "collapse" tied notes into longer notes on WithStaff and this was implemented by some regular expression substitutions at the very end of the getLY() function. Those regexes had stopped working because an unrelated change caused another part of the code to put a different amount of whitespace into the Lilypond output, and the regexes had been written in such a way that they were sensitive to how whitespace was used. Oops. I'll see if I can get a fix in tomorrow (am a bit tired now). Thanks again.