]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/advanced-notation.itely
* Documentation/user/instrument-notation.itely (Laissez vibrer
[lilypond.git] / Documentation / user / advanced-notation.itely
index cf12df8db7e5d9a07b9f906ee528ceb741041ca2..9d4a2e62f42320641e0a463c612ff4b98cb9a345 100644 (file)
@@ -1,4 +1,4 @@
-@c -*- coding: latin-1; mode: texinfo; -*-
+@c -*- coding: utf-8; mode: texinfo; -*-
 @c This file is part of lilypond.tely
 
 @c A menu is needed before every deeper *section nesting of @node's; run 
@@ -38,7 +38,6 @@ your scores.
 * Overview of text markup commands::  
 * Font selection::              
 * New dynamic marks::           
-* Other text markup issues::    
 @end menu
 
 
@@ -102,6 +101,10 @@ c1
 \textSpannerDown
 \override TextSpanner #'edge-text = #'("rall " . "")
 c2\startTextSpan b c\stopTextSpan a
+\break
+\textSpannerUp
+\override TextSpanner #'edge-text = #(cons (markup #:italic "rit" ) "")
+c2\startTextSpan b c\stopTextSpan a
 @end lilypond
 
 @refcommands
@@ -215,15 +218,24 @@ but it can also be used anywhere text is called in lilypond
 
     \set Staff.instrument = \markup{ \column{ Alto solo } }
     c2^\markup{ don't be \flat }
-    b2
+    \override TextSpanner #'edge-text = #(cons (markup #:italic "rit" ) "")
+    b2\startTextSpan
     a2\mark \markup{ \large \bold Fine }
-    r2
+    r2\stopTextSpan
     \bar "||"
   }
   \addlyrics { bar, foo \markup{ \italic bar! } }
 }
 @end lilypond
 
+Text can also be placed on its own, away from any @code{\score}
+block.  This is primarily used in a @code{\book} (see
+@ref{Multiple movements}).
+
+@lilypond[quote,raggedright,verbatim]
+\markup{ Here is some text. }
+@end lilypond
+
 @cindex font switching
 
 The markup in the example demonstrates font switching commands.  The
@@ -293,6 +305,19 @@ whole.  For example, the @internalsref{RehearsalMark} is horizontally
 centered, so using @code{\mark \markup @{ \left-align .. @}} has no
 effect.
 
+In addition, vertical placement is performed after creating the
+text markup object.  If you wish to move an entire piece of markup,
+you need to use the #'padding property or create an "anchor" point
+inside the markup (generally with @code{\hspace #0}).
+
+@lilypond[quote,verbatim,fragment,relative=1]
+\fatText
+c'4^\markup{ \raise #5 "not raised" }
+\once \override TextScript #'padding = #3
+c'4^\markup{ raised }
+c'4^\markup{ \hspace #0 \raise #1.5 raised }
+@end lilypond
+
 
 @seealso
 
@@ -434,7 +459,7 @@ then set the
 
 @lilypond[fragment,verbatim]
 {
-  \override Staff.TimeSignature #'font-name = #"Times"
+  \override Staff.TimeSignature #'font-name = #"Charter"
   \override Staff.TimeSignature #'font-size = #2
   \time 3/4
   c'1_\markup {
@@ -454,11 +479,41 @@ property. The resulting size is taken relative to the
 @cindex font size
 @cindex font magnification
 
+
+It is also possible to change the default font family for the entire
+document. This is done by calling the @code{make-pango-font-tree} from
+within the @code{\paper} block. The function takes names for the font
+families to use for roman, sans serif and monospaced text. For
+example,
+
+@cindex font families, setting
+@cindex Pango
+
+
+@lilypond[verbatim]
+\paper  {
+  myStaffSize = #20
+  
+  #(define fonts
+    (make-pango-font-tree "Times New Roman"
+                          "Nimbus Sans"
+                          "Luxi Mono"
+                           (/ myStaffSize 20)))
+}
+
+{
+  c'^\markup { roman: foo \sans bla \typewriter bar }
+}
+@end lilypond
+
+@c we don't do Helvetica / Courier, since GS incorrectly loads
+@c Apple TTF fonts  
+
+
+
 @seealso
 
-@c FIXME.
-Init files: @file{ly/@/declarations@/-init@/.ly} contains hints how new
-fonts may be added to LilyPond.
+Examples: @file{ly/@/font@/-family@/-override.ly}
 
 
 @node New dynamic marks
@@ -490,22 +545,6 @@ boxf = \markup{ \bracket { \dynamic f } }
 @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
@@ -529,13 +568,15 @@ individual parts.
 @subsection Multi measure rests
 
 @cindex multi measure rests
+@cindex full measure rests
 @cindex Rests, multi measure
+@cindex Rests, full 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
+Rests for one full measure (or many bars) 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
@@ -589,6 +630,16 @@ R2.*10^\markup { \italic "ad lib." }
 R2.^\fermataMarkup
 @end lilypond
 
+Warning!  This text is created by @code{MultiMeasureRestText}, not
+@code{TextScript}.
+
+@lilypond[quote,raggedright,verbatim,fragment]
+\override TextScript #'padding = #5
+R1^"low"
+\override MultiMeasureRestText #'padding = #5
+R1^"high"
+@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.,
 
@@ -660,11 +711,11 @@ the metronome marking invisible
 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"
-  ")" }
+  =
+  \smaller \general-align #Y #DOWN \note #"8" #1
+  ) }
 @end lilypond
 
 @noindent
@@ -706,7 +757,12 @@ c1 \mark \default
 @end lilypond
 
 @noindent
-(The letter@tie{}`I' is skipped in accordance with engraving traditions.)
+The letter@tie{}`I' is skipped in accordance with engraving traditions.
+If you wish to include the letter `I', then use
+
+@example
+\set Score.markFormatter = #format-mark-alphabet
+@end example
 
 The mark is incremented automatically if you use @code{\mark
 \default}, but you can also use an integer argument to set the mark
@@ -841,6 +897,24 @@ names, for example
 c''1
 @end lilypond
 
+If you wish to center the instrument names, you must center all of them
+
+@lilypond[quote,verbatim,raggedright]
+{ <<
+\new Staff {
+  \set Staff.instrument = \markup {
+    \center-align { "Clarinetti"
+      \line { "in B" \smaller \flat } } }
+  c''1
+}
+\new Staff {
+  \set Staff.instrument = \markup{ \center-align { Vibraphone }}
+  c''1
+}
+>>
+}
+@end lilypond
+
 For longer instrument names, it may be useful to increase the
 @code{indent} setting in the @code{\layout} block.
 
@@ -851,8 +925,12 @@ Program reference: @internalsref{InstrumentName}.
 @refbugs
 
 When you put a name on a grand staff or piano staff, the width of the
-brace is not taken into account.  You must add extra spaces to the end of
-the name to avoid a collision.
+brace is not taken into account. The following property setting can be
+used to move the instrument names to the left, in such situations.
+
+@example
+\override Score.InstrumentName #'space-alist = #'((left-edge extra-space . 2.0))
+@end example
 
 
 @node Instrument transpositions
@@ -1354,7 +1432,7 @@ Cue notes have smaller font sizes.
  when the original part takes over again, this should be marked with
  the name of the original instrument.
 
- @c really?  Are you sure about that last point?  I'll check after 3.0 -gp
+@c really?  Are you sure about that last point?  I'll check after 3.0 -gp
 
 @c Yes, this is good practice.  Otherwise, the start of the original
 @c part can only be seen from the font size.  This is not good enough
@@ -1364,7 +1442,7 @@ Cue notes have smaller font sizes.
 @c -hwn
 
 
- any other changes introduced by the cued part should also be
+Any other changes introduced by the cued part should also be
 undone.  For example, if the cued instrument plays in a different clef,
 the original clef should be stated once again.
 
@@ -1422,6 +1500,7 @@ LilyPond is limited.
 * Clusters::                    
 * Special fermatas::            
 * Special noteheads::           
+* Pitched trills::              
 * Feathered beams::             
 * Improvisation::               
 @end menu
@@ -1454,13 +1533,21 @@ tsMarkup =\markup {
 @end lilypond
 
 Each staff can also have its own time signature.  This is done by
-moving the @internalsref{Timing_engraver} to the @internalsref{Staff}
+moving the @internalsref{Timing_translator} to the @internalsref{Staff}
 context.
 
 @example
 \layout @{
-  \context @{ \Score \remove "Timing_engraver" @}
-  \context @{ \Staff \consists "Timing_engraver" @}
+  \context @{ \Score
+     \remove "Timing_translator"
+     \remove "Default_bar_line_engraver"
+  @}
+  \context @{
+    \Staff
+    \consists "Timing_translator"
+    \consists "Default_bar_line_engraver"
+  @}
+    
 @}
 @end example
 
@@ -1485,8 +1572,15 @@ Now, each staff has its own time signature.
 
 @lilypond[quote,raggedright]
 \layout{
-  \context{ \Score \remove "Timing_engraver" }
-  \context{ \Staff \consists "Timing_engraver" }
+  \context{
+     \Score
+     \remove "Timing_translator"
+     \remove "Default_bar_line_engraver"
+    }
+  \context{ \Staff
+    \consists "Timing_translator"
+    \consists "Default_bar_line_engraver"
+  }
 }
 
 \relative c' <<
@@ -1709,6 +1803,19 @@ To see all notehead styles, please see
 
 Program reference: @internalsref{NoteHead}.
 
+@node Pitched trills
+@subsection Pitched trills
+
+Trills that should be executed on an explicitly specified pitch can be
+typeset with the command @code{pitchedTrill}, 
+
+@lilypond[raggedright,verbatim,fragment]
+  \pitchedTrill c'4\startTrillSpan fis
+  f'\stopTrillSpan
+@end lilypond
+
+The first argument is the main note. The absolute pitch of the second
+is printed as a stemless note head in parentheses.
 
 @node Feathered beams
 @subsection Feathered beams
@@ -1776,7 +1883,7 @@ teaching tools in addition to great musical scores.
 * Balloon help::                
 * Blank music sheet::           
 * Hidden notes::                
-* Shaped note heads ::          
+* Shape note heads ::           
 * Easy Notation note heads::    
 * Analysis brackets::           
 * Coloring objects::            
@@ -1878,14 +1985,14 @@ as possible.
 @end lilypond
 
 
-@node Shaped note heads 
-@subsection Shaped note heads 
+@node Shape note heads 
+@subsection Shape note heads 
 
-In shaped note head notation, the shape of the note head corresponds
+In shape note head notation, the shape of the note head corresponds
 to the harmonic function of a note in the scale.  This notation was
 popular in the 19th century American song books.
 
-Shaped note heads can be produced by setting @code{\aikenHeads} or
+Shape note heads can be produced by setting @code{\aikenHeads} or
 @code{\sacredHarpHeads}, depending on the style desired.
 
 @lilypond[verbatim,relative=1,fragment]
@@ -1903,7 +2010,7 @@ scale is determined by  the @code{\key} command
 @findex \aikenHeads
 @findex \sacredHarpHeads
 
-Shaped note heads are implemented through the @code{shapeNoteStyles}
+Shape note heads are implemented through the @code{shapeNoteStyles}
 property.  Its value is a vector of symbols.  The k-th element indicates
 the style to use for the k-th step of the scale.  Arbitrary
 combinations are possible, eg.,
@@ -1974,30 +2081,6 @@ Program reference: @internalsref{HorizontalBracket}.
 Examples: @inputfileref{input/@/regression,note@/-group@/-bracket@/.ly}.
 
 
-
-@ignore
-
-I don't think we need this info.
-
-@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
-made invisible.
-
-@refcommands
-
-@cindex @code{\stemUp}
-@code{\stemUp},
-@cindex @code{\stemDown}
-@code{\stemDown},
-@cindex @code{\stemNeutral}
-@code{\stemNeutral}.
-
-@end ignore
-
-
 @node Coloring objects
 @subsection Coloring objects
 
@@ -2243,40 +2326,104 @@ problematic notes.
 In normal time signatures, automatic beams can start on any note but can
 only end in a few positions within the measure: beams can end on a beat,
 or at durations specified by the properties in
-@code{autoBeamSettings}.  The defaults for @code{autoBeamSettings}
-are defined in @file{scm/@/auto@/-beam@/.scm}.
+@code{autoBeamSettings}.  The properties in @code{autoBeamSettings}
+consist of a list of rules for where beams can begin and end.  The
+default @code{autoBeamSettings} rules are defined in
+@file{scm/@/auto@/-beam@/.scm}.
 
-The value of @code{autoBeamSettings} is changed with three functions,
+In order to add a rule to the list, use
 @example
-#(override-auto-beam-setting
-   '(@var{be} @var{p} @var{q} @var{n} @var{m}) @var{a} @var{b}
-   [@var{context}])
-#(score-override-auto-beam-setting
-   '(@var{be} @var{p} @var{q} @var{n} @var{m}) @var{a} @var{b})
-#(revert-auto-beam-setting '(@var{be} @var{p} @var{q} @var{n} @var{m})
-   @var{a} @var{b} [@var{context}])
+#(override-auto-beam-setting '(be p q n m) a b [context])
 @end example
-Here, @var{be} is the symbol @code{begin} or @code{end}, and
-@var{context} is an optional context (default: @code{'Voice}).  It
-determines whether the rule applies to begin or end-points.  The
-quantity @var{p}/@var{q} refers to the length of the beamed notes (and
-`@code{* *}' designates notes of any length), @var{n}/@var{M} refers
-to a time signature (wildcards `@code{* *}' may be entered to
-designate all time signatures), @var{a}/@var{b} is a duration.  By
-default, this command changes settings for the current voice.  It is
-also possible to adjust settings at higher contexts, by adding a
-@var{context} argument.  @code{score-override-auto-beam-setting} is
-equal to @code{override-auto-beam-setting} with the argument
-@var{context} set to @code{'Score}.
-
-For example, if automatic beams should end on the first quarter note, use
-the following
+
+@itemize @bullet
+
+@item @code{be} is either "begin" or "end".
+
+@item @code{b/q} is the duration of the note for which you want
+to add a rule.  A beam is considered to have the duration of its
+shortest note.  Set @code{p} and @code{q} to @code{'*'} to
+have this apply to any beam.
+
+@item @code{n/m} is the position in the time signature to which
+this rule should apply.  Set @code{n} and @code{m} to @code{'*'}
+to have this apply in any time signature.
+
+@item @code{a/b} is the position in the bar at which the beam should end.
+
+@item @code{context} is optional, and it specifies the context at which
+the change should be made.  The default is @code{'Voice}.
+@code{#(score-override-auto-beam-setting '(A B C D) E F)} is equivalent to
+@code{#(override-auto-beam-setting '(A B C D) E F 'Score)}.
+
+@end itemize
+
+For example, if automatic beams should always end on the first quarter
+node, use
+
 @example
-#(override-auto-beam-setting '(end * * * *) 1 4 'Staff)
+#(override-auto-beam-setting '(end * * * *) 1 4)
+@end example
+
+You can force the beam settings to only take effect on beams whose shortest
+note is a certain duration
+
+@lilypond[quote,fragment,raggedright,verbatim,relative=2]
+\time 2/4
+#(override-auto-beam-setting '(end 1 16 * *) 1 16)
+a16 a a a a a a a |
+a32 a a a a16 a a a a a |
+#(override-auto-beam-setting '(end 1 32 * *) 1 16)
+a32 a a a a16 a a a a a |
+@end lilypond
+
+You can force the beam settings to only take effect in certain time
+signatures
+
+@lilypond[quote,fragment,raggedright,verbatim,relative=2]
+\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
+
+You can also remove a previously set beam-ending rule by using
+
+@example
+#(revert-auto-beam-setting '(be p q n m) a b [context])
 @end example
-Since the duration of a quarter note is 1/4 of a whole note, it is
-entered as @code{(ly:make-moment 1 4)}.
 
+@noindent
+be, p, q, n, m, a, b and context are the same as above.  Note that the
+default rules are specified in @file{scm/@/auto@/-beam@/.scm},
+so you can revert rules that you did not explicitly create.
+
+@lilypond[quote,fragment,raggedright,verbatim,relative=2]
+\time 4/4
+a16 a a a a a a a a a a a a a a a
+#(revert-auto-beam-setting '(end 1 16 4 4) 1 4)
+a16 a a a a a a a a a a a a a a a
+@end lilypond
+
+The rule in a revert-auto-beam-setting statement must exactly match the
+original rule.  That is, no wildcard expansion is taken into account.
+
+@lilypond[quote,fragment,raggedright,verbatim,relative=2]
+\time 1/4
+#(override-auto-beam-setting '(end 1 16 1 4) 1 8)
+a16 a a a
+#(revert-auto-beam-setting '(end 1 16 * *) 1 8) % this won't revert it!
+a a a a
+#(revert-auto-beam-setting '(end 1 16 1 4) 1 8) % this will
+a a a a
+@end lilypond
+
+
+
+@c TODO:  old material -- not covered by above stuff, I think.
 If automatic beams should end on every quarter in 5/4 time, specify
 all endings
 @example
@@ -2298,40 +2445,14 @@ 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
 3/8, has passed within the measure).
 
-Rules can also be restricted to specific time signatures.  A rule that
-should only be applied in @var{N}/@var{M} time signature is formed by
-replacing the second asterisks by @var{N} and @var{M}.  For example, a
-rule for 6/8 time exclusively looks like
-@example
-#(override-auto-beam-setting '(begin * * 6 8) @dots{})
-@end example
-
-If a rule should be to applied only to certain types of beams, use the
-first pair of asterisks.  Beams are classified according to the
-shortest note they contain.  For a beam ending rule that only applies
-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}
 @cindex lyrics
 
 If beams are used to indicate melismata in songs, then automatic
-beaming should be switched off.  This is done by setting
-@code{autoBeaming} to @code{#f}.
+beaming should be switched off with @code{\autoBeamOff}.
+
 
 @refcommands