From Fedora Project Wiki
(page creation)
 
(completed counterpoint exercise algorithms; changed to Wiki formatting)
Line 1: Line 1:
Address: User:Crantila/FSC/Typesetting/LilyPond
== What LilyPond Is ==
== What LilyPond Is ==
(no algorithms)
(no algorithms)
Line 7: Line 9:
== Installation ==
== Installation ==


1.) run 'yum install lilypond'
# run 'yum install lilypond'
2.) Review the dependencies; it will want to install a lot of things called lilypond-*-fonts
# 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'
# 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.
It's recommended to install the "Frescobaldi" GUI for LilyPond, which greatly reduces the complexity of the user experience.
Line 21: Line 23:


=== Set Up the Score ===
=== Set Up the Score ===
1.) Open Frescobaldi into a blank document
# Open Frescobaldi into a blank document
2.) Use the 'LilyPond > Setup New Score' dialogue
# Use the 'LilyPond > Setup New Score' dialogue
3.) Set the title and composer (and any other field) on the 'Titles and Headers' tab
# 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'
# 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
# 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
# You go to the 'Score settings' tab
  a) since you've already played through this example, uncheck "Create MIDI output" and save processing time
## since you've already played through this example, uncheck "Create MIDI output" and save processing time
  b) your example is in F Major
## your example is in F Major
  c) You want only whole notes, with no barlines; choose a 4/4 time signature, since we'll change this later
## 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
# 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
# If the setup looks like you want it, then press 'OK' to generate the template


=== Inputting the Parts ===
=== 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.
# 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
# The piano's upper staff will contain the notes between the { and } following the " right = \relative c'' " portion
3.) The piano's lower ... left
# The piano's lower ... left
4.) The figured bass will say what you put in figBass
# 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)
# 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
# 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' "
# 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).
# 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
# Put a ' right after the c so that it goes to the upper C
10.) Preview again, and this time it's right.
# 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"
# 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.
# 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 { "
# 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"
# 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 "
# 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>"
# 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.
# 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>"
# 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 ===
=== Formatting the Score ===
Line 57: Line 59:
==== Move the Figured Bass ====
==== 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.
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
# 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 %
# 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
# 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)
# 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
# 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 ====
==== 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)
# 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"
# Preview the file, and see that it no longer says, "Piano"


==== Make Some Elements Transparent ====
==== Make Some Elements Transparent ====
Line 75: Line 77:
You can use "\once \override ..." or \revert ..." too
You can use "\once \override ..." or \revert ..." too


1.) Find the "global" section
# Find the "global" section
2.) After \key and \time, put " \override Score.BarLine #'stencil = ##f "
# After \key and \time, put " \override Score.BarLine #'stencil = ##f "
3.) Preview the file, and see that this doesn't work quite as intended.
# Preview the file, and see that this doesn't work quite as intended.
4.) 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")
# 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
!!!!!!!! For some reason, there are barlines left between the staves... I'm working this out
# 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")
 
# 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!
Unlike with some other elements, if you simply remove the "\time 4/4" indicator, it will still print the default 4/4 time signature.


1.) In the "global" section, after \key and \time, put the following: \override Staff.TimeSignature #'transparent = ##t
* 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 ==
== Working on a Piano Score ==

Revision as of 05:15, 10 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

(probably a work for orchestra; we'll focus on issues unique to large ensemble music)