@c M-x texinfo-all-menus-update
@c to automatically fill in these menus before saving changes
+
@node Advanced notation
@chapter Advanced notation
This chapter deals with rarely-used and advanced notation.
@menu
-* Accidentals::
-* Expressive stuff::
+* Text::
+* Preparing parts::
* Orchestral music::
* Contemporary notation::
* Educational use::
-* Other stuff::
+* Automatic notation::
@end menu
-@node Accidentals
-@section Accidentals
-This section describes how to change the way that accidentals are
-inserted automatically before notes.
+@node Text
+@section Text
+
+This section explains how to include text (with various formatting) in
+your scores.
@menu
-* Automatic accidentals::
+* Text scripts::
+* Text spanners::
+* Text marks::
+* Text markup::
+* Text encoding::
+* Nested scores::
+* Overview of text markup commands::
+* Selecting font sizes::
+* Font selection::
+* New dynamic marks::
+* Other text markup issues::
@end menu
-@node Automatic accidentals
-@subsection Automatic accidentals
-@cindex Automatic accidentals
-Common rules for typesetting accidentals have been placed in a
-function. This function is called as follows
+@node Text scripts
+@subsection Text scripts
-@cindex @code{set-accidental-style}
-@example
-#(set-accidental-style 'STYLE #('CONTEXT#))
-@end example
+@cindex Text scripts
+@cindex text items, non-empty
+@cindex non-empty texts
-The function can take two arguments: the name of the accidental style,
-and an optional argument that denotes the context that should be
-changed. If no context name is supplied, @code{Staff} is the default,
-but you may wish to apply the accidental style to a single @code{Voice}
-instead.
+It is possible to place arbitrary strings of text or @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
-The following accidental styles are supported
-@table @code
-@item default
-This is the default typesetting behavior. It corresponds
-to 18th century common practice: Accidentals are
-remembered to the end of the measure in which they occur and
-only on their own octave.
+@lilypond[quote,fragment,raggedright,verbatim,relative=1]
+c4^"longtext" \fatText c4_"longlongtext" c4
+@end lilypond
-@item voice
-The normal behavior is to remember the accidentals on
-Staff-level. This variable, however, typesets accidentals
-individually for each voice. Apart from that, the rule is similar to
-@code{default}.
+More complex formatting may also be added to a note by using the
+markup command,
+@lilypond[fragment,raggedright,verbatim,quote]
+c'4^\markup { bla \bold bla }
+@end lilypond
-As a result, accidentals from one voice do not get canceled in other
-voices, which is often an unwanted result
+The @code{\markup} is described in more detail in
+@ref{Text markup}.
-@lilypond[quote,raggedright,relative=1,fragment,verbatim]
-\context Staff <<
- #(set-accidental-style 'voice)
- <<
- { es g } \\
- { c, e }
->> >>
-@end lilypond
-The @code{voice} option should be used 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
-@code{modern} or @code{modern-cautionary}
-should be used instead.
+@refcommands
-@item modern
-@cindex @code{modern} style accidentals
-This rule corresponds to the common practice in the 20th century. 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
+@cindex @code{\fatText}
+@code{\fatText},
+@cindex @code{\emptyText}
+@code{\emptyText}.
-@lilypond[quote,raggedright,fragment,verbatim]
-#(set-accidental-style 'modern)
-cis' c'' cis'2 | c'' c'
-@end lilypond
-@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
-@lilypond[quote,raggedright,fragment,verbatim]
-#(set-accidental-style 'modern-cautionary)
-cis' c'' cis'2 | c'' c'
+@seealso
+
+In this manual: @ref{Text markup}.
+
+Program reference: @internalsref{TextScript}.
+
+
+@node Text spanners
+@subsection Text spanners
+
+@cindex Text spanners
+
+Some performance indications, e.g., @i{rallentando} or @i{accelerando},
+are written as text and are extended over many measures with dotted
+lines. Such texts are created using text spanners; attach
+@code{\startTextSpan} and @code{\stopTextSpan} to the first and last
+notes of the spanner.
+
+The string to be printed, as well as the style, is set through object
+properties
+
+@lilypond[quote,raggedright,fragment,relative=1,verbatim]
+c1
+\textSpannerDown
+\override TextSpanner #'edge-text = #'("rall " . "")
+c2\startTextSpan b c\stopTextSpan a
@end lilypond
-@cindex @code{modern-voice}
-@item modern-voice
-This rule is used for multivoice accidentals to be read both by musicians
-playing one voice and musicians playing all voices. Accidentals are
-typeset for each voice, but they @emph{are} canceled across voices in
-the same @internalsref{Staff}.
+@refcommands
-@cindex @code{modern-voice-cautionary}
-@item modern-voice-cautionary
-This rule is the same as @code{modern-voice}, but with the extra
-accidentals (the ones not typeset by @code{voice}) typeset
-as cautionaries. Even though all accidentals typeset by
-@code{default} @emph{are} typeset by this variable,
-some of them are typeset as cautionaries.
+@cindex textSpannerUp
+@code{textSpannerUp},
+@cindex textSpannerDown
+@code{textSpannerDown},
+@cindex textSpannerNeutral
+@code{textSpannerNeutral}.
-@item piano
-@cindex @code{piano} accidentals
-This rule reflects 20th century practice for piano notation. Very similar to
-@code{modern} but accidentals also get canceled
-across the staves in the same @internalsref{GrandStaff} or
-@internalsref{PianoStaff}.
-@item piano-cautionary
-@cindex @code{#(set-accidental-style 'piano-cautionary)}
-Same as @code{#(set-accidental-style 'piano)} but with the extra
-accidentals typeset as cautionaries.
+@seealso
-@item no-reset
-@cindex @code{no-reset} accidental style
-This is the same as @code{default} but with accidentals lasting
-``forever'' and not only until the next measure
-@lilypond[quote,raggedright,fragment,verbatim,relative=1]
-#(set-accidental-style 'no-reset)
-c1 cis cis c
+Program reference: @internalsref{TextSpanner}.
+
+Examples: @inputfileref{input/@/regression,text@/-spanner@/.ly}.
+
+
+@node Text marks
+@subsection Text marks
+
+@cindex coda on bar line
+@cindex segno on bar line
+@cindex fermata on bar line
+@cindex bar lines, symbols on
+@cindex @code{\mark}
+
+The @code{\mark} command is primarily used for
+@internalsref{Rehearsal marks},
+but it can also be used to put signs like coda,
+segno, and fermata on a bar line. Use @code{\markup} to
+access the appropriate symbol
+
+@lilypond[fragment,quote,raggedright,verbatim,relative=2]
+c1 \mark \markup { \musicglyph #"scripts.ufermata" }
+c1
@end lilypond
-@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
+@noindent
+@code{\mark} is only typeset above the top stave of the score. If
+you specify the @code{\mark} command at a bar line, the resulting
+mark is placed above the bar line. If you specify it in the middle
+of a bar, the resulting mark is positioned between notes. If it is
+specified before the beginning of a score line, it is placed
+before the first note of the line. Finally, if the mark occurs at
+a line break, the mark will be printed at the
+beginning of the next line.
+@c IMO this is a bug; hopefully it'll be fixed soon, so I can
+@c delete this sentence. -gp
+If there is no next line, then the mark will not be printed at all.
-@lilypond[quote,raggedright,fragment,verbatim,relative=1]
-#(set-accidental-style 'forget)
-\key d\major c4 c cis cis d d dis dis
+
+@commonprop
+
+To print the mark at the end of the current line, use
+
+@example
+\override Score.RehearsalMark
+ #'break-visibility = #begin-of-line-invisible
+@end example
+
+@code{\mark} is often useful for adding text to the end of bar. In
+such cases, changing the @code{#'self-alignment} is very useful
+
+@lilypond[fragment,quote,raggedright,verbatim,relative=2]
+\override Score.RehearsalMark
+ #'break-visibility = #begin-of-line-invisible
+c1 c c c4 c c c
+\once \override Score.RehearsalMark #'self-alignment-X = #right
+\mark "D.S. al Fine "
@end lilypond
-@end table
@seealso
-Program reference: @internalsref{Accidental_engraver},
-@internalsref{Accidental}, and @internalsref{AccidentalPlacement}.
+Program reference: @internalsref{RehearsalMark}.
-@refbugs
+@node Text markup
+@subsection Text markup
-Simultaneous notes are considered to be entered in sequential
-mode. This means that in a chord the accidentals are typeset as if the
-notes in the chord happened once at a time - in the order in which
-they appear in the input file.
+@cindex markup
+@cindex text markup
+@cindex markup text
+@cindex typeset text
-This is a problem when accidentals in a chord depend on each other,
-which does not happen for the default accidental style. The problem
-can be solved by manually inserting @code{!} and @code{?} for the
-problematic notes.
+Use @code{\markup} to typeset text. Commands are entered with the
+backslash @code{\}.
+@lilypond[quote,verbatim,fragment,relative=1]
+c1^\markup { hello }
+c1_\markup { hi there }
+c1^\markup { hi \bold there, is \italic anyone home? }
+@end lilypond
-@node Expressive stuff
-@section Expressive stuff
+@noindent
+See @ref{Overview of text markup commands} for a list of all
+commands.
-Expressive marks help musicians to bring more to the music than simple
-notes and rhythms.
+@code{\markup} is primarily used for @internalsref{TextScript}s,
+but it can also be used anywhere text is called in lilypond
-@menu
-* Metronome marks::
-* Text scripts::
-* Text spanners::
-* Analysis brackets::
-@end menu
+@lilypond[quote,verbatim]
+\header{ title = \markup{ \bold { foo \italic { bar! } } } }
+\score{
+ \relative c'' {
+ \override Score.RehearsalMark
+ #'break-visibility = #begin-of-line-invisible
+ \override Score.RehearsalMark #'self-alignment-X = #right
+
+ \set Staff.instrument = \markup{ \column{ Alto solo } }
+ c2^\markup{ don't be \flat }
+ b2
+ a2\mark \markup{ \large \bold Fine }
+ r2
+ \bar "||"
+ }
+ \addlyrics { bar, foo \markup{ \italic bar! } }
+}
+@end lilypond
+@cindex font switching
-@node Metronome marks
-@subsection Metronome marks
+The markup in the example demonstrates font switching commands. The
+command @code{\bold} and @code{\italic} apply to the first following
+word only; to apply a command to more than one word, enclose the
+words with braces,
-@cindex Tempo
-@cindex beats per minute
-@cindex metronome marking
+@example
+\markup @{ \bold @{ hi there @} @}
+@end example
+
+@noindent
+For clarity, you can also do this for single arguments, e.g.,
-Metronome settings can be entered as follows
@example
-\tempo @var{duration} = @var{per-minute}
+\markup @{ is \italic @{ anyone @} home @}
@end example
-In the MIDI output, they are interpreted as a tempo change. In the
-layout output, a metronome marking is printed
-@cindex @code{\tempo}
-@lilypond[quote,raggedright,verbatim,fragment]
-\tempo 8.=120 c''1
+In markup mode you can compose expressions, similar to mathematical
+expressions, XML documents, and music expressions. You can stack
+expressions grouped vertically with the command @code{\column}.
+Similarly, @code{\center-align} aligns texts by their center lines:
+
+@lilypond[quote,verbatim,fragment,relative=1]
+c1^\markup { \column { a bbbb \line { c d } } }
+c1^\markup { \center-align { a bbbb c } }
+c1^\markup { \line { a b c } }
+@end lilypond
+
+Lists with no previous command are not kept distinct. The expression
+
+@example
+\center-align @{ @{ a b @} @{ c d @} @}
+@end example
+
+@noindent
+
+is equivalent to
+
+@example
+\center-align @{ a b c d @}
+@end example
+
+@noindent
+
+To keep lists of words distinct, please use quotes @code{"} or
+the @code{\line} command
+
+@lilypond[quote,verbatim,fragment,relative=1]
+\fatText
+c4^\markup{ \center-align { on three lines } }
+c4^\markup{ \center-align { "all one line" } }
+c4^\markup{ \center-align { { on three lines } } }
+c4^\markup{ \center-align { \line { on one line } } }
@end lilypond
+Markups can be stored in variables and these variables
+may be attached to notes, like
+@example
+allegro = \markup @{ \bold \large @{ Allegro @} @}
+ @{ a^\allegro b c d @}
+@end example
+
+Some objects have alignment procedures of their own, which cancel out
+any effects of alignments applied to their markup arguments as a
+whole. For example, the @internalsref{RehearsalMark} is horizontally
+centered, so using @code{\mark \markup @{ \left-align .. @}} has no
+effect.
+
+
@seealso
-Program reference: @internalsref{MetronomeChangeEvent}.
+This manual: @ref{Overview of text markup commands}.
+
+Program reference: @internalsref{TextScript}.
+
+Init files: @file{scm/@/new@/-markup@/.scm}.
+
@refbugs
-Collisions are not checked. If you have notes above the top line of
-the staff (or notes with articulations, slurs, text, etc), then the
-metronome marking may be printed on top of musical symbols. If this
-occurs, increase the padding of the metronome mark to place it
-further away from the staff.
+Kerning or generation of ligatures is only done when the @TeX{}
+backend is used. In this case, LilyPond does not account for them so
+texts will be spaced slightly too wide.
+
+Syntax errors for markup mode are confusing.
+
+
+@node Text encoding
+@subsection Text encoding
+
+LilyPond uses the Pango library to format multi-lingual texts, and
+does not perform any input-encoding conversions. This means that any
+text, be it title, lyric text, or musical instruction containing
+non-ASCII characters, must be utf-8. Easiest to enter such texts is
+by using a Unicode-aware editor, and save using utf-8 encoding. Most
+popular modern editors have utf-8 support, for example, vim, Emacs,
+jEdit, and GEdit do.
+
+Depending on the fonts installed, the following fragment shows Hebrew
+and Cyrillic lyrics,
+
+@cindex Cyrillic
+@cindex Hebrew
+@cindex ASCII, non
+
+@lilypondfile[fontload]{utf-8.ly}
+
+The @TeX{} backend does not handle encoding specially at all. Strings
+in the input are put in the output as-is. Extents of text items in the
+@TeX{} backend, are determined by reading a file created via the
+@file{texstr} backend,
@example
-\override Score.MetronomeMark #'padding = #2.5
+lilypond -b texstr input/les-nereides.ly
+latex les-nereides.texstr
@end example
+The last command produces @file{les-nereides.textmetrics}, which is
+read when you execute
-@node Text scripts
-@subsection Text scripts
-@cindex Text scripts
+@example
+lilypond -b tex input/les-nereides.ly
+@end example
-@cindex text items, non-empty
-@cindex non-empty texts
+Both @file{les-nereides.texstr} and @file{les-nereides.tex} need
+suitable LaTeX wrappers to load appropriate La@TeX{} packages for
+interpreting non-ASCII strings.
-It is possible to place arbitrary strings of text or markup text (see
-@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
-@lilypond[quote,fragment,raggedright,verbatim,relative=1]
-c4^"longtext" \fatText c4_"longlongtext" c4
+@seealso
+
+@inputfileref{input/regression,utf-8.ly}
+
+
+@node Nested scores
+@subsection Nested scores
+
+It is possible to nest music inside markups, by adding a @code{\score}
+block to a markup expression. Such a score must contain a @code{\layout}
+block.
+
+@lilypond[quote,verbatim,raggedright]
+\relative {
+ c4 d^\markup {
+ \score {
+ \relative { c4 d e f }
+ \layout { }
+ }
+ }
+ e f
+}
@end lilypond
-More complex formatting may also be added to a note by using the
-markup command,
-@lilypond[fragment,raggedright,verbatim,quote]
-c'4^\markup { bla \bold bla }
+
+@node Overview of text markup commands
+@subsection Overview of text markup commands
+
+The following commands can all be used inside @code{\markup @{ @}}.
+
+@include markup-commands.tely
+
+
+@node Selecting font sizes
+@subsection Selecting font sizes
+
+The easiest method of setting the font size of any context, is by
+setting the @code{fontSize} property.
+
+@lilypond[quote,fragment,relative=1,verbatim]
+c8
+\set fontSize = #-4
+c f
+\set fontSize = #3
+g
@end lilypond
-The @code{\markup} is described in more detail in
-@ref{Text markup}.
+@noindent
+It does not change the size of variable symbols, such as beams or
+slurs.
+
+Internally, the @code{fontSize} context property will cause the
+@code{font-size} property to be set in all layout objects. The value
+of @code{font-size} is a number indicating the size relative to the
+standard size for the current staff height. Each step up is an
+increase of approximately 12% of the font size. Six steps is exactly a
+factor two. The Scheme function @code{magstep} converts a
+@code{font-size} number to a scaling factor.
+
+@lilypond[quote,fragment,relative=1,verbatim]
+c8
+\override NoteHead #'font-size = #-4
+c f
+\override NoteHead #'font-size = #3
+g
+@end lilypond
+
+LilyPond has fonts in different design sizes. The music fonts for
+smaller sizes are chubbier, while the text fonts are relatively wider.
+Font size changes are achieved by scaling the design size that is
+closest to the desired size. The standard font size (for
+@code{font-size} equals 0), depends on the standard staff height. For
+a 20pt staff, a 10pt font is selected.
+The @code{font-size} property can only be set on layout objects that
+use fonts. These are the ones supporting the
+@internalsref{font-interface} layout interface.
@refcommands
-@cindex @code{\fatText}
-@code{\fatText},
-@cindex @code{\emptyText}
-@code{\emptyText}.
+The following commands set @code{fontSize} for the current voice:
+
+@cindex @code{\tiny}
+@code{\tiny},
+@cindex @code{\small}
+@code{\small},
+@cindex @code{\normalsize}
+@code{\normalsize}.
+
+
+@node Font selection
+@subsection Font selection
+
+@cindex font selection
+@cindex font magnification
+@cindex @code{font-interface}
+
+By setting the object properties described below, you can select a
+font from the preconfigured font families. LilyPond has default
+support for the feta music fonts and @TeX{}'s Computer Modern text
+fonts.
+
+@itemize @bullet
+@item @code{font-encoding}
+is a symbol that sets layout of the glyphs. This should only be set to
+select different types of non-text fonts, eg.
+
+@code{fetaBraces} for piano staff braces, @code{fetaMusic} the
+standard music font, including ancient glyphs, @code{fetaDynamic} for
+dynamic signs and @code{fetaNumber} for the number font.
+
+@item @code{font-family}
+is a symbol indicating the general class of the typeface. Supported are
+@code{roman} (Computer Modern), @code{sans}, and @code{typewriter}.
+
+@item @code{font-shape}
+is a symbol indicating the shape of the font. There are typically
+several font shapes available for each font family. Choices are
+@code{italic}, @code{caps}, and @code{upright}.
+
+@item @code{font-series}
+is a symbol indicating the series of the font. There are typically
+several font series for each font family and shape. Choices are
+@code{medium} and @code{bold}.
+
+@end itemize
+
+Fonts selected in the way sketched above come from a predefined style
+sheet. If you want to use a font from outside the style sheet,
+then set the
+@code{font-name} property,
+
+@lilypond[fragment,verbatim]
+{
+ \override Staff.TimeSignature #'font-name = #"Times"
+ \override Staff.TimeSignature #'font-size = #2
+ \time 3/4
+ c'1_\markup {
+ \override #'(font-name . "Vera Bold")
+ { This text is in Vera Bold }
+ }
+}
+@end lilypond
+
+@noindent
+Any font can be used, as long as it is available to Pango/FontConfig.
+
+The size of the font may be set with the @code{font-size}
+property. The resulting size is taken relative to the
+@code{text-font-size} as defined in the @code{\paper} block.
+
+@cindex font size
+@cindex font magnification
@seealso
-In this manual: @ref{Text markup}.
+Init files: @file{ly/@/declarations@/-init@/.ly} contains hints how new
+fonts may be added to LilyPond.
-Program reference: @internalsref{TextScriptEvent}, @internalsref{TextScript}.
+@node New dynamic marks
+@subsection New dynamic marks
-@node Text spanners
-@subsection Text spanners
-@cindex Text spanners
+It is possible to print new dynamic marks or text that should be aligned
+with dynamics. Use @code{make-dynamic-script} to create these marks.
-Some performance indications, e.g., @i{rallentando} or @i{accelerando},
-are written as text and are extended over many measures with dotted
-lines. Such texts are created using text spanners; attach
-@code{\startTextSpan} and @code{\stopTextSpan} to the first and last
-notes of the spanner.
+@cindex make-dynamic-script
-The string to be printed, as well as the style, is set through object
-properties
+@lilypond[quote,verbatim,raggedright]
+sfzp = #(make-dynamic-script "sfzp")
+\relative c' {
+ c4 c c\sfzp c
+}
+@end lilypond
-@lilypond[quote,raggedright,fragment,relative=1,verbatim]
-c1
-\override TextSpanner #'direction = #-1
-\override TextSpanner #'edge-text = #'("rall " . "")
-c2\startTextSpan b c\stopTextSpan a
+@cindex Dynamics, editorial
+@cindex Dynamics, parenthesis
+
+It is also possible to print dynamics in round parenthesis or square
+brackets. These are often used for adding editorial dynamics.
+
+@lilypond[quote,verbatim,raggedright]
+rndf = \markup{ \center-align {\line { \bold{\italic (}
+ \dynamic f \bold{\italic )} }} }
+boxf = \markup{ \bracket { \dynamic f } }
+{ c'1_\rndf c'1_\boxf }
@end lilypond
+@node Other text markup issues
+@subsection Other text markup issues
+
+To use a normal font within a title, you must define it manually
+
+@example
+#(def-markup-command (normal-font layout props arg) (markup?)
+ "Switch to normal text font"
+ (interpret-markup layout (cons '((font-series . 'medium) (font-shape . 'upright)) props) arg))
+
+\header@{
+ title = \markup@{ ABCD \normal-font ABCD @}
+@}
+@end example
+
+
+
+@node Preparing parts
+@section Preparing parts
+
+This section describes various notation that are useful for preparing
+individual parts.
+
+@menu
+* Multi measure rests::
+* Metronome marks::
+* Rehearsal marks::
+* Bar numbers::
+* Instrument names::
+* Instrument transpositions::
+* Ottava brackets::
+* Different editions from one source::
+@end menu
+
+
+@node Multi measure rests
+@subsection Multi measure rests
+
+@cindex multi measure rests
+@cindex Rests, multi measure
+@cindex whole rests for a full measure
+@cindex @code{R}
+
+Multi-measure rests are entered using `@code{R}'. It is specifically
+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
+multi-measure 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
+
+@lilypond[quote,raggedright,fragment,verbatim]
+\time 4/4 r1 | R1 | R1*2
+\set Score.skipBars = ##t R1*17 R1*4
+@end lilypond
+
+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
+
+@lilypond[quote,raggedright,fragment,verbatim]
+\set Score.skipBars = ##t
+\time 3/4
+R2. | R2.*2
+\time 13/8
+R1*13/8
+R1*13/8*12 |
+\time 10/8 R4*5*4 |
+@end lilypond
+
+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.
+
+If there are only a few measures of rest, LilyPond prints ``church rests''
+(a series of rectangles) in the staff. To replace that with a simple
+rest, use @code{MultiMeasureRest.expand-limit}.
+
+@lilypond[quote,raggedright,fragment,verbatim]
+\set Score.skipBars = ##t
+R1*2 | R1*5 | R1*9
+\override MultiMeasureRest #'expand-limit = 1
+R1*2 | R1*5 | R1*9
+@end lilypond
+
+@cindex text on multi-measure rest
+@cindex script on multi-measure rest
+@cindex fermata on multi-measure rest
+
+Texts can be added to multi-measure rests by using the
+@var{note}-@code{markup} syntax @ref{Text markup}.
+A variable (@code{\fermataMarkup}) is provided for
+adding fermatas
+
+@lilypond[quote,raggedright,verbatim,fragment]
+\set Score.skipBars = ##t
+\time 3/4
+R2.*10^\markup { \italic "ad lib." }
+R2.^\fermataMarkup
+@end lilypond
+
+If you want to have text on the left end of a multi-measure rest,
+attach the text to a zero-length skip note, i.e.,
+
+@example
+s1*0^"Allegro"
+R1*4
+@end example
+
+
@seealso
-Internals @internalsref{TextSpanEvent},
-@internalsref{TextSpanner}.
+Program reference: @internalsref{MultiMeasureRestMusicGroup},
+@internalsref{MultiMeasureRest}.
-Examples: @inputfileref{input/@/regression,text@/-spanner@/.ly}.
+The layout object @internalsref{MultiMeasureRestNumber} is for the
+default number, and @internalsref{MultiMeasureRestText} for user
+specified texts.
-@node Analysis brackets
-@subsection Analysis brackets
-@cindex brackets
-@cindex phrasing brackets
-@cindex musicological analysis
-@cindex note grouping bracket
+@refbugs
-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}
+It is not possible to use fingerings (e.g., @code{R1-4}) to put numbers
+over multi-measure rests. And the pitch of multi-measure rests (or
+staff-centered rests) can not be influenced.
-@lilypond[quote,raggedright,verbatim]
-\score {
- \relative c'' {
- c4\startGroup\startGroup
- c4\stopGroup
- c4\startGroup
- c4\stopGroup\stopGroup
- }
- \layout {
- \context {
- \Staff \consists "Horizontal_bracket_engraver"
-}}}
-@end lilypond
+@cindex condensing rests
-@seealso
+There is no way to automatically condense multiple rests into a single
+multi-measure rest. Multi-measure rests do not take part in rest
+collisions.
+
+Be careful when entering multi-measure rests followed by whole
+notes. The following will enter two notes lasting four measures each
+@example
+R1*4 cis cis
+@end example
+When @code{skipBars} is set, the result will look OK, but the bar
+numbering will be off.
-Program reference: @internalsref{HorizontalBracket},
-@internalsref{NoteGroupingEvent}.
-Examples: @inputfileref{input/@/regression,note@/-group@/-bracket@/.ly}.
+@node Metronome marks
+@subsection Metronome marks
+
+@cindex Tempo
+@cindex beats per minute
+@cindex metronome marking
+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. In the
+layout output, a metronome marking is printed
+@cindex @code{\tempo}
+@lilypond[quote,raggedright,verbatim,fragment]
+\tempo 8.=120 c''1
+@end lilypond
+@commonprop
+To change the tempo in the MIDI output without printing anything, make
+the metronome marking invisible
+@example
+\once \override Score.MetronomeMark #'transparent = ##t
+@end example
+To print other metronome markings, use these markup commands
+@lilypond[quote,raggedright,verbatim,relative,fragment]
+c4^\markup {
+ "("
+ \smaller \general-align #Y #DOWN \note #"16." #1
+ "="
+ \smaller \general-align #Y #DOWN \note #"8" #1"
+ ")" }
+@end lilypond
-@node Orchestral music
-@section Orchestral music
+@noindent
+See @ref{Text markup} for more details.
-@cindex Writing parts
-Orchestral music involves some special notation, both in the full
-score and the individual parts. This section explains how to tackle
-some common problems in orchestral music.
+@seealso
+Program reference: @internalsref{MetronomeMark}.
-@menu
-* Rehearsal marks::
-* Bar numbers::
-* Instrument names::
-* Instrument transpositions::
-* Multi measure rests::
-* Automatic part combining::
-* Hiding staves::
-* Different editions from one source::
-* Quoting other voices::
-* Formatting cue notes::
-@end menu
+@refbugs
+Collisions are not checked. If you have notes above the top line of
+the staff (or notes with articulations, slurs, text, etc), then the
+metronome marking may be printed on top of musical symbols. If this
+occurs, increase the padding of the metronome mark to place it
+further away from the staff.
+@example
+\override Score.MetronomeMark #'padding = #2.5
+@end example
@node Rehearsal marks
@subsection Rehearsal marks
+
@cindex Rehearsal marks
-@cindex mark
@cindex @code{\mark}
To print a rehearsal mark, use the @code{\mark} command
@noindent
(The letter@tie{}`I' is skipped in accordance with engraving traditions.)
-@c umm, is the manual the right place for feature requests? :) -gp
-@c FIXME - should make that tunable.
The mark is incremented automatically if you use @code{\mark
\default}, but you can also use an integer argument to set the mark
These can be used as inspiration for other formatting functions.
-@cindex coda on bar line
-@cindex segno on bar line
-@cindex fermata on bar line
-@cindex bar lines, symbols on
-
-The @code{\mark} command can also be used to put signs like coda,
-segno, and fermata on a bar line. Use @code{\markup} to
-access the appropriate symbol
-
-@lilypond[fragment,quote,raggedright,verbatim,relative=2]
-c1 \mark \markup { \musicglyph #"scripts.ufermata" }
-c1
-@end lilypond
-
-If the mark occurs at a line break, the mark will be printed at the
-beginning of the next line.
-@c IMO this is a bug; hopefully it'll be fixed soon, so I can
-@c delete this sentence. -gp
-If there is no next line, then the mark will not be printed at all.
-To print the mark at the end of the current line, use
-
-@example
-\override Score.RehearsalMark
- #'break-visibility = #begin-of-line-invisible
-@end example
-
-@cindex fermatas
-@cindex coda
-@cindex segno
-@cindex bar lines, putting symbols on
-
@seealso
-Program reference: @internalsref{MarkEvent}, @internalsref{RehearsalMark}.
+Program reference: @internalsref{RehearsalMark}.
Init files: @file{scm/@/translation@/-functions@/.scm} contains the
definition of @code{format-mark-numbers} and
@node Bar numbers
@subsection Bar numbers
-
@cindex Bar numbers
@cindex measure numbers
@cindex @code{currentBarNumber}
}
@end lilypond
+
@seealso
Program reference: @internalsref{BarNumber}.
@inputfileref{input/@/test,bar@/-number@/-every@/-five@/-reset@/.ly},
and @inputfileref{input/@/test,bar@/-number@/-regular@/-interval@/.ly}.
+
@refbugs
Bar numbers can collide with the @internalsref{StaffGroup} bracket, if
@code{padding} property of @internalsref{BarNumber} can be
used to position the number correctly.
+
@node Instrument names
@subsection Instrument names
brace is not taken into account. You must add extra spaces to the end of
the name to avoid a collision.
+
@node Instrument transpositions
@subsection Instrument transpositions
+@cindex transposition, MIDI
+@cindex transposition, instrument
+
The key of a transposing instrument can also be specified. This
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).
@end example
+@node Ottava brackets
+@subsection Ottava brackets
-@cindex transposition, MIDI
-@cindex transposition, instrument
-
+`Ottava' brackets introduce an extra transposition of an octave for
+the staff. They are created by invoking the function
+@code{set-octavation}
-@node Multi measure rests
-@subsection Multi measure rests
-@cindex multi measure rests
-@cindex Rests, multi measure
+@cindex ottava
+@cindex 15ma
+@cindex octavation
-@cindex @code{R}
+@lilypond[quote,raggedright,verbatim,fragment]
+\relative c''' {
+ a2 b
+ #(set-octavation 1)
+ a b
+ #(set-octavation 0)
+ a b
+}
+@end lilypond
-Multi-measure rests are entered using `@code{R}'. It is specifically
-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
-multi-measure 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
+The @code{set-octavation} function also takes -1 (for 8va bassa) and 2
+(for 15ma) as arguments. Internally the function sets the properties
+@code{ottavation} (e.g., to @code{"8va"}) and
+@code{centralCPosition}. For overriding the text of the bracket, set
+@code{ottavation} after invoking @code{set-octavation}, i.e.,
-@lilypond[quote,raggedright,fragment,verbatim]
-\time 4/4 r1 | R1 | R1*2
-\set Score.skipBars = ##t R1*17 R1*4
+@lilypond[quote,raggedright,verbatim]
+{
+ #(set-octavation 1)
+ \set Staff.ottavation = #"8"
+ c'''
+}
@end lilypond
-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
-@lilypond[quote,raggedright,fragment,verbatim]
-\set Score.skipBars = ##t
-\time 3/4
-R2. | R2.*2
-\time 13/8
-R1*13/8
-R1*13/8*12 |
-\time 10/8 R4*5*4 |
-@end lilypond
+@seealso
-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.
+Program reference: @internalsref{OttavaBracket}.
-If there are only a few measures of rest, LilyPond prints ``church rests''
-(a series of rectangles) in the staff. To replace that with a simple
-rest, use @code{MultiMeasureRest.expand-limit}.
+Examples: @inputfileref{input/@/regression,ottava@/.ly},
+@inputfileref{input/@/regression,ottava@/-broken@/.ly}.
-@lilypond[quote,raggedright,fragment,verbatim]
-\set Score.skipBars = ##t
-R1*2 | R1*5 | R1*9
-\override MultiMeasureRest #'expand-limit = 1
-R1*2 | R1*5 | R1*9
-@end lilypond
+@refbugs
-@cindex text on multi-measure rest
-@cindex script on multi-measure rest
-@cindex fermata on multi-measure rest
+@code{set-octavation} will get confused when clef changes happen
+during an octavation bracket.
-Texts can be added to multi-measure rests by using the
-@var{note}-@code{markup} syntax (see @ref{Text markup}).
-A variable (@code{\fermataMarkup}) is provided for
-adding fermatas
-@lilypond[quote,raggedright,verbatim,fragment]
-\set Score.skipBars = ##t
-\time 3/4
-R2.*10^\markup { \italic "ad lib." }
-R2.^\fermataMarkup
-@end lilypond
+@node Different editions from one source
+@subsection Different editions from one source
-If you want to have text on the left end of a multi-measure rest,
-attach the text to a zero-length skip note, i.e.,
+@cindex @code{\tag}
+@cindex tag
+
+The @code{\tag} command marks music expressions with a name. These
+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
+
+@example
+c1
+<<
+ \tag #'part <<
+ R1 \\
+ @{
+ \set fontSize = #-1
+ c4_"cue" f2 g4 @}
+ >>
+ \tag #'score R1
+>>
+c1
+@end example
+
+The same can be applied to articulations, texts, etc.: they are
+made by prepending
+@example
+-\tag #@var{your-tag}
+@end example
+to an articulation, for example,
+@example
+c1-\tag #'part ^4
+@end example
+This defines a note with a conditional fingering indication.
+
+@cindex keepWithTag
+@cindex removeWithTag
+By applying the @code{\keepWithTag} and @code{\removeWithTag}
+commands, tagged expressions can be filtered. For example,
@example
-s1*0^"Allegro"
-R1*4
+<<
+ @var{the music}
+ \keepWithTag #'score @var{the music}
+ \keepWithTag #'part @var{the music}
+>>
@end example
+would yield
+@lilypondfile[raggedright,quote]{tag-filter.ly}
+
+The argument of the @code{\tag} command should be a symbol, or a list
+of symbols, for example,
+@example
+\tag #'(original-part transposed-part) @dots{}
+@end example
-@cindex whole rests for a full measure
@seealso
-Program reference: @internalsref{MultiMeasureRestEvent},
-@internalsref{MultiMeasureTextEvent},
-@internalsref{MultiMeasureRestMusicGroup}, and
-@internalsref{MultiMeasureRest}.
+Examples: @inputfileref{input/@/regression,tag@/-filter@/.ly}.
-The layout object @internalsref{MultiMeasureRestNumber} is for the
-default number, and @internalsref{MultiMeasureRestText} for user
-specified texts.
@refbugs
-It is not possible to use fingerings (e.g., @code{R1-4}) to put numbers
-over multi-measure rests. And the pitch of multi-measure rests (or
-staff-centered rests) can not be influenced.
+Multiple rests are not merged if you create the score with both tagged
+sections.
+
-@cindex condensing rests
-There is no way to automatically condense multiple rests into a single
-multi-measure rest. Multi-measure rests do not take part in rest
-collisions.
+@node Orchestral music
+@section Orchestral music
+
+Orchestral music involves some special notation, both in the full
+score and the individual parts. This section explains how to tackle
+some common problems in orchestral music.
+
+@menu
+* Automatic part combining::
+* Hiding staves::
+* Quoting other voices::
+* Formatting cue notes::
+* Aligning to cadenzas::
+@end menu
-Be careful when entering multi-measure rests followed by whole
-notes. The following will enter two notes lasting four measures each
-@example
-R1*4 cis cis
-@end example
-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
@cindex automatic part combining
@cindex part combiner
-
Automatic part combining is used to merge two parts of music onto a
staff. It is aimed at typesetting orchestral scores. When the two
parts are identical for a period of time, only one is shown. In
@end example
-
The following example demonstrates the basic functionality of the part
combiner: putting parts on one staff, and setting stem directions and
polyphony
@seealso
-Program reference: @internalsref{PartCombineMusic},
-@internalsref{SoloOneEvent}, and
-@internalsref{SoloTwoEvent}, and
-@internalsref{UnisonoEvent}.
+Program reference: @internalsref{PartCombineMusic}.
@refbugs
differently named @internalsref{Voice} contexts, the events in those
will be ignored.
+
@node Hiding staves
@subsection Hiding staves
@cindex Hiding staves
In orchestral scores, staff lines that only have rests are usually
-removed. This saves some space. This style is called `French Score'.
+removed; this saves some space. This style is called `French Score'.
For @internalsref{Lyrics},
@internalsref{ChordNames} and @internalsref{FiguredBass}, this is
switched on by default. When the lines of these contexts turn out
@end lilypond
The first system shows all staves in full. If empty staves should be
-removed from the first system too, set @code{remove-first} to false in
+removed from the first system too, set @code{remove-first} to true in
@internalsref{RemoveEmptyVerticalGroup}.
-Another application is making ossia sections, i.e., alternative
-melodies on a separate piece of staff, with help of a Frenched
-staff. See @inputfileref{input/@/test,ossia@/.ly} for an example.
-
-
-@node Different editions from one source
-@subsection Different editions from one source
-
-@cindex tag
-The @code{\tag} command marks music expressions with a name. These
-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
-
-@example
-c1
-<<
- \tag #'part <<
- R1 \\
- @{
- \set fontSize = #-1
- c4_"cue" f2 g4 @}
- >>
- \tag #'score R1
->>
-c1
-@end example
-
-The same can be applied to articulations, texts, etc.: they are
-made by prepending
-@example
--\tag #@var{your-tag}
-@end example
-to an articulation, for example,
-@example
-c1-\tag #'part ^4
-@end example
-
-This defines a note with a conditional fingering indication.
-
-@cindex keepWithTag
-@cindex removeWithTag
-By applying the @code{\keepWithTag} and @code{\removeWithTag}
-commands, tagged expressions can be filtered. For example,
-@example
-<<
- @var{the music}
- \keepWithTag #'score @var{the music}
- \keepWithTag #'part @var{the music}
->>
-@end example
-would yield
-
-@lilypondfile[raggedright,quote]{tag-filter.ly}
-
-
-The argument of the @code{\tag} command should be a symbol, or a list
-of symbols, for example,
@example
-\tag #'(original-part transposed-part) @dots{}
+\override Score.RemoveEmptyVerticalGroup #'remove-first = ##t
@end example
+To remove other types of contexts, use @code{\AncientRemoveEmptyStaffContext}
+or @code{\RemoveEmptyRhythmicStaffContext}.
+Another application is making ossia sections, i.e., alternative
+melodies on a separate piece of staff, with help of a Frenched
+staff. See @inputfileref{input/@/test,ossia@/.ly} for an example.
-@seealso
-
-Examples: @inputfileref{input/@/regression,tag@/-filter@/.ly}.
-
-@refbugs
-
-Multiple rests are not merged if you create the score with both tagged
-sections.
-
@node Quoting other voices
@subsection Quoting other voices
Program reference: @internalsref{QuoteMusic}.
+
@node Formatting cue notes
@subsection Formatting cue notes
@end itemize
+@node Aligning to cadenzas
+@subsection Aligning to cadenzas
+
+In an orchestral context, cadenzas present a special problem:
+when constructing a score that includes a cadenza, all other
+instruments should skip just as many notes as the length of the
+cadenza, otherwise they will start too soon or too late.
+
+A solution to this problem are the functions @code{mmrest-of-length}
+and @code{skip-of-length}. These Scheme functions take a piece of music
+as argument, and generate a @code{\skip} or multi-rest, exactly as
+long as the piece. The use of @code{mmrest-of-length} is demonstrated
+in the following example.
+
+@lilypond[verbatim,raggedright,quote]
+cadenza = \relative c' {
+ c4 d8 << { e f g } \\ { d4. } >>
+ g4 f2 g4 g
+}
+
+\new GrandStaff <<
+ \new Staff { \cadenza c'4 }
+ \new Staff {
+ #(ly:export (mmrest-of-length cadenza))
+ c'4
+ }
+>>
+@end lilypond
+
@menu
* Polymetric notation::
+* Time administration::
* Clusters::
* Special fermatas::
+* Special noteheads::
* Feathered beams::
* Improvisation::
@end menu
+
@node Polymetric notation
@subsection Polymetric notation
each staff but replacing it manually using
@code{timeSignatureFraction} to the desired fraction. Then the printed
durations in each staff are scaled to the common time signature.
-The latter is done with @code{\compressmusic}, which is similar to
+The latter is done with @code{\compressMusic}, which is similar to
@code{\times}, but does not create a tuplet bracket.
\new Staff {
\time 3/4
\set Staff.timeSignatureFraction = #'(9 . 8)
- \compressmusic #'(2 . 3)
+ \compressMusic #'(2 . 3)
\repeat unfold 6 { c8[ c c] }
}
\new Staff {
\time 3/4
\set Staff.timeSignatureFraction = #'(10 . 8)
- \compressmusic #'(3 . 5) {
+ \compressMusic #'(3 . 5) {
\repeat unfold 2 { c8[ c c] }
\repeat unfold 2 { c8[ c] }
| c4. c4. \times 2/3 { c8 c c } c4
aligned vertically, but bar lines distort the regular spacing.
+@node Time administration
+@subsection Time administration
+
+@cindex Time administration
+
+Time is administered by the @internalsref{Time_signature_engraver},
+which usually lives in the @internalsref{Score} context. The
+bookkeeping deals with the following variables
+
+@table @code
+@item currentBarNumber
+The measure number.
+
+@item measureLength
+The length of the measures in the current time signature. For a 4/4
+time this is@tie{}1, and for 6/8 it is 3/4.
+
+@item measurePosition
+The point within the measure where we currently are. This quantity
+is reset to@tie{}0 whenever it exceeds @code{measureLength}. When that
+happens, @code{currentBarNumber} is incremented.
+
+@item timing
+If set to true, the above variables are updated for every time
+step. When set to false, the engraver stays in the current measure
+indefinitely.
+@end table
+
+Timing can be changed by setting any of these variables explicitly.
+In the next example, the 4/4 time signature is printed, but
+@code{measureLength} is set to 5/4. After a while, the measure is
+shortened by 1/8, by setting @code{measurePosition} to 7/8 at 2/4
+in the measure, so the next bar line will fall at 2/4 + 3/8. The
+3/8 arises because 5/4 normally has 10/8, but we have manually
+set the measure position to be 7/8 and 10/8 - 7/8 = 3/8.
+
+@lilypond[quote,raggedright,verbatim,relative,fragment]
+\set Score.measureLength = #(ly:make-moment 5 4)
+c1 c4
+c1 c4
+c4 c4
+\set Score.measurePosition = #(ly:make-moment 7 8)
+b8 b b
+c4 c1
+@end lilypond
+
+
@node Clusters
@subsection Clusters
Program reference: @internalsref{ClusterSpanner},
@internalsref{ClusterSpannerBeacon},
-@internalsref{Cluster_spanner_engraver}, and
-@internalsref{ClusterNoteEvent}.
+@internalsref{Cluster_spanner_engraver}.
Examples: @inputfileref{input/@/regression,cluster@/.ly}.
See @ref{Articulations} for general instructions how to apply scripts
such as fermatas to notes.
+
+@node Special noteheads
+@subsection Special noteheads
+
+Different noteheads are used by various instruments for various
+meanings -- crosses are used for ``parlato'' with vocalists, stopped
+notes on guitar; diamonds are used for harmonics on string instruments,
+etc. There is a shorthand (@code{\harmonic}) for diamond shapes; the
+other notehead styles are produced by tweaking the property
+
+@lilypond[raggedright,relative=1,fragment,verbatim,quote]
+c4 d
+\override NoteHead #'style = #'cross
+e f
+\revert NoteHead #'style
+e d <c f\harmonic> <d a'\harmonic>
+@end lilypond
+
+@noindent
+To see all notehead styles, please see
+@inputfileref{input/@/regression,note@/-head@/-style@/.ly}.
+
+
+@seealso
+
+Program reference: @internalsref{NoteHead}.
+
+
@node Feathered beams
@subsection Feathered beams
forcing two beams to overlap. Here is an example,
@c don't change relative setting witout changing positions!
-@lilypond[raggedright,relative=1,fragment,verbatim]
+@lilypond[raggedright,relative=1,fragment,verbatim,quote]
\new Staff <<
\new Voice
{
* Hidden notes::
* Shaped note heads ::
* Easy Notation note heads::
+* Analysis brackets::
+* Coloring objects::
@end menu
@node Balloon help
@code{\setEasyHeads}
-@node Other stuff
-@section Other stuff
-
-This is a temporary placeholder for stuff that's being moved to Advanced.
-It's just here so that somebody doesn't build the docs and then email me
-to complain that I've lost some doc sections. :)
+@node Analysis brackets
+@subsection Analysis brackets
+@cindex brackets
+@cindex phrasing brackets
+@cindex musicological analysis
+@cindex note grouping bracket
-@menu
-* Aligning to cadenzas::
-* Stems::
-* Transpose::
-* Ottava brackets::
-* Time administration::
-* Controlling formatting of prefatory matter::
-* Setting automatic beam behavior::
-* Beam formatting::
-@end menu
+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}
+@lilypond[quote,raggedright,verbatim]
+\score {
+ \relative c'' {
+ c4\startGroup\startGroup
+ c4\stopGroup
+ c4\startGroup
+ c4\stopGroup\stopGroup
+ }
+ \layout {
+ \context {
+ \Staff \consists "Horizontal_bracket_engraver"
+}}}
+@end lilypond
-@node Aligning to cadenzas
-@subsection Aligning to cadenzas
+@seealso
+Program reference: @internalsref{HorizontalBracket}.
-In an orchestral context, cadenzas present a special problem:
-when constructing a score that includes a cadenza, all other
-instruments should skip just as many notes as the length of the
-cadenza, otherwise they will start too soon or too late.
+Examples: @inputfileref{input/@/regression,note@/-group@/-bracket@/.ly}.
-A solution to this problem are the functions @code{mmrest-of-length}
-and @code{skip-of-length}. These Scheme functions take a piece of music
-as argument, and generate a @code{\skip} or multi-rest, exactly as
-long as the piece. The use of @code{mmrest-of-length} is demonstrated
-in the following example.
-@lilypond[verbatim,raggedright,quote]
-cadenza = \relative c' {
- c4 d8 << { e f g } \\ { d4. } >>
- g4 f2 g4 g
-}
-\new GrandStaff <<
- \new Staff { \cadenza c'4 }
- \new Staff {
- #(ly:export (mmrest-of-length cadenza))
- c'4
- }
->>
-@end lilypond
+@ignore
+I don't think we need this info.
-@node Stems
-@subsection Stems
+@n ode Stems
+@s ubsection Stems
Whenever a note is found, a @internalsref{Stem} object is created
automatically. For whole notes and rests, they are also created but
@cindex @code{\stemNeutral}
@code{\stemNeutral}.
+@end ignore
-@node Transpose
-@subsection Transpose
-@cindex Transpose
-@cindex transposition of pitches
-@cindex @code{\transpose}
-A music expression can be transposed with @code{\transpose}. The
-syntax is
+@node Coloring objects
+@subsection Coloring objects
+
+@c FIXME: need link to missing list of colors
+Individual objects may be assigned colors. You may use color names
+listed HERE
+
+@lilypond[quote,raggedright,verbatim,fragment]
+\override NoteHead #'color = #red
+c4 c
+\override NoteHead #'color = #(x11-color 'LimeGreen)
+d
+\override Stem #'color = #blue
+e
+@end lilypond
+
+The full range of colors defined for X11 can be accessed by using the
+scheme function x11-color. The function takes one argument that can be a
+symbol
+
@example
-\transpose @var{from} @var{to} @var{musicexpr}
+\override Beam #'color = #(x11-color 'MediumTurquoise)
@end example
-This means that @var{musicexpr} is transposed by the interval between
-the pitches @var{from} and @var{to}: any note with pitch @code{from}
-is changed to @code{to}.
+or a string
-
-For example, consider a piece written in the key of D-major. If
-this piece is a little too low for its performer, it can be
-transposed up to E-major with
@example
-\transpose d e @dots{}
+\override Beam #'color = #(x11-color "MediumTurquoise")
@end example
-Consider a part written for violin (a C instrument). If
-this part is to be played on the A clarinet, the following
-transposition will produce the appropriate part
+The first form is quicker to write and is more efficient. However, using
+the second form it is possible to access X11 colors by the multi-word
+form of its name
@example
-\transpose a c @dots{}
+\override Beam #'color = #(x11-color "medium turquoise")
@end example
-@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
+If x11-color cannot make sense of the parameter then the color returned
+defaults to black. It should be obvious from the final score that
+something is wrong.
+
+This example, illustrates the use of x11-color. Notice that the stem
+color remains black after being set to (x11-color 'Boggle), which is
+deliberate nonsense.
@lilypond[quote,raggedright,verbatim]
-mus = { \key d \major cis d fis g }
-\context Staff {
- \clef "F" \mus
- \clef "G"
- \transpose c g' \mus
- \transpose c f' \mus
+{
+ \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
+ \set Staff.instrument = \markup {
+ \with-color #(x11-color 'navy) "Clarinet"
+ }
+ \time 2/4
+ gis''8 a''
+ \override Beam #'color = #(x11-color "medium turquoise")
+ gis'' a''
+ \override NoteHead #'color = #(x11-color "LimeGreen")
+ gis'' a''
+ \override Stem #'color = #(x11-color 'Boggle)
+ gis'' a''
}
@end lilypond
-@code{\transpose} may also be used to input written notes for a
-transposing instrument. Pitches are normally entered into LilyPond
-in C (or ``concert pitch''), but they may be entered in another
-key. For example, when entering music for a B-flat trumpet which
-begins on concert D, one would write
-
-@example
-\transpose c bes @{ e4 @dots{} @}
-@end example
-To print this music in B-flat again (ie producing a trumpet part,
-instead of a concert pitch conductor's score) you would wrap the
-existing music with another @code{transpose}
+@refbugs
+Not all x11 colors are distinguishable in a web browser. For web use
+normal colors are recommended.
-@example
-\transpose bes c @{ \transpose c bes @{ e4 @dots{} @} @}
-@end example
+An x11 color is not necessarily exactly the same shade as a similarly
+named normal color.
@seealso
-Program reference: @internalsref{TransposedMusic}, and
-@internalsref{UntransposableMusic}.
+COLORLIST
-@refbugs
-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}.
+@node Automatic notation
+@section Automatic notation
-@node Ottava brackets
-@subsection Ottava brackets
+This section describes how to change the way that accidentals and
+beams are automatically displayed.
-`Ottava' brackets introduce an extra transposition of an octave for
-the staff. They are created by invoking the function
-@code{set-octavation}
+FIXME: this might get moved into Changing Defaults. Please send
+opinions to lilypond-devel. Thanks! :)
-@cindex ottava
-@cindex 15ma
-@cindex octavation
+@menu
+* Automatic accidentals::
+* Setting automatic beam behavior::
+@end menu
-@lilypond[quote,raggedright,verbatim,fragment]
-\relative c''' {
- a2 b
- #(set-octavation 1)
- a b
- #(set-octavation 0)
- a b
-}
-@end lilypond
+@node Automatic accidentals
+@subsection Automatic accidentals
+@cindex Automatic accidentals
-The @code{set-octavation} function also takes -1 (for 8va bassa) and 2
-(for 15ma) as arguments. Internally the function sets the properties
-@code{ottavation} (e.g., to @code{"8va"}) and
-@code{centralCPosition}. For overriding the text of the bracket, set
-@code{ottavation} after invoking @code{set-octavation}, i.e.,
+Common rules for typesetting accidentals have been placed in a
+function. This function is called as follows
-@lilypond[quote,raggedright,verbatim]
-{
- #(set-octavation 1)
- \set Staff.ottavation = #"8"
- c'''
-}
-@end lilypond
+@cindex @code{set-accidental-style}
+@example
+#(set-accidental-style 'STYLE #('CONTEXT#))
+@end example
-@seealso
+The function can take two arguments: the name of the accidental style,
+and an optional argument that denotes the context that should be
+changed. If no context name is supplied, @code{Staff} is the default,
+but you may wish to apply the accidental style to a single @code{Voice}
+instead.
-Program reference: @internalsref{OttavaBracket}.
+The following accidental styles are supported
+@table @code
+@item default
+This is the default typesetting behavior. It corresponds
+to 18th century common practice: Accidentals are
+remembered to the end of the measure in which they occur and
+only on their own octave.
-Examples: @inputfileref{input/@/regression,ottava@/.ly},
-@inputfileref{input/@/regression,ottava@/-broken@/.ly}.
+@item voice
+The normal behavior is to remember the accidentals on
+Staff-level. This variable, however, typesets accidentals
+individually for each voice. Apart from that, the rule is similar to
+@code{default}.
-@refbugs
+As a result, accidentals from one voice do not get canceled in other
+voices, which is often an unwanted result
-@code{set-octavation} will get confused when clef changes happen
-during an octavation bracket.
+@lilypond[quote,raggedright,relative=1,fragment,verbatim]
+\context Staff <<
+ #(set-accidental-style 'voice)
+ <<
+ { es g } \\
+ { c, e }
+>> >>
+@end lilypond
+The @code{voice} option should be used 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
+@code{modern} or @code{modern-cautionary}
+should be used instead.
-@node Time administration
-@subsection Time administration
+@item modern
+@cindex @code{modern} style accidentals
+This rule corresponds to the common practice in the 20th century. 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
-Time is administered by the @internalsref{Time_signature_engraver},
-which usually lives in the @internalsref{Score} context.
-The bookkeeping deals with the following variables
+@lilypond[quote,raggedright,fragment,verbatim]
+#(set-accidental-style 'modern)
+cis' c'' cis'2 | c'' c'
+@end lilypond
-@table @code
-@item currentBarNumber
-The measure number.
+@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
+@lilypond[quote,raggedright,fragment,verbatim]
+#(set-accidental-style 'modern-cautionary)
+cis' c'' cis'2 | c'' c'
+@end lilypond
-@item measureLength
-The length of the measures in the current time signature. For a 4/4
-time this is@tie{}1, and for 6/8 it is 3/4.
+@cindex @code{modern-voice}
+@item modern-voice
+This rule is used for multivoice accidentals to be read both by musicians
+playing one voice and musicians playing all voices. Accidentals are
+typeset for each voice, but they @emph{are} canceled across voices in
+the same @internalsref{Staff}.
-@item measurePosition
-The point within the measure where we currently are. This quantity
-is reset to@tie{}0 whenever it exceeds @code{measureLength}. When that
-happens, @code{currentBarNumber} is incremented.
+@cindex @code{modern-voice-cautionary}
+@item modern-voice-cautionary
+This rule is the same as @code{modern-voice}, but with the extra
+accidentals (the ones not typeset by @code{voice}) typeset
+as cautionaries. Even though all accidentals typeset by
+@code{default} @emph{are} typeset by this variable,
+some of them are typeset as cautionaries.
-@item timing
-If set to true, the above variables are updated for every time
-step. When set to false, the engraver stays in the current measure
-indefinitely.
-@end table
+@item piano
+@cindex @code{piano} accidentals
+This rule reflects 20th century practice for piano notation. Very similar to
+@code{modern} but accidentals also get canceled
+across the staves in the same @internalsref{GrandStaff} or
+@internalsref{PianoStaff}.
-Timing can be changed by setting any of these variables explicitly.
-In the next example, the 4/4 time signature is printed, but
-@code{measureLength} is set to 5/4. After a while, the measure is
-shortened by 1/8, by setting @code{measurePosition} to 7/8 at 2/4
-in the measure, so the next bar line will fall at 2/4 + 3/8. The
-3/8 arises because 5/4 normally has 10/8, but we have manually
-set the measure position to be 7/8 and 10/8 - 7/8 = 3/8.
+@item piano-cautionary
+@cindex @code{#(set-accidental-style 'piano-cautionary)}
+Same as @code{#(set-accidental-style 'piano)} but with the extra
+accidentals typeset as cautionaries.
-@lilypond[quote,raggedright,verbatim,relative,fragment]
-\set Score.measureLength = #(ly:make-moment 5 4)
-c1 c4
-c1 c4
-c4 c4
-\set Score.measurePosition = #(ly:make-moment 7 8)
-b8 b b
-c4 c1
+@item no-reset
+@cindex @code{no-reset} accidental style
+This is the same as @code{default} but with accidentals lasting
+``forever'' and not only until the next measure
+@lilypond[quote,raggedright,fragment,verbatim,relative=1]
+#(set-accidental-style 'no-reset)
+c1 cis cis c
+@end lilypond
+
+@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
+
+@lilypond[quote,raggedright,fragment,verbatim,relative=1]
+#(set-accidental-style 'forget)
+\key d\major c4 c cis cis d d dis dis
@end lilypond
+@end table
+
+@seealso
-@node Controlling formatting of prefatory matter
-@subsection Controlling formatting of prefatory matter
+Program reference: @internalsref{Accidental_engraver},
+@internalsref{Accidental}, and @internalsref{AccidentalPlacement}.
-@c This section will be moved to somewhere else soon. -gp
-This example demonstrates how to place prefatory matter
-(such as the clef and key signature) at the end of a line.
-@lilypond[quote,verbatim]
-\transpose c c' {
- \override Staff.Clef
- #'break-visibility = #end-of-line-visible
- \override Staff.KeySignature
- #'break-visibility = #end-of-line-visible
- \set Staff.explicitClefVisibility = #end-of-line-visible
- \set Staff.explicitKeySignatureVisibility = #end-of-line-visible
-
- % We want the time sig to take space, otherwise there is not
- % enough white at the start of the line.
-
- \override Staff.TimeSignature #'transparent = ##t
- \set Score.defaultBarType = #"empty"
-
- c1 d e f g a b c
- \key d \major
- \break
-
- % see above.
- \time 4/4
-
- d e fis g a b cis d
- \key g \major
- \break
- \time 4/4
-}
-@end lilypond
+@refbugs
+
+Simultaneous notes are considered to be entered in sequential
+mode. This means that in a chord the accidentals are typeset as if the
+notes in the chord happened once at a time - in the order in which
+they appear in the input file.
+
+This is a problem when accidentals in a chord depend on each other,
+which does not happen for the default accidental style. The problem
+can be solved by manually inserting @code{!} and @code{?} for the
+problematic notes.
@node Setting automatic beam behavior
equal to @code{override-auto-beam-setting} with the argument
@var{context} set to @code{'Score}.
-For example, if automatic beams should end on every quarter note, use
+For example, if automatic beams should end on the first quarter note, use
the following
@example
#(override-auto-beam-setting '(end * * * *) 1 4 'Staff)
Since the duration of a quarter note is 1/4 of a whole note, it is
entered as @code{(ly:make-moment 1 4)}.
+If automatic beams should end on every quarter in 5/4 time, specify
+all endings
+@example
+#(override-auto-beam-setting '(end * * * *) 1 4 'Staff)
+#(override-auto-beam-setting '(end * * * *) 1 2 'Staff)
+#(override-auto-beam-setting '(end * * * *) 3 4 'Staff)
+#(override-auto-beam-setting '(end * * * *) 5 4 'Staff)
+@dots{}
+@end example
+
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
#(override-auto-beam-setting '(end * * * *) 3 8)
+#(override-auto-beam-setting '(end * * * *) 1 2)
+#(override-auto-beam-setting '(end * * * *) 7 8)
@end example
In 4/4 time signature, this means that automatic beams could end only on
3/8 and on the fourth beat of the measure (after 3/4, that is 2 times
to beams with 32nd notes (and no shorter notes), use @code{(end 1 32 *
*)}.
+For example,
+
+@lilypond[quote,raggedright,relative=2,fragment,verbatim]
+\time 5/8
+#(override-auto-beam-setting '(end * * 5 8) 2 8)
+c8 c d d d
+\time 4/4
+e8 e f f e e d d
+\time 5/8
+c8 c d d d
+@end lilypond
+
@cindex automatic beam generation
@cindex autobeam
@cindex @code{autoBeaming}
>>}. If a polyphonic voice ends while an automatic beam is still
accepting notes, it is not typeset.
-The rules for ending a beam depend on the shortest note in a beam.
-So, while it is possible to have different ending rules for eight
-beams and sixteenth beams, a beam that contains both eight and
-sixteenth notes will use the rules for the sixteenth beam.
-
-In the example below, the autobeamer makes eighth beams and sixteenth
-end at three eighths. The third beam can only be corrected by
-specifying manual beaming.
-
-@lilypond[quote,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
-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}.
-
-@node Beam formatting
-@subsection Beam formatting
-
-
-When a beam falls in the middle of the staff, the beams point normally
-down. However, this behaviour can be altered with the
-@code{neutral-direction} property.
-
-
-@lilypond[quote,raggedright,relative=2,fragment,verbatim]
-{
- b8[ b]
- \override Beam #'neutral-direction = #-1
- b[ b]
- \override Beam #'neutral-direction = #1
- b[ b]
-}
-@end lilypond