On Fri 20 Dec 2024 at 13:40:48 (-0800), Knute Snortum wrote: > Since you're going to write a Python script, I figure I can share what I've > done so far on mine. It uses python-ly so you need to do a `pip install > python-ly` first before you run it. It makes three very big assumptions: > > 1) That you're using an absolute pitch of some sort. Relative pitch is > going to be a problem, I think.
Agreed. I start with that step as a standalone, using ly rel2abs . But next, I make a copy of the file, and change the names of the variables of interest from foo to fooi in filei, and fooii in fileii. I then run two conversion steps, one on filei that generates only the first part, ie converting "<b a>4." to "b4.", followed by another on fileii for the second part, ie converting "<b a>4." to "a4.". Finally, I cut and paste all the fooii variables of interest from fileii into filei, adjust the \score{ } sections to include the two voices instead of one, and add Merge_rests_engravers as appropriate. This method will give melodic lines that are suitable for having lyrics set beneath them, rather than a blizzard of simultaneity structures, which can confuse the eye. Cheers, David.