@lilypondfile[printfilename]{noteheadstyle.ly}
+@lilypondfile[printfilename]{easy-notation.ly}
+
@lilypondfile[printfilename]{dots.ly}
@lilypondfile[printfilename]{accidental.ly}
@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\notes\relative c'' {
gis1_"sharp" s s2
gisis1_"db. sharp" s s2
@lilypond[13pt,eps]
\emptyText
-%\property Voice.textEmptyDimension = ##t
-\property Voice.textStyle = "large"
+%\property Voice.textNonEmpty = ##f
+\property Voice.TextScript \set #'font-style = #'large
\notes\relative c'' {
\key d \major;
\time 4/4;
<d4_"notation" a fis> r
-{ \property Grace.flagStyle = ""
+{ \property Grace.Stem \override #'flag-style = ##f
\grace g16 }
fis8 e16 fis
-{ \property Grace.flagStyle = ""
+{ \property Grace.Stem \override #'flag-style = ##f
\grace a16 }
g8 fis16 g | a4 \bar "||"; }
\notes\relative c'' {
@lilypond[13pt,eps]
\emptyText
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\notes\relative c'' {
\key as \major;
\time 2/4;
@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\emptyText
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\notes\relative c'' {
[g8_"1/8" g g g] s16
[g16_"1/16" g g g] s16
@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\property Voice.textNonEmpty = ##t
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\time 4/4;
\notes\relative c'' {
<g1_"major" b d>
@
@lilypond[13pt,eps]
-\property Score.timeSignatureStyle = "C2/2"
+\property Score.TimeSignature \override #'style = #'C2/2
\context GrandStaff <
\notes\relative c' {
\key bes \major;
@
@lilypond[13pt,eps]
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\key g \major; \time 4/4;
\notes\relative c'' { d1 | g,4^\segno a b c | b a g2_"d.s." \bar "|."; }
@end lilypond
@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
-\property Lyrics.textStyle = "large"
-\property Voice.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
+\property Voice.TextScript \set #'font-style = #'large
\addlyrics
\notes\relative c' {
c1 d
@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
-\property Lyrics.textStyle = "large"
-\property Voice.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
+\property Voice.TextScript \set #'font-style = #'large
\addlyrics
\notes\relative c' {
d1
@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
-\property Lyrics.textStyle = "large"
-\property Voice.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
+\property Voice.TextScript \set #'font-style = #'large
\addlyrics
\notes\relative c' {
\property Voice.textScriptPadding = #-10
@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
-\property Lyrics.textStyle = "large"
-\property Voice.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
+\property Voice.TextScript \set #'font-style = #'large
\addlyrics
\notes\relative c' {
f1 g a
@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
-\property Lyrics.textStyle = "large"
-\property Voice.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
+\property Voice.TextScript \set #'font-style = #'large
\addlyrics
\notes\relative c'' {
g1 a
@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
-\property Lyrics.textStyle = "large"
-\property Voice.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
+\property Voice.TextScript \set #'font-style = #'large
\addlyrics
\notes\relative c'' {
a1
@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
-\property Lyrics.textStyle = "large"
-\property Voice.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
+\property Voice.TextScript \set #'font-style = #'large
\addlyrics
\notes\relative c' {
c1 d
@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
-\property Lyrics.textStyle = "large"
-\property Voice.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
+\property Voice.TextScript \set #'font-style = #'large
\addlyrics
\notes\relative c'' {
a1
@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
-\property Lyrics.textStyle = "large"
-\property Voice.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
+\property Voice.TextScript \set #'font-style = #'large
\addlyrics
\notes\relative c'' {
a1
@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
-\property Lyrics.textStyle = "large"
-\property Voice.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
+\property Voice.TextScript \set #'font-style = #'large
\addlyrics
\notes\relative c'' {
a1
@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\notes\relative c'' {
gis1_"g sharp" s as1_"a flat" s s
< des_"dim fifth" g,! > s s < cis_"augm fourth" g! > s s
@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\property Staff.clefStyle = #"fullSizeChanges"
-\property Lyrics.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
\addlyrics
\notes\relative c {
% \clef "F3";
@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\emptyText
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\notes\relative c'' {
g8_"1/8" s8
g16_"1/16" s8
@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
-\property Lyrics.textStyle = "large"
-\property Voice.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
+\property Voice.TextScript \set #'font-style = #'large
\addlyrics
\notes\relative c'' {
< g1 e c > < a f d > < b g e >
< c a f > < d b g > < e c a > < f d b > }
-\context Lyrics \lyrics { T Sp Dp S D Tp "D{\\kern-5pt}$\\mid$" }
+\context Lyrics \lyrics { T Sp Dp S D Tp "D{\\kern-5pt}$\\mid$" }
@end lilypond
@item G
@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\property Staff.clefStyle = #"fullSizeChanges"
-\property Lyrics.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
\addlyrics
\notes\relative c'' {
\clef french;
\time 4/4;
\clef treble;
\partial 4; < c4 g e > | < c a f > < b g d > < c2 g e > }
- \property Lyrics.textStyle = "large"
+ \property Lyrics.LyricText \set #'font-style = #'large
\addlyrics
\notes\relative c {
\clef bass;
@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\notes\relative c'' {
<g1_"unisone" g> s
<g1_"third" b> s
@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\notes\relative c'' {
<g1_"second" a> s
<g1_"seventh" f'> s
@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
-\property Lyrics.textStyle = "large"
-\property Voice.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
+\property Voice.TextScript \set #'font-style = #'large
\addlyrics
\notes\relative c'' {
< g1 g > s
@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
-\property Lyrics.textStyle = "large"
-\property Voice.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
+\property Voice.TextScript \set #'font-style = #'large
\addlyrics
\notes\relative c'' {
< g1^"perfect" c > s
@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
-\property Lyrics.textStyle = "large"
-\property Voice.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
+\property Voice.TextScript \set #'font-style = #'large
\addlyrics
\notes\relative c'' {
< gis1^"dimin" f'! > s
@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\notes\relative c'' {
< g1_"second" a > s < g'_"seventh" a, > s \bar "||";
< g,_"third" b > s < g'_"sixth" b, > s \bar "||";
@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\emptyText
-\property Lyrics.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
\addlyrics
\notes\relative c'' {
c4( d )e \bar "||";
@
@lilypond[13pt,eps]
-\property Score.timeSignatureStyle = "C2/2"
+\property Score.TimeSignature \override #'style = #'C2/2
\emptyText
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\notes\relative c'' {
\time 4/4;
\key g \major;
@
@lilypond[13pt,eps]
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\property Score.barNonAuto = ##t
\notes\relative c'' {
\property Voice.noteHeadStyle = #'mensural
@end lilypond
@lilypond[13pt,eps]
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\property Score.barNonAuto = ##t
\notes\relative c'' {
r\longa_"longa" r\breve_"breve"
@lilypond[13pt,eps]
\emptyText
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\notes\relative c'' {
\time 4/4;
g4._"pointed" g8 g2 | g4 () g8 g g2 \bar "||";
@
@lilypond[13pt,eps]
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\emptyText
\notes\relative c'' {
\time 4/4;
<
\context Staff = sa {
\emptyText
- \property Voice.textStyle = "large"
+ \property Voice.TextScript \set #'font-style = #'large
\notes\relative c'' {
c2._"pre-1850" b4\trill | c1 \bar "||";
c2._"post-1850" b4\trill | c1 \bar "||";
<
\context Staff = sa {
\emptyText
- \property Voice.textStyle = "large"
+ \property Voice.TextScript \set #'font-style = #'large
\notes\relative c'' {
a4_"turn" b\turn c2 \bar "||";
g4_"mordent" a b\mordent a \bar "||";
@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\notes\relative c' {
\key es \major;
es1_"e flat major" f g as bes c d es
@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
-\property Lyrics.textStyle = "large"
+\property Lyrics.LyricText \set #'font-style = #'large
\property Lyrics.minVerticalAlign = 8
\addlyrics
\notes\relative c' {
\property Score.noAutoBeaming = ##t
\property Score.barNonAuto = ##t
\emptyText
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\notes\relative c'' {
g2_"1/2" g' s16
g,4_"1/4" g' s16
@lilypond[13pt,eps]
\emptyText
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\time 4/4;
\notes\relative c' {
\partial 4;
< bes8 g > as < as f > g < g es > f < d f > es | < g4 es > }
>
}
- \property Voice.textStyle = "large"
- \property Lyrics.textStyle = "Large"
+ \property Voice.TextScript \set #'font-style = #'large
+ \property Lyrics.LyricText \set #'font-style = #'Large
\property Lyrics.minVerticalAlign = 6
\addlyrics
\notes\relative c' {
@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
-\property Voice.textStyle = "large"
+\property Voice.TextScript \set #'font-style = #'large
\notes\relative c' {
% e2:32_"a" f:32 [ e8:16 f:16 g:16 a:16 ] s4 [:32 e1_"b" g]
% e2:32_"a" f:32 [ e8:16 f:16 g:16 a:16 ] s4 \repeat "tremolo" 16 { e32_"b" g }
in the output (@TeX{}) files, and latex is finally run to create
one or more DVI files.
-The majority of this utility came from a bourne script written by Jan
-Arne Fagertun name @file{ly2dvi}.
-
@subsection Invoking ly2dvi
@example
@unnumberedsec Options
@table @code
-@item -D,--debug
- Set debug mode. There are two levels - in level one some debug
- info is written, in level two the command @strong{set -x} is run, which
- echoes every command in the ly2dvi script.
-@item -F,--headers=
- Name of additional La@TeX{} headers file. This is included in the
- tex file at the end of the headers, last line before @code{\begin@{document@}}
-@item -H,--Heigth=
- Set paper heigth (points). Used together with width and La@TeX{} name of
- papersize in case of papersize unknown to ly2dvi.
-@item -K,--keeplilypond
- Keep LilyPond output after the run.
-@item -L,--landscape
- Set landscape orientation - portrait is the default.
- Use together with @code{dvips -t landscape} if you run dvips
- separately.
-@item -N,--nonumber
- Switch off page numbering.
-@item -O,--orientation=
- Set orientation landscape - obsolete, use @strong{-L} instead.
+@item -s,--set=@var{KEY}=@var{VAL}
+ Add @var{key}= @var{val} to the settings, overriding those specified
+in the files. Possible keys: language, latexheaders, latexpackages,
+papersizename, pagenumber, linewidth, orientation, textheight.
+
+@item -k,--keep
+ Keep the temporary directory including LilyPond and ly2dvi output
+files. The temporary directory is created in the current directory as @code{ly2dvi.dir}.
@item -P,--postscript
- In addition to the DVI file, also Generate a postsript file.
-@item -W,--Width=
- Set paper width (points). Used together with heigth and La@TeX{} name of
- papersize in case of papersize unknown to ly2dvi.
-@item -d,--dependencies
- Tell LilyPond to make dependencies file.
+ Generate PostScript in stead of DVI.
+@item --no-lily
+ Do not run LilyPond; useful for debugging ly2dvi.
@item -h,--help
Print help.
-@item -k,--keeply2dvi
- Keep the La@TeX{} file after the run.
-@item -l,--language=
- Specify La@TeX{} language.
- (@strong{-l norsk} produces @code{\usepackage[norsk]@{babel@}}).
-@item -o,--output=
- Set output directory.
-@item -p,--papersize=
- Specify papersize.
- (@strong{-p a4} produces @code{\usepackage[a4paper]@{article@}})
-@item -s,--separate
- Normally all output files are included into one La@TeX{} file.
- With this switch all files are run separately, to produce one
- DVI file for each.
-@end table
-
-
-@subsection Features
-
-Ly2dvi responds to several parameters specified in the LilyPond
-file. They are overridden by corresponding command line options.
+@item -I,--include
+ Add to the lilypond include path.
+@item -d,--dependencies
+ Make a dependency file for the output.
+@item --outdir=@var{dir}
+ Generate output (including MIDI files) in @var{dir}
-@table @code
-@item language="";
- Specify La@TeX{} language
-@item latexheaders="";
- Specify additional La@TeX{} headers file
-@item orientation="";
- Set orientation.
-@item paperlinewidth="";
- Specify the width (pt, mm or cm) of the printed lines.
-@item papersize="";
- Specify name of papersize.
@end table
-@subsection Environment
-
-@table @code
-@item LILYPONDPREFIX
- Sets the root directory of the LilyPond installation
-@item LILYINCLUDE
- Additional directories for input files.
-@item TMP
- Temporary directory name. Default is /tmp
-@end table
+@subsection Titling layout
-@subsection Files
-
-@file{titledefs.tex} is inspected for definitions used to extract
-additional text definitions from the LilyPond file. In the current
-version the following are defined:
+Ly2dvi extracts the following header fields from the .ly files to
+generate titling:
@table @code
@item title
Name of the piece, leftflushed below the instrument
@end table
-@file{$LILYPONDPREFIX/share/.lilyrc $HOME/.lilyrc ./.lilyrc} are files
-to set up default running conditions. On Windows OS initialization
-files are named @file{_lilyrc}. The file syntax is as follows:
-@example
-VARIABLE-NAME=VALUE
-@end example
-
+@subsection Additional parameters
-Where @strong{VARIABLE-NAME} is the name of the variable documented below
-and @strong{VALUE} is either a string, a 1, or a 0. All files are parsed,
-in the shown sequence. In the current version the following are
-allowed:
+Ly2dvi responds to several parameters specified in the LilyPond
+file. They can be overridden by supplying the @code{--set} command line
+option.
@table @code
-@item DEBUG=value
-This turns off (default) or on the debug capabilities. Possible
-values are 0 (off) and 1 (on).
-@item DEPENDENCIES=value
-This turns off (default) or on the ability to generate a Makefile
-dependency list. Possible values are 0 (off) and 1 (on).
-@item KEEPLILYPOND=value
-This turns off (default) or on the ability to keep the log file
-associated with the LilyPond job. Possible values are 0 (off) and 1
-(on).
-@item KEEPLY2DVI=value
-This turns off (default) or on the ability to keep the temporary files
-that are generated by the ly2dvi job. Possible values are 0 (off) and
-1 (on)
-@item LANGUAGE=value
-Specify La@TeX{} language. Possible value is a valid La@TeX{} language.
-@item LATEXHF=value
-Specify additional La@TeX{} headers file. Possible value is a file
-specification.
-@item LILYINCLUDE=value
-Additional directories for input files. Possible value is a delimited
-directory path list.
-@item LILYPONDPREFIX=value
-This defines the LilyPond root directory. Possible value is a valid
-directory specification to the LilyPond distribution location.
-@item NONUMBER=value
-This turns off (default) or on the page numbering capability.
-Possible values are 0 (page numbering enabled) and 1 (page numbering
-disabled).
-@item ORIENTATION=value
-This sets the image orientation. Possible values are
-portrait (default) and landscape.
-@item OUTPUTDIR=value
-This defines the directory where the resultant files will be
-generated. Possible value is a valid directory specification.
-Default is the current working directory.
-@item PAPERSIZE=value
-This defines the papersize the image will be sized to fit. Possible
-values are a0, a1, a2, a3, a4 (default), a5, a6, a7, a8, a9, a10, b0,
-b1, b2, b3, b4, b5, archA, archB, archC, archD, archE, flsa, flse,
-halfletter, ledger, legal, letter, or note.
-@item PHEIGHT=value
-Specify paperheight (points - an inch is 72.27, a cm is 28.453 points).
-@item POSTSCRIPT=value
-This turns off (default) or on the capability of additionally
-generating a postscript file. Possible values are 0 (off) and 1 (on).
-@item PWIDTH=value
-Specify paperwidth (points - an inch is 72.27, a cm is 28.453 points).
-@item SEPARATE=value
-This turns off (default) or on the capability of generating multiple
-dvi and postscript files from multiple source files. The default is
-to generate a concatenation of the source files. Possible values are
-0 (single file) and 1 (separate files).
-@item TMP=value
-This defines the emporary directory. Actually this is not used at the
-present. Possible value is a valid directory specification that is
-writable to the user.
-@end table
+@item language
+ Specify La@TeX{} language: the @code{babel} package will be
+included. Default: unset.
-@subsection Initialization Sequence
-The initialization process reads inputs for several sources. Below is
-a list of priorities for lowest to hightest proirity.
+ Read from the @code{\header} block.
-[FIXME: should use ly2dvirc iso lilyrc]
+@item latexheaders
+ Specify additional La@TeX{} headers file.
-@itemize @bullet
-@item Program's defaults
-@item Values found in LilyPond output file
-@item Environment variables
-@item $LILYPONDPREFIX/share/lilypond/.lilyrc
-@item $HOME/.lilyrc
-@item ./.lilyrc
-@item command line options
-@end itemize
+ Normally read from the @code{\header} block. Default value: empty
-@subsection Bugs
+@item latexheaders
+ Specify additional La@TeX{} packages file. This works cumulative,
+so you can add multiple packages using multiple @code{-s=latexpackages} options.
+ Normally read from the @code{\header} block. Default value:
+@code{geometry}.
-If find something that you consider a bug, please send a bugreport (See
-@ref{Bug reports}) to @email{bug-gnu-music@@gnu.org}.
+@item orientation
+ Set orientation. Choices are @code{portrait} or @code{landscape}. Is
+read from the @code{\paper} block, if set.
+
+@cindex
+@item linewidth
+ Is read from the @code{\paper} block.
-@subsection Remarks
+@item papersizename
+ Specify name of papersize. Is read from the @code{\paper} block.
+@end table
-Many papersizes are now supported. Information on other sizes
-(La@TeX{} names, horizontal and vertical sizes) should be mailed to
-the author or to the mailing list.
+@subsection Bugs
-Supported papersizes are:
+Assumes that settings for LilyPond are correct. Assumes that @code{cp}
+and @code{rm} are in the path.
-a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, archA, archB, archC, archD,
-archE, b0, b1, b2, b3, b4, b5, flsa, flse, halfletter, ledger, legal,
-letter, note
+If find something that you consider a bug, please send a bugreport (See
+@ref{Bug reports}) to @email{bug-gnu-music@@gnu.org}.
@subsection Authors
-Python Version author:
-@email{daboys@@austin.rr.com, Jeffrey B. Reed},
-@uref{http://home.austin.rr.com/jbr/jeff/lilypond/}
-Original bourne shell version author:
-@email{Jan.A.Fagertun@@energy.sintef.no, Jan Arne Fagertun},
-@uref{http://www.termo.unit.no/mtf/people/janaf/}
+@email{hanwen@@cs.uu.nl,Han-Wen Nienhuys}.
+
+Earlier incarnations of ly2dvi were written by
+@email{daboys@@austin.rr.com, Jeffrey B. Reed} (Python version), and
+@email{Jan.A.Fagertun@@energy.sintef.no, Jan Arne Fagertun} (Bourne
+shell version)
duration, and main notes, but you can typeset the grace notes to the
right of the main note using the property
@code{graceAlignPosition}.
-@cindex @code{flagStyle}
+@cindex @code{flag-style}
When grace music is interpreted, a score-within-a-score is set up:
@var{musicexpr} has its own time bookkeeping, and you could (for
this score-within-a-score, you can create notes, beams, slurs, etc.
Unbeamed eighth notes and shorter by default have a slash through the
stem. This behavior can be controlled with the
-@code{flagStyle} property.
+@code{Stem}.@code{flag-style} property.
@quotation
@lilypond[fragment,verbatim]
\relative c'' {
\grace c8 c4 \grace { [c16 c16] } c4
- \grace { \property Grace.flagStyle = "" c16 } c4
+ \grace { \property Grace.Stem \override #'flag-style = ##f c16 } c4
}
@end lilypond
@cindex automatic part combining
@cindex part combiner
-You will already have seen that LilyPond can combine several Threads
-into one Voice, and put several Voices onto one Staff. The automatic
-part combiner takes this a step further. Two parts of music can be
-combined together in an intelligent way, ie, when the two parts are
-identical for a period of time, only one can be showed. In places where
-the two parts differ, stem directions can be set automatically. That is
-why the part combiner is of great use for the typesetting of Hymns and
-orchestral scores.
+Automatic part combining is used to merge two parts of music onto on
+staff in an intelligent way. It is aimed primarily at typesetting Hymns
+and orchestral scores. When the two parts are identical for a period of
+time, only will be shown. In places where the two parts differ, stem
+directions are set automatically. Also, soli and @`{a} due parts can be
+identified and marke.
@subsubsection Part combine syntax
\translator {
\VoiceContext
soloADue = ##f
- } }
+ }
}
}
@end lilypond
property. By assigning to that property (using plain @code{\property}),
you can change the resulting grobs.
@lilypond[verbatim, fragment]
-c'4 \property Voice.Stem = #'((meta . ((interfaces . ())))) c'4
+c'4 \property Voice.Stem \override #'meta = #'((interfaces . ())) c'4
@end lilypond
The @code{\property} statement effectively empties the definition of the
Stem object. One of the effects is that property specifying how it
in the following way.
@lilypond[verbatim]
-\score { \notes \relative c' {
- b-#"text"
- c-#'(bold "text")
- d-#'(lines "one" (bold "text"))
- e-#'(music (named "noteheads-2" "flags-u3"))
+\score {
+ \notes \relative c' {
+ b-#"italic"
+ c-#'(upright "upright")
+ c-#'((bold upright) "bold")
+ d-#'(lines "one" ((bold upright) "two"))
+ e-#'(music (named "noteheads-2" "flags-u3"))
+ }
+ \paper { linewidth = 10.\cm; }
}
-\paper { linewidth = 10.\cm; } }
@end lilypond
Normally, the Scheme markup text is stored in the @code{text} property
@lilypond[verbatim]
\include "paper16.ly";
-stemdown = \property Voice.Stem \override #'direction = #-1
-stemup = \property Voice.Stem \override #'direction = #1
-stemboth = \property Voice.Stem \revert #'direction
+stemDown = \property Voice.Stem \override #'direction = #-1
+stemUp = \property Voice.Stem \override #'direction = #1
+stemBoth = \property Voice.Stem \revert #'direction
viola = \notes \relative c' \context Voice = viola {
<c4-\f-\arpeggio g' c>
- \stemdown g'8. b,16
+ \stemDown g'8. b,16
s1 s2. r4
g
}
oboes = \notes \relative c'' \context Voice = oboe {
- \stemup s4 g8. b,16 c8 r <e'8.^\p g> <f16 a>
+ \stemUp s4 g8. b,16 c8 r <e'8.^\p g> <f16 a>
\grace <e8( g> <d4 f> <c2 e> \times 2/3 { <d8 \< f> <e g> <f a> }
<
{ \times 2/3 { a8 g c } \! c2 }
\context Voice = oboeTwo {
- \stemdown
+ \stemDown
\grace {
\property Grace.Stem \override #'direction = #-1
[f,16 g] }
f8 e e2
} >
- \stemboth
+ \stemBoth
\grace <c,8( e> <)b8. d8.-\trill> <c16 e> |
[<d ( f> < )f8. a>] <)b,8 d> r [<d16( f> <f8. )a>] <b,8 d> r |
[<c16( e> < )e8. g>] <c8 e,>
}
hoomPah = \repeat unfold 8
- \notes \transpose c' { c8 \stemdown c'8 \stemup }
+ \notes \transpose c' { c8 \stemDown c'8 \stemUp }
bassvoices = \notes \relative c' {
c4 g8. b,16
\autochange Staff \hoomPah
\translator Staff = down
- \stemdown [c8 c'8] r4
+ \stemDown [c8 c'8] r4
<g d'> r4
- < {\stemup r2 <e4 c'> <c8 g'> }
- \context Voice = reallyLow {\stemdown g2 ~ | g4 c8 } >
+ < {\stemUp r2 <e4 c'> <c8 g'> }
+ \context Voice = reallyLow {\stemDown g2 ~ | g4 c8 } >
}
\score {
This example has been doctored to have as many quirks as possible.
@example
- stemdown = \property Voice.Stem \override #'direction = #-1
+ stemDown = \property Voice.Stem \override #'direction = #-1
@end example
As you can see, this example features more voices on one staff. To make
@end example
This statement reverts the old setting. If you do this, the effect of a
-@code{\stemdown} or @code{\stemup} is neutralised.
+@code{\stemDown} or @code{\stemUp} is neutralised.
@code{\override} and @code{\revert} function like a stack: you can push
values onto the grob-setting-stack with @code{\override} and you pop
signifying an arpeggio.
@example
- \stemdown
+ \stemDown
@end example
these notes are indeed processed by precisely one context with
@code{\context}.
@example
-\stemup s4 g8. b,16 c8 r <e'8.-\p g> <f16 a>
+\stemUp s4 g8. b,16 c8 r <e'8.-\p g> <f16 a>
@end example
-@code{\stemup} is a reference to the @code{\property \override} command
+@code{\stemUp} is a reference to the @code{\property \override} command
defined above. .
@example
\grace <e8 g> < d4 f> <c2 e>
@end example
This ends the two-part section.
@example
-\stemboth
+\stemBoth
\grace <c,8( e> <)b8. d8.-\trill> <c16 e> |
@end example
@cindex trill
-@cindex stemboth
+@cindex stemBoth
@code{\stemBoth} ends the forced stem directions. From here, stems are
positioned as if it were single part music.
presome=${ac_default_prefix}
fi
DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
+
AC_SUBST(datadir)
AC_SUBST(DIR_DATADIR)
+
+ dnl yeah, so fuck me gently with a cactus: this doesnt belong here
+ dnl Please take the person responsible for inventing shell-scripts out
+ dnl and shoot him. On behalf of the sane world, thank you.
+ dnl DIR_SHAREDSTATEDIR="foobar"
+ dnl AC_SUBST(DIR_SHAREDSTATEDIR)
+
AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
])
--- /dev/null
+#!@PYTHON@
+
+
+# TODO:
+#
+# * Rewrite this. The control structure is too hairy.
+# * (c) on page 1
+# * more helpful info on lily crashes
+# * Should use files in /tmp/ only. This potentially messes with
+# user generated files in the CWD
+
+
+"""
+=======================================================================
+LilyPond to dvi converter
+
+Features include Title information, paper size specification, and image
+orientation.
+
+Usage: ly2dvi.py [OPTION]... [FILE]...
+Input: LilyPond source or LilyPond generated TeX files
+Output: DVI file
+=======================================================================
+"""
+
+name = 'ly2dvi'
+version = '@TOPLEVEL_VERSION@'
+errorlog = ''
+
+import sys
+import os
+import getopt
+import re
+import string
+import time
+import glob
+import tempfile
+
+# Can't grep localized msgs
+os.environ['LC_ALL'] = ''
+os.environ['LANG'] = ''
+os.environ['LC_LANG'] = ''
+
+
+
+class Input:
+ """
+ This class handles all ly2dvi.py input file methods
+
+ Public methods:
+
+ __init__() Constructor
+ open(file) Open a .ly file or .tex file using lilyinclude path
+ close() Close current file
+ type() Determine file type .ly (input) or .tex (output)
+ setVars() Set title definitions found in .tex (output) file
+ """
+
+ #
+ # Constructors
+ #
+
+ def __init__(this):
+ this.__fd = None
+
+ #
+ # open
+ #
+ def open(this,file):
+ """
+ open file and set private class variable __fd. The search
+ sequence is: current directory followed by the directories
+ found in include property list. Each directory is searched
+ for file, file.ly, file.sly and file.fly.
+
+ input: file filename
+ output: void
+ error: ExitNotFound Exception
+ """
+
+ for i in [''] + Props.get('include')[0:]:
+ ifile = os.path.join(i,file)
+ for j in ['','.ly','.fly', '.sly']:
+ jfile = ifile+j
+ try:
+ this.__fd = open( jfile, 'r' )
+ return
+ except:
+ pass
+ sys.exit('ExitNotFound', file)
+
+
+ #
+ # close
+ #
+ def close(this):
+ """
+ close file object __fd
+
+ input: void
+ output: void
+ error: None
+ """
+ this.__fd.close()
+
+
+ #
+ # type
+ #
+ def type(this):
+ """
+ Determine input file type. LilyPond source is 'input' type
+ and LilyPond generated TeX file is 'output' type
+
+ input: void
+ output: 'input' | 'output'
+ error: None
+ """
+
+ firstline = this.__fd.readline()
+ this.__fd.seek(0)
+ if re.match('% Generated automatically by: GNU LilyPond [0-9]+[.0-9]+',firstline ):
+ return 'output'
+ else:
+ return 'source'
+
+
+ #
+ # setVars
+ #
+ def setVars(this):
+ """
+ Search for properties in the current input file and set the
+ appropriate values. The supported properties names are in
+ local variable varTable along with the property list
+ titledefs.
+
+ input: void
+ output: None
+ error: None
+ """
+
+ varTable = [
+ # regexp set method
+ # ------ ----------
+ ( 'language', Props.setLanguage ),
+ ( 'latexheaders', Props.setHeader ),
+ ( 'latexpackages', Props.setPackages ),
+ ( 'paperorientation', Props.setOrientation ),
+ ( 'paperpapersize', Props.setPaperZize ),
+ ( 'papertextheight', Props.setTextHeight ),
+ ( 'paperlinewidth', Props.setLineWidth ),
+ ( 'filename', Props.setFilename ),
+ ]
+
+ titles={}
+ for line in this.__fd.readlines():
+ m=re.match('\\\\def\\\\lilypond([\w]+){(.*)}',line)
+ if m:
+ for var in varTable:
+ if m.group(1) == var[0]:
+ var[1](m.group(2),'file')
+ break
+ for var in Props.get('titledefs'):
+ if m.group(1) == var:
+ titles[var]=m.group(2)
+ break
+ Props.setTitles(titles,'file')
+ this.__fd.seek(0)
+
+\f
+
+class TeXOutput:
+ """
+ This class handles all ly2dvi.py output file methods
+
+ private methods:
+ __lilypondDefs(opt) Send title info to output file
+
+ Public methods:
+ __init__() Constructor
+ write(str) Write a string to output file
+ start(file) Start the latex file
+ next() Process next output file
+ end() Finish latex file and run latex
+ """
+
+ #
+ # constructor
+ #
+ def __init__(this):
+ this.__fd = None
+ this.__base = ''
+ this.__outfile = ''
+
+ #
+ # __medelaDefs
+ #
+ def __lilypondDefs(this,opt):
+ """
+ Write titles to output
+
+ input: opt Supports header and subheader output
+ output: None
+ error: None
+ """
+
+ titles = Props.get('titles')
+ for key in titles.keys():
+ this.write('%s\\lilypond%s{%s}%%\n' % (opt,key,titles[key]))
+
+ #
+ # write
+ #
+ def write(this,str):
+ """
+ Write str to current output file
+
+ input: str String to write
+ output: None
+ error: None
+ """
+
+ this.__fd.write(str)
+
+ #
+ # start
+ #
+ def start(this,file):
+ """
+ Start LaTeX file. Sets the linewidth (and possibly the
+ textheight) and leaves the page layout to the geometry
+ package. Creates temporary output filename and opens it
+ for write. Sends the LaTeX header information to output.
+ Lastly sends the title information to output.
+
+ input: file output file name
+ output: None
+ error: None
+ """
+
+ now=time.asctime(time.localtime(time.time()))
+
+ # Only set the textheight if it was explicitly set by the user,
+ # otherwise use the default. Helps to handle landscape correctly!
+ if Props.get('textheight') > 0:
+ textheightsetting = ',textheight=' + `Props.get('textheight')` + 'pt'
+ else:
+ textheightsetting = ''
+
+
+ top= r"""
+%% Creator: %s
+%% Generated automatically by: %s, from %s, at %s
+
+\documentclass[%s]{article}
+
+%s
+\usepackage{geometry}
+\usepackage[latin1]{inputenc}
+%%\usepackage[T1]{fontenc}
+%%
+%% don not waste unused space at bottom of page
+%% (unless we have footnotes ...)
+%%\headheight9pt
+%%\headsep0pt
+%% Maybe this is too drastic, but let us give it a try.
+\geometry{width=%spt%s,headheight=2mm,headsep=0pt,footskip=2mm,%s}
+\input{titledefs}
+%s
+\makeatletter
+\renewcommand{\@oddhead}{\parbox{\textwidth}%%
+ {\mbox{}\small\theheader\hfill\textbf{\thepage}}}%%
+%% UGR.
+%%\renewcommand{\@evenhead}{eve!{\small\lilypondinstrument{,}\quad\textbf{\thepage}}\hfil}%%
+\renewcommand{\@oddfoot}{\parbox{\textwidth}{\mbox{}\thefooter}}%%
+%s
+\begin{document}
+""" % ( program_id(), program_id(), Props.get('filename'), now, Props.get('papersize'),
+ Props.get('language'), Props.get('linewidth'), textheightsetting,
+ Props.get('orientation'), Props.get('header'), Props.get('pagenumber'))
+
+ base, ext = os.path.splitext(file)
+ this.__base = base
+ tempfile.template= base + '_ly'
+ this.__outfile = tempfile.mktemp(ext)
+ base, ext = os.path.splitext(this.__outfile)
+ this.__tmpbase = base
+ try:
+ this.__fd = open(this.__outfile,"w")
+ except:
+ sys.exit('ExitNoWrite', this.__outfile)
+ this.write(top)
+ this.__lilypondDefs('')
+ this.write("""\
+\\makelilytitle
+""")
+
+ #
+ # next
+ #
+ def next(this):
+ """
+ Write LaTeX subheader information to support more than one
+ score in a document. Lastly send current title information to
+ output.
+
+ input: None
+ output: None
+ error: None
+ """
+
+ this.write("""\
+\\def\\theopus{}%
+\\def\\thepiece{}%
+\\def\\lilypondopus{}%
+\\def\\lilypondpiece{}%
+""")
+ this.__lilypondDefs("\\def")
+ this.write("""\
+\\def\\theopus{\\lilypondopus}% ugh
+\\def\\thepiece{\\lilypondpiece}%
+\\makelilypiecetitle
+""")
+
+
+ #
+ # end
+ #
+ def end(this):
+ """
+ Close output file and run latex on it.
+
+ input: None
+ output: None
+ error: ExitBadLatex Exception
+ """
+
+ outfile=this.__base + '.dvi'
+ if Props.get('output') != '':
+ if not os.path.exists(Props.get('output')):
+ os.mkdir(Props.get('output'))
+
+ outfile = os.path.join(Props.get('output'), outfile )
+
+ this.write(r"""
+%% \vfill\hfill{\lilypondtagline}
+\makeatletter
+\renewcommand{\@oddfoot}{\parbox{\textwidth}{\mbox{}\lilypondtagline}}%%
+\makeatother
+\end{document}
+""")
+ this.__fd.close()
+ if os.path.isfile(outfile):
+ os.remove(outfile)
+ if ( os.name == 'posix' ):
+ stat = os.system('latex \'\\nonstopmode \\input %s\'' %
+ (this.__outfile))
+ else: # Windows shells don't eat the single quotes
+ stat = os.system('latex \\nonstopmode \\input %s' %
+ (this.__outfile))
+ if stat:
+ sys.exit('ExitBadLatex')
+ if not os.path.isfile(outfile):
+ os.rename(this.__tmpbase + '.dvi', outfile)
+
+ sys.stderr.write('\n' + program_id() + ': dvi file name is %s\n\n'
+ % (outfile))
+
+ if Props.get('postscript'):
+ dvipsopts=''
+ if Props.get('orientation') == 'landscape':
+ dvipsopts=dvipsopts + ' -t landscape'
+ psoutfile=this.__base + '.ps'
+ if Props.get('output') != '':
+ psoutfile = os.path.join(Props.get('output'), psoutfile )
+ stat = os.system('dvips %s -o %s %s' % (dvipsopts,psoutfile,outfile))
+ if stat:
+ sys.exit('ExitBadPostscript')
+
+
+\f
+
+
+# ARG! THIS CODE IS BLOATED:
+# FIXME: Junk all set/get methods.
+
+class Properties:
+ """
+ This class handles all ly2dvi.py property manipulation
+
+ Public methods:
+
+ __init__() Constructor
+ set<property> methods
+ """
+
+ def __init__(this):
+
+ #
+ # Following is the order of priority for property assignment. The
+ # list is organized from lowest to highest priority. Each
+ # assignment is overridden by the next requester in the list.
+ #
+ # Requester Description
+ # --------- -----------
+ # init Initial default values
+ # file The values found in the LilyPond generated TeX files
+ # environment Envrionment variables LILYINCLUDE, LILYPONDPREFIX
+ # rcfile $LILYPONDPREFIX/.lilyrc
+ # rcfile $HOME/.lilyrc
+ # rcfile ./.lilyrc
+ # commandline command line arguments
+ #
+ this.__overrideTable = {
+ 'init' : 0,
+ 'file' : 1,
+ 'environment' : 2,
+ 'rcfile' : 3,
+ 'commandline' : 4,
+ 'program' : 5
+ }
+
+ this.__roverrideTable = {} # reverse lookup used for debug
+ for i in this.__overrideTable.items():
+ this.__roverrideTable[i[1]]=i[0]
+
+ this.__data = {
+ 'papersize' : ['a4paper', this.__overrideTable['init']],
+ 'textheight' : [0, this.__overrideTable['init']],
+ 'linewidth' : [500, this.__overrideTable['init']],
+ 'orientation' : ['portrait', this.__overrideTable['init']],
+ 'language' : ['%', this.__overrideTable['init']],
+ 'include' : [[], this.__overrideTable['init']],
+ 'debug' : [0, this.__overrideTable['init']],
+ 'keeplilypond' : [0, this.__overrideTable['init']],
+ 'keeply2dvi' : [0, this.__overrideTable['init']],
+ 'pagenumber' : ['%', this.__overrideTable['init']],
+ 'separate' : [0, this.__overrideTable['init']],
+ 'output' : ['', this.__overrideTable['init']],
+ 'header' : ['%', this.__overrideTable['init']],
+ 'dependencies' : [0, this.__overrideTable['init']],
+ 'root' : ['', this.__overrideTable['init']],
+ 'tmp' : ['d:\tmp', this.__overrideTable['init']],
+ 'filename' : ['', this.__overrideTable['init']],
+ 'titledefs' : [[], this.__overrideTable['init']],
+ 'titles' : [{}, this.__overrideTable['init']],
+ 'lilyOutputFiles' : [[], this.__overrideTable['init']],
+ 'postscript' : [0, this.__overrideTable['init']],
+ }
+
+ #
+ # Try to set root and HOME first before calling rcfile
+ #
+ if os.environ.has_key('LILYPONDPREFIX'):
+ this.setRoot(os.environ['LILYPONDPREFIX'], 'environment')
+ else:
+ p=os.path.split(sys.argv[0])
+ p=os.path.split(p[0])
+ # bit silly. for ly2dvi, overrules compiled-in datadir...
+ # how to do this better (without running lily, of course?
+ this.setRoot(os.path.join(p[0],'share','lilypond'), 'init')
+
+ if not os.environ.has_key('HOME'):
+ if os.environ.has_key('HOMEDRIVE') and \
+ os.environ.has_key('HOMEPATH'):
+ os.environ['HOME'] = os.environ['HOMEDRIVE'] + \
+ os.environ['HOMEPATH']
+ else:
+ os.environ['HOME'] = os.curdir
+
+ this.rcfile() # Read initialization file(s)
+
+ if os.environ.has_key('LILYINCLUDE'):
+ tmp=this.get('include')
+ for s in string.split(os.environ['LILYINCLUDE'],os.pathsep):
+ tmp.append(s)
+ this.__set('include', tmp, 'environment')
+
+
+ t = os.pathsep
+ if os.environ.has_key ('TEXINPUTS'):
+ t = os.environ['TEXINPUTS'] + os.pathsep
+
+ ly2dvi_t = t + \
+ os.path.join(this.get('root'), 'tex' ) + \
+ os.pathsep + os.path.join(this.get('root'), 'ps' )
+ # Don't add the magic `//' to TEXINPUTS
+ ly2dvi_t = re.sub ('//*', '/', ly2dvi_t)
+ os.environ['TEXINPUTS'] = ly2dvi_t
+
+ m = ''
+ if os.environ.has_key ('MFINPUTS'):
+ m = os.environ['MFINPUTS']
+ ly2dvi_m = m + os.pathsep + \
+ os.path.join(this.get('root'), 'mf')
+ ly2dvi_m = re.sub ('//*', '/', ly2dvi_m)
+ # Don't add the magic `//' to MFINPUTS
+ os.environ['MFINPUTS'] = ly2dvi_m
+
+ if os.environ.has_key('TMP'):
+ this.__set('tmp',os.environ['TMP'],'environment')
+
+
+ def read_titledefs (this):
+ fd=this.get_texfile_path ('titledefs.tex')
+ mudefs=[]
+
+ for line in fd.readlines():
+ m=re.match('\\\\newcommand\*{\\\\lilypond([\w]+)}',line)
+ if m:
+ mudefs.append(m.group(1))
+ fd.close
+ this.__set('titledefs', mudefs, 'init')
+
+ #
+ # __set
+ #
+ def __set(this,var,value,requester):
+ """
+ All of the set methods call this to set a property. If the value
+ was last set by a requestor of lesser priority the new value is
+ assigned, else the old value has priority and is unchanged.
+ """
+
+ if this.__overrideTable[requester] < this.__data[var][1]:
+ return 0
+ else:
+ this.__data[var] = [value, this.__overrideTable[requester]]
+
+ #
+ # get
+ #
+ def get(this,var):
+ """
+ All of the get methods call this to get a property value. List
+ variable types are return by value to facilitate an append operation.
+ """
+
+ if var == 'include' or var == 'lilyOutputFiles':
+ return this.__data[var][0][0:] # return a copy not a ref
+ else:
+ return this.__data[var][0]
+
+ #
+ # get_texfile_path
+ #
+ def get_texfile_path (this, var):
+ """
+ locate and open titledefs.tex file
+ """
+
+ if os.name == 'nt':
+ path = os.path.join(this.get('root'), 'tex', var)
+ else:
+ path =''
+ cmd =('kpsewhich tex %s %s' % (var,errorlog))
+ sys.stderr.write ('executing: %s'% cmd)
+ pipe = os.popen (cmd, 'r')
+ path = pipe.readline ()[:-1] # chop off \n
+ return_status = pipe.close()
+ sys.stderr.write ('\n')
+ if return_status and not path:
+ path = os.path.join(this.get('root'), 'tex', var)
+ fd = open(path, 'r')
+ return fd
+
+
+ #
+ # Read rc file
+ #
+ def rcfile(this):
+ """
+ Read initialization file(s)
+ """
+ varTable = [
+ # name set method
+ # ---- ----------
+ ( 'DEBUG', this.setDebug ),
+ ( 'DEPENDENCIES', this.setDependencies ),
+ ( 'KEEPLILYPOND', this.setKeeplilypond ),
+ ( 'KEEPLY2DVI', this.setKeeply2dvi ),
+ ( 'LANGUAGE', this.setLanguage ),
+ ( 'LATEXHF', this.setHeader ),
+ ( 'LATEXPKG', this.setPackages ),
+ ( 'LILYINCLUDE', this.setInclude ),
+ ( 'LILYPONDPREFIX', this.setRoot ),
+ ( 'NONUMBER', this.setNonumber ),
+ ( 'ORIENTATION', this.setOrientation ),
+ ( 'OUTPUTDIR', this.setOutput ),
+ ( 'PAPERSIZE', this.setPaperZize ),
+ ( 'PHEIGHT', this.setTextHeight ),
+ ( 'POSTSCRIPT', this.setPostscript ),
+ ( 'PWIDTH', this.setLineWidth ),
+ ( 'SEPARATE', this.setSeparate ),
+ ( 'TMP', this.setTmp ),
+ ]
+
+ if ( os.name == 'posix' ):
+ dotFilename='.lilyrc'
+ else: # Windows apps like edit choke on .lilyrc
+ dotFilename='_lilyrc'
+
+ for d in [os.path.join(this.get('root'),'ly'), \
+ os.environ['HOME'], os.curdir ]:
+ file=os.path.join(d,dotFilename)
+ try:
+ fd = open( file, 'r' )
+ except:
+ continue
+
+ for line in fd.readlines():
+ if re.match('#.*',line):
+ continue
+ m=re.search('([\w]+)=(.*)',line)
+ if m:
+ for var in varTable:
+ if m.group(1) == var[0]:
+ var[1](m.group(2),'rcfile')
+ break
+ fd.close
+
+ #
+ # setPaperZize
+ #
+ def setPaperZize(this,size,requester):
+ """
+ Set paper size properties
+ """
+
+ paperTable = [
+ # regex width height name
+ # ----- ----- ------ ----
+ ( 'a0.*', 2389, 3381, 'a0paper' ),
+ ( 'a1$|a1p.*', 1690, 2389, 'a1paper' ),
+ ( 'a2.*', 1194, 1690, 'a2paper' ),
+ ( 'a3.*', 845, 1194, 'a3paper' ),
+ ( 'a4.*', 597, 845, 'a4paper' ),
+ ( 'a5.*', 423, 597, 'a5paper' ),
+ ( 'a6.*', 298, 423, 'a6paper' ),
+ ( 'a7.*', 211, 298, 'a7paper' ),
+ ( 'a8.*', 305, 211, 'a8paper' ),
+ ( 'a9.*', 105, 305, 'a9paper' ),
+ ( 'a10.*', 74, 105, 'a10paper' ),
+ ( 'b0.*', 2847, 4023, 'b0paper' ),
+ ( 'b1.*', 2012, 2847, 'b1paper' ),
+ ( 'b2.*', 1423, 2012, 'b2paper' ),
+ ( 'b3.*', 1006, 1423, 'b3paper' ),
+ ( 'b4.*', 712, 1006, 'b4paper' ),
+ ( 'b5.*', 503, 712, 'b5paper' ),
+ ( 'archA$', 650, 867, 'archApaper' ),
+ ( 'archB$', 867, 1301, 'archBpaper' ),
+ ( 'archC$', 1301, 1734, 'archCpaper' ),
+ ( 'archD$', 1734, 2602, 'archDpaper' ),
+ ( 'archE$', 2602, 3469, 'archEpaper' ),
+ ( 'flsa$|flse$', 614, 940, 'flsapaper' ),
+ ( 'halfletter$', 397, 614, 'halfletterpaper' ),
+ ( 'ledger$', 1229, 795, 'ledgerpaper' ),
+ ( 'legal$', 614, 1012, 'legalpaper' ),
+ ( 'letter$', 614, 795, 'letterpaper' ),
+ ( 'note$', 542, 723, 'notepaper' )
+ ]
+
+ found=0
+ for paper in paperTable:
+ if re.match(paper[0],size):
+ found=1
+ this.__set('papersize',paper[3],requester)
+ break
+
+ if not found:
+ sys.exit('ExitBadPaper',size)
+
+ #
+ # setTextHeight
+ #
+ def setTextHeight(this,size,requester):
+ """
+ Set textheight property
+ """
+
+ m=re.match('([0-9][.0-9]*)(cm|mm|pt|$)',size)
+ if m:
+ if m.group(2) == 'cm':
+ this.__set('textheight',\
+ float(m.group(1)) * 72.27/2.54, requester )
+ elif m.group(2) == 'mm':
+ this.__set('textheight',\
+ float(m.group(1)) * 72.27/25.4, requester )
+ elif m.group(2) == 'pt':
+ this.__set('textheight', float(m.group(1)), requester )
+ elif m.group(2) == '':
+ this.__set('textheight', float(m.group(1)), requester )
+ else:
+ sys.exit('ExitBadHeight', m.group(2))
+ else:
+ sys.exit('ExitBadHeight', size)
+
+ #
+ # setLineWidth
+ #
+ def setLineWidth(this,size,requester):
+ """
+ Set linewidth propery
+ """
+
+ m=re.match('([0-9][.0-9]*)(cm|mm|pt|$)',size)
+ if m:
+ if m.group(2) == 'cm':
+ this.__set('linewidth', \
+ float(m.group(1)) * 72.27/2.54, requester )
+ elif m.group(2) == 'mm':
+ this.__set('linewidth', \
+ float(m.group(1)) * 72.27/25.4, requester )
+ elif m.group(2) == 'pt':
+ this.__set('linewidth', float(m.group(1)), requester )
+ elif m.group(2) == '':
+ this.__set('linewidth', float(m.group(1)), requester )
+ else:
+ sys.exit('ExitBadWidth', m.group(2))
+ else:
+ sys.stderr.write ('ly2dvi: warning: ignoring linewidth: ' + size + '\n')
+
+ #
+ # setOrientation
+ #
+ def setOrientation(this,orient,requester):
+ """
+ Set orientation property
+ """
+
+ if orient == 'landscape' or orient == 'portrait':
+ this.__set('orientation', orient, requester )
+ else:
+ sys.exit('ExitBadOrient', orient)
+
+ #
+ # setLanguage
+ #
+ def setLanguage(this,lang,requester):
+ """
+ Set language property
+ """
+
+ this.__set('language', '\\usepackage[%s]{babel}' % (lang), requester )
+
+ #
+ # setInclude
+ #
+ def setInclude(this,inc, requester):
+ """
+ Append an include path
+ """
+
+ tmp = this.get('include')
+ tmp.append(inc)
+ this.__set('include', tmp, requester )
+
+ #
+ # setDebug
+ #
+ def setDebug(this,value,requester):
+ """
+ Set or Clear debug flag
+ """
+
+ if int(value) == 1:
+ this.__set('debug',1,requester)
+ else:
+ this.__set('debug',0,requester)
+
+ #
+ # setKeeplilypond
+ #
+ def setKeeplilypond(this, value, requester):
+ """
+ Set or Clear keeplilypond flag
+ """
+
+ if int(value) == 1:
+ this.__set('keeplilypond',1,requester)
+ else:
+ this.__set('keeplilypond',0,requester)
+
+ #
+ # setKeeply2dvi
+ #
+ def setKeeply2dvi(this, value, requester):
+ """
+ Set or Clear keeply2dvi flag
+ """
+
+ if int(value) == 1:
+ this.__set('keeply2dvi',1,requester)
+ else:
+ this.__set('keeply2dvi',0,requester)
+
+ #
+ # setNonumber
+ #
+ def setNonumber(this, value, requester):
+ """
+ Set nonumber flag
+ """
+
+ if int(value) == 1:
+ this.__set('pagenumber','\\pagestyle{empty}',requester)
+ else:
+ this.__set('pagenumber','%',requester)
+
+ #
+ # setSeparate
+ #
+ def setSeparate(this, value, requester):
+ """
+ Set or Clear separate flag
+ """
+
+ if int(value) == 1:
+ this.__set('separate',1,requester)
+ else:
+ this.__set('separate',0,requester)
+
+ #
+ # Set output directory name
+ #
+ def setOutput(this,out,requester):
+ this.__set('output',out,requester)
+
+ #
+ # Set latex header name
+ #
+ def setHeader(this,head, requester):
+ this.__set('header','\\input{' + head + '}'+this.get('header'),requester)
+
+ #
+ # Set latex package name
+ #
+ def setPackages(this,pkgs, requester):
+ this.__set('header','\\usepackage{' + pkgs + '}'+this.get('header'),requester)
+
+ #
+ # Set or Clear Dependencies flag to generate makefile dependencies
+ #
+ def setDependencies(this, value, requester):
+ """
+ Set or Clear dependencies flag
+ """
+
+ if int(value) == 1:
+ this.__set('dependencies',1,requester)
+ else:
+ this.__set('dependencies',0,requester)
+
+ #
+ # Set tmp directory
+ #
+ def setTmp(this,dir, requester):
+ this.__set('tmp',dir,requester)
+
+ #
+ # Set lilypond source file name
+ #
+ def setFilename(this,file, requester):
+ this.__set('filename',file,requester)
+
+ #
+ # Set title commands
+ #
+ def setTitles(this,titles, requester):
+ this.__set('titles',titles,requester)
+
+ #
+ # Set title commands
+ #
+ def addLilyOutputFiles(this,filelist,requester):
+ """
+ Add a to the lily output list
+ """
+
+ tmp = this.get('lilyOutputFiles')
+ tmp = tmp + filelist
+ this.__set('lilyOutputFiles',tmp,requester)
+
+ #
+ # Set/Clear postscript flag
+ #
+ def setPostscript(this,value,requester):
+ """
+ Set postscript flag
+ """
+
+ if int(value) == 1:
+ this.__set('postscript',1,requester)
+ else:
+ this.__set('postscript',0,requester)
+
+ #
+ # Set root
+ #
+ def setRoot(this,path, requester):
+ """
+ Set LilyPond root directory
+ """
+
+ os.environ['LILYPONDPREFIX'] = path
+ if os.name == 'nt' or os.name == 'dos':
+ path = unc2dos(path);
+
+ this.__set('root',path,requester)
+
+
+ #
+ # printProps
+ #
+ def printProps(this):
+ """
+ Print properties
+ """
+
+ for key in this.__data.keys():
+ print "%s <%s>:<%s>" % (key,this.get(key),
+ this.__roverrideTable[this.__data[key][1]])
+
+\f
+
+#
+# Misc functions
+#
+
+def getLilyopts():
+ inc = ''
+ if len(Props.get('include')) > 0:
+ inc = string.join (map (lambda x: '-I "%s"' % x, Props.get('include')))
+ dep=''
+ if Props.get('dependencies'):
+ dep=' --dependencies'
+ return inc + dep
+
+def writeLilylog(file,contents):
+ if Props.get('keeplilypond'):
+ base, ext = os.path.splitext(file)
+ tempfile.template=base + "_li"
+ file=tempfile.mktemp('.log')
+ output = Props.get('output')
+ if output != '':
+ file = os.path.join( output, file )
+ try:
+ fd = open( file, 'w' )
+ except:
+ sys.exit('ExitNoWrite', file)
+ fd.write(contents)
+ fd.close()
+
+def getTeXFile(contents):
+ texfiles=[]
+ for line in string.split(contents,'\n'):
+ m = re.search('paper output to (.+)\.\.\.', line)
+ if m:
+ texfiles.append(m.group(1))
+
+ if texfiles == []:
+ sys.exit('ExitNoTeXName')
+ else:
+ return texfiles
+
+def getDepFiles (log):
+ files=[]
+ for line in string.split (log,'\n'):
+ m = re.search ("dependencies output to (.+)\.\.\.", line)
+ if m:
+ files.append (m.group (1))
+ return files
+
+def unc2dos(path):
+ """
+ Convert a path of format //<drive>/this/that/the/other to
+ <drive>:\this\that\the\other
+ """
+ m=re.match('^//([A-Za-z])(/.*)$',path)
+ if m:
+ return m.group(1) + ':' + os.path.normpath(m.group(2))
+
+
+
+def program_id ():
+ return 'ly2dvi (GNU LilyPond) ' + version;
+
+
+def mailaddress():
+ try:
+ return os.environ['MAILADDRESS']
+ except KeyError:
+ return '(address unknown)'
+
+
+def identify ():
+ sys.stderr.write (program_id () + '\n')
+
+def print_version ():
+ sys.stdout.write (program_id () + '\n')
+
+def help ():
+ sys.stdout.write (
+"""Usage: %s [OPTION]... [FILE]...
+
+Generate dvi file from LilyPond source/output
+
+Options:
+ -D,--debug increase verbosity
+ -F,--headers= name of additional LaTeX headers file
+ -H,--Height= set paper height (points) (see manual page)
+ -I,--include=DIR add DIR to LilyPond\'s search path
+ -K,--keeplilypond keep LilyPond output files
+ -L,--landscape set landscape orientation
+ -N,--nonumber switch off page numbering
+ -O,--orientation= set orientation (obsolete -- use -L instead)
+ -P,--postscript generate PostScript file
+ -W,--Width= set paper width (points) (see manual page)
+ -M,--dependencies tell LilyPond to make a dependencies file
+ -h,--help this help text
+ -k,--keeply2dvi keep ly2dvi output files
+ -l,--language= give LaTeX language (babel)
+ -o,--outdir= set output directory
+ --output= set output directory
+ -p,--papersize= give LaTeX papersize (eg. a4)
+ -s,--separate run all files separately through LaTeX
+
+files may be (a mix of) input to or output from LilyPond(1)
+""" % name)
+
+\f
+
+#
+# main
+#
+
+def main():
+ """Generate dvi files from LilyPond source/output"""
+
+ infile = Input()
+ outfile = TeXOutput()
+ texInputFiles=[]
+ tempfile.tempdir=""
+
+ (options, files) = getopt.getopt (sys.argv[1:],
+ 'DF:H:I:KLNPW:Mhkl:o:p:s',
+ ['debug', 'headers=', 'Height=',
+ 'include=', 'keeplilypond', 'landscape',
+ 'nonumber', 'Width=', 'dependencies',
+ 'help', 'keeply2dvi', 'language=',
+ 'outdir=', 'output=', 'version',
+ 'papersize=', 'separate', 'postscript'])
+
+ for opt in options:
+ o = opt[0]
+ a = opt[1]
+ if o == '--debug' or o == '-D':
+ Props.setDebug(1,'commandline')
+ elif o == '--headers' or o == '-F':
+ Props.setHeader(a,'commandline')
+ elif o == '--include' or o == '-I':
+ Props.setInclude(a,'commandline')
+ elif o == '--Height' or o == '-H':
+ Props.setTextHeight(a,'commandline')
+ elif o == '--keeplilypond' or o == '-K':
+ Props.setKeeplilypond(1,'commandline')
+ elif o == '--landscape' or o == '-L':
+ Props.setOrientation('landscape','commandline')
+ elif o == '--nonumber' or o == '-N':
+ Props.setNonumber(1,'commandline')
+ elif o == '--Width' or o == '-W':
+ Props.setLineWidth(a,'commandline')
+ elif o == '--dependencies' or o == '-M':
+ Props.setDependencies(1,'commandline')
+ elif o == '--help' or o == '-h':
+ help()
+ sys.exit (0)
+ elif o == '--keeply2dvi' or o == '-k':
+ Props.setKeeply2dvi(1,'commandline')
+ elif o == '--language' or o == '-l':
+ Props.setLanguage(a,'commandline')
+ elif o == '--outdir' or o == '-o' or o == '--output':
+ Props.setOutput(a,'commandline')
+ elif o == '--papersize' or o == '-p':
+ Props.setPaperZize(a,'commandline')
+ elif o == '--separate' or o == '-s':
+ Props.setSeparate(1,'commandline')
+ elif o == '--postscript' or o == '-P':
+ Props.setPostscript(1,'commandline')
+ elif o == '--version':
+ print_version ()
+ return 0
+ else:
+ print o
+ raise getopt.error
+
+ identify()
+ Props.read_titledefs ()
+
+ if len(files):
+ for file in files:
+ infile.open(file)
+ type = infile.type()
+ infile.close()
+ if type == 'source':
+ if os.environ.has_key('OS') and \
+ os.environ['OS'] == 'Windows_95':
+ cmd = 'ash -c "lilypond %s %s 2>&1"' %(getLilyopts(), file)
+ else:
+ cmd = 'lilypond %s %s 2>&1' % (getLilyopts(), file)
+ sys.stderr.write ('executing: %s\n'% cmd)
+
+ fd = os.popen(cmd , 'r')
+ log = ''
+
+ s = fd.readline()
+ while len(s) > 0:
+ sys.stderr.write (s)
+ sys.stderr.flush ()
+ log = log + s
+ s = fd.readline ()
+ if 0:
+ s = fd.read (1)
+ while len(s) > 0:
+ sys.stderr.write (s)
+ sys.stderr.flush ()
+ s = fd.read (1)
+ log = log + s
+ stat = fd.close()
+ if stat:
+ sys.exit('ExitBadLily', cmd )
+ texFiles=getTeXFile(log)
+ depFiles=getDepFiles (log)
+ writeLilylog(file,log)
+ Props.addLilyOutputFiles(texFiles,'program')
+ texInputFiles = texInputFiles + texFiles
+ else:
+ texInputFiles.append(file)
+
+ firstfile=1
+ for file in texInputFiles:
+ infile.open(file)
+ infile.setVars() # first pass set variables
+ infile.close()
+ if Props.get('debug'):
+ Props.printProps()
+ if firstfile:
+ outfile.start(file) # allow for specified name
+ else:
+ outfile.next()
+ outfile.write("""\
+\\input{%s}
+""" % (file))
+ if Props.get('separate'):
+ outfile.end()
+ else:
+ firstfile=0
+ if not Props.get('separate'):
+ outfile.end()
+
+ # --outdir mess
+ if Props.get ('output'):
+ outdir=Props.get ('output')
+ for i in depFiles:
+ text=open (i).read ()
+ # ugh, should use lilypond -o DIR/foo.tex
+ # or --dep-prefix to fix dependencies
+ text=re.sub ('\n([^:]*).tex', '\n' + outdir + '/\\1.dvi', text)
+ text=re.sub (' ([^:]*).tex', ' ' + outdir + '/\\1.dvi', text)
+ open (os.path.join (outdir, i), 'w').write (text)
+ os.remove (i)
+
+ else:
+ help()
+ sys.exit('ExitBadArgs','No files specified')
+
+#
+# Exit values
+#
+ExitTable = {
+ 'ExitInterupt' : ['Ouch!', 1 ],
+ 'ExitBadArgs' : ['Wrong number of arguments', 2 ],
+ 'ExitNotFound' : ['File not found', 3 ],
+ 'ExitBadPaper' : ['Unknown papersize', 4 ],
+ 'ExitBadHeight' : ['Invalid Height specification', 5 ],
+ 'ExitBadWidth' : ['Invalid Width specification', 6 ],
+ 'ExitBadOrient' : ['Invalid Orientation specification', 7 ],
+ 'ExitNoWrite' : ['Permission denied', 8 ],
+ 'ExitNoTeXName' : ['Hmm, I could not find an output file name', 9 ],
+ 'ExitBadLily' : ['LilyPond failed', 10 ],
+ 'ExitBadLatex' : ['Latex failed', 11 ],
+ 'ExitBadPostscript' : ['Postscript failed', 12 ],
+ 'ExitUnknown' : ['Unknown Exit Code', 20 ],
+ }
+
+def cleanup():
+ lilyfiles = []
+ tmpfiles = []
+ if not Props.get('keeplilypond'):
+ lilyfiles = Props.get('lilyOutputFiles')
+ if not Props.get('keeply2dvi'):
+ tmpfiles = glob.glob('*_ly[0-9]*.*')
+ for file in lilyfiles + tmpfiles:
+ if os.path.isfile(file):
+ os.remove(file)
+
+
+Props = Properties()
+
+try:
+ main()
+
+except KeyboardInterrupt:
+ print ExitTable['ExitInterupt'][0]
+ cleanup()
+ sys.exit(ExitTable['ExitInterupt'][1])
+
+except SystemExit, errno:
+ if ExitTable.has_key(errno.args[0]):
+ msg = ExitTable[errno.args[0]]
+ else:
+ msg = ExitTable['ExitUnknown']
+ if len(errno.args) > 1:
+ sys.stderr.write( '%s: %s: %s\n' % (name, msg[0], errno.args[1]))
+ else:
+ sys.stderr.write( '%s %s\n' % (name, msg[0]))
+ if Props.get('debug'):
+ Props.printProps()
+ cleanup()
+ sys.exit(msg[1])
+else:
+ cleanup()
+
+
+
+
-/* @configure_input@ */
+/* @AUTOGENERATE@ */
/* Hmm */
#define PACKAGE "@package@"
+/* define if bla bla /var and the like. */
+#define DIR_SHAREDSTATEDIR "@DIR_SHAREDSTATEDIR@"
+
+#define DIR_DATADIR "@DIR_DATADIR@"
+
/* default lilypond init and input dir */
#define DIR_DATADIR "@DIR_DATADIR@"
includedir = @includedir@
datadir = @datadir@
localedir = @localedir@
+sharedstatedir = @sharedstatedir@
program_prefix = @program_prefix@
program_suffix = @program_suffix@
EXTRA_LIBES = @EXTRA_LIBES@ @LIBS@
TAR= @TAR@
TBL = @TBL@
TROFF = @TROFF@
-YODL= @YODL@
-YODL2HTML= @YODL2HTML@
-YODL2LATEX= @YODL2LATEX@
-YODL2LESS_DIR= @YODL2LESS_DIR@
-YODL2MAN= @YODL2MAN@
-YODL2MSLESS= @YODL2MSLESS@
-YODL2TEXINFO= @YODL2TEXINFO@
-YODL2TXT= @YODL2TXT@
ZIP = @ZIP@
AC_DEFINE(STRINGS_UTILS_INLINED)
fi
-
AC_STEPMAKE_CXX
AC_STEPMAKE_GXX
AC_STEPMAKE_CXXTEMPLATE
+
% Generated by mudela-book.py; options are
\include "paper16.ly"
\paper { linewidth = 390.000000 \pt; }
+
\include "paper16.ly";
\score {
\notes {
+
\header { texidoc = "tuplet-spanner should not put visible brackets on
beams even if they're auto generated."; }
+
\header {
texidoc ="Auto beam can not be put on the final notes of a score ";
}
+
\header {
texidoc= "Staffs that end half way a system should end at the bar line.";
}
+
\header{
texidoc="Beam thinks that first two notes should be stem down. Can be fixed by uncommenting \stemUp";
}
+
\score { \notes {
[\times 2/3 {c16 c c} c8]
+
\header {
texidoc ="tuplet bracket doesn't behave properly at line break. Not a real problem.";
+
\header {
texidoc = "a staff should really die, if no one's referencing it."
}
+
\header {
texidoc =" Spacing for one staff in polymetric music should
be not hampered by a staff in another time signature.";
+
\header {
texidoc = "Dots should remain close to the heads they belong to, but should not overlap.";
}
+
% dynamics should not collide with staff
% dynamics (of two voices) should not collide with eachother
% strange stem through beam bug in bar 8 on viola staff
+
\score{
\context Staff <
\context Voice=one \skip 1;
instrument names on grandstaffs. GR is centered on entire score
%}
-\version "1.3.129"
+
\include "paper20.ly"
\header{
latexpackages = "amsmath";
+
\score { \notes {\grace {c'_\f} d e f g}}
+
\score {
\notes \context Voice = VA \relative c'' {
\grace {[b8^1 c^2]} d4^3
+
\score {
\notes\relative c''{
\grace g8 g'2 ( )g
+
% dumps core: 1.3.93
\score{
\notes{
- \grace { <e,,,32\sustaindown( e,> } <)gis'2 e>
+ \grace { <e,,,32\sustainDown( e,> } <)gis'2 e>
}
}
+
% jij had zoon mooi tight spacing example,
% kan zo'n harde space ook niet voor en na maatstreep!
\score {
+
% mb.ly: midi-bug
% midi notes get stuck
+
\include "paper20.ly"
Sopnotes = \notes {
\time 4/4;
<
\context Staff="sop"
<
- \$Sopnotes
+ \Sopnotes
>
>
\paper {
+
% on their own staff, voices should be stemboth (not up/down)
End = { \skip 1*8; }
+
% move to regtest once it works?
\header {
+
\header { texidoc= "Spacing after clef/key should be stretched
equidistantly for large stretching, but should stay clear of prefatory
matter for small stretching. Support in the spacing engine for
+
\score { \context Staff \notes \repeat volta 3 c1 \alternative { d1 e1 }}
+
% the \stopped collides with the
%beam.
+
\header{
texidoc="
Slurs should be attached to note heads, except when they would collide
+
% Placement of slur uses x-extent of note-head which includes dots
\score {
\paper {
linewidth = -1.;
}
-}
\ No newline at end of file
+}
+
\header{
texidoc="
Right ending of slur is too far right.
+
\score{
\notes\relative c''{
\time 2/4;
+
% When tightly spaced, hinterfleisch -> 0.
% Stems may touch the bar lines, opposite stems may touch eachother.
% We need a mininum of about a note-width/interline space in these
>
\paper { linewidth = -1.; }
}
-\version "1.3.117";
+
+
\header {
texidoc ="1st beam should prob. be horizontal.";
}
+
\score{
\notes\relative c''{
a'( a a [a8...] b,32\break
+
% strange bug with stems through beams in second beam
End = { \skip 1*8; }
+
\header {
texidoc= "LilyPond doesn't kern text, but TeX does, leading to skewed results: the VAVAVAVA takes less space than LilyPond thinks it does."; }
+
% text spanners should not repeat start text when broken
\score {
\paper {
linewidth = 40*\staffspace;
}
-}
\ No newline at end of file
+}
+
\score { \notes
{ c4_"foo" }
}
+
\header {
texidoc = "First and second bes (tied across line break)
should get an accidental, but others should not";
+
\header {
texidoc="Positioning of last ties is incorrect; ties between 2-1 and 1-1
durations differ.";
+
% Uses old style
\score {
+
\header {
texidoc="Simple beams. This broke somewhere < 1.3.110
";
linebreak = \penalty -1000;
-$ex8 = \notes \relative c' {
+exI = \notes \relative c' {
\repeat "volta" 2 {
\times 2/3 {c8( cis d} \times 2/3 {dis e f}
\times 2/3 {fis g gis} \times 2/3 {a bes b} |
c1 || \linebreak
}
-\score { \context Staff { \notes { \$ex8 } } }
+\score { \context Staff { \notes { \exI } } }
+
% docme.
\score{
\context Staff <
\include "paper20.ly"
-\version "1.3.120";
+
oden = \lyrics{
O |
+\
cpp -P -traditional -o l-fake.ly -DFAKE_GRACE les-nereides.ly
+
\score {
\context Voice \notes\relative c {
c' d e f g a b c
+
\score {
\context Voice \notes\relative c {
a''2 ~ c4( [e8 )e] [a,16 a a a]
-\version "1.3.117";
one = \notes\relative c{
c'' d e f
}
}
-\version "1.3.117";
+
cpp -P -traditional -o l-fake.ly -DFAKE_GRACE les-nereides.ly
%}
-\version "1.3.117";
+
\header{
composer = "ARTHUR GRAY";
\property Voice.Stem \override #'direction = #-1
\property Voice.slurEndAttachment = #'stem
<)a''4\arpeggio eis cis>
- %\stemboth
+ %\stemBoth
\property Voice.slurEndAttachment = ##f
% Huh, urg? Implicit \context Staff lifts us up to Staff context???
\translator Staff=bass
lowerDynamics = \context Dynamics=lower \notes{
s2
%2
- s2\sustaindown s8. s16\sustainup s4
+ s2\sustainDown s8. s16\sustainUp s4
%3
- s2\sustaindown s8. s16\sustainup s4
+ s2\sustainDown s8. s16\sustainUp s4
%3
#ifndef FAKE_GRACE
- s4\sustaindown s16
- s32 s s\sustainup s
- s32\sustaindown s s s
+ s4\sustainDown s16
+ s32 s s\sustainUp s
+ s32\sustainDown s s s
s8
#else
- s2\sustaindown
+ s2\sustainDown
s32*12
- s32 s s\sustainup s
- s32\sustaindown s s s
+ s32 s s\sustainUp s
+ s32\sustainDown s s s
#endif
\property Dynamics.stopSustain = #""
- s4 s16. s32\sustainup
+ s4 s16. s32\sustainUp
%5
- s8\sustaindown s s
+ s8\sustainDown s s
\property Dynamics.stopSustain = #"*"
\property Dynamics.stopStartSustain = #"-P"
- s s\sustainup\sustaindown s s
- s\sustainup
+ s s\sustainUp\sustainDown s s
+ s\sustainUp
%6
\property Dynamics.stopStartSustain = #""
- s8\sustaindown s s
+ s8\sustainDown s s
\property Dynamics.stopStartSustain = #"-P"
- s s\sustainup\sustaindown s s
- s\sustainup
+ s s\sustainUp\sustainDown s s
+ s\sustainUp
}
\score{
magnification_italic = 1.;
\translator {
\ScoreContext
- TimeSignature \override #'style = #"C"
+ TimeSignature \override #'style = #'C
SpacingSpanner \override #'maximum-duration-for-spacing = #(make-moment 1 4)
\remove Bar_number_engraver;
+
\score{ \sequential {\clef bass ; }
\paper { \translator { \type Score_engraver ; \name "Score"; }
linewidth =1.5\cm;
copyright = "public domain";
}
-% \version "1.0.16";
+% \;
tempi = \notes {
- \property Voice.textStyle = "large"
+ \property Voice.TextScript \set #'font-style = #'large
s8^"Allegro assai"
}
}
global = \notes {
- \key g;
+ \key g \major;
\time 3/8;
<
\dynamics
* organ staff...
%}
-\version "1.3.117";
+
\context Staff \notes\relative c''<
\context Voice=one {
- \property Voice.horizontalNoteShift=0
- \property Voice.verticalDirection=1
+ \property Voice.NoteColumn \override #'horizontal-shift = #0
+ \stemUp\slurUp\tieUp
e4
}
\context Voice=two {
- \property Voice.verticalDirection=1
- \property Voice.horizontalNoteShift=1
+ \stemUp\slurUp\tieUp
+ \property Voice.NoteColumn \override #'horizontal-shift = #1
cis
}
\context Voice=three {
- \property Voice.horizontalNoteShift=2
- \property Voice.verticalDirection=1
+ \property Voice.NoteColumn \override #'horizontal-shift = #2
+ \stemUp\slurUp\tieUp
ais
}
\context Voice=four {
- \property Voice.verticalDirection=-1
+ \stemDown\slurDown\tieDown
\property Voice.horizontalNoteShift=-1
fis
}
natural sign.
";
}
-\version "1.3.117";
+
thenotes = \notes \relative cis' { \time 4/4;
\score { < \context Staff \thenotes
\context NoteNames {
- \property NoteNames.basicNoteNameProperties \override #'no-spacing-rods = ##f
+ \property NoteNames.NoteName \override #'no-spacing-rods = ##f
\thenotes
}
>
+
\header{
texidoc="
Accidentals work: the second note does not get a sharp. The third and
+
\score { \notes
\relative c'' \context Staff {
\emptyText
\repeat volta 2 { \time 4/4; c4^"cuivr\\'e"_\fermata }
\alternative {
- { \property Voice.textStyle = "italic" d-4_"cantabile" }
+ { \property Voice.TextScript \set #'font-style = #'italic d-4_"cantabile" }
{ e } } \grace { c16 }
- \property Voice.textStyle = "large"
+ \property Voice.TextScript \set #'font-style = #'large
f4-\ff^""^"Largo" \mark "B"; g
}
\paper { linewidth = -1.0;
-\header = {
+
+xheader = {
texidoc = "arpeggio stays clear of accidentals and flipped note heads.
Since Arpeggio engraver is Voice, it does nothing for voice collisions."
};
";
}
-\version "1.3.117";
+
\score{
\context PianoStaff <
+
\header{
texidoc="
The first two a8 notes should not be beamed.
\paper{
linewidth=-1.;
}
-}
\ No newline at end of file
+}
+
\header{
texidoc="
Auto change piano staff switches voices between up and down staffs
+
\header{
texidoc="Two automatic knees";
}
+
\header{
texidoc="One automatic knee";
}
+
\header {
texidoc="Bar number settable and padding adjustable.";
}
";
}
-\version "1.3.117";
+
onestaff = \context Staff = foo\notes {
\property Staff.instr = instr
>
}
-\version "1.3.117";
+
Beam.auto-knee-gap was set to false.
";
}
-\version "1.3.117";
+
\score{
\notes\relative c''{
[g8 c c,]
+
\header{
texidoc="
beams should look the same
Override with @code{noStemExtend}.
";
}
-\version "1.3.117";
+
\score {
\context Voice \notes\relative c {
+
\header{
texidoc="
Beaming is generated automatically. Beams may cross bar lines. In that
+
\header{
texidoc="
The same mechanism can be used to force pagebreaks.
+
\header{
texidoc="
Breaks can be encouraged and discouraged using @code{\break} and
}
-\version "1.3.117";
+
\score {
\notes \relative c' {
+
\header{
texidoc="property chordChanges: only display chord names when
there's a change in the chords scheme, but always display the
by default.
";
}
-\version "1.3.117"
+
chord = \notes\transpose c''\chords{
c1
c:m
\translator {
\ChordNamesContext
- ChordName \override #'word-space = #1
+ ChordNames \override #'word-space = #1
}
}
}
+
\header{
texidoc="
Chord tremolos look like beams, but are a kind of repeat symbol.
";
}
-\version "1.3.117";
+
\score {
\notes{
copyright = "public domain";
Tested = "test the Collision resolution ";
}
-\version "1.3.117";
+
twovoice = \context Staff \notes <
\context Voice=i { \stemDown c4 d e f g2~ g4 a [c8 d e f] c2| }
}
-\version "1.3.117";
+
\score {
\context Voice \notes\relative c'' {
\time 6/8;
line. Isolated dynamics may be forced up or down. ";
}
-\version "1.3.122";
+
\score{
\notes\relative c''{
+
\header {
texidoc = " Ez-notation prints names in note heads.";
}
+\include "paper26.ly";
+\paper { \paperTwentysix }
+
\score {
\notes { c'2 e'4 f' | g'1 }
\paper { \translator { \EasyNotation } }
+
\header{
texidoc="
As a last resort, the placement of grobs can be adjusted manually, by
second slur has slurDirection set to down, overriding the stemup setting.
";
}
-\version "1.3.117";
+
\score {
\notes \relative c'' \context Voice {
+
\header{
texidoc=" Simple glissando lines between notes are supported.
+
\header{
texidoc="
Grace notes are typeset as an encapsulated piece of music. You can
";
}
-\version "1.3.117";
+
zager = \context Staff = zager \notes \relative c'' {
\clef treble;
c1
";
}
-\version "1.3.117";
+
\score {
\notes \relative c''
copyright = "public domain";
}
-\version "1.3.117";
+
m = \notes \relative c'' {
\property Staff.automaticMelismata = ##t
+
\header{
texidoc="
Adding a @code{Bar_engraver} to the LyricsVoice context makes sure that
+
\header{
texidoc="
If @code{Score.skipBars} is set,
+
\header { texidoc=" You can write molecule callbacks in Scheme, thus
providing custom glyphs for notation elements. A simple example is
adding parentheses to existing molecule callbacks.
colliding from barlines.
";
}
-\version "1.3.117";
+
\score { \notes { \time 3/4; \key cis \major;
R2.*15 R2. R2.*7 }
+
\header{
texidoc="
Text is set with empty horizontal dimensions. The boolean property
+
\header {
texidoc = "Note head lines (eg glissando)
run between centers of the note heads.";
";
}
-\version "1.3.117";
+
\score { \notes \relative c{
+
\header{
texidoc=" The number of stafflines of a staff can be set. Ledger
+
\header {
texidoc="Slurs play well with phrasing slur.";
}
\paper {
linewidth = -1.;
}
-}
\ No newline at end of file
+}
+
\header{
texidoc="
Folded. This doesn't make sense without alternatives, but it works.
";
}
-\score { \notes\context Staff\relative c'' {
-\repeat fold 3 { c^"3$\\times$ 0alt" d }
-% less alts than body
-\repeat fold 4 { c^"4$\\times$ 2alt" d } \alternative { e f }
-% more alts than body
-\repeat fold 2 { c^"2$\\times$ 3alt" d } \alternative { e f g }
-}}
+\score {
+ \context Staff \notes \relative c'' {
+ \repeat fold 3 { c^"3$\\times$ 0alt" d }
+ % less alts than body
+ \repeat fold 4 { c^"4$\\times$ 2alt" d } \alternative { e f }
+ % more alts than body
+ \repeat fold 2 { c^"2$\\times$ 3alt" d } \alternative { e f g }
+ }
+}
+
\header{
texidoc="
Across linebreaks, the left edge of a first and second alternative
+
\header{
texidoc="
LilyPond has three modes for repeats: folded, unfolded and
+
\score { \notes \context Voice {
\repeat volta 3 c1
\alternative { d f } e4 } }
+
\header{
texidoc="
Volta (Semi folded) behavior. Voltas can start on non-barline moments.
}
% no alts.
-\score { \notes
- \relative c'' {
-% repeat non aligning with barlines.
-e
-\repeat volta 3 { c^"3$\\times$ 0alt" d e }
-% less alts than body
-\repeat volta 4 { c^"4$\\times$ 2alt" d } \alternative { e f }
-
-% more alts than body
-\repeat volta 2 { c^"2$\\times$ 3alt" d } \alternative { e f g }
-}
-
- \midi{}
- \paper{}
-
+\score {
+ \notes \relative c'' {
+ % repeat non aligning with barlines.
+ \repeat volta 3 { c^"3$\\times$ 0alt" d e }
+ % less alts than body
+ \repeat volta 4 { c^"4$\\times$ 2alt" d } \alternative { e f }
+ % more alts than body
+ \repeat volta 2 { c^"2$\\times$ 3alt" d } \alternative { e f g }
+ }
+ \paper {}
+ \midi {}
}
}
}
-\version "1.3.117";
+
+
\header{
texidoc="
Rests. Note that the dot of 8th, 16th and 32nd rests rest should be
+
\header{
texidoc="
Fonts are available in a default set of sizes: 11, 13, 16, 20, 23 and
+
\include "paper13.ly"
\include "allfontstyle.ly";
+
\include "paper16.ly"
\include "allfontstyle.ly";
+
\include "paper20.ly"
\include "allfontstyle.ly";
+
\include "paper23.ly"
\include "allfontstyle.ly";
+
\include "paper26.ly"
\include "allfontstyle.ly";
+
\header{
texidoc="
Slurs should be attached to note heads, except when they would collide
+
\header{
texidoc="
Across line breaks, slurs behave nicely. On the left, they extend to
>
}
-\version "1.3.117";
+
run through noteheads or stems.
";
}
-\version "1.3.117";
+
\score{
\notes\relative c''{
\time 3/4;
+
\score{
\notes\relative c''<
\time 4/4;
+
\score{
\notes\relative c'<
\time 6/8;
+
\header{
texidoc="
Loose:
+
\header{
texidoc="
Natural:
+
\header{
texidoc="
If there are accidentals in the music, we add space, but the space
+
\header{
texidoc="
The staccato dot (and all scripts with follow-into-staff set), must
}
-\version "1.3.117";
+
\score {
+
\header{
texidoc="
@c FIXME
+
\header{
texidoc="
Beams, stems and noteheads often have communication troubles, since
+
\header{
texidoc="
In a limited number of cases, LilyPond corrects for optical spacing
";
}
-\version "1.3.117";
+
\score{
\context Voice\notes \relative c''{
\property Voice.Text \set #'direction = #1
+
\header{
texidoc="
When tieing notes with accidentals across a bar boundary, the
@code{tieVerticalDirection}.
";
}
-\version "1.3.117";
+
t = \notes \relative c' { <c e g> ~ <c e g> }
+
\header{
texidoc="
Ties are strictly horizontal. They are placed in between note heads.
+
\header {
texidoc="Simple beams. This broke somewhere < 1.3.110
";
}
}
-\version "1.3.117";
+
+
\header {
texidoc ="Broken volta spanners behave correctly at left edge in all cases."
};
%}
-voice1 = \notes {
+voiceB = \notes {
\clef bass;
\property Staff.instrument = "Bass"
\property Staff.instr = "B"
}
}
}
-voice2 = \notes {
+voiceC = \notes {
\repeat volta 2
{
bes8 bes8 c'8 c'8 a4 r8 g16 f16 |
}
}
}
-voice3 = \notes {
+voiceD = \notes {
\repeat volta 2
{
bes8 bes8 c'8 c'8 a4 r8 g16 f16 |
}
}
}
-voice4 = \notes {
+voiceE = \notes {
\repeat volta 2
{
bes8 bes8 c'8 c'8 a4 r8 g16 f16 |
\context Staff="4"
{
- \$voice1
- \$voice2
+ \voiceB
+ \voiceC
\break
- \$voice3
- \$voice4
+ \voiceD
+ \voiceE
}
>
-\version "1.3.117";
+
ritme = \notes\transpose c'' {
\time 4/4;
-\version "1.3.117";
+
\paper{
%my standard paper block
minVerticalAlign=8.4;
}
\translator{\StaffContext
- TimeSignature \override #'style = #"C"
+ TimeSignature \override #'style = #'C
}
\translator{\VoiceContext
noStemExtend = ##t
-\version "1.3.117";
+
rh=\property Thread.NoteHead \override #'style = #'default
lh=\property Thread.NoteHead \override #'style = #'diamond
n = \property Thread.NoteHead \revert #'font-relative-size % = #'diamond %\property Thread.fontSize=#0
sm=\property Thread.NoteHead \override #'font-relative-size = #-1
-% su=\property Voice.verticalDirection=#1
-% sd=\property Voice.verticalDirection=#-1
+% su=\stemUp\slurUp\tieUp
+% sd=\stemDown\slurDown\tieDown
su=\property Voice.Stem \override #'direction = #1
sd=\property Voice.Stem \override #'direction = #-1
%K000.ly LilyPond 1.2.16
-\version "1.3.117"
+
\include "scarlatti-properties.ly"
\include "scarlatti-paper.ly"
%{
%standard properties list
rh={\property Thread.noteHeadStyle=""}
-lh={\property Thread.noteHeadStyle="diamond"}
+lh={\property Thread.noteHeadStyle = #'diamond}
n={\property Thread.fontSize="0"}
sm={\property Thread.fontSize="-1"}
su={\property Voice.verticalDirection="1"}
http://www.Arkkra.com/doc/star.ps
%}
-\version "1.3.120";
+
\header{
title="The Star Spangled Banner";
+
\score{
\notes\relative c''{
%segfault in engraver
-\version "1.3.117";
+
global = \notes {
\key a \minor;
\context Staff=up <
\global
\context Voice=foo {
- \property Voice.verticalDirection = #1
- \property Voice.scriptVerticalDirection = #1
+ \stemUp\slurUp\tieUp
+ \scriptUp
\melody
}
>
+
\score {
\context Voice \notes\relative c {
\time 3/4;
+
\score {
\context Voice \notes\relative c {
c''4 c4 cis4 cis [c8 c \clef "bass"; f,, f]
-\version "1.3.117"
+
%{
See scm/chord-names.scm: chord::names-alist-american
James Hammons <jlhamm@pacificnet.net>
\paper {
\translator {
\ChordNamesContext
- ChordName \override #'word-space = #1
- ChordName \override #'style = #'american
+ ChordNames \override #'word-space = #1
+ ChordNames \override #'style = #'american
}
}
}
date = "2000";
}
-\version "1.3.120";
+
\include "paper26.ly"
+
\score {
\context Voice \notes\relative c {
\time 4/4;
+
\score {
\context Voice \notes\relative c {
\time 4/4;
+
\include "paper-as9.ly"
\score {
+
\include "paper-as5.ly"
\score {
g4 a b c
}
\paper {
- \paper_as_five
+ \paperAs_five
\translator { \StaffContext barSize = #5 }
}
-\version "1.3.117";
+
\score{
\notes\relative c''{
| | | |--|
x| x| x| x| x|
%}
- %\property Voice.beamAutoEnd = #(make-moment 2 4)
+ %\property Voice.autoBeamSettings \override #'(end * * * *) = #(make-moment 2 4)
\property Voice.autoBeamSettings \override #'(end * * * *) = #(make-moment 2 4)
c8 c c c16 c
-\version "1.3.117";
+
%{
Currently (1.1.27.jcn3), the auto-beam engraver will only engrave
+
\score{
\notes\relative c''{
c8 c c c
+
%{
The auto-beam engraver has presets for common time signatures.
%}
-\version "1.3.117";
+
% bagpipe music.
\header
%
\score {
\notes { \time 6/8; \partial 4;
- \property Voice.tieVerticalDirection = \up
+ \tieUp
\slurUp
f4 |
\gg f4 e8 \thrd d4. |
\eg a4.()a4 d8 |
-\gg d4 f8 \dble e4. ( | \nobreak
+\gg d4 f8 \dble e4. ( | \noBreak
)e8 d4 \gg d4 e8 |
\break
-\version "1.3.117";
+
\header{
enteredby = "jcn";
+
\score
{
\notes \relative c'' {
+
\score {
\notes { c1 c1 \break c1 c1 }
\paper {
-\version "1.3.117";
+
\score {
\context Voice \notes\relative c {
c'1:16
-\version "1.3.117";
+
\score{
\notes\transpose c'{
+
\score {
\context Voice \notes\relative c {
% beam-control.fly
linewidth=-1.;
}
}
-\version "1.3.117";
+
+
\score {
\context Voice \notes\relative c {
[b''16 a]
}
}
-\version "1.3.117";
+
+
\header{
filename = "beam-pos.ly";
composer = "jcn";
+
%{
Have some fun beam quanting
%}
+
\score {
\context Voice \notes\relative c {
[c''16 b] [a b]
-\version "1.3.117";
+
\score{
\notes\relative c'{
\stemUp
-\version "1.3.117";
+
\score{
\notes\relative c'{
\stemUp
+
\score{
\notes\relative c''{
\property Score.beamQuantisation = #'none
+
\score{
\notes \relative c''{
- \property Voice.slurVerticalDirection = #1 c8(()c())c4
- \property Voice.slurVerticalDirection = #-1 a8(()a)a4
+ \slurUp c8(()c())c4
+ \slurDown a8(()a)a4
\break
- \property Voice.slurVerticalDirection = #-1 a8(()a())a4
- \property Voice.slurVerticalDirection = #1 c8(()c)c4
+ \slurDown a8(()a())a4
+ \slurUp c8(()c)c4
\break
- \property Voice.slurVerticalDirection = #-1 e8(()e())e4
- \property Voice.slurVerticalDirection = #1 f,8(()f)f4
+ \slurDown e8(()e())e4
+ \slurUp f,8(()f)f4
\break
- \property Voice.slurVerticalDirection = #1 e8(()e())e4
- \property Voice.slurVerticalDirection = #-1 f'8(()f)f4
+ \slurUp e8(()e())e4
+ \slurDown f'8(()f)f4
\break
}
TestedFeatures = "beams and beamflags";
}
-\version "1.3.117";
+
\score{
<
+
% followThread: connect note heads with line when thread switches staff
\score{
"(Feta definitively is not an abbreviation of Font-En-TjA)";
}
-\version "1.3.117";
+
shortlong = \notes{
c4()c( c c |
+
\header{
texidoc="property chordChanges: only display chord names when
there's a change in the chords scheme, but always display the
>
}
-\version "1.3.117";
+
-\version "1.3.117";
+
%{
Would this be acceptable/good enough/convenient for entry?
\paper{
\translator {
\ChordNamesContext
- ChordName \override #'word-space = #1
+ ChordNames \override #'word-space = #1
}
}
}
+
\score {
\context Voice \notes\relative c {
\clef "bass_8"; c4
}
-%\version "1.0.16";
+%;
-\version "1.3.117";
+
\score {
\context Voice \notes\relative c {
-\version "1.3.122"
+
% Ugh, we need to override some LaTeX titling stuff
\header {
c1 c
}
-violino1 = \notes \relative c' {
+violinoB = \notes \relative c' {
\property Staff.instrument = #"Violino I "
\property Staff.instr = #"Vl. I "
c1 c
}
-violino2 = \notes \relative c' {
+violinoC = \notes \relative c' {
\property Staff.instrument = #"Violino II "
\property Staff.instr = #"Vl. II "
c1 c
}
\translator {
\OrchestralScoreContext
- timeSignatureStyle = #"C"
+ TimeSignature \override #'style = #'C
}
}
}
+
\score{
\notes\relative c''{
a1\fff\> \!a\pp
-\version "1.3.117";
+
% add cue notes context
CueVoiceContext = \translator {
\VoiceContext
\name CueVoice;
- basicNoteHeadProperties \override #'font-relative-size = #-1
- basicStemProperties \override #'font-relative-size = #-1
- basicBeamProperties \override #'font-relative-size = #-1
- basicTextScriptProperties \override #'font-relative-size = #-1
- basicSlurProperties \override #'font-relative-size = #-1
- basicLocalKeyProperties \override #'font-relative-size = #-1
+ NoteHead \override #'font-relative-size = #-1
+ Stem \override #'font-relative-size = #-1
+ Beam \override #'font-relative-size = #-1
+ TextScript \override #'font-relative-size = #-1
+ Slur \override #'font-relative-size = #-1
+ Accidentals \override #'font-relative-size = #-1
};
\translator{ \CueVoiceContext }
StaffContext = \translator{\StaffContext
+
\score { \notes { c'1 \break < d'1 f' a'> }
\paper {\translator { \StaffContext
\consists Custos_engraver;
-\version "1.3.117";
+
\score {
+
% barline spacing disrupts visual rhythm.
#(set! space-alist (assoc-set! space-alist '("Staff_bar" "begin-of-note") '(minimum_space 0.0)))
+
% a few 32nds shouldn't stretch spacing enormously.
\score {
\notes { \time 3/4;
+
%non of the dynamics properties work anymore
\score {
\context Voice \notes\relative c {
-% \property Voice.verticalDirection = #-1
+% \stemDown\slurDown\tieDown
\property Voice.dynamicDirection = #1
\property Voice.dynamicPadding = #40
+
#(begin (newline)(display "hello world")(newline))\score{
\notes\relative c'{ c }
}
+
flauti = \notes \relative c' {
\property Staff.midiInstrument = #"flute"
\property Staff.instrument = #"2 Flauti"
R1*6 c1 R1*4
}
-violino1 = \notes \relative c' {
+violinoB = \notes \relative c' {
\property Staff.midiInstrument = #"violin"
\property Staff.instrument = #"Violino I"
\property Staff.instr = #"Vl. I"
R1*7 c1 R1*3
}
-violino2 = \notes \relative c' {
+violinoC = \notes \relative c' {
\property Staff.midiInstrument = #"violin"
\property Staff.instrument = #"Violino II"
\property Staff.instr = #"Vl. II"
}
\paper {
- \paper_sixteen
+ \paperSixteen
indent=100.0\mm;
linewidth=150.0\mm;
\translator {
+
\header{
texidoc="Explicit pitches and durations.";
}
\pitch #(make-pitch 1 1 1) \duration #(make-duration 2 0)
}
-}
\ No newline at end of file
+}
% (An alternative is to use a lyrics line if you want the figures
% aligned vertically.)
-\version "1.3.117";
+
% Scheme macros for accidentals. Note how they can be combined
% with other strings, for example in: d^#`(rows ,sharp "4")
+
%
% test file to get a4 paper really filled,
% without having to resort to the ever-ugly oversizing hack:
\repeat "unfold" 36 c1
}
\paper{
- \paper_thirteen
+ \paperThirteen
indent = 0.0\mm;
% URG
% Vertical space is rather precious when typesetting
+
\score {
\notes \context Voice = VA \relative c'' {
\grace {[b8^1 c^2]} d4^3
-\version "1.3.122";
+
FontBody= \notes\transpose c''{
\bar "|:";
% "(Feta definitively is not an abbreviation of Font-En-TjA)";
}
-\version "1.3.120";
+
\include "font-body.ly"
\score{
+
\header{
title= "The Feta Font";
subtitle = "proofsheet";
\score{
\FontBody
\paper{
- \paper_eleven
+ \paperEleven
linewidth = 17.5 \cm;
gourlay_maxmeasures =5.;
}
+
\header{
title= "The Feta Font";
subtitle = "proofsheet";
\score{
\FontBody
\paper{
- \paper_thirteen
+ \paperThirteen
linewidth = 17.5 \cm;
gourlay_maxmeasures =5.;
}
% "(Feta definitively is not an abbreviation of Font-En-TjA)";
}
-\version "1.3.120";
+
\include "paper16.ly"
\include "font-body.ly"
gourlay_maxmeasures =5.;
}
}
-\version "1.3.117";
+
+
\header{
title= "The Feta Font";
subtitle = "proofsheet";
\score{
\FontBody
\paper{
- \paper_twentysix
+ \paperTwentysix
linewidth = 17.5 \cm;
gourlay_maxmeasures =5.;
}
-\version "1.3.117";
+
\score {
\context Voice \notes\relative c {
% perhaps the current modifier approach is too simplistic
-\version "1.3.117";
+
gmsus=\notes\relative c \chords{
g1
-\version "1.3.117";
+
%{
+
\score {
\context Voice \notes\relative c {
-\version "1.3.117";
+
voiceOne = \notes \relative c'' {
a1 a a
-\version "1.3.117";
+
toeterI = \notes\relative c <{
\property Staff.instrument = #"Toeters"
+
\score {
\context Voice \notes\relative c {
-\version "1.3.117";
+
shiftI \property Voice.NoteColumn \override #'horizontal-shift = #0
+
\score{
\context Staff <
\time 4/4;
/Mats B
%}
-\version "1.3.117";
+
violinincipit = \notes\relative c''{
\clef "french";
-\version "1.3.117";
+
\score {
\notes
%}
-\version "1.3.117";
+
\score{
\context Staff <
\property Staff.instrument = "instrument"
-\version "1.3.117";
+
\score {
-\version "1.3.117";
+
%% This should only be necessary if your kpathsea setup is broken
%
\paper {
\translator {
\ChordNamesContext
- ChordName \override #'word-space = #1
- ChordName \override #'style = #'jazz
+ ChordNames \override #'word-space = #1
+ ChordNames \override #'style = #'jazz
}
}
}
+
\include "paper16.ly"
\score { \notes
\key cis \major; cis \key ces \major; ces
}
- \paper{\paper_sixteen}
+ \paper{\paperSixteen}
}
-\version "1.3.117";
+
blah = \notes {
}
}
-\version "1.3.117";
+
-\version "1.3.117";
+
\score{
\notes\relative c'{
[c16 \stemDown c'' \stemBoth c,, d]
+
\header {
texidoc="
Draw abritrary lines. This brings LilyPond on par with Mup.
\paper {
linewidth = 70.0*\staffspace;
}
-}
\ No newline at end of file
+}
+
%{
Test ly2dvi features.
%}
>
}
-\version "1.3.117";
+
>
}
-\version "1.3.117";
+
copyright = "public domain";
}
-\version "1.3.117";
+
m = \notes \relative c'' {
\property Staff.automaticMelismata = ##t
-\version "1.3.117";
+
somewhatLong = \lyrics{
- \property Lyrics . textStyle = "roman"
+ \property Lyrics.LyricText \set #'font-style = #'roman
AaaaaaA2
BbbbbbB2
CcccccC2
}
ratherLong = \lyrics{
- \property Lyrics . textStyle = "roman"
+ \property Lyrics.LyricText \set #'font-style = #'roman
LLLLoooonggggg2
Syyllllaaabbble2
LLLLoooonggggg2
}
quiteLong = \lyrics{
- \property Lyrics . textStyle = "roman"
+ \property Lyrics.LyricText \set #'font-style = #'roman
LLLLLLLLLooooongggggggg2
Syyyyyyyyyyyyylllllllaaaaaabbble2
LLLLLLLLLooooongggggggg2
-\version "1.3.117";
+
%{
+
\score { \notes {
c4
\property Score.repeatCommands = #'((volta "93") end-repeat)
-\version "1.3.117";
+
global = \notes {
s1 | \mark "A";
-\version "1.3.117";
+
%
% Test new font selection and scm text markup
+
\score{
\context Staff \notes\relative c''<
\context Voice = x {
>
\paper { Gourlay_maxmeaures = 2.; }
}
-\version "1.3.117";
+
+
%% Chord gurus, is this ok now??
monstrous= \chords{
+
\score{
\context Staff \notes\relative c''{
c1
-\version "1.3.117";
+
voiceOne = \notes\transpose c''{ \stemUp
R1 * 2 | f'4-. r r2 | R1 * 3 |
+
\score {
\context Voice \notes\relative c {
[c8 c16 c16]
+
\score {
\context Voice \notes\relative c {
% test noStemExtend
+
scheme = \notes {
<c'1 e' g'>
<e' g' c''>
+
\score {
\context Voice \notes\relative c {
\context Staff \notes\relative c''<
\context Voice=one {
- \property Voice.horizontalNoteShift=0
- \property Voice.verticalDirection=1
+ \property Voice.NoteColumn \override #'horizontal-shift = #0
+ \stemUp\slurUp\tieUp
e4
}
\context Voice=two {
- \property Voice.verticalDirection=1
- \property Voice.horizontalNoteShift=1
+ \stemUp\slurUp\tieUp
+ \property Voice.NoteColumn \override #'horizontal-shift = #1
cis
}
\context Voice=three {
- \property Voice.horizontalNoteShift=2
- \property Voice.verticalDirection=1
+ \property Voice.NoteColumn \override #'horizontal-shift = #2
+ \stemUp\slurUp\tieUp
ais
}
\context Voice=four {
- \property Voice.verticalDirection=-1
+ \stemDown\slurDown\tieDown
\property Voice.horizontalNoteShift=-1
fis
}
-\version "1.3.117";
+
\score{
\notes \transpose c''{
+
\score
{
\notes { c1 c1 \property Score.skipBars = ##t c1 \break R1*8 c1 c1 c1 c1
latexpackages="graphicx";
}
-\version "1.3.126";
+
m = \notes \relative c''{
-\version "1.3.117";
+
\score {
+
% Test parser error
\score{
+
% Test parser error
foo = \notes{
+
% Test parser error
foo = \notes{
+
% Test parser error
foo = \notes{
+
\score{
\context PianoStaff <
\context StaffCombineStaff=one \skip 1*2;
barNumberScriptPadding = #15
%% URG: this changes dynamics too
%%textStyle = #"italic"
- timeSignatureStyle = #"C"
+ TimeSignature \override #'style = #'C
maximumRestCount = #1
}
}
+
\header {
texidoc="Template for part-combining orchestral scores";
}
+
\score{
\context PianoStaff <
\context StaffCombineStaff=one \skip 1*7;
barNumberScriptPadding = #15
%% URG: this changes dynamics too
%%textStyle = #"italic"
- timeSignatureStyle = #"C"
+ TimeSignature \override #'style = #'C
maximumRestCount = #1
}
}
texidoc = "Piano pedal symbols merge stop and start. The strings are configurable. ";
}
-\version "1.3.120";
+
\score{
+
\score {
\context Voice \notes\relative c {
\context Voice=VoiceOne
+
\score {
\context Voice \notes\relative c {
c8 c c ~ c c c c ~ c ~ c ~ c c c
-\version "1.3.117";
+
%{
+
\score{
<
\context Staff \notes\relative c'{
+
\score{
<
\context Staff \notes\relative c'{
+
\score {
\context Voice \notes\relative c {
c'' d e f | \repetitions1*3 |
+
\score {
\context Voice \notes\relative c {
r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128
+
\score{
\context RhythmicStaff {
\notes\relative c''{
+
\header {
crossRefNumber = "1";
tagline = "Lily was here 1.3.98 -- automatically converted from ABC";
\context Staff="default"
{
- \$voicedefault
+ \voicedefault
}
>
+
\score {
\context Voice \notes\relative c {
% sharp-major
+
%{
Please don't use this Scheme hacking unless you have a good reason.
-\version "1.3.117";
+
blah = \notes{ \transpose c'' {
+
\score{
\context Staff <
\context Voice=one \partcombine Voice
+
\score{
\notes \relative c''{
- \property Voice.slurVerticalDirection = #1 c()a d()g,\break
- \property Voice.slurVerticalDirection = #-1 c()a d()g,\break
- \property Voice.slurVerticalDirection = #1 a()c d()g,\break
- \property Voice.slurVerticalDirection = #-1 a()c d()g,\break
- \property Voice.slurVerticalDirection = #-1 a()c d()g,\break
+ \slurUp c()a d()g,\break
+ \slurDown c()a d()g,\break
+ \slurUp a()c d()g,\break
+ \slurDown a()c d()g,\break
+ \slurDown a()c d()g,\break
}
\paper{
indent = 0.0;
+
\score {
\context Voice \notes\relative c {
% to see the magic: uncomment size stuff in init/paper20.ly
"(Feta definitively is not an abbreviation of Font-En-TjA)";
}
-\version "1.3.117";
+
shortlong = \notes{
c4()c( c c |
+
\score{
\notes\relative c''{
-\property Voice.slurVerticalDirection = #1
-\property Voice.stemVerticalDirection = #-1
+\slurUp
+\stemDown
a(a' a,)a
a(a a')a,
a(d a)a
c,(g' c e f d b)g
\property Voice.noAutoBeaming = ##t
-\property Voice.stemVerticalDirection = #1
+\stemUp
a8(a a a a a a)a
}
\paper { indent = 0.; linewidth = 40.*\staffspace; }
}
-\version "1.3.110";
+
+
\score{
\notes\relative c''{
\time 2/4;
% test damping
-\version "1.3.117";
+
\score{
\notes\relative c'{
-\version "1.3.117";
+
\score{
\notes{
c( d e )c |
- \slurdotted
+ \slurDotted
c( d e )c |
- \slurnormal
+ \slurNoDots
c( d e )c |
\property Voice.slurDash = #0.0
c( d e )c |
- \slurnormal
+ \slurNoDots
c( d e )c |
}
\paper{
-\version "1.3.117";
+
\score {
\context Voice \notes\relative c {
% CASE 3
+
\score{
\notes\relative c''{
\time 2/4;
+
\score{
\notes\relative c''{
\slurUp
+
x = {
\outputproperty #(make-type-checker 'note-head-interface)
#'extra-offset = #'(-1 . 0)
+
\header{
% should look the same
title="symmetry";
+
\header{
% should look the same
title="symmetry";
-\version "1.3.117";
+
\score{
\notes\transpose c'{
+
\score{
\context Staff = one <
\context Voice=one { \skip 1; }
\notes \relative c''
\context GrandStaff <
\context Staff = SA <
- \context Voice = VA { \property Voice.verticalDirection= 1
+ \context Voice = VA { \stemUp\slurUp\tieUp
e4 dis4 e2 }
- \context Voice = VB { \property Voice.verticalDirection= -1
+ \context Voice = VB { \stemDown\slurDown\tieDown
[cis8 a] [fis b] gis2 }
{\key e \major; }
>
}
}
-\version "1.3.117";
+
TestedFeatures = "This file tests various spacings";
}
-\version "1.3.117";
+
multipart = \notes \relative c'{
\context StaffGroup <
-\version "1.3.117";
+
nt = \notes { c1 \break c1 c1 }
stuff = \notes \relative c'' <
\context Staff = stone { \nt }
+
\score {
\notes {
c2_"geen gedonder"_"jij gaat onder"
+
\score
{
\context StaffGroup = a <
\translator
{
\StaffContext
- \consists Staff_margin_engraver;
+ \consists Instrument_name_engraver;
numberOfStaffLines = #1
}
+
\score {
\notes \relative c'' \context GrandStaff <
\context Staff = up { c4 c4 }
- \context Staff = down { \property Staff. staffLineLeading = #5.5 c4
+ \context Staff = down { \property Staff. staffSpace = #5.5 c4
[<c8 d f g>
e]
[f c']
% test staff margin with partial measure.
-\version "1.3.117";
+
\score {
\notes { \property Staff.instrument = "foo" \partial 4; c4 c1 }
>
\paper { linewidth = -1.; }
}
-\version "1.3.117";
+
-\version "1.3.120";
+
\include "paper-as5.ly"
\score {
\context StaffGroup <
\context Staff=upper \notes\relative c{
- \key f;
+ \key f \major;
\time 3/4;
r8^"Moderato" %\pp
<g'-. c-.> <c-. es-.> <g-. c-.> <c-. es-.> <g-. c-.> |
r8 <as-. c-.> <c-. es-.>
}
\context Staff=lower \notes\relative c{
- \key f;
+ \key f \major;
\time 3/4;
\clef "bass";
<c,2 c'> r4
\VoiceContext
beamHeight = ##f
autoBeamSettings \override (begin * * * *) = #(make-moment 0 1)
- textEmptyDimension = ##t
+ textNonEmpty = ##f
}
}
+
\include "paper-as9.ly"
\score {
\context GrandStaff <
\context Staff=upper \notes\relative c{
- \key F;
+ \key f \major;
\time 3/4;
r8^"Moderato" %\pp
<g'-. c-.> <c-. es-.> <g-. c-.> <c-. es-.> <g-. c-.> |
r8 <as-. c-.> <c-. es-.>
}
\context Staff=lower \notes\relative c{
- \key F;
+ \key f \major;
\time 3/4;
\clef "bass";
<c,2 c'> r4
}
>
\paper {
-% \paper_as_nine
+% \paperAs_nine
indent=4.0\char;
linewidth=78.0\char;
%\translator { \StaffContext barSize = #9 }
\translator {
\VoiceContext
beamHeight = ##f
- autoBeamSettings \push (begin * * * *) = #(make-moment 0 1)
- textEmptyDimension = ##t
+ autoBeamSettings \override (begin * * * *) = #(make-moment 0 1)
+ textNonEmpty = ##f
}
}
+
\score {
\notes {
\relative c'' {
-\property Voice . noteHeadStyle = "mensural"
+\property Voice . noteHeadStyle = #'mensural
\property Voice. stemCentered = ##t
c\maxima*1/8
c\longa*1/4 c\breve*1/2 c1 c2 c4 c8
+
\score {
\context Voice \notes\relative c {
}
-\version "1.3.117";
+
beamintervals = \notes{
\time 7/4;
+
\score {
\notes \context PianoStaff < \context Staff = SA { s1 }
\context Staff = SB { s1 }>
+
\score {
\notes \context StaffGroup < \context Staff = SA { s1 }
\context Staff = SB { s1 }>
-\version "1.3.117";
+
%{
\translator {
\StaffContext
\name TabStaff;
- basicStaffSymbolProperties \override #'line-count = #6
+ StaffSymbol \override #'line-count = #6
\remove "Clef_engraver";
\remove "Time_signature_engraver";
\consists "Pitch_squash_engraver";
- basicNoteHeadProperties \override #'transparent = ##t
- basicStemProperties \override #'transparent = ##t
- basicNoteHeadProperties \override #'staff-position = #-6
- basicDotsProperties \override #'transparent = ##t
+ NoteHead \override #'transparent = ##t
+ Stem \override #'transparent = ##t
+ NoteHead \override #'staff-position = #-6
+ Dots \override #'transparent = ##t
squashedPosition = #-4
- basicStemProperties \override #'length = #12
+ Stem \override #'length = #12
}
\translator {
\ScoreContext
instrument= "Violoncello";
}
-\version "1.3.117";
+
% this is an example of extreme dynamics
-\version "1.3.117";
+
\score{
\notes\relative c''{
-\version "1.3.123";
+
%
% Test font selection and scm text markup
% the thumb-script is used in cello music to indicate a note that should
% be played with your thumb.
-\version "1.3.117";
+
\score { \notes \relative c'' {
[<a8_\thumb a'8-3(> <)b_\thumb b'-3>
+
\score{
\notes \relative c''{
c1~\break c
+
\score{
\notes\relative c''{
\time 2/4;
+
\score {
\context Voice \notes\relative c {
+
\score {
\context Voice \notes\relative c {
\property Staff.TimeSignature \override #'style = #'C
+
\score {
\context Voice \notes\relative c {
instrument= "Instrument";
}
-\version "1.3.117";
+
\score{
\notes
+
voltaCommands = \notes {
s1 \property Staff.repeatCommands = #((volta . "1"))
c4 c4 c4 c4
+
\score {
\context Voice \notes\relative c {
% btw: this is not how transposing is done in mudela,
}
-\version "1.3.117";
+
vOne = \notes \relative c''{
\clef"violin";
+
\score {
\context Voice \notes \relative c'' {
\time 2/4;
+
\score
{
\context Voice \notes \relative c'' {
-\version "1.3.117"
+
\score {
\context Voice \notes\relative c'' {
copyright = "public domain";
}
-\version "1.3.117";
+
\include "paper-as5.ly"
-\version "1.3.117";
+
%
% We'd want to combine the stems, but have two slurs too...
% Looks like the a-due engraver
+
%{
Hmm, ik vraag me af of dit al helemaal koel is.
{\voiceTwo c}>
- \version "1.3.117";
+ ;
}
\paper { }
-\version "1.3.117";
+
\score {
\notes <
+
\score {
\notes <
\context Staff = upper {
}
}
-\version "1.3.117";
+
+
\score{
\context Staff <
\context Voice=one\skip 1;
}
-\version "1.3.117";
+
voiceB = \notes {
\clef bass;
-\version "1.3.117";
+
voiceE = \notes {
font_normal = 12.;
\translator {
\StaffContext
- TimeSignature \override #'style = #"C"
+ TimeSignature \override #'style = #'C
\consists Instrument_name_engraver;
}
}
+
\header {
texidoc="Various warnings
";
+
fragment = \notes {
f'32 g a b b a g f
+
\header{
texidoc="
There are several ways to calculate the direction of a beam
+
fragment = \notes {
[b''8 b]
\property Voice.Beam \set #'default-neutral-direction = #-1
+
fragment = \notes {
\property Voice.Beam \set #'staff-position = #2
\property Voice.Beam \set #'height = #-2
+
\header{
texidoc="
Beams over rests.
+
fragment = \notes {
\property Voice.Beam \set #'direction = #1
\property Voice.Beam \set #'height-hs = #0
+
fragment = \notes {
\context Voice {
\property Voice.crescendoText = "cresc."
+
\score {
\notes \relative c'' {
a-#"\\embeddedps{3 4 moveto 5 3 rlineto stroke}"
+
fragment = \notes {
a''^"3 $\\times$ \\`a deux"
}
+
\header{
texidoc="
Theads can be traced automagically when they switch staffs by setting
+
% german-chords.ly:
% german/norwegian/danish?
linewidth = -1;
}
}
-
\ No newline at end of file
+
-\version "1.3.117";
+
% Test scm markup text and kerning
+
\score {
\context Staff \notes <
\context Voice=i {
+
fragment = \notes {
\outputproperty #(make-type-checker 'note-head-interface)
#'extra-offset = #'(2 . 3)
+
#(define (make-text-checker text)
(lambda (grob) (equal? text (ly-get-elt-property grob 'text))))
+
\score {
\notes \relative c'' {
a b c d
+
\score {
\notes { c4 c4 c8 c8 }
\paper {
+
\header{
texidoc="
Slurs can be forced to always attach to note heads.
+
fragment = \notes {
a'''' b c a
\property Voice.TextSpanner \set #'type = #'dotted-line
+
\header{
texidoc="
In orchestral scores and hymns, voices are traditionally combined onto
%}
\include "paper16.ly"
-\version "1.3.129";
+
quickmeasure = \notes {[\repeat unfold 16 c''16]}
mel = \notes \relative c' {c16 d16 e8 a4 g2 e8 d c2. g'1 e4 d c2}
+
\header {
texidoc="
Simple customised music apply.
+
\header{
texidoc="
In some cases, you may want to set slur attachments by hand.
+
fragment = \notes {
\property Voice.Slur \set #'direction = #1
\property Voice.Stem \set #'length = #5.5
+
\header {
texidoc="You can get ugly slurs, if you want.
";
+
\header {
texidoc="
@example
+
\header {
texidoc = "By splitting the grouping (Axis_group_engraver) and
%}
-\version "1.3.117";
+
praeludiumRight = \notes {
\key e \major;
\clef violin;
+
\header {
title = "The river is flowing";
composer = "Traditonal (?)";
+
soprano = \notes \relative c'' {
fis8 g g8.-\trill fis32 g a8 d, r a
b4 ~ \times 2/3 { [b16 cis d] } \times 2/3 { [e fis g] }
}
bass = \notes \relative c {
- \property Voice.verticalDirection = \down
+ \stemDown\slurDown\tieDown
d4 e fis r8 fis | g4. g8 fis4. fis8 e8 e a a d,4
}
tenor = \notes \relative c' {
- \property Voice.verticalDirection = \up
+ \stemUp\slurUp\tieUp
r8
d4 cis8 r d16. cis32 d4 | r8 e16. dis32 e4 ~ e8 d16. cis32 d4 ~ |
[d8 d8] [cis cis] d4
\score {
\context PianoStaff \notes <
- \context Staff = top { \key d; \time 4/4;
+ \context Staff = top { \key d \major; \time 4/4;
\soprano
}
- \context Staff = bottom < \key d; \time 4/4; \clef bass;
+ \context Staff = bottom < \key d \major; \time 4/4; \clef bass;
\context Voice = up { \tenor }
\context Voice = down { \bass }
>
+
\header {
title = "Two miniatures";
}
+
% lines preceded by a percent are comments.
\include "paper16.ly"
\score {
-\version "1.3.130";
+
\include "paper13.ly";
+
\include "paper16.ly";
stemdown = \property Voice.Stem \override #'direction = #-1
viola = \notes \relative c' \context Voice = viola {
<c4-\f-\arpeggio g' c>
- \stemdown g'8. b,16
+ \stemDown g'8. b,16
s1 s2. r4
g
}
oboes = \notes \relative c'' \context Voice = oboe {
- \stemup s4 g8. b,16 c8 r <e'8.^\p g> <f16 a>
+ \stemUp s4 g8. b,16 c8 r <e'8.^\p g> <f16 a>
\grace <e8( g> <d4 f> <c2 e> \times 2/3 { <d8 \< f> <e g> <f a> }
<
{ \times 2/3 { a8 g c } \! c2 }
\context Voice = oboeTwo {
- \stemdown
+ \stemDown
\grace {
\property Grace.Stem \override #'direction = #-1
[f,16 g] }
f8 e e2
} >
- \stemboth
+ \stemBoth
\grace <c,8( e> <)b8. d8.-\trill> <c16 e> |
[<d ( f> < )f8. a>] <)b,8 d> r [<d16( f> <f8. )a>] <b,8 d> r |
[<c16( e> < )e8. g>] <c8 e,>
}
hoomPah = \repeat unfold 8
- \notes \transpose c' { c8 \stemdown c'8 \stemup }
+ \notes \transpose c' { c8 \stemDown c'8 \stemUp }
bassvoices = \notes \relative c' {
c4 g8. b,16
\autochange Staff \hoomPah
\translator Staff = down
- \stemdown [c8 c'8] r4
+ \stemDown [c8 c'8] r4
<g d'> r4
- < {\stemup r2 <e4 c'> <c8 g'> }
- \context Voice = reallyLow {\stemdown g2 ~ | g4 c8 } >
+ < {\stemUp r2 <e4 c'> <c8 g'> }
+ \context Voice = reallyLow {\stemDown g2 ~ | g4 c8 } >
}
\score {
+
accompMotif = \notes \relative c {
\times 2/3 { c8 g' es' }
\times 2/3 { c' es, g, }
+
\header {
title = "Test";
}
+
\score {
\notes {\notes \reletive c' {
copyright = "public domain";
}
-\version "1.3.117";
melodie = \notes\relative c'' {
\clef "violin";
}
text = \lyrics{
- \property Lyrics . textStyle = "italic"
+ \property Lyrics.LyricText \set #'font-style = #'italic
Ah!4 vous dir -- ai -- je ma man2
Ce4 qui cau -- se mon tour -- ment2
auto beaming, adding lyrics to notes, hyphens
%}
-\version "1.3.117";
+
melody = \notes \relative c'' {
\clef violin;
#include "lily-guile.hh"
class Scheme_hash_table;
+
+/*
+ Junk this almost-void class.
+ */
class Scope {
Scheme_hash_table *id_dict_;
Scope (Scope const &);
*/
kpse_set_program_name(av0, NULL);
kpse_maketex_option("tfm", TRUE);
+
+ /*
+ UGH: should not use DIR_DATADIR, but /var,
+ */
+
+ /*
+ ugh: apparently the program_args is non-functional.
+ */
+ kpse_format_info[kpse_tfm_format].program ="mktextfm --destdir " DIR_DATADIR "/tfm";
+
+ kpse_format_info[kpse_tfm_format].client_path =
+ (DIR_DATADIR "/tfm" );
+
#endif
}
+
+
{
if (header_l_)
outputter_l_->output_scope (header_l_, "lilypond");
+
+ outputter_l_->write_header_fields_to_file (header_l_);
}
outputter_l_->output_comment (_ ("Outputting Score, defined at: "));
progress_indication ("\n");
- if (global_header_p)
- {
- Scope gh (global_header_p);
- outputter_l_->write_header_fields_to_file (&gh);
- }
-
+
// huh?
delete outputter_l_;
outputter_l_ = 0;
$(outdir)/%.dvi: $(outdir)/%.ly
$(PYTHON) $(LY2DVI) --outdir=$(outdir) --dependencies $<
- -mv $(basename $(<F))*.midi $(outdir)
# don't junk intermediate .dvi files. They're easier to view than
# .ps or .png
$(outdir)/%.dvi: %.ly
$(PYTHON) $(LY2DVI) --outdir=$(outdir) --dependencies $<
- -mv $(basename $<)*.midi $(outdir)
$(outdir)-$(PAPERSIZE)/%.dvi: %.ly
$(PYTHON) $(LY2DVI) --outdir=$(outdir)-$(PAPERSIZE) --dependencies --papersize=$(PAPERSIZE) $<
- -mv $(basename $<)*.midi $(outdir)-$(PAPERSIZE)
-$(outdir)/%.dvi: %.fly
- $(PYTHON) $(LY2DVI) -o $(outdir) $<
- -mv $(basename $<)*.midi $(outdir)
ATVARIABLES = \
BASH\
DATE\
+ sharedstatedir\
GUILE\
date\
datadir\
"(unset)"
(scm->texi (cdr handle))))
(propdoc (backend-property->texi sym)))
-
+
(cons (car propdoc) (string-append (cdr propdoc)
"\nDefault value: "
defval))))
(music . ((font-family . music) (lookup . name)))
(finger . ((font-style . finger)))
(bold . ((font-series . bold)))
+ (upright . ((font-shape . upright)))
(italic . ((font-shape . italic)))
(named . ((lookup . name)))
(super . ((raise . 1) (font-relative-size . -1)))
(visibility-lambda . ,end-of-line-visible)
(style . vaticana)
(Y-offset-callbacks . (,Staff_symbol_referencer::callback))
- (meta . ,(grob-description "Custos" custos-interface staff-symbol-interface break-aligned-interface) )
+ (meta . ,(grob-description "Custos" custos-interface staff-symbol-referencer-interface break-aligned-interface) )
))
(Hairpin . (
(Script . (
(molecule-callback . ,Script::brew_molecule)
+ (direction . -1)
(X-offset-callbacks . (,Side_position_interface::centered_on_parent))
(after-line-breaking-callback . ,Script::after_line_breaking)
(meta . ,(grob-description "Script" script-interface side-position-interface font-interface))
))
(SostenutoPedal . (
(molecule-callback . ,Text_item::brew_molecule)
+ (direction . -1)
(X-offset-callbacks . (,Side_position_interface::aligned_on_self))
(Y-offset-callbacks .
(,Side_position_interface::aligned_side
(no-spacing-rods . #t)
(molecule-callback . ,Sustain_pedal::brew_molecule)
(self-alignment-X . 0)
+ (direction . -1)
(X-offset-callbacks . (,Side_position_interface::aligned_on_self))
(Y-offset-callbacks .
(,Side_position_interface::aligned_side
(TextScript . (
(molecule-callback . ,Text_item::brew_molecule)
(no-spacing-rods . #t)
+ (direction . -1)
(padding . 0.5)
(baseline-skip . 2)
(font-family . roman)
(font-shape . italic)
(no-spacing-rods . #t)
(self-alignment-X . 0)
+ (direction . -1)
(X-offset-callbacks . (,Side_position_interface::aligned_on_self))
(Y-offset-callbacks .
(,Side_position_interface::aligned_side
(grob-property-description 'stacking-dir dir? "stack contents of grobs in which direction ?.")
(grob-property-description 'staff-space number? "Amount of line leading relative to global staffspace.")
(grob-property-description 'staff-position number? "vertical position in staff spaces, counted from the middle line.")
+(grob-property-description 'staff-symbol boolean? "the staff symbol grob that we're in.")
(grob-property-description 'staffline-clearance number? "don't get closer than this to stafflines.")
(grob-property-description 'stem ly-grob? "pointer to Stem object.")
(grob-property-description 'stem-centered boolean? "Center stems on note heads. Useful for mensural notation.")
all-interfaces)))
-(define interface-names (map (lambda (x) (symbol->string (car x))) all-interfaces))
+(define (interface-names) (map (lambda (x) (symbol->string (car x))) all-interfaces))
str = re.sub ('\\\\property *"?([^.]+)"? *[.] *"?timeSignatureStyle"? *= *"([^"]*)"', '\\\\property \\1.TimeSignature \\\\override #\'style = #\'\\2', str)
- str = re.sub ('\\\\property *"?([^.]+)"? *[.] *"?horizontalNoteShift"? *= *"?#?([0-9]+)"?', '\\\\property \\1.NoteColumn \\\\override #\'horizonta-shift = #\\2', str)
+ str = re.sub ('"?timeSignatureStyle"? *= *#?""', 'TimeSignature \\\\override #\'style = ##f, str)
+
+ str = re.sub ('"?timeSignatureStyle"? *= *#?"([^"]*)"', 'TimeSignature \\\\override #\'style = #\'\\1', str)
+
+ str = re.sub ('#\'style *= #*"([^"])"', '#\'style = #\'\\1', str)
+
+ str = re.sub ('\\\\property *"?([^.]+)"? *[.] *"?horizontalNoteShift"? *= *"?#?([0-9]+)"?', '\\\\property \\1.NoteColumn \\\\override #\'horizontal-shift = #\\2', str)
+ # ugh
+ str = re.sub ('\\\\property *"?([^.]+)"? *[.] *"?flagStyle"? *= *""', '\\\\property \\1.Stem \\\\override #\'flag-style = ##f', str)
+
+ str = re.sub ('\\\\property *"?([^.]+)"? *[.] *"?flagStyle"? *= *"([^"]*)"', '\\\\property \\1.Stem \\\\override #\'flag-style = #\'\\2', str)
return str
conversions.append (((1,3,98), conv, 'CONTEXT.textStyle -> GROB.#font-style '))
if last_conversion:
sys.stderr.write ('\n')
new_ver = '\\version \"%s\"' % tup_to_str (last_conversion)
+ # JUNKME?
+ # ugh: this all really doesn't help
+ # esp. as current conversion rules are soo incomplete
if re.search (lilypond_version_re_str, str):
str = re.sub (lilypond_version_re_str,'\\'+new_ver , str)
- else:
- str = new_ver + '\n' + str
+ #else:
+ # str = new_ver + '\n' + str
outfile.write(str)
#!@PYTHON@
+# run lily, setup LaTeX input.
+""" TODO: --dependencies
-# TODO:
-#
-# * Rewrite this. The control structure is too hairy.
-# * (c) on page 1
-# * more helpful info on lily crashes
-# * Should use files in /tmp/ only. This potentially messes with
-# user generated files in the CWD
-
-
-"""
-=======================================================================
-LilyPond to dvi converter
-
-Features include Title information, paper size specification, and image
-orientation.
-
-Usage: ly2dvi.py [OPTION]... [FILE]...
-Input: LilyPond source or LilyPond generated TeX files
-Output: DVI file
-=======================================================================
"""
-name = 'ly2dvi'
-version = '@TOPLEVEL_VERSION@'
-errorlog = ''
-import sys
import os
-import getopt
-import re
+import stat
import string
-import time
-import glob
+import re
+import getopt
+import sys
+import __main__
+import operator
import tempfile
-# Can't grep localized msgs
-os.environ['LC_ALL'] = ''
-os.environ['LANG'] = ''
-os.environ['LC_LANG'] = ''
-
-
-
-class Input:
- """
- This class handles all ly2dvi.py input file methods
-
- Public methods:
-
- __init__() Constructor
- open(file) Open a .ly file or .tex file using lilyinclude path
- close() Close current file
- type() Determine file type .ly (input) or .tex (output)
- setVars() Set title definitions found in .tex (output) file
- """
-
- #
- # Constructors
- #
-
- def __init__(this):
- this.__fd = None
-
- #
- # open
- #
- def open(this,file):
- """
- open file and set private class variable __fd. The search
- sequence is: current directory followed by the directories
- found in include property list. Each directory is searched
- for file, file.ly, file.sly and file.fly.
-
- input: file filename
- output: void
- error: ExitNotFound Exception
- """
-
- for i in [''] + Props.get('include')[0:]:
- ifile = os.path.join(i,file)
- for j in ['','.ly','.fly', '.sly']:
- jfile = ifile+j
- try:
- this.__fd = open( jfile, 'r' )
- return
- except:
- pass
- sys.exit('ExitNotFound', file)
-
-
- #
- # close
- #
- def close(this):
- """
- close file object __fd
-
- input: void
- output: void
- error: None
- """
- this.__fd.close()
-
-
- #
- # type
- #
- def type(this):
- """
- Determine input file type. LilyPond source is 'input' type
- and LilyPond generated TeX file is 'output' type
-
- input: void
- output: 'input' | 'output'
- error: None
- """
-
- firstline = this.__fd.readline()
- this.__fd.seek(0)
- if re.match('% Generated automatically by: GNU LilyPond [0-9]+[.0-9]+',firstline ):
- return 'output'
- else:
- return 'source'
-
-
- #
- # setVars
- #
- def setVars(this):
- """
- Search for properties in the current input file and set the
- appropriate values. The supported properties names are in
- local variable varTable along with the property list
- titledefs.
-
- input: void
- output: None
- error: None
- """
-
- varTable = [
- # regexp set method
- # ------ ----------
- ( 'language', Props.setLanguage ),
- ( 'latexheaders', Props.setHeader ),
- ( 'latexpackages', Props.setPackages ),
- ( 'paperorientation', Props.setOrientation ),
- ( 'paperpapersize', Props.setPaperZize ),
- ( 'papertextheight', Props.setTextHeight ),
- ( 'paperlinewidth', Props.setLineWidth ),
- ( 'filename', Props.setFilename ),
- ]
-
- titles={}
- for line in this.__fd.readlines():
- m=re.match('\\\\def\\\\lilypond([\w]+){(.*)}',line)
- if m:
- for var in varTable:
- if m.group(1) == var[0]:
- var[1](m.group(2),'file')
- break
- for var in Props.get('titledefs'):
- if m.group(1) == var:
- titles[var]=m.group(2)
- break
- Props.setTitles(titles,'file')
- this.__fd.seek(0)
-
-\f
-
-class TeXOutput:
- """
- This class handles all ly2dvi.py output file methods
-
- private methods:
- __lilypondDefs(opt) Send title info to output file
-
- Public methods:
- __init__() Constructor
- write(str) Write a string to output file
- start(file) Start the latex file
- next() Process next output file
- end() Finish latex file and run latex
- """
-
- #
- # constructor
- #
- def __init__(this):
- this.__fd = None
- this.__base = ''
- this.__outfile = ''
-
- #
- # __medelaDefs
- #
- def __lilypondDefs(this,opt):
- """
- Write titles to output
-
- input: opt Supports header and subheader output
- output: None
- error: None
- """
-
- titles = Props.get('titles')
- for key in titles.keys():
- this.write('%s\\lilypond%s{%s}%%\n' % (opt,key,titles[key]))
-
- #
- # write
- #
- def write(this,str):
- """
- Write str to current output file
-
- input: str String to write
- output: None
- error: None
- """
-
- this.__fd.write(str)
-
- #
- # start
- #
- def start(this,file):
- """
- Start LaTeX file. Sets the linewidth (and possibly the
- textheight) and leaves the page layout to the geometry
- package. Creates temporary output filename and opens it
- for write. Sends the LaTeX header information to output.
- Lastly sends the title information to output.
-
- input: file output file name
- output: None
- error: None
- """
-
- now=time.asctime(time.localtime(time.time()))
-
- # Only set the textheight if it was explicitly set by the user,
- # otherwise use the default. Helps to handle landscape correctly!
- if Props.get('textheight') > 0:
- textheightsetting = ',textheight=' + `Props.get('textheight')` + 'pt'
- else:
- textheightsetting = ''
-
-
- top= r"""
-%% Creator: %s
-%% Generated automatically by: %s, from %s, at %s
-
-\documentclass[%s]{article}
-
-%s
-\usepackage{geometry}
-\usepackage[latin1]{inputenc}
-%%\usepackage[T1]{fontenc}
-%%
-%% don not waste unused space at bottom of page
-%% (unless we have footnotes ...)
-%%\headheight9pt
-%%\headsep0pt
-%% Maybe this is too drastic, but let us give it a try.
-\geometry{width=%spt%s,headheight=2mm,headsep=0pt,footskip=2mm,%s}
-\input{titledefs}
-%s
-\makeatletter
-\renewcommand{\@oddhead}{\parbox{\textwidth}%%
- {\mbox{}\small\theheader\hfill\textbf{\thepage}}}%%
-%% UGR.
-%%\renewcommand{\@evenhead}{eve!{\small\lilypondinstrument{,}\quad\textbf{\thepage}}\hfil}%%
-\renewcommand{\@oddfoot}{\parbox{\textwidth}{\mbox{}\thefooter}}%%
-%s
-\begin{document}
-""" % ( program_id(), program_id(), Props.get('filename'), now, Props.get('papersize'),
- Props.get('language'), Props.get('linewidth'), textheightsetting,
- Props.get('orientation'), Props.get('header'), Props.get('pagenumber'))
-
- base, ext = os.path.splitext(file)
- this.__base = base
- tempfile.template= base + '_ly'
- this.__outfile = tempfile.mktemp(ext)
- base, ext = os.path.splitext(this.__outfile)
- this.__tmpbase = base
- try:
- this.__fd = open(this.__outfile,"w")
- except:
- sys.exit('ExitNoWrite', this.__outfile)
- this.write(top)
- this.__lilypondDefs('')
- this.write("""\
-\\makelilytitle
-""")
-
- #
- # next
- #
- def next(this):
- """
- Write LaTeX subheader information to support more than one
- score in a document. Lastly send current title information to
- output.
-
- input: None
- output: None
- error: None
- """
-
- this.write("""\
-\\def\\theopus{}%
-\\def\\thepiece{}%
-\\def\\lilypondopus{}%
-\\def\\lilypondpiece{}%
+
+layout_fields = ['title', 'subtitle', 'subsubtitle', 'footer', 'head',
+ 'composer', 'arranger', 'instrument', 'opus', 'piece', 'metre',
+ 'meter', 'poet']
+
+
+# init to empty; values here take precedence over values in the file
+extra_init = {
+ 'language' : [],
+ 'latexheaders' : [],
+ 'latexpackages' : ['geometry'],
+ 'papersizename' : [],
+ 'pagenumber' : [],
+ 'textheight' : [],
+ 'linewidth' : [],
+ 'orientation' : []
+}
+
+extra_fields = extra_init.keys ()
+
+fields = layout_fields + extra_fields
+original_dir = os.getcwd ()
+include_path = ['.']
+temp_dir = ''
+keep_temp_dir = 0
+no_lily = 0
+outdir = '.'
+track_dependencies_p = 0
+
+dependency_files = []
+
+
+program_version = '@TOPLEVEL_VERSION@'
+if program_version == '@' + 'TOPLEVEL_VERSION' + '@':
+ program_version = '1.3.134'
+
+# generate ps ?
+postscript_p = 0
+
+option_definitions = [
+ ('', 'h', 'help', 'print help'),
+ ('KEY=VAL', 's', 'set', 'change global setting KEY to VAL'),
+ ('', 'P', 'postscript', 'Generate PostScript output'),
+ ('', 'k', 'keep', 'Keep all output, and name the directory ly2dvi.dir'),
+ ('', '', 'no-lily', 'Don\'t run lilypond'),
+ ('', 'v', 'version', "Print version and copyright info"),
+ ('DIR', '', 'outdir', 'Dump all final output into DIR'),
+ ('', 'd', 'dependencies', 'Dump all final output into DIR'),
+ ]
+
+
+
+def identify():
+ sys.stdout.write ('lilypond-book (GNU LilyPond) %s\n' % program_version)
+
+def print_version ():
+ identify()
+ sys.stdout.write (r"""Copyright 1998--1999
+Distributed under terms of the GNU General Public License. It comes with
+NO WARRANTY.""")
+
+
+
+def progress (s):
+ """Make the progress messages stand out between lilypond stuff"""
+ sys.stderr.write (' *** ' + s+ '\n')
+
+def error (s):
+ sys.stderr.write (s)
+ raise 'Exiting ... '
+
+
+def find_file (name):
+ """
+ Search the include path for NAME. If found, return the (CONTENTS, PATH) of the file.
+ """
+
+ f = None
+ nm = ''
+ for a in include_path:
+ try:
+ nm = os.path.join (a, name)
+ f = open (nm)
+ __main__.read_files.append (nm)
+ break
+ except IOError:
+ pass
+ if f:
+ sys.stderr.write ("Reading `%s'\n" % nm)
+ return (f.read (), nm)
+ else:
+ error ("File not found `%s'\n" % name)
+ return ('', '')
+
+
+
+
+def getopt_args (opts):
+ "Construct arguments (LONG, SHORT) for getopt from list of options."
+ short = ''
+ long = []
+ for o in opts:
+ if o[1]:
+ short = short + o[1]
+ if o[0]:
+ short = short + ':'
+ if o[2]:
+ l = o[2]
+ if o[0]:
+ l = l + '='
+ long.append (l)
+ return (short, long)
+
+def option_help_str (o):
+ "Transform one option description (4-tuple ) into neatly formatted string"
+ sh = ' '
+ if o[1]:
+ sh = '-%s' % o[1]
+
+ sep = ' '
+ if o[1] and o[2]:
+ sep = ','
+
+ long = ''
+ if o[2]:
+ long= '--%s' % o[2]
+
+ arg = ''
+ if o[0]:
+ if o[2]:
+ arg = '='
+ arg = arg + o[0]
+ return ' ' + sh + sep + long + arg
+
+
+def options_help_str (opts):
+ "Convert a list of options into a neatly formatted string"
+ w = 0
+ strs =[]
+ helps = []
+
+ for o in opts:
+ s = option_help_str (o)
+ strs.append ((s, o[3]))
+ if len (s) > w:
+ w = len (s)
+
+ str = ''
+ for s in strs:
+ str = str + '%s%s%s\n' % (s[0], ' ' * (w - len(s[0]) + 3), s[1])
+ return str
+
+def help():
+ sys.stdout.write("""Usage: lyvi [options] FILE\n
+Generate .dvi with LaTeX for lilypond
+Options:
""")
- this.__lilypondDefs("\\def")
- this.write("""\
-\\def\\theopus{\\lilypondopus}% ugh
-\\def\\thepiece{\\lilypondpiece}%
-\\makelilypiecetitle
+ sys.stdout.write (options_help_str (option_definitions))
+ sys.stdout.write (r"""Warning all output is written in the CURRENT directory
+
+
+
+Report bugs to bug-gnu-music@gnu.org.
+
+Written by
+Han-Wen Nienhuys <hanwen@cs.uu.nl>
""")
+ sys.exit (0)
- #
- # end
- #
- def end(this):
- """
- Close output file and run latex on it.
- input: None
- output: None
- error: ExitBadLatex Exception
- """
+def setup_temp ():
+ global temp_dir
+ temp_dir = 'ly2dvi.dir'
+ if not keep_temp_dir:
+ temp_dir = tempfile.mktemp ('ly2dvi')
+
+ try:
+ os.mkdir (temp_dir)
+ except OSError:
+ pass
+
- outfile=this.__base + '.dvi'
- if Props.get('output') != '':
- if not os.path.exists(Props.get('output')):
- os.mkdir(Props.get('output'))
+ # try not to gen/search MF stuff in temp dir
+ fp = ''
+ try:
+ fp = ':' + os.environ['TFMFONTS']
+ except KeyError:
+ fp = '://:'
- outfile = os.path.join(Props.get('output'), outfile )
-
- this.write(r"""
-%% \vfill\hfill{\lilypondtagline}
-\makeatletter
-\renewcommand{\@oddfoot}{\parbox{\textwidth}{\mbox{}\lilypondtagline}}%%
-\makeatother
-\end{document}
-""")
- this.__fd.close()
- if os.path.isfile(outfile):
- os.remove(outfile)
- if ( os.name == 'posix' ):
- stat = os.system('latex \'\\nonstopmode \\input %s\'' %
- (this.__outfile))
- else: # Windows shells don't eat the single quotes
- stat = os.system('latex \\nonstopmode \\input %s' %
- (this.__outfile))
- if stat:
- sys.exit('ExitBadLatex')
- if not os.path.isfile(outfile):
- os.rename(this.__tmpbase + '.dvi', outfile)
- sys.stderr.write('\n' + program_id() + ': dvi file name is %s\n\n'
- % (outfile))
-
- if Props.get('postscript'):
- dvipsopts=''
- if Props.get('orientation') == 'landscape':
- dvipsopts=dvipsopts + ' -t landscape'
- psoutfile=this.__base + '.ps'
- if Props.get('output') != '':
- psoutfile = os.path.join(Props.get('output'), psoutfile )
- stat = os.system('dvips %s -o %s %s' % (dvipsopts,psoutfile,outfile))
- if stat:
- sys.exit('ExitBadPostscript')
-
-
-\f
-
-
-# ARG! THIS CODE IS BLOATED:
-# FIXME: Junk all set/get methods.
-
-class Properties:
- """
- This class handles all ly2dvi.py property manipulation
-
- Public methods:
-
- __init__() Constructor
- set<property> methods
- """
-
- def __init__(this):
-
- #
- # Following is the order of priority for property assignment. The
- # list is organized from lowest to highest priority. Each
- # assignment is overridden by the next requester in the list.
- #
- # Requester Description
- # --------- -----------
- # init Initial default values
- # file The values found in the LilyPond generated TeX files
- # environment Envrionment variables LILYINCLUDE, LILYPONDPREFIX
- # rcfile $LILYPONDPREFIX/.lilyrc
- # rcfile $HOME/.lilyrc
- # rcfile ./.lilyrc
- # commandline command line arguments
- #
- this.__overrideTable = {
- 'init' : 0,
- 'file' : 1,
- 'environment' : 2,
- 'rcfile' : 3,
- 'commandline' : 4,
- 'program' : 5
- }
-
- this.__roverrideTable = {} # reverse lookup used for debug
- for i in this.__overrideTable.items():
- this.__roverrideTable[i[1]]=i[0]
-
- this.__data = {
- 'papersize' : ['a4paper', this.__overrideTable['init']],
- 'textheight' : [0, this.__overrideTable['init']],
- 'linewidth' : [500, this.__overrideTable['init']],
- 'orientation' : ['portrait', this.__overrideTable['init']],
- 'language' : ['%', this.__overrideTable['init']],
- 'include' : [[], this.__overrideTable['init']],
- 'debug' : [0, this.__overrideTable['init']],
- 'keeplilypond' : [0, this.__overrideTable['init']],
- 'keeply2dvi' : [0, this.__overrideTable['init']],
- 'pagenumber' : ['%', this.__overrideTable['init']],
- 'separate' : [0, this.__overrideTable['init']],
- 'output' : ['', this.__overrideTable['init']],
- 'header' : ['%', this.__overrideTable['init']],
- 'dependencies' : [0, this.__overrideTable['init']],
- 'root' : ['', this.__overrideTable['init']],
- 'tmp' : ['d:\tmp', this.__overrideTable['init']],
- 'filename' : ['', this.__overrideTable['init']],
- 'titledefs' : [[], this.__overrideTable['init']],
- 'titles' : [{}, this.__overrideTable['init']],
- 'lilyOutputFiles' : [[], this.__overrideTable['init']],
- 'postscript' : [0, this.__overrideTable['init']],
- }
-
- #
- # Try to set root and HOME first before calling rcfile
- #
- if os.environ.has_key('LILYPONDPREFIX'):
- this.setRoot(os.environ['LILYPONDPREFIX'], 'environment')
- else:
- p=os.path.split(sys.argv[0])
- p=os.path.split(p[0])
- # bit silly. for ly2dvi, overrules compiled-in datadir...
- # how to do this better (without running lily, of course?
- this.setRoot(os.path.join(p[0],'share','lilypond'), 'init')
-
- if not os.environ.has_key('HOME'):
- if os.environ.has_key('HOMEDRIVE') and \
- os.environ.has_key('HOMEPATH'):
- os.environ['HOME'] = os.environ['HOMEDRIVE'] + \
- os.environ['HOMEPATH']
- else:
- os.environ['HOME'] = os.curdir
-
- this.rcfile() # Read initialization file(s)
-
- if os.environ.has_key('LILYINCLUDE'):
- tmp=this.get('include')
- for s in string.split(os.environ['LILYINCLUDE'],os.pathsep):
- tmp.append(s)
- this.__set('include', tmp, 'environment')
-
-
- t = os.pathsep
- if os.environ.has_key ('TEXINPUTS'):
- t = os.environ['TEXINPUTS'] + os.pathsep
-
- ly2dvi_t = t + \
- os.path.join(this.get('root'), 'tex' ) + \
- os.pathsep + os.path.join(this.get('root'), 'ps' )
- # Don't add the magic `//' to TEXINPUTS
- ly2dvi_t = re.sub ('//*', '/', ly2dvi_t)
- os.environ['TEXINPUTS'] = ly2dvi_t
-
- m = ''
- if os.environ.has_key ('MFINPUTS'):
- m = os.environ['MFINPUTS']
- ly2dvi_m = m + os.pathsep + \
- os.path.join(this.get('root'), 'mf')
- ly2dvi_m = re.sub ('//*', '/', ly2dvi_m)
- # Don't add the magic `//' to MFINPUTS
- os.environ['MFINPUTS'] = ly2dvi_m
-
- if os.environ.has_key('TMP'):
- this.__set('tmp',os.environ['TMP'],'environment')
-
-
- def read_titledefs (this):
- fd=this.get_texfile_path ('titledefs.tex')
- mudefs=[]
-
- for line in fd.readlines():
- m=re.match('\\\\newcommand\*{\\\\lilypond([\w]+)}',line)
- if m:
- mudefs.append(m.group(1))
- fd.close
- this.__set('titledefs', mudefs, 'init')
-
- #
- # __set
- #
- def __set(this,var,value,requester):
- """
- All of the set methods call this to set a property. If the value
- was last set by a requestor of lesser priority the new value is
- assigned, else the old value has priority and is unchanged.
- """
-
- if this.__overrideTable[requester] < this.__data[var][1]:
- return 0
- else:
- this.__data[var] = [value, this.__overrideTable[requester]]
-
- #
- # get
- #
- def get(this,var):
- """
- All of the get methods call this to get a property value. List
- variable types are return by value to facilitate an append operation.
- """
-
- if var == 'include' or var == 'lilyOutputFiles':
- return this.__data[var][0][0:] # return a copy not a ref
- else:
- return this.__data[var][0]
-
- #
- # get_texfile_path
- #
- def get_texfile_path (this, var):
- """
- locate and open titledefs.tex file
- """
-
- if os.name == 'nt':
- path = os.path.join(this.get('root'), 'tex', var)
- else:
- path =''
- cmd =('kpsewhich tex %s %s' % (var,errorlog))
- sys.stderr.write ('executing: %s'% cmd)
- pipe = os.popen (cmd, 'r')
- path = pipe.readline ()[:-1] # chop off \n
- return_status = pipe.close()
- sys.stderr.write ('\n')
- if return_status and not path:
- path = os.path.join(this.get('root'), 'tex', var)
- fd = open(path, 'r')
- return fd
-
-
- #
- # Read rc file
- #
- def rcfile(this):
- """
- Read initialization file(s)
- """
- varTable = [
- # name set method
- # ---- ----------
- ( 'DEBUG', this.setDebug ),
- ( 'DEPENDENCIES', this.setDependencies ),
- ( 'KEEPLILYPOND', this.setKeeplilypond ),
- ( 'KEEPLY2DVI', this.setKeeply2dvi ),
- ( 'LANGUAGE', this.setLanguage ),
- ( 'LATEXHF', this.setHeader ),
- ( 'LATEXPKG', this.setPackages ),
- ( 'LILYINCLUDE', this.setInclude ),
- ( 'LILYPONDPREFIX', this.setRoot ),
- ( 'NONUMBER', this.setNonumber ),
- ( 'ORIENTATION', this.setOrientation ),
- ( 'OUTPUTDIR', this.setOutput ),
- ( 'PAPERSIZE', this.setPaperZize ),
- ( 'PHEIGHT', this.setTextHeight ),
- ( 'POSTSCRIPT', this.setPostscript ),
- ( 'PWIDTH', this.setLineWidth ),
- ( 'SEPARATE', this.setSeparate ),
- ( 'TMP', this.setTmp ),
- ]
-
- if ( os.name == 'posix' ):
- dotFilename='.lilyrc'
- else: # Windows apps like edit choke on .lilyrc
- dotFilename='_lilyrc'
-
- for d in [os.path.join(this.get('root'),'ly'), \
- os.environ['HOME'], os.curdir ]:
- file=os.path.join(d,dotFilename)
- try:
- fd = open( file, 'r' )
- except:
- continue
-
- for line in fd.readlines():
- if re.match('#.*',line):
- continue
- m=re.search('([\w]+)=(.*)',line)
+ os.environ['TFMFONTS'] = original_dir + fp
+
+ os.chdir (temp_dir)
+ progress ('Temp directory is `%s\'\n' % temp_dir)
+
+
+def system (cmd, ignore_error = 0):
+ sys.stderr.write ("invoking `%s\'\n" % cmd)
+ st = os.system (cmd)
+ if st:
+ msg = ('Error command exited with value %d' % st)
+ if ignore_error:
+ sys.stderr.write (msg + ' (ignored)\n')
+ else:
+ error (msg)
+
+ return st
+
+def cleanup_temp ():
+ if not keep_temp_dir:
+ progress ('Cleaning up `%s\'' % temp_dir)
+ system ('rm -rf %s' % temp_dir)
+
+
+def run_lilypond (files):
+ opts = ''
+ opts = opts + ' ' + string.join (map (lambda x : '-I ' + x, include_path))
+ opts = opts + ' ' + string.join (map (lambda x : '-H ' + x, fields))
+
+ if track_dependencies_p:
+ opts = opts + " --dependencies "
+
+ fs = string.join (files)
+
+ system ('lilypond %s %s ' % (opts, fs))
+
+
+def set_setting (dict, key, val):
+ try:
+ val = string.atof (val)
+ except ValueError:
+ pass
+
+ try:
+ dict[key].append (val)
+ except KeyError:
+ dict[key] = [val]
+
+
+def analyse_lilypond_output (filename, extra):
+ """Grep FILENAME for interesting stuff, and
+ put relevant info into EXTRA."""
+ filename = filename+'.tex'
+ progress ("Analyzing `%s'" % filename)
+ s = open (filename).read ()
+
+ # search only the first 10k
+ s = s[:10240]
+ for x in ('textheight', 'linewidth', 'papersizename', 'orientation'):
+ m = re.search (r'\\def\\lilypondpaper%s{([^}]*)}'%x, s)
if m:
- for var in varTable:
- if m.group(1) == var[0]:
- var[1](m.group(2),'rcfile')
- break
- fd.close
-
- #
- # setPaperZize
- #
- def setPaperZize(this,size,requester):
- """
- Set paper size properties
- """
-
- paperTable = [
- # regex width height name
- # ----- ----- ------ ----
- ( 'a0.*', 2389, 3381, 'a0paper' ),
- ( 'a1$|a1p.*', 1690, 2389, 'a1paper' ),
- ( 'a2.*', 1194, 1690, 'a2paper' ),
- ( 'a3.*', 845, 1194, 'a3paper' ),
- ( 'a4.*', 597, 845, 'a4paper' ),
- ( 'a5.*', 423, 597, 'a5paper' ),
- ( 'a6.*', 298, 423, 'a6paper' ),
- ( 'a7.*', 211, 298, 'a7paper' ),
- ( 'a8.*', 305, 211, 'a8paper' ),
- ( 'a9.*', 105, 305, 'a9paper' ),
- ( 'a10.*', 74, 105, 'a10paper' ),
- ( 'b0.*', 2847, 4023, 'b0paper' ),
- ( 'b1.*', 2012, 2847, 'b1paper' ),
- ( 'b2.*', 1423, 2012, 'b2paper' ),
- ( 'b3.*', 1006, 1423, 'b3paper' ),
- ( 'b4.*', 712, 1006, 'b4paper' ),
- ( 'b5.*', 503, 712, 'b5paper' ),
- ( 'archA$', 650, 867, 'archApaper' ),
- ( 'archB$', 867, 1301, 'archBpaper' ),
- ( 'archC$', 1301, 1734, 'archCpaper' ),
- ( 'archD$', 1734, 2602, 'archDpaper' ),
- ( 'archE$', 2602, 3469, 'archEpaper' ),
- ( 'flsa$|flse$', 614, 940, 'flsapaper' ),
- ( 'halfletter$', 397, 614, 'halfletterpaper' ),
- ( 'ledger$', 1229, 795, 'ledgerpaper' ),
- ( 'legal$', 614, 1012, 'legalpaper' ),
- ( 'letter$', 614, 795, 'letterpaper' ),
- ( 'note$', 542, 723, 'notepaper' )
- ]
-
- found=0
- for paper in paperTable:
- if re.match(paper[0],size):
- found=1
- this.__set('papersize',paper[3],requester)
- break
-
- if not found:
- sys.exit('ExitBadPaper',size)
-
- #
- # setTextHeight
- #
- def setTextHeight(this,size,requester):
- """
- Set textheight property
- """
-
- m=re.match('([0-9][.0-9]*)(cm|mm|pt|$)',size)
- if m:
- if m.group(2) == 'cm':
- this.__set('textheight',\
- float(m.group(1)) * 72.27/2.54, requester )
- elif m.group(2) == 'mm':
- this.__set('textheight',\
- float(m.group(1)) * 72.27/25.4, requester )
- elif m.group(2) == 'pt':
- this.__set('textheight', float(m.group(1)), requester )
- elif m.group(2) == '':
- this.__set('textheight', float(m.group(1)), requester )
- else:
- sys.exit('ExitBadHeight', m.group(2))
- else:
- sys.exit('ExitBadHeight', size)
-
- #
- # setLineWidth
- #
- def setLineWidth(this,size,requester):
- """
- Set linewidth propery
- """
-
- m=re.match('([0-9][.0-9]*)(cm|mm|pt|$)',size)
- if m:
- if m.group(2) == 'cm':
- this.__set('linewidth', \
- float(m.group(1)) * 72.27/2.54, requester )
- elif m.group(2) == 'mm':
- this.__set('linewidth', \
- float(m.group(1)) * 72.27/25.4, requester )
- elif m.group(2) == 'pt':
- this.__set('linewidth', float(m.group(1)), requester )
- elif m.group(2) == '':
- this.__set('linewidth', float(m.group(1)), requester )
- else:
- sys.exit('ExitBadWidth', m.group(2))
- else:
- sys.stderr.write ('ly2dvi: warning: ignoring linewidth: ' + size + '\n')
-
- #
- # setOrientation
- #
- def setOrientation(this,orient,requester):
- """
- Set orientation property
- """
-
- if orient == 'landscape' or orient == 'portrait':
- this.__set('orientation', orient, requester )
+ set_setting (extra, x, m.group (1))
+
+def find_tex_files_for_base (base, extra):
+ headerfiles = {}
+ for f in layout_fields:
+ if os.path.exists (base + '.' + f):
+ headerfiles[f] = base+'.'+f
+
+ if os.path.exists (base +'.dep'):
+ dependency_files.append (base + '.dep')
+
+ for f in extra_fields:
+ if os.path.exists (base + '.' + f):
+ extra[f].append (open (base + '.' + f).read ())
+
+ return (base +'.tex',headerfiles)
+
+
+def find_tex_files (files, extra):
+ tfiles = []
+ for f in files:
+ x = 0
+ while 1:
+ fname = os.path.basename (f)
+ fname = os.path.splitext (fname)[0]
+ if x:
+ fname = fname + '-%d' % x
+
+ if os.path.exists (fname + '.tex'):
+ tfiles.append (find_tex_files_for_base (fname, extra))
+ analyse_lilypond_output (fname, extra)
+ else:
+ break
+
+ x = x +1
+ return tfiles
+
+def one_latex_definition (defn, first):
+ s = ''
+ for (k,v) in defn[1].items ():
+ s = r"""\def\the%s{%s}""" % (k,open (v).read ())
+
+ if first:
+ s = s + '\\makelilytitle\n'
else:
- sys.exit('ExitBadOrient', orient)
-
- #
- # setLanguage
- #
- def setLanguage(this,lang,requester):
- """
- Set language property
- """
-
- this.__set('language', '\\usepackage[%s]{babel}' % (lang), requester )
-
- #
- # setInclude
- #
- def setInclude(this,inc, requester):
- """
- Append an include path
- """
-
- tmp = this.get('include')
- tmp.append(inc)
- this.__set('include', tmp, requester )
-
- #
- # setDebug
- #
- def setDebug(this,value,requester):
- """
- Set or Clear debug flag
- """
-
- if int(value) == 1:
- this.__set('debug',1,requester)
- else:
- this.__set('debug',0,requester)
-
- #
- # setKeeplilypond
- #
- def setKeeplilypond(this, value, requester):
- """
- Set or Clear keeplilypond flag
- """
-
- if int(value) == 1:
- this.__set('keeplilypond',1,requester)
- else:
- this.__set('keeplilypond',0,requester)
-
- #
- # setKeeply2dvi
- #
- def setKeeply2dvi(this, value, requester):
- """
- Set or Clear keeply2dvi flag
- """
-
- if int(value) == 1:
- this.__set('keeply2dvi',1,requester)
- else:
- this.__set('keeply2dvi',0,requester)
-
- #
- # setNonumber
- #
- def setNonumber(this, value, requester):
- """
- Set nonumber flag
- """
-
- if int(value) == 1:
- this.__set('pagenumber','\\pagestyle{empty}',requester)
- else:
- this.__set('pagenumber','%',requester)
-
- #
- # setSeparate
- #
- def setSeparate(this, value, requester):
- """
- Set or Clear separate flag
- """
-
- if int(value) == 1:
- this.__set('separate',1,requester)
- else:
- this.__set('separate',0,requester)
-
- #
- # Set output directory name
- #
- def setOutput(this,out,requester):
- this.__set('output',out,requester)
-
- #
- # Set latex header name
- #
- def setHeader(this,head, requester):
- this.__set('header','\\input{' + head + '}'+this.get('header'),requester)
-
- #
- # Set latex package name
- #
- def setPackages(this,pkgs, requester):
- this.__set('header','\\usepackage{' + pkgs + '}'+this.get('header'),requester)
-
- #
- # Set or Clear Dependencies flag to generate makefile dependencies
- #
- def setDependencies(this, value, requester):
- """
- Set or Clear dependencies flag
- """
-
- if int(value) == 1:
- this.__set('dependencies',1,requester)
- else:
- this.__set('dependencies',0,requester)
-
- #
- # Set tmp directory
- #
- def setTmp(this,dir, requester):
- this.__set('tmp',dir,requester)
-
- #
- # Set lilypond source file name
- #
- def setFilename(this,file, requester):
- this.__set('filename',file,requester)
-
- #
- # Set title commands
- #
- def setTitles(this,titles, requester):
- this.__set('titles',titles,requester)
-
- #
- # Set title commands
- #
- def addLilyOutputFiles(this,filelist,requester):
- """
- Add a to the lily output list
- """
-
- tmp = this.get('lilyOutputFiles')
- tmp = tmp + filelist
- this.__set('lilyOutputFiles',tmp,requester)
-
- #
- # Set/Clear postscript flag
- #
- def setPostscript(this,value,requester):
- """
- Set postscript flag
- """
-
- if int(value) == 1:
- this.__set('postscript',1,requester)
- else:
- this.__set('postscript',0,requester)
-
- #
- # Set root
- #
- def setRoot(this,path, requester):
- """
- Set LilyPond root directory
- """
-
- os.environ['LILYPONDPREFIX'] = path
- if os.name == 'nt' or os.name == 'dos':
- path = unc2dos(path);
-
- this.__set('root',path,requester)
-
-
- #
- # printProps
- #
- def printProps(this):
- """
- Print properties
- """
-
- for key in this.__data.keys():
- print "%s <%s>:<%s>" % (key,this.get(key),
- this.__roverrideTable[this.__data[key][1]])
-
-\f
-
-#
-# Misc functions
-#
-
-def getLilyopts():
- inc = ''
- if len(Props.get('include')) > 0:
- inc = string.join (map (lambda x: '-I "%s"' % x, Props.get('include')))
- dep=''
- if Props.get('dependencies'):
- dep=' --dependencies'
- return inc + dep
-
-def writeLilylog(file,contents):
- if Props.get('keeplilypond'):
- base, ext = os.path.splitext(file)
- tempfile.template=base + "_li"
- file=tempfile.mktemp('.log')
- output = Props.get('output')
- if output != '':
- file = os.path.join( output, file )
- try:
- fd = open( file, 'w' )
- except:
- sys.exit('ExitNoWrite', file)
- fd.write(contents)
- fd.close()
-
-def getTeXFile(contents):
- texfiles=[]
- for line in string.split(contents,'\n'):
- m = re.search('paper output to (.+)\.\.\.', line)
- if m:
- texfiles.append(m.group(1))
-
- if texfiles == []:
- sys.exit('ExitNoTeXName')
- else:
- return texfiles
-
-def getDepFiles (log):
- files=[]
- for line in string.split (log,'\n'):
- m = re.search ("dependencies output to (.+)\.\.\.", line)
- if m:
- files.append (m.group (1))
- return files
-
-def unc2dos(path):
- """
- Convert a path of format //<drive>/this/that/the/other to
- <drive>:\this\that\the\other
- """
- m=re.match('^//([A-Za-z])(/.*)$',path)
- if m:
- return m.group(1) + ':' + os.path.normpath(m.group(2))
-
-
-
-def program_id ():
- return 'ly2dvi (GNU LilyPond) ' + version;
-
-
-def mailaddress():
- try:
- return os.environ['MAILADDRESS']
- except KeyError:
- return '(address unknown)'
-
-
-def identify ():
- sys.stderr.write (program_id () + '\n')
+ s = s + '\\makelilypiecetitle\n'
+
+ s = s + '\\input %s' % defn[0]
+ return s
-def print_version ():
- sys.stdout.write (program_id () + '\n')
-def help ():
- sys.stdout.write (
-"""Usage: %s [OPTION]... [FILE]...
+ly_paper_to_latexpaper = {
+ 'a4' : 'a4paper',
+
+}
-Generate dvi file from LilyPond source/output
+def global_latex_definition (tfiles, extra):
+ """construct preamble from EXTRA,
+ dump lily output files after that, and return result.
+ """
-Options:
- -D,--debug increase verbosity
- -F,--headers= name of additional LaTeX headers file
- -H,--Height= set paper height (points) (see manual page)
- -I,--include=DIR add DIR to LilyPond\'s search path
- -K,--keeplilypond keep LilyPond output files
- -L,--landscape set landscape orientation
- -N,--nonumber switch off page numbering
- -O,--orientation= set orientation (obsolete -- use -L instead)
- -P,--postscript generate PostScript file
- -W,--Width= set paper width (points) (see manual page)
- -M,--dependencies tell LilyPond to make a dependencies file
- -h,--help this help text
- -k,--keeply2dvi keep ly2dvi output files
- -l,--language= give LaTeX language (babel)
- -o,--outdir= set output directory
- --output= set output directory
- -p,--papersize= give LaTeX papersize (eg. a4)
- -s,--separate run all files separately through LaTeX
-
-files may be (a mix of) input to or output from LilyPond(1)
-""" % name)
-
-\f
-
-#
-# main
-#
-
-def main():
- """Generate dvi files from LilyPond source/output"""
-
- infile = Input()
- outfile = TeXOutput()
- texInputFiles=[]
- tempfile.tempdir=""
-
- (options, files) = getopt.getopt (sys.argv[1:],
- 'DF:H:I:KLNPW:Mhkl:o:p:s',
- ['debug', 'headers=', 'Height=',
- 'include=', 'keeplilypond', 'landscape',
- 'nonumber', 'Width=', 'dependencies',
- 'help', 'keeply2dvi', 'language=',
- 'outdir=', 'output=', 'version',
- 'papersize=', 'separate', 'postscript'])
-
- for opt in options:
- o = opt[0]
- a = opt[1]
- if o == '--debug' or o == '-D':
- Props.setDebug(1,'commandline')
- elif o == '--headers' or o == '-F':
- Props.setHeader(a,'commandline')
- elif o == '--include' or o == '-I':
- Props.setInclude(a,'commandline')
- elif o == '--Height' or o == '-H':
- Props.setTextHeight(a,'commandline')
- elif o == '--keeplilypond' or o == '-K':
- Props.setKeeplilypond(1,'commandline')
- elif o == '--landscape' or o == '-L':
- Props.setOrientation('landscape','commandline')
- elif o == '--nonumber' or o == '-N':
- Props.setNonumber(1,'commandline')
- elif o == '--Width' or o == '-W':
- Props.setLineWidth(a,'commandline')
- elif o == '--dependencies' or o == '-M':
- Props.setDependencies(1,'commandline')
- elif o == '--help' or o == '-h':
- help()
- sys.exit (0)
- elif o == '--keeply2dvi' or o == '-k':
- Props.setKeeply2dvi(1,'commandline')
- elif o == '--language' or o == '-l':
- Props.setLanguage(a,'commandline')
- elif o == '--outdir' or o == '-o' or o == '--output':
- Props.setOutput(a,'commandline')
- elif o == '--papersize' or o == '-p':
- Props.setPaperZize(a,'commandline')
- elif o == '--separate' or o == '-s':
- Props.setSeparate(1,'commandline')
- elif o == '--postscript' or o == '-P':
- Props.setPostscript(1,'commandline')
- elif o == '--version':
- print_version ()
- return 0
+
+ s = ""
+ s = s + '% generation tag\n'
+
+ paper = ''
+
+ if extra['papersizename']:
+ paper = '[%s]' % ly_paper_to_latexpaper[extra['papersizename'][0]]
+ s = s + '\\documentclass%s{article}\n' % paper
+
+ if extra['language']:
+ s = s + r'\usepackage[%s]{babel}\n' % extra['language'][-1]
+
+
+ s = s + '\\usepackage{%s}\n' \
+ % string.join (extra['latexpackages'], ',')
+
+ s = s + string.join (extra['latexheaders'], ' ')
+
+ textheight = ''
+ if extra['textheight']:
+ textheight = ',textheight=%fpt' % extra['textheight'][0]
+
+ orientation = 'portrait'
+ if extra['orientation']:
+ orientation = extra['orientation'][0]
+
+ s = s + '\geometry{width=%spt%s,headheight=2mm,headsep=0pt,footskip=2mm,%s}\n' % (extra['linewidth'][0], textheight, orientation)
+
+ s= s + r"""
+\usepackage[latin1]{inputenc}
+\input{titledefs}
+\makeatletter
+\renewcommand{\@oddfoot}{\parbox{\textwidth}{\mbox{}\thefooter}}%%
+"""
+ if extra['pagenumber'] and extra['pagenumber'][-1]:
+ s = s + r"""
+ \renewcommand{\@oddhead}{\parbox{\textwidth}%%
+ {\mbox{}\small\theheader\hfill\textbf{\thepage}}}%%"""
else:
- print o
- raise getopt.error
-
- identify()
- Props.read_titledefs ()
-
- if len(files):
- for file in files:
- infile.open(file)
- type = infile.type()
- infile.close()
- if type == 'source':
- if os.environ.has_key('OS') and \
- os.environ['OS'] == 'Windows_95':
- cmd = 'ash -c "lilypond %s %s 2>&1"' %(getLilyopts(), file)
- else:
- cmd = 'lilypond %s %s 2>&1' % (getLilyopts(), file)
- sys.stderr.write ('executing: %s\n'% cmd)
+ s = s + '\\pagestyle{empty}'
- fd = os.popen(cmd , 'r')
- log = ''
+ s = s + '\\begin{document}'
+
+ first = 1
+ for t in tfiles:
+ s = s + one_latex_definition (t, first)
+ first = 0
- s = fd.readline()
- while len(s) > 0:
- sys.stderr.write (s)
- sys.stderr.flush ()
- log = log + s
- s = fd.readline ()
- if 0:
- s = fd.read (1)
- while len(s) > 0:
- sys.stderr.write (s)
- sys.stderr.flush ()
- s = fd.read (1)
- log = log + s
- stat = fd.close()
- if stat:
- sys.exit('ExitBadLily', cmd )
- texFiles=getTeXFile(log)
- depFiles=getDepFiles (log)
- writeLilylog(file,log)
- Props.addLilyOutputFiles(texFiles,'program')
- texInputFiles = texInputFiles + texFiles
- else:
- texInputFiles.append(file)
-
- firstfile=1
- for file in texInputFiles:
- infile.open(file)
- infile.setVars() # first pass set variables
- infile.close()
- if Props.get('debug'):
- Props.printProps()
- if firstfile:
- outfile.start(file) # allow for specified name
- else:
- outfile.next()
- outfile.write("""\
-\\input{%s}
-""" % (file))
- if Props.get('separate'):
- outfile.end()
- else:
- firstfile=0
- if not Props.get('separate'):
- outfile.end()
-
- # --outdir mess
- if Props.get ('output'):
- outdir=Props.get ('output')
- for i in depFiles:
- text=open (i).read ()
- # ugh, should use lilypond -o DIR/foo.tex
- # or --dep-prefix to fix dependencies
- text=re.sub ('\n([^:]*).tex', '\n' + outdir + '/\\1.dvi', text)
- text=re.sub (' ([^:]*).tex', ' ' + outdir + '/\\1.dvi', text)
- open (os.path.join (outdir, i), 'w').write (text)
- os.remove (i)
-
- else:
- help()
- sys.exit('ExitBadArgs','No files specified')
-
-#
-# Exit values
-#
-ExitTable = {
- 'ExitInterupt' : ['Ouch!', 1 ],
- 'ExitBadArgs' : ['Wrong number of arguments', 2 ],
- 'ExitNotFound' : ['File not found', 3 ],
- 'ExitBadPaper' : ['Unknown papersize', 4 ],
- 'ExitBadHeight' : ['Invalid Height specification', 5 ],
- 'ExitBadWidth' : ['Invalid Width specification', 6 ],
- 'ExitBadOrient' : ['Invalid Orientation specification', 7 ],
- 'ExitNoWrite' : ['Permission denied', 8 ],
- 'ExitNoTeXName' : ['Hmm, I could not find an output file name', 9 ],
- 'ExitBadLily' : ['LilyPond failed', 10 ],
- 'ExitBadLatex' : ['Latex failed', 11 ],
- 'ExitBadPostscript' : ['Postscript failed', 12 ],
- 'ExitUnknown' : ['Unknown Exit Code', 20 ],
- }
-
-def cleanup():
- lilyfiles = []
- tmpfiles = []
- if not Props.get('keeplilypond'):
- lilyfiles = Props.get('lilyOutputFiles')
- if not Props.get('keeply2dvi'):
- tmpfiles = glob.glob('*_ly[0-9]*.*')
- for file in lilyfiles + tmpfiles:
- if os.path.isfile(file):
- os.remove(file)
-
-
-Props = Properties()
-
-try:
- main()
-
-except KeyboardInterrupt:
- print ExitTable['ExitInterupt'][0]
- cleanup()
- sys.exit(ExitTable['ExitInterupt'][1])
-
-except SystemExit, errno:
- if ExitTable.has_key(errno.args[0]):
- msg = ExitTable[errno.args[0]]
- else:
- msg = ExitTable['ExitUnknown']
- if len(errno.args) > 1:
- sys.stderr.write( '%s: %s: %s\n' % (name, msg[0], errno.args[1]))
- else:
- sys.stderr.write( '%s %s\n' % (name, msg[0]))
- if Props.get('debug'):
- Props.printProps()
- cleanup()
- sys.exit(msg[1])
-else:
- cleanup()
+ s = s + '\\end{document}'
+
+ return s
+
+def do_files (fs, extra):
+
+ """process the list of filenames in FS, using standard settings in EXTRA.
+ """
+ if not no_lily:
+ run_lilypond (fs)
+
+ wfs = find_tex_files (fs, extra)
+ s = global_latex_definition (wfs, extra)
+
+ latex_file ='ly2dvi.out'
+ f = open (latex_file + '.tex', 'w')
+ f.write (s)
+ f.close ()
+
+ # todo: nonstopmode
+ system ('latex %s' % latex_file)
+ return latex_file + '.dvi'
+
+def generate_postscript (dvi_name, extra):
+ """Run dvips on DVI_NAME, optionally doing -t landscape"""
+
+ opts = ''
+ if extra['papersizename']:
+ opts = opts + ' -t %s' % extra['papersizename'][0]
+
+ if extra['orientation'] and extra['orientation'][0] == 'landscape':
+ opts = opts + ' -t landscape'
+
+ ps_name = re.sub (r'\.dvi', r'.ps', dvi_name)
+ system ('dvips %s -o %s %s' % (opts, ps_name, dvi_name))
+
+ return ps_name
+
+
+
+def generate_dependency_file (depfile, outname):
+ df = open (depfile, 'w')
+ df.write (outname + ':' )
+
+ for d in dependency_files:
+ s = open (d).read ()
+ s = re.sub ('#[^\n]*\n', '', s)
+ s = re.sub (r'\\\n', ' ', s)
+ m = re.search ('.*:(.*)\n', s)
+
+ # ugh. Different targets?
+ if m:
+ df.write ( m.group (1) + ' ' )
+
+ df.write ('\n')
+ df.close ();
+
+(sh, long) = getopt_args (__main__.option_definitions)
+(options, files) = getopt.getopt(sys.argv[1:], sh, long)
+for opt in options:
+ o = opt[0]
+ a = opt[1]
+
+ if 0:
+ pass
+ elif o == '--help' or o == '-h':
+ help ()
+ elif o == '--include' or o == '-I':
+ include_path.append (a)
+ elif o == '--postscript' or o == '-P':
+ postscript_p = 1
+ elif o == '--keep' or o == '-k':
+ keep_temp_dir = 1
+ elif o == '--no-lily':
+ no_lily = 1
+ elif o == '--outdir':
+ outdir = a
+ elif o == '--set' or o == '-s':
+ ss = string.split (a, '=')
+ set_setting (extra_init, ss[0], ss[1])
+ elif o == '--dependencies' or o == '-d':
+ track_dependencies_p = 1
+ elif o == '--version' or o == '-v':
+ identify ()
+
+
+include_path = map (os.path.abspath, include_path)
+files = map (os.path.abspath, files)
+outdir = os.path.abspath (outdir)
+
+def strip_ly_suffix (f):
+ (p, e) =os.path.splitext (f)
+ if e == '.ly':
+ e = ''
+ return p +e
+
+files = map (strip_ly_suffix, files)
+
+if files:
+ setup_temp ()
+ extra = extra_init
+
+ dvi_name = do_files (files, extra)
+
+ if postscript_p:
+ ps_name = generate_postscript (dvi_name, extra)
+
+
+
+ base = os.path.basename (files[0])
+ dest = base
+ type = 'foobar'
+ srcname = 'foobar'
+
+ if postscript_p:
+ srcname = ps_name
+ dest = dest + '.ps'
+ type = 'PS'
+ else:
+ srcname = dvi_name
+ dest= dest + '.dvi'
+ type = 'DVI'
+
+ dest = os.path.join (outdir, dest)
+ system ('cp \"%s\" \"%s\"' % (srcname, dest ))
+ system ('cp *.midi %s' % outdir, ignore_error = 1)
+
+ progress ("%s file left in `%s'\n" % (type, dest))
+
+ depfile = os.path.join (outdir, base + '.dep')
+
+ if track_dependencies_p:
+ generate_dependency_file (depfile, dest)
+ progress ("Dependency file left in `%s'\n" % depfile)
+
+ cleanup_temp ()
+
+
presome=${ac_default_prefix}
fi
DIR_DATADIR=`echo ${DIR_DATADIR} | sed "s!\\\${prefix}!$presome!"`
+
AC_SUBST(datadir)
AC_SUBST(DIR_DATADIR)
+
+ dnl yeah, so fuck me gently with a cactus: this doesnt belong here
+ dnl Please take the person responsible for inventing shell-scripts out
+ dnl and shoot him. On behalf of the sane world, thank you.
+ dnl DIR_SHAREDSTATEDIR="foobar"
+ dnl AC_SUBST(DIR_SHAREDSTATEDIR)
+
AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
])
+# WHAT THE FUCK IS THIS DOING IN STEPMAKE???
+
$(outdir)/%.afm: %.af
grep '[[:cntrl:]]' $< | sed 's/^[[:cntrl:]] *//' > $@
# grep '[[:cntrl:]]' $< | sed 's/^. *//' > $@
sed-atvariables = -e '\#' $(foreach i, $(ATVARIABLES), -e 's!@$i@!$($i)!g')
# these are obsolete
+
+# then remove them --hwn
+
# use ATVARIABLES
sed-date=sed 's!@DATE@!${date}!g'
sed-PACKAGE = sed 's!@PACKAGE@!${PACKAGE}!g'