Music · Typeset

Why I Love LilyPond: Simplicity of Syntax

Syntax: the arrangement of words and phrases to create well-formed sentences in a language.


Every program, whether it has a GUI or not, has a syntax, a code of operation and understanding. Think of syntax as a language with which you speak to the program in order to communicate effectively.

Many would consider a program like LilyPond a fairly complex syntax. They say that the click and drag option is a lot better, because it is a graphical representation that you can manipulate. It supposedly requires little to know communication to the program (other than the program understanding you gestures).

What is actually true

Imagine if you had to click-and-drag every letter of what you wanted to say into place on a program that publishes books… wouldn’t that be cumbersome? This method of input would be beyond difficult, which would eventually mean you would find keyboard shortcuts to do the trick. Also imagine the kerning every letter to the next. This would be tedious as well.

This is how seasoned Finale experts run their program, albeit a small amount of people. Most people find shortcuts to do what they want, but a lot of people (this is a generalization) probably just click and drag if not the notes than everything else. This is also what I did; I did find shortcuts to enter notes, but that’s only 50% of the work that needed to be done. A lot of other things were done by hand.

The GUI Is Slowing You Down

The truth about LilyPond

LilyPond stands in sharp contrast with the usage of other programs. The developers have spent an enormous amount of time coding what are time-tested engraving standards so that, in most cases, you get the right output, or something not far from it. This greatly simplifies syntax, mostly because instead of you being left to your own devices, you are asked to learn a lean language (the Finale equivalent of hot keys and keyboard shortcuts) in order to accomplish a goal. Think about this example:

RachmaninoffOp23No10ex

In this example, I only had to modify 3 separate circumstances in the music. One was in the L.H. slur position, the other the stem directions, and the last the beaming. I had already, in the previous measures, set the program to avoid printing tuplet numbers in the L.H. (which is a simple tweak). Other than this, the syntax of the input is very simple. I denoted a chord using a g.t./l.t. bracket (<>) and everything else was denoted in their proper voices. In all, this section of music took me about 10 minutes to get my initial input (which was almost perfect). This is because there is a very specific meaning to the language.

When I use something like a4 b c d e and press compile, what you see is “a (a quarter note) followed by b c d e, all of which are also quarter notes.” It assumes your time signature is 4/4, and that you didn’t want a barline until after the d. It didn’t make the assumption that you needed extra rests and barlines to complete the incomplete bar at the beginning of the second measure, since you didn’t ask for it.

EaseOfSyntax1

This is sharply contrasted to Finale and Sibelius that make a lot of assumptions for you in order to make your life “easier.” And though it may work fine for simple processes, most other music makes it difficult.

Difficulty Explaining

I know that not all of music is as simple as the example above, but there is a massive difference between programs. Imagine if you tried to type in a document that constantly completed sentences and added periods and random words that fit in the language you were using… You would be constantly changing your material, and also being bogged down in the output of the program.

In reality, Finale and Sibelius are like a word processor that you have to click and drag most everything you want to do change. Every line has a period at the end of it, and in order to move the word or phrase including the period down, you would have to finagle your way through menus or search online forums for hacks in order to accomplish that.

LilyPond is simple in terms of syntax because the information is communicated via means which make sense. Granted the harder the music the more you have to know about the syntax, but is that really any more difficult than doing more homework with a program that you barely know how to do anything with and have to ask someone else to show you?

How about a paradigm shift?

How about we consider the virtues of being able to focus on content, knowing that your input makes sense, can be parsed by anyone, and is intelligent, logical, and efficient in its hermeneutics?

Postscript

I’m engaged in (albeit slow these days) in an engraving challenge. This is the GitHub for it. Check it out, and see what all had to be done in order for the participants to be counted qualified. It is quite the exercise in efficiency, and the syntax for the LilyPond versions have soared at a level which I have been highly impressed.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s