Lilypst - integrate Lilypond sheet music into Typst documents

Hi everyone,

I like to create song books for my holidays and up until last year, I used lilypond, lilypond-book, LaTeX and its songs package for that. However, that was painful in several ways and I highly prefer working in typst, so I ported my song book pipeline to it. For this however, I needed a replacement for lilypond-book so I could compile the lilypond sheet music and integrate it into my typst document. Therefore, I created exactly that replacement: Lilypst

It works by providing a typst function that exposes some metadata to a python script which compiles all the lilypond snippets and generates typst functions that get imported back into the main typst document using typsts relatively new pdf-import functionality.

Currently, its main features are

  • parsing, which lilypond-files to compile from the typst document as well as what width is available to them
  • compiling all the necessary lilypond-files with the available width
  • compiling in a lazy way, so lilypond only runs when things have changed - this can be turned off
  • compiling the music Staves into individual files, so page breaks can happen between them
  • moving the header part out of lilypond into typst so its styling can be integrated better
  • create indexes from the header metadata (such as titles and composers) using in-dexter
  • create an index from the beginning of the songtext - this is quite hacky and experimental though

For more details, please refer to the README and the example document in the repo. I hope someone will find this helpful and if there are any questions or suggestions for improvement, feel free to reach out.