From 063a94c1c5540dd572fe3a87d9252cd376428c26 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 29 Mar 2004 21:17:23 +0000 Subject: [PATCH] * Documentation/user/introduction.itely: * Documentation/user/notation.itely: * Documentation/user/tutorial.itely: Up all relative examples. Enclose @lilypond displays in @quotation. Typos and corrections. * Documentation/user/macros.itexi: Use fetaflat, fetasharp. --- ChangeLog | 9 + Documentation/user/cheatsheet.itely | 46 +- Documentation/user/introduction.itely | 789 ++++++------ Documentation/user/lilypond.tely | 10 + Documentation/user/macros.itexi | 11 +- Documentation/user/music-glossary.tely | 2 +- Documentation/user/notation.itely | 1626 +++++++++++++++--------- Documentation/user/preface.itely | 36 +- Documentation/user/tutorial.itely | 861 +++++++------ input/test/engraver-example.lyinc | 68 +- mf/feta.tex | 2 +- scripts/lilypond-book.py | 11 +- 12 files changed, 2024 insertions(+), 1447 deletions(-) diff --git a/ChangeLog b/ChangeLog index a21a751b8e..f8d53127c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-03-29 Jan Nieuwenhuizen + + * Documentation/user/introduction.itely: + * Documentation/user/notation.itely: + * Documentation/user/tutorial.itely: Up all relative examples. + Enclose @lilypond displays in @quotation. Typos and corrections. + + * Documentation/user/macros.itexi: Use fetaflat, fetasharp. + 2004-03-29 Mats Bengtsson * scm/music-functions.scm (make-voice-props-revert): Revert also diff --git a/Documentation/user/cheatsheet.itely b/Documentation/user/cheatsheet.itely index ec9d1aa189..61b8d06558 100644 --- a/Documentation/user/cheatsheet.itely +++ b/Documentation/user/cheatsheet.itely @@ -13,7 +13,7 @@ @item @code{1 2 8 16} @tab durations @tab -@lilypond[relative=1,notime] +@lilypond[relative=2,notime] \set Staff.autoBeaming = ##f \set Staff.Clef = \turnOff c1 c2 c8 c16 @@ -22,7 +22,7 @@ c1 c2 c8 c16 @item @code{c4. c4..} @tab augmentation dots @tab -@lilypond[relative=1,notime] +@lilypond[relative=2,notime] \set Staff.Clef = \turnOff c4. c4.. @end lilypond @@ -30,14 +30,14 @@ c4. c4.. @item @code{c d e f g a b } @tab scale @tab -@lilypond[relative=1,notime] +@lilypond[relative=2,notime] c d e f g a b @end lilypond @item @code{fis bes} @tab alteration @tab -@lilypond[relative,notime] +@lilypond[relative=1,notime] fis bes @end lilypond @@ -66,7 +66,7 @@ s16_" " @item @code{r4 r8} @tab rest @tab -@lilypond[relative=1,notime] +@lilypond[relative=2,notime] \set Staff.Clef = \turnOff r4 r8 @end lilypond @@ -74,7 +74,7 @@ r4 r8 @item @code{d ~ d} @tab tie @tab -@lilypond[relative=1,notime] +@lilypond[relative=2,notime] \set Score.timing = ##f \set Staff.autoBeaming = ##f d ~ d @@ -92,7 +92,7 @@ s4 @item @var{note}@code{'} @tab raise octave @tab -@lilypond[relative=1,notime] +@lilypond[relative=2,notime] \set Score.timing = ##f \set Staff.autoBeaming = ##f a a' @@ -101,7 +101,7 @@ a a' @item @var{note}@code{,} @tab lower octave @tab -@lilypond[relative=1,notime] +@lilypond[relative=2,notime] \set Score.timing = ##f \set Staff.autoBeaming = ##f c c, @@ -111,7 +111,7 @@ c c, @item @code{c( d e)} @tab slur @tab -@lilypond[fragment,relative=1] +@lilypond[fragment,relative=2] \set Score.timing = ##f \set Staff.TimeSignature = \turnOff \set Staff.autoBeaming = ##f @@ -122,7 +122,7 @@ c( d e) @item @code{c\( c( d) e\)} @tab phrasing slur @tab -@lilypond[fragment,relative=1] +@lilypond[fragment,relative=2] \set Score.timing = ##f \set Staff.TimeSignature = \turnOff \set Staff.autoBeaming = ##f @@ -133,7 +133,7 @@ c\( c( d) e\) @item @code{a8[ b]} @tab beam @tab -@lilypond[fragment,relative=1] +@lilypond[fragment,relative=2] \set Score.timing = ##f \set Staff.TimeSignature = \turnOff \set Staff.autoBeaming = ##f @@ -153,7 +153,7 @@ a8-[ b-] @item @code{c-> c-.} @tab articulations @tab -@lilypond[fragment,relative=1] +@lilypond[fragment,relative=2] \set Staff.TimeSignature = \turnOff c-> c-. @end lilypond @@ -162,7 +162,7 @@ c-> c-. @item @code{c\mf c\sfz} @tab dynamics @tab -@lilypond[fragment,relative=1] +@lilypond[fragment,relative=2] \set Staff.TimeSignature = \turnOff c\mf c\sfz @end lilypond @@ -171,7 +171,7 @@ c\mf c\sfz @item @code{a\< b\!} @tab crescendo @tab -@lilypond[fragment,relative=1] +@lilypond[fragment,relative=2] \set Score.timing = ##f \set Staff.TimeSignature = \turnOff \set Staff.autoBeaming = ##f @@ -181,7 +181,7 @@ a\< a \!a @item @code{a\> b\!} @tab decrescendo @tab -@lilypond[fragment,relative=1] +@lilypond[fragment,relative=2] \set Score.timing = ##f \set Staff.TimeSignature = \turnOff \set Staff.autoBeaming = ##f @@ -192,7 +192,7 @@ a\> a a\! @item @code{< >} @tab chord @tab -@lilypond[fragment,relative=1] +@lilypond[fragment,relative=2] @end lilypond @@ -200,7 +200,7 @@ a\> a a\! @item @code{\partial 8} @tab upstep @tab -@lilypond[fragment,relative=1] +@lilypond[fragment,relative=2] \partial 8 f8 c2 d e @end lilypond @@ -209,7 +209,7 @@ a\> a a\! @item @code{\times 2/3 @{f g a@}} @tab triplets @tab -@lilypond[relative=1,fragment] +@lilypond[relative=2,fragment] \times 2/3 { f8 g a } @end lilypond @@ -217,7 +217,7 @@ a\> a a\! @item @code{\grace} @tab grace notes @tab -@lilypond[relative=1,fragment] +@lilypond[relative=2,fragment] \context Voice { \grace b16 c4 } @end lilypond @@ -237,7 +237,7 @@ twinkle @item @code{twin -- kle} @tab lyric hyphen @tab -@lilypond[fragment,relative=1] +@lilypond[fragment,relative=2] << \notes { g'4 g } \lyricsto "" \new Lyrics \lyrics { twin -- kle } >> @@ -246,21 +246,21 @@ twinkle @item @code{\chords @{ c:dim f:maj7 @}} @tab chords @tab -@lilypond[fragment,relative=1] +@lilypond[fragment,relative=2] \chords { c:dim f:maj7 } @end lilypond @item @code{\context ChordNames} @tab printing chord names @tab -@lilypond[fragment,relative=1] +@lilypond[fragment,relative=2] \context ChordNames \chords { c:dim f:maj7 } @end lilypond @item @code{<<@{e f@} \\@{c d@}>>} @tab polyphony @tab -@lilypond[fragment,relative=2] +@lilypond[fragment,relative=3] \context Staff <<{e f} \\ {c d}>> @end lilypond diff --git a/Documentation/user/introduction.itely b/Documentation/user/introduction.itely index 7dd564d569..6e41c8d0ad 100644 --- a/Documentation/user/introduction.itely +++ b/Documentation/user/introduction.itely @@ -1,61 +1,64 @@ @c -*-texinfo-*- +@c This file is part of lilypond.tely @node Introduction @chapter Introduction LilyPond is a system for formatting music prettily. This chapter -discusses the backgrounds of LilyPond. It explains the problem of +discusses the backgrounds of LilyPond. It explains the problem of printing music with computers, and our approach to solving those problems. @menu -* Engraving:: -* Automated engraving:: -* What symbols to engrave?:: -* Music representation:: -* Example applications:: -* About this manual:: +* Engraving:: +* Automated engraving:: +* What symbols to engrave?:: +* Music representation:: +* Example applications:: +* About this manual:: @end menu @node Engraving @section Engraving -The art of music typography is called @emph{(plate) engraving}. The -term derives from the traditional process of music printing. Only a +The art of music typography is called @emph{(plate) engraving}. The +term derives from the traditional process of music printing. Just a few decades ago, sheet music was made by cutting and stamping the -music into zinc or pewter plates in mirror image. The plate would be -inked, and the depressions caused by the cutting and stamping would -hold ink. An image was formed by pressing paper to the plate. The -stamping and cutting was completely done by hand. Making corrections -was cumbersome, so engraving had to be done correctly in one go. Of -course, this was a highly specialized skill, and a craftsman had to -complete around 10 years of practical training before he could be a -master engraver. - - -Nowadays, all newly printed music is produced on computers. This has -obvious advantages: prints are cheaper to make, and editorial work can -be done over e-mail. Unfortunately, the pervasive use of computers has -also decreased the graphical quality of scores. Computer printouts -have a bland, mechanical look, which makes them unpleasant to play -from. - +music into a zinc or pewter plate in mirror image. The plate would be +inked, the depressions caused by the cutting and stamping would hold +ink. An image was formed by pressing paper to the plate. The +stamping and cutting was completely done by hand. Making a correction +was cumbersome, if possible at all, so the engraving had to be perfect +in one go. Engraving was a highly specialized skill, a craftsman had +to complete around ten years of practical training before he could be +a master engraver. + +Nowadays, all newly printed music is produced with computers. This +has obvious advantages; prints are cheaper to make, editorial work can +be delivered by email. Unfortunately, the pervasive use of computers +has also decreased the graphical quality of scores. Computer +printouts have a bland, mechanical look, which makes them unpleasant +to play from. The most important features of a music print is the +font, i.e, the symbols or glyphs, and the placement or spacing of the +symbols. + +@c introduce illustrating aspects of engraving, font... The images below illustrate the difference between traditional engraving and typical computer output, and the third picture shows how -LilyPond mimics the traditional look. The left picture shows a scan -of a flat symbol from a Henle edition published in 2000. In the center -show symbol from a hand engraved B@"{a}renreiter edition of the same -music. The left scan illustrates typical flaws of computer print: the -staff line are thin, the weight of the symbol matches the light lines, -and the glyph has a straight layout with sharp corners. By contrast, -the B@"{a}renreiter has a bold and almost voluptuous rounded look. -Our flat symbol is designed after, among others, this one. It is -rounded, and its weight harmonizes with the thickness of our staff -lines, which are also much thicker than Henle's lines. - -@multitable @columnfractions .1 .3 .3 .3 +LilyPond mimics the traditional look. The left picture shows a scan +of a flat symbol from a Henle edition published in 2000. In the +center show symbol from a hand engraved B@"{a}renreiter edition of the +same music. The left scan illustrates typical flaws of computer +print: the staff lines are thin, the weight of the flat symbol matches +the light lines and it has a straight layout with sharp corners. By +contrast, the B@"{a}renreiter flat has a bold, almost voluptuous +rounded look. Our flat symbol is designed after, among others, this +one. It is rounded, and its weight harmonizes with the thickness of +our staff lines, which are also much thicker than Henle's lines. + +@multitable @columnfractions .05 .3 .3 .3 .05 @item @tab @ifnotinfo @iftex @@ -101,68 +104,70 @@ LilyPond Feta font (2003) @cindex blackness @cindex balance +@c introduce illustrating aspects of engraving, spacing... In spacing, the distribution of space should reflect the durations between notes. However, many modern scores adhere to the durations -with mathematical precision, and that leads to a poor result. In the -next example, a motive is printed twice. It is printed using exact -mathematical spacing, and with some corrections. Can you spot which -fragment is which? +with mathematical precision, which leads to a poor result. In the +next example a motive is printed twice. It is printed once using +exact mathematical spacing, and once with corrections. Can you +spot which fragment is which? @cindex optical spacing +@quotation @lilypond[noindent] - \score { \notes { - \override Staff.NoteSpacing #'stem-spacing-correction - = #0.6 - c'4 e''4 e'4 b'4 | - \stemDown b'4 e''4 a'4 e''4| \stemBoth - \bar "||" - \override Staff.NoteSpacing #'stem-spacing-correction - = #0.0 - \override Staff.StaffSpacing #'stem-spacing-correction - = #0.0 - c'4 e''4 e'4 b'4 | - \stemDown b'4 e''4 a'4 e''4| - } - \paper { raggedright = ##t } } +\score { + \notes { + \override Staff.NoteSpacing #'stem-spacing-correction = #0.6 + c'4 e''4 e'4 b'4 | + \stemDown b'4 e''4 a'4 e''4 | \bar "||" + \override Staff.NoteSpacing #'stem-spacing-correction = #0.0 + \override Staff.StaffSpacing #'stem-spacing-correction = #0.0 + \stemBoth c'4 e''4 e'4 b'4 | + \stemDown b'4 e''4 a'4 e''4 | + } + \paper { raggedright = ##t } +} @end lilypond +@end quotation @cindex regular rhythms @cindex regular spacing The fragment only uses quarter notes: notes that are played in a -constant rhythm. The spacing should reflect that. Unfortunately, the -eye deceives us a little: not only does it notice the distance between +constant rhythm. The spacing should reflect that. Unfortunately, the +eye deceives us a little; not only does it notice the distance between note heads, it also takes into account the distance between -consecutive stems. As a result, the notes of an up-stem/down-stem +consecutive stems. As a result, the notes of an up-stem/down-stem combination should be put farther apart, and the notes of a down-up combination should be put closer together, all depending on the -combined vertical positions of the notes. The first two measures are -printed with this correction, the last two measures without. The notes +combined vertical positions of the notes. The first two measures are +printed with this correction, the last two measures without. The notes in the last two measures form down-stem/up-stem clumps of notes. @cindex typography -Musicians are usually more absorbed with performing the music than -with studying its looks, so this nitpicking about typographical -details may seem academical. That is not justified. In larger pieces -with monotonous rhythms, spacing corrections lead to subtle variations -in the layout of every line, giving each one a distinct visual -signature. Without this signature, all lines would look the same, they -become like a labyrinth. If the musician looks away once or has a -lapse in his concentration, he will be lost on the page. +Musicians are usually more absorbed with performing than with studying +the looks of piece of music; nitpicking about typographical details +may seem academical. But it is not. In larger pieces with monotonous +rhythms, spacing corrections lead to subtle variations in the layout +of every line, giving each one a distinct visual signature. Without +this signature all lines would look the same, they become like a +labyrinth. If the musician looks away once or has a lapse in his +concentration, he will be lost on the page. +@c he/she Similarly, the strong visual look of bold symbols on heavy staff lines stands out better when music is far away from reader, for example, if it is on a music stand. A careful distribution of white space allows music to be set very tightly without cluttering symbols together. The -result minimizes the number of page turns, +result minimizes the number of page turns, which is a great advantage. -This is a common characteristic of typography. Layout should be +This is a common characteristic of typography. Layout should be pretty, not only for its own sake, but especially because it helps the -reader in his task. For performance material like sheet music, this is -doubly important: musicians have a limited amount of attention. The +reader in his task. For performance material like sheet music, this is +doubly important: musicians have a limited amount of attention. The less attention they need for reading, the more they can focus on -playing itself. In other words, better typography translates to better +playing itself. In other words, better typography translates to better performances. Hopefully, these examples also demonstrate that music typography is an @@ -184,142 +189,141 @@ How do we go about implementing typography? If craftsmen need over ten years to become true masters, how could we simple hackers ever write a program to take over their jobs? -The answer is: we cannot. Typography relies on human judgment of -appearance, so people cannot be replaced ultimately. However, much of -the dull work can be automated. If LilyPond solves most of the common -situations correctly, then this will be a huge improvement over -existing software. The remaining cases can be tuned by hand. Over the -course of years, the software can be refined to do more and more +The answer is: we cannot. Typography relies on human judgment of +appearance, so people cannot be replaced ultimately. However, much of +the dull work can be automated. If LilyPond solves most of the common +situations correctly, this will be a huge improvement over existing +software. The remaining cases can be tuned by hand. Over the course +of years, the software can be refined to do more and more automatically, so manual overrides are less and less necessary. -When we started, we wrote the program in C++. With this design, the -program functionality was set in stone stone by us developers. That -proved to be unsatisfactory: - +When we started we wrote the LilyPond entirely using the C++ +programming language, the program's functionality was set in stone by +the developers. That proved to be unsatisfactory for a number of +reasons: @itemize @bullet @item When LilyPond makes mistakes, users need to override formatting decisions. Therefore, the user -must access to the formatting engine. Hence, rules and settings cannot +must access to the formatting engine. Hence, rules and settings cannot be fixed by us at compile time, but they must be accessible for users at run-time. @item Engraving is a matter of visual judgment, and therefore a matter of -taste. As knowledgeable as we are, users can disagree with our -personal decisions. Therefore, the definitions of typographical style +taste. As knowledgeable as we are, users can disagree with our +personal decisions. Therefore, the definitions of typographical style must also be accessible to the user. @item Finally, we continually refine the formatting algorithms, so we -need a flexible approach to rules. The C++ language forces a certain +need a flexible approach to rules. The C++ language forces a certain method of grouping rules that do not match well with how music notation works. @end itemize -The formatting architecture of LilyPond addresses these needs. It is -built around the notion graphical objects, carrying variables. The -architecture encompasses formatting rules, typographical style and -individual formatting decisions. - -Variables control layout decisions. For example, many objects have a -direction variable that encodes the choice between up and down (or -left and right). Here you see two chords, with accents and -arpeggio. In the first chord, the objects have all directions down (or -left). The second chord has all directions up (right). - +These problems have been addressed by integrating the GUILE +interpreter for the scheme programming language and rewriting parts of +LilyPond in scheme. The new, flexible formatting is built around the +notion of graphical objects, described by scheme variables and +functions. This architecture encompasses formatting rules, +typographical style and individual formatting decisions. The user has +direct access to most of these controls. + +Scheme variables control layout decisions. For example, many +graphical objects have a direction variable that encodes the choice +between up and down (or left and right). Here you see two chords, +with accents and arpeggio. In the first chord, the graphical objects +have all directions down (or left). The second chord has all +directions up (right). + +@quotation @lilypond[raggedright,relative=1] \new Score \with { - \override SpacingSpanner #'spacing-increment = #3 - \override TimeSignature #'transparent = ##t -} { - \stemDown - 4_>-\arpeggio - - \override Arpeggio #'direction = #RIGHT - \stemUp - 4^>-\arpeggio + \override SpacingSpanner #'spacing-increment = #3 + \override TimeSignature #'transparent = ##t + } { + \stemDown 4_>-\arpeggio + \override Arpeggio #'direction = #RIGHT + \stemUp 4^>-\arpeggio } @end lilypond +@end quotation -The process of formatting a score consists of reading and -writing object variables. +The process of formatting a score consists of reading and writing the +variables of graphical objects. -Some variables have a preset value. For example, the thickness of many -lines ---a characteristic of typographical style--are preset -variables. Changing them gives a different typographical impression: - -@lilypond[] -frag= \notes { - \clef bass f8 as8 - c'4-~ c'16 as g f e16 g bes c' des'4 - } -\paper { raggedright = ##t } +Some variables have a preset value. For example, the thickness of many +lines---a characteristic of typographical style---are preset +variables. Changing them gives a different typographical impression +@quotation +@lilypond[raggedright] +fragment = \notes { + \clef bass f8 as8 + c'4-~ c'16 as g f e16 g bes c' des'4 +} \score { -<< \new Staff \frag - \new Staff \with { - \override Beam #'thickness = #0.3 - \override Stem #'thickness = #0.5 - \override Bar #'thickness = #3.6 - \override Tie #'thickness = #2.2 - \override StaffSymbol #'thickness = #3.0 - \override Tie #'extra-offset = #'(0 . 0.3) - } \frag + << + \new Staff \fragment + \new Staff \with { + \override Beam #'thickness = #0.3 + \override Stem #'thickness = #0.5 + \override Bar #'thickness = #3.6 + \override Tie #'thickness = #2.2 + \override StaffSymbol #'thickness = #3.0 + \override Tie #'extra-offset = #'(0 . 0.3) + } \fragment >> } @end lilypond +@end quotation Formatting rules are also preset variables: each object has variables -containing procedures. These procedure perform the actual formatting, -and by substituting different ones, we can change behavior. In the +containing procedures. These procedure perform the actual formatting, +and by substituting different ones, we can change behavior. In the following example, the rule that note head objects use to produce -their symbol is changed during the music fragment: - +their symbol is changed during the music fragment +@quotation @lilypond[raggedright] -#(define (mc-squared gr org cur) - (let* - ((ifs (ly:grob-property gr 'interfaces)) - (sp (ly:grob-property gr 'staff-position)) ) - (if (and (memq 'note-head-interface ifs) - (memq sp '(-2 -3 -5))) - (begin - (ly:grob-set-property! gr 'print-function brew-new-markup-stencil) - (ly:grob-set-property! gr 'font-family 'roman) - (ly:grob-set-property! - gr 'text - (make-raise-markup -0.5 - (case sp - ((-5) (make-simple-markup "m")) - ((-3) (make-simple-markup "c ")) - ((-2) (make-smaller-markup (make-bold-markup "2"))) - (else (make-simple-markup "bla")) - )))) - ))) +#(define (mc-squared grob orig current) + (let ((interfaces (ly:grob-property grob 'interfaces)) + (pos (ly:grob-property grob 'staff-position))) + (if (and (memq 'note-head-interface interfaces) + (memq pos '(-2 -3 -5))) + (begin + (ly:grob-set-property! grob 'print-function brew-new-markup-stencil) + (ly:grob-set-property! grob 'font-family 'roman) + (ly:grob-set-property! + grob 'text + (make-raise-markup + -0.5 + (case pos + ((-5) (make-simple-markup "m")) + ((-3) (make-simple-markup "c ")) + ((-2) (make-smaller-markup (make-bold-markup "2"))) + (else (make-simple-markup "bla"))))))))) \score { - \notes \context Voice \relative c' - { - \stemUp - \set autoBeaming = ##f - \time 2/4 - { 4 - \once \override NoteHead #'print-function - = #Note_head::brew_ez_stencil - - \once \override NoteHead #'style - = #'cross - - \applyoutput #mc-squared - - << { d8[ es-( fis^^ g] fis2-) } - \repeat unfold 5 { \applyoutput #mc-squared s8 } >> - - } - - } + \notes \context Voice \relative c' { + \stemUp + \set autoBeaming = ##f + \time 2/4 + 4 + \once \override NoteHead #'print-function = #Note_head::brew_ez_stencil + + \once \override NoteHead #'style = #'cross + + \applyoutput #mc-squared + + << + { d8[ es-( fis^^ g] fis2-) } + \repeat unfold 5 { \applyoutput #mc-squared s8 } + >> + } } @end lilypond +@end quotation @@ -330,20 +334,20 @@ their symbol is changed during the music fragment: @cindex typography The formatting process in LilyPond decides where to place -symbols. However, this can only be done once it is decided @emph{what} +symbols. However, this can only be done once it is decided @emph{what} symbols should be printed, in other words what notation to use. Common music notation is a system of recording music that has evolved -over the past 1000 years. The form that is now in common use, dates -from the early renaissance. Although, the basic form (i.e. note heads on a +over the past 1000 years. The form that is now in common use, dates +from the early renaissance. Although, the basic form (i.e. note heads on a 5-line staff) has not changed, the details still change to express the innovations of contemporary notation. Hence, it encompasses some 500 -years of music. Its applications range from monophonic melodies to +years of music. Its applications range from monophonic melodies to monstrous counterpoint for large orchestras. How can we get a grip on such a many-headed beast, and force it into the confines of a computer program? We have broken up the problem of -notation (as opposed to engraving, i.e. typography) into digestible +notation (as opposed to engraving, i.e. typography) into digestible and programmable chunks: every type of symbol is handled by a separate module, a so-called plug-in. Each plug-in is completely modular and independent, so each can be developed and improved separately. People @@ -353,233 +357,261 @@ engravers, so by analogy, each plug-in is called @code{engraver}. In the following example, we see how we start out with a plug-in for note heads, the @code{Note_heads_engraver}. -@lilypond[] +@quotation +@lilypond[raggedright] \include "engraver-example.lyinc" -\score { \topVoice -\paper { - \context { \VoiceContext - \remove "Stem_engraver" - \remove "Phrasing_slur_engraver" - \remove "Slur_engraver" - \remove "Script_engraver" - \remove "Beam_engraver" - \remove "Auto_beam_engraver" - - } - \context { \StaffContext - \remove "Accidental_engraver" - \remove "Key_engraver" - \remove "Clef_engraver" - \remove "Bar_engraver" - \remove "Time_signature_engraver" - \remove "Staff_symbol_engraver" - \consists "Pitch_squash_engraver" - } - -} +\score { + \topVoice + \paper { + \context { + \VoiceContext + \remove "Stem_engraver" + \remove "Phrasing_slur_engraver" + \remove "Slur_engraver" + \remove "Script_engraver" + \remove "Beam_engraver" + \remove "Auto_beam_engraver" + } + \context { + \StaffContext + \remove "Accidental_engraver" + \remove "Key_engraver" + \remove "Clef_engraver" + \remove "Bar_engraver" + \remove "Time_signature_engraver" + \remove "Staff_symbol_engraver" + \consists "Pitch_squash_engraver" + } + } } @end lilypond +@end quotation -Then a @code{Staff_symbol_engraver} adds the staff: +@noindent +Then a @code{Staff_symbol_engraver} adds the staff -@lilypond[] +@quotation +@lilypond[raggedright] \include "engraver-example.lyinc" -\score { \topVoice -\paper { - \context { \VoiceContext - \remove "Stem_engraver" - \remove "Phrasing_slur_engraver" - \remove "Slur_engraver" - \remove "Script_engraver" - \remove "Beam_engraver" - \remove "Auto_beam_engraver" - - } - \context { \StaffContext - \remove "Accidental_engraver" - \remove "Key_engraver" - \remove "Clef_engraver" - \remove "Bar_engraver" - \consists "Pitch_squash_engraver" - \remove "Time_signature_engraver" - } - -} +\score { + \topVoice + \paper { + \context { + \VoiceContext + \remove "Stem_engraver" + \remove "Phrasing_slur_engraver" + \remove "Slur_engraver" + \remove "Script_engraver" + \remove "Beam_engraver" + \remove "Auto_beam_engraver" + } + \context { + \StaffContext + \remove "Accidental_engraver" + \remove "Key_engraver" + \remove "Clef_engraver" + \remove "Bar_engraver" + \consists "Pitch_squash_engraver" + \remove "Time_signature_engraver" + } + } } @end lilypond +@end quotation - The @code{Clef_engraver} defines a reference point for the staff: +@noindent +The @code{Clef_engraver} defines a reference point for the staff -@lilypond[] +@quotation +@lilypond[raggedright] \include "engraver-example.lyinc" -\score { \topVoice -\paper { - \context { \VoiceContext - \remove "Stem_engraver" - \remove "Phrasing_slur_engraver" - \remove "Slur_engraver" - \remove "Script_engraver" - \remove "Beam_engraver" - \remove "Auto_beam_engraver" - } - \context { \StaffContext - \remove "Accidental_engraver" - \remove "Key_engraver" - \remove "Bar_engraver" - \remove "Time_signature_engraver" - } - -} +\score { + \topVoice + \paper { + \context { + \VoiceContext + \remove "Stem_engraver" + \remove "Phrasing_slur_engraver" + \remove "Slur_engraver" + \remove "Script_engraver" + \remove "Beam_engraver" + \remove "Auto_beam_engraver" + } + \context { + \StaffContext + \remove "Accidental_engraver" + \remove "Key_engraver" + \remove "Bar_engraver" + \remove "Time_signature_engraver" + } + } } @end lilypond +@end quotation -And the @code{Stem_engraver} adds stems: +@noindent +And the @code{Stem_engraver} adds stems -@lilypond[] +@quotation +@lilypond[raggedright] \include "engraver-example.lyinc" -\score { \topVoice -\paper { - \context { \VoiceContext - \remove "Phrasing_slur_engraver" - \remove "Slur_engraver" - \remove "Script_engraver" - \remove "Beam_engraver" - \remove "Auto_beam_engraver" - } - \context { \StaffContext - \remove "Accidental_engraver" - \remove "Key_engraver" - \remove "Bar_engraver" - \remove "Time_signature_engraver" - } -} +\score { + \topVoice + \paper { + \context { + \VoiceContext + \remove "Phrasing_slur_engraver" + \remove "Slur_engraver" + \remove "Script_engraver" + \remove "Beam_engraver" + \remove "Auto_beam_engraver" + } + \context { + \StaffContext + \remove "Accidental_engraver" + \remove "Key_engraver" + \remove "Bar_engraver" + \remove "Time_signature_engraver" + } + } } @end lilypond +@end quotation The @code{Stem_engraver} is notified of any note head coming along. Every time one (or more, for a chord) note head is seen, a stem object is created and connected to the note head. - By adding engravers for beams, slurs, accents, accidentals, bar lines, time signature, and key signature, we get a complete piece of notation. -@lilypond[] +@quotation +@lilypond[raggedright] \include "engraver-example.lyinc" - \score { \topVoice } @end lilypond - - +@end quotation This system works well for monophonic music, but what about -polyphony? In polyphonic notation, many voices can share a staff. +polyphony? In polyphonic notation, many voices can share a staff. -@lilypond[] +@quotation +@lilypond[raggedright] \include "engraver-example.lyinc" \score { \context Staff << \topVoice \\ \botVoice >> } @end lilypond +@end quotation In this situation, the accidentals and staff are shared, but the -stems, slurs, beams, etc. are private to each voice. Hence, engravers -should be grouped. The engravers for note heads, stems, slurs, etc. go +stems, slurs, beams, etc. are private to each voice. Hence, engravers +should be grouped. The engravers for note heads, stems, slurs, etc. go into a group called ``Voice context,'' while the engravers for key, -accidental, bar, etc. go into a group called ``Staff context.'' In the +accidental, bar, etc. go into a group called ``Staff context.'' In the case of polyphony, a single Staff context contains more than one Voice -context. In polyphonic notation, many voices can share a staff: -Similarly, more Staff contexts can be put into a single Score context. +context. In polyphonic notation, many voices can share a staff. +Similarly, more Staff contexts can be put into a single Score context -@lilypond[] +@quotation +@lilypond[raggedright] \include "engraver-example.lyinc" \score { -<< \new Staff << \topVoice \\ \botVoice >> -\new Staff << \pah \\ \hoom >> + << + \new Staff << \topVoice \\ \botVoice >> + \new Staff << \pah \\ \hoom >> >> } @end lilypond +@end quotation @node Music representation @section Music representation Ideally, the input format for any high-level formatting system is an -abstract description of the content. In this case, that would be the -music itself. This poses a formidable problem: how can we define what +abstract description of the content. In this case, that would be the +music itself. This poses a formidable problem: how can we define what music really is? Instead of trying to find an answer, we have reversed the question. We write a program capable of producing sheet music, -and adjust the format to be as lean as possible. When the format can +and adjust the format to be as lean as possible. When the format can no longer be trimmed down, by definition we are left with content itself. Our program serves as a formal definition of a music document. - -The syntax is also the user-interface for LilyPond, hence it is easily typable, e.g., +The syntax is also the user-interface for LilyPond, hence it is easy +to type @example - c'4 d'8 +c'4 d'8 @end example -Are a quarter note C (middle C) and eighth note D1 (D above middle C), -as in this example: - +a quarter note C1 (middle C) and eighth note D1 (D above middle C) +@quotation @lilypond[fragment] - c'4 d'8 +c'4 d'8 @end lilypond +@end quotation -On a microscopic scale, such syntax is easy to use. On a larger scale, -syntax also needs structure. How else can you enter complex pieces -like symphonies and operas? The structure is formed by the concept of -music expressions: by combining small fragments of music into larger -ones, more complex music can be expressed. For example, +On a microscopic scale, such syntax is easy to use. On a larger +scale, syntax also needs structure. How else can you enter complex +pieces like symphonies and operas? The structure is formed by the +concept of music expressions: by combining small fragments of music +into larger ones, more complex music can be expressed. For example +@quotation @lilypond[verbatim,fragment,relative=1] c4 @end lilypond +@end quotation -Combine this simultaneously with two other notes by enclosing in << and >>. +Combine this simultaneously with two other notes by enclosing in << and >> -@verbatim - <> -@end verbatim +@example +<> +@end example +@quotation @lilypond[fragment,relative=1] - \new Staff <> +\new Voice { <> } @end lilypond +@end quotation +This expression is put in sequence by enclosing it in curly braces +@code{@{ @dots{} @}} - -This expression is put in sequence by enclosing it in braces, i.e., - -@verbatim - { <> f4 } -@end verbatim +@example +@{ <> f4 @} +@end example +@quotation @lilypond[relative=1] - \new Voice { <> f4 } +\new Voice { <> f4 } @end lilypond +@end quotation The above is another expression, and therefore, it many combined again -with a simultaneous expression (in this case, a half note). +with a simultaneous expression; in this case, a half note -@verbatim - << { <> f4 } g2 >> -@end verbatim -@lilypond[fragment,relative=1] -<< g2 \\ { 4 f4 } >> +@example +<< @{ <> f4 @} g2 >> +@end example +@quotation +@lilypond[fragment,relative=2] +\new Voice { << g2 \\ { 4 f4 } >> } @end lilypond +@end quotation Such recursive structures can be specified neatly and formally in a -context-free grammar. The parsing code is also generated from this -grammar. In other words, the syntax of LilyPond is clearly and +context-free grammar. The parsing code is also generated from this +grammar. In other words, the syntax of LilyPond is clearly and unambiguously defined. User-interfaces and syntax are what people see and deal with -most. They are partly a matter of taste, and also subject of much -discussion. Although discussions on taste do have their merit, they -are not very productive. In the larger picture of LilyPond, the +most. They are partly a matter of taste, and also subject of much +discussion. Although discussions on taste do have their merit, they +are not very productive. In the larger picture of LilyPond, the importance of input syntax is small: inventing neat syntax is easy, -writing decent formatting code is much harder. This is also +writing decent formatting code is much harder. This is also illustrated by the line-counts for the respective components: parsing and representation take up less than 10% of the code. @@ -588,41 +620,52 @@ and representation take up less than 10% of the code. @section Example applications We have written LilyPond as an experiment of how to condense the art -of music engraving into a computer program. Thanks to all that hard +of music engraving into a computer program. Thanks to all that hard work, the program can now be used to perform useful tasks. The -simplest application is printing notes: +simplest application is printing notes +@quotation @lilypond[relative=1] - \time 2/4 c4 c g'4 g a4 a g2 +\time 2/4 c4 c g'4 g a4 a g2 @end lilypond +@end quotation -By adding chord names and lyrics we obtain a lead sheet: +@noindent +By adding chord names and lyrics we obtain a lead sheet +@quotation @lilypond[raggedright] -\score { << - \context ChordNames \chords { c2 c f2 c } - \new Staff \notes \relative c' { \time 2/4 c4 c g'4 g a4 a g2 } - \context Lyrics \lyrics { twin4 kle twin kle lit tle star2 } >> } +\score { + << + \context ChordNames \chords { c2 c f2 c } + \new Staff \notes \relative c' { \time 2/4 c4 c g'4 g a4 a g2 } + \context Lyrics \lyrics { twin4 kle twin kle lit tle star2 } + >> +} @end lilypond +@end quotation + -Polyphonic notation and piano music can also be printed. The following -example combines some more exotic constructs: +Polyphonic notation and piano music can also be printed. The following +example combines some more exotic constructs -@lilypondfile{screech-boink.ly} +@quotation +@lilypondfile[raggedright]{screech-boink.ly} +@end quotation The fragments shown above have all been written by hand, but that is -not a requirement. Since the formatting engine is mostly automatic, it +not a requirement. Since the formatting engine is mostly automatic, it can serve as an output means for other programs that manipulate -music. For example, it can also be used to convert databases of +music. For example, it can also be used to convert databases of musical fragments to images for use on websites and multimedia presentations. -This manual also shows an application: the input format is plain text, -and can therefore be easily embedded in other text-based formats, such -as La@TeX{}, HTML or in the case of this manual, Texinfo. By means of a -special program, the input fragments can be replaced by music images in -the resulting PostScript or HTML output files. This makes it easy to -mix music and text in documents. +This manual also shows an application: the input format is text, and +can therefore be easily embedded in other text-based formats such as +La@TeX{}, HTML or in the case of this manual, Texinfo. By means of a +special program, the input fragments can be replaced by music images +in the resulting PostScript or HTML output files. This makes it easy +to mix music and text in documents. @@ -631,59 +674,62 @@ mix music and text in documents. The manual is divided into the following chapters: @itemize @bullet + @item -@ifhtml The +@ifhtml +The @end ifhtml @emph{@ref{Tutorial}} -gives a gentle introduction to typesetting music. -First time users should start here. +gives a gentle introduction to typesetting music. +First time users should start here. + @item @ifhtml The @end ifhtml @emph{@ref{Notation manual}} -discusses topics grouped by notation construct. Once you master the +discusses topics grouped by notation construct. Once you master the basics, this is the place to look up details. + @item @ifhtml The @end ifhtml -@emph{@ref{Literature list}} - contains a set of useful reference books, for those who wish to know - more on notation and engraving. -@item -@ifhtml - The - @end ifhtml @emph{@ref{Changing defaults}} -@c -Explains how to fine tune layout. +explains how to fine tune layout. @item @ifhtml The chapter @end ifhtml -@emph{@ref{Invoking LilyPond}} explains how to run LilyPond and its helper +@emph{@ref{Invoking LilyPond}} shows how to run LilyPond and its helper programs. @item @ifhtml -The +The @end ifhtml @emph{@ref{lilypond-book manual}} explains the details behind creating documents with in-line music examples (like this manual). - @item @ifhtml -The chapter +The chapter @end ifhtml @emph{@ref{Converting from other formats}} -explains how to run the conversion programs. These programs +explains how to run the conversion programs. These programs are supplied with the LilyPond package, and convert a variety of music -formats to the @code{.ly} format. In addition, this section explains +formats to the @code{.ly} format. In addition, this section explains how to upgrade input files from previous versions of LilyPond. +@item +@ifhtml +The +@end ifhtml +@emph{@ref{Literature list}} + contains a set of useful reference books, for those who wish to know + more on notation and engraving. + @end itemize Once you are an experienced user, you can use the manual as reference: @@ -693,7 +739,7 @@ that case, please file a bug report.}, but the document is also available in @ifnothtml a big HTML page, -@end ifnothtml +@end ifnothtml @ifhtml @uref{../lilypond.html, a big HTML page} @end ifhtml @@ -702,11 +748,12 @@ browser. @cindex search in manual @cindex using the manual - +@c FIXME: +@c add/integrate glossary, put in list above If you are not familiar with music notation or music terminology -(especially if you are a non-native English speaker), then it is -advisable to consult the glossary as well. The glossary explains -musical terms, and includes translations to various languages. It is a +(especially if you are a non-native English speaker), it is advisable +to consult the glossary as well. The glossary explains musical terms, +and includes translations to various languages. It is a @ifhtml @uref{../music-glossary.html,separate document}. @end ifhtml @@ -720,7 +767,7 @@ separate document, available in HTML and PDF. @cindex language -This manual is not complete without a number of other documents. They +This manual is not complete without a number of other documents. They are not available in print, but should be included with the documentation package for your platform: @@ -737,9 +784,9 @@ class, object and function. It is produced directly from the formatting definitions used. Almost all formatting functionality that is used internally, is -available directly to the user. For example, all variables that +available directly to the user. For example, all variables that control thicknesses, distances, etc, can be changed in input -files. There are a huge number of formatting options, and all of them +files. There are a huge number of formatting options, and all of them are described in the generated documentation. Each section of the notation manual has a @b{See also} subsection, which refers to the the generated documentation. In the HTML document, these subsections @@ -752,10 +799,10 @@ have clickable links. @end ifhtml After you have gone through the tutorial, you should be able to write -input files. In practice, writing files from scratch turns out to be +input files. In practice, writing files from scratch turns out to be intimidating. To give you a head start, we have collected a number of often-used formats in example files. These files can be used as a -start: simply copy the template, and add notes in the appropriate +start; simply copy the template and add notes in the appropriate places. @item @@ -765,9 +812,9 @@ places. @end ifhtml @cindex snippets -These small files show various tips and tricks, and are available as a -big HTML document, with pictures and explanatory texts included. - +This collection of files shows various tips and tricks, and is +available as a big HTML document, with pictures and explanatory texts +included. @item The regression tests @@ -776,9 +823,9 @@ big HTML document, with pictures and explanatory texts included. @end ifhtml This collection of files tests each notation and engraving feature of -LilyPond in one file. The collection is primarily there to help us +LilyPond in one file. The collection is primarily there to help us debug problems, but it can be instructive to see how we exercise the -program. The format is like the tips and tricks document. +program. The format is similar to the the tips and tricks document. @end itemize @@ -790,11 +837,11 @@ the image. The location of the documentation files that are mentioned here can vary from system to system. On occasion, this manual refers to initialization and example files. Throughout this manual, we refer to -input files relative to the top-directory of the source archive. For +input files relative to the top-directory of the source archive. For example, @file{input/test/bla.ly} may refer to the file @file{lilypond-1.7.19/input/test/bla.ly}. On binary packages for the Unix platform, the documentation and examples can typically be found -somewhere below @file{/usr/share/doc/lilypond/}. Initialization files, +somewhere below @file{/usr/share/doc/lilypond/}. Initialization files, for example @file{scm/lily.scm}, or @file{ly/engraver-init.ly}, are usually found in the directory @file{/usr/share/lilypond/}. @@ -812,5 +859,5 @@ Finally, this and all other manuals, are available online both as PDF files and HTML from the web site, which can be found at @uref{http://www.lilypond.org/}. -@cindex website +@cindex website @cindex URL diff --git a/Documentation/user/lilypond.tely b/Documentation/user/lilypond.tely index bfbcd3c3fd..da5e4828e8 100644 --- a/Documentation/user/lilypond.tely +++ b/Documentation/user/lilypond.tely @@ -63,6 +63,16 @@ are clickable in HTML. * Abbrevs in caps, e.g. HTML, DVI, MIDI, etc. +* Colon usage + 0. Do not use a colon to introduce examples, sentences just continue + + in the display material. + + 1. To introduce lists + 2. When beginning a quote: "So, he said,..." + This usage is rarer. Americans often just use a comma. + 3. When adding a defining example at the end of a sentence. + @end ignore @ifhtml diff --git a/Documentation/user/macros.itexi b/Documentation/user/macros.itexi index 6a8b7c7bb8..9d0e1bd74a 100644 --- a/Documentation/user/macros.itexi +++ b/Documentation/user/macros.itexi @@ -1,5 +1,12 @@ @c -*-texinfo-*- +@tex +\input feta20.tex +\font\fetasixteen=feta16 +\def\fetafont{\fetasixteen} +\def\fetachar#1{\hbox{\fetasixteen#1}} +@end tex + @c Reference GLOSsary @macro rglos {NAME} @ifhtml @@ -23,7 +30,7 @@ @iftex @macro texisharp {word} @tex -$\\sharp$% +\\raise0.5ex\\fetachar\\fetasharp @end tex @end macro @end iftex @@ -37,7 +44,7 @@ b @iftex @macro texiflat {word} @tex -$\\flat$% +\\kern0.15em\\fetachar\\fetaflat @end tex @end macro @end iftex diff --git a/Documentation/user/music-glossary.tely b/Documentation/user/music-glossary.tely index de4c5c0e46..dfa5b3711a 100644 --- a/Documentation/user/music-glossary.tely +++ b/Documentation/user/music-glossary.tely @@ -863,7 +863,7 @@ geometrically describes the development of a range of pitches geometrical shape of a cluster covers the area in which any single pitch contained in the cluster would be notated as an ordinary note. -@lilypond[relative=1,verbatim] +@lilypond[relative=2,verbatim] \apply #notes-to-clusters { } @end lilypond diff --git a/Documentation/user/notation.itely b/Documentation/user/notation.itely index 8c3d532164..de451eaa03 100644 --- a/Documentation/user/notation.itely +++ b/Documentation/user/notation.itely @@ -60,16 +60,18 @@ related constructs, such as stems, tuplets and ties. @subsection Notes -A note is printed by specifying its pitch and then its duration: +A note is printed by specifying its pitch and then its duration @footnote{Notes constitute the most basic elements of LilyPond input, but they do not form valid input on their own without a @code{\score} block. However, for the sake of brevity and simplicity we will generally omit @code{\score} blocks and @code{\paper} declarations in this manual.} +@quotation @lilypond[fragment,verbatim] - cis'4 d'8 e'16 c'16 +cis'4 d'8 e'16 c'16 @end lilypond +@end quotation @node Pitches @@ -85,12 +87,14 @@ The most common syntax for pitch entry is used in @code{\chords} and names. The notes are specified by the letters @code{a} through @code{g}, while the octave is formed with notes ranging from @code{c} to @code{b}. The pitch @code{c} is an octave below middle C and the -letters span the octave above that C: +letters span the octave above that C +@quotation @lilypond[fragment,verbatim] \clef bass - a,4 b, c d e f g a b c' d' e' \clef treble f' g' a' b' c'' +a,4 b, c d e f g a b c' d' e' \clef treble f' g' a' b' c'' @end lilypond +@end quotation @cindex note names, Dutch @@ -102,27 +106,29 @@ names are the Dutch note names. In Dutch, @code{aes} is contracted to @code{es} and @code{ees} are accepted. Half-flats and half-sharps are formed by adding @code{-eh} and -@code{-ih}; the following is a series of Cs with increasing pitches: +@code{-ih}; the following is a series of Cs with increasing pitches @cindex quarter tones @cindex semi-flats, semi-sharps -@lilypond[verbatim,relative=2] - ceses4 - ceseh - ces - ceh - c - cih - cis - cisih - cisis -@end lilypond +@quotation +@lilypond[verbatim,relative=3] +ceses4 +ceseh +ces +ceh +c +cih +cis +cisih +cisis +@end lilypond +@end quotation There are predefined sets of note names for various other languages. To use them, include the language specific init file. For example: @code{\include "english.ly"}. The available language files -and the note names they define are: +and the note names they define are @anchor{note name} @anchor{note names} @@ -148,16 +154,18 @@ espanol.ly do re mi fa sol la sib si -s -b The optional octave specification takes the form of a series of single quote (`@code{'}') characters or a series of comma (`@code{,}') characters. Each @code{'} raises the pitch by one -octave; each @code{,} lowers the pitch by an octave: +octave; each @code{,} lowers the pitch by an octave +@quotation @lilypond[fragment,verbatim] - c' c'' es' g' as' gisis' ais' +c' c'' es' g' as' gisis' ais' @end lilypond +@end quotation @refcommands -Notes can be hidden and unhidden with the following commands: +Notes can be hidden and unhidden with the following commands @cindex @code{\hideNotes} @code{\hideNotes}, @@ -181,11 +189,13 @@ after the pitch. A cautionary accidental @cindex cautionary accidental @cindex parenthesized accidental (i.e. an accidental within parentheses) can be obtained by adding the -question mark `@code{?}' after the pitch: +question mark `@code{?}' after the pitch +@quotation @lilypond[fragment,verbatim] - cis' cis' cis'! cis'? +cis' cis' cis'! cis'? @end lilypond +@end quotation @seealso @@ -206,9 +216,11 @@ A chord is formed by a enclosing a set of pitches in @code{<} and @code{>}. A chord may be followed by a duration, and a set of articulations, just like simple notes. -@lilypond[relative] - 4 8 <>8 +@quotation +@lilypond[relative=1] +4 8 <>8 @end lilypond +@end quotation @node Rests @subsection Rests @@ -217,11 +229,13 @@ articulations, just like simple notes. -Rests are entered like notes, with the note name @code{r}: +Rests are entered like notes, with the note name @code{r} +@quotation @lilypond[raggedright,verbatim] r1 r2 r4 r8 @end lilypond +@end quotation Whole bar rests, centered in middle of the bar, must be done with multi-measure rests. They are discussed in @@ -231,11 +245,13 @@ must be done with multi-measure rests. They are discussed in A rest's vertical position may be explicitly specified by entering a note with the @code{\rest} keyword appended. This makes manual formatting in polyphonic music easier. Rest collision testing will -leave these rests alone: +leave these rests alone +@quotation @lilypond[raggedright,verbatim] a'4\rest d'4\rest @end lilypond +@end quotation @seealso @@ -250,15 +266,18 @@ Program reference: @internalsref{RestEvent}, and @internalsref{Rest}. @cindex Space note An invisible rest (also called a `skip') can be entered like a note -with note name `@code{s}' or with @code{\skip @var{duration}}: +with note name `@code{s}' or with @code{\skip @var{duration}} +@quotation @lilypond[raggedright,verbatim] a2 s4 a4 \skip 1 a4 @end lilypond +@end quotation The @code{s} syntax is only available in note mode and chord mode. In -other situations, you should use the @code{\skip} command: +other situations, you should use the @code{\skip} command +@quotation @lilypond[raggedright,verbatim] \score { \new Staff << @@ -267,6 +286,7 @@ other situations, you should use the @code{\skip} command: >> } @end lilypond +@end quotation The skip command is merely an empty musical placeholder. It does not produce any output, not even transparent output. @@ -275,9 +295,11 @@ The @code{s} skip command does create @internalsref{Staff} and @internalsref{Voice} when necessary, similar to note and rest commands. For example, the following results in an empty staff. +@quotation @lilypond[raggedright,verbatim] \score { \notes { s4 } } @end lilypond +@end quotation The same fragment using @code{\skip} results in an empty page. @@ -298,7 +320,7 @@ In Note, Chord, and Lyrics mode, durations are designated by numbers and dots: durations are entered as their reciprocal values. For example, a quarter note is entered using a @code{4} (since it is a 1/4 note), while a half note is entered using a @code{2} (since it is a 1/2 note). For notes -longer than a whole you must use variables: +longer than a whole you must use variables @example c'\breve @@ -307,6 +329,7 @@ r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r64 @end example +@quotation @lilypond[noindent] \score { \notes \relative c'' { @@ -328,17 +351,20 @@ r1 r2 r4 r8 r16 r32 r64 r64 } } @end lilypond +@end quotation If the duration is omitted then it is set to the previously entered duration. The default for the first note is a quarter note. The duration can be followed by dots (`@code{.}') in order to obtain dotted note -lengths: +lengths @cindex @code{.} +@quotation @lilypond[fragment,verbatim] - a' b' c''8 b' a'4 a'4. b'4.. c'8. +a' b' c''8 b' a'4 a'4. b'4.. c'8. @end lilypond +@end quotation @cindex @code{r} @cindex @code{s} @@ -348,17 +374,19 @@ will not affect the appearance of the notes or rests produced. In the following example, the first three notes take up exactly two beats, but no triplet bracket is printed. -@lilypond[fragment,relative=2,verbatim] - \time 2/4 - a4*2/3 gis4*2/3 a4*2/3 - a4 +@quotation +@lilypond[fragment,relative=3,verbatim] +\time 2/4 +a4*2/3 gis4*2/3 a4*2/3 +a4 @end lilypond +@end quotation @refcommands Dots are normally moved up to avoid staff lines, except in polyphonic situations. The following commands may be used to force a particular -direction manually: +direction manually @cindex @code{\dotsUp} @code{\dotsUp}, @@ -400,22 +428,26 @@ made invisible. A tie connects two adjacent note heads of the same pitch. The tie in effect extends the length of a note. Ties should not be confused with slurs, which indicate articulation, or phrasing slurs, which indicate -musical phrasing. A tie is entered using the tilde symbol `@code{~}': +musical phrasing. A tie is entered using the tilde symbol `@code{~}' +@quotation @lilypond[fragment,verbatim] - e' ~ e' ~ + e' ~ e' ~ @end lilypond +@end quotation When a tie is applied to a chord, all note heads whose pitches match are connected. When no note heads match, no ties will be created. In its meaning a tie is just a way of extending a note duration, similar to the augmentation dot; in the following example there are two ways of -notating exactly the same concept: +notating exactly the same concept @c +@quotation @lilypond[fragment,raggedright] \time 3/4 c'2. c'2 ~ c'4 @end lilypond +@end quotation If you need to tie a lot of notes over bars, it may be easier to use automatic note splitting (see @ref{Automatic note splitting}). @@ -460,11 +492,11 @@ optimal. @cindex @code{\times} Tuplets are made out of a music expression by multiplying all durations -with a fraction: +with a fraction @cindex @code{\times} @example - \times @var{fraction} @var{musicexpr} +\times @var{fraction} @var{musicexpr} @end example @noindent @@ -472,22 +504,26 @@ The duration of @var{musicexpr} will be multiplied by the fraction. The fraction's denominator will be printed over the notes, optionally with a bracket. The most common tuplet is the triplet in which 3 notes have the length of 2, so the notes are 2/3 of their written -length: +length +@quotation @lilypond[fragment,verbatim] - g'4 \times 2/3 {c'4 c' c'} d'4 d'4 +g'4 \times 2/3 {c'4 c' c'} d'4 d'4 @end lilypond +@end quotation The property @code{tupletSpannerDuration} specifies how long each bracket should last. With this, you can make lots of tuplets while typing @code{\times} only once, saving lots of typing. In the next example, there are two triplets shown, while @code{\times} was only -used once: +used once -@lilypond[fragment,relative,raggedright,verbatim] +@quotation +@lilypond[fragment,relative=1,raggedright,verbatim] \set tupletSpannerDuration = #(ly:make-moment 1 4) \times 2/3 { c'8 c c c c c } @end lilypond +@end quotation The format of the number is determined by the property @code{tupletNumberFormatFunction}. The default prints only the @@ -557,7 +593,7 @@ Octaves are specified by adding @code{'} and @code{,} to pitch names. When you copy existing music, it is easy to accidentally put a pitch in the wrong octave and hard to find such an error. The relative octave mode prevents these errors: a single error puts the rest of the -piece off by one octave: +piece off by one octave @cindex @code{\relative} @example @@ -576,29 +612,36 @@ or lower the pitch by an extra octave. Upon entering relative mode, an absolute starting pitch must be specified that will act as the predecessor of the first note of @var{musicexpr}. -Here is the relative mode shown in action: +Here is the relative mode shown in action +@quotation @lilypond[fragment,raggedright,verbatim] - \relative c'' { - b c d c b c bes a - } +\relative c'' { + b c d c b c bes a +} @end lilypond +@end quotation -Octave changing marks are used for intervals greater than a fourth: +Octave changing marks are used for intervals greater than a fourth +@quotation @lilypond[fragment,verbatim] - \relative c'' { - c g c f, c' a, e'' } +\relative c'' { + c g c f, c' a, e'' +} @end lilypond +@end quotation If the preceding item is a chord, the first note of the chord is used -to determine the first note of the next chord: +to determine the first note of the next chord +@quotation @lilypond[fragment,verbatim] - \relative c' { - c - - - } -@end lilypond +\relative c' { + c + + +} +@end lilypond +@end quotation @cindex @code{\notes} The pitch after the @code{\relative} contains a note name. To parse @@ -617,7 +660,7 @@ Octave checks make octave errors easier to correct: a note may be followed by @code{=}@var{quotes} which indicates what its absolute octave should be. In the following example, @example - \relative c'' @{ c='' b=' d,='' @} +\relative c'' @{ c='' b=' d,='' @} @end example @noindent @@ -630,7 +673,7 @@ following notes. There is also a syntax that is separate from the notes. @example - \octave @var{pitch} +\octave @var{pitch} @end example This checks that @var{pitch} (without octave) yields @var{pitch} (with @@ -640,11 +683,11 @@ successfully. The second check fails with an error message. The octave is adjusted so the following notes are in the correct octave once again. @example - \relative c' @{ - e - \octave a' - \octave b' - @} +\relative c' @{ + e + \octave a' + \octave b' +@} @end example @@ -653,13 +696,15 @@ respect to the note preceding it. In the next fragment, the last note is a @code{a'}, above middle C. Hence, the @code{\octave} check may be deleted without changing the meaning of the piece. +@quotation @lilypond[verbatim,fragment] - \relative c' { - e - \octave b - a - } +\relative c' { + e + \octave b + a +} @end lilypond +@end quotation @node Bar check @subsection Bar check @@ -673,18 +718,18 @@ Bar checks help detect errors in the durations. A bar check is entered using the bar symbol, `@code{|}'. Whenever it is encountered during interpretation, it should fall on a measure boundary. If it does not, a warning is printed. In the next example, the second bar -check will signal an error: +check will signal an error @example - \time 3/4 c2 e4 | g2 | +\time 3/4 c2 e4 | g2 | @end example Bar checks can also be used in lyrics, for example @example - \lyrics @{ - \time 2/4 - Twin -- kle | Twin -- kle - @} +\lyrics @{ + \time 2/4 + Twin -- kle | Twin -- kle +@} @end example @@ -704,15 +749,17 @@ The property @code{Score.skipTypesetting} can be used to switch on and off typesetting completely during the interpretation phase. When typesetting is switched off, the music is processed much more quickly. This can be used to skip over the parts of a score that have already -been checked for errors: +been checked for errors +@quotation @lilypond[fragment,raggedright,verbatim] \relative c'' { c8 d \set Score.skipTypesetting = ##t - e f g a g c, f e d +e f g a g c, f e d \set Score.skipTypesetting = ##f c d b bes a g c2 } @end lilypond +@end quotation @node Automatic note splitting @subsection Automatic note splitting @@ -723,14 +770,16 @@ by replacing the @internalsref{Note_heads_engraver} by the In the following examples, notes crossing the bar line are split and tied. -@lilypond[noindent,verbatim,relative=1] +@quotation +@lilypond[noindent,verbatim,relative=2] \new Voice \with { - \remove "Note_heads_engraver" - \consists "Completion_heads_engraver" + \remove "Note_heads_engraver" + \consists "Completion_heads_engraver" } { c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 } @end lilypond +@end quotation This engraver splits all running notes at the bar line, and inserts ties. One of its uses is to debug complex scores: if the measures are @@ -809,7 +858,7 @@ the staff. Setting or changing the key signature is done with the @code{\key} -command: +command @example @code{\key} @var{pitch} @var{type} @end example @@ -859,12 +908,14 @@ The clef indicates which lines of the staff correspond to which pitches. -The clef can be set or changed with the @code{\clef} command: +The clef can be set or changed with the @code{\clef} command +@quotation @lilypond[fragment,verbatim] - \key f\major c''2 \clef alto g'2 +\key f\major c''2 \clef alto g'2 @end lilypond +@end quotation -Supported clef-names include: +Supported clef-names include @c Moved standard clefs to the top /MB @table @code @cindex treble clef @@ -912,9 +963,11 @@ example, @cindex choral tenor clef -@lilypond[verbatim,fragment,relative] - \clef "G_8" c4 +@quotation +@lilypond[verbatim,fragment,relative=1] +\clef "G_8" c4 @end lilypond +@end quotation This command is equivalent to setting @code{clefGlyph}, @code{clefPosition} (which controls the Y position of the clef), @@ -932,20 +985,23 @@ Program reference: the object for this symbol is @internalsref{Clef}. ``Ottava'' brackets introduce an extra transposition of an octave for the staff. They are created by invoking the function -@code{set-octavation}: +@code{set-octavation} @cindex ottava @cindex 15ma @cindex octavation +@quotation @lilypond[verbatim,fragment] \relative c''' { a2 b #(set-octavation 1) a b #(set-octavation 0) - a b } + a b +} @end lilypond +@end quotation The @code{set-octavation} function also takes -1 (for 8va bassa) and 2 (for 15ma) as arguments. Internally the function sets the properties @@ -954,8 +1010,8 @@ The @code{set-octavation} function also takes -1 (for 8va bassa) and 2 @code{ottavation} after invoking @code{set-octavation}, i.e., @example - #(set-octavation 1) - \set Staff.ottavation = #"8" +#(set-octavation 1) +\set Staff.ottavation = #"8" @end example @seealso @@ -982,10 +1038,12 @@ staff. The time signature is set or changed by the @code{\time} -command: +command +@quotation @lilypond[fragment,verbatim] - \time 2/4 c'2 \time 3/4 c'2. +\time 2/4 c'2 \time 3/4 c'2. @end lilypond +@end quotation The symbol that is printed can be customized with the @code{style} property. Setting it to @code{#'()} uses fraction style for 4/4 and @@ -1007,21 +1065,26 @@ More options are available through the Scheme function @internalsref{MeasureGrouping} signs. Such signs ease reading rhythmically complex modern music. In the following example, the 9/8 measure is subdivided in 2, 2, 2 and 3. This is passed to -@code{set-time-signature} as the third argument @code{(2 2 2 3)}: +@code{set-time-signature} as the third argument @code{(2 2 2 3)} -@lilypond[verbatim] -\score { \notes \relative c'' { - #(set-time-signature 9 8 '(2 2 2 3)) - g8[ g] d[ d] g[ g] a8[( bes g]) | - #(set-time-signature 5 8 '(3 2)) - a4. g4 - } - \paper { - raggedright = ##t - \context { \StaffContext - \consists "Measure_grouping_engraver" - }}} -@end lilypond +@quotation +@lilypond[raggedright,verbatim] +\score { + \notes \relative c'' { + #(set-time-signature 9 8 '(2 2 2 3)) + g8[ g] d[ d] g[ g] a8[( bes g]) | + #(set-time-signature 5 8 '(3 2)) + a4. g4 + } + \paper { + \context { + \StaffContext + \consists "Measure_grouping_engraver" + } + } +} +@end lilypond +@end quotation @seealso @@ -1043,10 +1106,12 @@ Automatic beaming does not use the measure grouping specified with @cindex @code{\partial} Partial measures, for example in upsteps, are entered using the -@code{\partial} command: -@lilypond[fragment,verbatim,relative=1] -\partial 16*5 c16 cis d dis e | a2. c,4 | b2 +@code{\partial} command +@quotation +@lilypond[fragment,verbatim,relative=2] +\partial 16*5 c16 cis d dis e | a2. c,4 | b2 @end lilypond +@end quotation The syntax for this command is @example @@ -1099,14 +1164,17 @@ happen on bar lines. Special types -of bar lines can be forced with the @code{\bar} command: +of bar lines can be forced with the @code{\bar} command @c -@lilypond[relative=1,fragment,verbatim] - c4 \bar "|:" c4 +@quotation +@lilypond[relative=2,fragment,verbatim] +c4 \bar "|:" c4 @end lilypond +@end quotation -The following bar types are available: -@lilypond[fragment,relative,raggedright,verbatim] +The following bar types are available +@quotation +@lilypond[fragment,relative=1,raggedright,verbatim] c4 \bar "|" c \bar "" c @@ -1119,6 +1187,7 @@ c4 \bar "|." c \bar ":" c @end lilypond +@end quotation For allowing line breaks, there is a special command, @example \bar "empty" @@ -1128,16 +1197,23 @@ point. In scores with many staves, a @code{\bar} command in one staff is automatically applied to all staves. The resulting bar lines are -connected between different staves of a @internalsref{StaffGroup}: +connected between different staves of a @internalsref{StaffGroup} @c +@quotation @lilypond[fragment,verbatim] -<< \context StaffGroup << - \new Staff { e'4 d' - \bar "||" - f' e' } - \new Staff { \clef bass c4 g e g } >> -\new Staff { \clef bass c2 c2 } >> +<< + \context StaffGroup << + \new Staff { + e'4 d' + \bar "||" + f' e' + } + \new Staff { \clef bass c4 g e g } + >> + \new Staff { \clef bass c2 c2 } +>> @end lilypond +@end quotation A bar line is created whenever the @code{whichBar} property is set. At the start of a measure it is set to the contents of @@ -1183,14 +1259,16 @@ Examples: @inputfileref{input/test,bar-lines.ly}, The easiest way to enter fragments with more than one voice on a staff is to split chords using the separator @code{\\}. You can use it for -small, short-lived voices or for single chords: +small, short-lived voices or for single chords +@quotation @lilypond[verbatim,fragment] \context Staff \relative c'' { c4 << { f d e } \\ { b c2 } >> c4 << g' \\ b, \\ f' \\ d >> } @end lilypond +@end quotation The separator causes @internalsref{Voice} contexts@footnote{Polyphonic voices are sometimes called "layers" other notation packages} @@ -1204,15 +1282,18 @@ appropriately. This can also be done by instantiating @internalsref{Voice} contexts by hand, and using @code{\voiceOne}, up to @code{\voiceFour} to assign -a stem directions and horizontal shift for each part: +a stem directions and horizontal shift for each part @c +@quotation @lilypond[raggedright,verbatim] \relative c'' -\context Staff << \new Voice { \voiceOne cis2 b } +\context Staff << + \new Voice { \voiceOne cis2 b } \new Voice { \voiceThree b4 ais ~ ais4 gis4 } \new Voice { \voiceTwo fis4~ fis4 f ~ f } >> @end lilypond +@end quotation @noindent The command @code{\oneVoice} will revert back to the normal setting. @@ -1221,33 +1302,38 @@ The command @code{\oneVoice} will revert back to the normal setting. Normally, note heads with a different number of dots are not merged, but when the object property @code{merge-differently-dotted} is set in -the @internalsref{NoteCollision} object, they are merged: +the @internalsref{NoteCollision} object, they are merged +@quotation @lilypond[verbatim,fragment,raggedright] \relative c'' \context Voice << { - g8 g8 - \override Staff.NoteCollision - #'merge-differently-dotted = ##t - g8 g8 - } \\ { g8.[ f16] g8.[ f16] } - >> + g8 g8 + \override Staff.NoteCollision + #'merge-differently-dotted = ##t + g8 g8 +} \\ { g8.[ f16] g8.[ f16] } >> @end lilypond +@end quotation Similarly, you can merge half note heads with eighth notes, by setting -@code{merge-differently-headed}: -@lilypond[fragment,relative=2,verbatim] +@code{merge-differently-headed} +@quotation +@lilypond[fragment,relative=3,verbatim] \context Voice << { - c8 c4. - \override Staff.NoteCollision - #'merge-differently-headed = ##t - c8 c4. } \\ { c2 c2 } >> + c8 c4. + \override Staff.NoteCollision + #'merge-differently-headed = ##t +c8 c4. } \\ { c2 c2 } >> @end lilypond +@end quotation -LilyPond also vertically shifts rests that are opposite of a stem: +LilyPond also vertically shifts rests that are opposite of a stem +@quotation @lilypond[raggedright,fragment,verbatim] \context Voice << c''4 \\ r4 >> @end lilypond +@end quotation @refcommands @@ -1317,20 +1403,24 @@ notation (see @ref{Clusters}). Beams are used to group short notes into chunks that are aligned with the metrum. They are inserted automatically -@lilypond[fragment,verbatim,relative=2] +@quotation +@lilypond[fragment,verbatim,relative=3] \time 2/4 c8 c c c \time 6/8 c c c c8. c16 c8 @end lilypond +@end quotation When these automatic decisions are not good enough, beaming can be entered explicitly. It is also possible to define beaming patterns that differ from the defaults. Individual notes may be marked with @code{\noBeam}, to prevent them -from being beamed: +from being beamed -@lilypond[fragment,verbatim,relative=2] +@quotation +@lilypond[fragment,verbatim,relative=3] \time 2/4 c8 c\noBeam c c @end lilypond +@end quotation @seealso @@ -1353,13 +1443,15 @@ Program reference: @internalsref{Beam}. In some cases it may be necessary to override the automatic beaming algorithm. For example, the autobeamer will not put beams over rests or bar lines. Such beams are specified by manually: the begin and end -point are marked with @code{[} and @code{]}: +point are marked with @code{[} and @code{]} -@lilypond[fragment,relative,verbatim] - \context Staff { - r4 r8[ g' a r8] r8 g[ | a] r8 - } +@quotation +@lilypond[fragment,relative=1,verbatim] +\context Staff { + r4 r8[ g' a r8] r8 g[ | a] r8 +} @end lilypond +@end quotation @cindex @code{stemLeftBeamCount} @@ -1367,14 +1459,16 @@ Normally, beaming patterns within a beam are determined automatically. If necessary, the properties @code{stemLeftBeamCount} and @code{stemRightBeamCount} can be used to override the defaults. If either property is set, its value will be used only once, and then it -is erased: +is erased -@lilypond[fragment,relative,verbatim] - \context Staff { - f8[ r16 f g a] - f8[ r16 \set stemLeftBeamCount = #1 f g a] - } +@quotation +@lilypond[fragment,relative=1,verbatim] +\context Staff { + f8[ r16 f g a] + f8[ r16 \set stemLeftBeamCount = #1 f g a] +} @end lilypond +@end quotation @cindex @code{stemRightBeamCount} @@ -1383,13 +1477,15 @@ all 16th or shorter beams at beat positions, as defined by the @code{beatLength} property. -@lilypond[relative=1,verbatim,noindent] - c16[ c c c c c c c] - \set subdivideBeams = ##t - c16[ c c c c c c c] - \set Score.beatLength = #(ly:make-moment 1 8) - c16[ c c c c c c c] +@quotation +@lilypond[relative=2,verbatim,noindent] +c16[ c c c c c c c] +\set subdivideBeams = ##t +c16[ c c c c c c c] +\set Score.beatLength = #(ly:make-moment 1 8) +c16[ c c c c c c c] @end lilypond +@end quotation @cindex subdivideBeams Kneed beams are inserted automatically, when a large gap is detected @@ -1454,7 +1550,7 @@ also possible to adjust settings at higher contexts, by adding a @var{context} argument. For example, if automatic beams should end on every quarter note, use -the following: +the following @example #(override-auto-beam-setting '(end * * * *) 1 4 'Staff) @end example @@ -1462,7 +1558,7 @@ Since the duration of a quarter note is 1/4 of a whole note, it is entered as @code{(ly:make-moment 1 4)}. The same syntax can be used to specify beam starting points. In this -example, automatic beams can only end on a dotted quarter note: +example, automatic beams can only end on a dotted quarter note @example #(override-auto-beam-setting '(end * * * *) 3 8) @end example @@ -1518,12 +1614,14 @@ In the example below, the autobeamer makes eight beams and sixteenth end at 3 eights; the third beam can only be corrected by specifying manual beaming. -@lilypond[raggedright,fragment,relative] - #(override-auto-beam-setting '(end * * * *) 3 8) - % rather show case where it goes wrong - %\time 12/8 c'8 c c c16 c c c c c c[ c c c] c8[ c] c4 - \time 12/8 c'8 c c c16 c c c c c c c c c c8 c c4 +@quotation +@lilypond[raggedright,fragment,relative=1] +#(override-auto-beam-setting '(end * * * *) 3 8) +% rather show case where it goes wrong +%\time 12/8 c'8 c c c16 c c c c c c[ c c c] c8[ c] c4 +\time 12/8 c'8 c c c16 c c c c c c c c c c8 c c4 @end lilypond +@end quotation It is not possible to specify beaming parameters that act differently in different parts of a measure. This means that it is not possible to use automatic beaming in irregular meters such as @code{5/8}. @@ -1536,7 +1634,7 @@ This section describes how to change the way that accidentals are inserted automatically before the running notes. Common rules for typesetting accidentals have been canned in a -function. This function is called as follows: +function. This function is called as follows @cindex @code{set-accidental-style} @example @@ -1548,7 +1646,7 @@ the example, @code{modern}), and another symbol that denotes the context name (in this example, @code{Voice}). If no context name is supplied, @code{Staff} is the default. -The following styles are supported: +The following styles are supported @table @code @item default This is the default typesetting behavior. It should correspond @@ -1565,15 +1663,17 @@ individually for each voice. Apart from that, the rule is similar to This leads to some weird and often unwanted results because accidentals from one voice do not get canceled in other - voices: -@lilypond[raggedright,relative,fragment,verbatim] - \context Staff << - #(set-accidental-style 'voice) - << - { es g } \\ - { c, e } - >> >> + voices +@quotation +@lilypond[raggedright,relative=1,fragment,verbatim] +\context Staff << + #(set-accidental-style 'voice) + << + { es g } \\ + { c, e } +>> >> @end lilypond +@end quotation Hence you should only use @code{voice} if the voices are to be read solely by individual musicians. If the staff is to be used by one musician (e.g. a conductor) then you use @@ -1587,23 +1687,27 @@ instead. This rule prints the same accidentals as @code{default}, but temporary accidentals also are canceled in other octaves. Furthermore, in the same octave, they also get canceled in the following - measure: + measure +@quotation @lilypond[raggedright,fragment,verbatim] - #(set-accidental-style 'modern) - cis' c'' cis'2 | c'' c' +#(set-accidental-style 'modern) +cis' c'' cis'2 | c'' c' @end lilypond +@end quotation @item @code{modern-cautionary} @cindex @code{modern-cautionary} This rule is similar to @code{modern}, but the ``extra'' accidentals (the ones not typeset by @code{default}) are typeset as cautionary accidentals. - They are printed in reduced size or with parentheses: + They are printed in reduced size or with parentheses +@quotation @lilypond[raggedright,fragment,verbatim] - #(set-accidental-style 'modern-cautionary) - cis' c'' cis'2 | c'' c' +#(set-accidental-style 'modern-cautionary) +cis' c'' cis'2 | c'' c' @end lilypond +@end quotation @cindex @code{modern-voice} @item modern-voice @@ -1636,22 +1740,26 @@ This rule reflects 20th century practice for piano notation. Very similar t @cindex @code{no-reset} accidental style @c This is the same as @code{default} but with accidentals lasting - ``forever'' and not only until the next measure: -@lilypond[raggedright,fragment,verbatim,relative] + ``forever'' and not only until the next measure +@quotation +@lilypond[raggedright,fragment,verbatim,relative=1] #(set-accidental-style 'no-reset) c1 cis cis c @end lilypond +@end quotation @item forget This is sort of the opposite of @code{no-reset}: Accidentals are not remembered at all---and hence all accidentals are typeset relative to the key signature, regardless of what was - before in the music: + before in the music -@lilypond[raggedright,fragment,verbatim,relative] - #(set-accidental-style 'forget) - \key d\major c4 c cis cis d d dis dis +@quotation +@lilypond[raggedright,fragment,verbatim,relative=1] +#(set-accidental-style 'forget) +\key d\major c4 c cis cis d d dis dis @end lilypond +@end quotation @end table @@ -1706,11 +1814,13 @@ possible. A slur indicates that notes are to be played bound or @emph{legato}. -They are entered using parentheses: -@lilypond[relative=1,fragment,verbatim] - f( g)( a) a8 b( a4 g2 f4) - 2( 2) +They are entered using parentheses +@quotation +@lilypond[relative=2,fragment,verbatim] +f( g)( a) a8 b( a4 g2 f4) +2( 2) @end lilypond +@end quotation @c TODO: should explain that ^( and _( set directions @@ -1721,26 +1831,30 @@ However, in some situations with beams, slurs may be attached to stem ends. If you want to override this layout you can do this through the object property @code{attachment} of @internalsref{Slur}. Its value is a pair of symbols, specifying the attachment type of the left and -right end points: +right end points -@lilypond[fragment,relative,verbatim] - \slurUp - \override Stem #'length = #5.5 - g'8(g g4) - \override Slur #'attachment = #'(stem . stem) - g8( g g4) +@quotation +@lilypond[fragment,relative=1,verbatim] +\slurUp +\override Stem #'length = #5.5 +g'8(g g4) +\override Slur #'attachment = #'(stem . stem) +g8( g g4) @end lilypond +@end quotation If a slur would strike through a stem or beam, the slur will be moved away upward or downward. If this happens, attaching the slur to the -stems might look better: +stems might look better -@lilypond[fragment,relative,verbatim] - \stemUp \slurUp - d32( d'4 d8..) - \override Slur #'attachment = #'(stem . stem) - d,32( d'4 d8..) +@quotation +@lilypond[fragment,relative=1,verbatim] +\stemUp \slurUp +d32( d'4 d8..) +\override Slur #'attachment = #'(stem . stem) +d,32( d'4 d8..) @end lilypond +@end quotation @refcommands @@ -1778,11 +1892,13 @@ results are ugly. A phrasing slur (or phrasing mark) connects chords and is used to indicate a musical sentence. It is started using @code{\(} and @code{\)} -respectively: +respectively -@lilypond[fragment,verbatim,relative] - \time 6/4 c'\( d( e) f( e) d\) +@quotation +@lilypond[fragment,verbatim,relative=1] +\time 6/4 c'\( d( e) f( e) d\) @end lilypond +@end quotation Typographically, the phrasing slur behaves almost exactly like a normal slur. However, they are treated as different objects. A @@ -1815,23 +1931,27 @@ slurs. Putting phrasing slurs over rests leads to spurious warnings. @node Breath marks @subsection Breath marks -Breath marks are entered using @code{\breathe}: +Breath marks are entered using @code{\breathe} -@lilypond[fragment,relative,verbatim] +@quotation +@lilypond[fragment,relative=1,verbatim] c'4 \breathe d4 @end lilypond +@end quotation The glyph of the breath mark can be tuned by overriding the @code{text} property of the @code{BreathingSign} layout object with any markup text. For example, -@lilypond[fragment,verbatim,relative] +@quotation +@lilypond[fragment,verbatim,relative=1] c'4 \override BreathingSign #'text = #(make-musicglyph-markup "scripts-rvarcomma") \breathe d4 @end lilypond +@end quotation @seealso @@ -1848,17 +1968,19 @@ Examples: @inputfileref{input/regression,breathing-sign.ly}. @cindex beats per minute @cindex metronome marking -Metronome settings can be entered as follows: +Metronome settings can be entered as follows @example \tempo @var{duration} = @var{per-minute} @end example In the MIDI output, they are interpreted as a tempo change, and in the -paper output, a metronome marking is printed: +paper output, a metronome marking is printed @cindex @code{\tempo} +@quotation @lilypond[fragment,verbatim] - \tempo 8.=120 c''1 +\tempo 8.=120 c''1 @end lilypond +@end quotation @seealso @@ -1877,14 +1999,18 @@ lines. You can create such texts using text spanners: attach start and ending note of the spanner. The string to be printed, as well as the style, is set through object -properties: +properties -@lilypond[fragment,relative,verbatim] - \relative c' { c1 +@quotation +@lilypond[fragment,relative=1,verbatim] +\relative c' { + c1 \override TextSpanner #'direction = #-1 \override TextSpanner #'edge-text = #'("rall " . "") - c2\startTextSpan b c\stopTextSpan a } + c2\startTextSpan b c\stopTextSpan a +} @end lilypond +@end quotation @seealso @@ -1906,19 +2032,23 @@ Brackets are used in musical analysis to indicate structure in musical pieces. LilyPond supports a simple form of nested horizontal brackets. To use this, add the @internalsref{Horizontal_bracket_engraver} to @internalsref{Staff} context. A bracket is started with -@code{\startGroup} and closed with @code{\stopGroup}: +@code{\startGroup} and closed with @code{\stopGroup} +@quotation @lilypond[raggedright,verbatim] -\score { \notes \relative c'' { - c4\startGroup\startGroup - c4\stopGroup - c4\startGroup - c4\stopGroup\stopGroup +\score { + \notes \relative c'' { + c4\startGroup\startGroup + c4\stopGroup + c4\startGroup + c4\stopGroup\stopGroup } - \paper { \context { - \StaffContext \consists "Horizontal_bracket_engraver" - }}} + \paper { + \context { + \StaffContext \consists "Horizontal_bracket_engraver" +}}} @end lilypond +@end quotation @seealso @@ -1939,9 +2069,11 @@ Examples: @inputfileref{input/regression,note-group-bracket.ly}. A variety of symbols can appear above and below notes to indicate different characteristics of the performance. They are added to a note by adding a dash and the character signifying the -articulation. They are demonstrated here: +articulation. They are demonstrated here +@quotation @lilypondfile[]{script-abbreviations.ly} +@end quotation The meanings of these shorthands can be changed. See @file{ly/script-init.ly} for examples. @@ -1949,19 +2081,23 @@ The meanings of these shorthands can be changed. See The script is automatically placed, but if you need to force directions, you can use @code{_} to force them down, or @code{^} to -put them up: +put them up +@quotation @lilypond[fragment,verbatim] c''4^^ c''4_^ @end lilypond +@end quotation Other symbols can be added using the syntax @var{note}@code{\}@var{name}, e.g. @code{c4\fermata}. Again, they can be forced up or down using @code{^} and @code{_}, e.g. -@lilypond[verbatim,fragment,relative=2] +@quotation +@lilypond[verbatim,fragment,relative=3] c\fermata c^\fermata c_\fermata @end lilypond +@end quotation @@ -1994,8 +2130,9 @@ e.g. @cindex coda @cindex varcoda +@quotation @lilypondfile[]{script-chart.ly} - +@end quotation @refcommands @@ -2025,12 +2162,14 @@ Fingering instructions can be entered using @example @var{note}-@var{digit} @end example -For finger changes, use markup texts: +For finger changes, use markup texts @c +@quotation @lilypond[verbatim,raggedright,fragment] - c'4-1 c'4-2 c'4-3 c'4-4 - c'^\markup { \finger "2-3" } +c'4-1 c'4-2 c'4-3 c'4-4 +c'^\markup { \finger "2-3" } @end lilypond +@end quotation @cindex finger change @cindex scripts @@ -2038,30 +2177,36 @@ For finger changes, use markup texts: @cindex subscript You can use the thumb-script to indicate that a note should be -played with the thumb (e.g. in cello music): +played with the thumb (e.g. in cello music) +@quotation @lilypond[verbatim,raggedright,fragment] - 8_\thumb _\thumb +8_\thumb _\thumb @end lilypond +@end quotation Fingerings for chords can also be added to individual notes -of the chord by adding them after the pitches: -@lilypond[verbatim,raggedright,fragment,relative=1] - < c-1 e-2 g-3 b-5 > 4 +of the chord by adding them after the pitches +@quotation +@lilypond[verbatim,raggedright,fragment,relative=2] +< c-1 e-2 g-3 b-5 >4 @end lilypond +@end quotation @noindent In this case, setting @code{fingeringOrientations} will put fingerings next -to note heads: +to note heads -@lilypond[verbatim,raggedright,fragment,relative=1] - \set fingeringOrientations = #'(left down) - 4 - \set fingeringOrientations = #'(up right down) - 4 - \set fingeringOrientations = #'(right) - 4 +@quotation +@lilypond[verbatim,raggedright,fragment,relative=2] +\set fingeringOrientations = #'(left down) + 4 +\set fingeringOrientations = #'(up right down) + 4 +\set fingeringOrientations = #'(right) +4 @end lilypond +@end quotation The last note demonstrates how fingering instructions can be put close to note heads in monophonic music, using this feature. @@ -2080,14 +2225,18 @@ Examples: @inputfileref{input/regression,finger-chords.ly}. @cindex non-empty texts It is possible to place arbitrary strings of text or markup text (see -@ref{Text markup}) above or below notes by using a string: +@ref{Text markup}) above or below notes by using a string @code{c^"text"}. By default, these indications do not influence the note spacing, but by using the command @code{\fatText}, the widths -will be taken into account: +will be taken into account @c -@lilypond[fragment,raggedright,verbatim] \relative c' { -c4^"longtext" \fatText c4_"longlongtext" c4 } +@quotation +@lilypond[fragment,raggedright,verbatim] +\relative c' { + c4^"longtext" \fatText c4_"longlongtext" c4 +} @end lilypond +@end quotation It is possible to use @TeX{} commands in the strings, but this should be avoided because the exact dimensions of the string can then no @@ -2125,24 +2274,28 @@ by a slurred small note with a slashed stem. The appoggiatura is a grace note that takes a fixed fraction of the main note, is and denoted as a slurred note in small print without a slash. They are entered with the commands @code{\acciaccatura} and -@code{\appoggiatura}, as demonstrated in the following example: +@code{\appoggiatura}, as demonstrated in the following example @cindex appoggiatura @cindex acciaccatura -@lilypond[relative=2,verbatim,fragment] +@quotation +@lilypond[relative=3,verbatim,fragment] b4 \acciaccatura d8 c4 \appoggiatura e8 d4 \acciaccatura { g16[ f] } e4 @end lilypond +@end quotation Both are special forms of the @code{\grace} command. By prefixing this keyword to a music expression, a new one is formed, which will be printed in a smaller font and takes up no logical time in a measure. -@lilypond[relative=2,verbatim,fragment] - c4 \grace c16 c4 - \grace { c16[ d16] } c2 c4 +@quotation +@lilypond[relative=3,verbatim,fragment] +c4 \grace c16 c4 +\grace { c16[ d16] } c2 c4 @end lilypond +@end quotation @noindent Unlike @code{\acciaccatura} and @code{\appoggiatura}, the @@ -2151,48 +2304,56 @@ Unlike @code{\acciaccatura} and @code{\appoggiatura}, the Internally, timing for grace notes is done using a second, `grace' time. Every point in time consists of two rational numbers: one denotes the logical time, one denotes the grace timing. The above -example is shown here with timing tuples: +example is shown here with timing tuples +@quotation @lilypond[raggedright] << \relative c''{ - c4 \grace c16 c4 \grace { - c16[ d16] } c2 c4 + c4 \grace c16 c4 \grace { + c16[ d16] } c2 c4 } \new Lyrics \lyrics { - \markup { (0,0) } 4 - \grace { \markup { - ( \fraction 1 4 , \fraction -1 16 ) } 16 } - \markup { (\fraction 1 4 , 0 ) } 4 - \grace { - \markup { (\fraction 2 4 , \fraction "-1" 8 ) } 16 - \markup { (\fraction 2 4 , \fraction "-1" 16 ) } 16 - } - \markup { ( \fraction 2 4 , 0 ) } - } >> + \markup { (0,0) } 4 + \grace { \markup { + ( \fraction 1 4 , \fraction -1 16 ) } 16 } + \markup { (\fraction 1 4 , 0 ) } 4 + \grace { + \markup { (\fraction 2 4 , \fraction "-1" 8 ) } 16 + \markup { (\fraction 2 4 , \fraction "-1" 16 ) } 16 + } + \markup { ( \fraction 2 4 , 0 ) } + } +>> @end lilypond +@end quotation The placement of grace notes is synchronized between different staves. In the following example, there are two sixteenth graces notes for -every eighth grace note: +every eighth grace note -@lilypond[relative=2,verbatim,fragment] +@quotation +@lilypond[relative=3,verbatim,fragment] << \new Staff { e4 \grace { c16[ d e f] } e4 } - \new Staff { c'4 \grace { g8[ b] } c4 } >> + \new Staff { c'4 \grace { g8[ b] } c4 } >> @end lilypond +@end quotation -If you want to end a note with a grace, then the standard trick -is to put the grace notes after a ``space note'', e.g. -@lilypond[fragment,verbatim,relative=2] +If you want to end a note with a grace, the standard trick is to put +the grace notes after a ``space note'' + +@quotation +@lilypond[fragment,verbatim,relative=3] \context Voice { - << { d1^\trill ( } + << { d1^\trill ( } { s2 \grace { c16[ d] } } >> - c4) + c4) } @end lilypond +@end quotation @noindent By adjusting the duration of the skip note (here it is a half-note), @@ -2203,16 +2364,18 @@ A @code{\grace} section will introduce special typesetting settings, for example, to produce smaller type, and set directions. Hence, when introducing layout tweaks, they should be inside the grace section, for example, -@lilypond[fragment,verbatim,relative=1] +@quotation +@lilypond[fragment,verbatim,relative=2] \new Voice { - \acciaccatura { - \override Stem #'direction = #-1 - f16-> - \revert Stem #'direction - } - g4 + \acciaccatura { + \override Stem #'direction = #-1 + f16-> + \revert Stem #'direction + } + g4 } @end lilypond +@end quotation @noindent The overrides should also be reverted inside the grace section. @@ -2223,10 +2386,10 @@ then this can be accomplished through the function direction for this grace, so stems do not always point up. @example - \new Staff @{ - #(add-grace-property "Voice" Stem direction '()) - @dots{} - @} +\new Staff @{ + #(add-grace-property "Voice" Stem direction '()) + @dots{} +@} @end example @noindent @@ -2251,17 +2414,19 @@ Grace note synchronization can also lead to surprises. Staff notation, such as key signatures, bar lines, etc. are also synchronized. Take care when you mix staves with grace notes and staves without, for example, -@lilypond[relative=2,verbatim,fragment] +@quotation +@lilypond[relative=3,verbatim,fragment] << \new Staff { e4 \bar "|:" \grace c16 d4 } \new Staff { c4 \bar "|:" d4 } >> @end lilypond +@end quotation @noindent This can be remedied by inserting grace skips, for the above example -@verbatim - \new Staff { c4 \bar "|:" \grace s16 d4 } >> -@end verbatim +@example +\new Staff @{ c4 \bar "|:" \grace s16 d4 @} >> +@end example Grace sections should only be used within sequential music expressions. Nesting or juxtaposing grace sections is not supported, @@ -2279,11 +2444,13 @@ wavy line between two notes. A glissando line can be requested by attaching a @code{\glissando} to -a note: +a note -@lilypond[fragment,relative,verbatim] - c'\glissando c' +@quotation +@lilypond[fragment,relative=1,verbatim] +c'\glissando c' @end lilypond +@end quotation @seealso @@ -2322,16 +2489,18 @@ Printing text over the line (such as @emph{gliss.}) is not supported. @cindex @code{\rfz} -Absolute dynamic marks are specified using a command after a note: +Absolute dynamic marks are specified using a command after a note @code{c4\ff}. The available dynamic marks are @code{\ppp}, @code{\pp}, @code{\p}, @code{\mp}, @code{\mf}, @code{\f}, @code{\ff}, @code{\fff}, @code{\fff}, @code{\fp}, @code{\sf}, @code{\sff}, -@code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz}: +@code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz} -@lilypond[verbatim,raggedright,fragment,relative] - c'\ppp c\pp c \p c\mp c\mf c\f c\ff c\fff - c2\sf c\rfz +@quotation +@lilypond[verbatim,raggedright,fragment,relative=1] +c'\ppp c\pp c \p c\mp c\mf c\f c\ff c\fff +c2\sf c\rfz @end lilypond +@end quotation @cindex @code{\<} @cindex @code{\>} @@ -2342,41 +2511,47 @@ Absolute dynamic marks are specified using a command after a note: A crescendo mark is started with @code{\<} and terminated with @code{\!}. A decrescendo is started with @code{\>} and also terminated with @code{\!}. Because these marks are bound to notes, if you must -use spacer notes if multiple marks during one note are needed: +use spacer notes if multiple marks during one note are needed +@quotation @lilypond[fragment,verbatim] - c''\< c''\! d''\> e''\! - << f''1 { s4 s4\< s4\! \> s4\! } >> +c''\< c''\! d''\> e''\! +<< f''1 { s4 s4\< s4\! \> s4\! } >> @end lilypond +@end quotation This may give rise to very short hairpins. Use @code{minimum-length} in @internalsref{Voice}.@internalsref{Hairpin} to lengthen them, for -example: +example @example \override Staff.Hairpin #'minimum-length = #5 @end example You can also use a text saying @emph{cresc.} instead of hairpins. Here -is an example how to do it: +is an example how to do it -@lilypond[fragment,relative=2,verbatim] - \setTextCresc - c \< d e f\! - \setHairpinCresc - e\> d c b\! +@quotation +@lilypond[fragment,relative=3,verbatim] +\setTextCresc +c \< d e f\! +\setHairpinCresc +e\> d c b\! @end lilypond +@end quotation @cindex crescendo @cindex decrescendo -You can also supply your own texts: -@lilypond[fragment,relative,verbatim] - \context Voice { - \set crescendoText = \markup { \italic "cresc. poco" } - \set crescendoSpanner = #'dashed-line - a'2\< a a a\!\mf - } +You can also supply your own texts +@quotation +@lilypond[fragment,relative=1,verbatim] +\context Voice { + \set crescendoText = \markup { \italic "cresc. poco" } + \set crescendoSpanner = #'dashed-line + a'2\< a a a\!\mf +} @end lilypond +@end quotation @cindex diminuendo @@ -2416,7 +2591,7 @@ for repetitions. In LilyPond, most of these notations can be captured in a uniform syntax. One of the advantages is that they can be rendered in MIDI accurately. -The following types of repetition are supported: +The following types of repetition are supported @table @code @item unfold @@ -2471,31 +2646,37 @@ If you have alternative endings, you may add @var{alternative3} @dots{} @code{@}} @end example where each @var{alternative} is a music expression. If you do not -give enough alternatives for all of the repeats, then the first -alternative is assumed to be played more than once. +give enough alternatives for all of the repeats, the first alternative +is assumed to be played more than once. -Normal notation repeats are used like this: -@lilypond[fragment,verbatim,relative=1] - c1 - \repeat volta 2 { c4 d e f } - \repeat volta 2 { f e d c } +Normal notation repeats are used like this +@quotation +@lilypond[fragment,verbatim,relative=2] +c1 +\repeat volta 2 { c4 d e f } +\repeat volta 2 { f e d c } @end lilypond +@end quotation -With alternative endings: -@lilypond[fragment,verbatim,relative=1] - c1 - \repeat volta 2 {c4 d e f} - \alternative { {d2 d} {f f,} } +With alternative endings +@quotation +@lilypond[fragment,verbatim,relative=2] +c1 +\repeat volta 2 {c4 d e f} +\alternative { {d2 d} {f f,} } @end lilypond +@end quotation -@lilypond[fragment,verbatim,relative=1] +@quotation +@lilypond[fragment,verbatim,relative=2] \context Staff { - \partial 4 - \repeat volta 4 { e | c2 d2 | e2 f2 | } - \alternative { { g4 g g } { a | a a a a | b2. } } + \partial 4 + \repeat volta 4 { e | c2 d2 | e2 f2 | } + \alternative { { g4 g g } { a | a a a a | b2. } } } @end lilypond +@end quotation @refbugs @@ -2551,16 +2732,18 @@ a text string or as a markup text, see @ref{Text markup}. Do not forget to change the font, as the default number font does not contain alphabetic characters. Or, @item the list @code{(volta #f)}, which - stops a running volta bracket: + stops a running volta bracket @end table -@lilypond[verbatim,fragment,relative=2] +@quotation +@lilypond[verbatim,fragment,relative=3] c4 \set Score.repeatCommands = #'((volta "93") end-repeat) c4 c4 \set Score.repeatCommands = #'((volta #f)) c4 c4 @end lilypond +@end quotation @seealso @@ -2575,7 +2758,8 @@ Program reference: @internalsref{VoltaBracket}, @internalsref{RepeatedMusic}, @cindex tremolo beams To place tremolo marks between notes, use @code{\repeat} with tremolo -style: +style +@quotation @lilypond[verbatim,raggedright] \score { \context Voice \notes\relative c' { @@ -2585,12 +2769,15 @@ style: } } @end lilypond +@end quotation Tremolo marks can also be put on a single note. In this case, the note should not be surrounded by braces. +@quotation @lilypond[verbatim,raggedright] \repeat "tremolo" 4 c'16 @end lilypond +@end quotation A similar mechanism is the tremolo subdivision, described in @ref{Tremolo subdivisions}. @@ -2612,14 +2799,16 @@ Example files: @inputfileref{input/regression,chord-tremolo.ly}, @cindex @code{tremoloFlags} Tremolo marks can be printed on a single note by adding -`@code{:}[@var{length}]' after the note. The length must be at least 8. -A @var{length} value of 8 gives one line across the note stem. If the -length is omitted, then then the last value (stored in -@code{tremoloFlags}) is used: +`@code{:}[@var{length}]' after the note. The length must be at least +8. A @var{length} value of 8 gives one line across the note stem. If +the length is omitted, the last value (stored in @code{tremoloFlags}) +is used +@quotation @lilypond[verbatim,fragment] c'2:8 c':32 | c': c': | @end lilypond +@end quotation @c [TODO : stok is te kort bij 32en] @@ -2642,13 +2831,15 @@ Elsewhere: @internalsref{StemTremolo}, @internalsref{TremoloEvent}. In the @code{percent} style, a note pattern can be repeated. It is printed once, and then the pattern is replaced with a special sign. Patterns of a one and two measures are replaced by percent-like signs, -patterns that divide the measure length are replaced by slashes: +patterns that divide the measure length are replaced by slashes +@quotation @lilypond[verbatim,raggedright] \context Voice { \repeat "percent" 4 { c'4 } \repeat "percent" 2 { c'2 es'2 f'4 fis'4 g'4 c''4 } } -@end lilypond +@end lilypond +@end quotation @seealso @@ -2674,14 +2865,16 @@ Program reference: @internalsref{RepeatSlash}, @internalsref{PercentRepeat}, Sometimes you might want to show only the rhythm of a melody. This can be done with the rhythmic staff. All pitches of notes on such a -staff are squashed, and the staff itself has a single line: +staff are squashed, and the staff itself has a single line -@lilypond[fragment,relative,verbatim] +@quotation +@lilypond[fragment,relative=1,verbatim] \context RhythmicStaff { \time 4/4 c4 e8 f g2 | r4 g r2 | g1:32 | r1 | } @end lilypond +@end quotation @seealso @@ -2699,15 +2892,17 @@ Examples: @inputfileref{input/regression,rhythmic-staff.ly}. Percussion notes may be entered in @code{\drums} mode, which is similar to @code{notes}. Each piece of percussion has a full name and -an abbreviated name, and both be used in input files: +an abbreviated name, and both be used in input files @example hihat hh bassdrum bd @end example +@quotation @lilypond[raggedright] \new DrumStaff \drums { hihat hh bassdrum bd } @end lilypond +@end quotation The complete list of drum names is in the init file @file{ly/drumpitch-init.ly}. @@ -2728,9 +2923,10 @@ of percussion. To typeset the music, the notes must be interpreted in a -@internalsref{DrumStaff} and @internalsref{DrumVoice} contexts: +@internalsref{DrumStaff} and @internalsref{DrumVoice} contexts @c +@quotation @lilypond[raggedright,verbatim] up = \drums { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat } down = \drums { bassdrum4 snare8 bd r bd sn4 } @@ -2740,11 +2936,13 @@ down = \drums { bassdrum4 snare8 bd r bd sn4 } \new DrumVoice { \voiceTwo \down } >> } @end lilypond +@end quotation The above example shows verbose polyphonic notation. The short polyphonic notation, described in @ref{Polyphony}, can also be used if the @internalsref{DrumVoices} are instantiated by hand first. For example, +@quotation @lilypond[fragment,verbatim] \drums \new DrumStaff << \context DrumVoice = "1" { s1 *2 } @@ -2759,16 +2957,18 @@ the @internalsref{DrumVoices} are instantiated by hand first. For example, } >> @end lilypond +@end quotation There are also other layout possibilities. To use these, set the property @code{drumStyleTable} in context @internalsref{DrumVoice}. -The following variables have been predefined: +The following variables have been predefined @table @code @item drums-style is the default. It typesets a typical drum kit on a five-line staff +@quotation @lilypond[noindent] nam = \lyrics { cymc cyms cymr hh hhc hho hhho hhp cb hc bd sn ss tomh tommh tomml toml tomfh tomfl } @@ -2792,6 +2992,7 @@ mus = \drums { cymc cyms cymr hh | hhc hho hhho hhp | \break cb hc \override BarNumber #'transparent =##T }}} @end lilypond +@end quotation The drum scheme supports six different toms. When there fewer toms, simply select the toms that produce the desired result, i.e. to get toms on @@ -2799,8 +3000,9 @@ the three middle lines you use @code{tommh}, @code{tomml} and @code{tomfh}. @item timbales-style -to typeset timbales on a two line staff: +to typeset timbales on a two line staff +@quotation @lilypond[raggedright] nam = \lyrics { timh ssh timl ssl cb } mus = \drums { timh ssh timl ssl cb s16 } @@ -2823,9 +3025,11 @@ mus = \drums { timh ssh timl ssl cb s16 } >> } @end lilypond +@end quotation @item congas-style -to typeset congas on a two line staff: +to typeset congas on a two line staff +@quotation @lilypond[raggedright] nam = \lyrics { cgh cgho cghm ssh cgl cglo cglm ssl } mus = \drums { cgh cgho cghm ssh cgl cglo cglm ssl s16 } @@ -2848,9 +3052,11 @@ mus = \drums { cgh cgho cghm ssh cgl cglo cglm ssl s16 } >> } @end lilypond +@end quotation @item bongos-style -to typeset bongos on a two line staff: +to typeset bongos on a two line staff +@quotation @lilypond[raggedright] nam = \lyrics { boh boho bohm ssh bol bolo bolm ssl } mus = \drums { boh boho bohm ssh bol bolo bolm ssl s16 } @@ -2873,9 +3079,11 @@ mus = \drums { boh boho bohm ssh bol bolo bolm ssl s16 } >> } @end lilypond +@end quotation @item percussion-style -to typeset all kinds of simple percussion on one line staves: +to typeset all kinds of simple percussion on one line staves +@quotation @lilypond[raggedright] nam = \lyrics { tri trio trim gui guis guil cb cl tamb cab mar hc } mus = \drums { tri trio trim gui guis guil cb cl tamb cab mar hc s16 } @@ -2896,11 +3104,13 @@ mus = \drums { tri trio trim gui guis guil cb cl tamb cab mar hc s16 } >> } @end lilypond +@end quotation @end table If you do not like any of the predefined lists you can define your own -list at the top of your file: +list at the top of your file +@quotation @lilypond[raggedright,verbatim] #(define mydrums '( (bassdrum default #f -1) @@ -2920,6 +3130,7 @@ down = \drums { bd4 sn bd toml8 toml } >> } @end lilypond +@end quotation @seealso @@ -2990,8 +3201,9 @@ The two staves of the piano staff must be named @code{up} and The autochanger switches on basis of pitch (middle C is the turning point), and it looks ahead skipping over rests to switch in -advance. Here is a practical example: +advance. Here is a practical example +@quotation @lilypond[verbatim,raggedright] \score { \notes \context PianoStaff << \context Staff = "up" { @@ -3002,6 +3214,7 @@ advance. Here is a practical example: s1*2 } >> } @end lilypond +@end quotation @noindent In this example, spacer rests are used to prevent the bottom staff from @@ -3029,7 +3242,7 @@ quality output, staff switches should be specified manually. @cindex manual staff switches @cindex staff switch, manual -Voices can be switched between staves manually, using the following command: +Voices can be switched between staves manually, using the following command @example \change Staff = @var{staffname} @var{music} @end example @@ -3053,11 +3266,13 @@ piano has three pedals, sustain, una corda, and sostenuto. Piano pedal instruction can be expressed by attaching @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda}, @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp} to a -note or chord: +note or chord +@quotation @lilypond[fragment,verbatim] c'4\sustainDown c'4\sustainUp @end lilypond +@end quotation What is printed can be modified by setting @code{pedal@var{X}Strings}, where @var{X} is one of the pedal types: @code{Sustain}, @@ -3066,45 +3281,53 @@ where @var{X} is one of the pedal types: @code{Sustain}, information. Pedals can also be indicated by a sequence of brackets, by setting the -@code{pedalSustainStyle} property to @code{bracket} objects: +@code{pedalSustainStyle} property to @code{bracket} objects -@lilypond[fragment,verbatim,relative=2] +@quotation +@lilypond[fragment,verbatim,relative=3] \set Staff.pedalSustainStyle = #'bracket c\sustainDown d e b\sustainUp\sustainDown b g \sustainUp a \sustainDown \bar "|." @end lilypond +@end quotation A third style of pedal notation is a mixture of text and brackets, obtained by setting the @code{pedalSustainStyle} style property to -@code{mixed}: +@code{mixed} -@lilypond[fragment,verbatim,relative=2] +@quotation +@lilypond[fragment,verbatim,relative=3] \set Staff.pedalSustainStyle = #'mixed c\sustainDown d e b\sustainUp\sustainDown b g \sustainUp a \sustainDown \bar "|." @end lilypond +@end quotation The default `*Ped.' style for sustain and damper pedals corresponds to style @code{#'text}. The sostenuto pedal uses @code{mixed} style by default. -@lilypond[fragment,verbatim,relative=2] +@quotation +@lilypond[fragment,verbatim,relative=3] c\sostenutoDown d e c, f g a\sostenutoUp @end lilypond +@end quotation For fine-tuning of the appearance of a pedal bracket, the properties @code{edge-width}, @code{edge-height}, and @code{shorten-pair} of @code{PianoPedalBracket} objects (see @internalsref{PianoPedalBracket} in the Program reference) can be modified. For example, the -bracket may be extended to the end of the note head: +bracket may be extended to the end of the note head +@quotation @lilypond[fragment,verbatim] \override Staff.PianoPedalBracket #'shorten-pair = #'(0 . -1.0) c\sostenutoDown d e c, f g a\sostenutoUp @end lilypond +@end quotation @node Arpeggio @subsection Arpeggio @@ -3114,29 +3337,34 @@ bracket may be extended to the end of the note head: @cindex @code{\arpeggio} You can specify an arpeggio sign on a chord by attaching an -@code{\arpeggio} to a chord: +@code{\arpeggio} to a chord -@lilypond[fragment,relative,verbatim] +@quotation +@lilypond[fragment,relative=1,verbatim] \arpeggio @end lilypond +@end quotation When an arpeggio crosses staves, you attach an arpeggio to the chords in both staves, and set -@internalsref{PianoStaff}.@code{connectArpeggios}: +@internalsref{PianoStaff}.@code{connectArpeggios} -@lilypond[fragment,relative,verbatim] +@quotation +@lilypond[fragment,relative=1,verbatim] \context PianoStaff << \set PianoStaff.connectArpeggios = ##t \new Staff { \arpeggio } \new Staff { \clef bass \arpeggio } >> @end lilypond +@end quotation The direction of the arpeggio is sometimes denoted by adding an -arrowhead to the wiggly line: +arrowhead to the wiggly line -@lilypond[fragment,relative,verbatim] +@quotation +@lilypond[fragment,relative=1,verbatim] \context Voice { \arpeggioUp \arpeggio @@ -3144,14 +3372,17 @@ arrowhead to the wiggly line: \arpeggio } @end lilypond +@end quotation A square bracket on the left indicates that the player should not -arpeggiate the chord: +arpeggiate the chord -@lilypond[fragment,relative,verbatim] +@quotation +@lilypond[fragment,relative=1,verbatim] \arpeggioBracket \arpeggio @end lilypond +@end quotation @refcommands @@ -3189,9 +3420,10 @@ arpeggios in one @internalsref{PianoStaff} at the same time. Whenever a voice switches to another staff a line connecting the notes can be printed automatically. This is enabled if the property -@code{PianoStaff.followVoice} is set to true: +@code{PianoStaff.followVoice} is set to true -@lilypond[fragment,relative,verbatim] +@quotation +@lilypond[fragment,relative=1,verbatim] \context PianoStaff << \set PianoStaff.followVoice = ##t \context Staff \context Voice { @@ -3202,6 +3434,7 @@ can be printed automatically. This is enabled if the property \context Staff=two { \clef bass \skip 1*2 } >> @end lilypond +@end quotation @seealso @@ -3253,7 +3486,7 @@ combination of a backslash followed by one of @code{`}, @code{'}, Subsequent characters of a word can be any character that is not a digit and not white space. One important consequence of this is that a word can end with @code{@}}. The following example is usually a bug. The -syllable includes a @code{@}}, and hence the opening brace is not balanced: +syllable includes a @code{@}}, and hence the opening brace is not balanced @example \lyrics @{ twinkle@} @end example @@ -3261,7 +3494,7 @@ syllable includes a @code{@}}, and hence the opening brace is not balanced: @cindex @code{\property}, in @code{\lyrics} Similarly, a period following a alphabetic sequence, is included in the resulting string. As a consequence, spaces must be inserted around -property commands: +property commands @example \override Score . LyricText #'font-shape = #'italic @end example @@ -3273,7 +3506,7 @@ property commands: Any @code{_} character which appears in an unquoted word is converted to a space. This provides a mechanism for introducing spaces into words without using quotes. Quoted words can also be used in Lyrics mode to -specify words that cannot be written with the above rules: +specify words that cannot be written with the above rules @example \lyrics @{ He said: "\"Let" my peo ple "go\"" @} @@ -3301,7 +3534,7 @@ next one. Such a line is called an extender line, and it is entered as @seealso Program reference: events @internalsref{LyricEvent}, -@internalsref{HyphenEvent}, and @internalsref{ExtenderEvent}. Objects: +@internalsref{HyphenEvent}, and @internalsref{ExtenderEvent}. Objects @internalsref{LyricHyphen}, @internalsref{LyricExtender} and @internalsref{LyricText}. @@ -3316,7 +3549,7 @@ The definition of lyrics mode is too complex. @node The Lyrics context @subsection The Lyrics context -Lyrics are printed by interpreting them in a @internalsref{Lyrics} context: +Lyrics are printed by interpreting them in a @internalsref{Lyrics} context @example \context Lyrics \lyrics @dots{} @end example @@ -3329,7 +3562,7 @@ This will place the lyrics according to the durations that were entered. The lyrics can also be aligned under a given melody automatically. In this case, it is no longer necessary to enter the correct duration for each syllable. This is achieved by combining the -melody and the lyrics with the @code{\lyricsto} expression: +melody and the lyrics with the @code{\lyricsto} expression @example \lyricsto @var{name} \new Lyrics @dots{} @end example @@ -3350,7 +3583,7 @@ hierarchy of staves and lyrics first, e.g. \context Voice = tenor @{ @emph{music} @} >> @end example -and then combine the appropriate melodies and lyric lines: +and then combine the appropriate melodies and lyric lines @example \lyricsto "soprano" \context Lyrics = sopranoLyrics @emph{the lyrics} @@ -3370,11 +3603,12 @@ The final input would resemble The @code{\lyricsto} command detects melismata: it only puts one syllable under a tied or slurred group of notes. If you want to force -an unslurred group of notes to be a melisma, then insert -@code{\melisma} after the first note of the group, and -@code{\melismaEnd} after the last one, e.g. +an unslurred group of notes to be a melisma, insert @code{\melisma} +after the first note of the group, and @code{\melismaEnd} after the +last one, e.g. -@lilypond[relative=1,raggedright,fragment,verbatim] +@quotation +@lilypond[relative=2,raggedright,fragment,verbatim] << \context Voice = "lala" { \time 3/4 f4 g8 \melisma @@ -3385,6 +3619,7 @@ an unslurred group of notes to be a melisma, then insert la di __ daah } >> @end lilypond +@end quotation In addition, notes are considered a melisma if they are manually beamed, and automatic beaming (see @ref{Setting automatic beam @@ -3444,7 +3679,7 @@ achieve this, each line of lyrics should be marked to correspond with the melodic line. This is done automatically when @code{\lyricsto}, but it can also be done manually. -To this end, give the @internalsref{Voice} context an identity: +To this end, give the @internalsref{Voice} context an identity @example \context Voice = duet @{ \time 3/4 @@ -3454,7 +3689,7 @@ To this end, give the @internalsref{Voice} context an identity: Then set the @internalsref{Lyrics} contexts to names starting with that identity followed by a dash. In the preceding example, the @internalsref{Voice} identity is @code{duet}, so the identities of the -@internalsref{Lyrics}s are marked @code{duet-1} and @code{duet-2}: +@internalsref{Lyrics}s are marked @code{duet-1} and @code{duet-2} @example \context Lyrics = "duet-1" @{ Hi, my name is Bert. @} @@ -3462,7 +3697,8 @@ that identity followed by a dash. In the preceding example, the Ooooo, ch\'e -- ri, je t'aime. @} @end example -The complete example is shown here: +The complete example is shown here +@quotation @lilypond[raggedright,verbatim] \score { << \notes \relative c'' \context Voice = duet { \time 3/4 @@ -3477,6 +3713,7 @@ The complete example is shown here: >> >> } @end lilypond +@end quotation @cindex stanza number @cindex singer's names @@ -3484,7 +3721,8 @@ The complete example is shown here: Stanza numbers can be added by setting @code{stanza}, e.g. -@lilypond[verbatim,relative=2] +@quotation +@lilypond[verbatim,relative=3] << \context Voice = duet { \time 3/4 g2 e4 a2 f4 g2. } \lyrics \lyricsto "duet" \new Lyrics { @@ -3493,6 +3731,7 @@ Stanza numbers can be added by setting @code{stanza}, e.g. } >> @end lilypond +@end quotation This example also demonstrates how names of the singers can be added using @code{vocalName} analogous to instrument annotations for staves. @@ -3504,14 +3743,14 @@ To make empty spaces in lyrics, use @code{\skip}. @seealso Program reference: Layout objects @internalsref{LyricText} and -@internalsref{VocalName}. Music expressions: +@internalsref{VocalName}. Music expressions @internalsref{LyricEvent}. @refbugs @cindex ambiguity -Input for lyrics introduces a syntactical ambiguity: +Input for lyrics introduces a syntactical ambiguity @example foo = bar @@ -3552,8 +3791,9 @@ for example, @} @end example -This results in the following output: +This results in the following output +@quotation @lilypond[raggedright] \score { \context ChoirStaff @@ -3573,9 +3813,10 @@ This results in the following output: } } @end lilypond +@end quotation If you have multiple voices in a single staff, and you want a single -ambitus per staff rather than per each voice, then add the +ambitus per staff rather than per each voice, add the @internalsref{Ambitus_engraver} to the @internalsref{Staff} context rather than to the @internalsref{Voice} context. @@ -3617,20 +3858,22 @@ followed by a number, e.g. @code{c4\3} for a C quarter on the third string. By default, string 1 is the highest one, and the tuning defaults to the standard guitar tuning (with 6 strings). The notes are printed as tablature, by using @internalsref{TabStaff} and -@internalsref{TabVoice} contexts: +@internalsref{TabVoice} contexts +@quotation @lilypond[fragment,verbatim] \notes \context TabStaff { a,4\5 c'\2 a\3 e'\1 e\4 c'\2 a\3 e'\1 } @end lilypond +@end quotation @cindex minimumFret When no string is specified, the first string that does not give a fret number less than @code{minimumFret} is selected. The default -value for @code{minimumFret} is 0: +value for @code{minimumFret} is 0 @example @@ -3638,6 +3881,7 @@ e16 fis gis a b4 \set TabStaff.minimumFret = #8 e16 fis gis a b4 @end example +@quotation @lilypond[noindent,raggedright] frag = \notes { \key e \major @@ -3652,6 +3896,7 @@ frag = \notes { >> } @end lilypond +@end quotation @seealso @@ -3678,8 +3923,9 @@ being the pitch (measured in semitones relative to middle C) of an open string. The numbers specified for @code{stringTuning} are the numbers of semitones to subtract or add, starting the specified pitch by default middle C, in string order. Thus, the notes are e, a, d, and -g: +g +@quotation @lilypond[fragment,verbatim] \context TabStaff << \set TabStaff.stringTunings = #'(-5 -10 -15 -20) @@ -3689,6 +3935,7 @@ g: } >> @end lilypond +@end quotation @refbugs @@ -3706,9 +3953,10 @@ Program reference: @internalsref{Tab_note_heads_engraver}. LilyPond has support for both printing chord names. Chords may be entered in musical chord notation, i.e. @code{< .. >}, but they can also be entered by name. Internally, the chords are represented as a -set of pitches, so they can be transposed: +set of pitches, so they can be transposed +@quotation @lilypond[verbatim,raggedright] twoWays = \notes \transpose c c' { \chords { @@ -3723,6 +3971,7 @@ twoWays = \notes \transpose c c' { << \context ChordNames \twoWays \context Voice \twoWays >> } @end lilypond +@end quotation This example also shows that the chord printing routines do not try to be intelligent. The last chord (@code{f bes d}) is not interpreted as @@ -3742,25 +3991,31 @@ an inversion. Chord mode is a mode where you can input sets of pitches using common names. It is introduced by the keyword @code{\chords}. In chords mode, a chord is entered by the root, which is entered -like a common pitch: -@lilypond[fragment,verbatim,relative=1] +like a common pitch +@quotation +@lilypond[fragment,verbatim,relative=2] \chords { es4. d8 c2 } @end lilypond +@end quotation @cindex chord entry @cindex chord mode Other chords may be entered by suffixing a colon, and introducing a -modifier, and optionally, a number: +modifier, and optionally, a number @c +@quotation @lilypond[fragment,verbatim] \chords { e1:m e1:7 e1:m7 } @end lilypond +@end quotation The first number following the root is taken to be the `type' of the chord, thirds are added to the root until it reaches the specified -number: +number +@quotation @lilypond[fragment,verbatim] \chords { c:3 c:5 c:6 c:7 c:8 c:9 c:10 c:11 } @end lilypond +@end quotation @cindex root of chord @cindex additions, in chords @@ -3768,24 +4023,30 @@ number: More complex chords may also be constructed adding separate steps to a chord. Additions are added after the number following -the colon, and are separated by dots: +the colon, and are separated by dots @c +@quotation @lilypond[verbatim,fragment] \chords { c:5.6 c:3.7.8 c:3.6.13 } @end lilypond +@end quotation Chord steps can be altered by suffixing a @code{-} or @code{+} sign -to the number: +to the number +@quotation @lilypond[verbatim,fragment] \chords { c:7+ c:5+.3- c:3-.5-.7- } @end lilypond +@end quotation Removals are specified similarly, and are introduced by a caret. They -must come after the additions: +must come after the additions +@quotation @lilypond[verbatim,fragment] \chords { c^3 c:7^5 c:9^3.5 } @end lilypond +@end quotation Modifiers can be used to change pitches. The following modifiers are -supported: +supported @table @code @item m is the minor chord. This modifier lowers the 3rd and (if present) the 7th step. @@ -3801,10 +4062,12 @@ supported: step. Append either @code{2} or @code{4} to add the 2nd or 4th step to the chord. @end table -Modifiers can be mixed with additions: +Modifiers can be mixed with additions +@quotation @lilypond[verbatim,fragment] \chords { c:sus4 c:7sus4 c:dim7 c:m6 } @end lilypond +@end quotation @cindex modifiers, in chords. @cindex @code{aug} @@ -3815,28 +4078,34 @@ Modifiers can be mixed with additions: Since an unaltered 11 does not sound good when combined with an unaltered 13, the 11 is removed in this case (unless it is added -explicitly): +explicitly) @c +@quotation @lilypond[fragment,verbatim] \chords { c:13 c:13.11 c:m13 } -@end lilypond +@end lilypond +@end quotation @cindex @code{/} An inversion (putting one pitch of the chord on the bottom), as well as bass notes, can be specified by appending -@code{/}@var{pitch} to the chord: +@code{/}@var{pitch} to the chord +@quotation @lilypond[fragment,verbatim] \chords { c1 c/g c/f } -@end lilypond +@end lilypond +@end quotation @cindex @code{/+} A bass note can be added instead of transposed out of the chord, by using @code{/+}@var{pitch}. +@quotation @lilypond[fragment,verbatim] \chords { c1 c/+g c/+f } -@end lilypond +@end lilypond +@end quotation Chords is a mode similar to @code{\lyrics}, @code{\notes} etc. Most of the commands continue to work, for example, @code{r} and @@ -3849,11 +4118,13 @@ commands may be used to change various settings. Each step can only be present in a chord once. The following simply produces the augmented chord, since @code{5+} is interpreted -last: +last @cindex clusters +@quotation @lilypond[verbatim,fragment] \chords { c:5.5-.5+ } @end lilypond +@end quotation @node Printing chord names @@ -3865,8 +4136,9 @@ last: For displaying printed chord names, use the @internalsref{ChordNames} context. The chords may be entered either using the notation -described above, or directly using @code{<} and @code{>}: +described above, or directly using @code{<} and @code{>} +@quotation @lilypond[verbatim,raggedright] scheme = \notes { \chords {a1 b c} @@ -3878,12 +4150,14 @@ scheme = \notes { >> } @end lilypond +@end quotation You can make the chord changes stand out by setting @internalsref{ChordNames}.@code{chordChanges} to true. This will only display chord names when there is a change in the chords scheme and at -the start of a new line: +the start of a new line +@quotation @lilypond[verbatim,linewidth=9\cm] scheme = \chords { c1:m c:m \break c:m c:m d @@ -3897,10 +4171,11 @@ scheme = \chords { >> } @end lilypond +@end quotation The default chord name layout is a system for Jazz music, proposed by Klaus Ignatzek (see @ref{Literature list}). It can be tuned through the -following properties: +following properties @table @code @cindex chordNameExceptions @@ -3923,13 +4198,16 @@ it is major. Predefined options are @code{whiteTriangleMarkup} and Different parts of a chord name are normally separated by a slash. By setting @code{chordNameSeparator}, you can specify other separators, e.g. +@quotation @lilypond[fragment,verbatim] \context ChordNames \chords { - c:7sus4 - \set chordNameSeparator - = \markup { \typewriter "|" } - c:7sus4 } + c:7sus4 + \set chordNameSeparator + = \markup { \typewriter "|" } + c:7sus4 +} @end lilypond +@end quotation @cindex chordRootNamer @item chordRootNamer @@ -4022,7 +4300,7 @@ some common problems in orchestral music. @subsection Multiple staff contexts Polyphonic scores consist of many staves. These staves can be -constructed in three different ways: +constructed in three different ways @itemize @bullet @item The group is started with a brace at the left, and bar lines are connected. This is done with the @internalsref{GrandStaff} context. @@ -4051,7 +4329,8 @@ connected. This is the default for the score. @cindex mark @cindex @code{\mark} -To print a rehearsal mark, use the @code{\mark} command: +To print a rehearsal mark, use the @code{\mark} command +@quotation @lilypond[fragment,verbatim] \relative c'' { c1 \mark \default @@ -4061,6 +4340,7 @@ To print a rehearsal mark, use the @code{\mark} command: c1 \mark \default } @end lilypond +@end quotation @noindent (The letter I is skipped in accordance with engraving traditions.) @@ -4076,7 +4356,8 @@ as argument. It should return a markup object. In the following example, @code{markFormatter} is set to a canned procedure. After a few measures, it is set to function that produces a boxed number. -@lilypond[verbatim,fragment,relative=1] +@quotation +@lilypond[verbatim,fragment,relative=2] \set Score.markFormatter = #format-mark-numbers c1 \mark \default c1 \mark \default @@ -4086,6 +4367,7 @@ few measures, it is set to function that produces a boxed number. c1 \mark \default c1 \mark \default @end lilypond +@end quotation The file @file{scm/translation-functions.scm} contains the definitions of @code{format-mark-numbers} (the default format) and @@ -4100,16 +4382,18 @@ formatting functions. The @code{\mark} command can also be used to put signs like coda, segno and fermatas on a bar line. Use @code{\markup} to -to access the appropriate symbol: +to access the appropriate symbol -@lilypond[fragment,verbatim,relative=1] +@quotation +@lilypond[fragment,verbatim,relative=2] c1 \mark \markup { \musicglyph #"scripts-ufermata" } c1 @end lilypond +@end quotation In the case of a line break, marks must also be printed at the end of the line, and not at the beginning. Use the following to force that -behavior: +behavior @example \override Score.RehearsalMark #'break-visibility = #begin-of-line-invisible @@ -4149,10 +4433,11 @@ which is normally updated automatically for every measure. Bar numbers can be typeset at regular intervals instead of at the beginning of each line. This is illustrated in the following example, whose source is available as -@inputfileref{input/test,bar-number-regular-interval.ly}: +@inputfileref{input/test,bar-number-regular-interval.ly} +@quotation @lilypondfile[]{bar-number-regular-interval.ly} - +@end quotation @seealso @@ -4180,12 +4465,12 @@ the start of the staff. For the first start, @code{instrument} is used, for the next ones @code{instr} is used. @quotation -@lilypond[verbatim,raggedright,relative=2] - \set Staff.instrument = "Ploink " - \set Staff.instr = "Plk " - c1 - \break - c'' +@lilypond[verbatim,raggedright,relative=3] +\set Staff.instrument = "Ploink " +\set Staff.instr = "Plk " +c1 +\break +c'' @end lilypond @end quotation @@ -4194,16 +4479,16 @@ names, for example @quotation @lilypond[fragment,verbatim,raggedright] - \notes { - \set Staff.instrument = \markup { - \column < "Clarinetti" - { "in B" - \smaller \flat - } - > - } - { c''1 } - } +\notes { + \set Staff.instrument = \markup { + \column < "Clarinetti" + { "in B" + \smaller \flat + } + > + } + { c''1 } +} @end lilypond @end quotation @@ -4253,8 +4538,9 @@ Since @var{from} and @var{to} are pitches, so @code{\transpose} must be inside a @code{\notes} section. @code{\transpose} distinguishes between enharmonic pitches: both @code{\transpose c cis} or @code{\transpose c des} will transpose up half a tone. The first -version will print sharps and the second version will print flats: +version will print sharps and the second version will print flats +@quotation @lilypond[raggedright,verbatim] mus =\notes { \key d \major cis d fis g } \score { \notes \context Staff { @@ -4264,6 +4550,7 @@ mus =\notes { \key d \major cis d fis g } \transpose c f' \mus }} @end lilypond +@end quotation @seealso @@ -4273,7 +4560,7 @@ Program reference: @internalsref{TransposedMusic}, and @refbugs -If you want to use both @code{\transpose} and @code{\relative}, then +If you want to use both @code{\transpose} and @code{\relative}, you must put @code{\transpose} outside of @code{\relative}, since @code{\relative} will have no effect music that appears inside a @code{\transpose}. @@ -4286,7 +4573,7 @@ applies to many wind instruments, for example, clarinets (B-flat, A and E-flat), horn (F) and trumpet (B-flat, C, D and E-flat). -The transposition is entered after the keyword @code{\transposition}: +The transposition is entered after the keyword @code{\transposition} @example \transposition bes %% B-flat clarinet @@ -4312,17 +4599,20 @@ meant for full bar rests and for entering parts: the rest can expand to fill a score with rests, or it can be printed as a single multimeasure rest. This expansion is controlled by the property @code{Score.skipBars}. If this is set to true, empty measures will not -be expanded, and the appropriate number is added automatically: +be expanded, and the appropriate number is added automatically +@quotation @lilypond[fragment,verbatim] \time 4/4 r1 | R1 | R1*2 \set Score.skipBars = ##t R1*17 R1*4 @end lilypond +@end quotation The @code{1} in @code{R1} is similar to the duration notation used for notes. Hence, for time signatures other than 4/4, you must enter other -durations. This can be done with augmentation dots or fractions: +durations. This can be done with augmentation dots or fractions +@quotation @lilypond[fragment,verbatim] \set Score.skipBars = ##t \time 3/4 @@ -4331,6 +4621,7 @@ durations. This can be done with augmentation dots or fractions: R1*13/8 R1*13/8*12 @end lilypond +@end quotation An @code{R} spanning a single measure is printed as either a whole rest or a breve, centered in the measure regardless of the time signature. @@ -4343,14 +4634,16 @@ Texts can be added to multi-measure rests by using the @var{note}-@code{markup} syntax (see @ref{Text markup}). In this case, the number is replaced. If you need both texts and the number, you must add the number by hand. A variable (@code{\fermataMarkup}) is provided for -adding fermatas: +adding fermatas +@quotation @lilypond[verbatim,fragment] \time 3/4 R2._\markup { "Ad lib" } R2.^\fermataMarkup @end lilypond +@end quotation If you want to have a text on the left end of a multi-measure rest, attach the text to a zero-length skip note, i.e. @@ -4386,12 +4679,12 @@ multimeasure rest. Multi measure rests do not take part in rest collisions. Be careful when entering multimeasure rests followed by whole -notes. The following will enter two notes lasting four measures each: +notes. The following will enter two notes lasting four measures each @example R1*4 cis cis @end example -When @code{skipBars} is set, then the result will look OK, but the -bar numbering will be off. +When @code{skipBars} is set, the result will look OK, but the bar +numbering will be off. @node Automatic part combining @subsection Automatic part combining @@ -4417,9 +4710,10 @@ The music expressions will be interpreted as @internalsref{Voice} contexts. The following example demonstrates the basic functionality of the part combiner: putting parts on one staff, and setting stem directions and -polyphony: +polyphony -@lilypond[verbatim,raggedright,fragment,relative=1] +@quotation +@lilypond[verbatim,raggedright,fragment,relative=2] \new Staff \partcombine { g g a( b) c c r r @@ -4428,6 +4722,7 @@ polyphony: g g r4 r e e g g } @end lilypond +@end quotation The first @code{g} appears only once, although it was specified twice (once in each part). Stem, slur and tie directions are @@ -4437,9 +4732,10 @@ first part (with context called @code{one}) always gets up stems, and `Solo II'. If you just want the merging parts, and not the textual markings, you -may set the property @var{soloADue} to false: +may set the property @var{soloADue} to false -@lilypond[verbatim,raggedright,fragment,relative=1] +@quotation +@lilypond[verbatim,raggedright,fragment,relative=2] \new Staff << \set Staff.soloADue = ##f \partcombine @@ -4450,6 +4746,7 @@ may set the property @var{soloADue} to false: g r4 r f } >> @end lilypond +@end quotation @seealso @@ -4469,8 +4766,8 @@ measure. Internally, the @code{\partcombine} interprets both arguments as @code{Voice}s named @code{one} and @code{two}, and then decides when the parts can be combined. Consequently, if the arguments switch to -differently named @internalsref{Voice} contexts, then the events in -those will be ignored. +differently named @internalsref{Voice} contexts, the events in those +will be ignored. @node Hiding staves @subsection Hiding staves @@ -4489,9 +4786,10 @@ For normal staves, a specialized @internalsref{Staff} context is available, which does the same: staves containing nothing (or only multi measure rests) are removed. The context definition is stored in @code{\RemoveEmptyStaffContext} variable. Observe how the second staff -in this example disappears in the second line: +in this example disappears in the second line +@quotation @lilypond[verbatim] \score { \notes \relative c' << @@ -4504,6 +4802,7 @@ in this example disappears in the second line: } } @end lilypond +@end quotation The first page shows all staves in full. If empty staves should be removed from the first page too, set @code{remove-first} to false in @@ -4522,7 +4821,7 @@ tagged expressions can be filtered out later. With this mechanism it is possible to make different versions of the same music source. In the following example, we see two versions of a piece of music, one -for the full score, and one with cue notes for the instrumental part: +for the full score, and one with cue notes for the instrumental part @example c1 @@ -4561,7 +4860,9 @@ filtered. For example, @end example would yield +@quotation @lilypondfile[]{tag-filter.ly} +@end quotation The argument of the @code{\tag} command should be a symbol, or a list of symbols, for example, @@ -4590,7 +4891,7 @@ quotation may then be done with @code{\quote} @noindent Here, @var{name} is an identifying string. The @var{music} is any kind -of music. This is an example of @code{\addquote}: +of music. This is an example of @code{\addquote} @verbatim \addquote clarinet \notes\relative c' { @@ -4611,6 +4912,7 @@ added clarinet voice. Quotations take into account the transposition both source and target instruments, if they are specified using the @code{\transposition} command. +@quotation @lilypond[verbatim,fragment] \addquote clarinet \notes\relative c' { \transposition bes @@ -4621,6 +4923,7 @@ instruments, if they are specified using the @code{\transposition} command. e'8 f'8 \quote clarinet 2 } } @end lilypond +@end quotation @refbugs @@ -4683,7 +4986,7 @@ ancient notation, see @ref{Custodes}, @ref{Divisiones}, If this all is way too much of documentation for you, and you just want to dive into typesetting without worrying too much about the -details on how to customize a context, then you may have a look at the +details on how to customize a context, you may have a look at the predefined contexts (see @ref{Vaticana style contexts}). Use them to set up predefined style-specific voice and staff contexts, and directly go ahead with the note entry. @@ -4720,12 +5023,14 @@ music, e.g. for the incipit. The @code{mensural} style finally produces note heads that mimic the look of note heads in historic printings of the 16th century. -The following example demonstrates the @code{neo_mensural} style: +The following example demonstrates the @code{neo_mensural} style +@quotation @lilypond[fragment,raggedright,verbatim] \override NoteHead #'style = #'neo_mensural a'\longa a'\breve a'1 a'2 a'4 a'8 a'16 @end lilypond +@end quotation When typesetting a piece in Gregorian Chant notation, a Gregorian ligature engraver will automatically select the proper note heads, @@ -4737,7 +5042,7 @@ used to automatically assemble mensural ligatures. See @seealso -In this manual: +In this manual @ref{Percussion staves} use note head styles of their own that are frequently used in contemporary music notation. @@ -4755,6 +5060,7 @@ Use the @code{style} property of grob @internalsref{Accidental} to select ancient accidentals. Supported styles are @code{mensural}, @code{vaticana}, @code{hufnagel} and @code{medicaea}. +@quotation @lilypond[raggedright,staffsize=26] \score { \notes { @@ -4799,6 +5105,7 @@ select ancient accidentals. Supported styles are } } @end lilypond +@end quotation As shown, not all accidentals are supported by each style. When trying to access an unsupported accidental, LilyPond will switch to a @@ -4835,12 +5142,14 @@ well for e.g. the incipit of a transcribed mensural piece of music. The @code{mensural} style finally mimics the appearance of rests as in historic prints of the 16th century. -The following example demonstrates the @code{neo_mensural} style: +The following example demonstrates the @code{neo_mensural} style +@quotation @lilypond[fragment,raggedright,verbatim] \override Rest #'style = #'neo_mensural r\longa r\breve r1 r2 r4 r8 r16 @end lilypond +@end quotation There are no 32th and 64th rests specifically for the mensural or neo-mensural style. Instead, the rests from the default style will be @@ -4885,10 +5194,12 @@ with respect to that clef. modern style mensural C clef @tab @code{neo_mensural_c1}, @code{neo_mensural_c2}, @code{neo_mensural_c3}, @code{neo_mensural_c4} @tab -@lilypond[relative,notime] +@quotation +@lilypond[relative=1,notime] \override Staff.TimeSignature #'transparent = ##t \clef "neo_mensural_c2" c @end lilypond +@end quotation @item @code{clefs-petrucci_c1} @@ -4909,125 +5220,151 @@ petrucci style mensural C clefs, for use on different staff lines @code{petrucci_c5} @tab -@lilypond[relative,notime] +@quotation +@lilypond[relative=1,notime] \override Staff.TimeSignature #'transparent = ##t \clef "petrucci_c2" c @end lilypond +@end quotation @item @code{clefs-petrucci_f} @tab petrucci style mensural F clef @tab @code{petrucci_f} @tab -@lilypond[relative,notime] +@quotation +@lilypond[relative=1,notime] \override Staff.TimeSignature #'transparent = ##t \clef "petrucci_f" c @end lilypond +@end quotation @item @code{clefs-petrucci_g} @tab petrucci style mensural G clef @tab @code{petrucci_g} @tab -@lilypond[relative,notime] +@quotation +@lilypond[relative=1,notime] \override Staff.TimeSignature #'transparent = ##t \clef "petrucci_g" c @end lilypond +@end quotation @item @code{clefs-mensural_c} @tab historic style mensural C clef @tab @code{mensural_c1}, @code{mensural_c2}, @code{mensural_c3}, @code{mensural_c4} @tab -@lilypond[relative,notime] +@quotation +@lilypond[relative=1,notime] \override Staff.TimeSignature #'transparent = ##t \clef "mensural_c2" c @end lilypond +@end quotation @item @code{clefs-mensural_f} @tab historic style mensural F clef @tab @code{mensural_f} @tab -@lilypond[relative,notime] +@quotation +@lilypond[relative=1,notime] \override Staff.TimeSignature #'transparent = ##t \clef "mensural_f" c @end lilypond +@end quotation @item @code{clefs-mensural_g} @tab historic style mensural G clef @tab @code{mensural_g} @tab -@lilypond[relative,notime] +@quotation +@lilypond[relative=1,notime] \override Staff.TimeSignature #'transparent = ##t \clef "mensural_g" c @end lilypond +@end quotation @item @code{clefs-vaticana_do} @tab Editio Vaticana style do clef @tab @code{vaticana_do1}, @code{vaticana_do2}, @code{vaticana_do3} @tab -@lilypond[relative,notime] +@quotation +@lilypond[relative=1,notime] \override Staff.StaffSymbol #'line-count = #4 \override Staff.TimeSignature #'transparent = ##t \clef "vaticana_do2" c @end lilypond +@end quotation @item @code{clefs-vaticana_fa} @tab Editio Vaticana style fa clef @tab @code{vaticana_fa1}, @code{vaticana_fa2} @tab -@lilypond[relative,notime] +@quotation +@lilypond[relative=1,notime] \override Staff.StaffSymbol #'line-count = #4 \override Staff.TimeSignature #'transparent = ##t \clef "vaticana_fa2" c @end lilypond +@end quotation @item @code{clefs-medicaea_do} @tab Editio Medicaea style do clef @tab @code{medicaea_do1}, @code{medicaea_do2}, @code{medicaea_do3} @tab -@lilypond[relative,notime] +@quotation +@lilypond[relative=1,notime] \override Staff.StaffSymbol #'line-count = #4 \override Staff.TimeSignature #'transparent = ##t \clef "medicaea_do2" c @end lilypond +@end quotation @item @code{clefs-medicaea_fa} @tab Editio Medicaea style fa clef @tab @code{medicaea_fa1}, @code{medicaea_fa2} @tab -@lilypond[relative,notime] +@quotation +@lilypond[relative=1,notime] \override Staff.StaffSymbol #'line-count = #4 \override Staff.TimeSignature #'transparent = ##t \clef "medicaea_fa2" c @end lilypond +@end quotation @item @code{clefs-hufnagel_do} @tab historic style hufnagel do clef @tab @code{hufnagel_do1}, @code{hufnagel_do2}, @code{hufnagel_do3} @tab -@lilypond[relative,notime] +@quotation +@lilypond[relative=1,notime] \override Staff.StaffSymbol #'line-count = #4 \override Staff.TimeSignature #'transparent = ##t \clef "hufnagel_do2" c @end lilypond +@end quotation @item @code{clefs-hufnagel_fa} @tab historic style hufnagel fa clef @tab @code{hufnagel_fa1}, @code{hufnagel_fa2} @tab -@lilypond[relative,notime] +@quotation +@lilypond[relative=1,notime] \override Staff.StaffSymbol #'line-count = #4 \override Staff.TimeSignature #'transparent = ##t \clef "hufnagel_fa2" c @end lilypond +@end quotation @item @code{clefs-hufnagel_do_fa} @tab historic style hufnagel combined do/fa clef @tab @code{hufnagel_do_fa} @tab -@lilypond[relative,notime] +@quotation +@lilypond[relative=1,notime] \override Staff.TimeSignature #'transparent = ##t \clef "hufnagel_do_fa" c @end lilypond +@end quotation @end multitable @@ -5066,8 +5403,9 @@ mensural g clef is implemented. Use the @code{flag-style} property of grob @internalsref{Stem} to select ancient flags. Besides the @code{default} flag style, - only @code{mensural} style is supported: + only @code{mensural} style is supported +@quotation @lilypond[fragment,raggedright,verbatim] \override Stem #'flag-style = #'mensural \override Stem #'thickness = #1.0 @@ -5076,14 +5414,16 @@ select ancient flags. Besides the @code{default} flag style, c'8 d'8 e'8 f'8 c'16 d'16 e'16 f'16 c'32 d'32 e'32 f'32 s8 c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32 @end lilypond +@end quotation Note that the innermost flare of each mensural flag always is vertically aligned with a staff line. If you do not like this behavior, you can set the @code{adjust-if-on-staffline} property of grob @internalsref{Stem} to @code{##f}. Then, the vertical position of the end of each flare is different between notes on staff lines and -notes between staff lines: +notes between staff lines +@quotation @lilypond[fragment,raggedright] \override Stem #'flag-style = #'mensural \override Stem #'thickness = #1.0 @@ -5093,6 +5433,7 @@ notes between staff lines: c'8 d'8 e'8 f'8 c'16 d'16 e'16 f'16 c'32 d'32 e'32 f'32 s8 c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32 @end lilypond +@end quotation There is no particular flag style for neo-mensural notation. Hence, when typesetting e.g. the incipit of a transcribed piece of mensural @@ -5110,8 +5451,9 @@ There is limited support for mensural time signatures. The glyphs are hard-wired to particular time fractions. In other words, to get a particular mensural signature glyph with the @code{\time n/m} command, @code{n} and @code{m} have to be chosen according to the -following table: +following table +@quotation @lilypond \score { \notes { @@ -5160,6 +5502,7 @@ following table: } } @end lilypond +@end quotation Use the @code{style} property of grob @internalsref{TimeSignature} to select ancient time signatures. Supported styles are @@ -5219,7 +5562,7 @@ used in different flavors of notational style. For typesetting custodes, just put a @internalsref{Custos_engraver} into the @internalsref{Staff} context when declaring the @code{\paper} block, -as shown in the following example: +as shown in the following example @example \paper @{ @@ -5231,8 +5574,9 @@ as shown in the following example: @} @end example -The result looks like this: +The result looks like this +@quotation @lilypond[raggedright] \score { \notes { @@ -5249,11 +5593,13 @@ The result looks like this: } } @end lilypond +@end quotation The custos glyph is selected by the @code{style} property. The styles supported are @code{vaticana}, @code{medicaea}, @code{hufnagel} and -@code{mensural}. They are demonstrated in the following fragment: +@code{mensural}. They are demonstrated in the following fragment +@quotation @lilypond \score { \new Lyrics \lyrics { @@ -5283,6 +5629,7 @@ supported are @code{vaticana}, @code{medicaea}, @code{hufnagel} and } } @end lilypond +@end quotation @seealso @@ -5314,9 +5661,11 @@ contains definitions that you can apply by just inserting and @code{\finalis} at proper places in the input. Some editions use @emph{virgula} or @emph{caesura} instead of divisio minima. Therefore, @code{gregorian-init.ly} also defines @code{\virgula} and -@code{\caesura}: +@code{\caesura} +@quotation @lilypondfile[]{divisiones.ly} +@end quotation @refcommands @@ -5358,8 +5707,9 @@ Ligatures are entered by enclosing them in @code{\[} and @code{\]}. Some ligature styles may need additional input syntax specific for this particular type of ligature. By default, the @internalsref{LigatureBracket} engraver just puts a square bracket -above the ligature: +above the ligature +@quotation @lilypond[raggedright,verbatim] \score { \notes \transpose c c' { @@ -5369,6 +5719,7 @@ above the ligature: } } @end lilypond +@end quotation To select a specific style of ligatures, a proper ligature engraver has to be added to the @internalsref{Voice} context, as explained in @@ -5391,7 +5742,7 @@ There is limited support for white mensural ligatures. To engrave white mensural ligatures, in the paper block the @internalsref{Mensural_ligature_engraver} has to be put into the @internalsref{Voice} context, and remove the -@internalsref{Ligature_bracket_engraver}: +@internalsref{Ligature_bracket_engraver} @example \paper @{ @@ -5423,6 +5774,7 @@ For example, s4 \[ e1 f1 a\breve g\longa \] @end example +@quotation @lilypond[raggedright] \score { \notes \transpose c c' { @@ -5444,11 +5796,13 @@ For example, } } @end lilypond +@end quotation Without replacing @internalsref{Ligature_bracket_engraver} with @internalsref{Mensural_ligature_engraver}, the same music transcribes -to the following: +to the following +@quotation @lilypond[raggedright] \score { \notes \transpose c c' { @@ -5463,6 +5817,7 @@ to the following: } } @end lilypond +@end quotation @refbugs @@ -5510,6 +5865,7 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published @item @code{1. Punctum} @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.5\cm] \include "gregorian-init.ly" \score { @@ -5547,7 +5903,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=2.5\cm] \include "gregorian-init.ly" \score { @@ -5589,7 +5947,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -5623,10 +5983,12 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @item @code{2. Virga} @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -5660,12 +6022,14 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab @tab @item @code{3. Apostropha vel Stropha} @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -5699,7 +6063,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -5733,11 +6099,13 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab @item @code{4. Oriscus} @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -5771,12 +6139,14 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab @tab @item @code{5. Clivis vel Flexa} @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -5810,7 +6180,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=2.0\cm] \include "gregorian-init.ly" \score { @@ -5848,7 +6220,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -5882,10 +6256,12 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @item @code{6. Podatus vel Pes} @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -5919,7 +6295,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=2.0\cm] \include "gregorian-init.ly" \score { @@ -5957,7 +6335,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -5991,10 +6371,12 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @item @code{7. Pes Quassus} @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6028,7 +6410,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6062,11 +6446,13 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab @item @code{8. Quilisma Pes} @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6100,7 +6486,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6134,11 +6522,13 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab @item @code{9. Podatus Initio Debilis} @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6172,7 +6562,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6206,11 +6598,13 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab @item @code{10. Torculus} @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6244,7 +6638,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6278,7 +6674,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6312,10 +6710,12 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @item @code{11. Torculus Initio Debilis} @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6349,7 +6749,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6383,7 +6785,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6417,10 +6821,12 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @item @code{12. Porrectus} @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6454,7 +6860,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6488,7 +6896,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6522,10 +6932,12 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @item @code{13. Climacus} @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6559,7 +6971,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6593,7 +7007,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6627,10 +7043,12 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @item @code{14. Scandicus} @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6664,7 +7082,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6698,7 +7118,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6732,10 +7154,12 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @item @code{15. Salicus} @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6769,7 +7193,9 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { @@ -6803,44 +7229,47 @@ volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published } } @end lilypond +@end quotation @tab @item @code{16. Trigonus} @tab +@quotation @lilypond[noindent,staffsize=26,nofragment,linewidth=1.0\cm] \include "gregorian-init.ly" \score { - \notes \transpose c c' { - % Trigonus - \[ \stropha b \stropha b \stropha a \] - s^\markup {"P"} + \notes \transpose c c' { + % Trigonus + \[ \stropha b \stropha b \stropha a \] + s^\markup {"P"} + } + \paper { + interscoreline = 1 + \context { + \ScoreContext + \remove "Bar_number_engraver" } - \paper { - interscoreline = 1 - \context { - \ScoreContext - \remove "Bar_number_engraver" - } - \context { - \StaffContext - \remove "Clef_engraver" - \remove "Key_engraver" - \override StaffSymbol #'transparent = ##t - \remove "Time_signature_engraver" - \remove "Bar_engraver" - minimumVerticalExtent = ##f - } - \context { - \VoiceContext - \remove Ligature_bracket_engraver - \consists Vaticana_ligature_engraver - \override NoteHead #'style = #'vaticana_punctum - \override Stem #'transparent = ##t - } + \context { + \StaffContext + \remove "Clef_engraver" + \remove "Key_engraver" + \override StaffSymbol #'transparent = ##t + \remove "Time_signature_engraver" + \remove "Bar_engraver" + minimumVerticalExtent = ##f + } + \context { + \VoiceContext + \remove Ligature_bracket_engraver + \consists Vaticana_ligature_engraver + \override NoteHead #'style = #'vaticana_punctum + \override Stem #'transparent = ##t } + } } @end lilypond +@end quotation @tab @tab @@ -7088,7 +7517,7 @@ Trigonus @tab @refcommands -The following head prefixes are supported: +The following head prefixes are supported @cindex @code{\virga} @code{\virga}, @@ -7132,30 +7561,32 @@ The predefined @code{VaticanaVoiceContext} and Gregorian Chant in the style of the Editio Vaticana. These contexts initialize all relevant context properties and grob properties to proper values. With these contexts, you can immediately go ahead -entering the chant, as the following short excerpt demonstrates: +entering the chant, as the following short excerpt demonstrates +@quotation @lilypond[raggedright,verbatim,noindent] \include "gregorian-init.ly" \score { -<< - \context VaticanaVoice = "cantus" { - \override Score.BarNumber #'transparent = ##t - \notes { - \[ c'\melisma c' \flexa a \] - \[ a \flexa \deminutum g\melismaEnd \] - f \divisioMinima - \[ f\melisma \pes a c' c' \pes d'\melismaEnd \] - c' \divisioMinima \break - \[ c'\melisma c' \flexa a \] - \[ a \flexa \deminutum g\melismaEnd \] f \divisioMinima + << + \context VaticanaVoice = "cantus" { + \override Score.BarNumber #'transparent = ##t + \notes { + \[ c'\melisma c' \flexa a \] + \[ a \flexa \deminutum g\melismaEnd \] + f \divisioMinima + \[ f\melisma \pes a c' c' \pes d'\melismaEnd \] + c' \divisioMinima \break + \[ c'\melisma c' \flexa a \] + \[ a \flexa \deminutum g\melismaEnd \] f \divisioMinima + } } - } - \lyricsto "cantus" \new Lyrics \lyrics { - San- ctus, San- ctus, San- ctus - } >> - + \lyricsto "cantus" \new Lyrics \lyrics { + San- ctus, San- ctus, San- ctus + } + >> } @end lilypond +@end quotation @node Figured bass @subsection Figured bass @@ -7165,18 +7596,19 @@ entering the chant, as the following short excerpt demonstrates: @c TODO: musicological blurb about FB -LilyPond has limited support for figured bass: +LilyPond has limited support for figured bass +@quotation @lilypond[verbatim,fragment] << - \context Voice \notes { \clef bass dis4 c d ais} - \context FiguredBass - \figures { - < 6 >4 < 7 >8 < 6+ [_!] > + \context Voice \notes { \clef bass dis4 c d ais } + \context FiguredBass \figures { + < 6 >4 < 7 >8 < 6+ [_!] > < 6 >4 <6 5 [3+] > - } - >> + } +>> @end lilypond +@end quotation The support for figured bass consists of two parts: there is an input mode, introduced by @code{\figures}, where you can enter bass figures @@ -7184,36 +7616,42 @@ as numbers, and there is a context called @internalsref{FiguredBass} that takes care of making @internalsref{BassFigure} objects. In figures input mode, a group of bass figures is delimited by -@code{<} and @code{>}. The duration is entered after the @code{>>}: +@code{<} and @code{>}. The duration is entered after the @code{>>} @example - <4 6> +<4 6> @end example +@quotation @lilypond[fragment] \context FiguredBass \figures { <4 6> } @end lilypond +@end quotation Accidentals are added when you append @code{-}, @code{!} and @code{+} -to the numbers: +to the numbers @example - <4- 6+ 7!> +<4- 6+ 7!> @end example +@quotation @lilypond[fragment] - \context FiguredBass - \figures { <4- 6+ 7!> } +\context FiguredBass +\figures { <4- 6+ 7!> } @end lilypond +@end quotation Spaces or dashes may be inserted by using @code{_}. Brackets are -introduced with @code{[} and @code{]}: +introduced with @code{[} and @code{]} @example - < [4 6] 8 [_! 12]> +< [4 6] 8 [_! 12]> @end example +@quotation @lilypond[fragment] - \context FiguredBass +\context FiguredBass \figures { < [4 6] 8 [_! 12]> } @end lilypond +@end quotation Although the support for figured bass may superficially resemble chord support, it works much simpler. The @code{\figures} mode simply @@ -7261,15 +7699,19 @@ can be denoted as the envelope of a set of notes. They are entered by applying the function @code{notes-to-clusters} to a sequence of chords, e.g. @c -@lilypond[relative=1,verbatim] - \apply #notes-to-clusters { } +@quotation +@lilypond[relative=2,verbatim] +\apply #notes-to-clusters { } @end lilypond +@end quotation The following example (from @inputfileref{input/regression,cluster.ly}) shows what the result -looks like: +looks like +@quotation @lilypondfile[]{cluster.ly} +@end quotation Ordinary notes and clusters can be put together in the same staff, even simultaneously. In such a case no attempt is made to @@ -7302,34 +7744,38 @@ Contemporary music notation frequently uses special fermata symbols to indicate fermatas of differing lengths. The following fermatas are supported +@quotation @lilypond[raggedright] \score { - << \addlyrics \notes { - b' - ^\shortfermata - _\shortfermata - r - b' - ^\fermata - _\fermata - - r - b' - ^\longfermata - _\longfermata - - r - b' - ^\verylongfermata - _\verylongfermata - r + << + \addlyrics \notes { + b' + ^\shortfermata + _\shortfermata + r + b' + ^\fermata + _\fermata + + r + b' + ^\longfermata + _\longfermata + + r + b' + ^\verylongfermata + _\verylongfermata + r } \context Lyrics \lyrics { - \override LyricText #'font-family = #'typewriter + \override LyricText #'font-family = #'typewriter "shortfermata" "fermata" "longfermata" "verylongfermata" - } >> + } + >> } @end lilypond +@end quotation See @ref{Articulations} for general instructions how to apply scripts such as fermatas to a @code{\notes@{@}} block. @@ -7351,13 +7797,15 @@ balloon. The primary purpose of this feature is to explain notation. The following example demonstrates its use. -@lilypond[verbatim,fragment,raggedright,relative=1] - \context Voice - \applyoutput - #(add-balloon-text 'NoteHead "heads, or tails?" - '(1 . -3)) - c8 +@quotation +@lilypond[verbatim,fragment,raggedright,relative=2] +\context Voice +\applyoutput + #(add-balloon-text 'NoteHead "heads, or tails?" + '(1 . -3)) +c8 @end lilypond +@end quotation @noindent The function @code{add-balloon-text} takes the name of a grob, the @@ -7381,12 +7829,14 @@ Examples: @inputfileref{input/regression,balloon.ly}. @cindex Hal Leonard The `easy play' note head includes a name inside the head. It is -used in music for beginners: +used in music for beginners +@quotation @lilypond[raggedright,verbatim,staffsize=26] - \setEasyHeads - c'2 e'4 f' | g'1 +\setEasyHeads +c'2 e'4 f' | g'1 @end lilypond +@end quotation The command @code{\setEasyHeads} overrides settings for the @internalsref{NoteHead} object. To make the letters readable, it has @@ -7396,8 +7846,8 @@ to be printed in a large font size. To print with a larger font, see @cindex Xdvi @cindex ghostscript -If you view the result with Xdvi, then staff lines may show through -the letters. Printing the PostScript file obtained does produce the +If you view the result with Xdvi, staff lines may show through the +letters. Printing the PostScript file obtained does produce the correct result. @refcommands @@ -7445,7 +7895,7 @@ settings. Hence, the MIDI file should not have more than 15 staves The MIDI block is analogous to the paper block, but it is somewhat -simpler. The @code{\midi} block can contain: +simpler. The @code{\midi} block can contain @cindex MIDI block @itemize @bullet @@ -7455,7 +7905,7 @@ simpler. The @code{\midi} block can contain: A number followed by a period is interpreted as a real number, so for setting the tempo for dotted notes, an extra space should be -inserted, for example: +inserted, for example @example \midi @{ \tempo 4 . = 120 @} @@ -7481,5 +7931,5 @@ property. The instrument name should be chosen from the list in @refbugs -If the selected string does not exactly match, then the default is -used, which is the Grand Piano. +If the selected string does not exactly match, the default is used, +which is the Grand Piano. diff --git a/Documentation/user/preface.itely b/Documentation/user/preface.itely index 1fd26c2fb2..ca7cffa72c 100644 --- a/Documentation/user/preface.itely +++ b/Documentation/user/preface.itely @@ -11,39 +11,38 @@ grand new project he was working on. It was an automated system for printing music (to be precise, it was MPP, a preprocessor for MusiXTeX). As it happened, Han-Wen accidentally wanted to print out some parts from a score, so he started looking at the software, and he -quickly got hooked. It was decided that MPP was a dead end. After -lots of philosophizing and heated e-mail exchanges Han-Wen started +quickly got hooked. It was decided that MPP was a dead end. After +lots of philosophizing and heated email exchanges Han-Wen started LilyPond in 1996. This time, Jan got sucked into Han-Wen's new project. In some ways, developing a computer program is like learning to play -an instrument. In the beginning, discovering how it works is fun, and -the things you cannot do are challenging. After the initial excitement, -you have to practice and practice. Scales and studies can be dull, and +an instrument. In the beginning, discovering how it works is fun, and +the things you cannot do are challenging. After the initial excitement, +you have to practice and practice. Scales and studies can be dull, and if you are not motivated by others---teachers, conductors or -audience---it is very tempting to give up. You continue, and gradually -playing becomes a part of your life. Some days it comes naturally, and +audience---it is very tempting to give up. You continue, and gradually +playing becomes a part of your life. Some days it comes naturally, and it is wonderful, and on some days it just does not work, but you keep playing, day after day. Like making music, working on LilyPond is can be dull work, and on -some days it feels like plodding through a morass of -bugs. Nevertheless, it has become a part of our life, and we keep -doing it. Probably the most important motivation is that our program -actually does something useful for people. When we browse around the -net we find many people that use LilyPond, and produce impressive -pieces of sheet music. Seeing that feels unreal, but in a very -pleasant way. +some days it feels like plodding through a morass of bugs. +Nevertheless, it has become a part of our life, and we keep doing it. +Probably the most important motivation is that our program actually +does something useful for people. When we browse around the net we +find many people that use LilyPond, and produce impressive pieces of +sheet music. Seeing that feels unreal, but in a very pleasant way. Our users not only give us good vibes by using our program, many of them also help us by giving suggestions and sending bug reports, so we would like to thank all users that sent us bug reports, gave suggestions or contributed in any other way to LilyPond. -Playing and printing music is more than nice analogy. Programming +Playing and printing music is more than nice analogy. Programming together is a lot of fun, and helping people is deeply satisfying, but ultimately, working on LilyPond is a way to express our deep love for -music. May it help you create lots of beautiful music! +music. May it help you create lots of beautiful music! Han-Wen and Jan @@ -53,10 +52,9 @@ Utrecht/Eindhoven, The Netherlands, July 2002. @unnumberedsec Notes to version 2.2 During the 2.1 development cycle, the cleanup of the existing features -has continued unabated. Major areas of improvement are orchestral +has continued unabated. Major areas of improvement are orchestral notation, lyrics formatting and font size handling. Han-Wen and Jan -Utrecht/Eindhoven, The Netherlands, March 2004. - +Utrecht/Eindhoven, The Netherlands, March 2004. diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index e3d567bc0e..76ecb16e89 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -6,32 +6,31 @@ @c compiling/viewing (emacs?) @c * where to go from First steps+More basics? +@c Your first LilyPond score in 10 minutes? + @node Tutorial @chapter Tutorial +This tutorial starts with a short introduction to the LilyPond music +language. After this first contact we will show you how to to produce +printed output. Then you will be able to create and print your own +sheets of music. - -Using LilyPond comes down to encoding music in an input file. After -entering the music, the program is run on the file producing output -which can be viewed or printed. In this tutorial, we will show step -by step how to enter such files, and illustrate the process with -fragments of input and the corresponding output. At the end of every -section, a paragraph will list where to find further information on -the topics discussed. - +@ifhtml Many people learn programs by trying and fiddling around with the -program. This is also possible with LilyPond. If you click on a +program. This is also possible with LilyPond. If you click on a picture in the HTML version of this manual, you will see the exact LilyPond input that was used to generate that image. -@ifhtml -Try it on this image, -@lilypond[raggedright] - c''^\markup { \bold \huge { Click on this image! } } +Try it on this image +@quotation +@lilypond[raggedright,relative=2] + c-\markup { \bold \huge { Click here. } } @end lilypond +@end quotation @end ifhtml By cutting and pasting the full input into a test file, you have a -starting template for experiments. If you like learning in this way, +starting template for experiments. If you like learning in this way, you will probably want to print out or bookmark @ifhtml the @@ -39,11 +38,12 @@ the @ref{Cheat sheet}, which is a table listing all commands for quick reference. +@c unnecesary cruft? +In this tutorial, we will show step by step how to enter such files, +and illustrate the process with fragments of input and the +corresponding output. At the end of every section, a paragraph will +list where to find further information on the topics discussed. -This tutorial starts with a short introduction to the LilyPond music -language. After this first contact, we will show you how to to -produce printed output. You should then be able to create and print -your first sheets of music. @menu * First steps:: @@ -73,56 +73,64 @@ your first sheets of music. @node First steps @section First steps -The first example demonstrates how to enter the very simple piece of -music, a scale. A note can be entered by typing its name, from +The first example demonstrates how to enter the most elementary piece +of music, a scale. A note can be entered by typing its name, from @samp{a} through @samp{g}. So, if you enter - + @example c d e f g a b @end example @noindent -the result looks like this: +the result looks like this -@lilypond[notime,relative] +@quotation +@lilypond[notime,relative=1] c d e f g a b @end lilypond +@end quotation The duration of a note is specified by a number after the note name. @samp{1} for a @rglos{whole note}, @samp{2} for a @rglos{half note}, -and so on +@samp{4} for a @rglos{quarter note} and so on @example a1 a2 a4 a16 a32 @end example +@quotation @lilypond[notime] \set Score.timing = ##f \set Staff.autoBeaming = ##f \transpose c c' { a1 a2 a4 a16 a32 s16_" " } @end lilypond +@end quotation -If you do not specify a @rglos{duration}, then the duration last -entered is used, and the first note will be a quarter +If you do not specify a @rglos{duration}, the duration last entered is +used; the first note's duration defaults to a quarter +@c FIXME: let's omit the first note rule? +@c The first note will be a quarter @example a a8 a a2 a @end example +@quotation @lilypond[notime] \set Score.timing = ##f \transpose c c' { a a8 a a2 a s16_" " } @end lilypond +@end quotation -Rests are entered just like notes, but with the name ``@code{r}'': +Rests are entered just like notes, but with the name ``@code{r}'' @cindex rests -@quotation @example r2 r4 r8 r16 @end example +@quotation @lilypond[fragment] \set Score.timing = ##f \set Staff.Clef = \turnOff @@ -133,21 +141,21 @@ s16_" " @end quotation @separate - -Add a dot @samp{.} after the duration to get a @rglos{dotted note}: +Add a dot @samp{.} after the duration to get a @rglos{dotted note} @example -a2. a4 a8. a16 +a2. a4 a8. a16 @end example +@quotation @lilypond[notime] \set Score.timing = ##f -\transpose c c' { a2. a4 a8. a16 s16_" " } +\transpose c c' { a2. a4 a8. a16 s16_" " } @end lilypond - +@end quotation The @rglos{meter} (or @rglos{time signature}) can be set with the -@code{\time} command: +@code{\time} command @example \time 3/4 @@ -155,7 +163,8 @@ The @rglos{meter} (or @rglos{time signature}) can be set with the \time 4/4 @end example -@c a clef here may lead to confusion +@c A clef here may lead to confusion, remove it. +@quotation @lilypond \override Staff.Clef #'transparent = ##t \time 3/4 @@ -165,9 +174,9 @@ s4_" " \time 4/4 s16_" " @end lilypond +@end quotation - -The @rglos{clef} can be set using the @code{\clef} command: +The @rglos{clef} can be set using the @code{\clef} command @c what is more common name treble or violin? @c in Dutch, it is violin. @@ -179,6 +188,7 @@ The @rglos{clef} can be set using the @code{\clef} command: \clef tenor @end example +@quotation @lilypond[notime] \set Score.timing = ##f \clef violin @@ -190,21 +200,13 @@ s4_" " \clef tenor s16_" " @end lilypond +@end quotation To recognize names like @code{c} and @code{d} as pitches, they have to be entered inside a so-called @code{\notes} block. This block is -formed by enclosing notes and commands are enclosed in curly braces, - -@example -@{ - \time 3/4 - \clef bass - c2 e4 g2. - f4 e d c2 r4 -@} -@end example -and adding the keyword @code{\notes} before the opening brace -@code{@{}, for example, +formed by enclosing notes and commands are enclosed in curly braces +@code{@{ @dots{} @}} and adding the keyword @code{\notes} before the +opening brace @example \notes @{ @@ -215,9 +217,8 @@ and adding the keyword @code{\notes} before the opening brace @} @end example -Now the piece of music is almost ready to be printed. When this -enclosed a @code{\score} block, i.e. braces @code{@{ @dots{} @}} with -keyword @code{\score} in front, like +Now the piece of music is almost ready to be printed. Enclose +the @code{\notes} block in a @code{\score} block @example \score @{ @@ -230,8 +231,9 @@ keyword @code{\score} in front, like @} @end example -then the music will be converted to printable output: +and the music will be converted to printable output. +@quotation @lilypond[noindent] \score { \notes { @@ -245,9 +247,10 @@ then the music will be converted to printable output: } } @end lilypond +@end quotation In many examples in this manual, both @code{\score} and @code{\notes} -and accompanying braces are left out for brevity. However, they must +and accompanying braces are left out for brevity. However, they must be present when feeding the file to LilyPond. For more elaborate information on @@ -259,68 +262,72 @@ see @item Clefs see @ref{Clef} @item Rests -see @ref{Rests}. +see @ref{Rests}. @item Time signatures and other timing commands see @ref{Time signature}. @end table + @node Running LilyPond @section Running LilyPond -In the last section we explained what kind of things you could enter -in a LilyPond file. In this section we will explain what commands to run -and how to view or print the output. If you have not used LilyPond -before, want to test your setup, or want to run an example file -yourself, read this section. The instructions that follow are for -Unix-like systems. Some additional instructions for Microsoft Windows -are given at the end of this section. +@c FIXME: let's not be so casual about Emacs and VIM, but rather +@c instruct (how) to use them; let advanced user figure-out what +@c commands to type? +In the last section we explained what kind of things you could enter +in a LilyPond file. In this section we will explain what commands to +run and how to view or print the output. If you have not used +LilyPond before, want to test your setup, or want to run an example +file yourself, read this section. The instructions that follow are +for Unix-like systems. Some additional instructions for Microsoft +Windows are given at the end of this section. + +@c FIXME: remove footnotes/integrate in text Begin by opening a terminal window and starting a text editor. For example, you could open an xterm and execute -@code{joe}.@footnote{There are macro files for VIM addicts, and there -is a @code{LilyPond-mode} for Emacs addicts. If it has not been -installed already, then refer to the file @file{INSTALL.txt}}. In -your text editor, enter the following input and save the file as -@file{test.ly}: +@code{joe}@footnote{There are macro files for VIM addicts, and there +is a @code{LilyPond-mode} for Emacs addicts. If it has not been +installed already, refer to the file @file{INSTALL.txt}}. In your +text editor, enter the following input and save the file as +@file{test.ly} -@quotation @example \score @{ \notes @{ c'4 e' g' @} @} @end example -@end quotation -To process @file{test.ly}, proceed as follows: +@noindent +To process @file{test.ly}, proceed as follows -@quotation +@noindent @example lilypond test.ly @end example -@end quotation -You will see something resembling: +@noindent +You will see something resembling -@quotation @example GNU LilyPond 1.8.0 Now processing: `/home/fred/ly/test.ly' Parsing... Interpreting music...[1] - @emph{ ... more interesting stuff ... } + @emph{ ... more interesting stuff ... } PDF output to `test.pdf'... DVI output to `test.dvi'... @end example -@end quotation @cindex DVI file @cindex Viewing music @cindex xdvi +@noindent The result is the file @file{test.pdf}@footnote{For @TeX{} -aficionados: there is also a @file{test.dvi} file. It can be viewed -with @code{xdvi}. The DVI uses a lot of PostScript specials, which do -not show up in the magnifying glass. The specials also mean that the -DVI file cannot be processed with @code{dvilj}. Use @code{dvips} for +aficionados: there is also a @file{test.dvi} file. It can be viewed +with @code{xdvi}. The DVI uses a lot of PostScript specials, which do +not show up in the magnifying glass. The specials also mean that the +DVI file cannot be processed with @code{dvilj}. Use @code{dvips} for printing. @cindex dvips @cindex dvilj @@ -331,21 +338,18 @@ installed, you can try @uref{Ghostscript, http://www.cs.wisc.edu/~ghost/}, a freely available package for viewing and printing PDF and PostScript files.} -On Windows, start up a text-editor@footnote{Any programmer-oriented -editor will do, for example Notepad. Do not use word processor. Its -formatting codes will confuse LilyPond} and enter +On Windows, start up a text-editor@footnote{Any simple or +programmer-oriented editor will do, for example Notepad. Do not use a +word processor, its formatting codes will confuse LilyPond} and enter - -@quotation @example \score @{ \notes @{ c'4 e' g' @} @} @end example -@end quotation Save it on the desktop as @file{test.ly} and make sure that it is not -called @file{test.ly.TXT}. Double clicking @file{test.ly} will process +called @file{test.ly.TXT}. Double clicking @file{test.ly} will process the file and show the resulting PDF file. @@ -363,17 +367,16 @@ like German and Dutch.} cis1 ees fisis aeses @end example +@quotation @lilypond[notime] \set Score.timing = ##f \transpose c c' { cis1 ees fisis aeses s16_" " } @end lilypond +@end quotation - @cindex key signature, setting - The key signature is set with the command ``@code{\key}'', followed by -a pitch and @code{\major} or @code{\minor}: -@quotation +a pitch and @code{\major} or @code{\minor} @example \key d \major g1 @@ -381,6 +384,7 @@ g1 g @end example +@quotation @lilypond[fragment] \set Staff.TimeSignature = \turnOff \key d \major @@ -394,25 +398,27 @@ g' Key signatures together with the pitches (including alterations) are used together to determine when to print accidentals. This is a feature that often causes confusion to newcomers, so let us explain it -in more detail: +in more detail LilyPond makes a sharp distinction between musical content and -layout. The alteration (flat, natural or sharp) of a note is part of -the pitch, and is therefore musical content. Whether an accidental (a +layout. The alteration (flat, natural or sharp) of a note is part of +the pitch, and is therefore musical content. Whether an accidental (a flat, natural or sharp @emph{sign}) is a printed in front of the -corresponding note is a question of layout. Layout is something that +corresponding note is a question of layout. Layout is something that follows rules, so accidentals are printed automatically according to those rules. The pitches in your music are works of art, so they will not be added automatically, and you must enter what you want to hear. In this example +@quotation @lilypond[fragment] \set Staff.TimeSignature = \turnOff \key d \major d' cis' fis' @end lilypond +@end quotation @noindent no note gets an explicit accidental, but still you enter @@ -424,15 +430,16 @@ d cis fis The code @code{d} does not mean ``print a black dot just below the staff.'' Rather, it means: ``a note with pitch D-natural.'' In the key -of A-flat, it does get an accidental: +of A-flat, it does get an accidental +@quotation @lilypond[fragment] \set Staff.TimeSignature = \turnOff \key as \major d' @end lilypond +@end quotation -@noindent @example \key as \major d @@ -460,9 +467,9 @@ see @ref{Key signature} @cindex tie A tie is created by adding a tilde ``@code{~}'' to the first note -being tied: +being tied @quotation -@lilypond[fragment,verbatim,relative=2] +@lilypond[fragment,verbatim,relative=3] g4~ g a2~ a4 @end lilypond @end quotation @@ -479,22 +486,20 @@ For more information on Ties, see @ref{Ties}. @cindex beams, by hand Beams are drawn automatically - @quotation -@lilypond[fragment,relative=1,verbatim] - a8 ais d es r d +@lilypond[fragment,relative=2,verbatim] +a8 ais d es r d @end lilypond @end quotation @separate If you do not like where beams are put, they can be entered by -hand. Mark the first note to be beamed with @code{[} and the last one +hand. Mark the first note to be beamed with @code{[} and the last one with @code{]}. - @quotation -@lilypond[fragment,relative=1,verbatim] - a8[ ais] d[ es r d] +@lilypond[fragment,relative=2,verbatim] +a8[ ais] d[ es r d] @end lilypond @end quotation @separate @@ -502,9 +507,8 @@ with @code{]}. For more information on beams, see @ref{Beaming}. -Here are key signatures, accidentals and ties in action: +Here are key signatures, accidentals and ties in action -@quotation @example \score @{ \notes @{ @@ -518,10 +522,10 @@ Here are key signatures, accidentals and ties in action: @} @} @end example - +@quotation @lilypond \score { - \notes { \transpose c c' { + \notes \transpose c c' { \time 4/4 \key g \minor \clef violin @@ -529,7 +533,7 @@ Here are key signatures, accidentals and ties in action: a8 d4.~ d e8 fis4 fis8 fis8 eis4 a8 gis~ gis2 r2 - }} + } \paper { linewidth = #(* 50 staffspace) } } @end lilypond @@ -539,7 +543,7 @@ Here are key signatures, accidentals and ties in action: There are some interesting points to note in this example. Bar lines and beams are drawn automatically. Line breaks are calculated automatically; it does not matter where the line breaks are in the -source file. Finally, the order in which time, key and clef changes +source file. Finally, the order in which time, key and clef changes are entered is not relevant: in the printout, these are ordered according to standard notation conventions. @@ -557,13 +561,13 @@ according to standard notation conventions. @c but we'd need to remove the ', from \key and tie To raise a note by an octave, add a high quote @code{'} (apostrophe) to the note name, to lower a note one octave, add a ``low quote'' @code{,} -(a comma). Middle C is @code{c'}: +(a comma). Middle C is @code{c'} -@quotation @example c'4 c'' c''' \clef bass c c, @end example +@quotation @lilypond[fragment] \set Score.timing = ##f \set Staff.TimeSignature = \turnOff @@ -572,13 +576,15 @@ c'4 c'' c''' \clef bass c c, @end quotation @separate -An example of the use of quotes is in the following Mozart fragment: +An example of the use of quotes is in the following Mozart fragment +@quotation @lilypond[raggedright,fragment,verbatim] - \key a \major - \time 6/8 - cis''8. d''16 cis''8 e''4 e''8 - b'8. cis''16 b'8 d''4 d''8 +\key a \major +\time 6/8 +cis''8. d''16 cis''8 e''4 e''8 +b'8. cis''16 b'8 d''4 d''8 @end lilypond +@end quotation This example shows that music in a high register needs lots of quotes. This makes the input less readable, and it is a source of errors. The @@ -586,17 +592,17 @@ solution is to use ``relative octave'' mode. In practice, this is the most convenient way to copy existing music. To use relative mode, add @code{\relative} before the piece of music. You must also give a note from which relative starts, in this case @code{c''}. If you do not -use octavation quotes (i.e. do not add @code{'} or @code{,} after a +use octavation quotes (i.e. do not add @code{'} or @code{,} after a note), relative mode chooses the note that is closest to the previous -one. For example, @code{c f} goes up while @code{c g} goes down: +one. For example, @code{c f} goes up while @code{c g} goes down -@quotation @example \relative c'' @{ c f c g c @} @end example +@quotation @lilypond[fragment] \set Score.timing = ##f \set Staff.TimeSignature = \turnOff @@ -612,28 +618,29 @@ Since most music has small intervals, pieces can be written almost without octavation quotes in relative mode. The previous example is entered as @c +@quotation @lilypond[raggedright,fragment,verbatim] \relative c'' { \key a \major \time 6/8 - cis8. d16 cis8 e4 e8 - b8. cis16 b8 d4 d8 + cis8. d16 cis8 e4 e8 + b8. cis16 b8 d4 d8 } @end lilypond - +@end quotation @c needed better, maybe even redundant explanation @c added another example below. @c grappig: Pa vond het heel logies, en slim toen-i eenmaal begreep. @c in eerste instantie drong het `relative' niet door zonder extra uitleg. Larger intervals are made by adding octavation quotes. -@quotation @example \relative c'' @{ c f, f c' c g' c, @} @end example +@quotation @lilypond[fragment] \set Score.timing = ##f \set Staff.TimeSignature = \turnOff @@ -645,7 +652,7 @@ Larger intervals are made by adding octavation quotes. @separate In @code{\relative} mode, quotes or commas no longer determine the -absolute height of a note. Rather, the height of a note is relative to +absolute height of a note. Rather, the height of a note is relative to the previous one, and changing the octave of a single note shifts all following notes an octave up or down. @@ -658,83 +665,92 @@ and @ref{Octave check}. In input files, music is represent by so-called @emph{music -expression}. We have already seen in the previous examples; -a single note is a music expression: +expression}. We have already seen in the previous examples; +a single note is a music expression -@lilypond[verbatim,relative=2] +@quotation +@lilypond[verbatim,relative=3] a4 @end lilypond +@end quotation Enclosing group of notes in braces creates a new music -expression: +expression -@lilypond[verbatim,relative=2] - { a4 g4 } +@quotation +@lilypond[verbatim,relative=3] +{ a4 g4 } @end lilypond +@end quotation Putting a bunch of music expressions (notes) in braces, means that -they should be played in sequence. The result again is a music +they should be played in sequence. The result again is a music expression, which can be grouped with other expressions sequentially. Here, the expression from the previous example is combined with two -notes: +notes -@lilypond[verbatim,relative=2] - { { a4 g } f g } +@quotation +@lilypond[verbatim,relative=3] +{ { a4 g } f g } @end lilypond +@end quotation -This technique becomes useful for non-monophonic music. To enter music +This technique becomes useful for non-monophonic music. To enter music with more voices or more staves, we also combine expressions in -parallel. Two voices that should play at the same time, are entered as +parallel. Two voices that should play at the same time, are entered as a simultaneous combination of two sequences. A ``simultaneous'' music expression is formed by enclosing expressions in @code{<<} and @code{>>}. In the following example, three sequences (all containing -two notes) are combined simultaneously: +two notes) are combined simultaneously -@lilypond[verbatim,relative=2] - << - { a4 g } - { f e } - { d b } - >> +@quotation +@lilypond[verbatim,relative=3] +<< + { a4 g } + { f e } + { d b } +>> @end lilypond +@end quotation This mechanism is similar to mathematical formulas: a big formula is created by composing small formulas. Such formulas are called expressions, and their definition is recursive, so you can make arbitrarily complex and large expressions. For example, -@quotation - 1 +@example +1 - 1 + 2 +1 + 2 - (1 + 2) * 3 +(1 + 2) * 3 - ((1 + 2) * 3) / (4 * 5) -@end quotation +((1 + 2) * 3) / (4 * 5) +@end example @cindex expression @cindex music expression This example shows a sequence of expressions, where each expression is contained in the next one. The simplest expressions are numbers and -operators (like +, * and /). Parentheses are used to group +operators (like +, * and /). Parentheses are used to group expressions. Like mathematical expressions, music expressions can be nested arbitrarily deep, e.g. -@lilypond[verbatim,relative=1] - { c <> - << { e f } { c <> } - >> - } +@quotation +@lilypond[verbatim,relative=2] +{ + c <> + << { e f } { c <> } >> +} @end lilypond - +@end quotation @cindex indent When spreading expressions over multiple lines, it is customary to use -an indent that indicates the nesting level. Formatting music like this +an indent that indicates the nesting level. Formatting music like this eases reading, and helps you insert the right number of closing -braces at the end of an expression. For example, +braces at the end of an expression. For example, @example \score @{ @@ -750,7 +766,7 @@ braces at the end of an expression. For example, @end example Some editors have special support for entering LilyPond, and can help -indenting source files. See @ref{Editor support} for more information. +indenting source files. See @ref{Editor support} for more information. @@ -760,7 +776,7 @@ indenting source files. See @ref{Editor support} for more information. To print more than one staff, each piece of music that makes up a staff is marked by adding @code{\new Staff} before it. These @code{Staff}'s are then combined parallel with @code{<<} and -@code{>>}, as demonstrated here: +@code{>>}, as demonstrated here @quotation @lilypond[fragment,verbatim] @@ -776,35 +792,34 @@ The command @code{\new} introduces a ``notation context.'' A notation context is an environment in which musical events (like notes or @code{\clef} commands) are interpreted. For simple pieces, such notation contexts are created implicitly. For more complex pieces, it -is best to mark contexts explicitly. This ensures that each fragment +is best to mark contexts explicitly. This ensures that each fragment gets its own stave. There are several types of contexts: @code{Staff}, @code{Voice} and -@code{Score} handle normal music notation. Other staves are also +@code{Score} handle normal music notation. Other staves are also @code{Lyrics} (for setting lyric texts) and @code{ChordNames} (for printing chord names). In terms of syntax, prepending @code{\new} to a music expression -creates a bigger music expression. In this way it resembles the minus -sign in mathematics. The formula (4+5) is an expression, so -(4+5) is a bigger +creates a bigger music expression. In this way it resembles the minus +sign in mathematics. The formula (4+5) is an expression, so -(4+5) is a bigger expression. -We can now typeset a melody with two staves: +We can now typeset a melody with two staves @c TODO: (c) status of this Paul McCartney (?) song (let's all stand together) - @quotation @lilypond[verbatim,raggedright] \score { - \notes - << \new Staff { + \notes << + \new Staff { \time 3/4 \clef violin \relative c'' { e2 d4 c2 b4 a8[ a] - b[ b] g[ g] a2. } + b[ b] g[ g] a2. } } \new Staff { \clef bass @@ -829,27 +844,29 @@ For more information on context see the description in @cindex staccato Common accents can be added to a note using a dash (`@code{-}') and a -single character: +single character @quotation -@lilypond[verbatim,relative=1] -c-. c-- c-> c-^ c-+ c-_ +@lilypond[verbatim,relative=2] +c-. c-- c-> c-^ c-+ c-_ @end lilypond @end quotation @separate @cindex fingering Similarly, fingering indications can be added to a note using a dash -(`@code{-}') and the digit to be printed: +(`@code{-}') and the digit to be printed @c -@lilypond[verbatim,relative=1] +@quotation +@lilypond[verbatim,relative=2] c-3 e-5 b-2 a-1 @end lilypond +@end quotation Dynamic signs are made by adding the markings (with a backslash) to -the note: +the note @quotation -@lilypond[verbatim,relative=1] +@lilypond[verbatim,relative=2] c\ff c\mf @end lilypond @end quotation @@ -860,10 +877,10 @@ c\ff c\mf @cindex crescendo Crescendi and decrescendi are started with the commands @code{\<} and -@code{\>}. An ending dynamic, for example @code{\f}, will finish the -crescendo, or the command @code{\!} can be used: +@code{\>}. An ending dynamic, for example @code{\f}, will finish the +crescendo, or the command @code{\!} can be used @quotation -@lilypond[verbatim,relative=1] +@lilypond[verbatim,relative=2] c2\< c2\ff\> c2 c2\! @end lilypond @end quotation @@ -875,32 +892,33 @@ c2\< c2\ff\> c2 c2\! A slur is a curve drawn across many notes, and indicates legato articulation. The starting note and ending note are marked with a -``@code{(}'' and a ``@code{)}'' respectively: +``@code{(}'' and a ``@code{)}'' respectively @quotation -@lilypond[fragment,relative=1,verbatim] +@lilypond[fragment,relative=2,verbatim] d4( c16)( cis d e c cis d e)( d4) @end lilypond @end quotation @separate @cindex slurs versus ties -A slur looks like a tie, but it has a different meaning. A tie simply +A slur looks like a tie, but it has a different meaning. A tie simply makes the first note sound longer, and can only be used on pairs of -notes with the same pitch. Slurs indicate the articulations of notes, -and can be used on larger groups of notes. Slurs and ties are also -nested in practice: +notes with the same pitch. Slurs indicate the articulations of notes, +and can be used on larger groups of notes. Slurs and ties are also +nested in practice -@lilypond[fragment,relative=1] +@quotation +@lilypond[fragment,relative=2] c2~( c8 fis fis4 ~ fis2 g2) @end lilypond - +@end quotation @cindex phrasing slurs Slurs to indicate phrasing can be entered with @code{\(} and @code{\)}, so you can have both legato slurs and phrasing slurs at the same time. @quotation -@lilypond[fragment,relative=1,verbatim] +@lilypond[fragment,relative=2,verbatim] a8(\( ais b c) cis2 b'2 a4 cis, c\) @end lilypond @end quotation @@ -929,7 +947,7 @@ Chords can be made by surrounding pitches with angled brackets. Angled brackets are the symbols @code{<} and @code{>}. @quotation -@lilypond[relative,fragment,verbatim] +@lilypond[relative=1,fragment,verbatim] r4 4 8 @end lilypond @end quotation @@ -937,18 +955,18 @@ r4 4 8 You can combine markings like beams and ties with chords. They must -be placed outside the angled brackets: +be placed outside the angled brackets @quotation -@lilypond[relative,fragment,verbatim] +@lilypond[relative=1,fragment,verbatim] r4 8[ ]~ @end lilypond @end quotation -@quotation @example r4 8\>( 8\!) @end example -@lilypond[relative,fragment] +@quotation +@lilypond[relative=1,fragment] \slurUp r4 8\>( 8\!) @end lilypond @@ -964,26 +982,28 @@ r4 8\>( 8\!) @cindex pickup @cindex anacruse @cindex partial measure -A pickup is entered with the keyword @code{\partial}. It +A pickup is entered with the keyword @code{\partial}. It is followed by a duration: @code{\partial 4} is a quarter note upstep -and @code{\partial 8} an eighth note: -@lilypond[relative=1,verbatim,fragment] - \partial 8 - f8 c2 d e +and @code{\partial 8} an eighth note +@quotation +@lilypond[relative=2,verbatim,fragment] +\partial 8 +f8 c2 d e @end lilypond - +@end quotation @cindex tuplets @cindex triplets Tuplets are made with the @code{\times} keyword. It takes two arguments: a fraction and a piece of music. The duration of the piece of music is multiplied by the fraction. Triplets make notes occupy -2/3 of their notated duration, so a triplet has 2/3 as its fraction: +2/3 of their notated duration, so a triplet has 2/3 as its fraction @c -@lilypond[relative,verbatim,fragment] - \times 2/3 { f8 g a } - \times 2/3 { c r c } +@quotation +@lilypond[relative=1,verbatim,fragment] +\times 2/3 { f8 g a } +\times 2/3 { c r c } @end lilypond - +@end quotation @cindex grace notes @cindex accacciatura Grace notes are also made by prefixing a music expression with the @@ -991,10 +1011,12 @@ keyword @code{\appoggiatura} or @code{\acciaccatura} @cindex appoggiatura @cindex acciaccatura -@lilypond[relative=1,verbatim,fragment] - c4 \appoggiatura b16 c4 - c4 \acciaccatura b16 c4 +@quotation +@lilypond[relative=2,verbatim,fragment] +c4 \appoggiatura b16 c4 +c4 \acciaccatura b16 c4 @end lilypond +@end quotation @noindent @@ -1016,25 +1038,25 @@ see @ref{Partial measures}. @cindex comments @cindex line comment @cindex block comment -Comments are pieces of the input that are ignored. There are two -types of comments. The percent symbol @code{%} introduces a line -comment; the rest of the line is ignored. Block comments span larger -sections of input. Anything that is enclosed in @code{%@{} and -@code{%@}} is ignored too. The following fragment shows possible uses -for comments: +A comment is a remark for the human reader of the music input, it is +ignored and has no effect on the printed output. There are two types +of comments. The percent symbol @code{%} introduces a line comment; +the rest of the line is ignored. A block comments marks a whole +section of music input, anything that is enclosed in @code{%@{} and +@code{%@}} is ignored. The following fragment shows possible uses for +comments @example - % notes for twinkle twinkle follow: - c4 c g' g a a - - %@{ - +% notes for twinkle twinkle follow +c4 c g' g a a + +%@{ This line, and the notes below are ignored, since they are in a block comment. g g f f e e d d c2 - %@} +%@} @end example @@ -1055,7 +1077,7 @@ Lyrics are entered by separating each syllable with a space, @end example To prevent certain words (for example ``as'') as being read as a -pitch, the input-mode must be switched. This is done with +pitch, the input-mode must be switched. This is done with @code{\lyrics}. In @code{\lyrics} mode, all words are read as lyric syllables. @example @@ -1066,31 +1088,34 @@ syllables. Again, the braces @code{@{@}} signify that the syllables are sung in sequence. -By default, music expressions are interpreted in @code{Staff} context. For +By default, music expressions are interpreted in @code{Staff} context. For lyrics, this is obviously not desirable, so it is necessary to explicitly specify a @code{Lyrics} context, @example - \new Lyrics \lyrics @{ I want to break free @} +\new Lyrics \lyrics @{ I want to break free @} @end example -The melody for this song is as follows: +The melody for this song is as follows -@lilypond[fragment,relative=1] - c4 - \times 2/3 { f4 g g } \times 2/3 { g4( a2) } +@quotation +@lilypond[fragment,relative=2] +c4 +\times 2/3 { f4 g g } \times 2/3 { g4( a2) } @end lilypond +@end quotation The lyrics can be set to these notes, combining both with the -@code{\lyricsto} keyword: +@code{\lyricsto} keyword @example \lyricsto "@var{name}" \new Lyrics @dots{} @end example where @var{name} identifies to which melody the lyrics should be -aligned. In this case, there is only one melody, so we can leave it +aligned. In this case, there is only one melody, so we can leave it empty. The final result is +@quotation @lilypond[verbatim,fragment,raggedright] \score { \notes << @@ -1103,43 +1128,50 @@ The final result is >> } @end lilypond +@end quotation @cindex melisma @cindex extender line @c synonyms? This melody ends on a @rglos{melisma}, a single syllable (``free'') -sung to more than one note. This is indicated with an @emph{extender -line}. It is entered as two underscores, i.e. +sung to more than one note. This is indicated with an @emph{extender +line}. It is entered as two underscores, i.e. @example - \lyrics @{ I want to break free __ @} +\lyrics @{ I want to break free __ @} @end example +@quotation @lilypond[raggedright] -\score { - \notes << - \relative c' \new Voice { - \partial 8 - c8 - \times 2/3 { f g g } \times 2/3 { g4( a2) } } - \lyricsto "" \new Lyrics \lyrics { I want to break free __ } +\score { + << + \notes \relative c' \new Voice { + \partial 8 + c8 + \times 2/3 { f g g } \times 2/3 { g4( a2) } + } + \lyricsto "" \new Lyrics \lyrics { I want to break free __ } >> } @end lilypond +@end quotation Similarly, hyphens between words can be entered as two dashes, -resulting in a centered hyphen between two syllables: +resulting in a centered hyphen between two syllables @example - Twin -- kle twin -- kle +Twin -- kle twin -- kle @end example +@quotation @lilypond[raggedright] \score { - << \notes \relative f' - \context Voice = bla { \time 2/4 - f4 f c' c' } + << + \notes \relative f' \context Voice = bla { + \time 2/4 + f4 f c' c' + } \new Lyrics \lyrics \lyricsto "bla" { Twin -- kle twin -- kle } >> - \paper { raggedright = ##t } - } +} @end lilypond +@end quotation More options, like putting multiple lines of lyrics below a melody are discussed in @ref{Vocal music}. @@ -1157,34 +1189,40 @@ In popular music, it is common to denote accompaniment as chord-names. Such chords can be entered like notes, @example - c2 f4. g8 +c2 f4. g8 @end example @noindent but now, each pitch is read as the root of a chord instead of a note. -This mode is switched on with @code{\chords}: +This mode is switched on with @code{\chords} -@lilypond[verbatim] +@quotation +@lilypond[verbatim,raggedright] \score { \chords { c2 f4. g8 } } @end lilypond +@end quotation Other chords can be created by adding modifiers after a colon. The -following example shows a few common modifiers: +following example shows a few common modifiers @c +@quotation @lilypond[verbatim] \chords { c2 f4:m g4:maj7 gis1:dim7 } @end lilypond +@end quotation For lead sheets, chords are not printed on staves, but as names on a -line of themselves. Hence, we have to override the context with +line of themselves. Hence, we have to override the context with @code{\new}, rendering the music expression in a @code{ChordNames} context +@quotation @lilypond[verbatim] \new ChordNames \chords { c2 f4.:m g4.:maj7 gis8:dim7 } @end lilypond +@end quotation @cindex lead sheet @separate @@ -1200,23 +1238,25 @@ a lead sheet, for example, >> @} @end example -@lilypond[] -\score { - << - \partial 4 - \new ChordNames \chords { r8 c2:sus4 f } +@quotation +@lilypond[raggedright] +\score { + << + \partial 4 + \new ChordNames \chords { r8 c2:sus4 f } \notes \relative c' { - c4 - \times 2/3 { f g g } \times 2/3 { g4( a2) } } + c4 + \times 2/3 { f g g } \times 2/3 { g4( a2) } + } \new Lyrics \lyricsto "" \lyrics { I want to break free __ } >> - \paper{ raggedright = ##t } } @end lilypond +@end quotation -A complete list of modifiers and other options for layout are in the -reference manual section @ref{Chords}. +A complete list of modifiers and other options for layout can be found +in @ref{Chords}. @node Listening to output @section Listening to output @@ -1243,13 +1283,12 @@ The @code{\midi} block is added to @code{\score}, for example, @end example Here, the tempo is specified using the @code{\tempo} command. In this -case the tempo of quarter notes is set to 72 beats per minute. More -information on auditory output is in the @ref{Sound} section in the -notation manual. +case the tempo of quarter notes is set to 72 beats per minute. More +information on auditory output in the notation manual, @ref{Sound}. -If there is a @code{\midi} command in a @code{\score}, then only MIDI -will be produced. If notation is needed too, then a @code{\paper} -block must be added too: +If there is a @code{\midi} command in a @code{\score}, only MIDI will +be produced. If notation is needed too, a @code{\paper} block must be +added too @example \score @{ @@ -1265,17 +1304,17 @@ block must be added too: @section Titling Bibliographic information is entered in a separate block, the -@code{\header} block. The name of the piece, its composer, etc. are -entered as an assignment, within @code{\header @{ @dots{} @}}. For +@code{\header} block. The name of the piece, its composer, etc. are +entered as an assignment, within @code{\header @{ @dots{} @}}. For example, @example - \header @{ - title = "Eight miniatures" - composer = "Igor Stravinsky" - tagline = "small is beautiful" - @} - - \score @{ @dots{} @} +\header @{ + title = "Eight miniatures" + composer = "Igor Stravinsky" + tagline = "small is beautiful" +@} + +\score @{ @dots{} @} @end example @cindex bibliographic information @@ -1284,17 +1323,17 @@ example, @cindex Engraved by LilyPond When the file is processed the title and composer are printed above -the music. The `tagline' is a short line printed at bottom of the last -page which normally says ``Engraved by LilyPond, version @dots{}''. In +the music. The `tagline' is a short line printed at bottom of the last +page which normally says ``Engraved by LilyPond, version @dots{}''. In the example above it is replaced by the line ``small is beautiful.''@footnote{Nicely printed parts are good PR for us, so please leave the tagline if you can.} -Normally, the @code{\header} is put at the top of the file. However, -for a document that contains multiple pieces (e.g. an etude book, or +Normally, the @code{\header} is put at the top of the file. However, +for a document that contains multiple pieces (e.g. an etude book, or an orchestral part with multiple movements), the header can be put in the @code{\score} block as follows; in this case, the name of -each piece will be printed before each movement: +each piece will be printed before each movement @cindex Engraved by LilyPond @@ -1302,18 +1341,18 @@ each piece will be printed before each movement: @cindex tag line @example - \header @{ - title = "Eight miniatures" - composer = "Igor Stravinsky" - tagline = "small is beautiful" - @} - - \score @{ @dots{} - \header @{ piece = "Adagio" @} - @} - \score @{ @dots{} - \header @{ piece = "Menuetto" @} - @} +\header @{ + title = "Eight miniatures" + composer = "Igor Stravinsky" + tagline = "small is beautiful" +@} + +\score @{ @dots{} + \header @{ piece = "Adagio" @} +@} +\score @{ @dots{} + \header @{ piece = "Menuetto" @} +@} @end example More information on titling can be found in @ref{Invoking lilypond}. @@ -1332,41 +1371,46 @@ beams, and the top voice has the stems up, while the bottom voice has them down. Entering such parts is done by entering each voice as a sequence (with -@code{@{ .. @}}), and combining those simultaneously, separating the -voices with @code{\\}: +@code{@{ .. @}}), and combining those simultaneously, separating the +voices with @code{\\} -@lilypond[verbatim,relative=2] - << { a4 g2 f4~ f4 } \\ - { r4 g4 f2 f4 } >> +@quotation +@lilypond[verbatim,relative=3] +<< { a4 g2 f4~ f4 } \\ + { r4 g4 f2 f4 } >> @end lilypond +@end quotation For polyphonic music typesetting, spacer rests can also be convenient: these are rests that do not print. It is useful for filling up voices that -temporarily do not play. Here is the same example with a spacer rest +temporarily do not play. Here is the same example with a spacer rest instead of a normal rest -@lilypond[relative=2] - << { a4 g2 f4~ f4 } \\ - { s4 g4 f2 f4 } >> +@quotation +@lilypond[relative=3] +<< { a4 g2 f4~ f4 } \\ + { s4 g4 f2 f4 } >> @end lilypond +@end quotation -Again, these expressions can be nested arbitrarily: +Again, these expressions can be nested arbitrarily -@lilypond[fragment,relative=2] +@quotation +@lilypond[fragment,relative=3] << - \new Staff - << { a4 g2 f4~ f4 } \\ - { s4 g4 f2 f4 } - >> - \new Staff - << \clef bass - { 1 ~ 4 } \\ - { f4 d e2 ~ e4} + \new Staff << + { a4 g2 f4~ f4 } \\ + { s4 g4 f2 f4 } + >> + \new Staff << + \clef bass + { 1 ~ 4 } \\ + { f4 d e2 ~ e4} >> >> @end lilypond +@end quotation - -More features of polyphonic typesetting are in the notation manual +More features of polyphonic typesetting in the notation manual in @ref{Polyphony}. @node Piano staves @@ -1376,32 +1420,30 @@ in @ref{Polyphony}. @cindex cross staff voice, manual @cindex @code{\context} -Piano music is always typeset in two staves connected by a brace. -Printing such a staff is similar to the polyphonic example in -@ref{More staves}: +Piano music is typeset in two staves connected by a brace. Printing +such a staff is similar to the polyphonic example in @ref{More staves} @example - << \new Staff @{ @dots{} @} - \new Staff @{ @dots{} @} - >> +<< \new Staff @{ @dots{} @} + \new Staff @{ @dots{} @} >> @end example but now this entire expression must be interpreted as a -@code{PianoStaff}: +@code{PianoStaff} @example \new PianoStaff << \new Staff @dots{} >> @end example -Here is a full-fledged example: +Here is a full-fledged example -@lilypond[relative,fragment] -\new PianoStaff - << \new Staff { \time 2/4 - c4 c g' g } - \new Staff { - \clef bass c,, c' e c } - >> +@quotation +@lilypond[relative=1,fragment] +\new PianoStaff << + \new Staff { \time 2/4 c4 c g' g } + \new Staff { \clef bass c,, c' e c } +>> @end lilypond +@end quotation -More information on formatting piano music is in @ref{Piano music}. +More information on formatting piano music is in @ref{Piano music}. @node Organizing larger pieces @section Organizing larger pieces @@ -1409,50 +1451,52 @@ More information on formatting piano music is in @ref{Piano music}. When all of the elements discussed earlier are combined to produce larger files, the @code{\score} blocks get a lot bigger, because the music expressions are longer, and, in the case of polyphonic pieces, -more deeply nested. Such large expressions can become unwieldy. +more deeply nested. Such large expressions can become unwieldy. By using variables, also known as identifiers, it is possible to break -up complex music expressions. An identifier is assigned as follows: +up complex music expressions. An identifier is assigned as follows @c @example - namedMusic = \notes @{ @dots{} +namedMusic = \notes @{ @dots{} @end example The contents of the music expression @code{namedMusic}, can be used -later by preceding the name with a backslash, i.e. @code{\namedMusic}. +later by preceding the name with a backslash, i.e. @code{\namedMusic}. In the next example, a two note motive is repeated two times by using -variable substitution: +variable substitution +@quotation @lilypond[raggedright,verbatim] seufzer = \notes { e'4( dis'4) } -\score { \notes { - \seufzer \seufzer -} } +\score { + \new Staff { \seufzer \seufzer } +} @end lilypond +@end quotation The name of an identifier should have alphabetic characters only; -no numbers, underscores or dashes. The assignment should be outside of +no numbers, underscores or dashes. The assignment should be outside of the @code{\score} block. It is possible to use variables for many other types of objects in the input. For example, @example - width = 4.5\cm - name = "Wendy" - aFivePaper = \paper @{ paperheight = 21.0 \cm @} +width = 4.5\cm +name = "Wendy" +aFivePaper = \paper @{ paperheight = 21.0 \cm @} @end example Depending on its contents, the identifier can be used in different -places. The following example uses the above variables: +places. The following example uses the above variables @example - \score @{ - \notes @{ c4^\name @} - \paper @{ - \aFivePaper - linewidth = \width - @} +\score @{ + \notes @{ c4^\name @} + \paper @{ + \aFivePaper + linewidth = \width @} +@} @end example More information on the possible uses of identifiers is in the @@ -1463,9 +1507,9 @@ technical manual, in TODO. @section An orchestral part In orchestral music, all notes are printed twice: both in a part for -the musicians, and in a full score for the conductor. Identifiers can +the musicians, and in a full score for the conductor. Identifiers can be used to avoid double work: the music is entered once, and stored in -a variable. The contents of that variable is then used to generate +a variable. The contents of that variable is then used to generate both the part and the score. It is convenient to define the notes in a special file, for example, @@ -1492,9 +1536,9 @@ Then, an individual part is made by putting the following in a file The line -@verbatim +@example \include "horn-music.ly" -@end verbatim +@end example @noindent substitutes the contents of @file{horn-music.ly} at this position in @@ -1502,49 +1546,57 @@ the file, so @code{hornNotes} is defined afterwards. The command @code{\transpose f c'} indicates that the argument, being @code{\hornNotes}, should be transposed by a fifth downwards: sounding @code{f} is denoted by notated @code{c'}, which corresponds with -tuning of a normal French Horn in F. The transposition can be seen in -the following output: +tuning of a normal French Horn in F. The transposition can be seen in +the following output +@quotation @lilypond[raggedright] \score { \notes \transpose f c' \notes \relative c { - \time 2/4 - r4 f8 a cis4 f e d -} + \time 2/4 + r4 f8 a cis4 f e d + } } @end lilypond +@end quotation In ensemble pieces, one of the voices often does not play for many -measures. This is denoted by a special rest, the multi-measure -rest. It is entered with a capital @code{R} followed by a duration (1 +measures. This is denoted by a special rest, the multi-measure +rest. It is entered with a capital @code{R} followed by a duration (1 for a whole note, 2 for a half note, etc.) By multiplying the -duration, longer rests can be constructed. For example, this rest -takes 3 measures in 2/4 time: +duration, longer rests can be constructed. For example, this rest +takes 3 measures in 2/4 time @example - R2*3 +R2*3 @end example When printing the part, multi-rests -must be condensed. This is done by setting a run-time variable: +must be condensed. This is done by setting a run-time variable @example - \set Score.skipBars = ##t +\set Score.skipBars = ##t @end example This commands sets the property @code{skipBars} property in the @code{Score} context to true (@code{##t}). Prepending the rest and -this option to the music above, leads to the following result: +this option to the music above, leads to the following result +@quotation @lilypond[raggedright] -\score {\notes { \transpose f c' \relative c { \time 2/4 -\set Score.skipBars = ##t - R2*3 - r4 f8 a cis4 f e d } }} +\score { + \notes \transpose f c' \relative c { + \time 2/4 + \set Score.skipBars = ##t + R2*3 + r4 f8 a cis4 f e d + } +} @end lilypond +@end quotation The score is made by combining all of the music in a @code{\score} -block. Assuming that the other voice is in @code{bassoonNotes} in the +block. Assuming that the other voice is in @code{bassoonNotes} in the file @file{bassoon-music.ly}, a score is made with @example @@ -1555,24 +1607,31 @@ file @file{bassoon-music.ly}, a score is made with \simultaneous @{ \new Staff \hornNotes \new Staff \bassoonNotes - @} @} + @} +@} @end example leading to +@quotation @lilypond[raggedright] \score { \notes \relative c \simultaneous { - \new Staff { \time 2/4 - R2*3 - r4 f8 a cis4 f e d } - \new Staff { \clef bass + \new Staff { + \time 2/4 R2*3 + r4 f8 a cis4 f e d + } + \new Staff { + \clef bass r4 d,8 f | gis4 c | b bes | - a8 e f4 | g d | gis f } - } } + a8 e f4 | g d | gis f + } + } +} @end lilypond +@end quotation -More in-depth information on preparing parts and scores is in the +More in-depth information on preparing parts and scores in the notation manual, in @ref{Orchestral music}. Setting run-time variables (``properties'') is discussed in ref-TODO. @@ -1590,18 +1649,17 @@ hand, simply by importing a PostScript figure into the word processor. However, there is an automated procedure to reduce the amount of work involved HTML, La@TeX{}, and Texinfo documents. - A script called @code{lilypond-book} will extract the music fragments, run format them, and put back the resulting notation. This program is fully described in @ref{lilypond-book manual}. Here we show a small -example. The example also contains explanatory text, so we will not -comment on it further: +example. The example also contains explanatory text, so we will not +comment on it further @example \documentclass[a4paper]@{article@} \begin@{document@} -Documents for lilypond-book may freely mix music and text. For +Documents for lilypond-book may freely mix music and text. For example, \begin@{lilypond@} @@ -1636,7 +1694,7 @@ Larger examples can be put in a separate file, and introduced with \end@{document@} @end example -Under Unix, you can view the results as follows: +Under Unix, you can view the results as follows @example $ cd input/tutorial $ mkdir -p out/ @@ -1653,7 +1711,7 @@ $ xdvi lilybook @end example To convert the file into a nice PDF document, run the following -commands: +commands @example $ dvips -Ppdf -u +lilypond lilybook $ ps2pdf lilybook.ps @@ -1661,34 +1719,35 @@ $ ps2pdf lilybook.ps Running lilypond-book and running latex creates a lot of temporary -files, which would clutter up the working directory. To remedy this, -use the @code{output} option. It will create the files in a separate +files, which would clutter up the working directory. To remedy this, +use the @code{output} option. It will create the files in a separate subdirectory @file{out}. The result looks more or less like @separate -Documents for lilypond-book may freely mix music and text. For -example, +Documents for lilypond-book may freely mix music and text. For +example -@lilypond +@quotation +@lilypond[raggedright] \score { \notes \relative c' { c2 g'2 \times 2/3 { f8 e d } c'2 g4 } - \paper { - raggedright = ##t - } } @end lilypond +@end quotation If you have no @code{\score} block in the fragment, -@code{lilypond-book} will supply one: +@code{lilypond-book} will supply one +@quotation @lilypond - c'4 +c'4 @end lilypond +@end quotation In this example two things happened: a @code{score} block was added, and the line width was set to natural @@ -1696,11 +1755,15 @@ length. Options are put in brackets. +@quotation @lilypond[staffsize=26,verbatim] - c'4 f16 +c'4 f16 @end lilypond +@end quotation Larger examples can be put in a separate file, and introduced with @code{\lilypondfile}. +@quotation @lilypondfile{screech-boink.ly} +@end quotation diff --git a/input/test/engraver-example.lyinc b/input/test/engraver-example.lyinc index 5e75faa63b..10f849102e 100644 --- a/input/test/engraver-example.lyinc +++ b/input/test/engraver-example.lyinc @@ -1,47 +1,37 @@ -% texidoc = "Include file for engraver example." - - -\paper { raggedright = ##t } - -topVoice = \notes \relative c' -{ - \key d\major - es8([ g] a[ fis]) - b4 - b16[-. b-. b-. cis-.] - d4-> +%% texidoc = "Include file for engraver example." + +topVoice = \notes \relative c' { + \key d\major + es8([ g] a[ fis]) + b4 + b16[-. b-. b-. cis-.] + d4-> } - - -botVoice = \notes \relative c' -{ - \key d\major - c8[( f] b[ a)] - es4 - es16[-. es-. es-. fis-.] - b4-> +botVoice = \notes \relative c' { + \key d\major + c8[( f] b[ a)] + es4 + es16[-. es-. es-. fis-.] + b4-> } - hoom = \notes \relative c { - \key d \major - \clef bass - - g8-. r - r4 - fis8-. - r8 - r4 - b'4-> + \key d \major + \clef bass + g8-. r + r4 + fis8-. + r8 + r4 + b'4-> } -pah = \notes \relative c' -{ - r8 b-. - r4 - r8 g8-. - r16 g-. r8 - \clef treble - fis'4-> +pah = \notes \relative c' { + r8 b-. + r4 + r8 g8-. + r16 g-. r8 + \clef treble + fis'4-> } diff --git a/mf/feta.tex b/mf/feta.tex index 1fe629ef72..3f39e4a6d4 100644 --- a/mf/feta.tex +++ b/mf/feta.tex @@ -1,6 +1,6 @@ % display all feta chars in a pretty picture % GNU LilyPond -% (c) 1998--2003 Jan Nieuwenhuizen +% (c) 1998--2004 Jan Nieuwenhuizen % % urg: fool ls-latex \def\urg{ diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 9600afeb11..019336b582 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -244,7 +244,8 @@ output = { PRINTFILENAME: '''\\texttt{%(filename)s} ''', - VERBATIM: r'''\begin{verbatim} + VERBATIM: r'''\noindent +\begin{verbatim} %(verb)s\end{verbatim} ''', FILTER: r'''\begin{lilypond}[%(options)s] @@ -258,14 +259,16 @@ output = { @lilypond''', AFTER: '', BEFORE: '', - OUTPUT: r''' - @image{%(base)s,,,[image of music],%(ext)s} + OUTPUT: r'''@noindent +@image{%(base)s,,,[image of music],%(ext)s} ''', PRINTFILENAME: '''@file{%(filename)s} ''', - VERBATIM: r'''@example + VERBATIM: r'''@exampleindent 0 +@example %(verb)s@end example +@exampleindent 5 ''', }, } -- 2.39.5