I had a request, so I’m posting some classical guitar music that I arranged recently and typeset in Lilypond
hope it’s helpful
While the Angelus Was Singing:
Lilypond Source Code
Resulting PDF Output
I had a request, so I’m posting some classical guitar music that I arranged recently and typeset in Lilypond
hope it’s helpful
While the Angelus Was Singing:
Lilypond Source Code
Resulting PDF Output
I’ve finally updated my Lilypond Beginners Guide. It now contains not only updated commands for the most recent stable Lilypond (version 2.12), but also a number of added commands that the first one lacked.
You can download the guide here:
Lilypond Beginners Guide
“Necessity is the mother of invention”
I’m typesetting a piece for 2 guitars and in the end I want to print off individual parts and a score. This can easily be achieved in Lilypond using the following method:
\include “notes.ly”
{ \classicalguitara }
\include “notes.ly”
{ \classicalguitarb }
\include “notes.ly”
{ << \new Staff { \guitara }
\new Staff { \guitarb } >> }
Now for the real problem….I need to have logical page breaks (which will happen in different places for the 2 guitar parts and the score). Now if I put in a page break into a single guitar part using the command:
\pageBreak
then the score will break in the same place….this will really be a problem when it comes to different page break locations for each of the parts…..there has got to be a good way to deal with this without constantly changing code for each individual part! And that’s when it came to me….wonderful variables can save the day…..here’s the low down:
Instead of using the page break command in the parts I use a variable called “partpagebreak”
then in the individual guitar files (classicalguitar1.ly and classicalguitar2.ly) I add the following line:
partpagebreak = { \pageBreak }
And in the score file (score.ly) I add the following line:
partpagebreak = { }
Now when I print the individual parts the command \partpagebreak will be replaced with the command for a page break and when I print the score the same variable will be converted into an empty space…problem fixed….different page layouts using the same code. Very cool!
Note: If I actually wanted to have specified page breaks in the score I could easily create a variable called “scorepagebreaks” and that would do the trick
I use Lilypond quite a lot, and over time I’ve realized the usefulness of variables.
In Lilypond you can easily make a variable by doing the following:
variablename = { whatever you want your variable to contain }
let me give an example….If I want to typeset a piece for guitar quartet (or any collection of instruments) there is certain information that will be used for each instrument:
\time 4/4
\key e \major
\partial 8
each of these lines would be nesseary for each individual part….the first line defines the time signature as 4/4, the second line defines the key signature and the last line tells Lilypond to have a pickup measure or partial measure) which is an eighth note duration.
to put this in a variable all I need to do is this:
piecesetup = {
\time 4/4
\key e \major
\partial 8
}
now in each of the individual guitar parts all I have to enter to get all those is:
\piecesetup
Note: when you define the variable, you don’t put a \ in front, but when you call for the variable in a part you must put the \ before the variable name (also be careful, you can’t use numbers or special characters in your variable name….just letters)
One nice aspect of this is after you’ve created all 4 guitar parts using the \piecesetup variable if you realize the key signature was wrong, you only need to change it once in the variable and all the parts are automatically fixed.