<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!-- header_tag --> <html lang="en"> <head> <title>Simple notation - GNU LilyPond Learning Manual</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="description" content="GNU LilyPond Learning Manual"> <meta name="generator" content="makeinfo 4.11"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="First-steps.html#First-steps" title="First steps"> <link rel="prev" href="Compiling-a-file.html#Compiling-a-file" title="Compiling a file"> <link rel="next" href="Working-on-input-files.html#Working-on-input-files" title="Working on input files"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <!-- Copyright (C) 1999--2007 by the authors Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections. A copy of the license is included in the section entitled ``GNU Free Documentation License''. --> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } hr { border:0; height:1; color: #000000; background-color: #000000; } /* hr { border: none; height: 1px; color: #666666; background-color: #666666; } body { border-left: 1px solid #666666; border-right: 1px solid #666666; color: #332d28; margin-right: auto; margin-left: auto; width: 60em; list-style-type: square; font-family: Arial,Helvetica,sans-serif; padding-right: 1em; padding-left: 1em; } a { border-bottom: 1px dashed #344242; text-decoration: none; color: #344242; } a:link { text-decoration: none; } a:visited { border-bottom: 1px dashed #666666; color: #666666; } a:active { border-bottom: 1px solid #00cccc; color: #00cccc; } a:hover { border-bottom: 1px solid #1d7b85; color: #1d7b85; } blockquote { border: 1px solid #cccccc; padding: 3px; width: 40em; } .node { border-left: 1px solid #666666; margin: -0.5em 0px 1em; padding: 2px 1px 0px; font-style: italic; } .node a { border: none; text-decoration: underline; font-style: normal; font-weight: bold; } .verbatim { font-family: "Courier New",Courier,monospace; } .unnumberedsubsubsec { font-size: large; color: #1d7b85; } .subsubheading { font-size: large; color: #3b220d; } .contents { border: 1px dashed #339999; margin: 3px 2em; list-style-type: square; padding-right: 1em; width: 40em; background-color: #fcfff9; } .contents a { border-bottom: 1px dashed #423d34; text-decoration: none; color: #423d34; } .contents a:visited { border-bottom: 1px dashed #666666; color: #666666; } .contents a:active { border-bottom: 1px solid #f0d86d; color: #f0d86d; } .contents a:hover { border-bottom: 1px solid #3b220d; color: #3b220d; } .menu { border-left: 1px dashed #339999; margin: 3px 2em 1em; list-style-type: square; padding-left: 1.4em; width: 40em; } .unnumbered { } h2 { font-size: x-large; color: #1d7b85; } */ --></style> </head> <BODY BGCOLOR=WHITE TEXT=BLACK> <div class="node"> <p> <a name="Simple-notation"></a> Next: <a rel="next" accesskey="n" href="Working-on-input-files.html#Working-on-input-files">Working on input files</a>, Previous: <a rel="previous" accesskey="p" href="Compiling-a-file.html#Compiling-a-file">Compiling a file</a>, Up: <a rel="up" accesskey="u" href="First-steps.html#First-steps">First steps</a> <hr> </div> <h4 class="subsection">2.1.2 Simple notation</h4> <p>LilyPond will add some notation elements automatically. In the next example, we have only specified four pitches, but LilyPond has added a clef, time signature, and rhythms. <blockquote> <pre class="verbatim"> { c' e' g' e' } </pre> <p> <a href="../87/lily-7f3700af.ly"> <img align="middle" border="0" src="../87/lily-7f3700af.png" alt="[image of music]"> </a> </p> </blockquote> <p class="noindent">This behavior may be altered, but in most cases these automatic values are useful. <h4 class="subheading">Pitches</h4> <p>Music Glossary: <a name="index-pitch-43"></a><a href="../music-glossary/pitch.html#pitch">pitch</a>, <a name="index-interval-44"></a><a href="../music-glossary/interval.html#interval">interval</a>, <a name="index-scale-45"></a><a href="../music-glossary/scale.html#scale">scale</a>, <a name="index-middle-C-46"></a><a href="../music-glossary/middle-C.html#middle-C">middle C</a>, <a name="index-octave-47"></a><a href="../music-glossary/octave.html#octave">octave</a>, <a name="index-accidental-48"></a><a href="../music-glossary/accidental.html#accidental">accidental</a>. <p>The easiest way to enter notes is by using <code>\relative</code> mode. In this mode, the octave is chosen automatically by assuming the following note is always to be placed closest to the previous note, i.e., it is to be placed in the octave which is within three staff spaces of the previous note. We begin by entering the most elementary piece of music, a <var>scale</var>, in which every note is within just one staff space of the previous note. <blockquote> <pre class="verbatim"> % set the starting point to middle C \relative c' { c d e f g a b c } </pre> <p> <a href="../e2/lily-23a261f4.ly"> <img align="middle" border="0" src="../e2/lily-23a261f4.png" alt="[image of music]"> </a> </p> </blockquote> <p>The initial note is <var>middle C</var>. Each successive note is placed closest to the previous note – in other words, the first <code>c</code> is the closest C to middle C. This is followed by the closest D to the previous note. We can create melodies which have larger intervals, still using only <code>\relative</code> mode: <blockquote> <pre class="verbatim"> \relative c' { d f a g c b f d } </pre> <p> <a href="../b3/lily-3c1515ef.ly"> <img align="middle" border="0" src="../b3/lily-3c1515ef.png" alt="[image of music]"> </a> </p> </blockquote> <p class="noindent">It is not necessary for the first note of the melody to start on the note which specifies the starting pitch. In the previous example, the first note – the <code>d</code> – is the closest D to middle C. <p>By adding (or removing) quotes <code>'</code> or commas <code>,</code> from the <code>\relative c' {</code><!-- /@w --> command, we can change the starting octave: <blockquote> <pre class="verbatim"> % one octave above middle C \relative c'' { e c a c } </pre> <p> <a href="../87/lily-7bdb7a86.ly"> <img align="middle" border="0" src="../87/lily-7bdb7a86.png" alt="[image of music]"> </a> </p> </blockquote> <p>Relative mode can be confusing initially, but is the easiest way to enter most melodies. Let us see how this relative calculation works in practice. Starting from a B, which is on the middle line in a treble clef, you can reach a C, D and E within 3 staff spaces going up, and an A, G and F within 3 staff spaces going down. So if the note following a B is a C, D or E it will be assumed to be above the B, and an A, G or F will be assumed to be below. <blockquote> <pre class="verbatim"> \relative c'' { b c % c is 1 staff space up, so is the c above b d % d is 2 up or 5 down, so is the d above b e % e is 3 up or 4 down, so is the e above b a % a is 6 up or 1 down, so is the a below b g % g is 5 up or 2 down, so is the g below b f % f is 4 up or 3 down, so is the f below } </pre> <p> <a href="../f8/lily-11ad44f2.ly"> <img align="middle" border="0" src="../f8/lily-11ad44f2.png" alt="[image of music]"> </a> </p> </blockquote> <p>Exactly the same happens even when any of these notes are sharpened or flattened. <var>Accidentals</var> are <strong>totally ignored</strong> in the calculation of relative position. Precisely the same staff space counting is done from a note at any other position on the staff. <p>To add intervals that are larger than three staff spaces, we can raise the <var>octave</var> by adding a single quote <code>'</code> (or apostrophe) to the note name. We can lower the octave by adding a comma <code>,</code> to the note name. <blockquote> <pre class="verbatim"> \relative c'' { a a, c' f, g g'' a,, f' } </pre> <p> <a href="../3d/lily-275c8251.ly"> <img align="middle" border="0" src="../3d/lily-275c8251.png" alt="[image of music]"> </a> </p> </blockquote> <p class="noindent">To change a note by two (or more!) octaves, we use multiple <code>''</code> or <code>,,</code> – but be careful that you use two single quotes <code>''</code> and not one double quote <code>"</code> ! The initial value in <code>\relative c'</code><!-- /@w --> may also be modified like this. <!-- " - keeps quotes in order for context-sensitive editor -td --> <h4 class="subheading">Durations (rhythms)</h4> <p>Music Glossary: <a name="index-beam-49"></a><a href="../music-glossary/beam.html#beam">beam</a>, <a name="index-duration-50"></a><a href="../music-glossary/duration.html#duration">duration</a>, <a name="index-whole-note-51"></a><a href="../music-glossary/whole-note.html#whole-note">whole note</a>, <a name="index-half-note-52"></a><a href="../music-glossary/half-note.html#half-note">half note</a>, <a name="index-quarter-note-53"></a><a href="../music-glossary/quarter-note.html#quarter-note">quarter note</a>, <a name="index-dotted-note-54"></a><a href="../music-glossary/dotted-note.html#dotted-note">dotted note</a>. <p>The <var>duration</var> of a note is specified by a number after the note name. <code>1</code> for a <var>whole note</var>, <code>2</code> for a <var>half note</var>, <code>4</code> for a <var>quarter note</var> and so on. <var>Beams</var> are added automatically. <p>If you do not specify a duration, the previous duration is used for the next note. The duration of the first note defaults to a quarter. <blockquote> <pre class="verbatim"> \relative c'' { a1 a2 a4 a8 a a16 a a a a32 a a a a64 a a a a a a a a2 } </pre> <p> <a href="../ab/lily-bb7a4506.ly"> <img align="middle" border="0" src="../ab/lily-bb7a4506.png" alt="[image of music]"> </a> </p> </blockquote> <p>To create <var>dotted notes</var>, add a dot <code>.</code> to the duration number. The duration of a dotted note must be stated explicitly (i.e., with a number). <blockquote> <pre class="verbatim"> \relative c'' { a a a4. a8 a8. a16 a a8. a8 a4. } </pre> <p> <a href="../27/lily-6ad15e49.ly"> <img align="middle" border="0" src="../27/lily-6ad15e49.png" alt="[image of music]"> </a> </p> </blockquote> <h4 class="subheading">Rests</h4> <p>Music Glossary: <a name="index-rest-55"></a><a href="../music-glossary/rest.html#rest">rest</a>. <p>A <var>rest</var> is entered just like a note with the name <code>r</code> : <blockquote> <pre class="verbatim"> \relative c'' { a r r2 r8 a r4 r4. r8 } </pre> <p> <a href="../d9/lily-b53032f0.ly"> <img align="middle" border="0" src="../d9/lily-b53032f0.png" alt="[image of music]"> </a> </p> </blockquote> <h4 class="subheading">Time signature</h4> <p>Music Glossary: <a name="index-time-signature-56"></a><a href="../music-glossary/time-signature.html#time-signature">time signature</a>. <p>The <var>time signature</var> can be set with the <code>\time</code> command: <blockquote> <pre class="verbatim"> \relative c'' { \time 3/4 a4 a a \time 6/8 a4. a \time 4/4 a4 a a a } </pre> <p> <a href="../cd/lily-a0d482b6.ly"> <img align="middle" border="0" src="../cd/lily-a0d482b6.png" alt="[image of music]"> </a> </p> </blockquote> <h4 class="subheading">Clef</h4> <p>Music Glossary: <a name="index-clef-57"></a><a href="../music-glossary/clef.html#clef">clef</a>. <p>The <var>clef</var> can be set using the <code>\clef</code> command: <blockquote> <pre class="verbatim"> \relative c' { \clef treble c1 \clef alto c1 \clef tenor c1 \clef bass c1 } </pre> <p> <a href="../3d/lily-68171513.ly"> <img align="middle" border="0" src="../3d/lily-68171513.png" alt="[image of music]"> </a> </p> </blockquote> <h4 class="subheading">All together</h4> <p>Here is a small example showing all these elements together: <blockquote> <pre class="verbatim"> \relative c, { \time 3/4 \clef bass c2 e8 c' g'2. f4 e d c4 c, r4 } </pre> <p> <a href="../ce/lily-8510d339.ly"> <img align="middle" border="0" src="../ce/lily-8510d339.png" alt="[image of music]"> </a> </p> </blockquote> <p class="noindent"> <h5 class="subsubheading">See also</h5> <p class="indent"> <p>Notation Reference: <a name="index-Writing-pitches-58"></a><a href="../lilypond/Writing-pitches.html#Writing-pitches">Writing pitches</a>, <a name="index-Writing-rhythms-59"></a><a href="../lilypond/Writing-rhythms.html#Writing-rhythms">Writing rhythms</a>, <a name="index-Writing-rests-60"></a><a href="../lilypond/Writing-rests.html#Writing-rests">Writing rests</a>, <a name="index-Time-signature-61"></a><a href="../lilypond/Time-signature.html#Time-signature">Time signature</a>, <a name="index-Clef-62"></a><a href="../lilypond/Clef.html#Clef">Clef</a>. <!-- footer_tag --><br><hr> <div class="node"> <p> Next: <a rel="next" accesskey="n" href="Working-on-input-files.html#Working-on-input-files">Working on input files</a>, Previous: <a rel="previous" accesskey="p" href="Compiling-a-file.html#Compiling-a-file">Compiling a file</a>, Up: <a rel="up" accesskey="u" href="First-steps.html#First-steps">First steps</a> </div> <div style="background-color: #e8ffe8; padding: 2; border: #c0ffc0 1px solid;"> <p> <font size="-1"> This page is for LilyPond-2.11.57 (development-branch). <br> <address> Report errors to <a href="http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs">http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs</a>. </address> <br> Your <a href="http://lilypond.org/web/devel/participating/documentation-adding">suggestions for the documentation</a> are welcome. </font> </p> </div> <P> Other languages: <a href="Simple-notation.fr.html">français</a>, <a href="Simple-notation.es.html">español</a>, <a href="Simple-notation.de.html">deutsch</a>. <BR> </P> </BODY></html>