From 83c0409957c5ff1f35ef918455a7156fd550fa61 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 27 Aug 2004 20:58:12 +0000 Subject: [PATCH] (Vertical spacing): corrections --- ChangeLog | 3 + Documentation/user/changing-defaults.itely | 193 ++++++++++++--------- Documentation/user/invoking.itexi | 135 +------------- Documentation/user/lilypond.tely | 19 +- Documentation/user/point-and-click.itely | 117 +++++++++++++ VERSION | 2 +- ly/declarations-init.ly | 4 - 7 files changed, 247 insertions(+), 226 deletions(-) create mode 100644 Documentation/user/point-and-click.itely diff --git a/ChangeLog b/ChangeLog index e55d725ba5..1b43b5c1f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-08-27 Han-Wen Nienhuys + * Documentation/user/point-and-click.texi (Point and click): new file. + put point & click in appendix. + * Documentation/user/changing-defaults.itely (Vertical spacing): corrections diff --git a/Documentation/user/changing-defaults.itely b/Documentation/user/changing-defaults.itely index 25b5a861d0..65d82faca9 100644 --- a/Documentation/user/changing-defaults.itely +++ b/Documentation/user/changing-defaults.itely @@ -1620,6 +1620,7 @@ titles. @menu * Setting global staff size:: +* Vertical spacing of piano staves:: * Vertical spacing:: * Horizontal spacing:: * Line breaking:: @@ -1660,7 +1661,7 @@ The recommended font sizes are listed in the following table: @tab 12.60 @tab 4.4 @tab - + @item feta14 @tab 14.14 @tab 5.0 @@ -1713,13 +1714,6 @@ This manual: @ref{Selecting font sizes}. -@menu -* Vertical spacing:: -* Horizontal spacing:: -* Line breaking:: -* Page layout:: -@end menu - @node Vertical spacing of piano staves @subsection Vertical spacing of piano staves @@ -1736,14 +1730,35 @@ The distance of staves in a @code{PianoStaff} is set with the It can be adjusted as follows @verbatim \new PianoStaff \with { - \override VerticalAlignment #'forced-distance = #9 + \override VerticalAlignment #'forced-distance = #7 } { ... } -@end example -This would bring the staves together at a distance of 9 staff spaces, +@end verbatim +This would bring the staves together at a distance of 7 staff spaces, measured from the center line of each staff. +The difference is demonstrated in the following example, +@lilypond[verbatim] +\relative << + \new PianoStaff \with { + \override VerticalAlignment #'forced-distance = #7 + } << + \new Staff { c1 } + \new Staff { c } + >> + \new PianoStaff << + \new Staff { c } + \new Staff { c } + >> +>> +@end lilypond + + + +@refbugs + +@code{forced-distance} cannot be changed per system. @node Vertical spacing @subsection Vertical spacing @@ -1807,50 +1822,57 @@ The quarter note is followed by 2 NHW, the half by 3 NHW, etc. c8 c4 c4 c4 @end lilypond -Normally, @code{spacing-increment} is set to 1.2, which is the -width of a note head, and @code{shortest-duration-space} is set to -2.0, meaning that the shortest note gets 2 NHW of space. For normal -notes, this space is always counted from the left edge of the symbol, so -the shortest notes are generally followed by one NHW of space. +Normally, @code{spacing-increment} is set to 1.2 staff space, which is +approximately the width of a note head, and +@code{shortest-duration-space} is set to 2.0, meaning that the +shortest note gets 2.4 staff space (2.0 times the +@code{spacing-increment}) of horizontal space. This space is counted +from the left edge of the symbol, so the shortest notes are generally +followed by one NHW of space. If one would follow the above procedure exactly, then adding a single 32th note to a score that uses 8th and 16th notes, would widen up the entire score a lot. The shortest note is no longer a 16th, but a 32nd, -thus adding 1 NHW to every note. To prevent this, the -shortest duration for spacing is not the shortest note in the score, -but the most commonly found shortest note. Notes that are even -shorter this are followed by a space that is proportional to their -duration relative to the common shortest note. So if we were to add -only a few 16th notes to the example above, they would be followed by -half a NHW: +thus adding 1 NHW to every note. To prevent this, the shortest +duration for spacing is not the shortest note in the score, but rather +the one which occurs most frequently. -@lilypond[fragment,verbatim,relative=2] - c2 c4. c8 c4. c16[ c] c4. c8 c8 c8 c4 c4 c4 -@end lilypond The most common shortest duration is determined as follows: in every measure, the shortest duration is determined. The most common short duration, is taken as the basis for the spacing, with the stipulation that this shortest duration should always be equal to or shorter than -1/8th note. The shortest duration is printed when you run lilypond -with @code{--verbose}. These durations may also be customized. If you -set the @code{common-shortest-duration} in -@internalsref{SpacingSpanner}, then this sets the base duration for -spacing. The maximum duration for this base (normally 1/8th), is set -through @code{base-shortest-duration}. +1/8th note. The shortest duration is printed when you run +@code{lilypond} with the @code{--verbose} option. + +These durations may also be customized. If you set the +@code{common-shortest-duration} in @internalsref{SpacingSpanner}, then +this sets the base duration for spacing. The maximum duration for this +base (normally 1/8th), is set through @code{base-shortest-duration}. @cindex @code{common-shortest-duration} @cindex @code{base-shortest-duration} @cindex @code{stem-spacing-correction} @cindex @code{spacing} -In the Introduction it was explained that stem directions influence -spacing. This is controlled with @code{stem-spacing-correction} -property in @internalsref{NoteSpacing}, which are generated for every +Notes that are even shorter than the commoon shortest note are +followed by a space that is proportional to their duration relative to +the common shortest note. So if we were to add only a few 16th notes +to the example above, they would be followed by half a NHW: + +@lilypond[fragment,verbatim,relative=2] + c2 c4. c8 c4. c16[ c] c4. c8 c8 c8 c4 c4 c4 +@end lilypond + + +In the introduction (see @ref{Engraving}), it was explained that stem +directions influence spacing. This is controlled with the +@code{stem-spacing-correction} property in the +@internalsref{NoteSpacing}, object. These are generated for every @internalsref{Voice} context. The @code{StaffSpacing} object (generated at @internalsref{Staff} context) contains the same property -for controlling the stem/bar line spacing. The following example -shows these corrections, once with default settings, and once with +for controlling the stem/bar line spacing. The following example shows +these corrections, once with default settings, and once with exaggerated corrections: @lilypond[raggedright] @@ -1864,18 +1886,6 @@ exaggerated corrections: } @end lilypond -@cindex SpacingSpanner, overriding properties - -Properties of the @internalsref{SpacingSpanner} must be overridden -from the @code{\paper} block, since the @internalsref{SpacingSpanner} is -created before any property commands are interpreted. -@example -\paper @{ \context @{ - \Score - \override SpacingSpanner #'spacing-increment = #3.0 -@} @} -@end example - @seealso @@ -1898,6 +1908,33 @@ following work-around may be used to insert extra space into a score. No work-around exists for decreasing the amount of space. +@node Line length +@subsection Line length + +@cindex page breaks +@cindex breaking pages + +@cindex @code{indent} +@cindex @code{linewidth} + +The most basic settings influencing the spacing are @code{indent} and +@code{linewidth}. They are set in the @code{\paper} block. They +control the indentation of the first line of music, and the lengths of +the lines. + +If @code{raggedright} is set to true in the @code{\paper} +block, then the lines are justified at their natural length. This +useful for short fragments, and for checking how tight the natural +spacing is. + +@cindex page layout +@cindex vertical spacing + +The option @code{raggedlast} is similar to @code{raggedright}, but +only affects the last line of the piece. No restrictions are put on +that line. The result is similar to formatting text paragraphs. In a +paragraph, the last line simply takes its natural length. + @node Line breaking @subsection Line breaking @@ -1945,32 +1982,6 @@ This makes the following 28 measures (assuming 4/4 time) be broken every Internals: @internalsref{BreakEvent}. -@node Line length and line breaking -@subsection Line length and line breaking - -@cindex page breaks -@cindex breaking pages - -@cindex @code{indent} -@cindex @code{linewidth} - -The most basic settings influencing the spacing are @code{indent} and -@code{linewidth}. They are set in the @code{\paper} block. They -control the indentation of the first line of music, and the lengths of -the lines. - -If @code{raggedright} is set to true in the @code{\paper} -block, then the lines are justified at their natural length. This -useful for short fragments, and for checking how tight the natural -spacing is. - -@cindex page layout -@cindex vertical spacing - -The option @code{raggedlast} is similar to @code{raggedright}, but -only affects the last line of the piece. No restrictions are put on -that line. The result is similar to formatting paragraphs. In a -paragraph, the last line simply takes its natural length. @node Multiple movements @@ -2032,8 +2043,8 @@ the top of the file is inserted. @} @end example -@node Titling -@subsection Titling +@node Creating titles +@subsection Creating titles Titles are created for each @code{\score} block, and over a @code{\book}. @@ -2069,7 +2080,7 @@ This is a demonstration of the fields available, \book { \header { title = "Title" - subtitle = "(and (the) subtitle)" + subtitle = "and the subtitle" subsubtitle = "Sub sub title" poet = "Poet" composer = "Composer" @@ -2131,7 +2142,8 @@ The default page breaking may be overriden by inserting @code{\pageBreak} or @code{\noPageBreak} commands. These commands are analogous to @code{\break} and @code{\noBreak}. They should be inserted with a bar line. These commands force and forbid a page-break -from happening. +from happening. Of course, the @code{\pageBreak} command also forces +a line break. Page breaks are computed by the @code{page-breaking} function in the @code{\bookpaper} block. @@ -2159,6 +2171,17 @@ To change the paper size, there are two commands, @end example The second one sets the size of the @code{\paper} block that it is in. +The following paper sizes are supported. + +@table @code +@item a6 +@item a5 +@item a4 +@item a3 +@item legal +@item letter +@item tabloid +@end table @node Page layout @subsection Page layout @@ -2173,6 +2196,7 @@ footers to each page. The default layout responds to the following settings in the @code{\bookpaper} block + @cindex \bookpaper @table @code @@ -2241,15 +2265,16 @@ The following settings influence the header and footer layout. this boolean controls whether a pagenumber is printed. @end table -The page layout itself is done by two functions: -@code{page-music-height} and @code{page-make-stencil}. The former -tells the line-breaking algorithm how much space can be spent on a -page, the latter creates the actual page given the system to put on it. +The page layout itself is done by two functions in the +@code{\bookpaper}, @code{page-music-height} and +@code{page-make-stencil}. The former tells the line-breaking algorithm +how much space can be spent on a page, the latter creates the actual +page given the system to put on it. @seealso -Examples: @inputfileref{input/test/,page-breaks.ly} +Examples: @inputfileref{input/test,page-breaks.ly} @refbugs diff --git a/Documentation/user/invoking.itexi b/Documentation/user/invoking.itexi index 923fdc218d..271c4090a7 100644 --- a/Documentation/user/invoking.itexi +++ b/Documentation/user/invoking.itexi @@ -10,7 +10,6 @@ This chapter details the technicalities of running LilyPond. * Error messages:: * Reporting bugs:: * Editor support:: -* Point and click:: * Invoking lilypond-latex:: @end menu @@ -39,8 +38,8 @@ output). If @file{filename.ly} contains more than one @code{\score} block, then the rest of the scores will be output in numbered files, starting with @file{filename-1.tex}. Several files can be specified; they will each be processed independently. @footnote{The status of -GUILE is not reset across invocations, so be careful not to change any -system defaults from within Scheme.} +GUILE is not reset after processing a @code{.ly} files, so be careful +not to change any system defaults from within Scheme.} @section Command line options @@ -63,7 +62,7 @@ A comma separated list of back-end output formats to use. Choices are @code{tex} (for @TeX{} output, to be processed with La@TeX{}, and @code{ps} for PostScript. -Other output options are intended for developers. +There are other output options, but they are intended for developers. @cindex output format, setting @@ -97,7 +96,8 @@ of the score. Do not trust the @code{.ly} input. When LilyPond formatting available through a web server, the -@code{--safe} @b{MUST} be passed. This will prevent code like +@code{--safe} @b{MUST} be passed. This will prevent inline Scheme +code from wreaking havoc, for example @verbatim #(system "rm -rf /") @@ -109,7 +109,7 @@ When LilyPond formatting available through a web server, the The @code{--safe} option works by evaluating in-line Scheme expressions in a special safe module. This safe module is derived from GUILE @file{safe-r5rs} module, but adds a number of functions of the -LilyPond API. These functions are listed in @file{safe-lily.scm}. +LilyPond API. These functions are listed in @file{scm/safe-lily.scm}. In addition, @code{--safe} disallows @code{\include} directives and disables the use of backslashes in @TeX{} strings. @@ -324,129 +324,6 @@ information. @end table -@node Point and click -@section Point and click -@cindex point and click - -@cindex source specials -@cindex specials, source - -Point and click lets you find notes in the input by clicking on them in -the Xdvi window. This makes it easier to find input that causes some -error in the sheet music. - -To use it, you need the following software: -@itemize @bullet -@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}. - - 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}. - -Apparently, KDVI does not process PostScript specials correctly. Beams -and slurs will not be visible in KDVI. - -@cindex Xdvi -@cindex KDVI -@cindex KDE - - - -@end itemize -@item an editor with a client/server interface (or a lightweight GUI -editor): - -@cindex 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. - -@c move this elsewhere? - - -@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}. - -@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. - -To use point-and-click, add one of these lines to the top of your .ly -file: -@example -#(ly:set-point-and-click 'line) -@end example -@cindex line-location - -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. - -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 -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 @var{XEDITOR} is set to -@example -emacsclient --no-wait +%l %f -@end example -@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}. - -For using Vim, set @code{XEDITOR} to @code{gvim --remote +%l %f}, or -use this argument with Xdvi's @code{-editor} option. - -@cindex NEdit -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 and VIM. Users of Emacs 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-point-and-click} line -with the following line: -@example -#(ly:set-point-and-click 'line-column) -@end example -@cindex line-column-location -and set @code{XEDITOR} to @code{emacsclient --no-wait +%l:%c %f}. Vim -users can set @var{XEDITOR} to @code{gvim --remote +:%l:norm%c| %f}. diff --git a/Documentation/user/lilypond.tely b/Documentation/user/lilypond.tely index 6a2bbae5cf..a43f42ac91 100644 --- a/Documentation/user/lilypond.tely +++ b/Documentation/user/lilypond.tely @@ -170,12 +170,13 @@ this and other documentation. * Invoking LilyPond:: Operation. * Converting from other formats:: Converting to lilypond source format. * Integrating text and music:: Integrating text and music with lilypond-book. -* Unified index:: +* Literature list:: * Scheme tutorial:: * Notation manual details:: -* Literature list:: -* Cheat sheet:: +* Point and click:: +* Unified index:: * GNU Free Documentation License:: FDL. +* Cheat sheet:: @end menu @end ifnottex @@ -197,18 +198,20 @@ this and other documentation. @c FIXME: Index has two alphabetically sorted lists @code vs plain? -@node Unified index -@unnumbered Unified index -@printindex cp +@include literature.itely @include scheme-tutorial.itely @include notation-appendices.itely +@include point-and-click.itely -@include literature.itely +@node Unified index +@appendix Unified index -@include cheatsheet.itely +@printindex cp @include fdl.itexi +@include cheatsheet.itely + @bye diff --git a/Documentation/user/point-and-click.itely b/Documentation/user/point-and-click.itely new file mode 100644 index 0000000000..f099513e4b --- /dev/null +++ b/Documentation/user/point-and-click.itely @@ -0,0 +1,117 @@ +@node Point and click +@appendix Point and click +@cindex point and click + +@cindex source specials +@cindex specials, source + +Point and click lets you find notes in the input by clicking on them in +the Xdvi window. This makes it easier to find input that causes some +error in the sheet music. + +To use it, you need the following software: +@itemize @bullet +@item a dvi viewer that supports src specials. + +The most obvious choice is Xdvi@footnote{KDVI also provides src +@cindex Xdvi +@cindex KDVI +@cindex KDE +specials, but does not use the kpathsea library, so it cannot find +LilyPond font and PostScript library files.}, version 22.36 or newer. +It is available from +@uref{ftp://ftp.math.berkeley.edu/pub/Software/TeX/xdvi.tar.gz,ftp.math.berkeley.edu}. + + 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 an editor with a client/server interface (or a lightweight GUI +editor): + +@cindex 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. + +@c move this elsewhere? + + +@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}. + +@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. + +To use point-and-click, add one of these lines to the top of your .ly +file: +@example +#(ly:set-point-and-click 'line) +@end example +@cindex line-location + +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. + +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 +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 @var{XEDITOR} is set to +@example +emacsclient --no-wait +%l %f +@end example +@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}. + +For using Vim, set @code{XEDITOR} to @code{gvim --remote +%l %f}, or +use this argument with Xdvi's @code{-editor} option. + +@cindex NEdit +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 and VIM. Users of Emacs 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-point-and-click} line +with the following line: +@example +#(ly:set-point-and-click 'line-column) +@end example +@cindex line-column-location +and set @code{XEDITOR} to @code{emacsclient --no-wait +%l:%c %f}. Vim +users can set @var{XEDITOR} to @code{gvim --remote +:%l:norm%c| %f}. diff --git a/VERSION b/VERSION index 0fd203dda4..d30d78ded7 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=2 MINOR_VERSION=3 -PATCH_LEVEL=12 +PATCH_LEVEL=13 MY_PATCH_LEVEL= diff --git a/ly/declarations-init.ly b/ly/declarations-init.ly index ab2785d6c5..9031f1e3be 100644 --- a/ly/declarations-init.ly +++ b/ly/declarations-init.ly @@ -40,10 +40,6 @@ noBreak = #(make-event-chord (list (make-penalty-music 10001 0))) pageBreak = #(make-event-chord (list (make-penalty-music -10001 -10001))) noPageBreak = #(make-event-chord (list (make-penalty-music 0 10001))) -%% why these defines? -pagebreak = \pageBreak -noPagebreak = \noPageBreak - noBeam = #(make-music 'BeamForbidEvent) pipeSymbol = #(make-music 'BarCheck) -- 2.39.5