@node lilypond-book
@chapter lilypond-book
-[ The tutorial part is at the moment commented out and moved to
-the end of this document ]
-
[TODO: THIS MANUAL IS NOT FINISHED YET. FIXME.]
@command{lilypond-book} is a script that helps integrating lilypond with
overwritten.
If you use @code{--outdir}, you should also @code{cd} to that directory
-before running LaTeX or makeinfo.
-
-@strong{[UGH: IS THIS THE BEST WAY TO DO IT? MAYBE ADD A COMMENT LINE TO THE
-GENERATED FILE, SO LILYPOND-BOOK CAN TEST IF THE FILE IT IS TO OVERWRITE
-IS GENERATED.]}
+before running LaTeX or makeinfo. This may seem a little kludgy, but
+both Latex and makeinfo expect picture files (the music) to be in the
+current working directory. Moreover, if you do this, LaTeX will not
+clutter you normal working directory with output files.
@strong{About the input}
@email{tca@@gnu.org, Tom Cato Amundsen}
-
-
-@ignore
-
-So what does this look like? Well, here is an example:
-@lilypond[veryverbatim, intertext="produces this music:"]
-\score{
- \notes\relative c'{
- \time 5/8;
- [e16( g b c a g][e a b d] | )e2 d,8 |
- [e16( g b c a g][e a b d] | )b2 [a16( f] |
- [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] |
- [f( a b d b a][f a b d] | )e2
- }
-}
-@end lilypond
-If you are lucky, the above example show a nice feature of LilyPond
-and La@TeX{}. Since LilyPond can output the music as @TeX{} graphics,
-La@TeX{} can insert pagebreaks between the lines of music.
-
-Notice that there is no @code{\paper} statement in the example
-above. Lilypond-book will insert some code for you that defines the
-linewidth and the font to use. If you don't want to change the default,
-there is no need to put an empty @code{\paper@{@}} inside the @code{\score}.
-In the example above, something like
-this might be inserted before your code:
-@example
-\include "paper16.ly"
-\paper@{ \paper_sixteen
- linewidth = 390.\pt;
- castingalgorithm = \Gourlay;
-@}
-@end example
-The actual values for linewidth will differ depending on papersize and
-number of columns. Also, if you use a different fontsize for the
-music, another file than @code{paper16.ly} will be included.
-
-If you want to make the music not so wide, you can insert a
-@code{\paper} statement that set the linewidth:
-
-@lilypond[veryverbatim, intertext="produces this music:"]
-\score{
- \notes\relative c'{
- \time 5/8;
- [e16( g b c a g][e a b d] | )e2 d,8 |
- [e16( g b c a g][e a b d] | )b2 [a16( f] |
- [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] |
- [f( a b d b a][f a b d] | )e2
- }
- \paper{linewidth = 10.\cm;}
-}
-@end lilypond
-
-Very often, if you mix music and text, the music is often only a
-few notes or at most a few bars. This music should be as short as
-possible and not stretched to be aligned to the right margin.
-
-If you only write voice-contents in the lilypond block, @command{lilypond-book}
-will set the @code{linewidth} variable to -1, so Lilypond
-will make the music as short as possible but without breaking the
-line. Here is a well know harmonic progression:
-@lilypond[veryverbatim, intertext="produce a well known harmonic progression:"]
- \context Voice { <c' e g> <b d g> <c2 e g> }
-@end lilypond
-
-If you want to place music examples in the text,
-@lilypond[eps]
-\context Voice { <c' e g> <b d g> <c2 e g>}
-@end lilypond
-, you can use the @code{eps} option. This will create the music as
-eps graphics and include it into the document with the
-@code{\includegraphics} command.
-
-The code used look like this:
-@example
-@@lilypond[eps]
- \context Voice { <c' e g> <b d g> <c2 e g> }
-@@end lilypond
-@end example
-
-You can also use the @code{eps} option if the block is a complete
-lilypond source. This 5 cm long empty line,
-@lilypond[eps]
-\score{
- \notes{s}
- \paper{ linewidth = 5.\cm;}
-}
-@end lilypond
-was created with this code:
-@example
-@@lilypond[eps]
-\score@{
- \notes@{s@}
- \paper@{ linewidth = 5.\cm;@}
-@}
-@@end lilypond
-@end example
-
-To avoid that La@TeX{} places the music on a line of its one, there should
-be no empty lines between the normal text and the lilypond
-environment.
-
-You can also use @code{lilypondfile} (on a separate line, FIXME), to
-include another file.
-
-@section Fontsize options You can use all lilypond fontsizes in
-@command{lilypond-book}. The default 16pt fontsize is probably to big to be
-included in the middle of the text, 11pt or 13pt is probably better.
-
-The code can look like this:
-@example
-@@lilypond[13pt, eps]
-<c' e g>
-@@end lilypond
-@end example
-
-The following options set the fontsize:
-@itemize
-@item @code{11pt}
-@lilypond[11pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end lilypond
-@item @code{13pt}
-@lilypond[13pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end lilypond
-@item @code{16pt}
-@lilypond[16pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end lilypond
-@item @code{20pt}
-@lilypond[20pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end lilypond
-@item @code{26pt}
-@lilypond[26pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end lilypond
-@end itemize
-
-
-@section More options
-@itemize
-@item The @code{singleline} option set @code{linewidth} to -1.0.
-@item The @code{multiline} option set @code{linewidth} to a value letting
-the music be aligned to the right margin. The music can span several
-lines.
-@end itemize
-
-@section Just in case...
-The options @code{fragment} and @code{nonfragment} will override
-@command{lilypond-book} when it scans the lilypond code to see if it is voice
-contents or complete code. This might be useful if @command{lilypond-book} choose
-wrong.
-
-Since there is no finder's fee which doubles every year, there is no
-need to wait for the price money to grow. So send a bug report today
-if you need this one of these options.
-
-@section Examples
-
-This was all options to @code{\begin}. The rest of the lilypond
-document will show some ways you can use lilypond in
-La@TeX{} documents. It will also act as a simple test-suite for
-lilypond-book. You can place @code{eps} lilypond in and marginspars just
-as any other included eps graphics.
-
-@lilypond
-\score{
- \notes\relative c'{
- \time 12/8;
- r4-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--]
- [f16-.( )f-. dis8-- gis16-.( )gis-.] cis4.-\fermata |
-
- r4.-\fermata [cis,16 cis g'8 f16 f b8][g16 g f8 b16 b] dis4.-\fermata
- }
- \paper{linewidth = 7.\cm;}
-}
-@end lilypond
-
-
-To the right you can see some bars from the trumpet fanfara from the
-beginning of the fantastic street opera ``Houdini the Great'', by the
-Danish composer Andy Pape. The music is put inside a
-@code{floatingfigure} environment, and the music will be aligned by
-the right marging if you set floatingfigure width and lilypond linewidth
-to the same value. The code looks like this:
-
-@lilypond[verbatim]
-\score{
- \notes\relative c'{
- \time 12/8;
- r4.-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--]
- [f16-.( )f-. dis8-- gis16-.( )gis-.] cis8.-\fermata |
-
- r4.-\fermata [cis,16 cis g'8 f16 f b8]
- [g16 g f8 b16 b] dis4.-\fermata
- }
- \paper{linewidth = 7.\cm;}
-}
-@end lilypond
-
-If you have a lot of small music examples like this in the middle of
-your text, you might get a nicer look by using ``double'' line
-spacing. Put the @code{\linespread@{1.6@}} command into the preamble of
-your document. Then the line spacing will not be increased between the
-lines where you have music printed with the smallest font size.
-
-Lilypond-book does know about @code{\onecolumn} and @code{\twocolumn}.
-So the music will be adjusted to the new linewith:
-
-Verbatim environments will also ignore the page margins. That is
-a feature of La@TeX{}. (But you usually put things inside a verbatim
-environment when you don't want La@TeX{} to do any linebreaking)
-
-@end ignore
* Tutorial:: A tutorial introduction to LilyPond.
* Reference Manual:: Reference Manual.
* Mutopia project:: Mutopia project.
-* Tricks:: Features, tips and tricks.
* Invoking LilyPond:: Operation.
* Bug reports:: Where to report bugs.
* ly2dvi:: Generating nice output with titles.
@mbinclude tutorial.itely
@mbinclude refman.itely
@mbinclude mutopia.itely
-@mbinclude tricks.itely
@mbinclude internals.itely
@mbinclude invoking.itexi
@mbinclude bugs.itexi
-
@node Mutopia project
@chapter Mutopia project
@cindex mutopia project
@cindex sheet music archive
+[TODO:
+
+* different name. Ports sucks
+
+* drop for 1.4
+
+* mutopia is rather offtopic in the lilypond manual
-The Mutopia project needs your help. Mutopia is a collection of
-public domain sheet music. All the music on Mutopia is completely
-free to download, print out, perform and distribute. Mutopia is
-similar in spirit to Project Gutenburg - but consists of a growing
-collection of free music. You can help the project by entering music
-(either by hand, or by converting from scans or MIDI) and submitting
-it. Point your browser to the @uref{http://www.mutopiaproject.org}.
+]
+Mutopia is a collection of public domain sheet music. All the music
+on Mutopia is completely free to download, print out, perform and
+distribute. Mutopia is similar in spirit to Project Gutenburg. You can
+help the project by entering music (either by hand, or by converting
+from scans or MIDI) and submitting it. Point your browser to the
+@uref{http://www.mutopiaproject.org}.
+
@menu
* Mutopia ports collection::
@end menu
@cindex mutopia ports collection
-We're working on a ports collection for LilyPond. The aim is to make
-all music in Mutopia very easily accessible for LilyPond users
-to study, edit and print.
-
-A somewhat functional experimental tree will be available in version
-1.3.141. It should then be very easy to
+The ports collection to makes all music in Mutopia very easily
+accessible for LilyPond users to study, edit and print. The
+ports-system performs the following functions:
@enumerate 1
- download anything from Mutopia
- compile for printing or for Mutopia submission
- publish and package for Mutopia
+@item download anything from Mutopia
+@item compile for printing or for Mutopia submission
+@item publish and package for Mutopia
@end enumerate
Type @samp{make help} in @file{ports} directory to see possible
targets.
+@ignore
[TODO]
Now that we have the @samp{make sync} target, maybe we should
@end example
Disadvantage: no clue of available titles.
+@end ignore
+
* A piano excerpt:: Piano music
* An orchestral score::
* Part extraction::
+* Latex and texinfo integration::
* end of tutorial:: The end
* Pre-cooked makefile::
@end menu
skipBars = ##t
@end example
+@node Latex and texinfo integration
+@section Latex and texinfo integration
+
+So what does this look like? Well, here is an example:
+@lilypond[veryverbatim, intertext="produces this music:"]
+\score{
+ \notes\relative c'{
+ \time 5/8;
+ [e16( g b c a g][e a b d] | )e2 d,8 |
+ [e16( g b c a g][e a b d] | )b2 [a16( f] |
+ [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] |
+ [f( a b d b a][f a b d] | )e2
+ }
+}
+@end lilypond
+If you are lucky, the above example show a nice feature of LilyPond
+and La@TeX{}. Since LilyPond can output the music as @TeX{} graphics,
+La@TeX{} can insert pagebreaks between the lines of music.
+
+Notice that there is no @code{\paper} statement in the example
+above. Lilypond-book will insert some code for you that defines the
+linewidth and the font to use. If you don't want to change the default,
+there is no need to put an empty @code{\paper@{@}} inside the @code{\score}.
+In the example above, something like
+this might be inserted before your code:
+@example
+\include "paper16.ly"
+\paper@{ \paper_sixteen
+ linewidth = 390.\pt;
+ castingalgorithm = \Gourlay;
+@}
+@end example
+The actual values for linewidth will differ depending on papersize and
+number of columns. Also, if you use a different fontsize for the
+music, another file than @code{paper16.ly} will be included.
+
+If you want to make the music not so wide, you can insert a
+@code{\paper} statement that set the linewidth:
+
+@lilypond[veryverbatim, intertext="produces this music:"]
+\score{
+ \notes\relative c'{
+ \time 5/8;
+ [e16( g b c a g][e a b d] | )e2 d,8 |
+ [e16( g b c a g][e a b d] | )b2 [a16( f] |
+ [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] |
+ [f( a b d b a][f a b d] | )e2
+ }
+ \paper{linewidth = 10.\cm;}
+}
+@end lilypond
+
+Very often, if you mix music and text, the music is often only a
+few notes or at most a few bars. This music should be as short as
+possible and not stretched to be aligned to the right margin.
+
+If you only write voice-contents in the lilypond block, @command{lilypond-book}
+will set the @code{linewidth} variable to -1, so Lilypond
+will make the music as short as possible but without breaking the
+line. Here is a well know harmonic progression:
+@lilypond[veryverbatim, intertext="produce a well known harmonic progression:"]
+ \context Voice { <c' e g> <b d g> <c2 e g> }
+@end lilypond
+
+If you want to place music examples in the text,
+@lilypond[eps]
+ \context Voice { <c' e g> <b d g> <c2 e g> }
+@end lilypond
+, you can use the @code{eps} option. This will create the music as
+eps graphics and include it into the document with the
+@code{\includegraphics} command.
+
+The code used look like this:
+@example
+@@lilypond[eps]
+ \context Voice @{ <c' e g> <b d g> <c2 e g> @}
+@@end lilypond
+@end example
+
+You can also use the @code{eps} option if the block is a complete
+lilypond source. This 5 cm long empty line,
+@lilypond[eps]
+\score{
+ \notes{s}
+ \paper{ linewidth = 5.\cm;}
+}
+@end lilypond
+was created with this code:
+@example
+@@lilypond[eps]
+\score@{
+ \notes@{s@}
+ \paper@{ linewidth = 5.\cm;@}
+@}
+@@end lilypond
+@end example
+
+To avoid that La@TeX{} places the music on a line of its one, there should
+be no empty lines between the normal text and the lilypond
+environment.
+
+You can also use @code{lilypondfile} (on a separate line, FIXME), to
+include another file.
+
+@subsection Fontsize options
+
+You can use all lilypond fontsizes in @command{lilypond-book}. The
+default 16pt fontsize is probably to big to be included in the middle of
+the text, 11pt or 13pt is probably better.
+
+The code can look like this:
+@example
+@@lilypond[13pt, eps]
+<c' e g>
+@@end lilypond
+@end example
+
+The following options set the fontsize:
+@itemize
+@item @code{11pt}
+@lilypond[11pt, eps]
+ \relative c'{
+ r16 [c d e][f d e c] [g'8 c][b-\prall c] |
+ [d16 g, a b][c a b g][d'8 g f-\prall g]
+ }
+@end lilypond
+@item @code{13pt}
+@lilypond[13pt, eps]
+ \relative c'{
+ r16 [c d e][f d e c] [g'8 c][b-\prall c] |
+ [d16 g, a b][c a b g][d'8 g f-\prall g]
+ }
+@end lilypond
+@item @code{16pt}
+@lilypond[16pt, eps]
+ \relative c'{
+ r16 [c d e][f d e c] [g'8 c][b-\prall c] |
+ [d16 g, a b][c a b g][d'8 g f-\prall g]
+ }
+@end lilypond
+@item @code{20pt}
+@lilypond[20pt, eps]
+ \relative c'{
+ r16 [c d e][f d e c] [g'8 c][b-\prall c] |
+ [d16 g, a b][c a b g][d'8 g f-\prall g]
+ }
+@end lilypond
+@item @code{26pt}
+@lilypond[26pt, eps]
+ \relative c'{
+ r16 [c d e][f d e c] [g'8 c][b-\prall c] |
+ }
+@end lilypond
+@end itemize
+
+
+@subsection More options
+
+@itemize
+@item The @code{singleline} option set @code{linewidth} to -1.0.
+@item The @code{multiline} option set @code{linewidth} to a value letting
+the music be aligned to the right margin. The music can span several
+lines.
+@end itemize
+
+@subsection Just in case...
+The options @code{fragment} and @code{nofragment} will override
+@command{lilypond-book} when it scans the lilypond code to see if it is voice
+contents or complete code. This might be useful if @command{lilypond-book} choose
+wrong.
+
+Since there is no finder's fee which doubles every year, there is no
+need to wait for the price money to grow. So send a bug report today
+if you need this one of these options.
+
+@subsection Examples
+
+This was all options to @code{\begin}. The rest of the lilypond
+document will show some ways you can use lilypond in
+La@TeX{} documents. It will also act as a simple test-suite for
+lilypond-book. You can place @code{eps} lilypond in and marginspars just
+as any other included eps graphics.
+
+@lilypond
+\score{
+ \notes\relative c'{
+ \time 12/8;
+ r4-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--]
+ [f16-.( )f-. dis8-- gis16-.( )gis-.] cis4.-\fermata |
+
+ r4.-\fermata [cis,16 cis g'8 f16 f b8][g16 g f8 b16 b] dis4.-\fermata
+ }
+ \paper{linewidth = 7.\cm;}
+}
+@end lilypond
+
+
+To the right you can see some bars from the trumpet fanfara from the
+beginning of the fantastic street opera ``Houdini the Great'', by the
+Danish composer Andy Pape. The music is put inside a
+@code{floatingfigure} environment, and the music will be aligned by
+the right marging if you set floatingfigure width and lilypond linewidth
+to the same value. The code looks like this:
+
+@lilypond[verbatim]
+\score{
+ \notes\relative c'{
+ \time 12/8;
+ r4.-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--]
+ [f16-.( )f-. dis8-- gis16-.( )gis-.] cis8.-\fermata |
+
+ r4.-\fermata [cis,16 cis g'8 f16 f b8]
+ [g16 g f8 b16 b] dis4.-\fermata
+ }
+ \paper{linewidth = 7.\cm;}
+}
+@end lilypond
+
+If you have a lot of small music examples like this in the middle of
+your text, you might get a nicer look by using ``double'' line
+spacing. Put the @code{\linespread@{1.6@}} command into the preamble of
+your document. Then the line spacing will not be increased between the
+lines where you have music printed with the smallest font size.
+
+Lilypond-book does know about @code{\onecolumn} and @code{\twocolumn}.
+So the music will be adjusted to the new linewith:
+
+Verbatim environments will also ignore the page margins. That is
+a feature of La@TeX{}. (But you usually put things inside a verbatim
+environment when you don't want La@TeX{} to do any linebreaking)
+
+
@node end of tutorial
@section The end
--- /dev/null
+\header {
+texidoc = "
+
+There are several ways to calculate the direction of a beam.
+@table @code
+@item majority
+number count of up or down notes
+@item mean
+mean center distance of all notes
+@item median
+mean centre distance weighted per note
+@end table
+
+You can spot the differences of these settings from these simple
+examples:
+
+These beam direction functions are defined in @file{scm/beam.scm}. If
+your favourite algorithm isn't one of these, you can hook up your own.
+";
+}
+
+\paper { linewidth = -1.;}
+\score { \notes \relative c {
+ [d''8 a]
+ \property Voice.Beam \set #'dir-function = #beam-dir-mean
+ [d a]
+ \property Voice.Beam \set #'dir-function = #beam-dir-median
+ [d a]
+}}
+\score { \notes \relative c {
+ \time 3/8;
+ [d''8 a a]
+ \property Voice.Beam \set #'dir-function = #beam-dir-mean
+ [d a a]
+ \property Voice.Beam \set #'dir-function = #beam-dir-median
+ [d a a]
+}}
+
--- /dev/null
+\header { texidoc = "
+The direction of a perfectly centred beams can be
+controlled through @code{Voice.Beam}'s grob-property
+@code{default-neutral-direction}
+";}
+
+\paper { linewidth = -1.;}
+\score {\notes \relative c {
+ [b''8 b]
+ \property Voice.Beam \set #'default-neutral-direction = #-1
+ [b b]
+}}
--- /dev/null
+\header { texidoc = "
+Conventionally, stems and beams extend to the middle staff line. This
+extension can be controlled through @code{Voice.Stem}'s grob-property
+@code{no-stem-extend}:
+";}
+
+\paper { linewidth = -1.;}
+\score {\notes \relative c {
+ \grace a'8 a4
+ \property Voice.Stem \set #'no-stem-extend = ##t
+ \grace g8 g4 [g8 g]
+}}
+\header {
+ texidoc = "By inserting the @TeX{} command \embeddedps, you can
+insert postscript directly into the output.
+
+TODO: make molecule-callback to do this.
+ ";
+}
\score {
\notes \relative c'' {
/*
TODO: fixme, fucks up if called twice on the same set of rests.
+
+ TODO: look at horizontal-shift to determine ordering between rests
+ for more than two voices.
+
*/
SCM
Rest_collision::do_shift (Grob *me, SCM elts)
(grob-property-description 'dependencies list? "list of score-grob pointers that indicate who to compute first for certain global passes.")
(grob-property-description 'details list? "alist of parameters for detailed grob behavior.")
(grob-property-description 'dir-forced boolean? "set if direction has been forced; read by Beam.")
-(grob-property-description 'dir-function procedure? "function of type (count total)->direction. Default value: beam-dir-majority, also available: beam-dir-mean, beam-dir-median.")
+(grob-property-description 'dir-function procedure? "function of type (count total)->direction. Default value: beam-dir-majority, also available: beam-dir-mean, beam-dir-median.
+
+The ways to calculate the direction of a beam work as follows:
+@table @code
+@item majority
+number count of up or down notes
+@item mean
+mean center distance of all notes
+@item median
+mean centre distance weighted per note
+@end table
+
+")
(grob-property-description 'dir-list list? "list of stem directions, needed for optical spacing correction.")
(grob-property-description 'direction dir? "up or down, left or right?.")
(grob-property-description 'direction-source ly-grob? "in case side-relative-direction is set, which grob to get the direction from .")
program_version = '@TOPLEVEL_VERSION@'
if program_version == '@' + 'TOPLEVEL_VERSION' + '@':
- program_version = '1.3.113'
+ program_version = '1.4pre'
include_path = [os.getcwd()]