From Fedora Project Wiki
(completed counterpoint exercise algorithms; changed to Wiki formatting)
(added the large ensemble score)
Line 92: Line 92:


== Working on an Large Ensemble Score ==
== Working on an Large Ensemble Score ==
(probably a work for orchestra; we'll focus on issues unique to large ensemble music)
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.
 
=== Setting up the Score ===
!! You added an additional staff for the 2nd oboe, which isn't in some of these instructions
 
# 'LilyPond > Setup New Score'
# "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
# "Parts" Tab:
#* Flute, Oboe, Bassoon
#* Horn in F, Trumpet in C
#* Timpani
#* Violin, Violin, Viola, Cello, Contrabass
# "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
# 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.
# 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
}
 
 
 
 
 
 
%%%%%%%% NOTES %%%%%%%%
flute = \relative c''
{</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>Scroll down so you can see the space between the "contrabass" section and the "flutePart" section.</li>
<li>Insert a header in there, like:
<pre>  % Music follows here.
 
}
 
 
 
 
 
 
%%%%%%%% 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.
 
<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>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>
<li>Here is an explanation of R</li>
<li>here is an explanation of |</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>
<!-- 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>Now we need to start adding notes.  We'll start with the parts that have no notes.</li>
<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>
<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>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>You should end up with <code>r4 r r\fermata |</code>.</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>Copy this measure to the other part.</li>
</ol></li>
<li>The next easiest part seems to be the bassoons.
<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>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>
<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>
<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>Thankfully, LilyPond provides a very easy and elegant way to input well-formatted dynamic markings.  Change the eighth-rest to this: <code>r8\f etc.</code></li>
<li>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.</li>
<li>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.</li>
<li>Those two measures should now look like this:
<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>
<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:
<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.
<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>
<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>do the rest of this stuff to get that done right</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>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>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>
</ol></li>
<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:
<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>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>You end up with <pre>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 "|:"
}</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
 
  R2.*4 |</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.

Revision as of 06:50, 24 June 2010

Address: User:Crantila/FSC/Typesetting/LilyPond

What LilyPond Is

(no algorithms)

How LilyPond Works

(no algorithms; may require illustrations)

Installation

  1. run 'yum install lilypond'
  2. Review the dependencies; it will want to install a lot of things called lilypond-*-fonts
  3. LilyPond can be run from the command-line, as 'lilypond'

It's recommended to install the "Frescobaldi" GUI for LilyPond, which greatly reduces the complexity of the user experience.

A Brief Introduction to LilyPond Syntax

I think I'm going to direct readers to the official LilyPond documentation, specifically the "Learning Manual." As for exactly what I'll suggest they read, or whether I'll incorporate/adapt some of it into this guide, remains to be seen.

Working on a Counterpoint Exercise

Scenario: You're in Counterpoint class, and you've been asked to submit a very clean copy of your next assignment. Since you don't want to pay $450,000 for Sibelius/Finale and a fruity computer to use it, you decide that LilyPond is the solution for you.

Set Up the Score

  1. Open Frescobaldi into a blank document
  2. Use the 'LilyPond > Setup New Score' dialogue
  3. Set the title and composer (and any other field) on the 'Titles and Headers' tab
  4. You need a two staves, so you go to 'Parts' then 'Keyboard' then 'Piano'
  5. You need to label the intervals between the notes, so you choose 'Special' then 'Figured Bass' (we'll put it in the right spot later
  6. You go to the 'Score settings' tab
    1. since you've already played through this example, uncheck "Create MIDI output" and save processing time
    2. your example is in F Major
    3. You want only whole notes, with no barlines; choose a 4/4 time signature, since we'll change this later
  7. Press 'Try' to get a preview of the score setup - the notes are demonstrative and will not be there
  8. If the setup looks like you want it, then press 'OK' to generate the template

Inputting the Parts

  1. Look over the template. It's not important to understand what any of this means, but it's good if you can figure it out.
  2. The piano's upper staff will contain the notes between the { and } following the " right = \relative c " portion
  3. The piano's lower ... left
  4. The figured bass will say what you put in figBass
  5. start with the piano's upper part. Input "f1 g a f d e f c a f g f" (explain)
  6. Check that it's right. Preview by press the "LilyPond" button on the toolbar
  7. The exercise starts too high, and it ends too low. Change the starting pitch by " right = \relative c' "
  8. Preview again; of course, it still ends too low (these simple exercises usually start and end on the same pitch).
  9. Put a ' right after the c so that it goes to the upper C
  10. Preview again, and this time it's right.
  11. Now, enter the notes that you've written for the piano's lower staff: "f1 e d c bes c bes f d bes e f"
  12. Preview the output again, and see that it starts too high, but ends on the right pitch.
  13. Fix the start-too-high by changing to " left = \relative c { "
  14. Preview again, and decide where to fix the other change (NB: I end up with "f1 e d c bes c bes f' d bes e f"
  15. Enter the interval number between the top and bottom between the { and } preceded by " figBass = \figuremode "
  16. You have to put each interval between < > brackets. The note-length of the figure's duration goes after the >, so I end up with "<1>1 <3> <5> <4> <3> <3> <5> <5> <5> <5> <3> <1>"
  17. Now you realize that there are some signficant errors in your work. The top staff is the cantus, and cannot change. You have to correct the lower staff.
  18. I've ended up with a lower part that is "f1 e d a bes c d e f d c f", which gives figures that are "<1>1 <3> <5> <6> <3> <3> <3> <6> <3> <3> <5> <1>"

Formatting the Score

I do this last, so that my primary focus is the note-wise content, and formatting is only a secondary concern. LilyPond is particularly good at handling this sort of outlook.

Move the Figured Bass

Normally, figured bass parts are below the staves. This example is using the figured-bass feature of LilyPond to do something else, so we're going to move the figured bass so that it's where it needs to be.

  1. the \score{ } section contains everything in the score; notice that the figured bass has the identifier \bassFiguresPart; remove this
  2. scroll up to where it says "bassFiguresPart = ... " and comment it with %
  3. scroll up to where it says "pianoPart = ... " and enter the "\new FiguredBass \figBass" line that you just commented out, on a line between the "right" and "left" staves
  4. now erase the part that you commented in (2) (or leave it there)
  5. Preview the file, and see that the figures now appear between the piano staves

Take away the word "Piano" at the start of the staves

  1. Find the part that begins "pianoPart = ... " and erase the "instrumentName ... " line (or comment it)
  2. Preview the file, and see that it no longer says, "Piano"

Make Some Elements Transparent

This involves some more advanced tweaking. Explain this sort of command.

Every layout object has a "stencil" property. By default, this is set to whatever function draws the object. If you set that property to #f, which means "false", then the drawing function is not called, and the object will not appear on the score.

Every layout object also has a "transparent" property. By default, this is set to #f ("false"). Setting it to #t ("true") will make the object transparent.

You can use "\once \override ..." or \revert ..." too

  1. Find the "global" section
  2. After \key and \time, put " \override Score.BarLine #'stencil = ##f "
  3. Preview the file, and see that this doesn't work quite as intended.
  4. It so happens that, while measure lines within a staff are handled by Staff.BarLine, measure lines between staves are handled by Staff.SpanBar; so you'll need to set its 'transparent symbol to #t also
  5. But there's still no measure-line at the end! You want a barline at the end, so pick one of the staves (right, left, figBass - it doesn't matter in this case) and use the \revert command (don't know if I should put this in, but: "\revert Score.BarLine #'transparent and \revert Score.SpanBar #'transparent")
  6. But even this isn't quite right. You want a double-barline at the end. So, put the cursor after the \revert lines, and then from the menu, 'LilyPond > Bar Lines > Ending Bar Line' . It knows what you want, remembers the symbol for you, so you don't have to!
  • explain in there the difference between a Staff.* and Score.* override
  • Unlike with some other elements, if you simply remove the "\time 4/4" indicator, it will still print the default 4/4 time signature.
  • This example is musically simple, but it includes some advanced concepts, and importantly helps to get over a couple of common (and understandable) fears, especially for beginners, and especially for musically-simple things like this

Working on a Piano Score

(these can get quite complex; we'll focus on issues unique to piano music)

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.

Setting up 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, 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.
  7. 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.
  • To make it easier to find the various parts of the score when it gets larger, I'm going use comments and spaces.
    1. Scroll to the top of the document. The first sections (version, header, tempoMark, and global) can be the first chunk.
    2. Above the "flute" section, include six newlines and a section-break marker with the title, "notes":
        \time 3/4
      }
      
      
      
      
      
      
      %%%%%%%% NOTES %%%%%%%%
      flute = \relative c''
      {
      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.
    3. Scroll down so you can see the space between the "contrabass" section and the "flutePart" section.
    4. Insert a header in there, like:
        % Music follows here.
        
      }
      
      
      
      
      
      
      %%%%%%%% PARTS %%%%%%%%
      flutePart = \new Staff \with 
      {
    5. Finally, scroll down to just above the "score" section, and insert space and a marker there. It might look like:
      } { \clef bass \contrabass }
      
      
      
      
      
      
      %%%%%%%% SCORE %%%%%%%%
      \score
    1. 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.
      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 --> 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
      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 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.

    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.
    5. Now we need to start adding notes. We'll start with the parts that have no notes.
      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.
    6. The next easiest part seems to be 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 |
      7. 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.
      8. 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.
      9. 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.
      10. Thankfully, LilyPond provides a very easy and elegant way to input well-formatted dynamic markings. Change the eighth-rest to this: r8\f etc.
      11. 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.
      12. 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.
      13. 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"-.
    7. 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:
      • 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.
    8. And now for the horns part.
      1. 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.
      2. 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.
      3. 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.
      4. do the rest of this stuff to get that done right
      5. make a note in the global section of which instruments don't use it
      6. While you're at it, do the same for the trumpets and timpani parts, which also do not use a printed key signature.
      7. 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'>>. Experiment with getting this right for one eighth-note.
      8. When you copy this exactly to the next notes, you will notice that the resulting output ascends (r8\f <<g-. g'>> <<g-. g'>> <<g-. g'>> <<g-. g'>> <<g-. g'>> | is what looks dumb). Give it a try.
      9. Experiment with the code, trying to get it right. One result, r8\f <<g-. g'>> <<g-. g,>> <<g-. g'>> <<g-. g,>> <<g-. g'>> | 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, r8\f <<g-. g'>> <<g,-. g'>> <<g,-. g'>> <<g,-. g'>> <<g,-. g'>> | makes more sense to me, because it's (almost) consistent: LilyPond will put in the lower note first, followed by the upper note.
      10. You can now finish inputting the horn part.
    9. 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.
    10. 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.
    11. 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.
    12. Ties: These can be written by adding ~ to the end of the note beginning the tie:
      c4~ c8
    13. 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.
    14. 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 (\!).
    15. italic "staccato" text
    16. embedded measure numbers ("I've played a bit of a trick on you by not telling you up front, but... )
    17. I've definitely lost my place in the table, but here is a continuation, after correctly inputting all of the slow introduction:
      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.
      7. I'm going to finish inputting all of this file, so that they can see these tricks applied to a full file.