Closed BertrandSim closed 3 years ago
Thanks Bertrand, well spotted, it's due to the lines:
if midi or western: out = ' '.join(out)
else: out = '\n'.join(out)
i.e. join the output items with newlines by default, but with spaces if outputting a MIDI or Western staff. The original reason for this was that each "output item" is likely to be a note, and having only one note per line seemed excessive for MIDI or Western, but makes more sense for jianpu where there is rather a lot of Lilypond code for each note. But it wouldn't actually hurt to unconditionally use '\n'.join(out) here if you don't mind lots of extra newlines in the .ly file.
As a temporary workaround, you might like to use Lilypond's %{ ... %} comment syntax (which can be used within a line, like C's / ... / ) instead of just %. But I agree we really should preserve newlines within LP: blocks, and not just because of comments (there are other advanced Lilypond 'hacks' that may require newlines in some places). I'll see if I can fix this properly later (I'm still not finished tinkering with bug #12 ....)
Hi Silas,
I've found that using line comments inside an
LP: ... :LP
block affects the output in betweenBEGIN MIDI STAFF
andEND MIDI STAFF
.My guess is that jianpu-ly places the output in between
BEGIN MIDI STAFF
andEND MIDI STAFF
on a single line, thus the%
comment marker causes subsequent lines to be commented out as well.Here's an example:
Perhaps this can be fixed by having each line inside an
LP: ... :LP
block in the input file to have a line ending char in the .ly output.Best, Bertrand