]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/refman.itely
* Documentation/user/lilypond-book.itely: small cleanups
[lilypond.git] / Documentation / user / refman.itely
index 886c066e547918f3979e59c908c761ac4771669c..aa864ff09675a1e3807a30ed5d558b441091a113 100644 (file)
@@ -46,7 +46,6 @@ encouraged to study the tutorial first.
 * Ancient notation ::           
 * Tuning output::               
 * Global layout::               
-* Output formats::              
 * Sound::                       
 @end menu
 
@@ -297,6 +296,14 @@ Durations can also be produced through GUILE extension mechanism.
 @end lilypond
 
 
+@refbugs
+
+Dot placement for chords is not perfect.  In some cases, dots overlap:
+@lilypond[]
+ \context Voice { <f,4. c'' d e f> }
+@end lilypond
+
+
 @node Ties
 @subsection Ties
 
@@ -345,6 +352,8 @@ of a chord is not supported in a simple way.  It can be achieved by
 moving the tie-engraver into the Thread context and turning on and off
 ties per Thread.
 
+Switching staffs when a tie is active will not work.
+
 @node Automatic note splitting 
 @subsection Automatic note splitting
 @c FIXME: This subsection doesn't belong in @ref{Note entry}.
@@ -452,7 +461,7 @@ readable.
 @cindex ghostscript
 
 If you view the result with Xdvi, then staff lines will show through
-the letters.  Printing the postscript file obtained with ly2dvi does
+the letters.  Printing the PostScript file obtained with ly2dvi does
 produce the correct result.
 
 
@@ -460,6 +469,7 @@ produce the correct result.
 @section Easier music entry
 @cindex Music entry
 @menu
+* Graphical interfaces::        
 * Relative octaves::            
 * Bar check::                   
 * Point and click::             
@@ -470,6 +480,51 @@ When entering music with LilyPond, it is easy to introduce errors. This
 section deals with tricks and features that help you enter music, and
 find and correct mistakes.
 
+@node Graphical interfaces
+@subsection Graphical interfaces
+
+@cindex GUI
+@cindex graphical interface
+@cindex sequencer
+@cindex RoseGarden
+@cindex Denemo
+@cindex NoteEdit
+@cindex MIDI
+
+One way to avoid entering notes using the keyboard is to use a
+graphical user interface.  The following programs are known to have
+a lilypond export option:
+
+@itemize @bullet
+@item
+Denemo was once intended as
+a LilyPond graphical user interface.  It run on Gnome/GTK.
+
+@quotation
+@uref{http://denemo.sourceforge.net/}
+@end  quotation
+
+@item
+ Noteedit, a graphical score editor that runs under KDE/Qt.
+@quotation
+@uref{http://rnvs.informatik.tu-chemnitz.de/~jan/noteedit/noteedit.html,}
+@end quotation
+
+@item
+RoseGarden was once the inspiration for naming LilyPond.  Nowadays it
+has been rewritten from scratch and supports LilyPond export as of
+version 0.1.6.
+
+@quotation
+@uref{http://rosegarden.sf.net/}
+@end quotation
+@end itemize
+
+Another option is to enter the music using your favorite MIDI
+sequencer, and then import it using midi2ly. midi2ly is described in
+@ref{Invoking midi2ly}.
+
+
 @c .  {Relative}
 @node Relative octaves
 @subsection Relative octaves
@@ -536,7 +591,7 @@ want to use relative within transposed music, you must place an
 additional @code{\relative} inside the @code{\transpose}.
 
 
-@c .  {Bar check}
+@c . {Bar check}
 @node Bar check
 @subsection Bar check
 @cindex Bar check
@@ -578,26 +633,65 @@ the Xdvi window. This makes it very easy to find input that causes some
 error in the sheet music.
 
 To use it, you need the following software
-
 @itemize @bullet
-@item 
-@uref{ftp://ftp.math.berkeley.edu/pub/Software/TeX/xdvi.tar.gz,plain
-Xdvi} version 22.36 or newer.
+@item A dvi viewer that supports src specials.
+@itemize @bullet
+@item Xdvi, version 22.36 or newer.  Available from
+@uref{ftp://ftp.math.berkeley.edu/pub/Software/TeX/xdvi.tar.gz,ftp.math.berkeley.edu}.
+
+  Note that most @TeX{} distributions ship with xdvik, which is always
+  a few versions behind the official Xdvi. To find out which xdvi you
+  are running, try @code{xdvi -version} or @code{xdvi.bin -version}.
+@item KDVI.  A dvi viewer for KDE.  You need KDVI from KDE 3.0 or
+newer.  Enable option @emph{Inverse search} in the menu @emph{Settings}.
+
+@cindex Xdvi
+@cindex KDVI
+@cindex KDE
+
+
+
+@end itemize
+@item An editor with a client/server interface (or a lightweight GUI
+editor).
 
-  Note that most @TeX{} distributions ship with xdvik, which is a
-  different and less well maintained program. To find out which xdvi you
-  are running, try @code{xdvi --version} or @code{xdvi.bin --version}.
+@cindex editor
 
-@item An editor with a client/server interface (or a lightweight GUI editor).
 @itemize @bullet
 @item Emacs. Emacs is an extensible text-editor.  It is available from
 @uref{http://www.gnu.org/software/emacs/}.  You need version 21 to use
 column location.
-@item GVim.  GVim is a lightweight GUI variant of VIM, the popular VI
+
+@c move this elsewhere?
+
+LilyPond also comes with support files for emacs: lilypond-mode for
+emacs provides indentation, syntax coloring and handy compile
+short-cuts. If lilypond-mode is not installed on your platform, then
+refer to the installation instructions for more information
+
+@cindex emacs
+@cindex emacs mode
+@cindex lilypond-mode for emacs
+@cindex syntax coloring
+
+@item XEmacs. Xemacs is very similar to emacs.
+
+@cindex XEmacs
+
+@item NEdit.  NEdit runs under Windows, and Unix.
+  It is available from @uref{http://www.nedit.org}.
+
+@cindex NEdit
+
+@item GVim.  GVim is a GUI variant of VIM, the popular VI
 clone.  It is available from @uref{http://www.vim.org}.
-@item NEdit.  NEdit is a somewhat Windows like editor, that has recently
-become Free Software.  It is available from @uref{http://www.nedit.org}.
+
+@cindex GVim
+@cindex Vim
+
 @end itemize
+@end itemize
+
 
 Xdvi must be configured to find the @TeX{} fonts and music
 fonts. Refer to the Xdvi documentation for more information.
@@ -605,7 +699,7 @@ fonts. Refer to the Xdvi documentation for more information.
 To use point-and-click, add one of these lines to the top of your .ly
 file.
 @example
-#(set! point-and-click line-location)
+#(set-point-and-click! 'line)
 @end example
 @cindex line-location
 
@@ -613,44 +707,42 @@ When viewing, Control-Mousebutton 1 will take you to the originating
 spot in the @file{.ly} file.  Control-Mousebutton 2 will show all
 clickable boxes.
 
-@subsubsec Emacs
+If you correct large files with point-and-click, be sure to start
+correcting at the end of the file. When you start at the top, and
+insert one line, all following locations will be off by a line.
+
 @cindex Emacs
-In your emacs startup file (usually @file{~/.emacs}), add the following
+For using point-and-click with emacs,  add the following
+In your emacs startup file (usually @file{~/.emacs}), 
 @example
 (server-start)
 @end example
 
-Make sure that the environment variable @code{XEDITOR} is set to
+Make sure that the environment variable @var{XEDITOR} is set to
 @example
 emacsclient --no-wait +%l %f
 @end example
-@cindex XEDITOR
-
-If you use Emacs version 21, you can make emacs jump to the exact spot
-(and not just the line) on a click.  To use this feature, you must
-enable column positioning.  At the top of the @code{ly} file, replace
-the @code{set!} line with the following line
-@example
-#(set! point-and-click line-column-location)
-@end example
-@cindex line-colomn-location
-Set @var{XEDITOR} to @code{emacsclient --no-wait +%l:%c %f}, or
-use this argument with xdvi's @file{-editor} option.
-
-If you correct large files with point-and-click, be sure to start
-correcting at the end of the file. When you start at the top, and
-insert one line, all following locations will be off by a line.
-
-@subsubsec GVim
-@cindex GVIM
-Set @var{XEDITOR} to @code{gvim +%l %f}, or
-use this argument with xdvi's @code{-editor} option.
+@cindex @var{XEDITOR}
+If you use xemacs instead of emacs, you use @code{(gnuserve-start)} in
+your @file{.emacs}, and set @code{XEDITOR} to @code{gnuclient -q +%l %f}
 
-@subsubsec NEdit
+For using Vim, set @code{XEDITOR} to @code{gvim --remote +%l %f}, or use this
+argument with xdvi's @code{-editor} option.
 @cindex NEdit
-Set @var{XEDITOR} to @code{nc -noask +%l %f}, or
+For using NEdit, set @code{XEDITOR} to @code{nc -noask +%l %f}, or
 use this argument with xdvi's @code{-editor} option.
 
+If can also make your editor jump to the exact location of the note
+you clicked. This is only supported on Emacs. Users of version 20 must
+apply the patch @file{emacsclient.patch}. Users of version 21 must
+apply @file{server.el.patch} (version 21.2 and earlier).  At the top
+of the @code{ly} file, replace the @code{set!} line with the following
+line,
+@example
+#(set-point-and-click! 'line-column)
+@end example
+@cindex line-colomn-location
+and set @code{XEDITOR} to @code{emacsclient --no-wait +%l:%c %f}.
 
 @refbugs
 
@@ -687,6 +779,7 @@ such as keys, clefs and time signatures.
 @cindex Staff notation
 
 @menu
+* Staff symbol::
 * Key signature::               
 * Clef::                        
 * Time signature::              
@@ -694,6 +787,31 @@ such as keys, clefs and time signatures.
 * Bar lines::                   
 @end menu
 
+@node Staff symbol
+@subsection Staff symbol
+
+
+@cindex adjusting staff symbol
+@cindex StaffSymbol, using \property
+@cindex staff lines, setting number of
+
+
+The lines of the staff symbol are formed by the
+@internalsref{StaffSymbol} grob.  This grob is created at the moment
+that their context is created.  You can not change the appearance of
+the staff symbol by using @code{\override} or @code{\set}.  At the
+moment that @code{\property Staff} is interpreted, a Staff context is
+made, and the StaffSymbol is created before any @code{\override} is
+effective. You can deal with this either overriding properties in a
+@code{\translator} definition, or by using @code{\outputproperty}.
+
+
+@refbugs
+
+If you end a staff half way a piece, the staff symbol may not end
+exactly on the barline.
+
+
 @c .  {Key}
 @node Key signature
 @subsection Key signature
@@ -1118,6 +1236,14 @@ the grob property @code{auto-knee-gap}.
 
 Auto knee beams can not be used together with hara kiri staffs.
 
+[TODO from bugs]
+
+The Automatic beamer does not put @strong{unfinished} beams on the
+last notes of a score.
+
+Formatting of ties is a difficult subject. LilyPond often does not
+give optimal results.
+
 @menu
 * Setting automatic beam behavior ::  
 @end menu
@@ -1224,12 +1350,12 @@ automatic beaming. This is done by setting @code{Voice.autoBeaming} to
 It is not possible to specify beaming parameters for beams with mixed
 durations, that differ from the beaming parameters of all separate
 durations, i.e., you'll have to specify manual beams to get:
-@lilypond[fragment,singleline,relative]
+
+@lilypond[singleline,fragment,relative,noverbatim]
   \property Voice.autoBeamSettings
   \override #'(end * * * *) = #(make-moment 3 8)
   \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}.
@@ -1252,7 +1378,8 @@ quite hairy, so non-experts should stick to the macros defined in
 @file{ly/property-init.ly}.
 @cindex @file{property-init.ly}
 
-The normal way of using the macros is to enter the macro name right after the
+The macros operate on the ``Current'' context (see @ref{Context properties}). This
+means that the macros shuold normally be invoked right after the
 creation of the context in which the accidental typesetting described
 by the macro is to take effect. I.e. if you want to use
 piano-accidentals in a pianostaff then you issue
@@ -1663,6 +1790,7 @@ articulation. They are demonstrated here.
       c''4-|_"c-|"      s4
       c''4->_"c->"      s4
       c''4-^_"c-\\^{ }" s4
+      c''4-__"c-\_" s4      
     }
   }
 @end lilypond
@@ -1684,7 +1812,8 @@ using @code{^} and @code{_}.
 @cindex staccatissimo
 @cindex fermata 
 @cindex stopped     
-@cindex staccato     
+@cindex staccato
+@cindex portato
 @cindex tenuto        
 @cindex upbow
 @cindex downbow
@@ -1713,7 +1842,8 @@ using @code{^} and @code{_}.
       \property Score.LyricText \override #'font-shape = #'upright
       \context Staff \notes {
         c''-\accent      c''-\marcato      c''-\staccatissimo c''^\fermata 
-        c''-\stopped     c''-\staccato     c''-\tenuto        c''-\upbow
+        c''-\stopped     c''-\staccato     c''-\tenuto         c''-\portato
+        c''-\upbow
         c''-\downbow     c''^\lheel        c''-\rheel         c''^\ltoe
         c''-\rtoe        c''-\turn         c''-\open          c''-\flageolet
         c''-\reverseturn c''-\trill        c''-\prall         c''-\mordent
@@ -1723,7 +1853,8 @@ using @code{^} and @code{_}.
       }
       \context Lyrics \lyrics {
         accent__      marcato__      staccatissimo__ fermata
-        stopped__     staccato__     tenuto__        upbow
+        stopped__     staccato__     tenuto__        portato
+        upbow
         downbow__     lheel__        rheel__         ltoe
         rtoe__        turn__         open__          flageolet
         reverseturn__ trill__        prall__         mordent
@@ -1788,8 +1919,8 @@ c4^"longtext" \fatText c4_"longlongtext" c4 }
 It is possible to use @TeX{} commands in the strings, but this should be
 avoided because it makes it impossible for LilyPond to compute the
 exact length of the string, which may lead to collisions.  Also, @TeX{}
-commands won't work with direct PostScript output (see @ref{PostScript
-output}).
+commands won't work with direct PostScript output.
+@c (see @ref{PostScript output}).
 
 Text scripts are created in form of @internalsref{TextScript} grobs, in
 @internalsref{Voice} context. 
@@ -1869,6 +2000,17 @@ standard definitions are in @file{ly/grace-init.ly}.
 }
 @end lilypond
 
+If you want to end a note with a grace note, then the standard trick
+is to put the grace notes before a phantom ``space note'', e.g.
+@lilypond[fragment,verbatim, relative=2]
+\context Voice {
+    < { d1^\trill ( }
+     { s2 \grace { [c16 d] } } >
+   )c4
+}
+@end lilypond
+
+
 @refbugs
 
 Grace note synchronization can also lead to surprises. Staff notation,
@@ -2804,7 +2946,6 @@ tuning defaults to the standard guitar tuning (with 6 strings).
   >  
 @end lilypond
 
-
 @node Non-guitar tablatures
 @subsection Non-guitar tablatures
 @cindex Non-guitar tablatures
@@ -2835,12 +2976,14 @@ A common trick for that is to put the notes in a variables, and to hide
 the fingering information (which correspond to the string number) for
 the standard staff.
 
-@lilypond[verbatim]
-  part = \notes {
+@c FIXME
+@c @lily pond[verbatim]
+@example
+  part = \notes @{
     a,4-2 c'-5 a-4 e'-6
     e-3 c'-5 a-4 e'-6
-  }
-  \score{
+  @}
+  \score @{
     \context StaffGroup <
       \context Staff <
         % Hide fingering number
@@ -2854,9 +2997,9 @@ the standard staff.
         \part
       >
     >
-  }
-@end lilypond
-
+  @}
+@end example
+@c @end lilypond
 
 @c . {Chords}
 @node Chords
@@ -3139,7 +3282,6 @@ To print a  rehearsal mark, use the @code{\mark} command.
   c1 \mark \default 
   c1 \mark "12"
   c1 \mark \default
-  c1 \mark #'(music "scripts-segno") 
   c1
 }
 @end lilypond
@@ -3151,6 +3293,28 @@ is @internalsref{RehearsalMark} in @internalsref{Score} context. See
 @code{input/test/boxed-molecule.ly} if you need boxes around the
 marks.
 
+The @code{\mark} command can also be used to put signs like coda,
+segno and fermatas on a barline.  The trick is to use the text markup
+mechanism to access the fermata symbol.
+@lilypond[fragment,verbatim,relative=1]
+  c1 \mark #'(music "scripts-ufermata") 
+  c1
+@end lilypond
+
+The problem is that marks that occur at a line break are typeset only
+at the beginning of the next line, opposite to what you want for the
+fermata. This can be corrected by the following property setting
+@example
+\property Score.RehearsalMark \override
+  #'visibility-lambda = #begin-of-line-invisible
+@end example
+
+@cindex fermatas
+@cindex coda
+@cindex segno
+@cindex barlines, putting symbols on 
+
+
 @node Bar numbers
 @subsection Bar numbers
 
@@ -3770,20 +3934,6 @@ The backend is not very strict in type-checking grob properties. If you
 LilyPond may crash.
 
 
-@cindex adjusting staff symbol
-@cindex StaffSymbol, using \property
-@cindex staff lines, setting number of
-
-Some grobs are created at the moment that their context is created. An
-example of such a grob is the staff itself (i.e. the horizontal lines).
-You can not change the appearance of the staff symbol by manipulating
-@code{\property Staff.StaffSymbol}.  At the moment that @code{\property
-Staff} is interpreted, a Staff context is made, and the StaffSymbol is
-created before any @code{\override} is effective. You can deal with this
-either overriding properties in a @code{\translator} definition, or by
-using @code{\outputproperty}.
-
-
 
 
 @node Tuning per grob 
@@ -3987,7 +4137,7 @@ abbrev: @code{columns lines roman music bold italic named super sub}
 The markup is broken down and converted into a list of grob properties,
 which are prepended to the property list.  The @var{key}-@var{value}
 pair is a grob property. A list of properties available is included in
-the generated documentation for @rint{Text_interface}.
+the generated documentation for @internalsref{text-interface}.
 
 The following abbreviations are defined:
 @table @code
@@ -4051,7 +4201,8 @@ marking:
 
 \score {
   \notes\relative c'' {
-    a1^#`((columns (font-relative-size . -1)) ,dotted-eight-note " = 64")
+    a1^#`((columns (font-relative-size . -1))
+           ,dotted-eight-note " = 64")
   }
   \paper {
     linewidth = -1.
@@ -4068,11 +4219,16 @@ marking:
 The syntax and semantics of markup texts are not clean, and both
 syntax and semantics are slated for a rewrite.
 
+LilyPond does not do kerning, and there generally spaces texts
+slightly too wide.
+
+
+
 @node Global layout
 @section Global layout
 
 The global layout determined by three factors: the page layout, the
-line breaks and the spacing. These all influence each other: The
+iline breaks and the spacing. These all influence each other: The
 choice of spacing determines how densely each system of music is set,
 whree line breaks breaks are chosen, and thus ultimately how many
 pages a piece of music takes. In this section we will explain how the
@@ -4087,14 +4243,65 @@ is processed by @TeX{}, page are filled with systems, and page breaks
 are chosen whenever the page gets full.
 
 @menu
-* Spacing::                     
+* Vertical spacing::            
+* Horizontal spacing::          
 * Font Size::                   
 * Line breaking::               
 * Page layout::                 
 @end menu
 
-@node Spacing
-@subsection Spacing
+
+@node Vertical spacing
+@subsection Vertical spacing
+
+@cindex vertical spacing
+@cindex distance between staffs
+@cindex staff distance
+@cindex between staves, distance
+
+The height of each system is determined automatically by lilypond, to
+keep systems from bumping into each other, some minimum distances are
+set.  By changing these, you can put staffs closer together, and thus
+put more  systems onto one page.
+
+Normally staves are stacked vertically. To make
+staves maintain a distance, their vertical size is padded. This is
+done with the property @code{minimumVerticalExtent}. It takes a pair
+of numbers, so if you want to make it smaller from its, then you could
+set
+@example
+  \property Staff.minimumVerticalExtent = #'(-4 . 4)
+@end example
+This sets the vertical size of the current staff to 4 staff-space on
+either side of the center staff line.  The argument of
+@code{minimumVerticalExtent} is interpreted as an interval, where the
+center line is the 0, so the first number is generally negative.  you
+could also make the staff larger at the bottom by setting it to
+@code{(-6 . 4)}. The default value is @code{(-6 . 6)}.
+
+Vertical aligment of staves is handled by the
+@internalsref{VerticalAlignment} grob, which lives at
+@internalsref{Score} level.
+
+The piano staffs are handled a little differently: to make cross-staff
+beaming work correctly, it necessary that the distance between staves
+is fixed.  This is also done with a @internalsref{VerticalAlignment}
+grob, created in @internalsref{PianoStaff}, but a forced distance is
+set. This is done with the grob property #'forced-distance. If you
+want to override this, use a @code{\translator} block as follows:
+@example
+  \translator @{
+    \PianoStaffContext
+    VerticalAlignment \override #'forced-distance = #9
+  @}
+@end example
+This would bring the staffs together at a distance of 9 staff spaces,
+and again this is measured from the center line of each staff.
+
+
+
+@node Horizontal spacing
+@subsection Horizontal Spacing
 
 The spacing engine translates differences in durations into
 stretchable distances (``springs'') of differing lengths. Longer
@@ -4244,6 +4451,10 @@ you can force an invisible bar line by entering @code{\bar
 ""}. Similarly, @code{\noBreak} forbids a line break at a certain
 point.
 
+
+@cindex regular line breaks
+@cindex four bar music. 
+
 If you want linebreaks at regular intervals, you can use the following:
 @example
 <  \repeat 7 unfold @{ s1 * 4 \break  @}
@@ -4285,6 +4496,16 @@ that case @code{interscoreline} specifies the minimum spacing.
 @cindex @code{interscoreline}
 @cindex @code{interscorelinefill}
 
+If the variable @code{lastpagefill} is defined (that is, it gets any
+value assigned in the @code{\paper} block), systems are evenly
+distributed vertically on the last page.  This might produce ugly
+results in case there are not enough systems on the last page.  Note
+that @command{lilypond-book} ignores @code{lastpagefill}.  See
+@ref{lilypond-book: integrating text and music} for
+more information.
+
+@cindex @code{lastpagefill}
+
 Page breaks are normally computed by @TeX{}, so they are not under
 direct control of LilyPond.  However, you can insert a commands into
 the @file{.tex} output to instruct @TeX{} where to break pages. You