From Fedora Project Wiki
(page creation)
 
(sorted out the lists; revised the text)
Line 1: Line 1:
== Working on an Large Ensemble Score ==
Address: User:Crantila/FSC/Typesetting/LilyPond_Orchestral
Address: User:Crantila/FSC/Typesetting/LilyPond_Orchestral


== Working on an Large Ensemble Score ==
Part of: Joseph Haydn's "Sinfonia No. 92: Oxford," first movement.
Part of: Joseph Haydn's "Sinfonia No. 92: Oxford," first movement.


!! For readers who want to input this while following the tutorial, I'll have to provide the resulting PDF output from LilyPond as their basis for input.
!! For readers who want to input this while following the tutorial, I'll have to provide the resulting PDF output from LilyPond as their basis for input.
* you shouldn't look at the source file until after inputting it yourself


=== Setting up the Score ===
=== Starting the Score ===
!! You added an additional staff for the 2nd oboe, which isn't in some of these instructions
!! You added an additional staff for the 2nd oboe, which isn't in some of these instructions


Line 17: Line 18:
#* all the rest are blank
#* all the rest are blank
# "Parts" Tab:
# "Parts" Tab:
#* Flute, Oboe, Bassoon
#* Flute, 2 of Oboe, Bassoon
#* Horn in F, Trumpet in C
#* Horn in F, Trumpet in C
#* Timpani
#* Timpani
Line 29: Line 30:
#* It should, but the instrument names are not correct as per the score; we'll adjust this later.
#* It should, but the instrument names are not correct as per the score; we'll adjust this later.
# Click "OK" to generate the score.
# Click "OK" to generate the score.
# I prefer most { characters to be on their own line; this is not functional, and completely optional.  If you want to make this change, then now is the appropriate time.
<li>To make it easier to find the various parts of the score when it gets larger, I'm going use comments and spaces.
<ol><li>Scroll to the top of the document.  The first sections (version, header, tempoMark, and global) can be the first chunk.</li>
<li>Above the "flute" section, include six newlines and a section-break marker with the title, "notes":
<pre>  \time 3/4
}


<!-- Begin the portion taken from the Piano example -->
=== Adjusting Frescobaldi's Output ===
These steps are useful in establishing a consistent input style for LilyPond.  The things suggested here are also useful for getting used to working with large scores, which can be a challenge in any text editor.  Thankfully, careful (and consistent!) code organization goes a long way in helping you to quickly find your way around your files.  Setting up files the right way to begin with makes this much easier in the end.


When you first setup the score, Frescobaldi will have created many sections for you by default.  The program avoids making too many stylistic choices for you, which allows you to create your own style.  It also sets up the default sections in a logical way:
<pre>version
header
widely-used settings like tempoMark and "global"
individual parts
score formatting</pre>
The specific ordering will become more obvious to you as you get used to LilyPond.


 
Here are some of the things that I do before inputting notes:
 
<ul>
 
<li>Use section-dividers (like <code>%%%%%%%% NOTES %%%%%%%%</code> for individual parts) to demarcate sections.</li>
%%%%%%%% NOTES %%%%%%%%
<li>Use different levels of dividers (like <code>%%%% OBOE %%%%</code> for the oboe) to show sub-sections</li>
flute = \relative c''
<li>Add blank lines between large sections, to separate them more obviously</li>
{</pre> You can change the section-break marker, the title, and the number of newlines to suit your needs, but this works for me - I know that the section where the notes are inputted follows that marker.</li>
<li>Begin braces on new lines, like
<li>Scroll down so you can see the space between the "contrabass" section and the "flutePart" section.</li>
<pre>\header
<li>Insert a header in there, like:
{
<pre> % Music follows here.
  title = "Symphony"
    
  ...
}
</pre> instead of on the same line, like
<pre>\header {
  title = "Symphony"
   ...
}
}
</pre>  This is simply a matter of personal taste, resulting from prior experience with C and C-like programming languages.</li>
<li>Familiarize myself with the sections and commands created by Frescobaldi, getting a sense of what the section/command does (even if I don't understand what each specific command does).  This makes it easier to sort out problems and customization down the road.  Sometimes, when the setup is quite complex, I make comments about what seems to be going on.</li>
<!-- <li>At this point, I also added the "Dynamics Context" commands, as described below in the "Piano Dynamics" section</li> -->
<!-- </ul> -->
<!-- End the portion taken from the Piano example -->
<li>Change the instrument names to replicate what my score indicates.  You don't necessarily need to do this, so long as the people using your score will understand what the instruments are.  Since my goal is to replicate this Dover edition score, I will change the names.
  <ol>
  <li>In the "PARTS" section, each xPart section has an "instrumentName = "something"" field.</li>
  <li>We'll be changing those to the following Italian names:
    <ul>
    <li>Flute --> Flauto</li>
    <li>Oboe I --> I Oboe</li>
    <li>Oboe II --> II Oboe</li>
    <li>Bassoon --> 2 Fagotti</li>
    <li>Horn in F --> 2 Corni in Sol (NB: these would have been "natural horns")</li>
    <li>Trumpet in C --> 2 Clarini in Do (NB: a clarino is a kind of trumpet)</li>
    <li>Violin I --> Violino I</li>
    <li>Violin II --> Violino II</li>
    <li>Cello --> Violoncello obligato</li>
    <li>Contrabass --> Basso</li>
    </ul></li>
  <li>Now we have to change the horns' transposition to match the name.  This is because Frescobaldi added a "Horn in F" part, which is the most common horn transposition.  However, Haydn's score uses horns in G (or "Sol" in Italian).</li>
  <li>Scroll up to the "hornF" section under the NOTES marker.  Change the line <code>\transposition f</code> to <code>\transposition g</code>.</li>
  <li>As it turns out, transposition can be a little more complicated than that.  We'll deal with that when we get there.</li>
  </ol></li>
</ul>


=== Inputting the Slow Introduction ===
Unlike the piano piece, this tutorial offers step-by-step instructions representing one way to input the score.  Only the slow introduction (the part before "Allegretto") will be inputted.  The rest is left to you.


 
==== Starting with the Easy Part ====
 
 
 
%%%%%%%% PARTS %%%%%%%%
flutePart = \new Staff \with
{</pre></li>
<li>Finally, scroll down to just above the "score" section, and insert space and a marker there.  It might look like:
<pre>
} { \clef bass \contrabass }
 
 
 
 
 
 
%%%%%%%% SCORE %%%%%%%%
\score</pre></li></ol>
# Now I change the instrument names to replicate what my score indicates.  You don't necessarily need to do this, so long as the people using your score will understand what the instruments are.  Since my goal is to replicate this Dover edition score, I will change the names.
## In the "PARTS" section, each xPart section has an "instrumentName = "something"" field.
## We'll be changing those to the following Italian names:
##* Flute --> Flauto
##* Oboe --> 2 Oboi
##* Bassoon --> 2 Fagotti
##* Horn in F --> 2 Corni in Sol (NB: these would have been "natural horns")
##* Trumpet in C --> 2 Clarini in Do (NB: a clarino is a kind of trumpet)
##* Violin I --> Violino I
##* Violin II --> Violino II
##* Cello --> Violoncello obligato
##* Contrabass --> Basso
## Now we have to change the horns' transposition to match the name.  This is because Frescobaldi added a "Horn in F" part, which is the most common horn transposition.  However, Haydn's score uses horns in G (or "Sol" in Italian).
## Scroll up to the "hornF" section under the NOTES marker.  Change the line <code>\transposition f</code> to <code>\transposition g</code>.
## As it turns out, transposition is a little more complicated than that.  We'll deal with that when we get there.
 
=== Starting Out with the Easy Part ===
The best way to get started on large scores is to just start with something easy.  Nothing can be easier than doing nothing, so let's first input the multi-measure rests in the wind sections and timpani.
The best way to get started on large scores is to just start with something easy.  Nothing can be easier than doing nothing, so let's first input the multi-measure rests in the wind sections and timpani.
<ol>
<ol>
<li>Count the number of measures of rests.  In this case, all of the winds and the timpani have thirteen or more measures of rests before their first entrance.</li>
<li>Count the number of measures of rests.  In this case, all of the winds and the timpani have thirteen or more measures of rests before their first entrance.</li>
<li>Let's put in those thirteen measures first.
<li>Let's put in those thirteen measures first.
<ol><li>In the NOTES section, find the flute section, and put in <code>R2.*13 |</code>.</li>
  <ol>
<li>Here is an explanation of R</li>
  <li>In the NOTES section, find the flute section, and put in <code>R2.*13 |</code>.</li>
<li>here is an explanation of |</li>
  <li>Here is an explanation of R</li>
<li>Copy and past that into the rest of the winds and the timpani.</li>
  <li>here is an explanation of |</li>
</ol></li>
  <li>Copy and past that into the rest of the winds and the timpani.</li>
  </ol></li>
<li>The timpani and trumpet/clarini parts have six further full measures of rest, before the measure with a fermata.  The fermata can't be included in the multi-measure rest, so we'll treat it separately.  Add <code>R2.*6 |</code> to the timpani and trumpets parts.</li>
<li>The timpani and trumpet/clarini parts have six further full measures of rest, before the measure with a fermata.  The fermata can't be included in the multi-measure rest, so we'll treat it separately.  Add <code>R2.*6 |</code> to the timpani and trumpets parts.</li>
<!-- This is where you added the second oboe part -->
<li>The horns, bassoons, and second oboe have one further measure of rests, so add <code>R2. |</code> to those parts.  We won't use <code>r2. |</code> because yadda.</li>
<li>The horns, bassoons, and second oboe have one further measure of rests, so add <code>R2. |</code> to those parts.  We won't use <code>r2. |</code> because yadda.</li>
<li>Now we need to start adding notes.  We'll start with the parts that have no notes.</li>
</ol>
<ol><li>The trumpets and timpani have no notes in the slow introduction, so all they need is the three-beat measure with a fermata on the third beat.</li>
 
<li>Rests are notated as though they were a pitch called "r".  That is to say, if you want to input a rest, then you input the pitch r.  This three-quarter-rest measure will be notated as <code>r4 r r |</code>.  Put this into the trumpets and timpani parts.  Remember: it's always a good idea to indicate the duration at the beginning of a measure, but it's not necessary to indicate a repeated duration.</li>
==== Continuing with the Wind and Timpani Parts ====
<li>Frescobaldi allows you to insert common musical signs with the "Quick Insert" tab on the left of the screen.  It may be hidden; to show it, click "Quick Insert" on the left-most edge of the Frescobaldi window.</li>
<ol>
<li>We need a regular fermata on the third quarter rest of this measure.  So, place the text-input caret just after the third quarter rest, and click the fermata symbol in the "Quick Insert" toolbar-thing.</li>
<li>Now we need to start adding notes.  We'll start with the parts that have only rests:
<li>You should end up with <code>r4 r r\fermata |</code>.</li>
  <ol>
<li>While the word for a fermata symbol is easy to remember, other symbols have less-obvious LilyPond notations, so the "Quick Insert" toolbar-thing is very handy.</li>
  <li>The trumpets and timpani have no notes in the slow introduction, so all they need is the three-beat measure with a fermata on the third beat.</li>
<li>Copy this measure to the other part.</li>
  <li>Rests are notated as though they were a pitch called "r".  That is to say, if you want to input a rest, then you input the pitch r.  This three-quarter-rest measure will be notated as <code>r4 r r |</code>.  Put this into the trumpets and timpani parts.  Remember: it's always a good idea to indicate the duration at the beginning of a measure, but it's not necessary to indicate a repeated duration.</li>
</ol></li>
  <li>Frescobaldi allows you to insert common musical signs with the "Quick Insert" tab on the left of the screen.  It may be hidden; to show it, click "Quick Insert" on the left-most edge of the Frescobaldi window.</li>
<li>The next easiest part seems to be the bassoons.
  <li>We need a regular fermata on the third quarter rest of this measure.  So, place the text-input caret just after the third quarter rest, and click the fermata symbol in the "Quick Insert" toolbar-thing.</li>
<ol><li>We've already input the bassoons' full-measure rests, so we can start with the first measure in which they play.  It should be notated as <code>r8 d g bes d bes |</code>.  Input this, and preview the score to see what happens.</li>
  <li>You should end up with <code>r4 r r\fermata |</code>.</li>
<li>Success!  When first starting an instrument, it's important to check that the notes begin in the right register.  If they don't, it can be adjusted easily by changing the pitch indication that follows the <code>\relative</code> declaration.  In this case, the bassoon happened to be in the right register for us by default.</li>
  <li>While the word for a fermata symbol is easy to remember, other symbols have less-obvious LilyPond notations, so the "Quick Insert" toolbar-thing is very handy.</li>
<li>The next measure is <code>g8 cis cis4 r |</code>.  Remember to indicate "cis" twice.  Put it in and check that it's correct.</li>
  <li>Copy this measure to the other part.</li>
<li>It is, but we're still missing some formatting.  Use the "Quick Insert" toolbar-thing to add staccato markings to the first measure.  You can add a staccato to the eighth-rest, but this doesn't make sense, so you shouldn't.</li>
  </ol></li>
<li>Slurs begin at ( and end at ).  Add a slur from the g to c-sharp.</li>
<li>The next easiest part is the bassoons:
<li>Preview the score to make sure that you entered these articulations correctly.  Your code should be:
  <ol>
<pre>r8 d-. g-. bes-. d-. bes-. |
  <li>We've already input the bassoons' full-measure rests, so we can start with the first measure in which they play.  It should be notated as <code>r8 d g bes d bes |</code>.  Input this, and preview the score to see what happens.</li>
g8( cis) cis4 r |</pre></li>
  <li>Success!  When first starting an instrument, it's important to check that the notes begin in the right register.  If they don't, it can be adjusted easily by changing the pitch indication that follows the <code>\relative</code> declaration.  In this case, the bassoon happened to be in the right register for us by default.</li>
  <li>The next measure is <code>g8 cis cis4 r |</code>.  Remember to indicate "cis" twice.  Put it in and check that it's correct.</li>
  <li>It is, but we're still missing some formatting.  Use the "Quick Insert" toolbar-thing to add staccato markings to the first measure.  You can add a staccato to the eighth-rest, but this doesn't make sense, so you shouldn't.</li>
  <li>Slurs begin at ( and end at ).  Add a slur from the g to c-sharp.</li>
  <li>Preview the score to make sure that you entered these articulations correctly.  Your code should be:
  <pre>r8 d-. g-. bes-. d-. bes-. |
  g8( cis) cis4 r |</pre></li>
  </ol></li>
<li>Now to add the "forte" marking.  You can add text (or any object, for that matter) onto a note (or rest, etc.) with one of these three symbols:
<li>Now to add the "forte" marking.  You can add text (or any object, for that matter) onto a note (or rest, etc.) with one of these three symbols:
<ul><li>^ meaning "put this above the object"</li><li>- meaning "put this above or below, as you think is best"</li><li>_ meaning "put this below the object"</li></ul>As you saw earlier, Frescobaldi attached our staccato markings with the "as you think best" symbol, which is almost always the right choice for articulations.  By convention, dynamic markings always go below the staff to which they apply, so we won't want to give LilyPond so much freedom, this time.</li>
  <ul>
  <li>^ meaning "put this above the object"</li>
  <li>- meaning "put this above or below, as you think is best"</li>
  <li>_ meaning "put this below the object"</li>
  </ul>
As you saw earlier, Frescobaldi attached our staccato markings with the "as you think best" symbol, which is almost always the right choice for articulations.  By convention, dynamic markings always go below the staff to which they apply, so we won't want to give LilyPond so much freedom, this time.</li>
<li>The easiest way to add (unformatted) text to a note is to simply attach it in quotation marks.  For the "forte" marking, put this on the eighth-rest: <code>r8_"f" etc.</code></li>
<li>The easiest way to add (unformatted) text to a note is to simply attach it in quotation marks.  For the "forte" marking, put this on the eighth-rest: <code>r8_"f" etc.</code></li>
<li>When you preview this, you'll notice that the result is thoroughly underwhelming.  It looks quite unlike a "forte" marking, and people reading the score would probably be confused, if just momentarily.</li>
<li>When you preview this, you'll notice that the result is thoroughly underwhelming.  It looks quite unlike a "forte" marking, and people reading the score would probably be confused, if just momentarily.</li>
Line 126: Line 141:
<li>Those two measures should now look like this:
<li>Those two measures should now look like this:
<pre>r8\f d-.^"a 2" g-. bes-. d-. bes-. |
<pre>r8\f d-.^"a 2" g-. bes-. d-. bes-. |
g8( cis) cis4 r |</pre> Note that <code>d-.^"a 2"</code> gives the same result as <code>d^"a 2"-.</code></li></ol>
g8( cis) cis4 r |
<li>You now know enough to complete the oboe parts, and the flute part.  Give it a try. NOTE that I've commented out a pre-block that has the result of this.  Don't know if I want to include it, though.  Here are some tips, if you get stuck:
</pre>
<ul><li>You will need to adjust the range of the flute and oboe, to read <code>flute = \relative c'''</code> and <code>oboeI = \relative c'''</code></li>
Note that <code>d-.^"a 2"</code> gives the same result as <code>d^"a 2"-.</code></li>
<li>You may want to use [ and ] to control eighth-note beaming in the Oboe I and Flauto parts.  You may not</li>
</ol>
<li>The Flauto will need more multi-measure rests with R, ''after'' some of the notes are inputted.</li>
 
<li>All of the parts will end with the same three-quarter-note-rests-with-fermata measure.</li>
==== Oboe and Horn Parts ====
</ul></li>
<ol>
<li>And now for the horns part.
<li>You now know enough to complete the oboe parts, and the flute part.  Give it a try.  Here are some tips, in case you get stuck:
<ol><li>Transposing instruments pose a small problem for LilyPond, as with any human or computerized engraving tool.  These steps first ensure that the transposition is set correctly.</li>
  <ul>
  <li>You will need to adjust the range of the flute and oboe, to read <code>flute = \relative c'''</code> and <code>oboeI = \relative c'''</code></li>
  <li>You may want to use [ and ] to control eighth-note beaming in the Oboe I and Flauto parts.  You may not</li>
  <li>The Flauto will need more multi-measure rests with R, ''after'' some of the notes are inputted.</li>
  <li>All of the parts will end with the same three-quarter-note-rests-with-fermata measure.</li>
  </ul></li>
<li>And now for the horns part. Transposing instruments pose a small problem for LilyPond, as with any human or computerized engraving tool.  These steps first ensure that the transposition is set correctly.</li>
<li>The "hornF" section should already have a <code>\transposition g</code> segment from earlier.  This tells LilyPond that the following notes are not in concert pitch, but rather are "in G."  A transposition statement tells LilyPond, in absolute pitch, which pitch actually sounds when the player plays a written c' .  In this case, the sound pitch is a perfect fourth below c' .  If we wanted it to be a perfect fifth higher, then we would need to write <code>\transposition g'</code>, but that's not accurate for this case.</li>
<li>The "hornF" section should already have a <code>\transposition g</code> segment from earlier.  This tells LilyPond that the following notes are not in concert pitch, but rather are "in G."  A transposition statement tells LilyPond, in absolute pitch, which pitch actually sounds when the player plays a written c' .  In this case, the sound pitch is a perfect fourth below c' .  If we wanted it to be a perfect fifth higher, then we would need to write <code>\transposition g'</code>, but that's not accurate for this case.</li>
<li>Our next obstacle is not actually a problem with LilyPond, but with how Frescobaldi set up the score for us.  The score that we wish to notate does not have a written key signature for the horn, but the "global" section (near the top of the file) includes one: G Major.  If this score were particularly complicated, or if it contained a large number of transposing instruments, then it would be best to remove the <code>\key ...</code> declration from the "global" section (and including it in every instrument as necessary).  However, since there is only one transposing instrument, we might be better off simply removing the global from the horn.</li>
<li>Our next obstacle is not actually a problem with LilyPond, but with how Frescobaldi set up the score for us.  The score that we wish to notate does not have a written key signature for the horn, but the "global" section (near the top of the file) includes one: G Major.  If this score were particularly complicated, or if it contained a large number of transposing instruments, then it would be best to remove the <code>\key ...</code> declration from the "global" section (and including it in every instrument as necessary).  However, since there is only one transposing instrument, we might be better off simply removing the global from the horn.</li>
Line 140: Line 161:
<li>make a note in the global section of which instruments don't use it</li>
<li>make a note in the global section of which instruments don't use it</li>
<li>While you're at it, do the same for the trumpets and timpani parts, which also do not use a printed key signature.</li>
<li>While you're at it, do the same for the trumpets and timpani parts, which also do not use a printed key signature.</li>
<li>The other issue with the horn part is that two pitches are to be played at once, and they are both notated in the same voice.  This is solved in the piano example like this: <code><<g g'>></code>.  Experiment with getting this right ''for one eighth-note''.</li>
<li>The other issue with the horn part is that two pitches are to be played at once, and they are both notated in the same voice.  This is solved in the piano example like this: <code><g g'></code>.  You can copy-and-paste this as needed.</li>
<li>When you copy this exactly to the next notes, you will notice that the resulting output ascends (<code>r8\f <<g-. g'>> <<g-. g'>> <<g-. g'>> <<g-. g'>> <<g-. g'>> |</code> is what looks dumb).  Give it a try.</li>
<li>Experiment with the code, trying to get it right.  One result, <code>r8\f <<g-. g'>> <<g-. g,>> <<g-. g'>> <<g-. g,>> <<g-. g'>> |</code> is hardly intuitive, but it makes a certain amount of sense: LilyPond moves from left to right in the file, putting notes into the measure in a squared-off zig-zag pattern.  Another possibility, <code>r8\f <<g-. g'>> <<g,-. g'>> <<g,-. g'>> <<g,-. g'>> <<g,-. g'>> |</code> makes more sense to me, because it's (almost) consistent: LilyPond will put in the lower note first, followed by the upper note.</li>
<li>You can now finish inputting the horn part.</li>
<li>You can now finish inputting the horn part.</li>
</ol></li>
</ol>
<li>When you have correctly finished all of the wind and timpani parts, you can move to the strings.  Input all of the pitches and note lengths first, then return and fill in with the other markings.  If you get stuck, leave that element for later, and either search the LilyPond help resources, or use the following steps to complete the details.  if it seems like 20 measures at once is too much, then break the score into smaller sections.</li>
<li>Tuplets (Triplets):
  <ul><li>To write any tuplet, use the formula <code>\times x/y { notes in here }</code>, where x is the number of notes actually space to use, and y is the number of notes to let you display.</li>
  <li>For an eighth-note triplet that takes up one beat, you might use this: <code>\times 2/3 { c8 d e }</code>, because in the space of 2 eighth notes you want to fit three instead.</li>
  <li>This is much more powerful than it seems at first.  You might want to make it seem as though the measures have stopped being marked, and write something like <code>\times 4/40 { ... }</code>, which will allow you to fit forty of something into the number of beat usually occupied by four of them.  This is especially useful with cadenzas, and cadenza-like passages.</li></ul>
</li>
<li>Short-term Polyphonic Input (Divisi):
  <ul><li>Anything between << and >> is interpreted by LilyPond as happening together.  If you take a look at the "score" section at the bottom of the file, you will see that all of the parts are listed in that kind of bracket.  This ensures that they all happen simultaneously.</li>
  <li>For short-term polyphonic input, use the formula <pre><< { upper-voice notes } \\ { lower-voice notes } >></pre>.  Remember that the "upper voice" has upward-pointing stems, and the "lower voice" has downward-pointing stems.</li></ul>
</li>
<li>Ties: These can be written by adding ~ to the end of the note beginning the tie: <pre>c4~ c8</pre></li>
<li>Grace Notes: These take up no logical time, and are smaller than ordinary notes.  Any notes appearing <code>\grace { in here }</code> would be considered grace notes.</li>
<li>Crescendo and Diminuendo Markings:
  <ul><li>These are added like other dynamic markings, attached with a backslash to the note where they begin.  A crescendo is triggered with \< and a diminuendo with \>.</li>
  <li>The left-most point of the marking (its beginning) is indicated by where you put \< or \></li>
  <li>The right-most (or end-)point is indicated by either another dynamic marking of any sort, or the special cancellation character (<code>\!</code>).</li></ul>
</li>
<li>italic "staccato" text</li>
<li>embedded measure numbers ("I've played a bit of a trick on you by not telling you up front, but... )</li>


I've definitely lost my place in the table, but here is a continuation, after correctly inputting all of the slow introduction:
==== Moving on to the Strings ====
After correctly finishing all of the wind and timpani parts, you can move on to the strings.
<ul>
<li>Input all of the pitches and note lengths first, then return to fill in the other markings.</li>
<li>If you get stuck, then put in some filler notes, and finish the rest of that part.  Make a note for yourself, as a comment in the source file, so that you know to return later to finish the part.</li>
<li>If twenty measures at once is too many, then break it into smaller chunks and input those.</li>
<li>Here are some tips to help you through this passage.  Use the LilyPond help files if you need further assistance.
  <ul>
  <li>Tuplets (Triplets):
    <ul>
    <li>To write any tuplet, use the formula <code>\times x/y { notes in here }</code>, where x is the number of notes actually space to use, and y is the number of notes to let you display.</li>
    <li>For an eighth-note triplet that takes up one beat, you might use this: <code>\times 2/3 { c8 d e }</code>, because in the space of 2 eighth notes you want to fit three instead.</li>
    <li>This is much more powerful than it seems at first.  You might want to make it seem as though the measures have stopped being marked, and write something like <code>\times 4/40 { ... }</code>, which will allow you to fit forty of something into the number of beat usually occupied by four of them.  This is especially useful with cadenzas, and cadenza-like passages.</li>
    </ul></li>
  <li>Short-term Polyphonic Input (Divisi):
    <ul>
    <li>Anything between << and >> is interpreted by LilyPond as happening together.  If you take a look at the "score" section at the bottom of the file, you will see that all of the parts are listed in that kind of bracket.  This ensures that they all happen simultaneously.</li>
    <li>For short-term polyphonic input, use the formula <pre><< { upper-voice notes } \\ { lower-voice notes } >></pre>.  Remember that the "upper voice" has upward-pointing stems, and the "lower voice" has downward-pointing stems.</li>
    </ul></li>
  <li>Ties: These can be written by adding ~ to the end of the note beginning the tie: <pre>c4~ c8</pre></li>
  <li>Grace Notes: These take up no logical time, and are smaller than ordinary notes.  Any notes appearing <code>\grace { in here }</code> would be considered grace notes.</li>
  <li>Crescendo and Diminuendo Markings:
    <ul>
    <li>These are added like other dynamic markings, attached with a backslash to the note where they begin.  A crescendo is triggered with \< and a diminuendo with \>.</li>
    <li>The left-most point of the marking (its beginning) is indicated by where you put \< or \></li>
    <li>The right-most (or end-)point is indicated by either another dynamic marking of any sort, or the special cancellation character (<code>\!</code>).</li>
    </ul></li>
  <li>Italic "staccato" Text: <code>\markup { \italic { staccato } }</code></li>
  <li>Source File Measure Numbers: One of the techniques that can be used when inputting larger scores is writing measure numbers into the source file as comments.  I usually write measure numbers every five measures, but it depends on the speed of the music, and what seems like it's useful.</li>
  </ul></li>
</ul>
 
==== Moving into the Fast Section ====
If you want to finish inputting the first movement, as an exercise, then you will also need to know how to write a tempo-change in an orchestral score:
<ol>
<ol>
  <li>In order to continue, we'll need to include a special measure-line (barline) and a change-of-tempo indicator.  This would be easy, and would display correctly, if we simply inputted the change in one particular voice.  However, if we did that, the change would only appear in one of the orchestral parts exported from the score.</li>
<li>In order to continue, we'll need to include a special measure-line (barline) and a change-of-tempo indicator.  This would be easy, and would display correctly, if we simply inputted the change in one particular voice.  However, if we did that, the change would only appear in one of the orchestral parts exported from the score.</li>
  <li>We're going to define a new whatever-thing, like the "global" section created for us by Frescobaldi, and include it in all of the parts.</li>
<li>We're going to define a new whatever-thing, like the "global" section created for us by Frescobaldi, and include it in all of the parts.</li>
  <li>The code needed for this is a little bit complicated, but you don't need to write it yourself: just take it from the "tempoMark" section created by Frescobaldi.  All you need to do is change "Adagio" to "Allegro spiritoso," and add the barline indicator.  This is also easy because of Frescobaldi: 'LilyPond > Bar Lines > Repeat start'</li>
<li>The code needed for this is a little bit complicated, but you don't need to write it yourself: just take it from the "tempoMark" section created by Frescobaldi.  All you need to do is change "Adagio" to "Allegro spiritoso," and add the barline indicator.  This is also easy because of Frescobaldi: 'LilyPond > Bar Lines > Repeat start'</li>
  <li>You end up with <pre>startExposition =
<li>You end up with
<pre>startExposition =
{
{
   \once \override Score.RehearsalMark #'self-alignment-X = #LEFT
   \once \override Score.RehearsalMark #'self-alignment-X = #LEFT
Line 176: Line 210:
   \mark \markup \bold "Allegro spiritoso"
   \mark \markup \bold "Allegro spiritoso"
   \bar "|:"
   \bar "|:"
}</pre></li>
}
  <li>Add the reference to this in all of your parts.  Because of how I named it, this also serves as a handy way to find your way through the LilyPond markup file.<pre>  r4 r r\fermata |
</pre></li>
<li>Add the reference to this in all of your parts.  Because of how I named it, this also serves as a handy way to find your way through the LilyPond markup file.
<pre>  r4 r r\fermata |
    
    
   \startExposition
   \startExposition
    
    
   R2.*4 |</pre></li>
   R2.*4 |
  <li>The barline and tempo-change will not appear unless you write some music after them, so put in some or all of the rests that follow, just to test it.</li>
</pre></li>
 
<li>The barline and tempo-change will not appear unless you write some music after them, so put in some or all of the rests that follow, just to test it.</li>
I'm going to finish inputting all of this file, so that they can see these tricks applied to a full file.
</ol>

Revision as of 06:02, 30 June 2010

Address: User:Crantila/FSC/Typesetting/LilyPond_Orchestral

Working on an Large Ensemble Score

Part of: Joseph Haydn's "Sinfonia No. 92: Oxford," first movement.

!! For readers who want to input this while following the tutorial, I'll have to provide the resulting PDF output from LilyPond as their basis for input.

  • you shouldn't look at the source file until after inputting it yourself

Starting the Score

!! You added an additional staff for the 2nd oboe, which isn't in some of these instructions

  1. 'LilyPond > Setup New Score'
  2. "Titles and Headers" Tab:
    • Dedication: Comte d'Ogny and Prince Oettingen-Wallerstein
    • Title: Sinfonia No. 92
    • Subtitle: "Oxford"
    • Composer: Haydn, Joseph
    • all the rest are blank
  3. "Parts" Tab:
    • Flute, 2 of Oboe, Bassoon
    • Horn in F, Trumpet in C
    • Timpani
    • Violin, Violin, Viola, Cello, Contrabass
  4. "Score settings" Tab:
    • Key signature: G Major
    • Time signature: 3/4
    • Tempo indication: Adagio
    • other settings as desired; I recommend not remocing bar numbers, and removing the default tagline
  5. Click "Try" to see if it works.
    • It should, but the instrument names are not correct as per the score; we'll adjust this later.
  6. Click "OK" to generate the score.

Adjusting Frescobaldi's Output

These steps are useful in establishing a consistent input style for LilyPond. The things suggested here are also useful for getting used to working with large scores, which can be a challenge in any text editor. Thankfully, careful (and consistent!) code organization goes a long way in helping you to quickly find your way around your files. Setting up files the right way to begin with makes this much easier in the end.

When you first setup the score, Frescobaldi will have created many sections for you by default. The program avoids making too many stylistic choices for you, which allows you to create your own style. It also sets up the default sections in a logical way:

version
header
widely-used settings like tempoMark and "global"
individual parts
score formatting

The specific ordering will become more obvious to you as you get used to LilyPond.

Here are some of the things that I do before inputting notes:

  • Use section-dividers (like %%%%%%%% NOTES %%%%%%%% for individual parts) to demarcate sections.
  • Use different levels of dividers (like %%%% OBOE %%%% for the oboe) to show sub-sections
  • Add blank lines between large sections, to separate them more obviously
  • Begin braces on new lines, like
    \header
    {
      title = "Symphony"
      ...
    }
    
    instead of on the same line, like
    \header {
      title = "Symphony"
      ...
    }
    
    This is simply a matter of personal taste, resulting from prior experience with C and C-like programming languages.
  • Familiarize myself with the sections and commands created by Frescobaldi, getting a sense of what the section/command does (even if I don't understand what each specific command does). This makes it easier to sort out problems and customization down the road. Sometimes, when the setup is quite complex, I make comments about what seems to be going on.
  • Change the instrument names to replicate what my score indicates. You don't necessarily need to do this, so long as the people using your score will understand what the instruments are. Since my goal is to replicate this Dover edition score, I will change the names.
    1. In the "PARTS" section, each xPart section has an "instrumentName = "something"" field.
    2. We'll be changing those to the following Italian names:
      • Flute --> Flauto
      • Oboe I --> I Oboe
      • Oboe II --> II Oboe
      • Bassoon --> 2 Fagotti
      • Horn in F --> 2 Corni in Sol (NB: these would have been "natural horns")
      • Trumpet in C --> 2 Clarini in Do (NB: a clarino is a kind of trumpet)
      • Violin I --> Violino I
      • Violin II --> Violino II
      • Cello --> Violoncello obligato
      • Contrabass --> Basso
    3. Now we have to change the horns' transposition to match the name. This is because Frescobaldi added a "Horn in F" part, which is the most common horn transposition. However, Haydn's score uses horns in G (or "Sol" in Italian).
    4. Scroll up to the "hornF" section under the NOTES marker. Change the line \transposition f to \transposition g.
    5. As it turns out, transposition can be a little more complicated than that. We'll deal with that when we get there.

Inputting the Slow Introduction

Unlike the piano piece, this tutorial offers step-by-step instructions representing one way to input the score. Only the slow introduction (the part before "Allegretto") will be inputted. The rest is left to you.

Starting with the Easy Part

The best way to get started on large scores is to just start with something easy. Nothing can be easier than doing nothing, so let's first input the multi-measure rests in the wind sections and timpani.

  1. Count the number of measures of rests. In this case, all of the winds and the timpani have thirteen or more measures of rests before their first entrance.
  2. Let's put in those thirteen measures first.
    1. In the NOTES section, find the flute section, and put in R2.*13 |.
    2. Here is an explanation of R
    3. here is an explanation of |
    4. Copy and past that into the rest of the winds and the timpani.
  3. The timpani and trumpet/clarini parts have six further full measures of rest, before the measure with a fermata. The fermata can't be included in the multi-measure rest, so we'll treat it separately. Add R2.*6 | to the timpani and trumpets parts.
  4. The horns, bassoons, and second oboe have one further measure of rests, so add R2. | to those parts. We won't use r2. | because yadda.

Continuing with the Wind and Timpani Parts

  1. Now we need to start adding notes. We'll start with the parts that have only rests:
    1. The trumpets and timpani have no notes in the slow introduction, so all they need is the three-beat measure with a fermata on the third beat.
    2. Rests are notated as though they were a pitch called "r". That is to say, if you want to input a rest, then you input the pitch r. This three-quarter-rest measure will be notated as r4 r r |. Put this into the trumpets and timpani parts. Remember: it's always a good idea to indicate the duration at the beginning of a measure, but it's not necessary to indicate a repeated duration.
    3. Frescobaldi allows you to insert common musical signs with the "Quick Insert" tab on the left of the screen. It may be hidden; to show it, click "Quick Insert" on the left-most edge of the Frescobaldi window.
    4. We need a regular fermata on the third quarter rest of this measure. So, place the text-input caret just after the third quarter rest, and click the fermata symbol in the "Quick Insert" toolbar-thing.
    5. You should end up with r4 r r\fermata |.
    6. While the word for a fermata symbol is easy to remember, other symbols have less-obvious LilyPond notations, so the "Quick Insert" toolbar-thing is very handy.
    7. Copy this measure to the other part.
  2. The next easiest part is the bassoons:
    1. We've already input the bassoons' full-measure rests, so we can start with the first measure in which they play. It should be notated as r8 d g bes d bes |. Input this, and preview the score to see what happens.
    2. Success! When first starting an instrument, it's important to check that the notes begin in the right register. If they don't, it can be adjusted easily by changing the pitch indication that follows the \relative declaration. In this case, the bassoon happened to be in the right register for us by default.
    3. The next measure is g8 cis cis4 r |. Remember to indicate "cis" twice. Put it in and check that it's correct.
    4. It is, but we're still missing some formatting. Use the "Quick Insert" toolbar-thing to add staccato markings to the first measure. You can add a staccato to the eighth-rest, but this doesn't make sense, so you shouldn't.
    5. Slurs begin at ( and end at ). Add a slur from the g to c-sharp.
    6. Preview the score to make sure that you entered these articulations correctly. Your code should be:
      r8 d-. g-. bes-. d-. bes-. |
        g8( cis) cis4 r |
  3. Now to add the "forte" marking. You can add text (or any object, for that matter) onto a note (or rest, etc.) with one of these three symbols:
    • ^ meaning "put this above the object"
    • - meaning "put this above or below, as you think is best"
    • _ meaning "put this below the object"
    As you saw earlier, Frescobaldi attached our staccato markings with the "as you think best" symbol, which is almost always the right choice for articulations. By convention, dynamic markings always go below the staff to which they apply, so we won't want to give LilyPond so much freedom, this time.
  4. The easiest way to add (unformatted) text to a note is to simply attach it in quotation marks. For the "forte" marking, put this on the eighth-rest: r8_"f" etc.
  5. When you preview this, you'll notice that the result is thoroughly underwhelming. It looks quite unlike a "forte" marking, and people reading the score would probably be confused, if just momentarily.
  6. Thankfully, LilyPond provides a very easy and elegant way to input well-formatted dynamic markings. Change the eighth-rest to this: r8\f etc.
  7. When you preview this, you will see that it now looks exactly like a typical "forte" marking. Not all dynamic markings have these short-forms, but most do.
  8. The "a 2" marking, meaning "to be played by two players," does need the text-in-quotes format, however. Put that marking above the d following the eighth rest.
  9. Those two measures should now look like this:
    r8\f d-.^"a 2" g-. bes-. d-. bes-. |
    g8( cis) cis4 r |
    
    Note that d-.^"a 2" gives the same result as d^"a 2"-.

Oboe and Horn Parts

  1. You now know enough to complete the oboe parts, and the flute part. Give it a try. Here are some tips, in case you get stuck:
    • You will need to adjust the range of the flute and oboe, to read flute = \relative c and oboeI = \relative c
    • You may want to use [ and ] to control eighth-note beaming in the Oboe I and Flauto parts. You may not
    • The Flauto will need more multi-measure rests with R, after some of the notes are inputted.
    • All of the parts will end with the same three-quarter-note-rests-with-fermata measure.
  2. And now for the horns part. Transposing instruments pose a small problem for LilyPond, as with any human or computerized engraving tool. These steps first ensure that the transposition is set correctly.
  3. The "hornF" section should already have a \transposition g segment from earlier. This tells LilyPond that the following notes are not in concert pitch, but rather are "in G." A transposition statement tells LilyPond, in absolute pitch, which pitch actually sounds when the player plays a written c' . In this case, the sound pitch is a perfect fourth below c' . If we wanted it to be a perfect fifth higher, then we would need to write \transposition g', but that's not accurate for this case.
  4. Our next obstacle is not actually a problem with LilyPond, but with how Frescobaldi set up the score for us. The score that we wish to notate does not have a written key signature for the horn, but the "global" section (near the top of the file) includes one: G Major. If this score were particularly complicated, or if it contained a large number of transposing instruments, then it would be best to remove the \key ... declration from the "global" section (and including it in every instrument as necessary). However, since there is only one transposing instrument, we might be better off simply removing the global from the horn.
  5. do the rest of this stuff to get that done right
  6. make a note in the global section of which instruments don't use it
  7. While you're at it, do the same for the trumpets and timpani parts, which also do not use a printed key signature.
  8. The other issue with the horn part is that two pitches are to be played at once, and they are both notated in the same voice. This is solved in the piano example like this: <g g'>. You can copy-and-paste this as needed.
  9. You can now finish inputting the horn part.

Moving on to the Strings

After correctly finishing all of the wind and timpani parts, you can move on to the strings.

  • Input all of the pitches and note lengths first, then return to fill in the other markings.
  • If you get stuck, then put in some filler notes, and finish the rest of that part. Make a note for yourself, as a comment in the source file, so that you know to return later to finish the part.
  • If twenty measures at once is too many, then break it into smaller chunks and input those.
  • Here are some tips to help you through this passage. Use the LilyPond help files if you need further assistance.
    • Tuplets (Triplets):
      • To write any tuplet, use the formula \times x/y { notes in here }, where x is the number of notes actually space to use, and y is the number of notes to let you display.
      • For an eighth-note triplet that takes up one beat, you might use this: \times 2/3 { c8 d e }, because in the space of 2 eighth notes you want to fit three instead.
      • This is much more powerful than it seems at first. You might want to make it seem as though the measures have stopped being marked, and write something like \times 4/40 { ... }, which will allow you to fit forty of something into the number of beat usually occupied by four of them. This is especially useful with cadenzas, and cadenza-like passages.
    • Short-term Polyphonic Input (Divisi):
      • Anything between << and >> is interpreted by LilyPond as happening together. If you take a look at the "score" section at the bottom of the file, you will see that all of the parts are listed in that kind of bracket. This ensures that they all happen simultaneously.
      • For short-term polyphonic input, use the formula
        << { upper-voice notes } \\ { lower-voice notes } >>
        . Remember that the "upper voice" has upward-pointing stems, and the "lower voice" has downward-pointing stems.
    • Ties: These can be written by adding ~ to the end of the note beginning the tie:
      c4~ c8
    • Grace Notes: These take up no logical time, and are smaller than ordinary notes. Any notes appearing \grace { in here } would be considered grace notes.
    • Crescendo and Diminuendo Markings:
      • These are added like other dynamic markings, attached with a backslash to the note where they begin. A crescendo is triggered with \< and a diminuendo with \>.
      • The left-most point of the marking (its beginning) is indicated by where you put \< or \>
      • The right-most (or end-)point is indicated by either another dynamic marking of any sort, or the special cancellation character (\!).
    • Italic "staccato" Text: \markup { \italic { staccato } }
    • Source File Measure Numbers: One of the techniques that can be used when inputting larger scores is writing measure numbers into the source file as comments. I usually write measure numbers every five measures, but it depends on the speed of the music, and what seems like it's useful.

Moving into the Fast Section

If you want to finish inputting the first movement, as an exercise, then you will also need to know how to write a tempo-change in an orchestral score:

  1. In order to continue, we'll need to include a special measure-line (barline) and a change-of-tempo indicator. This would be easy, and would display correctly, if we simply inputted the change in one particular voice. However, if we did that, the change would only appear in one of the orchestral parts exported from the score.
  2. We're going to define a new whatever-thing, like the "global" section created for us by Frescobaldi, and include it in all of the parts.
  3. The code needed for this is a little bit complicated, but you don't need to write it yourself: just take it from the "tempoMark" section created by Frescobaldi. All you need to do is change "Adagio" to "Allegro spiritoso," and add the barline indicator. This is also easy because of Frescobaldi: 'LilyPond > Bar Lines > Repeat start'
  4. You end up with
    startExposition =
    {
      \once \override Score.RehearsalMark #'self-alignment-X = #LEFT
      \once \override Score.RehearsalMark #'break-align-symbols = #'(time-signature key-signature)
      \mark \markup \bold "Allegro spiritoso"
      \bar "|:"
    }
    
  5. Add the reference to this in all of your parts. Because of how I named it, this also serves as a handy way to find your way through the LilyPond markup file.
      r4 r r\fermata |
      
      \startExposition
      
      R2.*4 |
    
  6. The barline and tempo-change will not appear unless you write some music after them, so put in some or all of the rests that follow, just to test it.