it()GNU LilyPond does not display notes directly, nor will it be rehacked
to be used interactively. GNU LilyPond writes output to a file. It
will not be extended to play music, or to recognize music.
- [As an aside, I am contemplating to create a library for rendering
- music, which is "X-capable", so that others can create interactive tools]
it()GNU LilyPond is intended to run on Unix platforms, but it should
be portable to any platform which can run TeX and the GNU tools
it()GNU LilyPond is free. Commercial windows packages for setting music are
% LIME
@Article {haken93,
- note = {A description of Lime internals (which resemble older (before 0.0.68pre) LilyPond data structures somewhat) HWN},
+ note = {A description of Lime internals (which resemble older (before 0.0.68pre) LilyPond data structures) HWN},
year = {1993},
title = {The Tilia Music Representation: Extensibility, Abstraction, and Notation Contexts for the Lime Music Editor},
author = {Lippold Haken and Dorothea Blostein},
@Book {read-notation,
- note = {(Out of print) This is as close to the ``standard'' reference work for music notation issues as one is likely to get. MB},
+ note = {(Out of print) This is as close to the ``standard'' reference
+work for music notation issues as one is likely to get. MB},
title = {Music Notation: a Manual of Modern Practice},
author = {Gardner Read},
totalentry = {(2nd edition)},
publishers. This beautiful booklet was intended as an introduction
for laymen on the art of engraving. It contains a step by step,
in-depth explanation of how to cut and stamp music into zinc plates.
- It also contains some compactly formulated rules on musical
+ It also contains a few compactly formulated rules on musical
orthography. Out of print. }
}
@Booklet {mpa96,
- note = {Pamphlet explaining some fine points in music font design HWN},
+ note = {Pamphlet explaining a few fine points in music font design HWN},
year = {1996},
title = {Standard music notation specifications for computer programming.},
month = {December},
impossible to modify the score in a meaningful way.
\item Formats for various notation programs. Notation programs either
- work with binary formats (e.g., NIFF\cite{niff-web}), need specific
- platforms (e.g., Sibelius\cite{sibelius}, Score\cite{score}), are
- proprietary or non-portable tools themselves (idem), produce
- inadequate output (e.g., MUP\cite{mup}), are based on graphical
- content (e.g., MusixTeX\cite{musixtex1}), or limit themselves to
- specific subdomains (e.g., ABC\cite{abc2mtex}).
+ work with binary formats (e.g., NIFF\cite{niff-web}), need specific
+ platforms (e.g., Sibelius\cite{sibelius}), are proprietary or
+ non-portable tools themselves (idem), produce inadequate output
+ (e.g., MUP\cite{mup}), are based on graphical content (e.g.,
+ MusixTeX\cite{musixtex1}), limit themselves to specific subdomains
+ (e.g., ABC\cite{abc2mtex}), or require considerable skill and
+ knowledge to use (e.g., SCORE\cite{score})
\item SMDL\cite{smdl-web}. This is a very rich ASCII format, that is
designed for storing many types of music. Unfortunately, there is
An example of the first guideline in action is the horizontal spacing.
The amount of space following a note should reflect the duration of
that note: short notes get a small amount of space, long notes larger
-amounts. Such spacing constraints can be quite subtle, for the
+amounts. Such spacing constraints can be subtle, for the
``amount of space'' is only the impression that should be conveyed; there
has to be some correction for optical illusions. See
Figure~\ref{fig:spacing}.
\section{Context in notation}
+Music notation relies heavily on context. Notational symbols do not
+have meaning if they are not surrounded by other context elements. In
+this section we give some examples how the reader uses this context do
+derive meaning of a piece of notation. We will focus on the prime
+example of context: the staff.
+
+A staff is the grid of five horizontal lines, but it contains more components :
+\begin{itemize}
+\item A staff can have a key signature (printed at the left)
+\item A staff can have a time signature (printed at the left)
+\item A staff has bar lines
+\item A staff has a clef (printed at the left)
+\end{itemize}
+
+It is still possible to print notes without these components, but one
+cannot determine the meaning of the notes.
+\begin{mudela}
+\score{
+\notes \relative c' { \time 2/4; g'4 c,4 a'4 f4 e c d2 }
+\paper {
+ linewidth = -1.;
+ \translator {
+ \StaffContext
+ \remove "Time_signature_engraver";
+ \remove "Bar_engraver";
+ \remove "Staff_symbol_engraver";
+ \remove "Clef_engraver";
+ \remove "Key_engraver";
+ }
+ }
+}
+\end{mudela}
+
+As you can see, you can still make out the general form of the melody
+and the rhythm that is to be played, but the notation is difficult to
+read and the musical information is not complete. The stress
+pattern in the notes can't be deduced from this output. For this, we
+need a time signature. Adding barlines helps with finding the strong
+and weak beats.
+\begin{mudela}
+\score {
+ \notes \relative c' { \time 2/4; g'4 c,4 a'4 f4 e c d2 }
+ \paper{
+ linewidth = -1.;
+\translator{
+ \StaffContext
+ \remove "Staff_symbol_engraver";
+ \remove "Clef_engraver";
+ \remove "Key_engraver";}
+ }
+ }
+\end{mudela}
+
+It is impossible to deduce the exact pitch of the notes. One needs a
+clef to do so. Staff lines help the eye in determining the vertical
+position of a note wrt. to the clef.
+\begin{mudela}
+\score {
+ \notes \relative c' {\clef alto; \time 2/4; g'4 c,4 a'4 f4 e c d2 }
+ \paper {
+ linewidth = -1.;
+ }
+}
+\end{mudela}
+
+Now you know the pitch of the notes: you look at the start of the line
+and see a clef, and with this clef, you can determine the notated pitches.
+You have found the em(context) in which the notation is to be
+interpreted!
+
+
\section{Interpretation context}
+Context (clef, time signature etc.) determines the relationship
+between musical and its notation in notes. Because LilyPond writes
+notation, context works the other way around for LilyPond: with
+context a piece of music can be converted to notation.
+
+A reader remembers this context while reading the notation from left
+to right. By analogy, LilyPond constructs this context while
+constructing notes from left to right. This is what happens in the
+``Interpretation'' phase from~\ref{fig:intro-fig}. In LilyPond, the
+state of this context is a set of variables with their values; A staff
+context contains variables like
+
+\begin{itemize}
+\item current clef
+\item current time signature
+\item current key
+\end{itemize}
+
+These variables determine when and how clefs, time signatures, bar
+lines and accidentals are printed.
+
+
+Staff is not the only form of context in notation. In polyphonic
+music, the stem direction shows which notes form a voice: all notes of
+the same voice have stems pointing in the same direction. The value
+of this variable determines the appearance of the printed stems.
+
+In LilyPond ``Notation context'' is abstracted to a data structure
+that is used, constructed and modified during the interpretation
+phase. It contains context properties, and is responsible for
+creating notational elements: the staff context creates symbols for
+clefs, time signatures and key signatures. The Voice context creates
+stems, note heads.
+
+For the fragment of polyphonic music below,
+\begin{mudela}
+ \context Staff { c'4 < { \stemup c'4 } \context Voice = VB { \stemdown a4 } > }
+\end{mudela}
+A staff context is created. Within this staff context (which printed
+the clef), a Voice context is created, which prints the first note.
+Then, a second Voice context is created, with stem direction set to
+``up'', and the direction for the other is set to down. Both Voice
+contexts are still part of the same Staff context.
+
+In the same way, multiple staff scores are created: within the score
+context, multiple staff contexts are created. Every staff context
+creates the notation associated with a staff.
\section{Discussion}
\mudelafile{noteheadstyle.ly}
+Multiple measure rests do not collide with barlines and clefs. They
+are not expanded when you set Score.SkipBars
+
+\mudelafile{multi-measure-rest.ly}
+
\section{Beams, slurs and other spanners}
\section{Global stuff}
-Markings that are attached to (invisible) barlines are quite
+Markings that are attached to (invisible) barlines are
delicate: the are attached to the rest of the score without the score
-knowing it. Consequently, they fall over quite often.
+knowing it. Consequently, they fall over often.
\mudelafile{bar-scripts.ly}
will make the music as short as possible but without breaking the
line. Here is a well know harmonic progression:
\begin{mudela}[veryverbatim, intertext="produce a well known harmonic progression:"]
- <c' e' g'> <b d' g'> <c'2 e' g'>
+\context Voice { <c' e' g'> <b d' g'> <c'2 e' g'>}
\end{mudela}
If you want to place music examples in the text,
\begin{mudela}[eps]
- <c' e' g'> <b d' g'> <c'2 e' g'>
+\context Voice { <c' e' g'> <b d' g'> <c'2 e' g'>}
\end{mudela}
, you can use the \verb|eps| option. This will create the music as
eps graphics and include it into the document with the
The code used look like this:
\begin{verbatim}
\begin{mudela}[eps]
- <c' e' g'> <b d' g'> <c'2 e' g'>
+\context Voice { <c' e' g'> <b d' g'> <c'2 e' g'>}
\end{mudela}
\end{verbatim}
dur &
\begin{mudela}[eps]
-<c' e' g'>
+\context Voice {<c' e' g'>}
\end{mudela}
\\
\hline moll &
\begin{mudela}[eps]
-<c' ees' g'>
+\context Voice {<c' ees' g'>}
\end{mudela}
\\
\hline forminsket &
\begin{mudela}[eps]
-<c' es' ges'>
+\context Voice {<c' es' ges'>}
\end{mudela}
\\
\hline forstørret &
\begin{mudela}[eps]
-<c' e' gis'>
+\context Voice {<c' e' gis'>}
\end{mudela}
\\
\hline
increased between the lines where you have music printed with the
smallest font size.
-Sinse the version number is quite low, you should be careful not to
+Since the version number is low, you should be careful not to
mix braces that belongs to mudela-book and \LaTeX~on the same
line. The following code will probably break:
label(sec:firsttune)
To demonstrate what LilyPond input looks like, we start off with a
-full fledged, yet simple, example. It is somewhat convoluted version
+full fledged, yet simple, example. It is a convoluted version
of one of the menuets in bind(J.)bind(S.)Bach's em(Clavierbuchlein).
mudela(verbatim)(
)verb( a8-. b-. cis-. d-. e-. fis-. % try some super and subscripts.)COMMENT(
-)There is more to music than just pitches and rhythms. An important
+)There is more to music than pitches and rhythms. An important
aspect is articulation. You can enter articulation signs either in an
abbreviated form, by a dash and the the character for the
articulation to use, e.g. code(-.) for staccato as shown above.
\paper { }
})COMMENT(
-) we will leave out the the repetitive details for now and just print
+) we will leave out the the repetitive details for now and only print
code(XXXX).
can. As an example we give a snippet of ``Twinkle Twinkle Little
Star'' in chords. The chords may seem slightly unconventional, but
they only serve to show how chords work. We've aligned the chords in
-the input on their starting beat just to help you reading it. This
+the input on their starting beat to help you reading it. This
layout does not influence the typesetting result in any way.
mudela(verbatim, fragment)(
)COMMENT(
)
-As you can see, LilyPond has some difficulty typesetting this
+As you can see, LilyPond has difficulty typesetting this
elegantly. To adequately solve this, you have to persuade LilyPond to
make separate stems for both sequential music lists. This is a topic
that is covered in bind(Section)ref(sec:polyphonic).
A more common problem is the typesetting of chord names. LilyPond has
a special kind of staff for this, the code(ChordNames) staff.
-The code(ChordNames) staff accepts music just as a normal staff,
+The code(ChordNames) staff accepts music like a normal staff,
but typesets only the name of each chord:
COMMENT(
c''4-\tenuto )COMMENT(
) Typing a lot of staccato notes in this syntax will get tedious very
-quickly. Therefore, Mudela has some handy abbreviations for
+quickly. Therefore, Mudela has handy abbreviations for
articulation marks such as staccato and tenuto. They are shown in the
following example: COMMENT(
)mudela(fragment,verbatim)(c''4-1 g''4-5 c''-"Sul tasto" )
COMMENT(Currently, the meaning of the
-syntax `note-dash-digit/articulation/text' is just ``add a superscript to this
+syntax `note-dash-digit/articulation/text' is ``add a superscript to this
note.'' This is not in line with our goal to em (define) music with
Mudela. We hope that this will be fixed in a future version of the
language. In the meantime you can abuse this: the super- and
For example:
mudela(fragment,center,verbatim)( c'4( )c'4 )
- The slur is quite flexible: you can nest nop(slurs,)footnote(This is
+The slur is flexible: you can nest nop(slurs,)footnote(This is
inconsistent when compared to the syntax for articulation hints. This
will be fixed some time, we hope.) and you can connect a note with a
slur on both the left and the right side:
[c'8 c'16 c'8]
)
-In practice, you won't be needing this command very often: the
+In practice, you won't be needing this command often: the
grouping is switched automatically when you issue a code(\time)
command. It is set to a combination of groups
of 2 and 3 beats, with as many groups of
sect(Notation context)
COMMENT(This section is about translation contexts, a topic of LilyPond that
-is somewhat advanced. You don't have to understand this to use
+is advanced. You don't have to understand this to use
LilyPond to print simple music. If you don't want to typeset fancy
polyphonic music or tweak the LilyPond notation engine, you can skip
the next two sections.)
the concept of staff `staff symbol' from now on.
But
-there is more to a staff than just the symbol. A staff
-contains---besides a staff symbol--- some more components:
-itemize(
+there is more to a staff than the symbol. A staff
+contains---besides a staff symbol--- more components:
+COMMENT(
+
+)itemize(
it()A staff can have a key signature (printed at the left)
it()A staff can have a time signature (printed at the left)
it()A staff has bar lines
We see that a staff forms context, and that context is needed to
convert between notation and music. In LilyPond we turn around this
reasoning: LilyPond has a notion of notation context, and the staff is
-just one example of a notation context. In fact, the arguments of the
+an example of a notation context. In fact, the arguments of the
code(\context) command (Staff, GrandStaff) were all names of different
contexts. A notation context is a conversion between music and
notation.
dit(GrandStaff) A code(GrandStaff) context contains code(Staff)
contexts, and it adds a brace to the output at the
- nop(left.)footnote(The GrandStaff is quite limited, LilyPond can not
- do cross staff beaming and slurring.)
+ nop(left.)footnote(The GrandStaff is limited, LilyPond can not do
+ cross staff beaming and slurring.)
A code(GrandStaff) context can contain code(Staff)s. Typically, it
will contain two code(Staff)s, one treble staff, and one bass
label(tutorial:more-staffs)
Now we explain how to typeset music that runs in multiple staffs.
-Consider the following---somewhat unrealistic---example:
+Consider the following---unrealistic---example:
mudela(fragment)(
\context GrandStaff <e'4 {\clef bass; g4^""} >
>
)COMMENT(
-) The names that you choose do not matter just as long as they are
+) The names that you choose do not matter as long as they are
different. This is almost right, except for the brace at the left and
the clef of the second staff. If you want a brace, then you have to
-tell LilyPond that the chord you just formed is to be interpreted as a
+tell LilyPond that the chord you formed is to be interpreted as a
so-called grand staff. This is also done with the code(\context)
command. The bass clef is made with a clef command: COMMENT(
\context "Voice" = "two" { g'2 f'4 e'4 }
>)
-As you can see the result is not quite perfect. The notes on the last
+As you can see the result is not perfect. The notes on the last
two beats look like plain chords and not like separate voices. What
really happened was that the stems of the upper and lower voices were
printed on top of each other.
sect(Lyrics)
label(tutorial:lyrics)
-Since a lyrics can have durations just like notes, we consider them to
+Since a lyrics can have durations like notes, we consider them to
be music too. Entering lyrics in mudela has two aspects. First, you
have to enter the text, i.e., the syllables along with their
durations. After this, you have to specify how to convert these to
) The strings that makes up each syllable in the lyrics block are
passed along to TeX() verbatim, so if you are proficient with TeX()
-you can do various nifty things. Just keep in mind that a syllable
+you can do various nifty things. Keep in mind that a syllable
either starts with a letter (a character in the range `code(a)' to
`code(z)' or `code(A)' to `code(Z)'), or it is a string enclosed
double quotes. It ends with either a number for the duration, or a space.
sect(Toplevel Mudela)
Back in bind(Section)ref(sec:firsttune) we said we would ignore
-toplevel constructions (e.g., code(\score)) until some later moment.
+toplevel constructions (e.g., code(\score)) until a later moment.
Now we will look at these constructions.
You can also see identifiers in action within the code(\paper) block:
the value code(-1.0) is assigned to code(linewidth). Within the
code(\paper) block, identifiers are not used as abbreviation only:
-assigning to some identifiers can influence the output: in this case,
+assigning to some identifiers can influence the output: in this case,
the music line is printed at natural width.
Recall the properties of a context, that could be set with
The Urtext edition of a piece of music, is an edition that reflects
the original writing of the composer. Such editions are useful for
musicologists, and performers that want to perform authentic
-interpretations. However, for mere mortals, the Urtext can be quite
+interpretations. However, for mere mortals, the Urtext can be
hard to read. It might not contain fingering and beaming, and
typically it is full of footnotes. Moreover, common interpretations
may have emerged---after the composer died. For this reason, the
played. You may leave out the code(\alternative) part. There must not
be more alternative endings than the code(repeat-count).
-A somewhat less intuitive form may be needed for lyrics, when there are
+A less intuitive form may be needed for lyrics, when there are
a couple alternatives, but nothing is repeated. The code(\repeat) command
must be present, but it may specify an empty music list:
COMMENT(
Although we recommend to use Unix, LilyPond is known to run on Windows
NT/95/98 as well. See Section ref(w32).
-it() GNU C++ version 2.8 or newer (egcs-1.1 or newer is also fine).
+it() EGCS 1.1 or newer.
it() Python 1.5 (Strictly speaking, you shouldn't need Python for
compiling and installing, but you'll need it to regenerate the font
tables, e.g.).
nsect(CAVEATS)
itemize(
-it()The -O2 option to gcc triggers a gcc bug on DEC Alpha in dstream.cc. You
- should turn off this flag for this file.
+it()The -O2 option triggers bugs on various platforms (PowerPC, Alpha).
+ If you experience problems, you should first try turning off this.
)
nsect(EXAMPLE)
COMMENT(-*-Text-*-)
-DEFINEMACRO(Package)(0)(LilyPond) DEFINEMACRO(package)(0)(lilypond)
+
redef(XXsetchapternum)(0)()
notableofcontents()
-article(This is the toplevel README to Package())()()
+article(This is the toplevel README to LilyPond)()()
includefile(../BLURB.in)
sect(VERSIONING)
-Package() uses a versioning scheme similar to the Linux kernel. In a
+LilyPond uses a versioning scheme similar to the Linux kernel. In a
version "x.y.z", an even second number 'y' denotes a stable version.
For development versions 'y' is odd. For using straightforward score
production, please use the latest stable version. Development versions
may not produce good or nice scores.
-If you have downloaded a
-
- *.pre*
-
-version, then this is version is *not* meant for producing nice output
-(but to keep your patchsets up to date). It might not even compile.
-The same goes for a version with a 4th version number, eg
-
- 1.2.3.mypatch2
-
-It will be safer if you download 1.2.3 or wait for 1.2.4.
-
-
-
sect(REQUIREMENTS)
-For the compilation and running of Package() you need some additional
+For the compilation and running of LilyPond you need some additional
packages. Please refer to the installation instructions.
NOTE: If you downloaded a binary (.rpm or a W95/NT .zip file), then
-you don't have to compile Package().
+you don't have to compile LilyPond.
sect(INSTALLATION)
make doc
-You can also simply read the .yo sources. They are ASCII text.
+You can also simply read the file(.yo) sources. They are ASCII text.
The complete documentation is accessible in formatted form at the
website lurl(http://www.cs.uu.nl/people/hanwen/lilypond/index.html)
sect(COMMENTS)
-Package() is a long way from finished and polished. We do appreciate
+LilyPond is a long way from finished and polished. We do appreciate
criticism, comments, bugreports, patches, etc.
-
+verb(
Please send your e-mail to one of the MAILING LISTS
-
+)
and not to us personally. See file(Documentation/links.yo) for more info.
sect(WINDOWS 32)
If you have received this file as part of a DOS/Window32 distribution
-(package()-*.zip), then it is advisable to also download the source
+(LilyPond-*.zip), then it is advisable to also download the source
package, since it might contain more documentation
lurl(ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/)
-If you decide to build Package() from source, please read the INSTALL.txt
+If you decide to build LilyPond from source, please read the INSTALL.txt
document first, especially the Windows NT/95 section.
sect(CAVEATS)
-* Please read the file BUGS for some ugly bugs. This especially applies
-Linux-Intel unix users.
+* Please read the file BUGS for some ugly bugs.
* If you have installed a previous version, be sure to remove old font
files, eg
sect(CDROM DISTRIBUTIONS)
-If you have received Package() on a cdrom, chances are that development
-has moved a some patchlevels up. If possible, please check the latest
-version of Package() before reporting bugs.
+If you have received LilyPond on a cdrom, chances are that development
+has moved a some patchlevels up. Please check the latest version of
+LilyPond before reporting bugs.
of LilyPond, specifically, this page was made from LilyPond
@TOPLEVEL_VERSION@.tar.gz
+Note: the pages may have been created from an unreleased development
+version. Please have patience, all changes will appear in the
+official version.
+
nsect(Free Software)
it()url(Mailing Lists)(DOEXPAND(docdir)/DOEXPAND(outdir)/mail.html)
it()url(All of the LilyPond documentation)(DOEXPAND(docdir)/DOEXPAND(outdir)/index.html)
it()url(The DOC++ documentation of the C++ sources.)(DOEXPAND(depth)/docxx/index.html)
+it()url(The installation instructions)(DOEXPAND(tops)/INSTALL.html)
)
nsect(Sites)
+pl 41.hwn2
+ - bf: Score bar line thickness.
+ - more paper writing
+ - website tweaks.
+ - Graphical_element::dim_cache_ now alloced separately.
+ - junked Graphical_element::absgolute_offset
+ - Musique-de-Table
+ - mmrest_x_minimum now works at begin-of-line.
+ - junked Span_bar::extra_x_off
+ - \property foo.bar = \stringid + \otherstringid
+ - bf: stop on lexer errors as well.
+ - only do vertical alignment at Score level.
+ - tweaked ledger endings a bit.
+
+
+pl 41.hwn1
+ - small fixes.
+ - mudela-book.py patch (thanks MB)
+
+pl 41.mb1
+ - Added the installation instructions to the top web page.
+ - N.W.Gade: Added triangolo part, minor changes.
+
+pl 41.tca1
+ - Lookup::accordion and removed some accordionfonts
+
+***************
+
pl 40.uu2
- rest ledger lines are dimensionless.
- Score_elements are added to the Paper_score directly when
. * staff size for post/prebreaks
. * .ly files
. * input/star-spangled-banner
-. * m=\notes\relative c'''{
- \time 2/4;
-
- R2*4 | c2 | c2 | c2 | c2 | c2 | c2 | c2 | c2 | c2 | \break
- <{R2*10}{s2 \mark "A"; }> | % Too narrow space for the first rest in
-1.1.29
- r4 r8 [g16 \p ( a ] |
-[ ) g8-. fis16 ( g ][ ) fis8-. f16 ( g ] |
-[ ) f8-. e16 ( f ][ ) e8-. es16 ( f ] |
-[ ) es8 \f c16 ( d][es8 d16 c ] |
-) d4 r8 [g16 \p ( a ] |
-[ ) g8-. fis16 ( g ][ ) fis8-. f16 ( g ] | \break
-) c2 | c2 | c2 | c2 | c2 | c2 | c2 | c2 | c2 |
-}
-
-\score{
- \m
- \paper{
- \translator{
- \ScoreContext
- SkipBars = 1;
- }
- \translator {
- \OrchestralPartStaffContext
- }
- }
-}
. * midi key.
. * P.P.S. It can be cool in mudela-book to distinguish in
pre,postMudelaExample, whether MudelaExample is epsed or not: ( if
\key b; \time 4/4; looks bad. The clef and time signature are too close.
-I noticed that ledger lines in the previewer looked like they had a
-double line (of different lengths). On printed output, I think I can
-see a slight thickening of the ledger lines in the middle. Is this
-supposed to happen?
-
restStyle=mensural doesn't seem to work (lots of characters not found
for rests.fly)
. * Phrasing: Indicating the textual underlay of a piece, or
There are distinct ways of specifying the first two (although at
present, they're not properly distinguished) but no distinct way to
specify the third. Should there be?
-. * spacing of mmrests.
. * rest collision minimum dist.
. * Matanya's tips:
. * spacing for prefatory matter
So that makes for a staff space of 4 2/3 point. I'll add the
dimensions to the TODO file.
. * accidentals closer to note head
+. * to space the staffs/staffgroups contained in the score.
+
+In the orchestscore.ly file, I tried:
+\paper{
+ \translator {
+ \OrchestralScoreContext
+ minVerticalAlign = 3.0*\staffheight;
+ }
+ \translator {
+ \StaffGroupContext
+ minVerticalAlign = 3.0*\staffheight;
+ }
+ \translator {
+ \StaffContext
+ minVerticalAlign = 3.0*\staffheight;
+ }
+}
. * heavier beams?
.* Cleanups needed
. * Spring generation
. * Collision
. * Rest_collision
+. * clef grav prop's
.* TODO before 1.2
. * \selectmusic to cut pieces from music.
. * Remove mutopia ramblings.
. * Remove non-free software links.
. * Remove meta article LilyPond.
-. * generic rest ledgers
. * TODO: merge atom & molecule; make tree from molecule.
. * break priority setting from SCM.
. * Gade score
. * remove [] in favour of auto-beamer
-. * The minimum distance between different staffs works only within
- StaffGroups, not between StaffGroups. The Gade Score looks quite
- strange on the pages where the Timpani and/or Brass sections don't
- play. I've set the minimum distance with:
- \translator {
- \OrchestralScoreContext
- minVerticalAlign = 2.5*\staffheight;
- }
. * hangOnClef with non-breakable clefs.
. * Aha, the problem is the new TeX code generation for changing fonts.
> (The explanation below is mostly intended for Han-Wen and Jan)
> fontencoding OT1 is for the hyphenation mechanism to work, an
> argument that's clearly irrelevant in our application. Yet we
> see the problem for August.
-. * Check gcc 2.8.1 compatibility
. * Abstraction for engravers:
. * make "in-between" engraver (Tie, Extender)
. * make wide_spanner_engraver (line_group_spanne,r staff_symbol)
. * put errorlevel in Input class
. * junk nesting slurs
. * integrate midi-elts from mi2mu and lily?
+. * distinguish between unset and empty properties.
.* FONT
. * the bracket is ugly (wings are too parabolic, should be more circular)
. * glissando, arpeggio
. * lengthened trill
. * include important spacing dims in fetalog
+. * scalability: use blot_diameter everywhere, make font chubbier for
+ small sizes.
+
.* 3RD PARTY BUGS
. * GNU diff 2.7: diff -rN does not see a new directory with empty file
. * check out GCC signatures?
header_regex = regex.compile('\\header[ \t\n]*{\([^}]*\)}')
header_entry_regex = regex.compile('[\n\t ]*\([^\n\t ]+\)[\n\t ]*=[\n \t]*\([^;]+\)[\n \t]*;')
+headertext= r"""
+These example files are taken from the LilyPond distribution.
+LilyPond currently only outputs TeX and MIDI. The pictures and
+PostScript files were generated using TeX, Ghostscript and some
+graphics tools. The papersize used for these examples is A4.
+The images are in PNG format, and should be viewable with any current browser.
+We don't use GIFS due to <a href="http://www.gnu.org/philosophy/gif.html">patent problems</a>.
+<p>
+If you want an accurate impression of the output quality please <em>print
+out</em> the samples first.
+"""
+
+headertext_nopics = r"""This is a subdirectory of the LilyPond example
+set. We decided not to show any examples from this directory. If you
+want to view them, then you have to download LilyPond and compile them
+yourself."""
+
+
#
# FIXME breaks on multiple strings.
#
list = open(filename, 'w')
list.write ('<html><TITLE>Rendered Examples</TITLE>\n')
list.write ('<body bgcolor=white>')
- if len(subdirs):
+ if subdirs:
list.write ('<h2>subdirectories</h2>')
list.write ('<ul>')
for ex in subdirs:
list.write ('</ul>')
- list.write('<h2>Contents of this directory</h2>\n');
- list.write ("""
-These example files are taken from the LilyPond distribution.
-LilyPond currently only outputs TeX and MIDI. The pictures and
-PostScript files were generated using TeX, Ghostscript and some
-graphics tools. The papersize used for these examples is A4.
-As you know, <a href="http://www.gnu.org/philosophy/gif.html">no gifs due to patent problems</a>,
-but the PNG images should be viewable with any current browser
-<p>
-If you want an accurate impression of the output quality please <em>print
-out</em> the samples first.
- """);
+
+
+ if inputs:
+ list.write('<h2>Contents of this directory</h2>\n');
+
+ list.write (headertext)
+ else:
+ list.write (headertext_nopics)
for ex in inputs:
--- /dev/null
+
+\header {
+composer = "Georg Philipp Telemann";
+title = "Musique de Table";
+date = "1733";
+tempo = "Maestoso";
+}
+
+%{
+
+This appeared in Uijlenspieghel, the magazine of the Dutch Horn
+Society, spring issue.
+
+It is part of 3rd production of the Table Music by Telemann. It is a
+concerto for two "Tromba Selvatica" (Wood trumpets, ie. horns.) in
+E-flat.
+
+There probably are violin parts as well. (they weren't printed in
+Uijlenspieghel)
+
+
+%}
+
+
+
+
+trombaUno = \notes \relative c'' {
+c2. ~
+c4
+g c |
+e2. ~ e4 c e |
+g2. ~ g4
+f2 ~
+f4
+e2~ e4
+f2 ~ f4
+d4 e ~ |
+e8 f d4.-\trill c8
+c e e-\trill d d16 e d c |
+c4 r r |
+r8 e f f16 g e8 e16 f |
+d4 r r
+r8 d g g16 e f8 f16 d |
+e16 g g e g e d e f32 g f16 d32 e d16
+e16 g g e g e d e f32 g f16 d32 e d16 |
+e16 d c d e d e d e8 fis g4 r r |
+R2.
+R2.
+r4 d2~ d4 r r R2.
+d2. ~ d 4 g, d'
+d2. ~ d4 g, d' d2. e fis g
+a4. a8 g4 ~ g8 e fis4.-\trill g8
+g g16 a b c d4 c8 b4
+r r
+g c b -\trill c r r |
+r8 [c16 b] c8 c16 d b8 b16 c |
+a4 r r | r e2~ e4 r r | r e2~ e4 d r | r c2 ~ c4 d r R2. |
+r4 e8 e e e e4 r r
+r8 [e e-\trill d] d16 e d c| c4 r r|
+r8 e8 f f16 g e8 e16 f |
+d8 d4 f8 e16 d c e d8 d4 f8 e16 d c e
+d4 r r |
+r8 d g g16 e f8 f16 d |
+e16 g g e g e d e f32 g f16 d32 e d16 |
+e16 g g e g e d e f32 g f16 d32 e d16 |
+e16 d c d e f e d e8 d-\trill c4 r r r8 e f f16 g e8 e16 f
+d8 d4 f8 e16 d c e d8 d4 f8 e16 d c e
+d4 r r|
+c2. ~ c4 g c e2.~ e4 c e |
+g2. ~ g4 f2 ~ f4 e2~e4 f2~f2.
+r4 d e~ e8 f d4.-\trill c8
+c2 r4
+e16 g g e c e e c g c c g e4 r r c4-| e4-| g-| c,2.
+
+
+}
+
+
+trombaDue = \notes \relative c' {
+e2. ~e4 c e g2.~g4 e g8 c |
+e2. ~ e4 d2~d4 d2 c2. d4 g, g |
+r4 g8 g g g e c' c g g16 e g8 |
+e4 r r
+r8 c' d8 d16 e c8 c, | g'4 r r |
+r4 r8 g d' d16 g, |
+c16 e e c e c g c d d g, g |
+c e e c e c g c d d g, g |
+c g e g c g c g c8 d |
+d4 r r R2. R2. R2. |
+r4 d2 ~ d4 r r |
+g,2. ~ g4 d' g, | g2. ~ g4 d' g, | g2. ~ g4 c e | r d2 ~ d4 c4 e8. d16 |
+d4. d8 d4 |
+r8 e d4 d | d g fis-\trill | g r r |
+r8 [c,16 d] e f g4 f8 e4 r r |
+r8 [e16 d] e8 e16 f d8 d16 e
+c4 r r | R2. | r4 e2~e4 r r | r d2 ~ d4 c4 r4 |
+r4 d2~ d4 r r |
+r [e8 e e e] e4 r r |
+r8 [c8 c g] g16 e g8 e4 r r
+r8 c'8 d8 d16 e c8 c, g'8 g4 d'8 c16 g e c g'8 g4 d'8 c16 g e c
+g'4 r r |
+r4 r8 g d' d16 g, |
+c16 e e c e c g c d d g, g
+c e e c e c g c d d g, g |
+[c16 g e g] [c8 c16 c] [c g g32 e32 g16] |
+e4 r r | r8 c' d d16 e c8 c, g'8 g4 d'8 c16 g e c |
+g'8 g4 d'8 c16 g e c | g'4 r r |
+e2.~e4 c e | g2.~g4 e g8 c | e2.~e4 d2 ~ d4 d2 c2. d2. r4 g,4 g r g8 g g g |
+e2 r4
+c'16 e e c g c c g e g g e c4 r r c-| e-| g-| c2.
+}
+
+global = \notes {
+ \time 3/4;
+ s2.* 80
+ \bar "|.";
+}
+trbname = "Horn (E\\textflat)"
+trbnameI = \trbname + " 1 "
+trbnameII = \trbname + " 2 "
+
+\score {
+ \context GrandStaff <
+ \context Staff = one <
+ \trombaUno
+ \property Staff.instrument = \trbnameI
+ \property Staff.instr = " "
+ \global
+ >
+ \context Staff = two <
+ \property Staff.instrument = \trbnameII
+ \property Staff.instr = " "
+ \global
+ \trombaDue
+ >
+ >
+ \paper {
+ \translator {
+ \OrchestralScoreContext
+ minVerticalAlign = 2.5*\staffheight;
+ }
+ \translator {
+ \StaffContext
+ \consists Staff_margin_engraver;
+ }
+
+% castingalgorithm = \Wordwrap;
+ indent = 2. \cm;
+ }
+}
# input/test/Makefile
depth = ../..
-examples=font20 mark knee beam-interstaff slur-interstaff denneboom sleur repeat hara-kiri grace
+examples=font20 slur-interstaff sleur hara-kiri grace
LOCALSTEPMAKE_TEMPLATES=mutopia
include $(depth)/make/stepmake.make
\score{
- \context GrandStaff <
+ \context PianoStaff <
\context Staff=one \notes\relative c'{
\stemup [c8 c \translator Staff=two \stemup c c]
[c c c c]
>
\paper{
\translator{
- \GrandStaffContext
+ \PianoStaffContext
minVerticalAlign = 3.0*\staffheight;
maxVerticalAlign = 3.0*\staffheight;
}
\score {
\notes{
+
\clef "treble"; c'1^"{treble}" \bar "||";
\clef "french";c'1^"{french}" \bar "||";
\clef "soprano";c'1^"{soprano}" \bar "||";
--- /dev/null
+
+\score { \notes { \time 3/4; \key cis; R2. R2.*5 }
+ \paper {
+ \translator { \ScoreContext SkipBars = 1; }
+ linewidth = -1.;
+ }
+}
\score{
- \context GrandStaff <
+ \context PianoStaff <
\context Staff=one \notes\relative c'{
\stemup c4( c \translator Staff=two c )c |
\translator Staff=one
% no slur damping
slur_slope_damping = 10.0;
\translator{
- \GrandStaffContext
+ \PianoStaffContext
minVerticalAlign = 3.0*\staffheight;
maxVerticalAlign = 3.0*\staffheight;
}
\score {
- \notes \context PianoStaff <
-
+ \notes \context PianoStaff <
\context Staff = treble {
\property PianoStaff.instrument = "Piano "
\property Staff.instrument = "Right " { c''4 }}
\property Staff.textEmptyDimension = 1
+\property Voice.textEmptyDimension = 1
\property Staff.timeSignatureStyle = "C"
\time 1/1;
c''1^"timeSignatureStyle = \"C\""
if (center_f)
translate_axis ( - center_f, axis ());
- dim_cache_[axis ()].invalidate ();
+ dim_cache_[axis ()]->invalidate ();
}
Align_element::Align_element()
Axis_group_element::set_axes (Axis a1, Axis a2)
{
Graphical_axis_group::set_axes (a1,a2);
- dim_cache_[X_AXIS].set_empty ((a1 != X_AXIS && a2 != X_AXIS));
- dim_cache_[Y_AXIS].set_empty ((a1 != Y_AXIS && a2 != Y_AXIS));
+ dim_cache_[X_AXIS]->set_empty ((a1 != X_AXIS && a2 != X_AXIS));
+ dim_cache_[Y_AXIS]->set_empty ((a1 != Y_AXIS && a2 != Y_AXIS));
}
Bar_script_engraver::do_acknowledge_element (Item *i)
{
Axis other_axis = Axis((axis_ + 1)%2);
- if (staff_side_p_ && !staff_side_p_->dim_cache_[other_axis].parent_l_)
+ if (staff_side_p_ && !staff_side_p_->dim_cache_[other_axis]->parent_l_)
{
- staff_side_p_->dim_cache_[other_axis].parent_l_
- = &i->dim_cache_[other_axis];
- staff_side_p_->dim_cache_[axis_].parent_l_
- = &i->dim_cache_[axis_];
+ staff_side_p_->dim_cache_[other_axis]->parent_l_
+ = i->dim_cache_[other_axis];
+ staff_side_p_->dim_cache_[axis_]->parent_l_
+ = i->dim_cache_[axis_];
staff_side_p_->add_support (i);
}
if (type_str_ =="")
- dim_cache_[X_AXIS].set_empty (true);
+ dim_cache_[X_AXIS]->set_empty (true);
}
Base_span_bar_engraver::Base_span_bar_engraver()
{
spanbar_p_ =0;
- valign_l_ =0;
use_priority_b_ = true;
break_priority_i_ = 0;
}
&& dynamic_cast<Bar *> (i.elem_l_))
{
bar_l_arr_.push (dynamic_cast<Bar *> (i.elem_l_));
-
+
if (bar_l_arr_.size() >= 2 && !spanbar_p_)
/*
hmm, i do want a bracket with one staff some times, but not always
*/
{
spanbar_p_ = get_span_bar_p();
+ spanbar_p_->dim_cache_[Y_AXIS]->parent_l_ = bar_l_arr_[0]->dim_cache_[Y_AXIS];
String visnam = String(name()) + "_visibility";
spanbar_p_->set_elt_property (visibility_lambda_scm_sym,
}
else
{
- spanbar_p_->dim_cache_[X_AXIS].parent_l_ = &bar_l_arr_[0]->dim_cache_[X_AXIS];
+ spanbar_p_->dim_cache_[X_AXIS]->parent_l_ = bar_l_arr_[0]->dim_cache_[X_AXIS];
}
announce_element (Score_element_info (spanbar_p_,0));
spanbar_p_-> type_str_ = bar_l_arr_[0]->type_str_;
}
}
- else if (dynamic_cast<Axis_align_spanner *> (i.elem_l_)
- && i.origin_grav_l_arr_.size() <= 2)
- {
- valign_l_ = dynamic_cast<Axis_align_spanner *> (i.elem_l_);
- }
}
void
{
for (int i=0; i < bar_l_arr_.size() ; i++)
spanbar_p_->add_bar (bar_l_arr_[i]);
- spanbar_p_->set_align (valign_l_);
typeset_element (spanbar_p_);
spanbar_p_ =0;
}
#if 0
if (!stems_.size ())
{
- dim_cache_[Y_AXIS].parent_l_ = &s->dim_cache_[Y_AXIS];
+ dim_cache_[Y_AXIS]->parent_l_ = s->dim_cache_[Y_AXIS];
}
#endif
stems_.push (s);
void
Clef_item::do_pre_processing()
{
- dim_cache_[Y_AXIS].translate (y_position_i_ * staff_line_leading_f () / 2.0);
+ dim_cache_[Y_AXIS]->translate (y_position_i_ * staff_line_leading_f () / 2.0);
SCM style_sym =get_elt_property (style_scm_sym);
String style;
if (style_sym != SCM_BOOL_F)
if (style == "transparent")
{
set_elt_property (transparent_scm_sym, SCM_BOOL_T);
- dim_cache_[X_AXIS].set_empty (true);
+ dim_cache_[X_AXIS]->set_empty (true);
}
}
g->text_str_ = "8";
g->style_str_ = "italic";
- g->dim_cache_[Y_AXIS].parent_l_ = &dim_cache_[Y_AXIS];
- g->dim_cache_[X_AXIS].parent_l_ = &dim_cache_[X_AXIS];
+ g->dim_cache_[Y_AXIS]->parent_l_ = dim_cache_[Y_AXIS];
+ g->dim_cache_[X_AXIS]->parent_l_ = dim_cache_[X_AXIS];
add_dependency (g); // just to be sure.
Real r = do_height ()[d] - g->extent (Y_AXIS)[-d];
- g->dim_cache_[Y_AXIS].set_offset (r);
+ g->dim_cache_[Y_AXIS]->set_offset (r);
SCM my_vis = get_elt_property (visibility_lambda_scm_sym);
if (my_vis != SCM_BOOL_F)
interstaff_f_ = align->threshold_interval_[MIN];
- Dimension_cache * slur_refpoint = &slur_l->dim_cache_[Y_AXIS];
- Dimension_cache * note_refpoint = ¬e->dim_cache_[Y_AXIS];
+ Dimension_cache * slur_refpoint = slur_l->dim_cache_[Y_AXIS];
+ Dimension_cache * note_refpoint = note->dim_cache_[Y_AXIS];
while (slur_refpoint->parent_l_ != common)
slur_refpoint = slur_refpoint->parent_l_;
if (!thing)
return;
- Dimension_cache * parcache = thing->dim_cache_[Y_AXIS].parent_l_;
+ Dimension_cache * parcache = thing->dim_cache_[Y_AXIS]->parent_l_;
if (!parcache || !thing)
return ;
static G_staff_side_item *
get_g_staff_side (Item *i)
{
- Graphical_element *e1 = i->dim_cache_[Y_AXIS].parent_l_->element_l ();
+ Graphical_element *e1 = i->dim_cache_[Y_AXIS]->parent_l_->element_l ();
return dynamic_cast<G_staff_side_item*>(e1);
}
{
G_staff_side_item * ss = dynamic_cast<G_staff_side_item*>(staff_side_p_arr_[i]);
- if (!ss->dim_cache_[X_AXIS].parent_l_)
+ if (!ss->dim_cache_[X_AXIS]->parent_l_)
{
- ss->dim_cache_[X_AXIS].parent_l_ = &inf.elem_l_->dim_cache_[X_AXIS];
+ ss->dim_cache_[X_AXIS]->parent_l_ = inf.elem_l_->dim_cache_[X_AXIS];
}
ss->add_support (rh);
}
G_script::do_pre_processing ()
{
Graphical_element * e
- = staff_side_l_->dim_cache_[X_AXIS].parent_l_->element_l();
+ = staff_side_l_->dim_cache_[X_AXIS]->parent_l_->element_l();
translate_axis (e->extent (X_AXIS).center (), X_AXIS);
}
{
staff_side_l_ = g;
add_dependency (g);
- dim_cache_[Y_AXIS].parent_l_ = & g->dim_cache_[Y_AXIS];
+ dim_cache_[Y_AXIS]->parent_l_ = g->dim_cache_[Y_AXIS];
}
Molecule*
{
add_dependency (e);
to_position_l_ = e;
- to_position_l_->dim_cache_[axis_].parent_l_ = &dim_cache_[axis_];
+ to_position_l_->dim_cache_[axis_]->parent_l_ = dim_cache_[axis_];
}
void
}
}
else
- common = dim_cache_[axis_].parent_l_;
+ common = dim_cache_[axis_]->parent_l_;
if (dim.empty_b ())
{
? to_position_l_->extent (axis_)
: Interval(0,0);
- Real off = dim_cache_[axis_].relative_coordinate (common);
+ Real off = dim_cache_[axis_]->relative_coordinate (common);
SCM pad = remove_elt_property (padding_scm_sym);
if (pad != SCM_BOOL_F)
off += gh_scm2double (SCM_CDR(pad)) * dir_;
}
Real total_off = dim[dir_] - sym_dim[-dir_] + off;
- dim_cache_[axis_].set_offset (total_off);
+ dim_cache_[axis_]->set_offset (total_off);
if (fabs (total_off) > 100 CM)
programming_error ("Huh ? Improbable staff side dim.");
}
{
Axis a = axes_[i];
assert (a>=0);
- Dimension_cache * &d = e->dim_cache_[a].parent_l_;
- assert (!d || d == &dim_cache_[a]);
- d = &dim_cache_[a];
- d->dependencies_l_arr_.push (&dim_cache_[a]);
+ Dimension_cache * &d = e->dim_cache_[a]->parent_l_;
+ assert (!d || d == dim_cache_[a]);
+ d = dim_cache_[a];
+ d->dependencies_l_arr_.push (dim_cache_[a]);
}
elem_l_arr_.push (e);
for (int i=0; i< 2; i++)
{
Axis a=axes_[i];
- Dimension_cache * d = &e->dim_cache_[a];
+ Dimension_cache * d = e->dim_cache_[a];
d->parent_l_ = 0;
- d->dependencies_l_arr_.unordered_substitute (&dim_cache_[a], 0);
+ d->dependencies_l_arr_.unordered_substitute (dim_cache_[a], 0);
}
}
for (int i=0; i< 2; i++)
{
Axis a=axes_[i];
- Dimension_cache * d = &e->dim_cache_[a];
+ Dimension_cache * d = e->dim_cache_[a];
d->parent_l_ = 0;
d->dependencies_l_arr_.clear ();
}
Graphical_element::Graphical_element ()
{
+ dim_cache_[X_AXIS] = new Dimension_cache;
+ dim_cache_[Y_AXIS] = new Dimension_cache;
used_b_ = false;
init ();
}
Graphical_element::Graphical_element (Graphical_element const &s)
- : dim_cache_ (s.dim_cache_)
{
+ dim_cache_[X_AXIS] = new Dimension_cache (*s.dim_cache_[X_AXIS]);
+ dim_cache_[Y_AXIS] = new Dimension_cache (*s.dim_cache_[Y_AXIS]);
+
used_b_ = true;
init ();
}
void
Graphical_element::init ()
{
- dim_cache_[X_AXIS].elt_l_ = dim_cache_[Y_AXIS].elt_l_ = this;
+ dim_cache_[X_AXIS]->elt_l_ = dim_cache_[Y_AXIS]->elt_l_ = this;
}
Real
Graphical_element::absolute_coordinate (Axis a) const
{
- return dim_cache_[a].absolute_coordinate ();
-}
-
-
-Offset
-Graphical_element::absolute_offset() const
-{
- return Offset (absolute_coordinate (X_AXIS), absolute_coordinate (Y_AXIS));
+ return dim_cache_[a]->absolute_coordinate ();
}
-
-
void
Graphical_element::translate_axis (Real y, Axis a)
{
- dim_cache_[a].translate (y);
+ dim_cache_[a]->translate (y);
}
Real
Graphical_element::relative_coordinate (Dimension_cache*e, Axis a) const
{
- return dim_cache_[a].relative_coordinate (e);
+ return dim_cache_[a]->relative_coordinate (e);
}
Dimension_cache *
Graphical_element::common_group (Graphical_element const* s, Axis a) const
{
- return dim_cache_[a].common_group (&s->dim_cache_[a]);
+ return dim_cache_[a]->common_group (s->dim_cache_[a]);
}
void
void
Graphical_element::set_empty (bool b)
{
- dim_cache_[X_AXIS].set_empty (b);
- dim_cache_[Y_AXIS].set_empty (b);
+ dim_cache_[X_AXIS]->set_empty (b);
+ dim_cache_[Y_AXIS]->set_empty (b);
}
Interval
Graphical_element::extent (Axis a) const
{
- Dimension_cache const * d = &dim_cache_[a];
+ Dimension_cache const * d = dim_cache_[a];
if (d->empty_b ())
return Interval ();
void
Graphical_element::invalidate_cache (Axis a)
{
- dim_cache_[a].invalidate ();
+ dim_cache_[a]->invalidate ();
}
Graphical_element*
Graphical_element::parent_l (Axis a) const
{
- Dimension_cache*d= dim_cache_[a].parent_l_;
+ Dimension_cache*d= dim_cache_[a]->parent_l_;
return d ? d->elt_l_ : 0;
}
Graphical_element::~Graphical_element ()
{
+ delete dim_cache_[X_AXIS];
+ delete dim_cache_[Y_AXIS];
}
Dimension_cache *
Graphical_element::common_group (Link_array<Graphical_element> gs, Axis a) const
{
- Dimension_cache * common = &dim_cache_[a];
+ Dimension_cache * common = dim_cache_[a];
for (int i=0; i < gs.size (); i++)
{
- common = common->common_group (&gs[i]->dim_cache_[a]);
+ common = common->common_group (gs[i]->dim_cache_[a]);
}
return common;
/**
Make bars that span multiple "staffs". Catch bars, and span a
- Span_bar over them if we find more than 2 bars
+ Span_bar over them if we find more than 2 bars. Vertical alignment
+ of staffs changes the appearance of spanbars. It is up to the
+ aligner (Vertical_align_engraver, in this case, to add extra
+ dependencies to the spanbars.
*/
class Base_span_bar_engraver : public Engraver
{
Span_bar * spanbar_p_;
Array<Bar*> bar_l_arr_;
- Axis_align_spanner * valign_l_;
+
public:
VIRTUAL_COPY_CONS(Translator);
{
void init ();
public:
- Dimension_cache dim_cache_[NO_AXES];
+ Dimension_cache *dim_cache_[NO_AXES];
/**
Set this if anyone points to me, or if I point to anyone.
Interval extent (Axis) const;
/**
- translate the symbol. The symbol does not have to be created yet.
+ translate the symbol.
*/
void translate (Offset);
/**
void translate_axis (Real, Axis);
Real relative_coordinate (Dimension_cache*group, Axis) const;
- Offset absolute_offset() const;
Real absolute_coordinate (Axis) const;
/**
Find the group-element which has both #this# and #s#
Link_array<Score_element> spanning_l_arr_;
Interval get_spanned_interval () const;
public:
- Real extra_x_off_;
Span_bar();
VIRTUAL_COPY_CONS(Score_element);
void set_align (Align_element *);
protected:
void evaluate_empty ();
+
virtual Interval do_width() const;
virtual void do_pre_processing();
virtual void do_post_processing();
Ineq_constrained_qp::print() const
{
#ifndef NPRINT
+ DOUT << "Ineq_constrained_qp { " << '\n';
DOUT << "Quad " << quad_;
DOUT << "lin " << lin_ << '\n'
<< "const " << const_term_<< '\n';
DOUT << "constraint["<<i<<"]: " << cons_[i] << " >= " << consrhs_[i];
DOUT << '\n';
}
+ DOUT << "}\n";
#endif
}
Item * broken_self = find_prebroken_piece (d);
Item * broken_parent = parent->find_prebroken_piece (d);
- broken_self->dim_cache_[X_AXIS].parent_l_ =
- &broken_parent->dim_cache_[X_AXIS];
+ broken_self->dim_cache_[X_AXIS]->parent_l_ =
+ broken_parent->dim_cache_[X_AXIS];
/*
ugh. Should do this is after breaking?
programming_error ("Vertical refpoint lost!");
else if (yparenti)
{
- broken_self->dim_cache_[Y_AXIS].parent_l_ =
- &broken_yparent->dim_cache_[Y_AXIS];
+ broken_self->dim_cache_[Y_AXIS]->parent_l_ =
+ broken_yparent->dim_cache_[Y_AXIS];
}
}
}
Lookup::simple_bar (String type, Real h) const
{
SCM thick = ly_symbol ("barthick_" + type);
- Real w = 0.1 PT;
+ Real w = 0.0;
+
if (paper_l_->scope_p_->elem_b (thick))
{
w = paper_l_->get_realvar (thick);
}
-
+ else
+ {
+ programming_error ("No bar thickness set ! ");
+ w = 1 PT;
+ }
return filledbox (Box (Interval(0,w), Interval(-h/2, h/2)));
}
Lookup::accordion (SCM s) const
{
Molecule m;
-
- /*
- Tom: go ahead.
- */
- return m;
-
+ String sym = ly_scm2string(SCM_CAR(s));
+ String reg = ly_scm2string(SCM_CAR(SCM_CDR(s)));
+ Real interline_f = paper_l_->get_realvar(interline_scm_sym);
+ if (sym == "Discant")
+ {
+ Molecule r = afm_find("scripts-accDiscant");
+ m.add_molecule(r);
+ if (reg.left_str(1) == "F")
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(interline_f * 2.5 PT, Y_AXIS);
+ m.add_molecule(d);
+ reg = reg.right_str(reg.length_i()-1);
+ }
+ int eflag = 0x00;
+ if (reg.left_str(3) == "EEE")
+ {
+ eflag = 0x07;
+ reg = reg.right_str(reg.length_i()-3);
+ }
+ else if (reg.left_str(2) == "EE")
+ {
+ eflag = 0x05;
+ reg = reg.right_str(reg.length_i()-2);
+ }
+ else if (reg.left_str(2) == "Eh")
+ {
+ eflag = 0x04;
+ reg = reg.right_str(reg.length_i()-2);
+ }
+ else if (reg.left_str(1) == "E")
+ {
+ eflag = 0x02;
+ reg = reg.right_str(reg.length_i()-1);
+ }
+ if (eflag & 0x02)
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
+ m.add_molecule(d);
+ }
+ if (eflag & 0x04)
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
+ d.translate_axis(0.8 * interline_f PT, X_AXIS);
+ m.add_molecule(d);
+ }
+ if (eflag & 0x01)
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
+ d.translate_axis(-0.8 * interline_f PT, X_AXIS);
+ m.add_molecule(d);
+ }
+ if (reg.left_str(2) == "SS")
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(0.5 * interline_f PT, Y_AXIS);
+ d.translate_axis(0.4 * interline_f PT, X_AXIS);
+ m.add_molecule(d);
+ d.translate_axis(-0.8 * interline_f PT, X_AXIS);
+ m.add_molecule(d);
+ reg = reg.right_str(reg.length_i()-2);
+ }
+ if (reg.left_str(1) == "S")
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(0.5 * interline_f PT, Y_AXIS);
+ m.add_molecule(d);
+ reg = reg.right_str(reg.length_i()-1);
+ }
+ }
+ else if (sym == "Freebase")
+ {
+ Molecule r = afm_find("scripts-accFreebase");
+ m.add_molecule(r);
+ if (reg.left_str(1) == "F")
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
+ m.add_molecule(d);
+ reg = reg.right_str(reg.length_i()-1);
+ }
+ if (reg == "E")
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(interline_f * 0.5 PT, Y_AXIS);
+ m.add_molecule(d);
+ }
+ }
+ else if (sym == "Bayanbase")
+ {
+ Molecule r = afm_find("scripts-accBayanbase");
+ m.add_molecule(r);
+ if (reg.left_str(1) == "T")
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(interline_f * 2.5 PT, Y_AXIS);
+ m.add_molecule(d);
+ reg = reg.right_str(reg.length_i()-1);
+ }
+ /* include 4' reed just for completeness. You don't want to use this. */
+ if (reg.left_str(1) == "F")
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
+ m.add_molecule(d);
+ reg = reg.right_str(reg.length_i()-1);
+ }
+ if (reg.left_str(2) == "EE")
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(interline_f * 0.5 PT, Y_AXIS);
+ d.translate_axis(0.4 * interline_f PT, X_AXIS);
+ m.add_molecule(d);
+ d.translate_axis(-0.8 * interline_f PT, X_AXIS);
+ m.add_molecule(d);
+ reg = reg.right_str(reg.length_i()-2);
+ }
+ if (reg.left_str(1) == "E")
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(interline_f * 0.5 PT, Y_AXIS);
+ m.add_molecule(d);
+ reg = reg.right_str(reg.length_i()-1);
+ }
+ }
+ else if (sym == "Stdbase")
+ {
+ Molecule r = afm_find("scripts-accStdbase");
+ m.add_molecule(r);
+ if (reg.left_str(1) == "T")
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(interline_f * 3.5 PT, Y_AXIS);
+ m.add_molecule(d);
+ reg = reg.right_str(reg.length_i()-1);
+ }
+ if (reg.left_str(1) == "F")
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(interline_f * 2.5 PT, Y_AXIS);
+ m.add_molecule(d);
+ reg = reg.right_str(reg.length_i()-1);
+ }
+ if (reg.left_str(1) == "M")
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(interline_f * 2 PT, Y_AXIS);
+ d.translate_axis(interline_f PT, X_AXIS);
+ m.add_molecule(d);
+ reg = reg.right_str(reg.length_i()-1);
+ }
+ if (reg.left_str(1) == "E")
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(interline_f * 1.5 PT, Y_AXIS);
+ m.add_molecule(d);
+ reg = reg.right_str(reg.length_i()-1);
+ }
+ if (reg.left_str(1) == "S")
+ {
+ Molecule d = afm_find("scripts-accDot");
+ d.translate_axis(interline_f * 0.5 PT, Y_AXIS);
+ m.add_molecule(d);
+ reg = reg.right_str(reg.length_i()-1);
+ }
+ }
+ /* ugh maybe try to use regular font for S.B. and B.B and only use one font
+ for the rectangle */
+ else if (sym == "SB")
+ {
+ Molecule r = afm_find("scripts-accSB");
+ m.add_molecule(r);
+ }
+ else if (sym == "BB")
+ {
+ Molecule r = afm_find("scripts-accBB");
+ m.add_molecule(r);
+ }
+ else if (sym == "OldEE")
+ {
+ Molecule r = afm_find("scripts-accOldEE");
+ m.add_molecule(r);
+ }
+ else if (sym == "OldEES")
+ {
+ Molecule r = afm_find("scripts-accOldEES");
+ m.add_molecule(r);
+ }
+ return m;
}
}
inclusion_global_array = lexer_p_->filename_str_arr_;
+
+ error_level_i_ = error_level_i_ | lexer_p_->errorlevel_i_; // ugh naming.
}
void
;
scalar:
- STRING { $$ = new Scalar (*$1); delete $1; }
+ string { $$ = new Scalar (*$1); delete $1; }
| int { $$ = new Scalar ($1); }
;
}
+
Score_element::dim_cache_callback (Dimension_cache*c)
{
Score_element * e =dynamic_cast<Score_element*>( c->element_l());
- if(&e->dim_cache_[X_AXIS] == c)
+ if(e->dim_cache_[X_AXIS] == c)
return e->do_width ();
else
return e->do_height ();
Score_element::Score_element()
{
output_p_ =0;
- dim_cache_[X_AXIS].set_callback (dim_cache_callback);
- dim_cache_[Y_AXIS].set_callback (dim_cache_callback);
+ dim_cache_[X_AXIS]->set_callback (dim_cache_callback);
+ dim_cache_[Y_AXIS]->set_callback (dim_cache_callback);
used_b_ = false;
pscore_l_=0;
lookup_l_ =0;
delete output_p_;
output_p_ = do_brew_molecule_p ();
+ Offset o (absolute_coordinate (X_AXIS), absolute_coordinate (Y_AXIS));
+
pscore_l_->outputter_l_->output_molecule (output_p_,
- absolute_offset (),
+ o,
classname(this));
pscore_l_->schedule_for_delete (this);
musical_column_l_->add_element(item_p);
}
}
- if (!elem_p->dim_cache_[Y_AXIS].parent_l_)
+ if (!elem_p->dim_cache_[Y_AXIS]->parent_l_)
scoreline_l_->add_element (elem_p);
}
elem_p_arr_.clear();
{
if (Item * item_l = dynamic_cast <Item *> (inf.elem_l_))
{
- Dimension_cache * c = &item_l->dim_cache_[X_AXIS];
+ Dimension_cache * c = item_l->dim_cache_[X_AXIS];
if (c->empty_b () || c->parent_l_)
return;
Interval iv (il->extent (X_AXIS));
if (!iv.empty_b ())
{
- Real off = il->relative_coordinate (&pc->dim_cache_[X_AXIS], X_AXIS);
+ Real off = il->relative_coordinate (pc->dim_cache_[X_AXIS], X_AXIS);
w.unite (iv + off);
}
}
spanning_l_arr_.unordered_substitute (o, n);
}
-void
-Span_bar::set_align (Align_element *a)
-{
- add_dependency (a);
- Score_element * e = dynamic_cast<Score_element*>(a);
- Item * i = dynamic_cast<Item*> (e);
- e = dynamic_cast<Score_element*> (a);
- i = dynamic_cast<Item*>(e);
-}
Interval
Span_bar::do_width () const
Bar::do_pre_processing ();
evaluate_empty ();
- translate_axis (extra_x_off_, X_AXIS);
- dim_cache_[Y_AXIS].set_empty (false); // a hack to make mark scripts work.
+ dim_cache_[Y_AXIS]->set_empty (false); // a hack to make mark scripts work.
}
void
Dimension_cache*common =
common_group (spanning_l_arr_[i], Y_AXIS);
- Real y = spanning_l_arr_[i]->dim_cache_[Y_AXIS].relative_coordinate (common)
- -dim_cache_[Y_AXIS].relative_coordinate (common);
+ Real y = spanning_l_arr_[i]->dim_cache_[Y_AXIS]->relative_coordinate (common)
+ -dim_cache_[Y_AXIS]->relative_coordinate (common);
y_int.unite (y + spanning_l_arr_[i]->extent(Y_AXIS));
}
}
else
{
- warning("Huh? My children deflated (FIXME)");
+ programming_error("Huh? My children deflated (FIXME)");
}
return output;
}
Span_bar::Span_bar ()
{
type_str_ = "";
- extra_x_off_ = 0.0;
}
Piano_bar_engraver::get_span_bar_p () const
{
Span_bar *s= new Span_bar;
- s->dim_cache_[X_AXIS].set_empty (true);
+ s->dim_cache_[X_AXIS]->set_empty (true);
s->type_str_ = "{";
return s;
}
Staff_group_bar_engraver::get_span_bar_p () const
{
Span_bar *s= new Span_bar;
- s->dim_cache_[X_AXIS].set_empty (true);
+ s->dim_cache_[X_AXIS]->set_empty (true);
s->type_str_ = "[";
return s;
}
if (Span_bar * b = dynamic_cast<Span_bar *> (i.elem_l_))
{
if (b->type_str_ == "{")
- b->extra_x_off_ -= paper_l ()->get_realvar (interline_scm_sym); // ugh
+ b->translate_axis ( -paper_l ()->get_realvar (interline_scm_sym),
+ X_AXIS); // ugh
}
}
output_p_ = do_brew_molecule_p ();
Offset left_off (spanned_drul_[LEFT]->absolute_coordinate(X_AXIS), 0);
- Offset o = absolute_offset() + left_off;
+ Offset o (absolute_coordinate (X_AXIS), absolute_coordinate (Y_AXIS));
+ o += left_off;
pscore_l_->outputter_l_->output_molecule (output_p_, o, classname (this));
}
interstaff_f_ = align->threshold_interval_[MIN] / internote_f;
- Dimension_cache * beam_refpoint = &beam_l->dim_cache_[Y_AXIS];
- Dimension_cache * stem_refpoint = &stem_l_->dim_cache_[Y_AXIS];
+ Dimension_cache * beam_refpoint = beam_l->dim_cache_[Y_AXIS];
+ Dimension_cache * stem_refpoint = stem_l_->dim_cache_[Y_AXIS];
while (beam_refpoint->parent_l_ != common)
beam_refpoint = beam_refpoint->parent_l_;
Scalar empty = get_property ("textEmptyDimension", 0);
if (empty.to_bool ())
{
- text->dim_cache_[X_AXIS].set_empty (true);
+ text->dim_cache_[X_AXIS]->set_empty (true);
}
announce_element (Score_element_info (text, r));
#include "vertical-align-engraver.hh"
#include "axis-align-spanner.hh"
#include "axis-group-spanner.hh"
+#include "span-bar.hh"
Vertical_align_engraver::Vertical_align_engraver()
{
Translator * t = i.origin_grav_l_arr_[0];
int sz = i.origin_grav_l_arr_.size() ;
+#if 0
return (sz == 1 && dynamic_cast<Translator_group*> (t))
|| (sz == 2 && dynamic_cast<Axis_group_engraver*> (t));
+#endif
+
+ Axis_group_element * elt = dynamic_cast<Axis_group_element *> (i.elem_l_);
+
+ return sz > 1 && elt && elt->axes_[0] == Y_AXIS && !elt->parent_l (Y_AXIS);
}
void
{
valign_p_->add_element (i.elem_l_);
}
+ else if (dynamic_cast<Span_bar*>(i.elem_l_) && i.origin_grav_l_arr_.size ())
+ {
+ i.elem_l_->add_dependency (valign_p_);
+ }
}
\translator {
\type "Engraver_group_engraver";
\name ChoirStaff;
- \consists "Vertical_align_engraver";
alignmentReference = \center;
\consists "Staff_group_bar_engraver";
\consistsend "Axis_group_engraver";
\type "Engraver_group_engraver";
\name GrandStaff;
\consists "Span_bar_engraver";
- \consists "Vertical_align_engraver";
\consists "Piano_bar_engraver";
- alignmentReference = \center;
- minVerticalAlign = 1.5*\staffheight;
- \consistsend "Axis_group_engraver";
+
\accepts "Staff";
};
\translator{\GrandStaffContext}
PianoStaffContext = \translator{\GrandStaffContext
+ alignmentReference = \center;
+
+ \consists "Vertical_align_engraver";
minVerticalAlign = 3.0*\staffheight;
maxVerticalAlign = 3.0*\staffheight;
+% \consistsend "Axis_group_engraver";
\name "PianoStaff";
};
StaffGroupContext= \translator {
\type "Engraver_group_engraver";
\consists "Span_bar_engraver";
- \consists "Vertical_align_engraver";
- alignmentReference = \center;
+
\consists "Staff_group_bar_engraver";
\name StaffGroup;
\translator {
\type "Engraver_group_engraver";
\name Lyrics;
- \consists "Vertical_align_engraver";
\consistsend "Axis_group_engraver";
\accepts "LyricVoice";
ChordNameContext = \translator {
\type "Engraver_group_engraver";
\name ChordNames;
- \consists "Vertical_align_engraver";
\accepts "ChordNameVoice";
\consistsend "Axis_group_engraver";
};
% Toplevel initialisation file.
-\version "1.0.15";
+\version "1.0.16";
\include "declarations.ly"
}
\paper {
linewidth=-1.0;
+ indent = 0.0;
}
\midi{ }
}
bar_thinkern = 3.0 * \staffline;
barthick_thick = 6.0* \staffline;
barthick_thin = 1.6*\staffline;
+barthick_score = 1.6*\staffline;
tuplet_thick = 1.0*\staffline;
volta_thick = 1.6*\staffline;
enddef;
-save uitsteek;
- uitsteek = .25;
-def draw_ledger(expr wid)=
- set_char_box(uitsteek * wid, (1+ uitsteek)*wid,
- ledgerlinethickness#/2,ledgerlinethickness#/2);
- pickup pencircle scaled ledgerlinethickness;
- rt x2 = w;
- lft x1 = -b;
- y1 = y2 = 0;
- draw z1 .. z2;
-enddef;
fet_beginchar("Ledger ending", "ledgerending", "ledgerending")
set_char_box (5/2 ledgerlinethickness#, 5/2 ledgerlinethickness#,
ledgerlinethickness#/2,ledgerlinethickness#/2);
- pickup pencircle scaled ledgerlinethickness;
- lft x1 = -b ;
+ pickup pencircle scaled 1.3 blot_diameter;
+
rt x2 = w;
- y1 =0; y2 =0;
- draw z1 .. z2;
+ lft x1 = -b;
+ x3 = x2;
+ bot y1 = -d;
+ y2 = y1;
+
+ top y3 = h;
+ y4 = y3;
+ x4 = x1;
+
+ filldraw z1 --- z2 --- z3 --- z4 --- cycle ;
fet_endchar;
fet_beginchar("Brevis notehead", "-1", "brevishead")
fi
mode_setup;
-
+%
input feta-macros;
input feta-klef;
input feta-timesig;
else:
-% input feta-bolletjes;
+ input feta-bolletjes;
% input feta-banier;
- input feta-eindelijk;
+% input feta-eindelijk;
% input feta-klef;
% input feta-toevallig;
% input feta-schrift;
--- /dev/null
+% feta-test16
+% part of LilyPond's pretty-but-neat music font
+
+input feta-autometric;
+fet_beginfont("feta-test", 16);
+staffsize#:=11pt#;
+test:=1;
+
+% smoked cheese
+% test := -1;
+
+
+% dem piksels.
+%test := 1;
+
+input feta-generic;
+
+fet_endfont("feta");
+
+end.
+
--- /dev/null
+% feta-test16
+% part of LilyPond's pretty-but-neat music font
+
+input feta-autometric;
+fet_beginfont("feta-test", 16);
+staffsize#:=26pt#;
+test:=1;
+
+% smoked cheese
+% test := -1;
+
+
+% dem piksels.
+%test := 1;
+
+input feta-generic;
+
+fet_endfont("feta");
+
+end.
+
-
#empty
+
+export TEXPICTS:=$(outdir)$(PATHSEP)$(TEXPICTS)