* Documentation build fixes.
-1.3.138
-=======
+1.3.138.hwn1
+============
+
+* Documentation updates
+
+* Added -e,--evaluate=CODE, to evaluate scheme from the command
+line. Practical application:
+
+ -e "(set-lily-option 'midi-debug #t)'
+
+Removed command-line options -T, -t, -Q, -x.
+
+* Changed point-and-click. Now it should be set to a procedure, e.g.
+
+ (set! point-and-click line-column-location)
+
+Added convert-ly rule.
+
+* Bugfix: use aliases not only for creating contexts, but also for
+referring to them. This fixes \clef "percussion" in rhythmic staffs.
+
+* removed \textscript.
1.3.137.jcn4
============
1.3.137.uu1
===========
+* changed name of ly-[sg]et-elt-property into ly-[sg]et-grob-property
+
* Added function (ly-music-name ), returns the name of a music objects as a
string.
paper that mixes fragments of notation with LaTeX.
* Special problems?
-
Music notation is very complicated. It is much more difficult than
typesetting mathematics which is TeX's forte. Almost everything in
music notation is a "Special problem".
--- /dev/null
+
+@quotation
+ We would like to dedicate this program to all the friends that we
+ met through music.
+
+ Han-Wen and Jan
+@end quotation
@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
+* 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
how grobs work.
@menu
-* What is a grob?::
-* Callbacks::
-* Setting grob properties::
-* Items and Spanners::
-* Grob Scheme functions::
+* What is a grob?::
+* Callbacks::
+* Setting grob properties::
+* Grob interfaces::
+* Items and Spanners::
+* Grob Scheme functions::
@end menu
@node What is a grob?
@subsection What is a grob?
-[TODO: document/explain interfaces]
-
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
space to the left. This mechanism is rather clumsy to use, but it allows
you tweak any setting of any grob.
+
+@node Grob interfaces
+@unnumberedsubsec Grob interfaces
+
+Grob properties form a namespace where you can set variables per
+object. Each object however, may have multiple functions. For example,
+consider a dynamic symbol, such @code{\ff} (fortissimo). It is printed
+above or below the staff, it is a dynamic sign, and it is a kind of
+text.
+
+To reflect this different functions of a grob, procedures and variables
+are grouped into so-called interfaces. The dynamic text for example
+supports the following interfaces:
+@table @code
+@item font-interface
+ The glyph is built from characters from a font, hence the
+@code{font-interface}. For objects supporting @code{font-interface}, you
+can select alternate fonts by setting @code{font-style},
+@code{font-point-size}, etc.
+
+@item dynamic-interface
+ Dynamic interface is not associated with any variable or function in
+particular, but this makes it possible to distinguish this grob from
+other similar grobs (like @code{TextScript}), that have no meaning of
+dynamics.
+
+@item text-interface
+ This interface is for texts that are to be set using special routines
+to stack text into lines, using kerning, etc.
+
+@item general-grob-interface
+ This interface is supported by all grob types.
+@end table
+
+
+
@node Items and Spanners
@unnumberedsubsec Items and Spanners
can run with the @code{-f scm} option. The scheme expressions are then
dumped onto the output file.
-(refer to the C++ code for more details). 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 value should
-be a Scheme function taking one argument (the grob) and returning a
-Molecule.
+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
+value should be a Scheme function taking one argument (the grob) and
+returning a Molecule. Most molecule callbacks are written in C++, but
+you can also write them in Scheme. An example is provided in
+@code{input/regression/molecule-hacking.ly}.
-[insert example of write your own.]
@defun molecule? m
type predicate.
at the end.
@end defun
+@defun set-lily-option sym val
+ Set a global option for the program.
+
+[todo: document interesting sym/val pairs ]
+@end defun
@unnumberedsec Command Options
@table @code
-@item -f,--format=
+
+@item -e,--evaluate=@var{code}
+ Evaluates the Scheme @var{code} before parsing @file{.ly}
+files. Multiple @code{-e} options may be given. They will be evaluated
+sequentially.
+
+@item -f,--format=@var{format}
Output format for sheet music. Choices are tex (for @TeX{}
output), ps (for PostScript) and scm (for a Scheme
dump).
Output rules to be included in Makefile.
@item -o,--output=FILE
Set the default output file to @file{FILE}.
-@item -Q,--find-old-relative
-show all changes needed to convert a file to relative octave syntax.
-
@item -s,--safe
Disallow untrusted @code{\include} directives, in-line
Scheme evaluation, backslashes in @TeX{}, code.
long time; do not rely on it for automatic invocation (e.g. over the
web). Volunteers are welcome to do a new audit.
-@item -T,--no-timestamps
-don't timestamp the output
-
-@item -t,--test
-Switch on any experimental features. Not for general public use.
@item -v,--version
Show version information
@item -V,--verbose
@uref{http://www.lilypond.org/}. The website contains on-line copies of
this and other documentation.
-
+@mbinclude dedication.itely
@menu
* Preface:: Preface
@node Preface
@chapter Preface
-[talk about:
+Some six years ago I was in the EJE (Eindhoven Youth Orchestra), and
+Jan, one of the cranked violists told me about the grand new project he
+was working on. It was an automated system for printing music (to be
+precise, it was MPP, a preprocessor for MusiXTeX). Accidentally, I also
+wanted to print out some parts from a score, so I started looking at his
+software, and quickly got hooked. The rest is, as they say, history.
-why lily, history, about manual, call for feedback on manual and
-program.
-Inspiration from ../misc/ ?
-]
+You're reading the preface of the manual for LilyPond 1.4, which is in
+all honesty, the first release of LilyPond that combines stability,
+flexibility and good documentation. I hope you have as much fun in using
+LilyPond as I had when hacking it.
+This manual was written to help you learn lily, but as you might
+imagine, I don't have anything learn about it. It's hard for me as a
+writer to judge whether the manual is clear for a newbie, but you can!
+So, should you find any part of the manual vague or outdated, please let
+us know: if you don't tell us, we'll never know.
+
+
+Han-Wen Nienhuys
+
+Utrecht, The Netherlands, March 2001.
+
+
+
+[preface jcn here? ]
@ignore
TODO:
- fix all FIXMEs
-
- Rhythm staff (clef, x-notehead)
-
@end ignore
@chapter Reference Manual
This document describes GNU LilyPond and its input format. The last
-revision of this document was for LilyPond 1.3.136.
+revision of this document was for LilyPond 1.3.138.
@menu
* Expressive marks::
* Ornaments::
* Repeats::
+* Rhythmic music::
* Piano music::
* Lyrics::
* Chords::
* Notes::
* Easy Notation note heads ::
* Tie::
+* Tuplets::
* Rests::
* Skip::
* Note mode::
context and turning off ties per Thread.
-@c . {Tuplets}
-@menu
-* Tuplets::
-@end menu
-
@node Tuplets
-@subsubsection Tuplets
-@cindex Tuplets
-@cindex Times
+@subsection Tuplets
+
+@cindex tuplets
+@cindex triplets
+@cindex @code{\times}
Tuplets are made out of a music expression by multiplying their duration
with a fraction.
g'4 \times 2/3 {c'4 c' c'} d'4 d'4
@end lilypond
-[todo: document tupletSpannerDuration]
-
-
+The property @code{tupletSpannerDuration} specifies how long brackets
+should last. With this, you can make lots of tuplets while typing
+@code{\times} only once. This saves typing work when you must make lots
+of tuplets.
+@lilypond[fragment, relative, singleline, verbatim]
+\property Voice.tupletSpannerDuration = #(make-moment 1 4)
+\times 2/3 { c''8 c c c c c }
+@end lilypond
@c . {Rests}
@node Rests
[TODO: discuss options for layout]
@c . {Partial}
-@subsubsection Partial
+@subsection Partial
@cindex Partial
@cindex anacrusis
@cindex upstep
@c . {Manual beams}
@cindex Automatic beams
-@subsubsection Manual beams
+@subsection Manual beams
@cindex beams, manual
@cindex @code{]}
@cindex @code{[}
@cindex @code{stemRightBeamCount}
-[FIXME: explain common tweaks.]
+[TODO: explain common tweaks.]
@node Expressive marks
stem end. If you want to override this layout you can do this through
@code{Voice.Slur}'s grob-property @code{attachment}:
-[TODO: remove this section]
Maybe reinclude other slur features and move back to tricks? Esp. the
second example, how to fix, can be very helpful.
-
-@c . {Text spanner}
-@menu
-* Text spanner::
-@end menu
-
@node Text spanner
-@subsubsection Text spanner
+@subsection Text spanner
@cindex Text spanner
Some textual indications, e.g. rallentando, accelerando, often extend
influence, spacing, but setting @code{Voice.textNonEmpty} to true will
take the widths into account. The identifier @code{\fattext} is defined
in the standard includes.
-@lilypond[fragment,singleline]
+@lilypond[fragment,singleline,verbatim]
\relative c' { c4^"longtext" \fatText c4_"longlongtext" c4 }
@end lilypond
At present, only repeats of whole measures are supported.
+@node Rhythmic music
+@section Rhythmic music
+
+
+@menu
+* Rhythmic staffs::
+@end menu
+
+@node Rhythmic staffs
+@subsection Rhythmic staffs
+
+Some times you might want to show only the rhythm of a melody. This can
+be done with the rhythmic staff. All pitches of notes on such a staff
+are squashed, and the staff itself looks has a single staff line:
+
+@lilypond[fragment,relative ]
+ \context RhythmicStaff {
+ \time 4/4;
+ c4 e8 f g2 | r4 g r2 | g1:32 | r1 |
+ }
+@end lilypond
+
+
+
+[TODO: explain perc notation, if it's finished in time.]
+
+
+
@c . {Piano music}
@node Piano music
@section Piano music
direction, length and thickness.
-
The most common way of tuning the output is to alter the values of these
-properties. There are two ways of doing that: first, you can
-specifically select a set of grobs at one point, and set properties as
-you wish, or secondly, you can (temporarily) modify the definition of a
-grob, thereby affecting an entire group of grobs.
-
-[Todo: onduidelijk]
+properties. There are two ways of doing that: first, you can temporarily
+change the definition of a certain type of grob, thus affecting a whole
+set of objects. Second, you can select one specific object, and set a
+grob property.
@menu
* Tuning groups of grobs ::
interesting effects, such as swing, articulation, slurring, tieing,
etc., but it is good enough for proof-hearing the music you enter.
-Dynamics and tempo changes are interpreted. [TODO: mention volume
-control/Instrument Equaliser]
+Dynamics and tempo changes are interpreted.
+
+[TODO: mention volume control/Instrument Equaliser]
@refbugs
* Point and click::
@end menu
-
+One of the applications of LilyPond is to enter music from existing
+written or printed material. When you're doing this kind of copying
+work, you can easily make mistakes. This section deals with tricks and
+features that help you enter music, and find and correct mistakes.
@c . {Relative}
@node Relative
@code{fisis} following a @code{ceses} will be put above the
@code{ceses}.
-Entering scales is straightforward in relative mode.
-
-@lilypond[fragment,verbatim,center]
+Entering music that changes octave frequently is easy in relative mode.
+@lilypond[fragment,singleline,verbatim,center]
\relative c'' {
- g a b c d e f g g, g
+ b c d c b c bes a
}
@end lilypond
And octave changing marks are used for intervals greater than a fourth.
-
@lilypond[fragment,verbatim,center]
\relative c'' {
c g c f, c' a, e'' }
@node Point and click
@subsection Point and click
-[todo]
+Point and click lets you find notes in the input by clicking on them in
+the Xdvi window. This makes it very easy to find input that causes some
+error in the sheet music.
+
+To use it, you need the following software
+
+@itemize
+@item
+@uref{ftp://ftp.math.berkeley.edu/pub/Software/TeX/xdvi.tar.gz,plain
+Xdvi} version 22.28 or better.
+
+ Note that most @TeX{} distributions ship with xdvik, which is a
+ different and less well maintained program. To find out which xdvi you
+ are running, try @code{xdvi --version} or @code{xdvi.bin --version}.
+@item emacs
+@end itemize
+
+
+Add one these lines to the top of your .ly file. The first one is for
+line location only. The second one is more convenient, but requires
+patching @code{emacsclient}.
+
+@example
+#(set! point-and-click line-location)
+#(set! point-and-click line-column-location)
+@end example
+
+In the emacs startup file (usually @file{~/.emacs}), add the following
+@example
+(server-start)
+@end example
+
+If you want emacs to jump to the exact spot (and not just the line) on a
+click, you must enable column positioning. To do so, you need to patch
+emacsclient. Apply @uref{this patch,
+http://www.cs.uu.nl/~hanwen/public/software/emacsclient-column} to
+@file{emacsclient.c} and @file{server.el} from the emacs source
+code. Stick the compiled emacsclient into a bin directory, and put
+@file{server.el} into a elisp directory
+(eg. @file{~/usr/share/emacs/}). Add the following to your @file{.emacs}
+init file, before invoking server-start.
+
+@example
+ (setq load-path (cons (concat (getenv "HOME") "/usr/share/emacs")
+ load-path))
+@end example
+
+
+Xdvi must be configured to use the emacs editor. Before starting, set
+the environment variable @code{XEDITOR} to @code{emacsclient --no-wait
++%c:%l %f}. Xdvi also must be configured to find the fonts. Refer to the
+xdvi documentation for more information.
+
+[TODO: is that so?]
+
+When viewing, control-mousebutton 1 will take you to the correct
+line/column. Control-mousebutton 2 will show all clickable boxes.
+
+When you convert the TeX file to PostScript using dvips, dvips
+will complain about not finding @code{src:X:Y} files. Those complaints are
+harmless, and can be ignored.
+
@node Interpretation context
@section Interpretation context
@cindex notation contexts
Notation contexts are objects that only exist during a run of LilyPond.
-During the interpretation phase of LilyPond (when lily prints
-"interpreting music"), music a @code{\score} block is interpreted in
-time order, i.e. in much the same order that humans read, play, and
-write music.
+During the interpretation phase of LilyPond (when it prints
+"interpreting music"), the music expresiion in a @code{\score} block is
+interpreted in time order. This is the same order that humans hear and
+play music.
-During this reading, the notation context is holds the state
-for the current point within the music. It contains information like
+During this interpretation, the notation context is holds the state for
+the current point within the music. It contains information like
@itemize @bullet
@item What notes are playing at this point?
There are some quirks that you must keep in mind when dealing with
defaults:
-Every top-level music is interpreted by the Score context, in other
+First, every top-level music is interpreted by the Score context, in other
words, you may think of @code{\score} working like
@example
\score @{
@}
@end example
-Sequential music follows the contexts of its "children". Take this example
+Second, sequential music follows the contexts of its
+``children''. Consider the following example.
+
@lilypond[verbatim, singleline]
\score { \context Score \notes { c'4 ( d' )e' } }
@end lilypond
@var{context-identifier}
@} @}
@end example
-Then you can add engravers, remove engravers and set context
-properties. The syntax for these operations are respectively
+Then you can add engravers, remove engravers.
+The syntax for these operations are respectively
@example
\remove @var{engravername}
\consists @var{engravername}
- @var{propname} = @var{value}
@end example
+
Here @var{engravername} is a string, the name of an engraver in the
-system. @var{propname} is a string and @var{value} is a Scheme
-expression.
+system.
+@example
+ @var{propname} = @var{value}
+@end example
+
@lilypond[verbatim,singleline]
\score { \notes {
c'4 c'4 }
\paper {
\translator { \StaffContext
- \consists Instrument_name_engraver;
- instrument = #"foo"
\remove Clef_engraver;
} } }
@end lilypond
@cindex engraver
-These type of property assignments happen before interpretation starts,
-so a @code{\property} expression will override any predefined settings.
-
-Engravers are the actual C++ modules that do the work in the
-interpretation phase.
-
+You can also set properties in a translator definition. The syntax is as
+follows:
-There are some pre-defined identifiers to simplify editing translators,
-they are defined in @file{ly/engraver.ly}. These pre-defined
-identifiers are:
-
-@table @code
-@cindex @code{StaffContext}
- @item @code{StaffContext}
- Default Staff context.
-@cindex @code{RhythmicStaffContext}
-
- @item @code{RhythmicStaffContext}
- Default RhythmicStaff context.
-@cindex @code{VoiceContext}
+@var{propname} is a string and @var{value} is a Scheme
+expression.
+@example
+ @var{propname} = @var{value}
+ @var{propname} \set @var{symbol} = @var{value}
+ @var{propname} \override @var{symbol} = @var{value}
+ @var{propname} \revert @var{symbol}
- @item @code{VoiceContext}
- Default Voice context.
-@cindex @code{ScoreContext}
+@end example
- @item @code{ScoreContext}
- Default Score context.
+These type of property assignments happen before interpretation starts,
+so a @code{\property} expression will override any predefined settings.
-@cindex @code{HaraKiriStaffContext}
- @item @code{HaraKiriStaffContext}
- Staff context that does not print if it only contains rests. See
-@ref{Hara-kiri staffs}.
-@end table
+ To simplify editing translators, all standard contexts have standard
+identifiers called @var{name}@code{Context}, e.g. @code{StaffContext},
+@code{VoiceContext}.
@node Defining new contexts
@subsection Defining new contexts
@itemize @bullet
@item A name, specified by @code{\name @var{contextname};}.
- @item A cooperation engraver. This is specified by @code{\type
+ @item A cooperation module. This is specified by @code{\type
@var{typename};}.
@end itemize
-
-A context definition has this syntax:
-
+This is an example:
@example
-
- \translator @code{@{}
- @var{translatorinit} @var{translatormodifierlist}
- @code{@}}
+\translator @code{
+ \type "Engraver_group_engraver";
+ \name "SimpleStaff";
+ \alias "Staff";
+ \consists "Staff_symbol_engraver";
+ \consists "Note_head_engraver";
+ \consistsend "Axis_group_engraver";
+}@
@end example
-@var{translatorinit} can be an identifier or
-@example
-
-@end example
-where @var{typename} is one of
-
-The cooperation engraver groups other engravers, and specifies how they
-should cooperate. Choices are:
+Basic building blocks of translation are called engravers; they are
+special C++ classes.
+The argument of @code{\type} is the name for a special engraver that
+handles cooperation between simple engravers such as
+@code{Note_head_engraver} and @code{Staff_symbol_engraver}. Alternatives
+for this engraver are the following:
@table @code
@cindex @code{Engraver_group_engraver}
@item @code{Engraver_group_engraver}
`miniscore'.
@end table
-@var{translatormodifierlist} is a list of items where each item is
-one of
+Other modifiers are
@itemize @bullet
- @item @code{\consists} @var{engravername} @code{;}
- Add @var{engravername} to the list of modules in this context.
- The order of engravers added with @code{\consists} is
- significant.
-
+ @item @code{\alias} @var{alternate-name} @code{;}
+ This specifies a different name. In the above example,
+@code{\property Staff.X = Y} will also work on @code{SimpleStaff}s
+
@item @code{\consistsend} @var{engravername} @code{;}
Analogous to @code{\consists}, but makes sure that
@var{engravername} is always added to the end of the list of
completeness, but is never used in practice.
- @item @code{\remove} @var{engravername} @code{;}
- Remove a previously added (with @code{\consists}) engraver.
-
@item @code{\name} @var{contextname} @code{;}
This sets name of the context, e.g. @code{Staff}, @code{Voice}. If
the name is not specified, the translator won't do anything.
-
- @item @var{propname} @code{=} @var{value} @code{;}
- A property assignment.
@end itemize
In the @code{\paper} block, it is also possible to define translator
- Properties can be preset within the @code{\translator} block
-corresponding to the appropriate context. In this case, the syntax
-is
-
-@example
- @var{propname} @code{=} @var{value}
-@end example
-
-The property settings are used during the interpretation phase. They
-are read by the LilyPond modules where interpretation contexts are
-built of. These modules are called @emph{translators}. Translators for
-notation are called @emph{engravers}, and translators for sound are
-called @emph{performers}.
-
-
@c . {Syntactic details}
@node Syntactic details
@section Syntactic details
@cindex Syntactic details
+
+This section describes details that were too boring to be put elsewhere.
+
@menu
* Top level::
* Identifiers::
\score @{ @var{musicexpr} @var{outputdefs} @}
@end example
-@var{outputdefs} are zero or more output definitions. If no output
-definition is supplied, the default @code{\paper} block will be added.
+@var{outputdefs} are zero or more output definitions. If none is
+supplied, the default @code{\paper} block will be added.
@cindex Header
@cindex @code{\header}
-The syntax is
+A header describes bibilographic information of the file's contents. It
+can also appear in a @code{\score} block. Tools like @code{ly2dvi} can
+use this information for generating titles. Key values that are used by
+@code{ly2dvi} are: title, subtitle, composer, opus, poet, instrument,
+metre, arranger, piece and tagline.
+
+@cindex @code{ly2dvi}
+
+The syntax is
@example
\header @{ @var{key1} = @var{val1};
-@cindex @code{ly2dvi}
@var{key2} = @var{val2}; @dots{} @}
@end example
-
-A header describes the file's contents. It can also appear in a
-@code{\score} block. Tools like @code{ly2dvi} can use this
-information for generating titles. Key values that are used by
-@code{ly2dvi} are: title, subtitle, composer, opus, poet, instrument,
-metre, arranger, piece and tagline.
-
It is customary to put the @code{\header} at the top of the file.
@subsubsection Default output
Music in LilyPond is entered as a music expression. Notes, rests, lyric
syllables are music expressions, and you can combine music expressions
to form new ones, for example by enclosing a list of expressions in
-@code{\sequential @{ @}} or @code{< >}. In this example, a compound
-expression is formed out of the quarter note @code{c} and a quarter note
-@code{d}:
+@code{\sequential @{ @}} or @code{< >}. In the following example, a
+compound expression is formed out of the quarter note @code{c} and a
+quarter note @code{d}:
@example
\sequential @{ c4 d4 @}
@node Lexical details
@section Lexical details
+Even more boring details, now on lexical side of the input parser.
+
@menu
* Comments::
* Direct Scheme::
A real constant can be followed by one of the dimension keywords:
@code{\mm} @code{\pt}, @code{\in}, or @code{\cm}, for millimeters,
points, inches and centimeters, respectively. This converts the number
-to a real that is the internal representation of dimensions.
+a number that is the internal representation of that dimension.
@node Strings
\version "1.3.124";
\header @{ title = "Two miniatures"; @}
- #(set! point-and-click #t)
+ #(set! point-and-click line-column-location)
\paper @{
linewidth = -1.0; @}
This sets the titling information for the entire file.
@example
- #(set! point-and-click #t)
+ #(set! point-and-click line-column-location)
@end example
This is Scheme code. It sets the variable @code{point-and-click} to the
\include "os-music.ly";
\include "paper13.ly";
-#(set! point-and-click #t)
+#(set! point-and-click line-column-location)
#(define text-flat '((font-relative-size . -2)
(music "accidentals--1")))
mistakes, so we enable point and click (See @ref{Point and click})
editing.
@example
-#(set! point-and-click #t)
+#(set! point-and-click line-column-location)
@end example
We need a flat sign in text to name the tuning of the french horn, so we
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=3
-PATCH_LEVEL=138
-MY_PATCH_LEVEL=jcn1
+PATCH_LEVEL=139
+MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
static int hex2nibble_i (Byte byte);
static Byte nibble2hex_byte (Byte byte);
public:
+ static String pad_to (String s, int length);
static String bool_str (bool b);
static String bin2dec_str (String bin_str);
static String bin2hex_str (String bin_str);
sprintf (s,"%ld", l);
return s;
}
+
+String
+String_convert::pad_to (String s, int n)
+{
+ return s + to_str (' ' , (n - s.length_i ()) >? 0);
+}
-
\header { texidoc=" You can write molecule callbacks in Scheme, thus
providing custom glyphs for notation elements. A simple example is
adding parentheses to existing molecule callbacks.
\score{
\context RhythmicStaff {
\notes\relative c''{
- \property RhythmicStaff.clefGlyph = #"clefs-percussion"
- \property RhythmicStaff.clefPosition = #0
+ \clef "percussion";
\time 4/4;
r4 r g2 | r4 g r2 | g1:32 | r1 |
}
--- /dev/null
+\header {
+texidoc= "Using make-music, you can add
+various stuff to notes. Here is an example
+how to add an extra fingering.
+
+In general, first do a display of the music you want ot
+create, then write a function that will build the structure for you.";
+}
+
+#(define (make-script x)
+ (let* ( (m (ly-make-music "Text_script_req"))
+ )
+
+ (ly-set-mus-property m 'text-type 'finger)
+ (ly-set-mus-property m 'text x)
+ m
+ ))
+
+#(define (add-script m x)
+ (if (equal? (ly-music-name m) "Request_chord")
+ (ly-set-mus-property m 'elements
+ (cons (make-script x) (ly-get-mus-property m 'elements)))
+
+ (let* ( (es (ly-get-mus-property m 'elements))
+ (e (ly-get-mus-property m 'element)) )
+ (map (lambda (y) (add-script y x)) es)
+ (if (music? e)
+ (add-script e x))
+ )
+ )
+ m
+)
+
+\score { \apply #(lambda (x) (add-script x "6") (display x) x ) \notes { c4-3 } }
+
-
+ \version "1.3.138";
\header {
title = "Two miniatures";
}
- #(set! point-and-click #t)
+ #(set! point-and-click line-column-location)
\paper { linewidth = -1.0; }
+\version "1.3.138";
+
\include "os-music.ly";
\include "paper13.ly";
-#(set! point-and-click #t)
+#(set! point-and-click line-column-location)
#(define text-flat '((font-relative-size . -2) (music "accidentals--1")))
\score {
#include "staff-symbol-referencer.hh"
#include "custos.hh"
#include "molecule.hh"
-#include "lookup.hh"
#include "debug.hh"
#include "note-head.hh"
#include "item.hh"
extern Array<String> dump_header_fieldnames_global;
extern bool midi_debug_global_b;
extern bool no_paper_global_b;
-extern bool no_timestamps_global_b;
extern String output_format_global;
extern String output_name_global;
extern bool safe_global_b;
/* Name of initialisation file. */
String init_name_global;
-/* Write midi as formatted ascii stream? */
-bool midi_debug_global_b;
-
/* Do not calculate and write paper output? */
bool no_paper_global_b = false;
-/* Do not write timestamps in output? */
-bool no_timestamps_global_b = false;
-
/* Selected output format.
One of tex, ps, scm, as. */
String output_format_global = "tex";
/* Verbose progress indication? */
bool verbose_global_b = false;
+/* Scheme code to execute before parsing, after .scm init */
+String init_scheme_code_string = "(begin #t ";
/*
{0, "no-paper", 'm', _i ("produce MIDI output only")},
{_i ("NAME"), "output", 'o', _i ("write output to NAME")},
{0, "safe", 's', _i ("inhibit file output naming and exporting")},
- {0, "no-timestamps", 'T', _i ("don't timestamp the output")},
{0, "version", 'v', _i ("print version number")},
{0, "verbose", 'V', _i ("verbose")},
{0, "warranty", 'w', _i ("show warranty and copyright")},
- {0, "midi-debug", 'X', _i ("write midi ouput in formatted ascii")},
+ {_i ("EXPR"), "evaluate", 'e',_i ("evalute EXPR as Scheme after .scm init is read")},
{0,0,0,0}
};
call_constructors ();
all_fonts_global_p = new All_font_metrics (global_path.str ());
+ init_scheme_code_string += ")";
+ gh_eval_str (init_scheme_code_string.ch_C());
+
int p=0;
const char *arg ;
while ((arg = oparser_p_static->get_next_arg ()) || p == 0)
output_name_global = p.str ();
}
break;
+ case 'e':
+ init_scheme_code_string +=
+ oparser_p_static->optional_argument_ch_C_;
+ break;
case 'w':
notice ();
exit (0);
case 'm':
no_paper_global_b = true;
break;
- case 'T':
- no_timestamps_global_b = true;
- break;
- case 'X':
- midi_debug_global_b = true;
- break;
default:
assert (false);
break;
Midi_track::data_str () const
{
String str = Midi_chunk::data_str ();
+
if (midi_debug_global_b)
str += "\n";
for (Cons<Midi_event> *i=event_p_list_.head_; i; i = i->next_)
Midi_stream::operator << (Midi_item const& midi_c_r)
{
String str = midi_c_r.str ();
+
+
if (midi_debug_global_b)
{
str = String_convert::bin2hex_str (str) + "\n";
}
#include "main.hh"
+
void
Music::set_spot (Input ip)
{
- /* misuse midi-debug flag: don't store origin */
- if (midi_debug_global_b)
- return;
set_mus_property ("origin", make_input (ip));
}
{"script", SCRIPT},
{"stylesheet", STYLESHEET},
{"skip", SKIP},
- {"textscript", TEXTSCRIPT},
{"tempo", TEMPO},
{"translator", TRANSLATOR},
{"transpose", TRANSPOSE},
exp = scm_eval2 (exp, SCM_EOL);
scm_eval2 (exp, SCM_EOL);
- String creator;
- if (no_timestamps_global_b)
- creator = gnu_lilypond_str ();
- else
- creator = gnu_lilypond_version_str ();
+ String creator = gnu_lilypond_version_str ();
+
+ String generate = _ (", at ");
+ time_t t (time (0));
+ generate += ctime (&t);
+ generate = generate.left_str (generate.length_i () - 1);
- String generate;
- if (no_timestamps_global_b)
- generate = ".";
- else
- {
- generate = _ (", at ");
- time_t t (time (0));
- generate += ctime (&t);
- generate = generate.left_str (generate.length_i () - 1);
- }
-
/*
Make fixed length time stamps
*/
Paper_outputter::output_version ()
{
String id_str = "Lily was here";
- if (no_timestamps_global_b)
- id_str += ".";
- else
- id_str += String (", ") + version_str ();
+ id_str += String_convert::pad_to (String (", ") + version_str (), 40);
output_String_def ("lilypondtagline", id_str);
output_String_def ("LilyPondVersion", version_str ());
%token APPLY
%token ARPEGGIO
%token DYNAMICSCRIPT
-%token TEXTSCRIPT
%token ACCEPTS
%token ALTERNATIVE
%token BAR
d->set_spot (THIS->here_input ());
$$ = d;
}
- | TEXTSCRIPT embedded_scm {
- Text_script_req *t = new Text_script_req;
- t->set_mus_property ("text", $2);
- t->set_spot (THIS->here_input ());
- $$ = t;
- }
| SPANREQUEST bare_int STRING {
Span_req * sp_p = new Span_req;
sp_p->set_span_dir ( Direction ($2));
// perhaps multiple text events?
String id_str;
String str = String (_ ("Creator: "));
- if (no_timestamps_global_b)
- id_str = gnu_lilypond_str ();
- else
- id_str = gnu_lilypond_version_str ();
+ id_str = String_convert::pad_to (gnu_lilypond_version_str (), 40);
str += id_str;
str += "\n";
/* Better not translate this */
str = "Generated automatically by: ";
str += id_str;
- if (no_timestamps_global_b)
- str += ".\n";
- else
- {
- str += _ (", at ");
- time_t t (time (0));
- str += ctime (&t);
- str = str.left_str (str.length_i () - 1);
- }
+ str += _ (", at ");
+ time_t t (time (0));
+ str += ctime (&t);
+ str = str.left_str (str.length_i () - 1);
/*
Pad out time stamps to 120 chars. */
- str = str + to_str (' ' , (120 - str.length_i ()) >? 0);
+
+ str = String_convert::pad_to (str, 120);
Audio_text generate_a (Audio_text::TEXT, str);
Midi_text generate (&generate_a);
while (n < 0)
{
n += 7;
- o -= 1;
+ o --;
}
return (o + n / 7) * 12 + pitch_byte_a[n % 7] + alteration_i_;
}
--- /dev/null
+/*
+ scheme-option.cc -- implement option setting from Scheme
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "lily-guile.hh"
+
+
+bool midi_debug_global_b;
+
+
+/*
+
+ Todo: print help text.
+
+
+ other interesting stuff to add:
+
+@item -T,--no-timestamps
+don't timestamp the output
+
+@item -t,--test
+Switch on any experimental features. Not for general public use.
+
+ */
+
+SCM
+set_lily_option (SCM var, SCM val)
+{
+ if (var == ly_symbol2scm ("midi-debug"))
+ {
+ midi_debug_global_b = to_boolean (val);
+ }
+ else if (var == ly_symbol2scm ("find-old-relative"))
+ {
+ /*
+ Seems to have been broken for some time!
+
+ @item -Q,--find-old-relative
+ show all changes needed to convert a file to relative octave syntax.
+
+
+
+ */
+
+ ;
+
+ }
+
+ return SCM_UNSPECIFIED;
+}
+
+
+static void
+init_functions ()
+{
+ scm_make_gsubr ("set-lily-option", 2, 0, 0, (Scheme_function_unknown)set_lily_option);
+}
+
+
+ADD_SCM_INIT_FUNC(init_functions_sopt, init_functions);
+
+
#include "translator.hh"
#include "debug.hh"
#include "translator-group.hh"
+#include "translator-def.hh"
#include "moment.hh"
#include "ly-smobs.icc"
bool
Translator::is_alias_b (String s) const
{
- return s == type_str_;
+ bool b = s == type_str_;
+
+ for (SCM a = unsmob_translator_def (definition_)->type_aliases_;
+ !b && gh_pair_p (a); a = gh_cdr (a))
+ b = b || s == ly_scm2string (gh_car (a));
+
+ return b;
}
bool
\consists "Pitch_squash_engraver";
\consists "Separating_line_group_engraver";
\name RhythmicStaff;
+ \alias "Staff";
+
Bar \override #'bar-size = #4
VoltaBracket \override #'minimum-space = #15 % urg, in \pt
VoltaBracket \override #'padding = #5 % urg, in \pt
Begin3
Title: LilyPond
-Version: 1.3.138
-Entered-date: 16MAR01
+Version: 1.3.139
+Entered-date: 17MAR01
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.138.tar.gz
+ 1000k lilypond-1.3.139.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.3.138.tar.gz
+ 1000k lilypond-1.3.139.tar.gz
Copying-policy: GPL
End
%define info yes
Name: lilypond
-Version: 1.3.138
+Version: 1.3.139
Release: 1
License: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.138.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.139.tar.gz
Summary: A program for printing sheet music.
URL: http://www.cs.uu.nl/~hanwen/lilypond
# Icon: lilypond-icon.gif
-
-
;;
;; (name . (glyph clef-position octavation))
;; -- the name clefOctavation is misleading the value 7 is 1 octave not 7 Octaves.
(debug-enable 'backtrace)
+
(define point-and-click #f)
(define security-paranoia #f)
+(define midi-debug #f)
+
+(define (line-column-location line col file)
+ "Print an input location, including column number ."
+ (string-append (number->string line) ":"
+ (number->string col) " " file " ")
+ )
+
+(define (line-location line col file)
+ "Print an input location, without column number ."
+ (string-append (number->string line) " " file)
+ )
+
+
(define default-script-alist '())
(define font-name-alist '())
(embedded-ps ((ps-scm 'volta) h w thick vert_start vert_end)))
(define (define-origin file line col)
- ; use this for column positions
- (if point-and-click
- ; ly-number->string breaks point-and-click
+ (if (procedure? point-and-click)
(string-append "\\special{src:"
- (number->string line) ":"
- (number->string col) " "
- file "}"
- ;; arg, the clueless take over the mailing list...
-; "\\special{-****-These-warnings-are-harmless-***}"
-; "\\special{-****-PLEASE-read-http://appel.lilypond.org/wiki/index.php3?PostProcessing-****}"
- )
- "")
-
- ; line numbers only:
- ;(string-append "\\special{src:" (number->string line) " " file "}")
-)
+ (point-and-click line col file)
+ "}" )
+ "")
+ )
; no-origin not yet supported by Xdvi
(define (no-origin) "")
conversions.append (((1,3,136), conv, 'ly-X-elt-property -> ly-X-grob-property'))
+if 1:
+ def conv (str):
+ str = re.sub ('point-and-click +#t', 'point-and-click line-column-location', str)
+ return str
+
+ conversions.append (((1,3,138), conv, 'point-and-click argument changed to procedure.'))
############################