A way to transpose a lilypond file for clarinet, horn and bass
Channel: harry sweet
Date: 20/04/2023

Most folks I know who use music software use programs such as Sibelius, Musescore and the like.  It makes sense to always see the finished version.  Probably writing one piece at a time this is advantageous . Just like word processors but for notation. 

But if you ever wrote an  html file by hand you know that another way is to add instructions to your text for the computer to use to render what the screen looks like.  Lilypond is like that.  You tell it what notes and chords you want and it takes care of the display.  The output is at least as good and probably better than most other software.

But the secret superpower of Lilypond is that it is easy (ish) to automate.  Which is a real issue when we are talking about modifiying hundresds of files. What I was looking at lately.   For a single file I would need to transpose 3x, compile 3x, combine 1x, compress 1x and upload 1x. 9x 200 is a lot.  And in a GUI app transposing a chart 3x is in itself a carpal tunnuling adventure.  Ditto many mouse clicks later for the other steps.  I would guess ~10k mouse clicks later I would give up and jump off a pier.

Lilypond files are just text, all the linux command line tools such as grep, sed, find as well as other programs such as rclone, qpdf  and pdftk  can be used to modify them automatically.  Now, anytime I write or modify a chart, I can use this perl script to transpose the chart to 3 other instruments, combine them into a single pdf file, compress that file and finally upload the finished product to my google drive.  From there another script (not mine) mirrors it to https://klezmer.app.