]> git.donarmstrong.com Git - lilypond.git/commitdiff
Update from Trevor.
authorGraham Percival <graham@percival-music.ca>
Wed, 13 Feb 2008 14:34:56 +0000 (06:34 -0800)
committerGraham Percival <graham@percival-music.ca>
Wed, 13 Feb 2008 14:34:56 +0000 (06:34 -0800)
Documentation/user/tweaks.itely

index 7698e32f74beec66a2de099a7658c1f7474f291c..017b485f1f1fa58150704ebfd90e558f82729aed 100644 (file)
@@ -17,7 +17,7 @@ configurable; virtually every fragment of output may be changed.
 @menu
 * Tweaking basics::             
 * The Internals Reference manual::  
-* Appearance of objects::       
+* Appearance of objects::
 * Placement of objects::        
 * Collisions of objects::       
 * Further tweaking::            
@@ -709,8 +709,8 @@ appearance of the printed music.
 
 @menu
 * Visibility and color of objects::  
-* Size of objects::             
-* Length and thickness of objects::  
+* Size of objects::
+* Length and thickness of objects::
 @end menu
 
 @node Visibility and color of objects
@@ -1623,7 +1623,7 @@ given the following default @code{outside-staff-priority} values:
 @item @code{BarNumber}            @tab @code{ 100}
 @end multitable
 
-If the default values of @code{outside-staff-priority} does not
+If the default values of @code{outside-staff-priority} do not
 give you the placing you want, the priority of any of the objects
 may be overridden.  Suppose we would
 like the ottava bracket to be placed below the text spanner in the
@@ -2777,11 +2777,11 @@ lhMusic = \relative c' {
 @section Further tweaking
 
 @menu
-* Other uses for tweaks::       
-* Using variables for tweaks::  
-* Other sources of information::  
-* Advanced tweaks with Scheme::  
-* Avoiding tweaks with slower processing::  
+* Other uses for tweaks::
+* Using variables for tweaks::
+* Other sources of information::
+* Advanced tweaks with Scheme::
+* Avoiding tweaks with slower processing::
 @end menu
 
 @node Other uses for tweaks
@@ -2789,23 +2789,21 @@ lhMusic = \relative c' {
 
 @itemize
 
-@cindex transparent property
+@cindex transparent property, use of
 @cindex objects, making invisible
 @cindex removing objects
 @cindex objects, removing
 @cindex hiding objects
 @cindex invisible objects
+@cindex tying notes across voices
 
 @item
-Setting the @code{transparent} property will cause an object 
-to be printed in @q{invisible ink}: the object is not printed, 
-but all its other behavior is retained.  The object still takes 
-up space, it takes part in collisions, and slurs, ties, and beams
-can be attached to it.
+@subheading Tying notes across voices
 
-The following example demonstrates how to connect different voices
-using ties.  Normally, ties only connect two notes in the same
-voice.  By introducing a tie in a different voice,
+The following example demonstrates how to connect notes in
+different voices using ties.  Normally, ties can be used to
+only to connect two notes in the same voice.  By introducing 
+a tie in a different voice,
 
 @lilypond[quote,fragment,relative=2]
 << {
@@ -2816,8 +2814,8 @@ voice.  By introducing a tie in a different voice,
 @end lilypond
 
 @noindent
-and blanking the first up-stem in that voice, the tie appears to cross
-voices:
+and blanking the first up-stem in that voice, the tie appears to 
+cross voices:
 
 @lilypond[quote,fragment,relative=2,verbatim]
 << {
@@ -2828,9 +2826,9 @@ voices:
 } >>
 @end lilypond
 
-To make sure that the just-blanked stem doesn't squeeze the tie too much,
-we also lengthen the stem, by setting the @code{length} to
-@code{8},
+To make sure that the just-blanked stem doesn't squeeze the tie 
+too much, we can also lengthen the stem, by setting the 
+@code{length} to @code{8},
 
 @lilypond[quote,fragment,relative=2,verbatim]
 << {
@@ -2842,9 +2840,12 @@ we also lengthen the stem, by setting the @code{length} to
 } >>
 @end lilypond
 
-@cindex stencil property
-
 @item
+@subheading Simulating a fermata
+
+@cindex stencil property, use of
+@cindex fermata, implementing in MIDI
+
 For outside-staff objects it is usually better to override the
 object's @code{stencil} property rather than its @code{transparent}
 property when you wish to remove it from the printed output.  
@@ -2876,6 +2877,7 @@ We show here the effect of the two methods:
     \tempo 4=120
     a a a a
   }
+  \layout { }
   \midi { }
 }
 @end lilypond
@@ -2891,42 +2893,172 @@ while the second (with no stencil) does not.
 @node Using variables for tweaks
 @subsection Using variables for tweaks
 
-TODO Add section
+Override commands are often long and tedious to type, and they
+have to be absolutely correct.  If the same overrides are to be
+used many times it may be worth defining variables to hold them.
+Suppose we wish to emphasize certain words in lyrics by printing
+them in bold italics.  The @code{\italic} and @code{\bold} 
+commands do not work within lyrics so we must instead use the 
+following @code{\override} and @code{\revert} commands:
+
+@example
+@code{\override Lyrics . LyricText #'font-shape = #'italic}
+@code{\override Lyrics . LyricText #'font-series = #'bold}
+
+@code{\revert Lyrics . LyricText #'font-shape}
+@code{\revert Lyrics . LyricText #'font-series}
+@end example
+
+These would be extremely tedious to enter if there were many words
+requiring emphasis.  So instead we define these as two variables,
+and use them as follows:
+
+@lilypond[quote,verbatim]
+emph = {
+  \override Lyrics . LyricText #'font-shape = #'italic
+  \override Lyrics . LyricText #'font-series = #'bold
+}
+norm = {
+  \revert Lyrics . LyricText #'font-shape
+  \revert Lyrics . LyricText #'font-series
+}
+
+global = { \time 4/4 \partial 4 \key c \major}
+SopMusic   = \relative c' { c4 | e4. e8 g4  g  | a a g }
+AltoMusic  = \relative c' { c4 | c4. c8 e4  e  | f f e }
+TenorMusic = \relative c  { e4 | g4. g8 c4. b8 | a8 b c d e4 }
+BassMusic  = \relative c  { c4 | c4. c8 c4  c  | f8 g a b c4 }
+VerseOne   = \lyrics { E -- | ter -- nal \emph Fa -- ther, \norm | strong to save, }
+VerseTwo   = \lyricmode { O | \emph Christ, \norm whose voice the | wa -- ters heard, }
+VerseThree = \lyricmode { O | \emph Ho -- ly Spi -- rit, \norm | who didst brood }
+VerseFour  = \lyricmode { O | \emph Tri -- ni -- ty \norm of | love and pow'r }
+
+\score {
+  \new ChoirStaff <<
+    \new Staff <<
+      \clef "treble"
+      \new Voice = "Sop"  { \voiceOne \global \SopMusic }
+      \new Voice = "Alto" { \voiceTwo \AltoMusic }
+      \new Lyrics \lyricsto "Sop" { \VerseOne   }
+      \new Lyrics \lyricsto "Sop" { \VerseTwo   }
+      \new Lyrics \lyricsto "Sop" { \VerseThree }
+      \new Lyrics \lyricsto "Sop" { \VerseFour  }
+    >>
+    \new Staff <<
+      \clef "bass"
+      \new Voice = "Tenor" { \voiceOne \TenorMusic }
+      \new Voice = "Bass"  { \voiceTwo \BassMusic  }
+    >>
+  >>
+}
+@end lilypond
+
+
 
 @node Other sources of information
 @subsection Other sources of information
 
 The Internals Reference documentation contains a lot of information
 about LilyPond, but even more information can be gathered from
-looking at the internal LilyPond files.
-
-TODO Show example, then explain where to find ly/propert-ly.
-
-Some default settings (such as the definitions for
-@code{\header@{@}}s) are stored as @code{.ly} files.  Other
-settings (such as the definitions of markup commands) are
-stored as @code{.scm} (Scheme) files.  Further explanation is
-outside the scope of this manual; users should be warned that
-a substantial amount of technical knowledge or time is required
-to understand these files.
+looking at the internal LilyPond files.  To explore these, first
+find the directory appropriate to your system, as follows:
 
 @itemize
 
-@item Linux: @file{@var{installdir}/lilypond/usr/share/lilypond/current/}
+@item Linux: 
+Navigate to 
+@file{@var{installdir}/lilypond/usr/share/lilypond/current/}
 
 @item OSX:
+Navigate to
 @file{@var{installdir}/LilyPond.app/Contents/Resources/share/lilypond/current/}.
-To access this, either @code{cd} into this directory from the
-Terminal, or control-click on the LilyPond application and select
-@q{Show Package Contents}.
+by either @code{cd}-ing into this directory from the
+Terminal, or control-clicking on the LilyPond application and 
+selecting @q{Show Package Contents}.
 
-@item Windows: @file{@var{installdir}/LilyPond/usr/share/lilypond/current/}
+@item Windows: 
+Using Windows Explorer, navigate to
+@file{@var{installdir}/LilyPond/usr/share/lilypond/current/}
 
 @end itemize
 
-The @file{ly/} and @file{scm/} directories will be of
-particular interest.  Files such as @file{ly/property-init.ly} and
-@file{ly/declarations-init.ly} define all the common tweaks.
+Within this directory the two interesting subdirectories are
+
+@itemize
+
+@item @file{../ly/} - contains files in LilyPond format
+
+@item @file{../scm/} - contains files in Scheme format
+
+@end itemize
+
+Let's begin by looking at some files in @file{../ly/}.
+Open @file{../ly/property-init.ly} in a text editor.  The one
+you normally use for @code{.ly} files will be fine.  This file
+contains the definitions of all the standard LilyPond built-in
+commands -- like @code{\stemUp} and @code{\slurDotted}.  You will
+see that these are nothing more than definitions of variables
+containing one or a group of @code{\override} commands.  For
+example, @code{/tieDotted} is defined to be:
+
+@example
+tieDotted = @{
+  \override Tie #'dash-period = #0.75
+  \override Tie #'dash-fraction = #0.1
+@}
+@end example
+
+If you do not like the default values these built-in commands can
+be redefined easily, just like any other variable, at the
+head of your input file.
+
+These are the most useful files to be found in @file{../ly/}:
+
+@multitable @columnfractions .4 .6
+@headitem Filename
+  @tab Contents
+@item @file{../ly/engraver-init.ly}
+  @tab Definitions of engraver Contexts
+@item @file{../ly/paper-defaults.ly}
+  @tab Specifications of paper-related defaults
+@item @file{../ly/performer-init.ly}
+  @tab Definitions of performer Contexts
+@item @file{../ly/property-init.ly}
+  @tab Definitions of all common macros
+@end multitable
+
+Other settings (such as the definitions of markup commands) are
+stored as @code{.scm} (Scheme) files.  The Scheme programming
+language is used to provide a programmable interface into
+LilyPond internal operation.  Further explanation of these files
+is currently outside the scope of this manual, as a knowledge of
+the Scheme language is required.  Users should be warned that
+a substantial amount of technical knowledge or time is required
+to understand Scheme and these files.
+
+If you have this knowledge, the Scheme files which may be of
+interest are:
+
+@multitable @columnfractions .4 .6
+@headitem Filename
+  @tab Contents
+@item @file{../scm/auto-beam.scm}
+  @tab Sub-beaming defaults
+@item @file{../scm/define-grobs.scm}
+  @tab Default settings for grob properties
+@item @file{../scm/define-markup-commands.scm}
+  @tab Specify all markup commands
+@item @file{../scm/midi.scm}
+  @tab Default settings for MIDI output
+@item @file{../scm/output-lib.scm}
+  @tab Settings that affect appearance of frets, colors,
+       accidentals, bar lines, etc
+@item @file{../scm/parser-clef.scm}
+  @tab Definitions of supported clefs
+@item @file{../scm/script.scm}
+  @tab Default settings for articulations
+@end multitable
+
 
 
 @node Advanced tweaks with Scheme
@@ -3034,3 +3166,4 @@ In some cases (see issue 246), this must be done before
 
 
 
+