Write music in TeXmacs

The code of the Graph plugin is quite easy to read. I took a look at the code and it turns out the logic for generating pictures using pdflatex is quite straightforward. The program to generate music sheets is called lilypond. It is also uses Scheme.

Please follow the following:

  1. Create a file lilypond.py from pdflatex.py in the folder plugins/tmpy/graph/, change every line of code that has PDFLatex into lilypond; delete the arguments in the cmd0 variable.
  2. add lilypond() where PDFLatex() appears in the file plugins/tmpy/session/tm_graph.py

One should look at other backends such as xypic in order to customize the size of the output.

Now look at the output:

P.S. This is a hack. The credit goes to the original author of Graph plugin.

3 Likes