Editing Tools for GNU LilyPond

If you want to still be able to read your source after you put fingering in, put the fingering on the even lines and finger.sed will attach it to the odd lines with the notes on them. Spacing is done with spaces. You can use drastic short cuts and substitute the identifiers you use on those lines, because you won't have to avoid them being mistaken for notes.

slasub.py does slash replacement and then substitutes anything, using optional per cents for argument placeholders in the replacement text. If you have no percents, you don't need parentheses after targets. You can pass arguments to lilypond commands using something like $move(2 -4).

slyce.py is a tool which helps produce many similar lilypond files, which is a common situation when using lilypond-book, especially when revisions become an issue. It's self-documenting. It creates child files from the different parts definitions in the center of the master file, copying the preceding and following boilerplate.

Can you use slyce and sly together in the same file? Sure! Slyce will not copy long comments, so none of the generated files will have any. Lilypond-book will not know about changes to included notes in its included (with \lilypondfile) files so it will not update if the lilypond file is unchanged. That is a feature, not a bug, to prevent foreverness. If you use lyinclude on the big master file you can do them all at once. You should check the lilypond files out with lilypond before putting them in your book anyway.

sly.py is a tool which permits parallel editing of notes, lyrics, chords, tab, or anything else in vertical columns or on successive lines, separated by the two byte field separator of your choice. The files generated can be put in lilypond source files by using includes or lyinclude. By giving the targets names like notes0.fly you can run filters on them while they lie helpless on your hard disk. When you are running lilypond on files with includes, lilypond gives almost the exact line number of the included file if it finds a mistake. That makes them very quick to find.

If you want to type html and latex faster, and who doesn't?

Now, as of December 2004, sly can even extract, copy, and process sly files embedded in a lilypond file. The lilypond file remains valid. The filename extension tells sly what to do with a file. The fine manual is still not too bad. Here is the rest of the stuff, but the "new version" is the old version now.

Sedfilt.py applies the filters in lists to the files on disk with the indicated extension. For example, "cly-sedfilts" is a list of filters to be applied to all the files in the current directory with the extension ".cly".  The command at most would be:
$ python sedfilt.py cly ly
to produce ".ly" files.

Keys.sed is a filter which makes it possible to enter b's and w's for flats and double flats and also adds the appropriate chromatic to the notes in the key signature. In other words, from where you put @key3s@ to where you put @key@, the f c and g notes will be rewritten as fs cs and gs. It saves typing many chromatic signs. An 'n' keeps it natural.

lyinclude.py substitutes the content of "yourfile.ly" for the \include "yourfile.ly" command. Its purpose is to prepare a lilypond music file to send to someone else, or to use in a lilypond-book.

Numtxt is a python script to create a file with numbered lines. It can also number groups of lines. It's for creating a dummy file in sly, but it could also create such a file for inclusion in a lilypond source file to save typing.

Old Stuff Due for an Overhaul

Ptfilter.txt contains ptfilter.sed, a collection of filter routines to make it far easier to fine tune LilyPond's output where simple substitution can help.

Pie.txt contains a filter used in a script as an example. Such scripts can be run on a block of selected text in emacs-xemacs.

Octly.txt contains a sed command file which transposes up to seven octaves up or down according to how you mark up the file. For dos-win, sed is easy to get and all linux distributions have it. It doesn't work with relative pitch of course.

On Patrick Atamaniuk's Website there is a version of sly and other lilypond utilities for BSD. He is a real programmer, and his contribution is greatly appreciated.

© 2002 David Raleigh Arnold. All rights reserved.