3

Python has a library called Lilypond which can be used to generate sheet music from a text based input. The documentation shows that the normal use is to create the text file, and then from a command line execute the lilypond executable with the text file as the first argument, which then outputs a PDF file.

How can I instead generate the PDF of sheet music programatically from inside another python program by calling Lilypond APIs? I am not interested in making system calls from Python to the lilypond executable.

Matthew Moisen
  • 16,701
  • 27
  • 128
  • 231
  • How is what you want to do different from executing it from the command line? – martineau Oct 09 '20 at 16:44
  • @martineau executing from the command line involves a manual step. By interacting with APIs I can automate this step. – Matthew Moisen Oct 09 '20 at 17:37
  • In that case you'll likely only going to be able to do this if someone has written a Python extension you can install to interact with its API (LilyPond is mostly written in C++). I don't know of one (and asking for recommendations is off-topic on stackoverflow). – martineau Oct 09 '20 at 17:45
  • If you are using Python to create LilyPond scores then I would suggest you'd take a look at Abjad abjad.github.io/ which allows you to create score in a object-oriented environment. – gilbertohasnofb Oct 10 '20 at 12:39

0 Answers0