+1.3.148.jcn3
+============
+
+* Added titling and page wrapping to direct PostScript output.
+Determining the line height still doesn't work, but you can set
+lineheight in paper block.
+
+* Bugfix: lilypond -o - foo.ly.
+
+* Took a stab at jazz-style chord name additions.
+
+* Compile fixes: gcc-3.0 snapshots hit Debian unstable. Note that
+flex-2.5.4a-11 still breaks with g++-3.0pre.
+
+* Chord-name cleanups.
+
+* Markup text:
+- added (extent . (min . max))
+- overstrike, as alias for (extent . (0 . 0))
+- added overstrike property to super and sub
+- allow text to be in too deep list, ie: #'((("text"))) still works
+- allow HEAD to be in too deep list, ie: #'(((bold)) "foo")
+- fixes to raise
+- renamed (rows to (columns (Thanks Mats; I must have been asleep
+when I wrote that code)
+- renamed align to axis
+
+* Fixes for german-chords.ly (Rune).
+
+* update-lily: use ftplib, notify upon failure, not success.
+
+* Oops, I did it again (Han-Wen).
+
+1.3.148.hwn2
+============
+
+* Documentation updates.
+
+* Bugfix: header/footer for ly2dvi.
+
+* Fixed: ly2dvi file1.ly file2.ly
+
+* lilypond-bug bugfix: remove .png file if output fails.
+
+1.3.148
+=======
+
1.3.147.jcn2
============
* GUILE errors, simple guile test
-* TEX errors, simple tex test
+* (La)TEX errors, simple tex test
+
+]
+@ignore
+
+ guile -v
+ Guile 1.4.1
+
+ guile -e %load-path
+ ERROR: Wrong type to apply: ("/usr/share/guile/site" /usr/share/guile/1.4.1")
+
+
+
+Mats?
+
+Let's take this step by step.
+
+It should not be critical which MikTeX version you use.
+Let's first verify that your MikTeX works as it should.
+Open a DOS window. Run the commands
+>> latex sample2e
+ Should produce some lines of output
+>> yap sample2e
+ Should display a three page document.
+
+Next step; verify that the geometry package is in place.
+Save the attached file to the directory where you run
+your DOS window. Run the commands
+>> latex geometrytest
+>> yap geometrytest
+This one you should get a single page document with some text
+in each corner.
]
+@end ignore
Lilypond input file. It uses @code{\version} statements in the file to
detect the old version number.
-@subsection Invoking convert-ly
+@unnumberedsubsec Invoking convert-ly
@example
convert-ly [OPTION]... [FILE]...
If version number cannot be determined, apply all conversions.
@item -e,--edit
Do an inline edit of the input file. override @code{--output}
-@item -f,--from=@var{FROM_PATCHLEVEL}
+@item -f,--from=@var{from-patchlevel}
Set the level to convert from. If this is not set, convert-ly will
guess this, on the basis of @code{\version} strings in the file
-@item -o,--output
- The output file to write.
+@item -o,--output=@var{file}
+ Set the output file to write.
@item -n,--no-version
Normally, convert-ly adds a @code{\version} indicator
to the output. Specifying this option suppresses this.
@item --show-rules
- shows all known conversions, and exit
-@item --to=@var{TO_PATCHLEVEL}
+ Show all known conversions and exit
+@item --to=@var{to-patchlevel}
Set the goal version of the conversion. It defaults to the latest
available version.
@end table
+@unnumberedsubsec Example
+
+Upgrade all lilypond files to 1.3.150:
+@example
+ convert-ly -e --to=1.3.150 `find -name '*.ly'`
+@end example
+
+@unnumberedsubsec Bugs
+
Not all language changes are handled. Multiple output options won't
work.
+@unnumberedsubsec Authors
+
@code{convert-ly} is written in @uref{http://www.python.org,Python}. It
was written by @email{hanwen@@cs.uu.nl, Han-Wen Nienhuys}. Report bugs
to @code{bug-gnu-music@@gnu.org}
-
format.
It is possible to record a MIDI file using a digital keyboard, and then
-convert it to @file{.ly}. However, human players can not rhythmically
-exact enough to make a MIDI to .ly conversion trivial. midi2ly tries to
+convert it to @file{.ly}. However, human players are not rhythmically
+exact enough to make a MIDI to LY conversion trivial. midi2ly tries to
compensate for these timing errors, but is not very good at this. It is
therefore not recommended to use midi2ly for human-generated midi
files. Correcting the quantization mistakes of the human player takes a
@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
-\property Lyrics.LyricText \set #'font-style = #'large
\addlyrics
-\notes\relative c'' {
+\context Staff \notes\relative c'' {
c4( d )e \bar "||"
c4-- d-- e-- \bar "||"
c4-.( d-. )e-. \bar "||"
c4-. d-. e-. \bar "||"
}
-\context Lyrics \lyrics { a "" "" b "" "" c "" "" d }
+\context Lyrics \lyrics {
+ \property Lyrics . LyricText \set #'font-style = #'large
+ a "" "" b "" "" c "" "" d }
@end lilypond
@item legato curve
@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
-\property Lyrics.LyricText \set #'font-style = #'large
+\property Score.LyricText \set #'font-style = #'large
%\property Lyrics.minVerticalAlign = #8
\addlyrics
-\notes\relative c' {
+\context Staff \notes\relative c' {
c1 d e f g a b c }
\context Lyrics \lyrics {
< { I II III IV V VI VII I }
@node Internals
@chapter Internals
-@menu
-* Conversion stages:: Lilypond is a multi-pass program.
-* Moment::
-* Grobs:: Graphical object
-* Duration::
-* Pitch data type::
-* Engraver::
-* Music_iterator::
-* Music::
-* Molecules:: Molecules are stand-alone descriptions of output
-* Font metrics:: Font metrics
-* Miscellaneous Scheme functions::
-@end menu
-
-@node Conversion stages
-@section Conversion stages
When translating the input to notation, there are number of distinct
phases. We list them here:
-@table @code
+@table @b
@item Parsing:
-The .ly file is read, and converted to a list of @code{Scores}, which
-each contain @code{Music} and paper/midi-definitions.
+The LY file is read, and converted to a list of @code{Scores}, which
+each contain @code{Music} and paper/midi-definitions. Here @code{Music},
+@code{Pitch} and @code{Duration} objects are created.
@item Interpreting music
@cindex interpreting music
events are delivered to
interpretation contexts,
@cindex engraver
-which use them to build grobs (or MIDI objects, for MIDI output).
+which use them to build @code{Grob}s (or MIDI objects, for MIDI output).
+
+In this stage @code{Music_iterators} do a traversal of the @code{Music}
+structure. The music events thus encountered are reported to
+@code{Translator}s, a set objects that collectively form interpretation
+contexts.
+
@item Prebreaking
@item Outputting:
All vertical dimensions and spanning objects are computed, and all grobs
-are output, line by line.
+are output, line by line. The output is encoded in the form of
+@code{Molecule}s
@end table
+The data types that are mentioned here are all discussed in this
+section.
+
+@menu
+* Input location::
+* Moment::
+* Duration::
+* Pitch data type::
+* Music::
+* Music_iterator::
+* Translator::
+* Grobs:: Graphical object
+* Molecules:: Molecules are stand-alone descriptions of output
+* Font metrics:: Font metrics
+* Miscellaneous Scheme functions::
+@end menu
+
+@node Input location
+@section input location
+
+The parser generates
+
+Input location objects point to a lcoation in the input file. This
+location is used to generate error messages and to enable the point and
+click output.
+
+@defun ly-input-location?
+Type predicate
+@end defun
+
+
+
+
@node Moment
@section Moment
create the rational number @var{num}/@var{den}.
@end defun
+@node Duration
+@section Duration
+
+A duration is a musical duration, i.e. a length of time described by a
+power of two (whole, half, quarter, etc.) and a number of augmentation
+dots.
+
+@defun make-duration length dotcount
+
+@var{length} is the negative logarithm (base 2) of the duration:
+1 is a half note, 2 is a quarter note, 3 is an eighth
+note, etc. The number of dots after the note is given by
+@var{dotcount}.
+@end defun
+
+
+@defun duration? d
+type predicate for Duration
+@end defun
+
+@node Pitch data type
+@section Pitch data type
+
+
+
+@defun make-pitch octave note shift
+
+@var{octave} is specified by an integer, zero for the octave containing
+middle C. @var{note} is a number from 0 to 6, with 0 corresponding to C
+and 6 corresponding to B. The shift is zero for a natural, negative for
+flats, or positive for sharps.
+@end defun
+
+@defun pitch-octave p
+extract the octave from pitch @var{p}.
+@end defun
+
+@defun pitch-notename p
+extract the note name from pitch @var{p}.
+@end defun
+
+@defun pitch-alteration p
+extract the alteration from pitch @var{p}.
+@end defun
+
+@defun pitch-semitones p
+calculate the number of semitones of @var{p} from central C.
+@end defun
+
+@defun Pitch::transpose t p
+Transpose @var{p} by the amount @var{t}, where @var{t} is the pitch that
+central C is transposed to.
+@end defun
+
+
+@node Music
+@section Music
+
+Music is the data type that music expressions are stored in. The data
+type does not yet offer many manipulations.
+
+@defun ly-get-mus-property m sym
+Get the property @var{sym} of music expression @var{m}.
+@end defun
+
+@defun ly-set-mus-property m sym val
+Set property @var{sym} in music expression @var{m} to @var{val}.
+@end defun
+
+@defun ly-make-music name
+Make a music object/expression of type @var{name}. Warning: this
+interface will likely change in the near future.
+@end defun
+
+@defun music? obj
+A type predicate, return true if @var{obj} is a music object.
+@end defun
+
+@defun ly-music-name music
+Print the name of @var{music}.
+@end defun
+
+
+@node Music_iterator
+@section Music_iterator
+
+Music_iterator is an object type that traverses the Music structure and
+reports the events it finds to interpretation contexts. It is not yet
+user-serviceable.
+
+@defun c++-function?
+type predicate for c++-function. Music_iterator are created from
+schemified C++ constructors. Such a constructor is a @code{c++-function}.
+@end defun
+
+@node Translator
+@section Translator
+
+Translators are the building blocks of contexts. They are not yet user
+accessible.
+
+@defun ly-get-trans-property tr sym
+retrieve the value of @var{sym} from context @var{tr}
+@end defun
+
+@defun ly-set-trans-property tr sym val
+set value of property @var{sym} in context @var{tr} to @var{val}.
+@end defun
+
+
@node Grobs
@section Grobs
@end example
This piece of lily input causes all stem objects to be stem-up
-henceforth. In effect, you are telling lilypond to extend the defintion
-of the "Stem" grob with the setting @code{direction := 1}. Of course
-there are many more ways of customizing Lily output, and since most of
-them involve Grobs in some form, this section explains some details of
-how grobs work.
+henceforth. In effect, you are telling lilypond to extend the definition
+of the `Stem' grob with the setting @code{direction := 1}.
@menu
* What is a grob?::
In music notation, lots of symbols are related in some way. You can
think of music notation as a graph where nodes are formed by the
-symbols, and the arcs by their relations. A grob is node in that
-graph. A grob stores references to other grobs, the directed edges in
-the graph.
+symbols, and the arcs by their relations. A grob is node in that graph.
+The directed edges in the graph are formed by references to other grobs
+(i.e. pointers).
-The objective of this big graph of grobs, is to specify the notation
-problem. The solution of this problem is a description of the printout
-that is in closed form, i.e. but a list of values. These values are
-Molecules. (see @ref{Molecules})
+This big graph of grobs specifies the notation problem. The solution of
+this problem is a description of the printout in closed form, i.e. a
+list of values. These values are Molecules. (see @ref{Molecules})
All grobs have an X and Y-position on the page. These X and Y positions
are stored in a relative format, so they can easily be combined by
stacking them, hanging one grob to the side of another, and coupling
them into a grouping-grob.
-Each grob has a reference point, or parent: the position of a grob is
-stored relative to that reference point. For example the X-reference
+Each grob has a reference point (a.k.a. parent): the position of a grob
+is stored relative to that reference point. For example the X-reference
point of a staccato dot usually is the note head that it applies
-to. Whenever the note head is moved, the staccato dot moves along
+to. When the note head is moved, the staccato dot moves along
automatically.
If you keep following offset reference points, you will always end up at
-the root-object. This root object is called @code{Line_of_score}, and it
+the root object. This root object is called @code{Line_of_score}, and it
represents a system (ie. a line of music).
All grobs carry a set of grob-properties. In the Stem example above,
appearance of a grob is determined solely by the values of its
properties.
-Often, a grob also is associated with a symbol. However, some
-grobs do not print any symbols, but take care of grouping objects. For
-example, there is a separate grob that stacks staffs vertically, so they
-are not printed in overstrike. The @code{NoteCollision} is another
-example of an abstract grob. It only moves around chords, but doesn't
-print anything.
-
-A complete list of grob types is found in
-@ref{(lilypond-internals)LilyPond backend}
-
-Grobs are created in the "Interpreting music" phase, by objects in
-LilyPond called engravers. In this phase of the translation, a load of
-grobs are created, and they are linked into a giant network of objects.
-This network of grobs forms the "specification" of the print
-problem. This problem is then solved: configurations, directions,
-dimensions, line breaks, etc. are calculated. Finally, the printing
-description in the form of Molecules (@ref{Molecules}) is extracted from
-the network. These are then dumped into the output file
+A grob is often associated with a symbol, but some grobs do not print
+any symbols. They take care of grouping objects. For example, there is a
+separate grob that stacks staffs vertically. The @code{NoteCollision}
+also is an abstract grob: it only moves around chords, but doesn't print
+anything.
+
+A complete list of grob types is found in the generated documentation.
+
@node Callbacks
@subsection Callbacks
will find @code{my-callback}, and execute that. The result is that the
stem is translated by two staff spaces in its direction.
-(note: Y-offset-callbacks is also a property)
+(note: @code{Y-offset-callbacks} is also a property)
+
Offset callbacks can be stacked, ie.
@end example
-The callbacks will be executed in the order callback3 callback2
-callback1. This is used for quantized positioning: the staccato dot is
+The callbacks will be executed in the order @code{callback3 callback2
+callback1}. This is used for quantized positioning: the staccato dot is
above or below a note head, and it must not be on a staff-line. To
-achieve this, for the staccato there are two callbacks: one callback
-that positions the grob above or below the note head, and one callback
-that rounds the Y-position of the grob to the nearest open space.
+achieve this, the staccato dot has two callbacks: one that positions the
+grob above or below the note head, and one that rounds the Y-position of
+the grob to the nearest open space.
Similarly, the size of a grob are determined through callbacks, settable
with grob properties @code{X-extent-callback} and
@subsection Setting grob properties
Grob properties are stored as GUILE association lists, with symbols as
-keys. From C++, element properties can be accessed using the functions
+keys. In GUILE you can access these using functions described @ref{Grob
+Scheme functions}. From C++, grob properties can be accessed using
+these functions:
@example
SCM get_grob_property (SCM) const;
SCM remove_grob_property (const char* nm);
@end example
-In GUILE, LilyPond provides
-
-@example
- ly-get-grob-property GROB SYMBOL
- ly-set-grob-property GROB SYMBOL VALUE
-@end example
-
-All lookup functions identify undefined properties with
-end-of-list (ie. @code{'()} in Scheme or @code{SCM_EOL} in C)
+All lookup functions identify undefined properties with end-of-list
+(ie. @code{'()} in Scheme or @code{SCM_EOL} in C)
Properties are stored in two ways:
@itemize @bullet
-@item mutable properties:
-element properties that change from object to object. The storage of
-these are private to a grob. Typically this is used to store lists of
-pointers to other grobs
+@item mutable properties.
+grob properties that change from object to object. The storage of
+these are private to a grob. For example pointers to other grobs are
+always stored in the mutable properties.
-@item immutable properties:
-element properties that are shared across different grobs of the same
+@item immutable properties.
+Grob properties that are shared across different grobs of the same
type. The storage is shared, and hence it is read-only. Typically, this
-is used to store function callbacks, and values for shared element
-properties are read from @file{scm/element-description.scm}.
+is used to store function callbacks, and default settings. They are
+initially read from from @file{scm/grob-description.scm}.
@end itemize
-There are two ways to manually set grob properties.
-
-You can change immutable grob properties. This is done with the
-\override syntax:
+You can change immutable grob properties with the \override syntax:
@example
\property Voice.Stem \override #'direction = #1
This will push the entry @code{'(direction . 1)} on the immutable
property list for stems, in effect overriding the setting from
-@file{scm/element-description.scm}. This can be undone by
+@file{scm/grob-description.scm}. This can be undone by
@example
\property Voice.stem \revert #'direction
this does a @code{\revert} followed by a @code{\override}
-The second way is \outputproperty. This construct looks like
+You can change mutable properties with \outputproperty. This construct
+looks like
@example
\context ContextName \outputproperty @var{pred} #@var{sym} = #@var{val}
@end example
-In this case, in every grob that satisfies @var{pred}, the property
-assignment @var{sym} = @var{val} is done. For example
+In this case, in every grob that satisfies @var{pred}, the grob property
+ @var{sym} is set to @var{val} is done. For example
@example
\outputproperty
#'extra-offset = #'(-1.0 . 0.0)
@end example
-This shifts all elements that have a @code{text} property one staff
+This shifts all grobs that have a @code{text} property one staff
space to the left. This mechanism is rather clumsy to use, but it allows
you tweak any setting of any grob.
example, slur, beam, tie, etc. These grobs form a subtype called
@code{Spanner}. All spanners have two span-points (these must be
@code{Item}s), one on the left and one on the right. The left bound is
-also the X-reference point.
+also the X-reference point of the spanner.
Some items need special treatment for line breaking. For example, a
clef is normally only printed at the start of a line (ie. after a line
printed after the line break.
Whether these versions are visible and take up space, is determined by
-the outcome of the visibility-lambda. This is a function taking a
-direction (-1, 0 or 1) and returns a cons of booleans, signifying wether
-this grob should be transparent and have no extent.
-
+the outcome of the @code{visibility-lambda}. This grob property is a
+function taking a direction (-1, 0 or 1) as argument. It returns a cons
+of booleans, signifying whether this grob should be transparent and have
+no extent.
@node Grob Scheme functions
@unnumberedsubsec Grob Scheme functions
+Grob properties can be manipulated from Scheme. In practice, most
+manipulations are coded in C++ because of tradition.
@defun ly-get-grob-property g sym
Get the value of a value in grob @var{g} of property @var{sym}. It
Typecheck: is @var{g} a grob?
@end defun
-@node Duration
-@section Duration
-
-@defun make-duration length dotcount
-
-@var{length} is the negative logarithm (base 2) of the duration:
-1 is a half note, 2 is a quarter note, 3 is an eighth
-note, etc. The number of dots after the note is given by
-@var{dotcount}.
-@end defun
-
-
-@defun duration? d
-type predicate for Duration
-@end defun
-
-@node Pitch data type
-@section Pitch data type
-
-
-
-@defun make-pitch octave note shift
-
-@var{octave} is specified by an integer, zero for the octave
-containing middle C. @var{note} is a number from 0 to 7, with 0
-corresponding to C and 7 corresponding to B. The shift is zero for a
-natural, negative to add flats, or positive to add sharps.
-@end defun
-
-@defun pitch-octave p
-extract the octave from pitch @var{p}.
-@end defun
-
-@defun pitch-notename
-extract the note name from pitch @var{p}.
-@end defun
-
-@defun pitch-alteration
-extract the alteration from pitch @var{p}.
-@end defun
-
-@defun pitch-semitones
-calculate the number of semitones of @var{p} from central C.
-@end defun
-
-@defun Pitch::transpose t p
-Transpose @var{p} by the amount @var{t}, where @var{t} is the pitch that
-central C is transposed to.
-@end defun
-
-@node Engraver
-@section Engraver
-
-Engravers are building blocks of contexts. They are not yet user accessible.
-
-@defun ly-get-trans-property tr sym
-retrieve the value of @var{sym} from context @var{tr}
-@end defun
-
-@defun ly-set-trans-property tr sym val
-set value of property @var{sym} in context @var{tr} to @var{val}.
-@end defun
-
-@node Music_iterator
-@section Music_iterator
-
-This data-type is a direct hook into some C++ constructor functions. It
-is not yet user-serviceable.
-@defun c++-function?
-type predicate for c++-function.
-@end defun
-
-@node Music
-@section Music
-
-Music is the data type that music expressions are stored in. The data
-type does not yet offer many manipulations.
-@defun ly-get-mus-property m sym
-Get the property @var{sym} of music expression @var{m}.
-@end defun
-
-@defun ly-set-mus-property m sym val
-Set property @var{sym} in music expression @var{m} to @var{val}.
-@end defun
-
-@defun ly-make-music name
-Make a music object/expression of type @var{name}. Warning: this
-interface will likely change in the near future.
-@end defun
@node Molecules
@section Molecules
@cindex Output description
The objective of any typesetting system is to put ink on paper in the
-right places. For LilyPond, this final stage is left to the TeX and the
-printer subsystem. For lily, the last stage in processing a score is
+right places. For LilyPond, this final stage is left to the @TeX{} and
+the printer subsystem. For lily, the last stage in processing a score is
outputting a description of what to put where. This description roughly
looks like
@end example
you merely have to look at the tex output of lily to see this.
-Internally these instructions are encoded in Molecules:@footnote{At some
+Internally these instructions are encoded in Molecules.@footnote{At some
point LilyPond also contained Atom-objects, but they have been replaced
-by Scheme expressions, making the name outdated.}. A molecule is an
-object that combines dimension information (how large is this glyph ?)
-with what-to-print-where.
+by Scheme expressions, making the name outdated.} A molecule is
+what-to-print-where information that also contains dimension information
+(how large is this glyph?).
Conceptually, Molecules can be constructed from Scheme code, by
translating a Molecule and by combining two molecules. In BNF
notation:
@example
- Molecule = COMBINE Molecule Molecule
+Molecule :: COMBINE Molecule Molecule
| TRANSLATE Offset Molecule
| GLYPH-DESCRIPTION
;
If you are interested in seeing how this information is stored, you
can run with the @code{-f scm} option. The scheme expressions are then
-dumped onto the output file.
+dumped in the output file.
All visible, i.e. non-transparant, grobs have a callback to create a
Molecule. The name of the property is @code{molecule-callback}, and its
Construct a molecule by putting @var{mol2} next to
@var{mol1}. @var{axis} can be 0 (x-axis) or 1 (y-axis), @var{dir} can be
-1 (left or down) or 1 (right or up). @var{padding} specifies extra
-space to add in between. The unit is global staff space. is the
+space to add in between measured in global staff space.
@end defun
@defun ly-get-molecule-extent! mol axis
@defun ly-set-molecule-extent! mol axis extent
Set the extent (@var{extent} must be a pair of numbers) of @var{mol} in
-@var{axis} direction (0 or 1 for x and y axis respectively).
+@var{axis} direction (0 or 1 for x- and y-axis respectively).
+
+Note that an extent @code{(A . B)} is an interval and hence @code{A} is
+smaller than @code{B}, and is often negative.
+
@end defun
@node Font metrics
that is loaded into LilyPond can be accessed via Scheme.
LilyPond only needs to know the dimension of glyph to be able to process
-them. This information is stored in font metric files. LilyPond can
-read two types of font-metrics: @TeX{} Font Metric files (tfm files) and
-Adobe Font Metric files (@file{.afm} files). LilyPond will always try
-to load afm files first since @file{.afm} files are more versatile.
+them. This information is stored in font metric files. LilyPond can read
+two types of font-metrics: @TeX{} Font Metric files (TFM files) and
+Adobe Font Metric files (AFM files). LilyPond will always try to load
+AFM files first they files are more versatile.
@defun ly-get-default-font gr
This returns the default font for grob @var{gr}.
@defun ly-find-glyph-by-name font name
This function retrieves a Molecule for the glyph named @var{name} in
-@var{font}. The font must be available as a afm file.
+@var{font}. The font must be available as an AFM file.
@cindex afm file
@end defun
@node Miscellaneous Scheme functions
@section Miscellaneous Scheme functions
-@defun ly-input-location?
-type predicate
-@end defun
@defun ly-warn msg
Scheme callable function to issue the warning @code{msg}.
@end defun
@defun ly-gulp-file name
-read file named @var{name}, and return its contents in a string. This
-uses the lilypond search path.
+Read the file named @var{name}, and return its contents in a string. The
+file is looked up using the lilypond search path.
@end defun
@end defun
@defun ly-number->string num
- converts @var{num} without generating many decimals. It leaves a space
-at the end.
+ converts @var{num} to a string without generating many decimals. It
+leaves a space at the end.
@end defun
@defun set-lily-option sym val
- Set a global option for the program.
+ Set a global option for the program. Supported options include
+@table @code
+@item midi-debug
+If set to true, generate human readable MIDI
+@end table
-[todo: document interesting sym/val pairs ]
+This function is useful to call from the command line: @code{lilypond -e
+"(set-lily-option 'midi-debug #t)"}
@end defun
@cindex options, command line
@cindex switches
+Usage:
@example
- lilypond [OPTION]... [FILE]...
+ lilypond @var{[OPTION]} ... @var{[file]}...
@end example
@unnumberedsec Options
sequentially.
@item -f,--format=@var{format}
-Output format for sheet music. Choices are tex (for @TeX{}
-output), ps (for PostScript), scm (for a Scheme
-dump), and as (for ASCIIScript).
+Output format for sheet music. Choices are @code{tex} (for @TeX{}
+output), @code{ps} (for PostScript), @code{scm} (for a Scheme
+dump), and @code{as} (for ASCII-art).
@c TODO: TFMFONTS
-For processing both the @TeX{} and the PostScript output, you must
-have appropriate environment variables set. For @TeX{}, you have to
-set @code{MFINPUTS} and @code{TEXINPUTS} to point to the directory
-containing LilyPond metafont and .tex files. For processing the
-PostScript with Ghostscript, you have to set @code{GS_FONTPATH} to
-point to the directory containing LilyPond @file{pfa} files.
+For processing both the @TeX{} and the PostScript output, you must have
+appropriate environment variables set. For @TeX{}, you have to set
+@code{MFINPUTS} and @code{TEXINPUTS} to point to the directory
+containing LilyPond metafont and .tex files. For processing PostScript
+output with Ghostscript you have to set @code{GS_FONTPATH} to point to
+the directory containing LilyPond PFA files.
Scripts to do this are included in
@file{buildscripts/out/lilypond-profile} (for sh shells) and
@item -h,--help
Show a summary of usage.
-@item --include, -I=DIRECTORY
-Add @file{DIRECTORY} to the search path for input files.
+@item --include, -I=@var{directory}
+Add @var{directory} to the search path for input files.
@cindex file searching
@cindex search path
-@item -i,--init=FILE
-Set init file to @file{FILE} (default: @file{init.ly}).
+@item -i,--init=@var{file}
+Set init file to @var{file} (default: @file{init.ly}).
@item -m,--no-paper
@cindex MIDI
-Disable @TeX{} output. If you have a @code{\midi} definition, it will do the
-midi output only.
+Disable @TeX{} output. If you have a @code{\midi} definition midi output
+will be generated.
@item -M,--dependencies
Output rules to be included in Makefile.
-@item -o,--output=FILE
-Set the default output file to @file{FILE}.
+@item -o,--output=@var{FILE}
+Set the default output file to @var{FILE}.
@item -s,--safe
Disallow untrusted @code{\include} directives, in-line
Scheme evaluation, backslashes in @TeX{}, code.
@item -v,--version
Show version information
@item -V,--verbose
-Be verbose
+Be verbose: show full paths of all files read, and give timing
+information.
+
@item -w,--warranty
Show the warranty with which GNU LilyPond comes. (It comes with
@strong{NO WARRANTY}!)
@end table
-When invoked with a filename that has no extension, LilyPond will try
-adding `@file{.ly}' as an extension first.
+When invoked with a filename that has no extension, LilyPond will try to
+add @file{.ly} as an extension first.
When LilyPond processes @file{filename.ly} it will produce
@file{filename.tex} as output (or @file{filename.ps} for PostScript
-
-@tex
-\def\preLilypondExample{\vspace{0.5cm}}
-@end tex
-
@node lilypond-book
@chapter lilypond-book
-[TODO: THIS MANUAL IS NOT FINISHED YET. FIXME.]
+@command{lilypond-book} runs Lilypond on fragments of lilypond in a
+La@TeX{} or texinfo file, and includes the results into a document that
+can be processed with La@TeX{}, @command{makeinfo} or
+@command{texi2dvi}. The result is a text document containing formatted
+music integrated.
-@command{lilypond-book} is a script that helps integrating lilypond with
-La@TeX{} or texinfo. @command{lilypond-book} runs Lilypond on fragments
-of lilypond in your source file, and includes the results into a
-document that can be processed with La@TeX{}, @command{makeinfo} or
-@command{texi2dvi}. The result is a text document with formatted music
-integrated.
+More precisely, if a La@TeX{} file contains
+@example
-@command{lilypond-book} will do its best to try to align the music to
-the left and right margins. Currently all papersizes, one- and
-twocolumn mode and the @code{geometry} package is supported.
-The TeXinfo command @code{pagesize} is on the TODO list for Lilypond 1.4.
-But changing the linewidth in other ways will not give you a straight
-right margin.
+ \begin@{lilypond@}
+ CONTENTS
+ \end@{lilypond@}
+
+@end example
+or
+@example
+ \lilypond@{CONTENTS@}
+@end example
+then LilyPond is run on CONTENTS. @command{lilypond-book} puts the
+result back into the latex file. When you run the result through latex,
+you get a document that mixes text and music. lilypond-book will insert
+line width and font size definitions before @code{CONTENTS}, so the
+music samples will match the layout of your document.
+
+Very often, if you mix music and text, the music is often only a few
+notes or at most a few bars. This music should be as short as possible
+and not stretched to be aligned to the right margin. lilypond-book does
+this automatically if you don't use a @code{\score} block in
+@code{CONTENTS}. For example: @code{\lilypond@{\context Voice <c' e' g'>
+@}}.
+
+You can also use @code{lilypondfile} to include another file:
+@example
+ \lilypondfile@{foo.ly@}
+@end example
+
+All three forms can take several options. They are specified in brackets
+as follows:
+@example
+ \lilypondfile[options, go, here]@{ .. @}
+ \begin[options, go, here]@{lilypond@} .. \end@{lilypond@}
+ \lilypond[options, go,here]@{ .. @}
+@end example
+
+In the texinfo version, bitmaps of the music are also generated, so you
+can also make a HTML document with embedded music.
-This document assumes you have basic knowledge of GNU LilyPond and
-La@TeX{} or texinfo.
@section TeXinfo reference
@@lilypond[options, go, here]
YOUR LILYPOND CODE
@@end lilypond
-@end example
-
-or
-
-@example
@@lilypond[option, go, here]@{ YOUR LILYPOND CODE @}
+@@lilypondfile[options, go,here]@{@var{filename}@}
@end example
+
@command{lilypond-book} knows the default margins, and a few papersizes.
These commands should be in the beginning of the document:
@itemize @bullet
@lilypond[11pt]{<c' e' g'>}
-
-@subsection @@example and @@code
-
-I'm not sure if this will go into the final documentation, this is
-here mostly to remember me on why things are the way they are.
-
-@command{lilypond-book} will do nothing with special with @code{@@code} and
-@code{@@example} environments. The 'code' and 'example' commands
-should work just as normal. People looking at document that should be
-processed by @command{lilypond-book}, should notice nothing special, except from
-some block like this:
-@example
-@@lilypond
-BLABLA
-@@end lilypond
-@end example
-
-or this:
-
-@code{@@lilypond@{ BLABLA @}}
-
-Anything other is a bug in @command{lilypond-book}.
-
-So to get this in the printed manual:
-
-@example
-@@lilypond[26pt]
-\relative c'@{c d e f g2 g@}
-@@end lilypond
-@end example
-
-you have to write this:
-
-@example
-@@example
-@@@@lilypond[26pt]
-\relative c'@@@{c d e f g2 g@@@}
-@@@@end lilypond
-@@end example
-@end example
-
-Simply explained, every '@{', '@}' and '@@' has to be written as '@@@{',
-'@@@}' and '@@@@'. This is how it works in plain texinfo too.
-
-
@section La@TeX{} reference
Your markup the lilypond code like this:
@code{\postLilypondExample}. The variables are
defined to nothing by default, and the user can redefine them
to whatever he wants.
-@strong{[UGH: THIS DOES NOT HAPPEN WHEN
-YOU USE THE SHORT FORM, \LILYPOND@{ ... @}, CHECK OUT WHY]}
@subsection Examples
@lilypond[11pt]{<c' e' g'>}
-@subsection \begin@{verbatim@} and \verb|\verb|
-
-There work just as expected. Look at @file{mb-latex.tex} for details.
-
@section Options
@table @code
@item eps
- the music is created as eps graphics that can be inserted in
- the middle of a text line, not only as a separate paragraph.
- (La@TeX{} only)
+This will create the music as eps graphics and include it into the
+document with the @code{\includegraphics} command. It works in Latex
+only.
+
+This enables you to place music examples in the running text (and not in
+a separate paragraph). To avoid that La@TeX{} places the music on a line
+of its one, there should be no empty lines between the normal text and
+the lilypond environment. For inline music, you probably also need a
+smaller music font size (eg. 11 pt or 13 pt)
+
+
@item verbatim
CONTENTS is copied into the source enclosed in a verbatim block,
followed by any text given with the @code{intertext} option, then
@code{ @@lilypond@{ CONTENTS @} } and @code{ \lilypond@{ CONTENTS @} }
-@item intertext="text inside apostrophs"
- Used in conjunction with @code{verbatim} option.
-@item filename=FILENAME
- Save the lilypond code to FILENAME instead of using a hash value
- of CONTENTS.
-@item 11pt, 13pt, 16pt, 20pt, 26pt
- set the fontsize to use for the music
+@item intertext="@var{text}"
+ Used in conjunction with @code{verbatim} option: this puts
+@var{text} between the code and the music.
+@item filename=@var{FILENAME}
+ Save the lilypond code to @var{FILENAME}. By default, a hash value
+of the code is used.
+
+@item @code{11pt}
+@lilypond[11pt, eps]
+ \relative c'{
+ r16 [c d e][f d e c] [g'8 c][b-\prall c] |
+ [d16 g, a b][c a b g][d'8 g f-\prall g]
+ }
+@end lilypond
+@item @code{13pt}
+@lilypond[13pt, eps]
+ \relative c'{
+ r16 [c d e][f d e c] [g'8 c][b-\prall c] |
+ [d16 g, a b][c a b g][d'8 g f-\prall g]
+ }
+@end lilypond
+@item @code{16pt}
+@lilypond[16pt, eps]
+ \relative c'{
+ r16 [c d e][f d e c] [g'8 c][b-\prall c] |
+ [d16 g, a b][c a b g][d'8 g f-\prall g]
+ }
+@end lilypond
+@item @code{20pt}
+@lilypond[20pt, eps]
+ \relative c'{
+ r16 [c d e][f d e c] [g'8 c][b-\prall c] |
+ [d16 g, a b][c a b g][d'8 g f-\prall g]
+ }
+@end lilypond
+@item @code{26pt}
+@lilypond[26pt, eps]
+ \relative c'{
+ r16 [c d e][f d e c] [g'8 c][b-\prall c] |
+ }
+@end lilypond
+
@item singleline
- linewidth = -1.
+ Produce a single naturally spaced, unjustified line. (i.e.: linewidth = -1).
@item multiline
- linewidth = textwidth
+ The opposite of @code{singleline}: justify and break lines.
@item fragment
@item nofragment
Override @command{lilypond-book} autodetection of what type of code is in the
lilypond block, voice contents or complete code.
+@item printfilename
+ Prints the file name before the music example. Useful in conjunction
+with @code{\lilypondfile}.
@end table
@section Invocation
@code{lilypond-book --outdir=out yourfile.tex}
-For latex input, the file to give to latex has ext @file{.latex}.
-TeXinfo input will be written to a file with ext @file{.texi}. So be
-careful, don't give the source file that ext, or the file will be
-overwritten.
+For latex input, the file to give to latex has extension @file{.latex}.
+TeXinfo input will be written to a file with extension @file{.texi}.
If you use @code{--outdir}, you should also @code{cd} to that directory
before running LaTeX or makeinfo. This may seem a little kludgy, but
current working directory. Moreover, if you do this, LaTeX will not
clutter you normal working directory with output files.
-@strong{About the input}
-
-If the file contains the ``block''
-
-@example
-
- \begin@{lilypond@}
- CONTENTS
- \end@{lilypond@}
-
-@end example
-
-then LilyPond is run on CONTENTS. @command{lilypond-book} puts the result back,
-surrounded by @code{\preLilypondExample} and @code{\postLilypondExample}
-commands. @code{\preLilypondExample} and @code{posLilypondExample} is
-defined to nothing by default, and the user can redefine them
-to whatever he wants.
-
@cindex titling and lilypond-book
@cindex lilypond-book and titling
@cindex \header in LaTeX documents
@item @option{-f}, @option{--format=}
Specify the document type to process, @code{latex} or @code{texi}.
@command{lilypond-book} usually figure out this automatically.
-@item --default-music-fontsize=??pt
+@item --default-music-fontsize=@var{sz}pt
Set the fontsize to use for lilypond if no fontsize is given
as option.
-@item --force-music-fontsize=??pt
+@item --force-music-fontsize=@var{sz}pt
Force all lilypond to use this fontsize, overriding options
- given to \begin@{lilypond@}
-@item -I DIR, --include=DIR
- include path
+ given to @code{\begin@{lilypond@}}
+@item -I @var{DIR}, --include=@var{DIR}
+ Add @var{DIR} to the include path.
@item -M, --dependencies
- Write dependencies to out-www/filename.dep
-@item --dep-prefix=PREF
- prepend PREF before each -M dependency
+ Write dependencies to @file{filename.dep}
+@item --dep-prefix=@code{PREF}
+ prepend @code{PREF} before each @code{-M} dependency
@item -n, --no-lily
- don't run lilypond
+ don't run lilypond, but do generate the @code{.ly} files
@item --no-pictures
- don't generate pictures
+ don't generate pictures when processing texinfo.
@item --read-lys
don't write ly files. This way you can do
- @example
- lilypond-book file.tely
- convert-ly
- lilypond-book --read-lys
- @end example
-@item --outname=FILE
+@example
+ lilypond-book file.tely
+ convert-ly
+ lilypond-book --read-lys
+@end example
+
+[TODO not a useful option unless you can undump the input file]
+
+@item --outname=@var{FILE}
The name of La@TeX{} file to output. If this option is not given,
the output name derived from the input name.
-@item --outdir=
- where to place generated files
+@item --outdir=@var{DIR}
+ place generated files in @var{DIR}.
@item --version
print version information
@item --help
The La@TeX{} \includeonly@{...@} command is ignored.
+The TeXinfo command @code{pagesize} is on the TODO list for Lilypond 1.4.
+But changing the linewidth in other ways will not give you a straight
+right margin.
+
Ignores almost all La@TeX{} commands that changes margins and linewidths.
+Since there is no finder's fee which doubles every year, there is no
+need to wait for the prize money to grow. So send a bug report today if
+you need this one of these options.
+
+
@section Authors
@email{hanwen@@cs.uu.nl, Han-Wen Nienhuys}, @uref{http://www.cs.uu.nl/people/hanwen}
@node ly2dvi
@chapter ly2dvi
-@file{ly2dvi} is a Python script which creates input file for La@TeX{},
-based on information from the output files from LilyPond.
-The script handles multiple files. If a LilyPond file name is
-specified LilyPond is run to make an output (@TeX{}) file.
+@file{ly2dvi} is a Python script that creates a nicely title output file
+from an input file for La@TeX{}. It can create a DVI or PS file. It
+works by running LilyPond on the input files, creating a La@TeX{}
+wrapper around the output, and running La@TeX{} (and optionally
+@code{dvips}).
-One or more La@TeX{} files are created, based on information found
-in the output (@TeX{}) files, and latex is finally run to create
-one or more DVI files.
-
-@subsection Invoking ly2dvi
+@unnumberedsubsec Invoking ly2dvi
@example
-ly2dvi [OPTION]... [FILE]...
+ly2dvi @var{[OPTIONS]} ... @var{[FILE]}...
@end example
@unnumberedsec Options
@item -P,--postscript
Also generate PostScript output.
@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, latexoptions,
-papersize, pagenumber, linewidth, orientation, textheight.
+ Add @var{KEY}= @var{VAL} to the settings, overriding those specified
+in the files. Possible keys: @code{language}, @code{latexheaders},
+@code{latexpackages}, @code{latexoptions}, @code{papersize},
+@code{pagenumber}, @code{linewidth}, @code{orientation},
+@code{textheight}.
@item -v,--version
Show version information
@item -V,--verbose
@strong{NO WARRANTY}!)
@end table
-@subsection Titling layout
+@unnumberedsubsec Titling layout
-Ly2dvi extracts the following header fields from the .ly files to
+Ly2dvi extracts the following header fields from the LY files to
generate titling:
@table @code
@item subtitle
Subtitle, centered below the title.
@item poet
- Name of the poet, leftflushed below the below subtitle.
+ Name of the poet, left flushed below the below subtitle.
@item composer
- Name of the composer, rightflushed below the subtitle.
+ Name of the composer, right flushed below the subtitle.
@item metre
- Meter string, leftflushed below the below poet.
+ Meter string, left flushed below the below poet.
@item opus
- Name of the opus, rightflushed below the below composer.
+ Name of the opus, right flushed below the below composer.
@item arranger
- Name of the arranger, rightflushed below the opus.
+ Name of the arranger, right flushed below the opus.
@item instrument
Name of the instrument, centered below the arranger
@item piece
- Name of the piece, leftflushed below the instrument
+ Name of the piece, left flushed below the instrument
+@item head
+ A text to print in the header of all pages. It is not called
+@code{header}, because @code{\header} is a reserved word in LilyPond.
+@item footer
+ A text to print in the footer of all pages
@item tagline
- Line to print at the bottom of last page. Default: ``Lily was here,
-@var{version-number}''.
+ Line to print at the bottom of last page. The default text is ``Lily
+was here, @var{version-number}''.
@end table
-@subsection Additional parameters
+@cindex header
+@cindex footer
+@cindex page layout
+@cindex titles
+
+
+
+@unnumberedsubsec Additional parameters
Ly2dvi responds to several parameters specified in the LilyPond
-file. They can be overridden by supplying the @code{--set} command line
+file. They can be overridden by supplying a @code{--set} command line
option.
@table @code
read from the @code{\paper} block, if set.
@item linewidth
- Is read from the @code{\paper} block.
+ The music line width. It is normally read from the @code{\paper}
+block.
@item papersize
- Specify the papersize. Is read from the @code{\paper} block.
+ The paper size (as a name, e.g. @code{a4}). It is normally read from
+the @code{\paper} block.
@end table
-@subsection Environment variables
+@unnumberedsubsec Environment variables
@table @code
@item LANG
selects the language for the warning messages of Ly2dvi and LilyPond.
@end table
-@subsection Bugs
-
-Assumes that @code{cp} and @code{rm} are in the path.
-
-Cannot generate @TeX{} or @code{PostScript} only.
+@unnumberedsubsec Bugs
-If find something that you consider a bug, please send a bugreport (See
-@ref{Bug reports}) to @email{bug-gnu-music@@gnu.org}.
+Cannot generate @TeX{} or @code{PostScript} only. Send bugreports to to
+@email{bug-gnu-music@@gnu.org}.
-@subsection Authors
+@unnumberedsubsec Authors
@email{hanwen@@cs.uu.nl,Han-Wen Nienhuys}.
\score { \notes {
\property Staff.instrument = #`((kern . 0.5) (lines
- "2 Clarinetti" (rows " (B" ,text-flat ")")))
+ "2 Clarinetti" (columns " (B" ,text-flat ")")))
c'' 4 }
}
@end lilypond
head: markup | (markup+)
markup-item: property | abbrev
property: (@var{key} . @var{value})
-abbrev: @code{rows lines roman music bold italic named super sub text}
+abbrev: @code{columns lines roman music bold italic named super sub
+overstrike text}
@code{finger volta timesig mmrest mark script large Large dynamic}
@end example
The following abbreviations are currently defined:
@table @code
-@item rows
-horizontal mode: set all text on one line (default)
+@item columns
+ horizontal mode: set all text on one line (default)
@item lines
vertical mode: set every text on a new line
@item roman
superscript
@item sub
subscript
+@item overstrike
+ the next text or character overstrikes this one
@item finger
select fingering number fontstyle
@item volta
marking:
@lilypond[verbatim]
-#(define note '(rows
+#(define note '(columns
(music "noteheads-2" ((kern . -0.1) "flags-stem"))))
-#(define eight-note `(rows ,note ((kern . -0.1)
+#(define eight-note `(columns ,note ((kern . -0.1)
(music ((raise . 3.5) "flags-u3")))))
#(define dotted-eight-note
- `(rows ,eight-note (music "dots-dot")))
+ `(columns ,eight-note (music "dots-dot")))
\score {
\notes\relative c'' {
- a1^#`((rows (font-relative-size . -1)) ,dotted-eight-note " = 64")
+ a1^#`((columns (font-relative-size . -1)) ,dotted-eight-note " = 64")
}
\paper {
linewidth = -1.
is used to generate PostScript. Alternatively, @file{ly2dvi} can be
used to generate the .dvi for you.
+@refbugs
+
+Titling is not generated.
+
@node PostScript output
@subsection PostScript output
necessary .pfa files to LilyPond's .ps output, or upload them to the
printer before printing.
-Titling is not generated.
+The line height calculation is broken, you must set @var{lineheight} in
+the paperblock if you have more than one staff in your score, e.g.
+
+@example
+ ...
+ \paper @{
+ % Set line height to 40 staff spaces
+ lineheight = 40
+ @}
+@end example
@node Scheme output
@subsection Scheme output
\context Staff = corni <
\property Staff.midiInstrument = #"french horn"
\property Staff.instrument = #`(lines "Corno"
- (rows "(E" ,text-flat ")"))
+ (columns "(E" ,text-flat ")"))
\property Staff.instr = #`(lines "Cor."
- (rows "(E" ,text-flat ")"))
+ (columns "(E" ,text-flat ")"))
\property Staff.transposing = #3
\notes \key bes \major
\context Voice=one \corno
@separate
@example
\property Staff.instrument = #`(lines "Corno"
- (rows "(E" ,text-flat ")"))
+ (columns "(E" ,text-flat ")"))
@end example
The french horn has the most complex scheme markup name, made up of two
-lines of text. The second line has two elements (rows), the @code{E}
+lines of text. The second line has two elements (columns), the @code{E}
and the flat sign @code{text-flat} that we defined before.
@separate
* Songs with additional verses::
@end menu
-
-So what does this look like? Well, here is an example:
-@li lypond[veryverbatim, intertext="produces this music:"]
-\score{
- \notes\relative c'{
- \time 5/8
- [e16( g b c a g][e a b d] | )e2 d,8 |
- [e16( g b c a g][e a b d] | )b2 [a16( f] |
- [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] |
- [f( a b d b a][f a b d] | )e2
- }
-}
-@end lilypond
-If you are lucky, the above example show a nice feature of LilyPond
-and La@TeX{}. Since LilyPond can output the music as @TeX{} graphics,
-La@TeX{} can insert pagebreaks between the lines of music.
-
-Notice that there is no @code{\paper} statement in the example
-above. Lilypond-book will insert some code for you that defines the
-linewidth and the font to use. If you don't want to change the default,
-there is no need to put an empty @code{\paper@{@}} inside the @code{\score}.
-In the example above, something like this might be inserted before your code:
-@example
-\include "paper16.ly"
-\paper@{ \paper_sixteen
- linewidth = 390.\pt
-@}
-@end example
-The actual values for linewidth will differ depending on papersize and
-number of columns. Also, if you use a different fontsize for the
-music, another file than @code{paper16.ly} should be included.
-
-If you want to make the music not so wide, you can insert a
-@code{\paper} statement to set the linewidth:
-
-@li lypond[veryverbatim, intertext="produces this music:"]
-\score{
- \notes\relative c'{
- \time 5/8
- [e16( g b c a g][e a b d] | )e2 d,8 |
- [e16( g b c a g][e a b d] | )b2 [a16( f] |
- [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] |
- [f( a b d b a][f a b d] | )e2
- }
- \paper{linewidth = 10.\cm }
-}
-@end lilypond
-
-Very often, if you mix music and text, the music is often only a
-few notes or at most a few bars. This music should be as short as
-possible and not stretched to be aligned to the right margin.
-
-If you only write voice-contents in the lilypond block, @command{lilypond-book}
-will set the @code{linewidth} variable to -1, so Lilypond
-will make the music as short as possible but without breaking the
-line. Here is a well know harmonic progression:
-@li lypond[veryverbatim, intertext="produce a well known harmonic progression:"]
- \context Voice { <c' e g> <b d g> <c2 e g> }
-@end lilypond
-
-If you want to place music examples in the text,
-@li lypond[eps]
- \context Voice { <c' e g> <b d g> <c2 e g> }
-@end lilypond
-, you can use the @code{eps} option. This will create the music as
-eps graphics and include it into the document with the
-@code{\includegraphics} command.
-
-The code used look like this:
-@example
-@@li lypond[eps]
- \context Voice @{ <c' e g> <b d g> <c2 e g> @}
-@@end lilypond
-@end example
-
-You can also use the @code{eps} option if the block is a complete
-lilypond source. This 5 cm long empty line,
-@li lypond[eps]
-\score{
- \notes{s}
- \paper{ linewidth = 5.\cm }
-}
-@end lilypond
-was created with this code:
-@example
-@@li lypond[eps]
-\score@{
- \notes@{s@}
- \paper@{ linewidth = 5.\cm@}
-@}
-@@end lilypond
-@end example
-
-To avoid that La@TeX{} places the music on a line of its one, there should
-be no empty lines between the normal text and the lilypond
-environment.
-
-You can also use @code{lilypondfile}, to include another file:
-@example
- @@li lypondfile[printfilename]@{foo.ly@}
-@end example
-
-@subsection Fontsize options
-
-You can use all lilypond fontsizes in @command{lilypond-book}. The
-default 16pt fontsize is probably to big to be included in the middle of
-the text, 11pt or 13pt is probably better.
-
-The code can look like this:
-@example
-@@li lypond[13pt, eps]
-<c' e g>
-@@end lilypond
-@end example
-
-The following options set the fontsize:
-@itemize
-@item @code{11pt}
-@li lypond[11pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end lilypond
-@item @code{13pt}
-@li lypond[13pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end lilypond
-@item @code{16pt}
-@li lypond[16pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end lilypond
-@item @code{20pt}
-@li lypond[20pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end lilypond
-@item @code{26pt}
-@li lypond[26pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- }
-@end lilypond
-@end itemize
-
-
-@subsection More options
-
-@itemize
-@item The @code{singleline} option sets @code{linewidth} to -1.0.
-@item The @code{multiline} option sets @code{linewidth} to a value letting
-the music be aligned to the right margin. The music can span several
-lines.
-@end itemize
-
-@subsection Just in case...
-The options @code{fragment} and @code{nofragment} will override
-@command{lilypond-book} when it scans the lilypond code to see if it is voice
-contents or complete code. This might be useful if @command{lilypond-book} choose
-wrong.
-
-Since there is no finder's fee which doubles every year, there is no
-need to wait for the price money to grow. So send a bug report today
-if you need this one of these options.
-
-@subsection Examples
-
-This was all options to @code{\begin}. The rest of the lilypond
-document will show some ways you can use lilypond in
-La@TeX{} documents. It will also act as a simple test-suite for
-lilypond-book. You can place @code{eps} lilypond in and marginspars just
-as any other included eps graphics.
-
-@li lypond
-\score{
- \notes\relative c'{
- \time 12/8
- r4-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--]
- [f16-.( )f-. dis8-- gis16-.( )gis-.] cis4.-\fermata |
-
- r4.-\fermata [cis,16 cis g'8 f16 f b8][g16 g f8 b16 b] dis4.-\fermata
- }
- \paper{linewidth = 7.\cm}
-}
-@end lilypond
-
-
-To the right you can see some bars from the trumpet fanfara from the
-beginning of the fantastic street opera ``Houdini the Great'', by the
-Danish composer Andy Pape. The music is put inside a
-@code{floatingfigure} environment, and the music will be aligned by
-the right margin if you set floatingfigure width and lilypond linewidth
-to the same value. The code looks like this:
-
-@li lypond[verbatim]
-\score{
- \notes\relative c'{
- \time 12/8
- r4.-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--]
- [f16-.( )f-. dis8-- gis16-.( )gis-.] cis8.-\fermata |
-
- r4.-\fermata [cis,16 cis g'8 f16 f b8]
- [g16 g f8 b16 b] dis4.-\fermata
- }
- \paper{linewidth = 7.\cm }
-}
-@end lilypond
-
-If you have a lot of small music examples like this in the middle of
-your text, you might get a nicer look by using ``double'' line
-spacing. Put the @code{\linespread@{1.6@}} command into the preamble of
-your document. Then the line spacing will not be increased between the
-lines where you have music printed with the smallest font size.
-
-Lilypond-book does know about @code{\onecolumn} and @code{\twocolumn}.
-So the music will be adjusted to the new linewidth:
-
-Verbatim environments will also ignore the page margins. That is
-a feature of La@TeX{}. (But you usually put things inside a verbatim
-environment when you don't want La@TeX{} to do any linebreaking)
-
@end ignore
-Only in .: LilyPond.ico
diff -urN ../cinstall/Makefile.in ./Makefile.in
--- ../cinstall/Makefile.in Thu Feb 8 05:55:22 2001
-+++ ./Makefile.in Tue Apr 10 19:20:14 2001
-@@ -130,11 +130,16 @@
++++ ./Makefile.in Thu Apr 12 11:41:37 2001
+@@ -130,11 +130,15 @@
@chmod a-x $@
clean:
+ $(MAKE) -C zlib $@
realclean: clean
- rm -f Makefile config.cache
-+ rm -f *.d
-+ rm -f inilex.c iniparse.c iniparse.h version.c config.log config.status *.d
-+
+- rm -f Makefile config.cache
++ rm -f Makefile *.d
++ rm -f config.cache config.log config.status
++ rm -f inilex.c iniparse.c iniparse.h version.c
+
+distclean: realclean
$(SHELL) $(updir1)/mkinstalldirs $(bindir) $(etcdir)
diff -urN ../cinstall/desktop.cc ./desktop.cc
--- ../cinstall/desktop.cc Sat Nov 11 05:55:16 2000
-+++ ./desktop.cc Tue Apr 10 19:15:01 2001
++++ ./desktop.cc Thu Apr 12 11:39:52 2001
@@ -79,9 +79,7 @@
"done",
"",
diff -urN ../cinstall/ini.cc ./ini.cc
--- ../cinstall/ini.cc Thu Oct 5 05:55:27 2000
-+++ ./ini.cc Sun Apr 8 21:52:03 2001
++++ ./ini.cc Thu Apr 12 11:39:52 2001
@@ -174,7 +174,7 @@
{
*nl = 0;
diff -urN ../cinstall/msg.cc ./msg.cc
--- ../cinstall/msg.cc Sat Aug 26 05:55:14 2000
-+++ ./msg.cc Sun Apr 8 21:51:56 2001
++++ ./msg.cc Thu Apr 12 11:39:52 2001
@@ -44,7 +44,7 @@
vsprintf (buf, fmt, args);
void
diff -urN ../cinstall/res.rc ./res.rc
--- ../cinstall/res.rc Wed Mar 7 18:13:31 2001
-+++ ./res.rc Sun Apr 8 19:48:40 2001
++++ ./res.rc Fri Apr 13 16:06:40 2001
@@ -30,10 +30,10 @@
IDD_SOURCE DIALOG DISCARDABLE 0, 0, 215, 95
CYGWIN.ICON FILE DISCARDABLE "cygwin.ico"
/////////////////////////////////////////////////////////////////////////////
-@@ -354,7 +355,7 @@
+@@ -354,7 +355,8 @@
BEGIN
IDS_ROOT_SLASH "Warning: we recommend you do NOT use the root of your hard drive as the cygwin root. Proceed anyway?"
IDS_ROOT_SPACE "You should not choose a root path that include spaces in directory names. Proceed anyway?"
- IDS_MIRROR_LST "http://sources.redhat.com/cygwin/mirrors.lst"
-+ IDS_MIRROR_LST "http://appel.lilypond.org/lilypond/gnu-windows/mirrors.lst"
++ // IDS_MIRROR_LST "http://appel.lilypond.org/lilypond/gnu-windows/mirrors.lst"
++ IDS_MIRROR_LST "http://www.lilypond.org/gnu-windows/mirrors.lst"
IDS_DIALOG_FAILED "Unable to create Dialog Box"
IDS_CYGWIN_FUNC_MISSING "Error: unable to find function `%s' in %s"
IDS_DOWNLOAD_SHORT "Download error: %s too short (%d, wanted %d)"
diff -urN ../cinstall/resource.h ./resource.h
--- ../cinstall/resource.h Thu Mar 1 05:55:20 2001
-+++ ./resource.h Sun Apr 8 16:38:11 2001
++++ ./resource.h Thu Apr 12 11:39:52 2001
@@ -47,11 +47,12 @@
#define IDB_SPIN 118
#define IDB_RTARROW 119
#define IDC_SOURCE_DOWNLOAD 1000
#define IDC_SOURCE_NETINST 1001
#define IDC_SOURCE_CWD 1002
-Common subdirectories: ../cinstall/zlib and ./zlib
+diff -urN ../cinstall/zlib/Makefile.in ./zlib/Makefile.in
+--- ../cinstall/zlib/Makefile.in Tue Aug 8 05:55:18 2000
++++ ./zlib/Makefile.in Thu Apr 12 11:42:10 2001
+@@ -299,6 +299,10 @@
+
+ clean: clean-am
+
++realclean: clean
++ rm -f Makefile *.d
++ rm -f config.cache config.log config.status
++
+ distclean-am: distclean-noinstLIBRARIES distclean-compile \
+ distclean-tags distclean-generic clean-am
+
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=3
-PATCH_LEVEL=148
-MY_PATCH_LEVEL=uu1
+PATCH_LEVEL=149
+MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
* GUILE errors, simple guile test
- * TEX errors, simple tex test
+ * (La)TEX errors, simple tex test
]
unsigned int string_hash (String);
-template<class V>
+template <class V>
struct Dict_initialiser
{
char *key_;
/*
interface to STL function.
*/
-template<class V>
-class Dictionary : public map<String, V>
+#include "cons.hh"
+template <class V>
+class Dictionary : public std::map<String, V> //map<String, V>
{
public:
Dictionary ()
}
bool elem_b (String s)
{
- map<String,V>::const_iterator ki (find (s));
+ std::map<String,V>::const_iterator ki (find (s));
return ki != end ();
}
#ifndef GETOPT_LONG_HH
#define GETOPT_LONG_HH
+#include <ostream.h> /* gcc 3.0 */
#include "string.hh"
-class ostream;
-
/**
a struct this for initialising the commandline options.
*/
#if !HAVE_MEMMEM // GNU extension.
void *memmem (void const * haystack, int haystack_len,
void const *needle, int needle_len);
-#endif HAVE_MEMMEM
+#endif /* HAVE_MEMMEM */
#if !HAVE_SNPRINTF // GNU extension.
int snprintf (char *str, size_t n, char const *format, ...);
#ifndef RATIONAL_HH
#define RATIONAL_HH
-
#include "compare.hh"
#include "arithmetic-operator.hh"
#include "flower-proto.hh"
-class String;
+#include "string.hh"
+
/**
Rational numbers. Included is support for + and - infinity.
den_ = r.den_;
}
-class ostream;
ostream &
operator << (ostream &, Rational);
#include "string.hh"
#include "interval.hh"
-class istream;
-
-
/**
class for reading and mapping a file.
#ifndef STRING_HH
#define STRING_HH
-
+#include <iostream.h> /* gcc 3.0 */
#include "arithmetic-operator.hh"
#include "flower-proto.hh"
#include "string-handle.hh"
-class ostream;
-
/**
Intuitive string class. provides
#define classname(class_ptr) demangle_classname (typeid (* (class_ptr)))
const char *
-demangle_classname (type_info const &);
+demangle_classname (std::type_info const &);
/**
static enum parseKey recognize ( register char *ident)
{
- int lower = 0, upper = (int) NOPE, midpoint, cmpvalue;
+ int lower = 0,
+ upper = (int) NOPE,
+ midpoint = 0,
+ cmpvalue = 0;
BOOL found = FALSE;
while ((upper >= lower) && !found)
const char *
-demangle_classname (type_info const &t)
+demangle_classname (std::type_info const &t)
{
char const *s = t.name ();
while (isdigit (*s))
else
{
istream_p_ = new istrstream ("", 0);
- istream_p_->set (ios::eofbit);
+ istream_p_->setstate (ios::eofbit);
+ // istream_p_->set (ios::eofbit);
}
}
return istream_p_;
+++ /dev/null
-
-
-\score { \notes
- { c4_"foo" }
-}
clarinetti = \notes \relative c' {
% \property Staff.instrument = #`("Clarinetti in B" ,text-flat)
- \property Staff.instrument = #`(lines "2 Clarinetti" (rows "(B" ,raisedflat ")"))
- \property Staff.instr = #`(lines "Cl." (rows "(B" ,raisedflat ")"))
+ \property Staff.instrument = #`(lines "2 Clarinetti" (columns "(B" ,raisedflat ")"))
+ \property Staff.instr = #`(lines "Cl." (columns "(B" ,raisedflat ")"))
c1 c
}
}
corni = \notes \relative c' {
- \property Staff.instrument = #`(lines "2 Corni" (rows "(E" ,raisedflat ")"))
- \property Staff.instr = #`(lines "Cor." (rows "(E" ,raisedflat ")"))
+ \property Staff.instrument = #`(lines "2 Corni" (columns "(E" ,raisedflat ")"))
+ \property Staff.instr = #`(lines "Cor." (columns "(E" ,raisedflat ")"))
c1 c
}
--- /dev/null
+\header {
+ title="Chord Taxomony of LilyPond -- jazz"
+ subtitle="Amy's chord tests"
+}
+scheme = \chords {
+ c1
+ c:4
+ c:9
+ bes:9^7
+ c:11^7
+ c:9+
+ % TODO
+ }
+
+\score {
+ <
+ \property ChordNames.ChordName \set #'style = #'jazz
+ \context ChordNames \scheme
+ \context Staff \notes \transpose c'' \scheme
+ >
+}
% Scheme macros for accidentals. Note how they can be combined
-% with other strings, for example in: d^#`(rows ,sharp "4")
+% with other strings, for example in: d^#`(columns ,sharp "4")
#(define sharp '((raise . 0.2) (music (named "accidentals-1"))))
#(define natural '((raise . 0.2) (music (named "accidentals-0"))))
fis4^"7 6" [g8 d] e4^"7 6" [f?8 c] |
[d^#sharp d b g][c^"7" c^"5" a^"6" f] |
[bes^"7" bes^"5" g^"6" e] a4^#sharp d^"6" ~ |
- d^#`(rows ,sharp "4") c^"6" d e^#sharp |
+ d^#`(columns ,sharp "4") c^"6" d e^#sharp |
}
}
d-#'(lines "one" "two" "three")
e-#'(lines (bold "one")
- (rows "and" "there" "is" ((font-family . number) "2"))
+ (columns "and" "there" "is" ((font-family . number) "2"))
(italic "three"))
f-#'(finger "3")
g-#'(music (named "noteheads-2" "flags-u3"))
- b-#'(rows "a" (((kern . 3) (raise . 2)) "b") "c")
- c-#'(rows "1" (((raise . -2) (kern . -1)) "2") "3")
+ b-#'(columns "a" (((kern . 3) (raise . 2)) "b") "c")
+ c-#'(columns "1" (((raise . -2) (kern . -1)) "2") "3")
% }
d-#'(lines "Violoncello" " e" "Contrabasso")
e-#'((lines (baselineskip . 0) (kern . 1.5)) "Violoncello" " e" "Contrabasso")
%
% FIXME: put in an item, and typeset by an engraver.
-#(define note '(rows (music "noteheads-2" ((kern . -0.1) "flags-stem"))))
-#(define eight-note `(rows ,note ((kern . -0.1) (music ((raise . 3.5) "flags-u3")))))
-#(define dotted-eight-note `(rows ,eight-note (music "dots-dot")))
+#(define note '(columns (music "noteheads-2" ((kern . -0.1) "flags-stem"))))
+#(define eight-note `(columns ,note ((kern . -0.1) (music ((raise . 3.5) "flags-u3")))))
+#(define dotted-eight-note `(columns ,eight-note (music "dots-dot")))
\score {
\notes\relative c'' {
- a1^#`((rows (font-relative-size . -1)) ,dotted-eight-note " = 64")
+ a1^#`((columns (font-relative-size . -1)) ,dotted-eight-note " = 64")
}
\paper {
linewidth = -1.
% \property VoiceCombineStaff.instr = #"Fl."
\property VoiceCombineStaff.instrument = #`((kern . 0.5) (lines
- "2 Clarinetti" (rows "(B" ,text-flat ")")))
+ "2 Clarinetti" (columns "(B" ,text-flat ")")))
\property VoiceCombineStaff.instr = #`((kern . 0.5) (lines
- "Cl." (rows "(B" ,text-flat ")")))
+ "Cl." (columns "(B" ,text-flat ")")))
%\global
\context VoiceCombineVoice=one \partcombine VoiceCombineVoice
% Ugh, markup burps
\property StaffCombineStaff.instrument = #'((kern . 0.5)
- (lines "Violoncello" (rows " e") (rows "Contrabasso")))
+ (lines "Violoncello" (columns " e") (rows "Contrabasso")))
\property StaffCombineStaff.instr = #"Vc."
--- /dev/null
+\header {
+texidoc="Test super/sub, raise and overstrike."
+}
+
+
+
+\score {
+ \notes \relative a'' {
+ c^#'("bar")
+ c^#'(("bar"))
+ c^#'((("bar")))
+ c^#'(bold "bar")
+ c^#'((bold) "bar")
+ c^#'(((bold)) "bar")
+ c^#'(bold ("bar"))
+ c^#'(bold "bar")
+ c^#'(columns "foe" ((raise . 3) "bar"))
+ c^#'(columns "foe" (((raise . 3) "bar")))
+ c^#'(columns "foe" (((raise . 3)) "bar"))
+ c^#'(columns "foe" (super "12") (sub "3 4"))
+ c^#'(columns "foe" (super (overstrike "o") "/") (sub "x"))
+ c^#'(columns "foe" (overstrike "o") "/")
+ c^#'(columns "foe" ((bold roman overstrike) "o") "/")
+ c^#'(columns "foe" ((extent . (0 . 0)) "o") "/")
+ c^#'(columns "foo" (super "bar" (super "baz")))
+ }
+}
\ No newline at end of file
\score{
\notes\relative c''{
- c'1^#'(rows (dynamic "p") " ma sosten.")
+ c'1^#'(columns (dynamic "p") " ma sosten.")
c^#'(bold "ABCD")
- c^#'(rows "Dal " (music "scripts-segno"))
+ c^#'(columns "Dal " (music "scripts-segno"))
c^#'(Large "ABCD")
\break
\property Voice . TextScript \override #'font-shape = #'upright
- c1^#'(rows (dynamic "p") " ma sosten.")
+ c1^#'(columns (dynamic "p") " ma sosten.")
c^#'(bold "ABCD")
\property Voice . TextScript \override #'font-series = #'bold
- c^#'(rows "Dal " (music "scripts-segno"))
+ c^#'(columns "Dal " (music "scripts-segno"))
c^#'(Large "ABCD")
}
}
\version "1.3.146"
-\header{
-filename = "title.ly"
-title = "Title"
-subtitle = "Subtitle"
-composer= "Composer (xxxx-yyyy)"
-arranger = "Arranger"
-copyright = "public domain"
-enteredby = "jcn"
-source = "urtext"
-instrument= "Instrument"
+\header {
+ filename = "title.ly"
+ title = "Title"
+ subtitle = "Subtitle"
+ subsubtitle = "Subsubtitle"
+ composer = "Composer (xxxx-yyyy)"
+ arranger = "Arranger"
+ copyright = "public domain"
+ enteredby = "jcn"
+ source = "urtext"
+ instrument = "Instrument"
}
-
-
-\score{
- \notes
- \relative c'{
- c' d e f f e d c \break
- c d e f f e d c
- }
- \header{
- opus = "Opus 0"
- piece = "Piece I"
- override="Overdriven"
- }
+\score {
+ \context Staff \notes \relative c' {
+ \repeat unfold 10 {
+ c d e f f e d c \break
+ c d e f f e d c
+ }
+ }
+ \header {
+ opus = "Opus 0"
+ piece = "Piece I"
+ }
}
-
-\score{
- \notes
- \relative c' {
- f' e d c c d e f \break
- f e d c c d e f
- }
- \header{
- piece = "Piece II"
- opus = "Opus 1"
- }
+\score {
+ \notes \relative c' {
+ f e d c c d e f \break
+ f e d c c d e f
+ }
+ \header {
+ opus = "Opus 1"
+ piece = "Piece II"
+ }
}
fugaIIRight = \notes \relative c'' {
\key e \major % E-major
\clef violin
- \time3/4
+ \time 3/4
%15
\context Staff <
>
\context Staff = corni <
\property Staff.midiInstrument = #"french horn"
- \property Staff.instrument = #`(lines "Corno" (rows "(E" ,text-flat ")"))
- \property Staff.instr = #`(lines "Cor." (rows "(E" ,text-flat ")"))
+ \property Staff.instrument = #`(lines "Corno" (columns "(E" ,text-flat ")"))
+ \property Staff.instr = #`(lines "Cor." (columns "(E" ,text-flat ")"))
\property Staff.transposing = #3
\notes \key bes \major
\context Voice=one \corno
%}
>
>
- \paper{
- gourlay_maxmeasures = 14.0
- }
- \midi{
- \tempo 4 = 120
- }
+ \paper{ }
+ \midi{ \tempo 4 = 120 }
}
announce_grob (text_p_, 0);
Direction dir = UP;
- SCM text;
+ SCM text = SCM_EOL;
if (solo == SCM_BOOL_T)
{
state_ = SOLO;
AFM_CharMetricInfo const *
Adobe_font_metric::find_char_metric (String nm, bool warn) const
{
- map<String,int>::const_iterator ai = name_to_metric_dict_.find (nm);
+ std::map<String,int>::const_iterator ai = name_to_metric_dict_.find (nm);
if (ai == name_to_metric_dict_.end ())
{
#include "axis-group-interface.hh"
#include "paper-def.hh"
-/*
- This callback is set in the children of the align element. It does
- not compute anything, but a side effect of a->do_side_processing ()
- is that the elements are placed correctly. */
MAKE_SCHEME_CALLBACK (Align_interface,alignment_callback,2);
SCM
Align_interface::alignment_callback (SCM element_smob, SCM axis)
*/
struct Grob_info {
Translator * origin_trans_l_;
- friend Engraver;
+ friend class Engraver;
public:
Link_array<Translator> origin_trans_l_arr (Translator*) const;
Grob * elem_l_;
bool isdir_b (SCM s);
bool isaxis_b (SCM s);
+bool ly_number_pair_p (SCM);
+bool ly_axis_p (SCM);
+
/*
these conversion functions also do a typecheck on the argument, and
return a default value if S has the wrong type.
typedef SCM (*Scheme_function_unknown) ();
-#if __GNUC_MINOR__ >= 96
+#if __GNUC__ > 2 || __GNUC_MINOR__ >= 96
typedef SCM (*Scheme_function_0) ();
typedef SCM (*Scheme_function_1) (SCM);
typedef SCM (*Scheme_function_2) (SCM,SCM);
extern int score_count_global;
extern Sources* source_global_l;
-class ostream;
+#include <iostream.h> /* gcc 3.0 */
void print_lilypond_versions (ostream &os);
#endif /* MAIN_HH */
Moment * unsmob_moment (SCM);
+#if 0
IMPLEMENT_ARITHMETIC_OPERATOR (Moment, / );
-IMPLEMENT_ARITHMETIC_OPERATOR (Moment, + );
IMPLEMENT_ARITHMETIC_OPERATOR (Moment, * );
+IMPLEMENT_ARITHMETIC_OPERATOR (Moment, + );
IMPLEMENT_ARITHMETIC_OPERATOR (Moment, - );
IMPLEMENT_ARITHMETIC_OPERATOR (Moment, % );
-
INSTANTIATE_COMPARE (Moment const&, Rational::compare);
-
+#endif
#endif /* MOMENT_HH */
void break_line ();
};
-class ostream;
-#include <streambuf.h>
+#include <iostream.h> /* gcc 3.0 */
+#if __GNUC__ > 2
+ostream *open_file_stream (String filename,
+ std::ios_base::openmode mode=std::ios::out);
+#else
ostream *open_file_stream (String filename, int mode=ios::out);
+#endif
void close_file_stream (ostream *os);
}
};
-typedef map<SCM,SCM, SCM_less> Scm_stl_map;
+typedef std::map<SCM,SCM, SCM_less> Scm_stl_map;
/**
auto resizing hash table.
#include <stdio.h>
#include <ctype.h>
+#include <iostream.h> /* gcc 3.0 */
#include "score.hh"
#include "lily-guile.hh"
return SCM_BOOL_F;
}
+bool
+ly_number_pair_p (SCM p)
+{
+ return gh_pair_p (p) && gh_number_p (gh_car (p)) && gh_number_p (gh_cdr (p));
+}
+bool
+ly_axis_p (SCM a)
+{
+ return gh_number_p (a) && (gh_scm2int (a) == 0 || gh_scm2int (a) == 1);
+}
typedef void (*Void_fptr) ();
Array<Void_fptr> *scm_init_funcs_;
export GUILE_MAX_SEGMENT_SIZE=576000
may considerably decrease memory footprint (~*0.85), with a small
- execution time penalty (~*1.10). */
+ execution time penalty (~*1.10). However, if this 15% gain in memory
+ usage prevents swapping, the execution time falls drastically. */
sane_putenv ("GUILE_INIT_SEGMENT_SIZE_1", "4194304");
sane_putenv ("GUILE_MAX_SEGMENT_SIZE", "8388608");
{
String s = oparser_p_static->optional_argument_ch_C_;
Path p = split_path (s);
- if (p.ext.empty_b ())
+ if (s != "-" && p.ext.empty_b ())
p.ext = format_to_ext (output_format_global);
output_name_global = p.str ();
}
Midi_stream::Midi_stream (String filename)
{
filename_str_ = filename;
+#if __GCC__ > 2
os_p_ = open_file_stream (filename, ios::out|ios::bin);
+#else
+ os_p_ = open_file_stream (filename, ios::out|ios::binary);
+#endif
}
Midi_stream::~Midi_stream ()
add_molecule (toadd);
}
-
-
-
-bool
-number_pair_p (SCM p)
-{
- return gh_pair_p (p) && gh_number_p (gh_car (p)) && gh_number_p (gh_cdr (p));
-}
-
-bool
-axis_p (SCM a)
-{
- return gh_number_p (a) && (gh_scm2int (a) == 0 || gh_scm2int (a) == 1);
-}
-
+/* ly_? Thought we had the ly_ prefix for wrapping/adding to gh_ */
SCM
Molecule::ly_set_molecule_extent_x (SCM mol, SCM axis, SCM np)
{
Molecule* m = unsmob_molecule (mol);
- if (m && axis_p (axis) && number_pair_p (np))
+ if (m && ly_axis_p (axis) && ly_number_pair_p (np))
{
Interval iv = ly_scm2interval (np);
m->dim_[Axis (gh_scm2int (axis))] = ly_scm2interval (np);
{
Molecule *m = unsmob_molecule (mol);
- if (!m || !axis_p (axis))
+ if (!m || !ly_axis_p (axis))
{
warning ("ly-get-molecule-extent: invalid arguments");
return ly_interval2scm (Interval (0,0));
Molecule * m2 = unsmob_molecule (second);
Molecule result;
- if (!m1 || !m2 || !isdir_b (direction) || !axis_p (axis) || !gh_number_p (padding))
+ if (!m1 || !m2 || !isdir_b (direction) || !ly_axis_p (axis) || !gh_number_p (padding))
{
warning ("ly-combine-molecule-at-edge: invalid arguments");
Molecule r;
#include "music-constructor.hh"
typedef Music* (*Music_ctor) ();
-static map<String,Music_ctor> *ctors_map_;
+static std::map<String,Music_ctor> *ctors_map_;
void
add_music_ctor (String s, Music_ctor c)
{
if (!ctors_map_)
- ctors_map_ = new map<String, Music_ctor>;
+ ctors_map_ = new std::map<String, Music_ctor>;
(*ctors_map_)[s] = c;
}
const int MAXLINELEN = 200;
+#if __GNUC__ > 2
+ostream *
+open_file_stream (String filename, std::ios_base::openmode mode)
+#else
ostream *
open_file_stream (String filename, int mode)
+#endif
{
ostream *os;
if ((filename == "-"))
- os = new ostream (cout._strbuf);
+ os = &cout;
else
{
Path p = split_path (filename);
warning (_ ("Error syncing file (disk full?)"));
exit_status_global = 1;
}
- delete os;
+ if (os != &cout)
+ delete os;
os = 0;
}
#include "lily-guile.hh"
#include "scm-option.hh"
-/*
- TODO: mooie onschuldige test, en koel om allerleide dingen te kunnen zetten,
- maar is dit nou wel handig voor gebruikert?
-
- -X, of -fps is hendiger dan
- -e "(set-lily-option 'midi-debug #t)'
+/*
+ This interface to option setting is meant for setting options are
+ useful to a limited audience. The reason for this interface is that
+ making command line options clutters up the command-line option name
+ space.
- [niet voor niets tiepo in 139 announs..]
-*/
+ preferably, also dont use TESTING_LEVEL_GLOBAL, since it defeats
+ another purpose of this very versatile interface, which is to
+ support multiple debug/testing options concurrently.
+
+ */
/* Write midi as formatted ascii stream? */
bool midi_debug_global_b;
+
/* General purpose testing flag */
int testing_level_global;
+
/*
TODO: verzin iets tegen optie code bloot
{
if (gh_string_p (text))
return string2molecule (me, text, alist_chain);
-
- /*
- ugh: gh_list_p () is linear.
- */
-
- else if (gh_list_p (text) && text != SCM_EOL && text != SCM_UNDEFINED)
+ else if (gh_pair_p (text))
{
+ /* urg, why not just do this in markup_text2molecule ? */
if (gh_string_p (gh_car (text)))
- return string2molecule (me, gh_car (text), alist_chain);
+ return markup_text2molecule (me,
+ gh_append2 (gh_list (SCM_EOL,
+ SCM_UNDEFINED),
+ text),
+ alist_chain);
+ /*
+ Allow (faulty) texts that are in an extra list:
+ #'(("foo"))
+ */
+ else if (scm_ilength (text) <= 1)
+ return text2molecule (me, gh_car (text), alist_chain);
else
return markup_text2molecule (me, text, alist_chain);
}
Real staff_space = Staff_symbol_referencer::staff_space (me);
- Axis axis = X_AXIS;
-
/*
- TODO: change ALIGN into AXIS.
+ Line mode is default.
*/
- SCM a = ly_assoc_chain (ly_symbol2scm ("align"), p);
+ Axis axis = X_AXIS;
+
+ SCM a = ly_assoc_chain (ly_symbol2scm ("axis"), p);
if (gh_pair_p (a) && isaxis_b (gh_cdr (a)))
axis = (Axis)gh_scm2int (gh_cdr (a));
if (gh_pair_p (r) && gh_number_p (gh_cdr (r)))
raise = gh_scm2double (gh_cdr (r)) * staff_space;
- Offset o (0, (axis == Y_AXIS ? - kern[axis] : 0) + raise);
-
+ Interval extent;
+ bool extent_b = false;
+ SCM e = ly_assoc_chain (ly_symbol2scm ("extent"), p);
+ if (gh_pair_p (e) && ly_number_pair_p (gh_cdr (e)))
+ {
+ extent = Interval (gh_scm2double (gh_cadr (e)) * staff_space,
+ gh_scm2double (gh_cddr (e)) * staff_space);
+ extent_b = true;
+ }
+
+ Offset o (0, (axis == Y_AXIS ? - kern[axis] : 0));
+
Molecule mol;
while (gh_pair_p (text))
{
+
Molecule m = text2molecule (me, gh_car (text), p);
- SCM m_p = SCM_EOL;
+
+ /*
+ TODO: look at padding?
+
+ Look ahead here for kern and raise.
+
+ (cols "foo" ((raise . 1) "bar"))
+ (cols "foo" ((bold (raise . 1)) "bar"))
+
+ When constructing the molecule for bar, all normal extra
+ properties found, such as bold, are used for the construction
+ of bar's molecule. But for kern or raise, it seems that we're
+ too late then, translating bar's molecule has no effect (or
+ maybe the effect of translating gets nullified when bar's
+ molecule is `added_to_edge' of the molecule for foo?)
+
+ So, while constructing foo's molecule, we look ahead for the
+ raise of bar. The HEAD of the description of bar may be a
+ single property, or a list, so we must check that too.
+ */
+
+ SCM next_p = SCM_EOL;
if (gh_pair_p (gh_car (text)))
- m_p = gh_cons (gh_call2 (f, sheet, gh_caar (text)), alist_chain);
- SCM m_k = ly_assoc_chain (ly_symbol2scm ("kern"), m_p);
- Real m_kern = kern[axis];
- if (gh_pair_p (m_k) && gh_number_p (gh_cdr (m_k)))
- m_kern = gh_scm2double (gh_cdr (m_k)) * staff_space;
+ next_p = gh_list (gh_call2 (f, sheet, gh_caar (text)), SCM_UNDEFINED);
+ SCM next_k = ly_assoc_chain (ly_symbol2scm ("kern"), next_p);
+ Real next_kern = kern[axis];
+ if (gh_pair_p (next_k) && gh_number_p (gh_cdr (next_k)))
+ next_kern = gh_scm2double (gh_cdr (next_k)) * staff_space;
+
+ SCM next_r = ly_assoc_chain (ly_symbol2scm ("raise"), next_p);
+ Real next_raise = 0;
+ if (gh_pair_p (next_r) && gh_number_p (gh_cdr (next_r)))
+ next_raise = gh_scm2double (gh_cdr (next_r)) * staff_space;
+
+ o[Y_AXIS] = next_raise;
if (!m.empty_b ())
{
m.translate (o);
if (axis == Y_AXIS && baseline_skip)
- m_kern += baseline_skip - m.extent (Y_AXIS)[UP];
- mol.add_at_edge (axis, axis == X_AXIS ? RIGHT : DOWN, m, m_kern);
+ next_kern += baseline_skip - m.extent (Y_AXIS)[UP];
+ mol.add_at_edge (axis, axis == X_AXIS ? RIGHT : DOWN, m, next_kern);
}
text = gh_cdr (text);
}
+
+ if (extent_b)
+ {
+#if 0
+ /* Hmm, we're not allowed to change a Molecule's extent? */
+ mol.dim_[axis] = extent;
+ Molecule::ly_set_molecule_extent_x (mol.self_scm (), gh_int2scm (axis),
+ gh_cdr (e));
+#else
+ // burp: unpredictable names, these...
+ Box b = mol.extent_box ();
+ SCM expr = mol.get_expr ();
+
+ b[axis] = extent;
+ mol = Molecule (b, expr);
+#endif
+ }
return mol;
}
(LilyPond-command (LilyPond-command-query (LilyPond-master-file))
'LilyPond-master-file))
+;; FIXME, this is broken
(defun LilyPond-region-file (begin end)
(let (
;; (dir "/tmp/")
(defun LilyPond-shell-process (name buffer command)
(let ((old (current-buffer)))
(switch-to-buffer-other-window buffer)
- (goto-char (point-max))
+ ;; Hmm, if we goto the end of the buffer, we don't see
+ ;; the messages scroll by. I don't know how to fix this,
+ ;; so let's emty the buffer, then
+ ;;(goto-char (point-max))
+ (erase-buffer)
+ (goto-char (point-min))
(start-process-shell-command name buffer command)
(switch-to-buffer-other-window old)))
-\version "1.3.146"
+BABYL OPTIONS: -*- rmail -*-
+Version: 5
+Labels:
+Note: This is the header of an rmail file.
+Note: If you are seeing it in rmail,
+Note: it means the file has no messages in it.
+\1f\f
+1,,
+Return-Path: rz@daimi.au.dk
+Delivery-Date: Fri, 13 Apr 2001 13:33:44 +0200
+Received: from localhost (localhost [127.0.0.1])
+ by appel.lilypond.org (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id NAA02351
+ for <fred@localhost>; Fri, 13 Apr 2001 13:33:43 +0200
+X-XS4ALL-To: <jantien@xs4all.nl>
+Received: from pop.xs4all.nl
+ by localhost with POP3 (fetchmail-5.1.2)
+ for fred@localhost (single-drop); Fri, 13 Apr 2001 13:33:44 +0200 (CEST)
+Received: from smtp5.xs4all.nl (smtp5.xs4all.nl [194.109.6.49])
+ by maildrop7.xs4all.nl (8.11.1/8.11.1) with ESMTP id f3DBWCd93235
+ for <jantien@xs4all.nl>; Fri, 13 Apr 2001 13:32:12 +0200 (CEST)
+ (envelope-from rz@daimi.au.dk)
+Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164])
+ by smtp5.xs4all.nl (8.9.3/8.9.3) with ESMTP id NAA10302
+ for <jantien@xs4all.nl>; Fri, 13 Apr 2001 13:31:04 +0200 (CEST)
+Received: from nightcrawler.daimi.au.dk ([130.225.18.95])
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 14o1n2-0008Pp-00
+ for <janneke@gnu.org>; Fri, 13 Apr 2001 07:31:00 -0400
+Received: from daimi.au.dk (localhost [127.0.0.1])
+ by nightcrawler.daimi.au.dk (8.11.2/8.11.2) with ESMTP id f3DBUwX31324
+ for <janneke@gnu.org>; Fri, 13 Apr 2001 13:30:58 +0200
+Sender: rz@daimi.au.dk
+Message-ID: <3AD6E372.640DEE61@daimi.au.dk>
+Date: Fri, 13 Apr 2001 13:30:58 +0200
+From: Rune Zedeler <rz@daimi.au.dk>
+X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.16-3 i686)
+X-Accept-Language: en
+MIME-Version: 1.0
+To: Jan Nieuwenhuizen <janneke@gnu.org>
+Subject: german-chords
+Content-Type: multipart/mixed;
+ boundary="------------69CC07F348020448DD291CA8"
+X-UIDL: 987161532.maildrop7.93237
+
+*** EOOH ***
+\version "1.3.148"
% german-chords.ly:
% german/norwegian/danish?
#(define german-Bb #f)
-#(define (pitch->chord-name-text-banter pitch additions)
- (if (equal? (cdr pitch) '(6 -1))
- (if german-Bb
- (cons "B" (accidental->text -1))
- '("B")
- )
+#(define (pitch->chord-name-text-banter pitch steps)
+ (let ((dopitch (if (member (cdr pitch) '((6 -1) (6 -2)))
+ (list 7 (+ (if german-Bb 0 1) (caddr pitch)))
+ (cdr pitch)
+ )))
(cons
- (list-ref '("C" "D" "E" "F" "G" "A" "H") (cadr pitch))
- (accidental->text (caddr pitch))
+ (list-ref '("C" "D" "E" "F" "G" "A" "H" "B") (car dopitch))
+ (accidental->text-super (cadr dopitch))
)
)
- )
+ )
+
#(define (pitch->note-name-text-banter pitch)
- (if (equal? (cdr pitch) '(6 -1))
- '("b")
- (cons
+ (let ((dopitch (if (member (cdr pitch) '((6 -1) (6 -2)))
+ (list 7 (+ 1 (caddr pitch)))
+ (cdr pitch)
+ )))
+ (list
(string-append
- (list-ref '("c" "d" "e" "f" "g" "a" "h") (cadr pitch))
- (if (or (equal? (cadr pitch) 2) (equal? (cadr pitch) 5))
- (list-ref '( "ses" "s" "" "is" "isis") (+ 2 (caddr pitch)))
- (list-ref '("eses" "es" "" "is" "isis") (+ 2 (caddr pitch)))
+ (list-ref '("c" "d" "e" "f" "g" "a" "h" "b") (car dopitch))
+ (if (or (equal? (car dopitch) 2) (equal? (car dopitch) 5))
+ (list-ref '( "ses" "s" "" "is" "isis") (+ 2 (cadr dopitch)))
+ (list-ref '("eses" "es" "" "is" "isis") (+ 2 (cadr dopitch)))
)
)
- '()
)
)
)
+
+\1f
\ No newline at end of file
\version "1.3.146"
% JUNKME.
+%% deprecated
papersizename = \papersize
+% ly2dvi now uses `papersize' internally (and on cmd line)
+papersize = \papersize
+
+% FIXME
+% direct PostScript line height for single line staffs
+lineheight = 14
+
paperfile = \papersize + ".ly"
% paperfile = "a4.ly"
Begin3
Title: LilyPond
-Version: 1.3.148.uu1
-Entered-date: 13APR01
+Version: 1.3.149
+Entered-date: 17APR01
Description: @BLURB@
Keywords: music notation typesetting midi fonts engraving
Author: hanwen@cs.uu.nl (Han-Wen Nienhuys)
janneke@gnu.org (Jan Nieuwenhuizen)
Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
- 1000k lilypond-1.3.148.uu1.tar.gz
+ 1000k lilypond-1.3.149.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.3.148.uu1.tar.gz
+ 1000k lilypond-1.3.149.tar.gz
Copying-policy: GPL
End
%define info yes
Name: lilypond
-Version: 1.3.148.uu1
+Version: 1.3.149
Release: 1
License: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.148.uu1.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.149.tar.gz
# music notation software for.. ?
Summary: A program for printing sheet music.
URL: http://www.cs.uu.nl/~hanwen/lilypond
#include <libintl.h>
#endif
+bool testing_level_global;
// ugh
String filename_str_g;
>
grandStaff = \context PianoStaff <
+
\trebleStaff
\bassStaff
>
\grandStaff
>
\paper {
- \translator {
+%{ \translator {
\HaraKiriStaffContext
%VerticalExtent = #'(0 . 0)
%MinimumVerticalExtent = #'(0 . 0)
%StaffMinimumVerticalExtent = #'(0 . 0)
}
+ %}
\translator {
\LyricsContext
VerticalExtent = #'(1.2 . 1.2)
--- /dev/null
+ depth = ../../..
+ include $(depth)/ports/ports.make
+
%!PS-Adobe-1.0: lily.ps
%
-%
+% Functions for direct and embedded PostScript
% round cappings
1 setlinecap
show
} bind def
-% simple, but does it work everywhere?
-% explain ? --hwn
+% Simple, but does it work everywhere?
+% The filled circles are drawn by setting the linewidth
+% to 2*radius and drawing a point. Is that (defined to be)
+% a nice filled circle?
/draw_ez_ball % ch letter_col ball_col font
{
% font
%!PS-Adobe-1.0: lilyponddefs
+%
+% Functions for direct PostScript output
% hmm
% /setgray { 1 add } bind def
-/stafflinethickness lilypondpaperstafflinethickness def
-/staffheight lilypondpaperstaffheight def
+/staff-line-thickness lilypondpaperstafflinethickness def
+/staff-height lilypondpaperstaffheight def
+/line-width lilypondpaperlinewidth def
+
+% FIXME: why isn't this set (by default) by lily?
+% /text-height lilypondpapertextheight def
+
+/output-scale lilypondpaperoutputscale def
+/paper-size { lilypondpaperpapersize } bind def
+
+% FIXME
+% urg, read from paper block
+% fixed base line skip value, for single line staffs
+/base-line-skip lilypondpaperlineheight def
+
+
+/init-paper {
+ gsave
+ .1 setlinewidth
+ clippath pathbbox newpath
+ /vsize exch def
+ /hsize exch def pop pop pop
-/xoffset 30 def
-/yoffset 700 def
+ %FIXME:
+ %vsize text-height sub 2 div /top-margin exch def
+ 144 2 div /top-margin exch def
+ hsize line-width sub 2 div /left-margin exch def
+ grestore
+} bind def
-/placebox
+/place-box
{
/object exch def
gsave
% FIXME. translate to middle of box.
%
-/draw_box % breapth width depth height
+/draw-box % breapth width depth height
{
/h exch def
/d exch def
grestore
} bind def
-/start_line
+/start-line
{
+ line-y top-margin sub base-line-skip lt {
+ showpage
+ /line-y vsize top-margin sub def
+ } if
gsave
- xoffset yoffset translate
+ line-x line-y translate
} bind def
-/stop_line
+/stop-line
{
- /object exch def
- 0 0 moveto pathbbox exch pop sub exch pop
- object
+ /the-line exch def
+ 0 0 moveto the-line clippath pathbbox
+ stroke
grestore
- yoffset add /yoffset exch def
- % urg...
- yoffset lilypondpaperstaffheight 8 mul sub /yoffset exch def
+ exch 4 -1 roll
+ sub
+ 3 1 roll
+ exch sub
+ %pstack
+ %
+ % ugh: now we should have `width height' on stack,
+ % but it's probably just the width and height of last element
+ % (the last staff)
+ % How do we get all heights of all staffs in a line?
+ %
+ % output-scale div neg line-y add /line-y exch def
+ %
+ % discarding height...
+ pop
+ %
+ % discard width
+ pop
+ % use fixed base-line-skip for now
+ line-y base-line-skip output-scale mul sub /line-y exch def
+} bind def
+
+% FIXME: font definitions should come from LilyPond
+% built-in ps fonts are ugly
+/huge-bold-font {
+ /Times-Bold findfont 20.7 scalefont setfont
+} bind def
+
+/Large-bold-font {
+ /Times-Bold findfont 17.3 scalefont setfont
+} bind def
+
+/large-bold-font {
+ /Times-Bold findfont 14.4 scalefont setfont
+} bind def
+
+/large-font {
+ /Times-Roman findfont 14.4 scalefont setfont
+} bind def
+
+/large-smallcaps-font {
+ % urg
+ /Helvetica findfont 14.4 scalefont setfont
+} bind def
+
+/normal-font {
+ /Times-Roman findfont 12 scalefont setfont
+} bind def
+
+/footnote-font {
+ /Times-Roman findfont 10 scalefont setfont
+} bind def
+
+/get-text-dimensions % path .. width height
+{
+ dup true charpath pathbbox
+ newpath
+ line-x line-y moveto
+ exch 4 -1 roll
+ sub
+ 3 1 roll
+ exch sub
+} bind def
+
+/set-centered
+{
+ line-x line-y moveto
+ get-text-dimensions
+ neg line-y add /line-y exch def
+ neg line-width add 2 div 0 rmoveto
+ show
+} bind def
+
+/set-left
+{
+ line-x line-y moveto
+ get-text-dimensions
+ neg line-y add /line-y exch def
+ pop
+ show
+} bind def
+
+/set-right
+{
+ line-x line-y moveto
+ get-text-dimensions
+ neg line-y add /line-y exch def
+ neg line-width add 0 rmoveto
+ show
+} bind def
+
+/make-lilypond-title
+{
+ currentdict /lilypondtitle known {
+ huge-bold-font lilypondtitle set-centered
+ line-y 5 sub /line-y exch def
+ } if
+ currentdict /lilypondsubtitle known {
+ Large-bold-font lilypondsubtitle set-centered
+ line-y 5 sub /line-y exch def
+ } if
+ currentdict /lilypondsubsubtitle known {
+ large-bold-font lilypondsubsubtitle set-centered
+ } if
+ currentdict /lilypondcomposer known {
+ large-smallcaps-font lilypondcomposer set-right
+ } if
+ currentdict /lilypondopus known {
+ normal-font lilypondopus set-right
+ } if
+ currentdict /lilypondarranger known {
+ normal-font lilypondarranger set-right
+ } if
+ currentdict /lilypondinstrument known {
+ large-font lilypondinstrument set-centered
+ } if
+ currentdict /lilypondpiece known {
+ large-smallcaps-font lilypondpiece set-left
+ } if
+} bind def
+
+/end-lilypond-output
+{
+ /line-y top-margin def
+ footnote-font lilypondtagline set-left
+ showpage
} bind def
/turnOnExperimentalFeatures { } bind def
-stafflinethickness setlinewidth
+
+staff-line-thickness setlinewidth
+
+paper-size
+
+staff-height init-paper
+
+/line-x left-margin def
+/line-y vsize top-margin sub def
+
+make-lilypond-title
% see if we're there...
% 10 setlinewidth 0 0 moveto 400 800 lineto stroke
;; TODO
;;
+;; * easier tweakability:
+;; - split chord::names-alists up into logical bits,
+;; such as chord::exceptions-delta, exceptions-oslash
+;; - iso just the 'style parameter, use a list, eg:
+;; \property ChordNames.ChordName \set
+;; #'style = #'(jazz delta oslash german-tonic german-Bb)
+;;
;; * fix FIXMEs
+;;
;; * clean split/merge of bass/banter/american stuff
-;; * handy, documented hooks for user-override of:
-;; - tonic (chord) name
-;; -
+;;
;; * doc strings
(define chord::names-alist-banter '())
chord::names-alist-banter))
;;;;;;;;;;
+(define simple-super
+;; duh, no docstrings for
+;; "No real superscript, just raised and small"
+ '((raise . 1) (font-relative-size . -1)))
-
-;; FIXME
-(define (accidental->text acc)
+(define (accidental->textp acc pos)
(if (= acc 0)
'()
- (list '(music (font-relative-size . -2))
- (string-append "accidentals-" (number->string acc)))))
+ (list '(music (font-relative-size . -2))
+ (list pos (string-append "accidentals-" (number->string acc))))))
+(define (accidental->text acc) (accidental->textp acc 'columns))
(define (accidental->text-super acc)
- (if (= acc 0)
- '()
- (cons 'super (list (accidental->text acc)))))
-
-(define (accidental->text-sub acc)
- (if (= acc 0)
- '()
- (cons sub (list accidental->text acc))))
-
-
-;; these look nice, but don't work together with current inner-name-jazz
-;; (inner-name-jazz is a bit broken: apply append etc)
-(define (xaccidental->textp acc pos)
- (if (= acc 0)
- '()
- (list (list '(music (font-relative-size . -2))
- (list pos (string-append "accidentals-" (number->string acc))))))
-)
-
-(define (xaccidental->text acc) (accidental->textp acc 'rows))
-(define (xaccidental->text-super acc) (accidental->textp acc 'super))
-(define (xaccidental->text-sub acc) (accidental->textp acc 'sub))
+ (accidental->textp acc '((raise . 0.6) (font-relative-size . -1))))
+(define (accidental->text-sub acc) (accidental->textp acc 'sub))
(define (pitch->note-name pitch)
(cons (cadr pitch) (caddr pitch)))
-;; FIXME: see german-chords.ly
(define (pitch->text pitch)
- (cons
- (make-string 1 (integer->char (+ (modulo (+ (cadr pitch) 2) 7) 65)))
+ (text-append
+ (list
+ '(font-relative-size . 2)
+ (make-string 1 (integer->char (+ (modulo (+ (cadr pitch) 2) 7) 65))))
(accidental->text-super (caddr pitch))))
dirty
'())))
-(define (chord::text-append l . r)
+(define (text-append l . r)
(if (not (chord::text? r))
l
(if (not (chord::text? l))
r
- (cons l r))))
-
+ (if (empty? (cdr r))
+ (list 'columns l (car r))
+ (text-append (list 'columns l (car r)) (cdr r))))))
+
(define (chord::step tonic pitch)
(- (pitch::note-pitch pitch) (pitch::note-pitch tonic)))
(modulo (+ i 6) 7)))))))))
(define (chord::additions steps)
- " Return:
+" Return:
* any even step (2, 4, 6)
* any uneven step that is chromatically altered,
(where 7-- == -1, 7- == 0, 7 == +1)
* highest step
-and you need also:
+?and jazz needs also:
* TODO: any uneven step that's lower than an uneven step which is
chromatically altered
(define (chord::additions->text-banter additions subtractions)
(if (pair? additions)
- (cons (apply append
- (chord::text-cleanup
- (list
- (cons 'super (step->text-banter (car additions)))
- (if (or (pair? (cdr additions))
- (pair? subtractions))
- '(super "/")))))
- (chord::additions->text-banter (cdr additions) subtractions))))
+ (text-append
+ (let ((step (step->text-banter (car additions))))
+ (if (or (pair? (cdr additions))
+ (pair? subtractions))
+ (text-append step "/")
+ step))
+ (chord::additions->text-banter (cdr additions) subtractions))
+ '()))
(define (chord::subtractions->text-banter subtractions)
(if (pair? subtractions)
- (cons (apply append
- (chord::text-cleanup
- (list
- '(super "no")
- (cons 'super (step->text-banter (car subtractions)))
- (if (pair? (cdr subtractions))
- '(super "/")))))
- (chord::subtractions->text-banter (cdr subtractions)))))
+ (text-append
+ '("no")
+ (let ((step (step->text-jazz (car subtractions))))
+ (if (pair? (cdr subtractions))
+ (text-append step "/")
+ step))
+ (chord::subtractions->text-banter (cdr subtractions)))
+ '()))
(define (chord::bass-and-inversion->text-banter bass-and-inversion)
(if (and (pair? bass-and-inversion)
(sep-text (if (and (string-match "super" (format "~s" exception-part))
(or (pair? additions)
(pair? subtractions)))
- '((super "/"))))
+ (list simple-super "/")))
(adds-text (chord::additions->text-banter additions subtractions))
(subs-text (chord::subtractions->text-banter subtractions))
(b+i-text (chord::bass-and-inversion->text-banter bass-and-inversion)))
- (apply append
- (map chord::text-cleanup
- (list
- '(rows) tonic-text except-text sep-text adds-text subs-text
- b+i-text)))))
+ (text-append
+ tonic-text except-text sep-text
+ (list (list simple-super) adds-text subs-text)
+ b+i-text)))
(define (chord::name-banter tonic exception-part unmatched-steps
bass-and-inversion steps)
'())))
(chord::name->text style (car pitches) steps bass-and-inversion)))
-
-
;;;
;;; American style
;;;
(((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . ("m(maj7)"))
;jazz: the delta, see jazz-chords.ly
;;(((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (super ((font-family . math) "N"))
- ;; ugh, kludge slashed o
- ;; (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") ((kern . -0.85) ((raise . 0.57) ((font-relative-size . -3) "/"))) "7")) ; slashed o
- (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") (((kern . -0.85) (raise . 1.1) (font-relative-size . -2)) "/") "7")) ; slashed o
+ ;; slashed o
+ (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (columns (super (overstrike "o") "/") "7"))
(((0 . 0) (2 . 0) (4 . 1) (6 . -1)) . ("aug7"))
- (((0 . 0) (2 . 0) (4 . -1) (6 . 0)) . (rows "maj7" ((font-relative-size . -2) ((raise . 0.2) (music (named "accidentals--1")))) "5"))
- (((0 . 0) (2 . 0) (4 . -1) (6 . -1)) . (rows "7" ((font-relative-size . -2) ((raise . 0.2) (music (named "accidentals--1")))) "5"))
+ (((0 . 0) (2 . 0) (4 . -1) (6 . 0)) . (columns "maj7" ((font-relative-size . -2) ((raise . 0.2) (music (named "accidentals--1")))) "5"))
+ (((0 . 0) (2 . 0) (4 . -1) (6 . -1)) . (columns "7" ((font-relative-size . -2) ((raise . 0.2) (music (named "accidentals--1")))) "5"))
(((0 . 0) (3 . 0) (4 . 0) (6 . -1)) . ("7sus4"))
;; Common ninth chords
(((0 . 0) (2 . 0) (4 . 0) (5 . 0) (1 . 0)) . ("6/9")) ;; we don't want the '/no7'
;;
;; This is getting out-of hand? Only exceptional chord names that
;; cannot be generated should be here.
-;; Maybe we should have inner-jazz-name and inner-american-name functions;
+;; Maybe we should have inner-name-jazz and inner-name-american functions;
;;
;;
;;
;; minor chords
; minor sixth chord = m6
- (((0 . 0) (2 . -1) (4 . 0) (5 . 0)) . (rows("m")((raise . 0.5) "6")))
+ (((0 . 0) (2 . -1) (4 . 0) (5 . 0)) . (columns("m")((raise . 0.5) "6")))
;; minor major seventh chord = m triangle
;; shouldn't this be a filled black triange, like this: ? --jcn
- ;;(((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . (rows ("m") ((raise . 0.5)((font-family . math) "N"))))
- (((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . (rows ("m") ((raise . 0.5)((font-family . math) "M"))))
+ ;;(((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . (columns ("m") ((raise . 0.5)((font-family . math) "N"))))
+ (((0 . 0) (2 . -1) (4 . 0) (6 . 0)) . (columns ("m") ((raise . 0.5)((font-family . math) "M"))))
; minor seventh chord = m7
- (((0 . 0) (2 . -1) (4 . 0) (6 . -1)) . (rows("m")((raise . 0.5) "7")))
+ (((0 . 0) (2 . -1) (4 . 0) (6 . -1)) . (columns("m")((raise . 0.5) "7")))
; minor sixth nine chord = m6/9
- (((0 . 0) (2 . -1) (4 . 0) (5 . 0) (1 . 0)) . (rows("m")((raise . 0.5) "6/9")))
+ (((0 . 0) (2 . -1) (4 . 0) (5 . 0) (1 . 0)) . (columns("m")((raise . 0.5) "6/9")))
; minor with added nine chord = madd9
- (((0 . 0) (2 . -1) (4 . 0) (1 . 0)) . (rows("m")((raise . 0.5) "add9")))
+ (((0 . 0) (2 . -1) (4 . 0) (1 . 0)) . (columns("m")((raise . 0.5) "add9")))
; minor ninth chord = m9
- (((0 . 0) (2 . -1) (4 . 0) (6 . -1) (1 . 0)) . (rows("m")((raise . 0.5) "9")))
+ (((0 . 0) (2 . -1) (4 . 0) (6 . -1) (1 . 0)) . (columns("m")((raise . 0.5) "9")))
;; dominant chords
; dominant seventh = 7
(((0 . 0) (2 . 0) (4 . 0) (6 . -1)) . (((raise . 0.5) "7")))
; augmented dominant = +7
;(((0 . 0) (2 . 0) (4 . +1) (6 . -1)) . (((raise . 0.5) "+7"))) ; +7 with both raised
- (((0 . 0) (2 . 0) (4 . +1) (6 . -1)) . (rows("+")((raise . 0.5) "7"))) ; +7 with 7 raised
- ;(((0 . 0) (2 . 0) (4 . +1) (6 . -1)) . (rows((raise . 0.5) "7(")
+ (((0 . 0) (2 . 0) (4 . +1) (6 . -1)) . (columns("+")((raise . 0.5) "7"))) ; +7 with 7 raised
+ ;(((0 . 0) (2 . 0) (4 . +1) (6 . -1)) . (columns((raise . 0.5) "7(")
; ((raise . 0.3)(music (named ("accidentals-1"))))
; ((raise . 0.5) "5)"))); 7(#5)
; dominant flat 5 = 7(b5)
- (((0 . 0) (2 . 0) (4 . -1) (6 . -1)) . (rows((raise . 0.5) "7(")
+ (((0 . 0) (2 . 0) (4 . -1) (6 . -1)) . (columns((raise . 0.5) "7(")
((raise . 0.3)(music (named ("accidentals--1"))))
((raise . 0.5) "5)")))
; dominant 9 = 7(9)
;; half diminshed chords
;; half diminished seventh chord = slashed o
;; (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (((raise . 0.8) "/o")))
- (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (rows ((raise . 1) "o") (((kern . -0.85) (raise . 1.1) (font-relative-size . -2)) "/") "7")) ; slashed o
+ (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . (columns (super (overstrike "o") "/") "7")) ; slashed o
; half diminished seventh chord with major 9 = slashed o cancelation 9
(((0 . 0) (2 . -1) (4 . -1) (6 . -1) (1 . 0)) . (
chord::names-alist-american))
(define (step->text-alternate-jazz pitch)
- (cons
+ (text-append
(accidental->text (caddr pitch))
- (list (number->string (+ (cadr pitch) (if (= (car pitch) 0) 1 8))))))
+ (number->string (+ (cadr pitch) (if (= (car pitch) 0) 1 8)))))
(define (step->text-jazz pitch)
(if (= (cadr pitch) 6)
(case (caddr pitch)
;; sharp 7 only included for completeness?
- ((-2) (cons (accidental->text -1) '("7")))
+ ((-2) (text-append (accidental->text -1) '("7")))
((-1) '("7"))
((0) '("maj7"))
- ((1) (cons (accidental->text-super 1) '("7")))
- ((2) (cons (accidental->text-super 2) '("7"))))
+ ((1) (text-append (accidental->text-super 1) '("7")))
+ ((2) (text-append (accidental->text-super 2) '("7"))))
(step->text-alternate-jazz pitch)))
-(define (chord::additions->text-jazz additions subtractions)
+(define (xchord::additions->text-jazz additions subtractions)
(if (pair? additions)
- (cons (apply append
- (chord::text-cleanup
- (list
- (cons 'super (step->text-jazz (car additions)))
- (if (or (pair? (cdr additions))
- (pair? subtractions))
- '(super "/")))))
- (chord::additions->text-jazz (cdr additions) subtractions))
- '()))
+ (text-append
+ (let ((step (step->text-jazz (car additions))))
+ (if (or (pair? (cdr additions))
+ (pair? subtractions))
+ (text-append step "/")
+ step))
+ (chord::additions->text-jazz (cdr additions) subtractions))
+ '()))
+
+(define (chord::>5? x)
+ (or (> (car x) 0)
+ (> (cadr x) 4)))
+
+
+;; FIXME:
+;; Perhaps all logic like this should be done earlier,
+;; so that in this text-construction printing phase
+;; we can just blindly create text from all additions.
+;;
+;; This depends maybe on the fact of code sharing,
+;; in this layout, we can share the functions chord::additions
+;; and chord::subtractions with banter.
+(define (chord::additions->text-jazz additions subtractions)
+ (text-append
+ (chord::additions<=5->text-jazz (filter-out-list chord::>5? additions)
+ (filter-out-list chord::>5? subtractions))
+ (chord::additions>5->text-jazz (filter-list chord::>5? additions)
+ (filter-list chord::>5? subtractions))))
+
+;; FIXME
+(define (chord::additions<=5->text-jazz additions subtractions)
+ (let ((sus (chord::sus-four-jazz additions)))
+ (if (pair? sus)
+ (text-append '("sus") (step->text-jazz (car sus)))
+ '())))
+
+(define (chord::additions>5->text-jazz additions subtractions)
+ "
+Compose text of all additions
+ * if there's a subtraction:
+ - add `add'
+ - list all up to highest
+ * list all steps that are below an chromatically altered step
+ "
+ (text-append
+ (if (not (empty? subtractions)) "add" '())
+ (let ((radds (reverse additions)))
+ (reverse (chord::additions>5->text-jazz-helper
+ radds
+ subtractions
+ (if (or (empty? subtractions) (empty? radds))
+ #f (car radds)))))))
+
+(define (chord::additions>5->text-jazz-helper additions subtractions list-step)
+ "
+Create texts for all additions
+If list-step != #f, list all steps down to 5
+If we encounter a chromatically altered step, turn on list-step
+"
+
+ (if list-step
+ (if (not (member list-step subtractions))
+ (if (> 5 (cadr list-step))
+ (cons (step->text-jazz list-step)
+ (chord::additions>5->text-jazz-helper
+ additions
+ subtractions
+ (chord::get-create-step additions
+ (- (cadr list-step) 2))))
+ (step->text-jazz list-step))
+ (chord::get-create-step additions (- (cadr list-step) 2)))
+ (if (pair? additions)
+ (let ((step (car additions)))
+ (cons (step->text-jazz step)
+ (chord::additions>5->text-jazz-helper
+ (cdr additions)
+ subtractions
+ (if (or (and (!= 6 (cadr step)) (!= 0 (caddr step)))
+ (and (= 6 (cadr step)) (!= -1 (caddr step))))
+ (chord::get-create-step additions (- (cadr step) 2))
+ #f))))
+ '())))
+
+(define (chord::sus-four-jazz chord-pitches)
+ "List of pitches that are step 2 or step 4"
+ (filter-list (lambda (x)
+ (and (= 0 (car x))
+ (or (= 1 (cadr x)) (= 3 (cadr x))))) chord-pitches))
+
+(define (chord::get-create-step steps n)
+ (let* ((i (if (< n 0) (+ n 7) n))
+ (found (filter-list (lambda (x) (= i (cadr x))) steps)))
+ (if (empty? found)
+ (if (!= i 6)
+ (list 0 i 0)
+ (list 0 6 -1))
+ (car found))))
+
(define (chord::subtractions->text-jazz subtractions)
(if (pair? subtractions)
- (cons (apply append
- (chord::text-cleanup
- (list
- '(super "omit")
- (cons 'super (step->text-jazz (car subtractions)))
- (if (pair? (cdr subtractions))
- '(super "/")))))
- (chord::subtractions->text-jazz (cdr subtractions)))
- '()))
+ (text-append
+ (if (= 5 (cadr (car subtractions)))
+ (text-append
+ '("omit")
+ (let ((step (step->text-jazz (car subtractions))))
+ (if (pair? (cdr subtractions))
+ (text-append step "/")
+ step)))
+ '())
+ (chord::subtractions->text-jazz (cdr subtractions)))
+ '()))
;; TODO: maybe merge with inner-name-banter
;; additions, subtractions and bass or inversion into chord name
(define (chord::inner-name-jazz tonic exception-part additions subtractions
bass-and-inversion steps)
-
- ;; ugh
- (apply
- append
-
- (chord::text-cleanup
- (list '(rows)
- (pitch->chord-name-text-banter tonic steps)
- exception-part
- ;; why does list->string not work, format seems only hope...
- (if (and (string-match "super" (format "~s" exception-part))
- (or (pair? additions)
- (pair? subtractions)))
- '((super "/")))
- (chord::additions->text-jazz additions subtractions)
- (chord::subtractions->text-jazz subtractions)
- (chord::bass-and-inversion->text-banter bass-and-inversion)))))
+ (text-append
+ (pitch->chord-name-text-banter tonic steps)
+ exception-part
+ ;; why does list->string not work, format seems only hope...
+ (if (and (string-match "super" (format "~s" exception-part))
+ (or (pair? additions)
+ (pair? subtractions)))
+ (list simple-super "/"))
+
+ (list `(,simple-super)
+ (chord::additions->text-jazz additions subtractions)
+ (chord::subtractions->text-jazz subtractions))
+ (chord::bass-and-inversion->text-banter bass-and-inversion)))
;; Jazz style--basically similar to american with minor changes
;;
(properties-to-font .
,Font_interface::properties_to_font_name)
- ;; FIXME: this is a not-so-cool idea to use ALIGN
- ;; RAISE, LOOKUP, since they are not proper elt-properties,
- ;; and might interfere with them.
(markup-to-properties . ,markup-to-properties)
(abbreviation-alist
- . ((rows . ((align . 0)))
- (lines . ((align . 1)))
+ . ((columns . ((axis . 0)))
+ (lines . ((axis . 1)))
(roman . ((font-family . roman)))
(music . ((font-family . music) (lookup . name)))
(finger . ((font-style . finger)))
(upright . ((font-shape . upright)))
(italic . ((font-shape . italic)))
(named . ((lookup . name)))
- (super . ((raise . 1) (font-relative-size . -1)))
- (sub . ((raise . -1) (font-relative-size . -1)))
+ (overstrike . ((extent . (0 . 0))))
+ (super . ((raise . 1) (font-relative-size . -1) (extent . (0 . 0))))
+ (sub . ((raise . -1) (font-relative-size . -1) (extent . (0 . 0))))
(text . ((lookup . value)))
)
)
;; (display "'\n")
(if (pair? markup)
- (if (and (symbol? (car markup)) (not (pair? (cdr markup))))
+ ;; This is hairy. We want to allow:
+ ;; ((foo bar) "text")
+ ;; ((foo (bar . 1)) "text")
+ ;; ((foo . (0 . 1)))
+
+ (if (and (symbol? (car markup))
+ (or (not (pair? (cdr markup)))
+ (number? (cadr markup))))
(if (equal? '() (cdr markup))
(markup-to-properties sheet (car markup))
(list markup))
head: markup | (markup+)
markup-item: property | abbrev
property: (@var{key} . @var{value})
-abbrev: @code{rows lines roman music bold italic named super sub text}
+abbrev: @code{columns lines roman music bold italic named super sub overstrike text}
@code{finger volta timesig mmrest mark script large Large dynamic}
@end example
The following abbreviations are currently defined:
@table @samp
-@item rows
-horizontal mode: set all text on one line (default)
+@item columns
+ horizontal mode: set all text on one line (default)
@item lines
vertical mode: set every text on new line
@item roman
select roman font
@item music
- select feta font
+ select feta font, and lookup by character name
@item bold
select bold series
@item italic
superscript
@item sub
subscript
+@item overstrike
+ the next text or character overstrikes this one
@item finger
select fingering number fontstyle
@item volta
(cons (car list) rest)
rest))))
+(define (filter-out-list pred? list)
+ "return that part of LIST for which PRED is true."
+ (if (null? list) '()
+ (let* ((rest (filter-list pred? (cdr list))))
+ (if (not (pred? (car list)))
+ (cons (car list) rest)
+ rest))))
+
(define (uniqued-alist alist acc)
(if (null? alist) acc
(if (assoc (caar alist) acc)
" draw_repeat_slash"))
(define (end-output)
- "\nshowpage\n")
+ "\nend-lilypond-output\n")
(define (experimental-on) "")
(define (filledbox breapth width depth height)
(string-append (numbers->string (list breapth width depth height))
- " draw_box" ))
+ " draw-box" ))
;; obsolete?
(define (font-def i s)
(define (placebox x y s)
(string-append
- (ly-number->string x) " " (ly-number->string y) " {" s "} placebox\n"))
+ (ly-number->string x) " " (ly-number->string y) " {" s "} place-box\n"))
(define (bezier-sandwich l thick)
(string-append
" draw_bezier_sandwich"))
(define (start-line height)
- "\nstart_line {
+ "\nstart-line {
lilypondpaperoutputscale lilypondpaperoutputscale scale
")
(define (stem breapth width depth height)
(string-append (numbers->string (list breapth width depth height))
- " draw_box" ))
+ " draw-box" ))
(define (stop-line)
- "}\nstop_line\n")
+ "}\nstop-line\n")
(define (text s)
(string-append "(" s ") show "))
return str
conversions.append (((1,3,147), conv, 'default-neutral-direction -> neutral-direction'))
+if 1:
+ def conv (str):
+ str = re.sub ('\(align', '(axis', str)
+ str = re.sub ('\(row', '(columns', str)
+ return str
+ conversions.append (((1,3,148), conv, '(align -> (axis, (row -> columns'))
+
################################
# END OF CONVERSIONS
else:
return (0,0)
-
def error (str):
sys.stderr.write (str + "\n Exiting ... \n\n")
raise 'Exiting.'
for g in png:
cmd = r"""gs -sDEVICE=pgm -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=- -r90 -dNOPAUSE %s -c quit | pnmcrop | pnmtopng > %s"""
cmd = cmd % (g + '.eps', g + '.png')
- system (cmd)
+ try:
+ status = system (cmd)
+ except:
+ os.unlink (g + '.png')
+ error ("Removing output file")
+
os.chdir (d)
lily_p = 1
paper_p = 1
-output = 0
+output_name = ''
targets = {
'DVI' : 0,
'LATEX' : 0,
program_version = '@TOPLEVEL_VERSION@'
if program_version == '@' + 'TOPLEVEL_VERSION' + '@':
- program_version = '1.3.142'
+ program_version = '1.3.148'
original_dir = os.getcwd ()
progress (_ ("warning: ") + s)
def error (s):
+
+
+ """Report the error S. Exit by raising an exception. Please
+ do not abuse by trying to catch this error. If you donn't want
+ a stack trace, write to the output directly.
+
+ RETURN VALUE
+
+ None
+
+ """
+
progress (_ ("error: ") + s)
raise _ ("Exiting ... ")
return str
def help ():
- sys.stdout.write (_ ("Usage: %s [OPTION]... FILE") % program_name)
- sys.stdout.write ('\n\n')
- sys.stdout.write (help_summary)
- sys.stdout.write ('\n\n')
- sys.stdout.write (_ ("Options:"))
- sys.stdout.write ('\n')
- sys.stdout.write (options_help_str (option_definitions))
- sys.stdout.write ('\n\n')
- sys.stdout.write (_ ("Report bugs to %s") % 'bug-gnu-music@gnu.org')
- sys.stdout.write ('\n')
-
+ ls = [(_ ("Usage: %s [OPTION]... FILE") % program_name),
+ ('\n\n'),
+ (help_summary),
+ ('\n\n'),
+ (_ ("Options:")),
+ ('\n'),
+ (options_help_str (option_definitions)),
+ ('\n\n'),
+ (_ ("Report bugs to %s") % 'bug-gnu-music@gnu.org'),
+ ('\n')]
+ map (sys.stdout.write, ls)
+
def setup_temp ():
global temp_dir
if not keep_temp_dir_p:
def system (cmd, ignore_error = 0):
+ """Run CMD. If IGNORE_ERROR is set, don't complain when CMD returns non zero.
+
+ RETURN VALUE
+
+ Exit status of CMD
+ """
+
if verbose_p:
progress (_ ("Invoking `%s\'") % cmd)
st = os.system (cmd) >> 8
shutil.rmtree (temp_dir)
+#what a name.
def set_setting (dict, key, val):
try:
val = string.atof (val)
warning (_ ("no such setting: %s") % `key`)
dict[key] = [val]
+
def strip_extension (f, ext):
(p, e) = os.path.splitext (f)
if e == ext:
]
def run_lilypond (files, outbase, dep_prefix):
- opts = '--output=%s.tex' % outbase
+ opts = ''
+# opts = opts + '--output=%s.tex' % outbase
opts = opts + ' ' + string.join (map (lambda x : '-I ' + x,
include_path))
if paper_p:
set_setting (extra, x, m.group (1))
def find_tex_files_for_base (base, extra):
+
+ """
+ Find the \header fields dumped from BASE.
+ """
+
headerfiles = {}
for f in layout_fields:
if os.path.exists (base + '.' + f):
def find_tex_files (files, extra):
+ """
+ Find all .tex files whose prefixes start with some name in FILES.
+
+ """
+
tfiles = []
for f in files:
x = x + 1
if not x:
- warning (_ ("no lilypond output found for %s") % `files`)
+ fstr = string.join (files, ', ')
+ warning (_ ("no lilypond output found for %s") % fstr)
return tfiles
def one_latex_definition (defn, first):
}
def global_latex_definition (tfiles, extra):
- '''construct preamble from EXTRA,
- dump lily output files after that, and return result.
- '''
+
+ '''construct preamble from EXTRA, dump Latex stuff for each
+lily output file in TFILES after that, and return the Latex file constructed. '''
s = ""
if extra['papersize']:
try:
options = '%s' % ly_paper_to_latexpaper[extra['papersize'][0]]
- except:
+ except KeyError:
warning (_ ("invalid value: %s") % `extra['papersize'][0]`)
pass
if extra['latexoptions']:
options = options + ',' + extra['latexoptions'][-1]
-
+
s = s + '\\documentclass[%s]{article}\n' % options
if extra['language']:
if extra['latexoptions']:
s = s + '\geometry{twosideshift=4mm}\n'
-
+
s = s + r'''
\usepackage[latin1]{inputenc}
\input{titledefs}
if extra['pagenumber'] and extra['pagenumber'][-1] and extra['pagenumber'][-1] != 'no':
s = s + r'''
-\renewcommand{\@evenhead}{\parbox{\textwidth}%
- {\mbox{}\textbf{\thepage}\hfill\small\theheader}}
-\renewcommand{\@oddhead}{\parbox{\textwidth}%
- {\mbox{}\small\theheader\hfill\textbf{\thepage}}}
+\renewcommand{\@evenhead}{\hbox to\textwidth{\textbf{\thepage}\hfill{\small\theheader}}}
+\renewcommand{\@oddhead}{\hbox to \textwidth{{\small\theheader}\hfill\textbf{\thepage}}}
'''
else:
s = s + '\\pagestyle{empty}\n'
return s
def run_latex (files, outbase, extra):
- wfs = find_tex_files ([outbase] + files[1:], extra)
+
+ """Construct latex file, for FILES and EXTRA, dump it into
+OUTBASE.latex. Run LaTeX on it.
+
+RETURN VALUE
+
+None
+ """
+ latex_fn = outbase + '.latex'
+
+ wfs = find_tex_files (files, extra)
s = global_latex_definition (wfs, extra)
- f = open (outbase + '.latex', 'w')
+ f = open (latex_fn, 'w')
f.write (s)
f.close ()
if ( os.name == 'posix' ):
- cmd = 'latex \\\\nonstopmode \\\\input %s' % outbase + '.latex'
+ cmd = 'latex \\\\nonstopmode \\\\input %s' % latex_fn
else:
- cmd = 'latex \\nonstopmode \\input %s' % outbase + '.latex'
+ cmd = 'latex \\nonstopmode \\input %s' % latex_fn
+
if not verbose_p:
progress ( _("Running %s...") % 'LaTeX')
cmd = cmd + ' 1> /dev/null 2> /dev/null'
def run_dvips (outbase, extra):
+
+ """Run dvips using the correct options taken from EXTRA,
+leaving a PS file in OUTBASE.ps
+
+RETURN VALUE
+
+None.
+"""
opts = ''
if extra['papersize']:
opts = opts + ' -t%s' % extra['papersize'][0]
(sh, long) = getopt_args (__main__.option_definitions)
try:
(options, files) = getopt.getopt(sys.argv[1:], sh, long)
-except:
+except getopt.error, s:
+ errorport.write ("\nerror: getopt says `%s\'\n\n" % s)
help ()
sys.exit (2)
targets['MIDI'] = 0
paper_p = 0
elif o == '--output' or o == '-o':
- output = a
+ output_name = a
elif o == '--set' or o == '-s':
ss = string.split (a, '=')
set_setting (extra_init, ss[0], ss[1])
identify ()
sys.exit (0)
elif o == '--warranty' or o == '-w':
- try:
- system ('lilypond -w')
- except:
+ status = system ('lilypond -w', ignore_error = 1)
+ if status:
warranty ()
+
sys.exit (0)
include_path = map (abspath, include_path)
-original_output = output
+original_output = output_name
if files and files[0] != '-':
files = map (lambda x: strip_extension (x, '.ly'), files)
- if not output:
- output = os.path.basename (files[0])
+ if not output_name:
+ output_name = os.path.basename (files[0])
for i in ('.dvi', '.latex', '.ly', '.ps', '.tex'):
- output = strip_extension (output, i)
+ output_name = strip_extension (output_name, i)
files = map (abspath, files)
- if os.path.dirname (output) != '.':
- dep_prefix = os.path.dirname (output)
+ if os.path.dirname (output_name) != '.':
+ dep_prefix = os.path.dirname (output_name)
else:
dep_prefix = 0
- reldir = os.path.dirname (output)
- (outdir, outbase) = os.path.split (abspath (output))
+ reldir = os.path.dirname (output_name)
+ (outdir, outbase) = os.path.split (abspath (output_name))
setup_environment ()
setup_temp ()
extra = extra_init
if lily_p:
- try:
+## try:
run_lilypond (files, outbase, dep_prefix)
- except:
- # TODO: friendly message about LilyPond setup/failing?
- #
- # TODO: lilypond should fail with different
- # error codes for:
- # - guile setup/startup failure
- # - font setup failure
- # - init.ly setup failure
- # - parse error in .ly
- # - unexpected: assert/core dump
- targets = {}
+## # except:
+## # TODO: friendly message about LilyPond setup/failing?
+## #
+## # TODO: lilypond should fail with different
+## # error codes for:
+## # - guile setup/startup failure
+## # - font setup failure
+## # - init.ly setup failure
+## # - parse error in .ly
+## # - unexpected: assert/core dump
+## # targets = {}
if targets.has_key ('DVI') or targets.has_key ('PS'):
- try:
+# try:
run_latex (files, outbase, extra)
# unless: add --tex, or --latex?
del targets['TEX']
del targets['LATEX']
- except:
- # TODO: friendly message about TeX/LaTeX setup,
- # trying to run tex/latex by hand
- if targets.has_key ('DVI'):
- del targets['DVI']
- if targets.has_key ('PS'):
- del targets['PS']
+# except Foobar:
+# # TODO: friendly message about TeX/LaTeX setup,
+# # trying to run tex/latex by hand
+# if targets.has_key ('DVI'):
+# del targets['DVI']
+# if targets.has_key ('PS'):
+# del targets['PS']
# TODO: does dvips ever fail?
if targets.has_key ('PS'):
else:
# FIXME
help ()
- progress ('\n')
- try:
- error (_ ("no FILEs specified, can't invoke as filter"))
- except:
- pass
+ errorport.write ("ly2dvi: error: " + _ ("no files specified on command line.\n"))
sys.exit (2)
'''
TODO:
+
+ * use urllib iso ftplib
+
* more flexible build/ftp/patches/releases paths
- * flexible build command
- * show only?
+
+
+ show only: --command='echo "latest is: %n-%v"'
'''
-import os
+import ftplib
import fnmatch
+import getopt
+import re
+import operator
+import os
+import tempfile
import stat
import string
-import re
-import getopt
import sys
import __main__
-import operator
-import tempfile
try:
import gettext
list_ = list_file
-#
-# ugh: use ftp module.
-#
def list_ftp (user, passwd, host, dir, file):
if user == 'None':
user = 'anonymous'
if passwd == 'None':
passwd = program_name
- command = '''
-open -u%s,%s -p21 %s
-set passive-mode off
-cd "%s"
-ls -1 "%s"
-''' % (user, passwd, host, dir, file)
- temp = tempfile.mktemp (program_name)
- f = open (temp, 'w')
- f.write (command)
- f.close ()
- p = os.popen ('lftp -f %s' % temp, 'r')
- s = p.read ()
- status = p.close ()
- return string.split (s[:-1], '\n')
+ ftp = ftplib.FTP (host)
+ ftp.login (user, passwd)
+ ftp.set_pasv (1)
+ ftp.cwd (dir)
+ list = ftp.nlst (file)
+ try:
+ ftp.quit ()
+ except:
+ ftp.close ()
+ return list
def split_url (url):
m = re.match ('([^:/]*)(:)?(/*([^:]*):)?(/*([^@]*)@)?(//([^/]*))?(.*)/(.*)',
if passwd == 'None':
passwd = program_name
- command = '''
-open -u%s,%s -p21 %s
-set passive-mode off
-cd "%s"
-get "%s"
-''' % (user, passwd, host, dir, file)
- temp = tempfile.mktemp (program_name)
- f = open (temp, 'w')
- f.write (command)
- f.close ()
- p = os.popen ('lftp -f %s' % temp, 'r')
- s = p.read ()
- status = p.close ()
+ ftp = ftplib.FTP (host)
+ ftp.login (user, passwd)
+ ftp.set_pasv (1)
+ t = tempfile.mktemp (program_name)
+ try:
+ f = open (t, 'w')
+ ftp.retrbinary ('RETR %s/%s' % (dir, file),
+ lambda x, f=f: f.write (x))
+ f.close ()
+ # huh? Invalid cross-device link
+ # os.rename (t, file)
+ system ('mv %s %s' % (t, file))
+ except:
+ os.remove (t)
+ raise 'Foo'
+ try:
+ ftp.quit ()
+ except:
+ ftp.close ()
+ return list
+
+
def copy_url (url, dir):
os.chdir (dir)
s = "copy_%s ('%s', '%s', '%s', '%s', '%s')" % split_url (url)
if 1:
latest = find_latest (url)
- if os.path.isdir ('%s/%s' % (build_root, latest)):
+ # if os.path.isdir ('%s/%s' % (build_root, latest)):
+ if os.path.exists ('%s/%s/index.html' % (build_root, latest)):
progress (_ ("latest is: %s") % latest)
progress (_ ("relax, %s is up to date" % package_name))
sys.exit (0)
if not os.path.isdir (build_root):
build_root = temp_dir
+
if not os.path.isdir (release_dir):
release_dir = temp_dir
setup_temp ()
progress (_ ("building %s...") % latest)
os.chdir (build_root)
- if build (latest):
+ if not build (latest):
if previous and remove_previous_p:
system ('rm -rf %s' % os.path.join (build_root, previous))
else:
\def\theheader
{
\ifx\lilypondhead\undefined\else%
- \parbox{\textwidth}{\mbox{}\lilypondhead}\fi
+ \lilypondhead\fi
}
\def\thefooter
{
\ifx\lilypondfooter\undefined\else%
- \parbox{\textwidth}{\mbox{}\lilypondfooter}\fi
+ \lilypondfooter\fi
}
\def\makelilypondtagline
{