This file lists authors of GNU LilyPond, and what they wrote. This
list is alphabetically ordered.
- * Tom Cato Amundsen <tca@gnu.org>, cembalo-partita in mudela,
- accordion symbols, some mudela-book.py
+ * Tom Cato Amundsen <tca@gnu.org>, cembalo-partita in lilypond,
+ accordion symbols, some lilypond-book.py
* Mats Bengtsson <matsb@s3.kth.se>,
`http://www.s3.kth.se/~matsb/' lots of testing, fixes, general
* Jeffrey B. Reed <daboys@austin.rr.com>, Windows-NT support.
- * Shay Rojanski Some mudela source.
+ * Shay Rojanski Some lilypond input.
* August S.Sigov <august@infran.ru> Russian translation
* Cross compilation and info build fixes, really cancel all builtin
rules, sigh.
-1.3.106.jcn1
-============
-
* Generated documentation fixes: Generate all interface descriptions,
separately, don't list non-set interface properties with element
descriptions.
+1.3.106.hwn1
+============
+
+* Deprecate `mudela' name: rename mudela to lilypond globally.
+
+* construct Music_iterators decentrally.
+
+* Make smob of Duration
+
+* Make smob of Musical_pitch.
+
+* Move Repeated_music members into SCM. Length is computed via a SCM
+function. (todo: write SCM function to unfold all repeats. \apply for
+\midi)
+
+* Remove Time_signature_change_req, \time is disguise for \property
+Score.timeSignatureFraction = ...
+
+* \property barCheckNoSynchronize: don't reset measurePosition when
+finding a bbarcheck. This makes bar-checks for polyphonic music
+easier.
+
+* elt property full-size-change for clefs.
+
+* Bugfix: use Stem::dim_callback (), so brew_molecule () is not called
+too early.
+
+* Bugfix: use extent of Note_head (iso. Note_column) for rest
+collisions, so Stem::brew_molecule() is not called too early.
1.3.105.jcn1
============
NAME = documentation
SUBDIRS=user bibliography pictures topdocs ntweb misc
STEPMAKE_TEMPLATES=documentation texinfo tex
-LOCALSTEPMAKE_TEMPLATES=lilypond mudela
+LOCALSTEPMAKE_TEMPLATES=lilypond ly
README_TOP_FILES=NEWS DEDICATION CHANGES
EXTRA_DIST_FILES=
EXTRA_DIST_FILES= $(BIB_FILES)
STEPMAKE_TEMPLATES=tex documentation
-LOCALSTEPMAKE_TEMPLATES=lilypond mudela
+LOCALSTEPMAKE_TEMPLATES=lilypond ly
export BIBINPUTS:=$(shell pwd)//$(PATHSEP)$(BIBINPUTS)
include $(depth)/make/stepmake.make
@menu
* LilyPond internals::
* Overview::
-* mudela::
* Request_engraver::
* Backend::
* Coding standards::
@menu
* Overview:: Overview
-* mudela:: mudela
* Request_engraver:: Request_engraver
@end menu
@chapter LilyPond internals
-This documents some aspects of the internals of GNU LilyPond. Some of
-this stuff comes from e-mail I wrote, some from e-mail others wrote,
-some are large comments taken away from the headers. This page may be a
-little incoherent. Unfortunately, it is also quite outdated. A more
-thorough and understandable document is in the works.
-
-You should use @code{doc++} to take a peek at the sources.
-
-@node Overview, mudela, Top, Top
+@node Overview, , , Top
@section Overview
-GNU LilyPond is a "multi-pass" system. The different passes have been
-created so that they do not depend on each other. In a later stage
-some parts may be moved into libraries, or seperate programs, or they
-might be integrated in larger systems.
+GNU LilyPond is a "multi-pass" system.
@table @samp
@end table
-@node mudela, Request_engraver, Overview, Top
-@section mudela
-
-[FIXME: implementation has been generalised, so this is out of date]
-
-Most information is stored in the form of a request. In music
-typesetting, the user might want to cram a lot more symbols on the
-paper than actually fits. To reflect this idea (the user asks more
-than we can do), the container for this data is called Request.
-
-In a lot of other formats this would be called an 'Event'
-
-@table @samp
-@item @code{Barcheck_req}
- Checks during music processing if start of this voice element
- coincides with the start of a measure. Handy to check if you left out
- some voice elts.
-@item @code{Note_req}
- LilyPond has to decide if the ball should be hanging left or
- right. This influences the horizontal dimensions of a column, and this
- is why request processing should be done before horizontal spacing.
- Other voices' frivolities may cause the need for accidentals, so this
- is also for the to decide. The engraver can decide on positioning based on
- ottava commands and the appropriate clef.
-@item @code{Rest_req}
- Typeset a rest.
-@item @code{Span_req}
- This type of request typically results in the creation of a @code{Spanner}
-@item @code{Beam_req}
- Start/stop a beam.
- Engraver has to combine this request with the stem_request, since the
- number of flags that a stem wants to carry will determine the
- number of beams.
-@item @code{Dynamic}
- Each dynamic is bound to one note (a crescendo spanning multiple
- notes is thought to be made of two "dynamics": a start and a stop).
- Dynamic changes can occur in a smaller time than the length of its
- note, therefore each @code{Dynamic} request carries a time, measured
- from the start of its note.
-@end table
-@node Request_engraver, , mudela, Top
+@node Request_engraver, , , Top
@section Request_engraver
In the previous section the idea of Request has been explained, but
@end menu
-@node Graphic elements, , , Backend
+@node Graphic elements, , , Backend
+@unnumberedsubsec
Music notation is composed of a sets of interrelated glyphs. In
Lilypond every glyph usually is represented by one object, a so-called
union of its children.
@node Position and width Callbacks, , , Backend
+@unnumberedsubsec
The positions are, as explained relative to a parent reference
point. Most positions are not known when an object is created, so these
"empty in this direction".
@node Score_element properties, , , Backend
+@unnumberedsubsec
Score elements can have other properties besides positioning, for
example, text strings (for text objects) style settings, glyphs, padding
-@node Score elements, , , Backend
+@node Score elements, , , Backend
+@unnumberedsubsec
[FIXME: we want to get rid of dependencies in the implementation.]
such a clear distinction between the two. Right now, Score_elements are
always either Item or either Spanner.
-@node Coding standards, , , Top
+@node Coding standards, , , Top
@chapter CodingStyle - standards while programming for GNU LilyPond
Use them.
-@node Making patches, , , Top
+@node Making patches, , , Top
@unnumberedsec Track and distribute your code changes
@end example
-@node Localisation, , , Top
+@node Localisation, , , Top
@chapter Localisation - User messages in LilyPond
@example
char const* messages[] = @{
_i ("enable debugging output"),
- _i ("ignore mudela version"),
+ _i ("ignore lilypond version"),
0
@};
@item LilyPond @uref{../user/out-www/lilypond-internals/lilypond-internals.html,internals}
@item @uref{../user/out-www/glossary.html,A glossary of musical
terms}, includes translations. Also available in @uref{../user/out-www/glossary.ps.gz,Postscript})
-@item @uref{../user/out-www/mudela-book.html,mudela-book}, a tool for
+@item @uref{../user/out-www/lilypond-book.html,lilypond-book}, a tool for
integrating text and music in LaTeX and texinfo; also available in
-@uref{../user/out-www/mudela-book.ps.gz,Postscript}
+@uref{../user/out-www/lilypond-book.ps.gz,Postscript}
@item @uref{../user/out-www/ly2dvi.html,ly2dvi} does page layout for
LilyPond printout.
@item @uref{../user/out-www/midi2ly.html,midi2ly}
next to the top of the rest. All rests except the whole rest are
centered on the middle staff line.
-@mudelafile{rest.ly}
+@lilypondfile{rest.ly}
Note head shapes are settable. The stem endings should be adjusted
per note head. If you want different note head styles on one stem,
dimensions. Nevertheless, noteheads in both styles can be combined, on
either up or down stems.
-@mudelafile{noteheadstyle.ly}
+@lilypondfile{noteheadstyle.ly}
Noteheads can have dots, and rests can too. Augmentation dots should
never be printed on a staff line, but rather be shifted vertically. They
shifted dots. (Wanske p. 186) In case of chords, all dots should be in
a column. The dots go along as rests are shifted to avoid collisions.
-@mudelafile{dots.ly}
+@lilypondfile{dots.ly}
Accidentals work: the second note does not get a sharp. The third and
fourth show forced and courtesy accidentals
-@mudelafile{accidental.ly}
+@lilypondfile{accidental.ly}
Multiple measure rests do not collide with barlines and clefs. They
are not expanded when you set @code{Score.skipBars}. Although the
colliding from barlines.
-@mudelafile{multi-measure-rest.ly}
+@lilypondfile{multi-measure-rest.ly}
If @code{Score.skipBars} is set,
the signs for four, two, and one measure rest are combined to
produce the graphical representation of rests for up to 10 bars.
The number of bars will be written above the sign.
-@mudelafile{mm-rests2.ly}
+@lilypondfile{mm-rests2.ly}
A sharp sign after a double sharp sign, as well as a flat sign
after a double flat sign is automatically prepended with a
natural sign.
-@mudelafile{accidental-single-double.ly}
+@lilypondfile{accidental-single-double.ly}
@section Stems
to the beam. If the stem is invisible (eg. on a whole note), the
tremolo must be centered on the note.
-@mudelafile{stem-tremolo.ly}
+@lilypondfile{stem-tremolo.ly}
Chord tremolos look like beams, but are a kind of repeat symbol.
To avoid confusion, chord tremolo beams do not reach the stems, but
as half notes cannot appear in a regular beam, and should reach the
stems.
-@mudelafile{chord-tremolo.ly}
+@lilypondfile{chord-tremolo.ly}
Beams, stems and noteheads often have communication troubles, since
the two systems for y dimensions (1 unit = staffspace, 1 unit = 1
on the middle staff line. Of course stem-direction is down for high
notes, and up for low notes.
-@mudelafile{stem-direction.ly}
+@lilypondfile{stem-direction.ly}
Similarly, if @code{stem_default_neutral_direction} is set to @code{-1}.
-@mudelafile{stem-direction-down.ly}
+@lilypondfile{stem-direction-down.ly}
@section Scripts
The staccato dot (and all scripts with follow-into-staff set), must
not be on staff lines.
-@mudelafile{staccato-pos.ly}
+@lilypondfile{staccato-pos.ly}
Dynamics appear below or above the staff. If multiple dynamics are
linked with (de)crescendi, they should be on the same line.
-@mudelafile{dyn-line.ly}
+@lilypondfile{dyn-line.ly}
Arpeggios are supported, both cross-staff and one-staff.
-@mudelafile{arpeggio.ly}
+@lilypondfile{arpeggio.ly}
from guile. For some unlogical names, guile customisation is used
by default.
-@mudelafile{chord-names.ly}
+@lilypondfile{chord-names.ly}
@section Grace notes
Grace notes without beams should have a slash, if @code{flagStyle} is
not set. Main note scripts don't end up on the grace note.
-@mudelafile{grace.ly}
+@lilypondfile{grace.ly}
@section Beams, slurs and other spanners
case, line breaks are forbidden. Yet clef and key signatures are
hidden just as with breakable bar lines.
-@mudelafile{beaming.ly}
+@lilypondfile{beaming.ly}
Beams should behave reasonably well, even under extreme circumstances.
Stems may be short, but noteheads should never touch the beam.
-@mudelafile{beam-extreme.ly}
+@lilypondfile{beam-extreme.ly}
Beams should always reach the middle staff line. The second beam
counting from the note head side, should never be lower than the
second staff line. This does not hold for grace note beams.
Override with @code{noStemExtend}.
-@mudelafile{beam-position.ly}
+@lilypondfile{beam-position.ly}
Slurs should look nice and symmetric. The curvature may increase
only to avoid noteheads, and as little as possible. Slurs never
run through noteheads or stems.
-@mudelafile{slur-nice.ly}
-@mudelafile{slur-symmetry.ly}
-@mudelafile{slur-symmetry-1.ly}
+@lilypondfile{slur-nice.ly}
+@lilypondfile{slur-symmetry.ly}
+@lilypondfile{slur-symmetry-1.ly}
Across line breaks, slurs behave nicely. On the left, they extend to
just after the preferatory matter, and on the right to the end of the
staff. A slur should follow the same vertical direction it would have
in unbroken state.
-@mudelafile{slur-broken-trend.ly}
+@lilypondfile{slur-broken-trend.ly}
Ties are strictly horizontal. They are placed in between note heads.
The horizontal middle should not overlap with a staffline.
-@mudelafile{tie.ly}
+@lilypondfile{tie.ly}
When tieing chords, the outer slurs point outwards, the inner slurs
point away from the center of the staff. Override with
@code{tieVerticalDirection}.
-@mudelafile{tie-chord.ly}
+@lilypondfile{tie-chord.ly}
When tieing notes with accidentals across a bar boundary, the accidental
must not be drawn on the note in the new bar. Instead, the next note of
Pitches can be verified by printing them with the @code{NoteNames} context.
-@mudelafile{tie-accidental.ly}
+@lilypondfile{tie-accidental.ly}
Beams can be typeset over fixed distance aligned staffs, beam
beautification doesn't really work, but knees do. Beams should be
behave well, wherever the switching point is.
-@mudelafile{beam-cross-staff.ly}
+@lilypondfile{beam-cross-staff.ly}
The same goes for slurs. They behave decently when broken across
linebreak.
-@mudelafile{slur-cross-staff.ly}
+@lilypondfile{slur-cross-staff.ly}
Tuplets are indicated by a bracket with a number. There should be no
bracket if there is one beam that matches the length of the tuplet.
The bracket does not interfere with the stafflines, and the number is
centered in the gap in the bracket.
-@mudelafile{tup.ly}
+@lilypondfile{tup.ly}
@section Property details
More specific settings take precendence over less specific settings. The
second slur has slurDirection set to down, overriding the stemup setting.
-@mudelafile{generic-property-override.ly}
+@lilypondfile{generic-property-override.ly}
@section Repeats
Unfolded behavior:
-@mudelafile{repeat-unfold.ly}
+@lilypondfile{repeat-unfold.ly}
Volta (Semi folded) behavior. Voltas can start on non-barline moments.
If they don't barlines should still be shown.
-@mudelafile{repeat-volta.ly}
+@lilypondfile{repeat-volta.ly}
Folded. This doesn't make sense without alternatives, but it works.
-@mudelafile{repeat-fold.ly}
+@lilypondfile{repeat-fold.ly}
Across linebreaks, the left edge of a first and second alternative
bracket should be equal
-@mudelafile{repeat-line-break.ly}
+@lilypondfile{repeat-line-break.ly}
Auto change piano staff switches voices between up and down staffs
automatically; rests are switched along with the coming note.
-@mudelafile{auto-change.ly}
+@lilypondfile{auto-change.ly}
@section Lyrics
extenders do not assume anything about lyric lengths, so they continue
to work.
-@mudelafile{lyric-combine.ly}
+@lilypondfile{lyric-combine.ly}
Multiple stanzas
-@mudelafile{lyrics-multi-stanza.ly}
+@lilypondfile{lyrics-multi-stanza.ly}
@section Multiple notes
and whole rests just outside the staff get ledger lines in different
cases.
-@mudelafile{rest-collision.ly}
+@lilypondfile{rest-collision.ly}
Normal collisions. We have support for polyphony, where the
middle voices are horizontally shifted.
-@mudelafile{collisions.ly}
+@lilypondfile{collisions.ly}
The number of stafflines of a staff can be set with the property
numberOfStaffLines. Ledger lines both on note heads and rests are
adjusted. Barlines also are adjusted.
-@mudelafile{number-staff-lines.ly}
+@lilypondfile{number-staff-lines.ly}
@section Spacing
In a limited number of cases, LilyPond corrects for optical spacing
effects. In this example, space for opposite pointed stems is adjusted
-@mudelafile{stem-spacing.ly}
+@lilypondfile{stem-spacing.ly}
If there are accidentals in the music, we add space, but the space
between note and accidentals is less than between the notes with the
Tight:
-@mudelafile{spacing-tight.ly}
+@lilypondfile{spacing-tight.ly}
Natural:
-@mudelafile{spacing-natural.ly}
+@lilypondfile{spacing-natural.ly}
Loose:
-@mudelafile{spacing-loose.ly}
+@lilypondfile{spacing-loose.ly}
Adding a @code{Bar_engraver} to the LyricsVoice context makes sure that
lyrics don't collide with barlines.
-@mudelafile{lyrics-bar.ly}
+@lilypondfile{lyrics-bar.ly}
Text is set with empty horizontal dimensions. The boolean property
textNonEmpty is used to respect the horizontal size of text.
-@mudelafile{non-empty-text.ly}
+@lilypondfile{non-empty-text.ly}
Breaks can be encouraged and discouraged using @code{\break} and
@code{\nobreak}. They are abbrevs for @code{\penalty} commands.
-@mudelafile{break.ly}
+@lilypondfile{break.ly}
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 often.
-@mudelafile{bar-scripts.ly}
+@lilypondfile{bar-scripts.ly}
Staff margins are also markings attached to barlines. They should be
left of the staff, and be centered vertically wrt the staff. They may
be on normal staffs, but also on compound staffs, like the PianoStaff
-@mudelafile{staff-margin.ly}
+@lilypondfile{staff-margin.ly}
Breathing signs, also used for phrasing, do normally not influence
global spacing -- only if space gets tight, notes are shifted to make
through their voice. In the following example, the notes in the first
two measures all have the same distance from each other:
-@mudelafile{breathing-sign.ly}
+@lilypondfile{breathing-sign.ly}
Hara kiri staffs kill themselves if they are empty. This example really
contains two staffs, but the second contains only spaces, and is
therefore removed.
-@mudelafile{hara-kiri-short.ly}
+@lilypondfile{hara-kiri-short.ly}
In orchestral scores and hymns, voices are traditionally combined onto
one staff. LilyPond has a part combiner, that combines or separates two
voices according to actual rhythm and pitch. User-defined texts such as
``solo'' and ``@`a2'' are typeset automagically, as appropriate.
-@mudelafile{part-combine.ly}
+@lilypondfile{part-combine.ly}
Fonts are available in a default set of sizes: 11, 13, 16, 20, 23 and
26pt staffheight. Sizes of the text fonts and symbol fonts are made
to match the staff dimensions.
-@mudelafile[nonfragment]{size11.ly}
+@lilypondfile[nonfragment]{size11.ly}
-@mudelafile[nonfragment]{size13.ly}
+@lilypondfile[nonfragment]{size13.ly}
-@mudelafile[nonfragment]{size16.ly}
+@lilypondfile[nonfragment]{size16.ly}
-@mudelafile[nonfragment]{size20.ly}
+@lilypondfile[nonfragment]{size20.ly}
-@mudelafile[nonfragment]{size23.ly}
+@lilypondfile[nonfragment]{size23.ly}
-@mudelafile[nonfragment]{size26.ly}
+@lilypondfile[nonfragment]{size26.ly}
@section Clefs and Time Signatures
below the clef respectively. The ``8'' is processed in a convoluted
way, so this is fragile as well.
-@mudelafile{clefs.ly}
+@lilypondfile{clefs.ly}
Key signatures appear on key changes. They may also
the start of the line. If @code{createKeyOnClefChange} is set, they're
also created on a clef change.
-@mudelafile{keys.ly}
+@lilypondfile{keys.ly}
As a last resort, the placement of items can be adjusted manually, by
setting the @code{extra-offset} of an output object.
-@mudelafile{generic-output-property.ly}
+@lilypondfile{generic-output-property.ly}
The same mechanism can be used to force pagebreaks.
-@mudelafile{between-systems.ly}
+@lilypondfile{between-systems.ly}
@bye
@itemize @bullet
@item @email{tca@@gnu.org, Tom Cato Amundsen},
- cembalo-partita in mudela, accordion symbols, some mudela-book.py
+ cembalo-partita in lilypond, accordion symbols, some lilypond-book.py
@item @email{matsb@@s3.kth.se, Mats Bengtsson},
@uref{http://www.s3.kth.se/~matsb/}
lots of testing, fixes, general comments and contributions.
@item @email{daboys@@austin.rr.com, Jeffrey B. Reed},
Windows-NT support.
@item Shay Rojanski
- Some mudela source.
+ Some lilypond input.
@item @email{august@@infran.ru, August S.Sigov}
Russian translation
@end itemize
STEPMAKE_TEMPLATES=documentation tex texinfo yolily-topdoc
-LOCALSTEPMAKE_TEMPLATES=lilypond mudela
+LOCALSTEPMAKE_TEMPLATES=lilypond ly
HTML_FILES=$(addprefix $(outdir)/, $(TEXI_FILES:.texi=.html) $(TELY_FILES:.tely=.html))
/usr/local/man/man1/midi2ly.1
/usr/local/man/man1/abc2ly.1
/usr/local/man/man1/etf2ly.1
- /usr/local/man/man1/convert-mudela.1
- /usr/local/man/man1/mudela-book.1
+ /usr/local/man/man1/convert-ly.1
+ /usr/local/man/man1/lilypond-book.1
/usr/local/man/man1/lilypond.1
/usr/local/bin/lilypond
/usr/local/bin/midi2ly
- /usr/local/bin/convert-mudela
- /usr/local/bin/mudela-book
+ /usr/local/bin/convert-ly
+ /usr/local/bin/lilypond-book
/usr/local/bin/abc2ly
+ /usr/local/bin/pmx2ly
+ /usr/local/bin/musedata2ly
/usr/local/bin/etf2ly
/usr/local/share/lilypond/*
/usr/local/share/locale/@{....@}/LC_MESSAGES/lilypond.mo
this:
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
\relative c'' { \key c \minor; r8 c16 b c8 g as c16 b c8 d | g,4 }
-@end mudela
+@end lilypond
@end quotation
The output looks very good: the font and the layout algorithms were
INFO_FILES = $(addprefix $(outdir)/, lilypond.info lilypond-internals.info)
STEPMAKE_TEMPLATES=tex texinfo documentation
-LOCALSTEPMAKE_TEMPLATES=lilypond mudela
+LOCALSTEPMAKE_TEMPLATES=lilypond ly
include $(depth)/make/stepmake.make
--- /dev/null
+@node convert-ly, , ,Top
+@chapter convert-ly
+@code{convert-ly} sequentially applies different
+lilypond-conversions to upgrade a Lilypond input file. It uses
+@code{\version} statements in the file to detect the old version
+number.
+
+@example
+ convert-ly [options] [files]
+@end example
+
+@section Options
+@table @samp
+@item --output
+ The output file to write.
+@item --edit
+ Do an inline edit of the input file. override @code{--output}
+@item --show-rules
+ shows all known conversions, and exit
+@item --from=@var{FROM_PATCHLEVEL}
+ Set the level to convert from. If this is not set, convert-ly will
+ guess this, on the basis of @code{\version} strings in the file
+@item --to=@var{TO_PATCHLEVEL}
+ Set the goal version of the conversion. It defaults to the latest
+ available version.
+@end table
+
+Not all language changes are handled. Multiple output options won't
+work.
+
+convert-ly is written in python, so you have install
+@uref{http://www.python.org,python}. It was written by
+@email{hanwen@@cs.uu.nl, Han-Wen Nienhuys}.
+
+
+
+++ /dev/null
-@node convert-mudela, , ,Top
-@chapter convert-mudela
-@code{convert-mudela} sequentially applies different
-mudela-conversions to upgrade a Mudela input file. It uses
-@code{\version} statements in the file to detect the old version
-number.
-
-@example
- convert-mudela [options] [files]
-@end example
-
-@section Options
-@table @samp
-@item --output
- The output file to write.
-@item --edit
- Do an inline edit of the input file. override @code{--output}
-@item --show-rules
- shows all known conversions, and exit
-@item --from=@var{FROM_PATCHLEVEL}
- Set the level to convert from. If this is not set, convert-mudela will
- guess this, on the basis of @code{\version} strings in the file
-@item --to=@var{TO_PATCHLEVEL}
- Set the goal version of the conversion. It defaults to the latest
- available version.
-@end table
-
-Not all language changes are handled. Multiple output options won't
-work.
-
-convert-mudela is written in python, so you have install
-@uref{http://www.python.org,python}. It was written by
-@email{hanwen@@cs.uu.nl, Han-Wen Nienhuys}.
-
-
-
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\property Voice.textStyle = "large"
\notes\relative c'' {
geses1_"db. flat" s s2
g!1_"natural" s2
}
-@end mudela
+@end lilypond
@item accelerando
I: accelerando, F: accelerando, en acc@'el@'erant, D: accelerando, Schneller,
NL: accelerando, DK: accelerando, S: accelerando, N:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\notes\relative c'' {
a1 b c d e f g a }
-@end mudela
+@end lilypond
@item andante
I: andante, F: andante, D: Andante, NL: andante, DK: andante, S: andante,
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
%\property Voice.textEmptyDimension = ##t
\property Voice.textStyle = "large"
g8 fis16 g | a4 \bar "||"; }
\notes\relative c'' {
<d4_"performance" a fis> r g16 () fis e fis a () g fis g | a4 \bar "||"; }
-@end mudela
+@end lilypond
An appoggiatura may have more notes preceding the main note.
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Voice.textStyle = "large"
\notes\relative c'' {
\context Voice = vb { \stemDown as16 ~ as8. as16 ~ as8. } >
\bar "||";
}
-@end mudela
+@end lilypond
@item arpeggio
I: arpeggio, F: arp@`ege, D: Arpeggio, Akkordbrechungen, gebrochener
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\context GrandStaff <
\notes\relative c'' {
\time 4/4;
c2 c | c c } >
}
>
-@end mudela
+@end lilypond
@item ascending interval
I: intervallo ascendente, F: intervalle ascendant, D: steigendes Intervall,
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\emptyText
\property Voice.textStyle = "large"
[g16_"1/16" g g g] s16
[g32_"1/32" s32 g32 s32 g32 s32 g32] s16
[g64_"1/64" s32 g64 s32 g64 s32 g64] s32 }
-@end mudela
+@end lilypond
@item beat
I: tempi, F: temps, D: Taktschlag, Zeit (im Takt), NL: tel, DK: (takt)slag, S:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\key g \major;
\time 4/4;
\notes\relative c'' { g4 c b a | g1 \bar "||";}
\time 3/8;
\notes\relative c'' { g8 d' c | b c a | g4. \bar "||";}
-@end mudela
+@end lilypond
@item bind
@w{@ar{}@strong{tie}}
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\context GrandStaff <
\property GrandStaff.minVerticalAlign = 12
\notes\relative c'' { \clef treble; g4 e c2 }
\notes\relative c { \clef bass; c1 \bar "|."; } >
-@end mudela
+@end lilypond
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
%\context StaffGroup <
\context ChoirStaff <
\property StaffGroup.minVerticalAlign = 12
\notes\relative c'' { \clef treble; g4 e c2 }
\notes\relative c { \clef bass; c1 \bar "|."; } >
-@end mudela
+@end lilypond
@item brass
I: ottoni, D: Blechbl@"aser, NL: koper (blazers), F: cuivres,
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\notes\relative c'' { g\breve }
-@end mudela
+@end lilypond
@item C
I: do, F: ut, D: C, c, NL: c, DK: c, S: c, N: c
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\property Staff.clefStyle = #"fullSizeChanges"
\property Staff.textStyle = #"large"
\context Lyrics \lyrics {
Soprano Mezzosoprano Alto Tenor Baritone
}
-@end mudela
+@end lilypond
@item cadence
I: cadenza, F: cadence, D: Kadenz, NL: cadens, DK: kadence, S: kadens, N: .
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\property Voice.textNonEmpty = ##t
\property Voice.textStyle = "large"
<g_"seventh-chord~" b d f>
<g_"ninth-chord" b d f a> s s2
}
-@end mudela
+@end lilypond
@item chromatic scale
I: scala cromatica, F: gamme chromatique, D: Chromatische Tonleiter, NL:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\notes\relative c' { c1 cis d dis e f fis g gis a ais b c }
-@end mudela
+@end lilypond
@item chromaticism
I: cromatismo, F: chromatisme, D: Chromatik, NL: chromatiek, DK: kromatik, S:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\key g \major; \time 4/4;
\notes\relative c'' { g4 g g a | b2 a | g4 b a a | g1 \bar "||"; }
-@end mudela
+@end lilypond
@item consonance
I: consonanza, F: consonance, D: Konsonanz, NL: consonant, DK: konsonans, S:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.timeSignatureStyle = "C2/2"
\context GrandStaff <
\notes\relative c' {
} >
}
>
-@end mudela
+@end lilypond
@item counter tenor
I: controtenore, F: contre-tenor, D: Kontratenor, NL: contratenor, DK:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\key g \major; \time 4/4;
\notes\relative c'' { g4 \< a b c | \! d1 \bar "|."; }
-@end mudela
+@end lilypond
@item cue-notes
I: notine, F: petites notes pr@'ec@'edent l'entr@'ee d'in instrument,
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Voice.textStyle = "large"
\key g \major; \time 4/4;
\notes\relative c'' { d1 | g,4^\segno a b c | b a g2_"d.s." \bar "|."; }
-@end mudela
+@end lilypond
@item decrescendo
I: decrescendo, D: Decrescendo, Leiser, NL: decrescendo, DK: decrescendo, S:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\key g \major; \time 4/4;
\notes\relative c'' { d4 \> c b a | \! g1 \bar "|."; }
-@end mudela
+@end lilypond
@item descending interval
I: intervallo discendente, F: intervalle descendant, D: fallendes Intervall,
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
\property Lyrics.textStyle = "large"
\property Voice.textScriptPadding = #-4
b^"~~ S" c }
\context Lyrics \lyrics { Ionian }
-@end mudela
+@end lilypond
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
\property Lyrics.textStyle = "large"
\property Voice.textScriptPadding = #-4
b^"~~ S" c d }
\context Lyrics \lyrics { Dorian }
-@end mudela
+@end lilypond
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
\property Lyrics.textStyle = "large"
\property Voice.textScriptPadding = #-4
b^"~~ S" c d e }
\context Lyrics \lyrics { Phrygian }
-@end mudela
+@end lilypond
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
\property Lyrics.textStyle = "large"
\property Voice.textScriptPadding = #0
e^"~~ S" f }
\context Lyrics \lyrics { Lydian }
-@end mudela
+@end lilypond
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
\property Lyrics.textStyle = "large"
\property Voice.textScriptPadding = #0
e^"~~ S" f g }
\context Lyrics \lyrics { Mixolydian }
-@end mudela
+@end lilypond
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
\property Lyrics.textStyle = "large"
\property Voice.textScriptPadding = #0
e^"~~ S" f g a }
\context Lyrics \lyrics { Aeolian }
-@end mudela
+@end lilypond
From the beginning of the 17th century the scales used in European
compositional music are primarily the major and the minor scales. In the
harmonic minor scale type an augmented second (A) occurs between the 6th and
7th tone.
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
\property Lyrics.textStyle = "large"
\property Voice.textScriptPadding = #-4
b^"~~ S" c }
\context Lyrics \lyrics { Major }
-@end mudela
+@end lilypond
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
\property Lyrics.textStyle = "large"
\property Voice.textScriptPadding = #0
e^"~~ S" f g a }
\context Lyrics \lyrics { "ancient minor" }
-@end mudela
+@end lilypond
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
\property Lyrics.textStyle = "large"
gis^"~~ S"
a }
\context Lyrics \lyrics { "Harmonic minor" }
-@end mudela
+@end lilypond
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
\property Lyrics.textStyle = "large"
c^"~~ S" b a
}
\context Lyrics \lyrics { "Melodic minor" }
-@end mudela
+@end lilypond
@item diminished interval
I: intervallo diminuito, F: intervalle diminu@'e, D: vermindertes Intervall,
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\key a \major;
\time 4/4;
\notes\relative c' {
\partial 8; e8 | a4. gis8 b a e cis |
fis2 d4. \bar "||"; }
-@end mudela
+@end lilypond
@item dissonant interval; dissonance
I: intervallo dissonante, dissonanza, F: dissonance, D: Dissonanz, NL:
but equal pitch.
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\property Voice.textStyle = "large"
\notes\relative c'' {
gis1_"g sharp" s as1_"a flat" s s
< des_"dim fifth" g,! > s s < cis_"augm fourth" g! > s s
}
-@end mudela
+@end lilypond
@item equal temperament
I: temperamento equabile, F: temp@'erament @'egal, D: gleichschwebende
octave lower (for example on double bass @w{@ar{}@strong{strings}}).
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\property Staff.clefStyle = #"fullSizeChanges"
\property Lyrics.textStyle = "large"
"octaved up"
"octaved down"
}
-@end mudela
+@end lilypond
@item fermata
I: corona, F: pause, D: Fermate, NL: fermate, DK: fermat, S: fermat, N: .
Prolonged note or rest of indefinite duration.
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\time 4/4;
\notes\relative c'' {
a4 b c2^\fermata \bar "|."; }
-@end mudela
+@end lilypond
@item fifth
I: quinta, F: quinte, D: Quinte, NL: kwint, DK: kvint, S: kvint, N:
a quarter note. The number of flags determines the @w{@ar{}@strong{note value}}.
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\emptyText
\property Voice.textStyle = "large"
g16_"1/16" s8
g32_"1/32" s8
g64_"1/64" s8 }
-@end mudela
+@end lilypond
@item flat
I: bemolle, F: b@'emol, D: B, b, NL: mol, DK: b, S: bef@"ortecken, N: .
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
\property Lyrics.textStyle = "large"
< g1 e c > < a f d > < b g e >
< c a f > < d b g > < e c a > < f d b > }
\context Lyrics \lyrics { T Sp Dp S D Tp "D{\\kern-5pt}$\\mid$" }
-@end mudela
+@end lilypond
@item G
I: sol, F: sol, D: G, g, NL: g, DK: g, S: g, N: g.
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\property Staff.clefStyle = #"fullSizeChanges"
\property Lyrics.textStyle = "large"
"octaved up"
"octaved down"
}
-@end mudela
+@end lilypond
@item glissando
I: glissando, F: glissando, D: Glissando, NL: glissando, DK: glissando, S:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\context GrandStaff <
\notes\relative c'' {
\time 4/4;
\partial 4; c4 | f, g c2
\bar "|."; }
\context Lyrics \lyrics { T S D T } >
-@end mudela
+@end lilypond
@item harmony
I: armonia, F: harmonie, D: Harmonie, Zusammenklang, NL: harmonie, DK:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\property Voice.textStyle = "large"
\notes\relative c'' {
<g1_"octave" g'> s
<g1_"decime" b'> s s
}
-@end mudela
+@end lilypond
Dissonances:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\property Voice.textStyle = "large"
\notes\relative c'' {
<g1_"seventh" f'> s
<g1_"ninth" a'> s s
}
-@end mudela
+@end lilypond
Three note harmony @w{@ar{}@strong{chord}}
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\property Lyrics.textStyle = "large"
\property Voice.textStyle = "large"
}
\context Lyrics \lyrics {
unisone second second second third third third third }
-@end mudela
+@end lilypond
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\property Lyrics.textStyle = "large"
\property Voice.textStyle = "large"
}
\context Lyrics \lyrics {
fourth fourth fifth fifth sixth sixth sixth sixth }
-@end mudela
+@end lilypond
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\property Lyrics.textStyle = "large"
\property Voice.textStyle = "large"
}
\context Lyrics \lyrics {
seventh seventh seventh octave none none decime decime }
-@end mudela
+@end lilypond
@item inverted interval
I: intervallo rivolto, F: intervalle renvers@'e, D: umgekerhtes Intervall, NL:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\property Voice.textStyle = "large"
\notes\relative c'' {
< g,_"third" b > s < g'_"sixth" b, > s \bar "||";
< g,_"fourth" c > s < g'_"fifth" c, > s \bar "||";
}
-@end mudela
+@end lilypond
@item just intonation
I: intonazione giusta, F: intonation juste, D: reine Stimmung, NL: reine
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\notes\relative c'' { a,1 s c'' }
-@end mudela
+@end lilypond
@item legato
I: legato, F: legato, li@'e, D: legato, NL: legato, DK: legato, S: legato, N:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\emptyText
\property Lyrics.textStyle = "large"
c4-. d-. e-. \bar "||";
}
\context Lyrics \lyrics { a "" "" b "" "" c "" "" d }
-@end mudela
+@end lilypond
@item legato curve
@w{@ar{}@strong{slur}} @w{@ar{}@strong{legato}}
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\notes\relative c'' {
\property Voice.noteHeadStyle = #'mensural
g\longa
}
-@end mudela
+@end lilypond
@item major interval
I: intervallo maggiore, F: intervalle majeur, D: gro@ss{}es Intervall, NL:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\notes\relative c'' {
\time 3/4;
\key f \major;
c es d | c bes8 a bes4 | c es d | c2 \bar "||";}
-@end mudela
+@end lilypond
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\notes\relative c' {
\time 6/8;
\key f \major;
f8 f f f a16 g a f |
c'8 c c c e16 d e c \bar "||";}
-@end mudela
+@end lilypond
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\notes\relative c'' {
\time 5/4;
\key g \major;
d4 b8 g b d d c a4 |
g8 g16 g g8 g16 g g8 fis16 g a8 fis16 e d4 \bar "||";}
-@end mudela
+@end lilypond
@item metronome
I: metronomo, F: m@'etronome, D: Metronom, NL: metronoom,
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\property Staff.clefStyle = #"fullSizeChanges"
\notes\relative c' {
\clef alto; c s
\clef treble; c s
}
-@end mudela
+@end lilypond
@item minor interval
I: intervallo minore, F: intervalle mineur, D: kleines Intervall, NL: klein
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.timeSignatureStyle = "C2/2"
\emptyText
\property Voice.textStyle = "large"
g8 d16_"------" c d8 g16 fis g8 b,16 a b8 g'16 fis |
g8 g,16 a b8 cis d16 s
}
-@end mudela
+@end lilypond
@item movement
I: movimento, F: mouvement, D: Satz, NL: deel, DK: sats, S: sats, N: .
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\notes\relative c'' {
a1
\property Score.skipBars=##t R1*3
a1 }
-@end mudela
+@end lilypond
@item mixolydian mode
@w{@ar{}@strong{diatonic scale}}
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Voice.textStyle = "large"
\property Score.barNonAuto = ##t
\notes\relative c'' {
\property Voice.noteHeadStyle = ##f
g1_"1/1" g2_"1/2" g4_"1/4" s16 g8_"1/8" s16
g16_"1/16" s16 g32_"1/32" s16 g64_"1/64" s32 }
-@end mudela
+@end lilypond
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Voice.textStyle = "large"
\property Score.barNonAuto = ##t
\notes\relative c'' {
r\longa_"longa" r\breve_"breve"
r1_"1/1" r2_"1/2" r4_"1/4" s16 r8_"1/8" s16
r16_"1/16" s16 r32_"1/32" s16 r64_"1/64" s32 }
-@end mudela
+@end lilypond
An augmentation dot after a note multiplies the duration by one and a
half. Another dot adds yet a fourth of the duration.
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Voice.textStyle = "large"
\notes\relative c'' {
\time 4/4;
g4._"pointed" g8 g2 | g4 () g8 g g2 \bar "||";
g4.._"double pointed" g16 g2 | g4 () g8 () g16 g g2 \bar "||"; }
-@end mudela
+@end lilypond
Alternatively note values may be subdivided by other ratios. Most common is
subdivision by 3 (@emph{triplets}) and 5 (@emph{quintuplets}). Subdivisions by
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Voice.textStyle = "large"
\emptyText
\notes\relative c'' {
g4 g g \bar "||";
\times 6/4 {g8_"quadruplets" g g g} |
g8 g g g g4 \bar "||";}
-@end mudela
+@end lilypond
@
note first while in the music from the preceding baroque and classic periods
the upper note is played first.
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
<
\context Staff = sa {
\emptyText
c2. b32 c b c \times 4/5 { b c b c b } | c1
}
>
-@end mudela
+@end lilypond
Other frequently used ornaments are the @emph{turn}, the @emph{mordent} and the
@emph{prall} (inverted mordent).
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
<
\context Staff = sa {
\emptyText
e'4 [e8 ~ e32 d e d] c2
}
>
-@end mudela
+@end lilypond
@w{@ar{}@strong{appoggiatura}}
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
\property Voice.textStyle = "large"
\key es \major;
c,1_"c minor" d es f g a! b! c \bar "||";
}
-@end mudela
+@end lilypond
@item repeat
I: ritornello, F: barre de reprise, D: Wiederholung, NL: herhaling, DK:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\key g \major;
\time 4/4;
\notes\relative c'' {
\repeat volta 2 {g4 g d' d | e e d2 | c4 c b b | a a g2 }
}
-@end mudela
+@end lilypond
@item rest
I: pausa, F: silence, D: Pause, NL: rust, DK: pause, S: paus, N: .
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
\property Lyrics.textStyle = "large"
< { I II III IV V VI VII I }
{ T "" "" S D } >
}
-@end mudela
+@end lilypond
@w{@ar{}@strong{functional harmony}}
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\notes\relative c'' { g1 gis s a bes s b c }
-@end mudela
+@end lilypond
@item seventh
I: settima, F: septi@`eme, D: Septime, NL: septiem, DK: septim, S: septim, N: .
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\key d \major;
\time 4/4;
\notes\relative c'' {
\partial 8; a8 |
d4-\staccato cis-\staccato b-\staccato cis-\staccato |
d2. \bar "||"; }
-@end mudela
+@end lilypond
@item staff
I: pentagramma, rigo (musicale), F: port@'ee, D: Notensystem, NL: (noten)balk;
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.noAutoBeaming = ##t
\property Score.barNonAuto = ##t
\emptyText
g,8_"1/8" g' s16
g,16_"1/16" g' s16
}
-@end mudela
+@end lilypond
@item strings
I: archi, F: cordes, D: Streicher, NL: strijkers, DK: strygere, S:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Voice.textStyle = "large"
\time 4/4;
d8 dis |
e c'4 e,8 c'4 e,8 c' ( | ) c2
}
-@end mudela
+@end lilypond
@item syntonic comma; dydimic comma
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\context GrandStaff <
\notes\relative c'' {
\time 4/4;
{ "" "" "2" "" "2" "" "2" "" } >
}
>
-@end mudela
+@end lilypond
@item tie; bind
I: legatura (di valore), F: liaison, D: Haltebogen, NL: overbinding, DK:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\property Score.barNonAuto = ##t
\notes\relative c'' { g2 ~ g4. }
-@end mudela
+@end lilypond
@item time signature
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\context Staff {
\time 3/4;
\notes\relative c'' {
\key g \major;
d4 g,8 a b c | d4 g, g | e' c8 d e fis | g4 g, g \bar "|."; }
}
-@end mudela
+@end lilypond
@item treble clef
I: chiave di violino, F: cl@'e de sol, D: Violinschl@"ussel,
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\emptyText
\property Score.barNonAuto = ##t
\property Voice.textStyle = "large"
% e2:32_"a" f:32 [ e8:16 f:16 g:16 a:16 ] s4 \repeat "tremolo" 16 { e32_"b" g }
e2:32_"a" f:32 [ e8:16 f:16 g:16 a:16 ] s4 \repeat "tremolo" 8 { e32_"b" g }
}
-@end mudela
+@end lilypond
@item triad
I: triade, F: triade, accord parfait, accord de trois sons, D: Dreiklang, NL:
@
-@mudela[13pt,eps]
+@lilypond[13pt,eps]
\key f \major;
\time 4/4;
\notes\relative c' {
\partial 4; f4 | bes4. a8 bes4 c |
bes () a g f | bes4. a8 bes4 c | f,2. \bar "||"; }
-@end mudela
+@end lilypond
@item voice
I: voce, F: voix, D: Stimme, NL: stem, DK: stemme, S: st@"amma, N: ,
@item --include, -I=DIRECTORY
Add @file{DIRECTORY} to the search path for input files.
@item --ignore-version, -V
- Make the incompatible mudela version warning non-fatal.
+ Make the incompatible lilypond version warning non-fatal.
@end table
--- /dev/null
+% kommentar
+\documentclass[a4paper, 12pt]{article}
+%\def\preMudelaExample{}
+%\def\postMudelaExample{}
+%\usepackage{graphics}
+%\usepackage{landscape}
+\begin{document}
+%uncomment this to try twocolumn mode
+%\twocolumn
+
+
+\section{Mudelabook + LaTeX}
+
+This is an examplefile for mixing Lilypond and Latex. It is also
+used to test lilypond-book. View the source to see how it is done.
+
+A simple scale:
+
+\begin{lilypond}
+\score{
+ \notes\relative c'{c d e f g a b c}
+}
+\end{lilypond}
+
+Lilypond-book search for the \verb|\score| command when it decides
+if the code is only a fragment. Thus, in the following code, you have
+to use \verb|fragment| option, because the comment confuses lilypond-book.
+
+\begin[fragment]{lilypond}
+c d e % \score
+\end{lilypond}
+
+There is also a shorthand version \verb|\lilypond{c' e' g'}|:
+
+\lilypond{c' e' g'}
+
+that is the same as writing
+\begin{verbatim}
+\begin[eps]{lilypond}
+c' e' g'
+\end{lilypond}
+\end{verbatim}
+
+This C major
+\begin[eps, 11pt]{lilypond}
+c' e' g'
+\end{lilypond}
+and C minor \lilypond[11pt]{c' es' g'} chords are floating inside the text.
+
+\subsection{verb and verbatim}
+
+As you see, the begin/end verbatim command inside
+does not confuse lilypond-book:
+
+\verb|\begin{lilypond}c d e\end{lilypond}|
+
+Neither does a verbatim inside verb:
+
+\verb|\begin{verbatim}\begin{lilypond}c d e\end{lilypond}\end{verbatim}|
+
+or verb inside verbatim:
+
+\begin{verbatim}
+\verb|\begin{lilypond}c d e\end{lilypond}|
+\end{verbatim}
+
+But this is just to stress \verb|lilypond-book|. What you need is:
+
+\verb|\lilypond{c' d' e'}|
+
+and
+
+\begin{verbatim}
+\begin{lilypond}
+c d e
+\end{lilypond}
+\end{verbatim}
+
+\subsection{The 'verbatim' and 'intertext' option}
+This shows the verbatim option:
+\begin[verbatim, intertext="gives this music:"]{lilypond}
+c' d' e'
+\end{lilypond}
+
+\subsection{LaTeX comments}
+This is a line with lilypond code after the comment char % \lilypond{<c' e' g'>}
+% \lilypond{<c' e' g'>}
+
+If you do not see any music from the heading 'LaTeX comments' and until
+this line, then lilypond-book is handling latex comments pretty well :-)
+
+\subsection{To float or not to float}
+This music
+\begin[eps]{lilypond}
+c' e'
+\end{lilypond}
+should be floating inside the text by using the \verb|eps| options.
+
+This music
+
+\begin[eps]{lilypond}
+c' e'
+\end{lilypond}
+
+has also the \verb|eps| options, but is not floating because there
+are an emptry line before and after the lilypond block. That is
+correct behaviour because it follows La\TeX{} convention that an
+empty line signals a new paragraph. Note that the \verb|eps| option
+is not necessary when you want the music in a paragraph on its own.
+
+\subsection{More examples}
+
+Itemize environment:
+\begin{itemize}
+\item \lilypond[11pt]{ c'} do
+\item \lilypond[11pt]{d'} re
+\item \lilypond[11pt]{e'} mi
+\item \lilypond[11pt]{f'} fa
+\item \lilypond[11pt]{g'} sol
+\end{itemize}
+
+Tables\footnote{ and footnote: \lilypond[eps,11pt]{c' e' g'} }:
+\marginpar{ Yes, even as marginpar
+\lilypond[eps,11pt]{c' d' e'} }
+
+\begin{tabular}{|l|l|r|}
+\hline
+\em Notes & \em Name \\
+\hline
+\lilypond[11pt, filename="cdur"]{<c' e' g'>} & major \\
+\lilypond[11pt]{<c' es' g'>} & minor \\
+\lilypond[11pt]{<c' es' ges'>} & diminished \\
+\lilypond[11pt]{<c' e' gis'>} & augmented \\
+\hline
+\end{tabular}
+
+\pagebreak
+
+Testing of spacing. The next music is surrounded by an empty line.
+text text text text text text text text text text text text
+text text text text text text text text text text text text
+
+\begin{lilypond}
+\score{ \notes\relative c'{ c d e f g a b c} }
+\end{lilypond}
+
+text text text text text text text text text text text text
+text text text text text text text text text text text text
+text text text text text text text text text text text text
+
+Next has no empty lines.
+text text text text text text text text text text text text
+text text text text text text text text text text text text
+text text text text text text text text text text text text
+\begin{lilypond}
+\score{ \notes\relative c'{ c d e f g a b c} }
+\end{lilypond}
+text text text text text text text text text text text text
+text text text text text text text text text text text text
+
+
+
+\end{document}
+++ /dev/null
-% kommentar
-\documentclass[a4paper, 12pt]{article}
-%\def\preMudelaExample{}
-%\def\postMudelaExample{}
-%\usepackage{graphics}
-%\usepackage{landscape}
-\begin{document}
-%uncomment this to try twocolumn mode
-%\twocolumn
-
-
-\section{Mudelabook + LaTeX}
-
-This is an examplefile for mixing Lilypond and Latex. It is also
-used to test mudela-book. View the source to see how it is done.
-
-A simple scale:
-
-\begin{mudela}
-\score{
- \notes\relative c'{c d e f g a b c}
-}
-\end{mudela}
-
-Mudela-book search for the \verb|\score| command when it decides
-if the code is only a fragment. Thus, in the following code, you have
-to use \verb|fragment| option, because the comment confuses mudela-book.
-
-\begin[fragment]{mudela}
-c d e % \score
-\end{mudela}
-
-There is also a shorthand version \verb|\mudela{c' e' g'}|:
-
-\mudela{c' e' g'}
-
-that is the same as writing
-\begin{verbatim}
-\begin[eps]{mudela}
-c' e' g'
-\end{mudela}
-\end{verbatim}
-
-This C major
-\begin[eps, 11pt]{mudela}
-c' e' g'
-\end{mudela}
-and C minor \mudela[11pt]{c' es' g'} chords are floating inside the text.
-
-\subsection{verb and verbatim}
-
-As you see, the begin/end verbatim command inside
-does not confuse mudela-book:
-
-\verb|\begin{mudela}c d e\end{mudela}|
-
-Neither does a verbatim inside verb:
-
-\verb|\begin{verbatim}\begin{mudela}c d e\end{mudela}\end{verbatim}|
-
-or verb inside verbatim:
-
-\begin{verbatim}
-\verb|\begin{mudela}c d e\end{mudela}|
-\end{verbatim}
-
-But this is just to stress \verb|mudela-book|. What you need is:
-
-\verb|\mudela{c' d' e'}|
-
-and
-
-\begin{verbatim}
-\begin{mudela}
-c d e
-\end{mudela}
-\end{verbatim}
-
-\subsection{The 'verbatim' and 'intertext' option}
-This shows the verbatim option:
-\begin[verbatim, intertext="gives this music:"]{mudela}
-c' d' e'
-\end{mudela}
-
-\subsection{LaTeX comments}
-This is a line with mudela code after the comment char % \mudela{<c' e' g'>}
-% \mudela{<c' e' g'>}
-
-If you do not see any music from the heading 'LaTeX comments' and until
-this line, then mudela-book is handling latex comments pretty well :-)
-
-\subsection{To float or not to float}
-This music
-\begin[eps]{mudela}
-c' e'
-\end{mudela}
-should be floating inside the text by using the \verb|eps| options.
-
-This music
-
-\begin[eps]{mudela}
-c' e'
-\end{mudela}
-
-has also the \verb|eps| options, but is not floating because there
-are an emptry line before and after the mudela block. That is
-correct behaviour because it follows La\TeX{} convention that an
-empty line signals a new paragraph. Note that the \verb|eps| option
-is not necessary when you want the music in a paragraph on its own.
-
-\subsection{More examples}
-
-Itemize environment:
-\begin{itemize}
-\item \mudela[11pt]{ c'} do
-\item \mudela[11pt]{d'} re
-\item \mudela[11pt]{e'} mi
-\item \mudela[11pt]{f'} fa
-\item \mudela[11pt]{g'} sol
-\end{itemize}
-
-Tables\footnote{ and footnote: \mudela[eps,11pt]{c' e' g'} }:
-\marginpar{ Yes, even as marginpar
-\mudela[eps,11pt]{c' d' e'} }
-
-\begin{tabular}{|l|l|r|}
-\hline
-\em Notes & \em Name \\
-\hline
-\mudela[11pt, filename="cdur"]{<c' e' g'>} & major \\
-\mudela[11pt]{<c' es' g'>} & minor \\
-\mudela[11pt]{<c' es' ges'>} & diminished \\
-\mudela[11pt]{<c' e' gis'>} & augmented \\
-\hline
-\end{tabular}
-
-\pagebreak
-
-Testing of spacing. The next music is surrounded by an empty line.
-text text text text text text text text text text text text
-text text text text text text text text text text text text
-
-\begin{mudela}
-\score{ \notes\relative c'{ c d e f g a b c} }
-\end{mudela}
-
-text text text text text text text text text text text text
-text text text text text text text text text text text text
-text text text text text text text text text text text text
-
-Next has no empty lines.
-text text text text text text text text text text text text
-text text text text text text text text text text text text
-text text text text text text text text text text text text
-\begin{mudela}
-\score{ \notes\relative c'{ c d e f g a b c} }
-\end{mudela}
-text text text text text text text text text text text text
-text text text text text text text text text text text text
-
-
-
-\end{document}
--- /dev/null
+\input texinfo @c -*-texinfo-*-
+@setfilename lilypond-book.info
+@settitle lilypond-book Manual
+@afourpaper
+@titlepage
+@title lilypond-book Manual
+@subtitle Integrating lilypond with La@TeX{} and TeXinfo
+@author Tom Cato Amundsen and Han-Wen Nienhuys
+
+ Copyright @copyright{} 1999 by the authors
+
+@vskip 0pt plus 1filll
+
+Permission is granted to make and distribute verbatim
+copies of this manual provided the copyright notice and
+this permission notice are preserved on all copies.
+
+Permission is granted to copy and distribute modified
+versions of this manual under the conditions for
+verbatim copying, provided also that the sections
+entitled ``Copying'' and ``GNU General Public License''
+are included exactly as in the original, and provided
+that the entire resulting derived work is distributed
+under the terms of a permission notice identical to this
+one.
+
+Permission is granted to copy and distribute
+translations of this manual into another language,
+under the above conditions for modified versions,
+except that this permission notice may be stated in a
+translation approved by the Free Software Foundation.
+
+@end titlepage
+
+@ifinfo
+This file documents GNU LilyPond.
+
+Copyright 1999 Tom Cato Amundsen and Han-Wen Nienhuys
+
+
+Permission is granted to make and distribute verbatim
+copies of this manual provided the copyright notice and
+this permission notice are preserved on all copies.
+
+@ignore
+Permission is granted to process this file through TeX
+and print the results, provided the printed document
+carries a copying permission notice identical to this
+one except for the removal of this paragraph (this
+paragraph not being relevant to the printed manual).
+
+@end ignore
+
+Permission is granted to copy and distribute modified
+versions of this manual under the conditions for
+verbatim copying, provided also that the sections
+entitled ``Copying'' and ``GNU General Public License''
+are included exactly as in the original, and provided
+that the entire resulting derived work is distributed
+under the terms of a permission notice identical to this
+one.
+
+Permission is granted to copy and distribute
+translations of this manual into another language,
+under the above conditions for modified versions,
+except that this permission notice may be stated in a
+translation approved by the Free Software Foundation.
+
+@end ifinfo
+@tex
+\def\preLilypondExample{\vspace{0.5cm}}
+@end tex
+
+@contents
+@node Top, , , (dir)
+@top
+
+
+
+@section Introduction
+
+[ The tutorial part is at the moment commented out and moved to
+the end of this document ]
+
+
+[TODO: THIS MANUAL IS NOT FINISHED YET. FIXME.]
+
+@command{lilypond-book} is a script that helps integrating lilypond with
+La@TeX{} or TeXinfo. @command{lilypond-book} runs Lilypond on fragments
+of lilypond in your source file, and includes the results into a
+document that can be processed with La@TeX{}, @command{makeinfo}
+or @command{texi2dvi}.
+The result is a text document with formatted music integrated.
+
+@command{lilypond-book} will do its best to try to align the music to
+the left and right margins. Currently the most used papersizes and
+one- and twocolumn mode is supported. But if you use some more
+advances features, like the geometry-package or change the margins in
+La@TeX{} or use @code{@@pagesize} in texinfo, will break.
+
+This document assumes you have basic knowledge of GNU LilyPond and
+La@TeX{} or texinfo.
+
+@section TeXinfo reference
+
+Your markup the lilypond code like this:
+@example
+@@lilypond[options, go, here]
+ YOUR LILYPOND CODE
+@@end lilypond
+@end example
+
+or
+
+@example
+@@lilypond[option, go, here]@{ YOUR LILYPOND CODE @}
+@end example
+
+@command{lilypond-book} knows the default margins, and a few papersizes.
+These commands should be in the beginning of the document:
+@itemize @bullet
+@item @code{@@afourpaper}
+@item @code{@@afourwide}
+@item @code{@@smallbook}
+@end itemize
+@code{@@pagesizes} are not supported.
+
+@subsection Examples
+
+Two simple examples. First a complete block:
+
+@example
+@@lilypond[26pt]
+c' d' e' f' g'2 g'
+@@end lilypond
+@end example
+
+produces this music:
+@lilypond
+c' d' e' f' g'2 g'
+@end lilypond
+
+Then the short version:
+@example
+@@lilypond[11pt]@{<c' e' g'>@}
+@end example
+
+and its music:
+
+@lilypond[11pt]{<c' e' g'>}
+
+
+@subsection @@example and @@code
+
+I'm not sure if this will go into the final documentation, this is
+here mostly to remember me on why things are the way they are.
+
+@command{lilypond-book} will do nothing with special with @code{@@code} and
+@code{@@example} environments. The 'code' and 'example' commands
+should work just as normal. People looking at document that should be
+processed by @command{lilypond-book}, should notice nothing special, except from
+some block like this:
+@example
+@@lilypond
+BLABLA
+@@end lilypond
+@end example
+
+or this:
+
+@code{@@lilypond@{ BLABLA @}}
+
+Anything other is a bug in @command{lilypond-book}.
+
+So to get this in the printed manual:
+
+@example
+@@lilypond[26pt]
+\relative c'@{c d e f g2 g@}
+@@end lilypond
+@end example
+
+you have to write this:
+
+@example
+@@example
+@@@@lilypond[26pt]
+\relative c'@@@{c d e f g2 g@@@}
+@@@@end lilypond
+@@end example
+@end example
+
+Simply explained, every '@{', '@}' and '@@' has to be written as '@@@{',
+'@@@}' and '@@@@'. This is how it works in plain texinfo too.
+
+@section La@TeX{} reference
+
+Your markup the lilypond code like this:
+@example
+\begin[option, go, here]@{lilypond@}
+ YOUR LILYPOND CODE
+\end@{lilypond@}
+@end example
+
+or
+
+@example
+\lilypond@{ YOUR LILYPOND CODE @}
+@end example
+
+The 'geometry' package is is not supported. The most popular
+papersizes should work.
+
+Lilypond-book know about the @code{\onecolumn} and
+@code{\twocolumn} commands.
+
+The music will be surrounded by @code{\preLilypondExample} and
+@code{\postLilypondExample}. The variables are
+defined to nothing by default, and the user can redefine them
+to whatever he wants.
+@strong{[UGH: THIS DOES NOT HAPPEN WHEN
+YOU USE THE SHORT FORM, \LILYPOND@{ ... @}, CHECK OUT WHY]}
+
+@subsection @code{landscape} package
+There is some simple support for landscape paper format, and this
+can be combined with the @code{\twocolumn} command. Only a4 and
+letter paper is supported, more to come...
+
+A more complete
+support, maybe also supporting the geometry package is planned, but
+there are more work that has to be done on @command{lilypond-book}
+first.
+
+This should work:
+@example
+\documentclass@{article@}
+\usepackage@{landscape@}
+\begin@{document@}
+\twocolumn
+BLA BLA BLA
+\end@{document@}
+@end example
+
+@subsection Examples
+
+@example
+\begin[26pt]@{lilypond@}
+c' d' e' f' g'2 g'2
+\end@{lilypond@}
+@end example
+
+produces this music:
+
+@lilypond[26pt]
+c' d' e' f' g'2 g'2
+@end lilypond
+
+Then the short version:
+@example
+\lilypond[11pt]@{<c' e' g'>@}
+@end example
+
+and its music:
+
+@lilypond[11pt]{<c' e' g'>}
+
+
+@subsection \begin@{verbatim@} and \verb|\verb|
+
+There work just as expected. Look at @file{mb-latex.tex} for details.
+
+@section Options
+
+@table @samp
+@item eps
+ the music is created as eps graphics that can be inserted in
+ the middle of a text line, not only as a separate paragraph.
+ (La@TeX{} only)
+@item verbatim
+ CONTENTS is copied into the source enclosed in a verbatim block,
+ followed by any text given with the @code{intertext} option, then
+ the actual music is displayed. This option does not work with
+ the short version of the lilypond blocks:
+
+ @code{ @@lilypond@{ CONTENTS @} } and @code{ \lilypond@{ CONTENTS @} }
+
+@item intertext="text inside apostrophs"
+ Used in conjunction with @code{verbatim} option.
+@item filename=FILENAME
+ Save the lilypond code to FILENAME instead of using a hash value
+ of CONTENTS.
+@item 11pt, 13pt, 16pt, 20pt, 26pt
+ set the fontsize to use for the music
+@item singleline
+ linewidth = -1.
+@item multiline
+ linewidth = textwidth
+@item fragment
+@item nonfragment
+ Override @command{lilypond-book} autodetection of what type of code is in the
+ lilypond block, voice contents or complete code.
+@end table
+
+@section Invocation
+
+When you run @command{lilypond-book} it will generate lots of small
+files that Lilypond will process. So to avoid all the garbage in
+your source directory, you should either change to a temporary
+directory, or use the @code{--outdir} commandline options:
+
+@code{cd out && lilypond-book ../yourfile.tex}
+
+@code{lilypond-book --outdir=out yourfile.tex}
+
+
+For latex input, the file to give to latex has ext @file{.latex}.
+TeXinfo input will be written to a file with ext @file{.texi}. So be
+careful, don't give the source file that ext, or the file will be
+overwritten.
+
+If you use @code{--outdir}, you should also @code{cd} to that directory
+before running LaTeX or makeinfo.
+
+@strong{[UGH: IS THIS THE BEST WAY TO DO IT. MAYBE ADD A COMMENT LINE TO THE
+GENERATED FILE, SO LILYPOND-BOOK CAN TEST IF THE FILE IT IS TO OVERWRITE
+IS GENERATED.]}
+
+@strong{About the input}
+
+If the file contains the ``block''
+
+@example
+
+ \begin@{lilypond@}
+ CONTENTS
+ \end@{lilypond@}
+
+@end example
+
+then LilyPond is run on CONTENTS. @command{lilypond-book} puts the result back,
+surrounded by @code{\preLilypondExample} and @code{\postLilypondExample}
+commands. @code{\preLilypondExample} and @code{posLilypondExample} is
+defined to nothing by default, and the user can redefine them
+to whatever he wants.
+
+
+@subsection Command line options
+
+@table @samp
+
+@item @option{-f}, @option{--format=}
+ Specify the document type to process, @code{latex} or @code{texi}.
+ @command{lilypond-book} usually figure out this automatically.
+@item --default-music-fontsize=??pt
+ Set the fontsize to use for lilypond if no fontsize is given
+ as option.
+@item --force-music-fontsize=??pt
+ Force all lilypond to use this fontsize, overriding options
+ given to \begin@{lilypond@}
+@item -I DIR, --include=DIR
+ include path
+@item -M, --dependencies
+ Write dependencies to out-www/filename.dep
+@item --dep-prefix=PREF
+ prepend PREF before each -M dependency
+@item -n, --no-lily
+ don't run lilypond
+@item --no-pictures
+ don't generate pictures
+@item --read-lys
+ don't write ly files. This way you can do
+ @example
+ lilypond-book file.tely
+ convert-ly
+ lilypond-book --read-lys
+ @end example
+@item --outname=FILE
+ The name of La@TeX{} file to output. If this option is not given,
+ the output name derived from the input name.
+@item --outdir=
+ where to place generated files
+@item --version
+ print version information
+@item --help
+ Print a short help message
+@end table
+
+
+
+@command{lilypond-book} is written in python 1.5, so you have to install
+@uref{http://www.python.org,python}.
+
+
+
+@section Bugs
+
+The La@TeX{} \includeonly@{...@} command is ignored.
+
+Ignores almost all La@TeX{} commands that changes margins and linewidths.
+
+@section Authors
+
+@email{hanwen@@cs.uu.nl, Han-Wen Nienhuys}, @uref{http://www.cs.uu.nl/people/hanwen}
+
+@email{tca@@gnu.org, Tom Cato Amundsen}
+
+@bye
+@ignore
+
+So what does this look like? Well, here is an example:
+@lilypond[veryverbatim, intertext="produces this music:"]
+\score{
+ \notes\relative c'{
+ \time 5/8;
+ [e16( g b c a g][e a b d] | )e2 d,8 |
+ [e16( g b c a g][e a b d] | )b2 [a16( f] |
+ [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] |
+ [f( a b d b a][f a b d] | )e2
+ }
+}
+@end lilypond
+If you are lucky, the above example show a nice feature of LilyPond
+and La@TeX{}. Since LilyPond can output the music as @TeX{} graphics,
+La@TeX{} can insert pagebreaks between the lines of music.
+
+Notice that there is no @code{\paper} statement in the example
+above. Lilypond-book will insert some code for you that defines the
+linewidth and the font to use. If you don't want to change the default,
+there is no need to put an empty @code{\paper@{@}} inside the @code{\score}.
+In the example above, something like
+this might be inserted before your code:
+@example
+\include "paper16.ly"
+\paper@{ \paper_sixteen
+ linewidth = 390.\pt;
+ castingalgorithm = \Gourlay;
+@}
+@end example
+The actual values for linewidth will differ depending on papersize and
+number of columns. Also, if you use a different fontsize for the
+music, another file than @code{paper16.ly} will be included.
+
+If you want to make the music not so wide, you can insert a
+@code{\paper} statement that set the linewidth:
+
+@lilypond[veryverbatim, intertext="produces this music:"]
+\score{
+ \notes\relative c'{
+ \time 5/8;
+ [e16( g b c a g][e a b d] | )e2 d,8 |
+ [e16( g b c a g][e a b d] | )b2 [a16( f] |
+ [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] |
+ [f( a b d b a][f a b d] | )e2
+ }
+ \paper{linewidth = 10.\cm;}
+}
+@end lilypond
+
+Very often, if you mix music and text, the music is often only a
+few notes or at most a few bars. This music should be as short as
+possible and not stretched to be aligned to the right margin.
+
+If you only write voice-contents in the lilypond block, @command{lilypond-book}
+will set the @code{linewidth} variable to -1, so Lilypond
+will make the music as short as possible but without breaking the
+line. Here is a well know harmonic progression:
+@lilypond[veryverbatim, intertext="produce a well known harmonic progression:"]
+ \context Voice { <c' e g> <b d g> <c2 e g> }
+@end lilypond
+
+If you want to place music examples in the text,
+@lilypond[eps]
+\context Voice { <c' e g> <b d g> <c2 e g>}
+@end lilypond
+, you can use the @code{eps} option. This will create the music as
+eps graphics and include it into the document with the
+@code{\includegraphics} command.
+
+The code used look like this:
+@example
+@@lilypond[eps]
+ \context Voice { <c' e g> <b d g> <c2 e g> }
+@@end lilypond
+@end example
+
+You can also use the @code{eps} option if the block is a complete
+lilypond source. This 5 cm long empty line,
+@lilypond[eps]
+\score{
+ \notes{s}
+ \paper{ linewidth = 5.\cm;}
+}
+@end lilypond
+was created with this code:
+@example
+@@lilypond[eps]
+\score@{
+ \notes@{s@}
+ \paper@{ linewidth = 5.\cm;@}
+@}
+@@end lilypond
+@end example
+
+To avoid that La@TeX{} places the music on a line of its one, there should
+be no empty lines between the normal text and the lilypond
+environment.
+
+You can also use @code{lilypondfile} (on a separate line, FIXME), to
+include another file.
+
+@section Fontsize options You can use all lilypond fontsizes in
+@command{lilypond-book}. The default 16pt fontsize is probably to big to be
+included in the middle of the text, 11pt or 13pt is probably better.
+
+The code can look like this:
+@example
+@@lilypond[13pt, eps]
+<c' e g>
+@@end lilypond
+@end example
+
+The following options set the fontsize:
+@itemize
+@item @code{11pt}
+@lilypond[11pt, eps]
+ \relative c'{
+ r16 [c d e][f d e c] [g'8 c][b-\prall c] |
+ [d16 g, a b][c a b g][d'8 g f-\prall g]
+ }
+@end lilypond
+@item @code{13pt}
+@lilypond[13pt, eps]
+ \relative c'{
+ r16 [c d e][f d e c] [g'8 c][b-\prall c] |
+ [d16 g, a b][c a b g][d'8 g f-\prall g]
+ }
+@end lilypond
+@item @code{16pt}
+@lilypond[16pt, eps]
+ \relative c'{
+ r16 [c d e][f d e c] [g'8 c][b-\prall c] |
+ [d16 g, a b][c a b g][d'8 g f-\prall g]
+ }
+@end lilypond
+@item @code{20pt}
+@lilypond[20pt, eps]
+ \relative c'{
+ r16 [c d e][f d e c] [g'8 c][b-\prall c] |
+ [d16 g, a b][c a b g][d'8 g f-\prall g]
+ }
+@end lilypond
+@item @code{26pt}
+@lilypond[26pt, eps]
+ \relative c'{
+ r16 [c d e][f d e c] [g'8 c][b-\prall c] |
+ [d16 g, a b][c a b g][d'8 g f-\prall g]
+ }
+@end lilypond
+@end itemize
+
+
+@section More options
+@itemize
+@item The @code{singleline} option set @code{linewidth} to -1.0.
+@item The @code{multiline} option set @code{linewidth} to a value letting
+the music be aligned to the right margin. The music can span several
+lines.
+@end itemize
+
+@section Just in case...
+The options @code{fragment} and @code{nonfragment} will override
+@command{lilypond-book} when it scans the lilypond code to see if it is voice
+contents or complete code. This might be useful if @command{lilypond-book} choose
+wrong.
+
+Since there is no finder's fee which doubles every year, there is no
+need to wait for the price money to grow. So send a bug report today
+if you need this one of these options.
+
+@section Examples
+
+This was all options to @code{\begin}. The rest of the lilypond
+document will show some ways you can use lilypond in
+La@TeX{} documents. It will also act as a simple test-suite for
+lilypond-book. You can place @code{eps} lilypond in and marginspars just
+as any other included eps graphics.
+
+@lilypond
+\score{
+ \notes\relative c'{
+ \time 12/8;
+ r4-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--]
+ [f16-.( )f-. dis8-- gis16-.( )gis-.] cis4.-\fermata |
+
+ r4.-\fermata [cis,16 cis g'8 f16 f b8][g16 g f8 b16 b] dis4.-\fermata
+ }
+ \paper{linewidth = 7.\cm;}
+}
+@end lilypond
+
+
+To the right you can see some bars from the trumpet fanfara from the
+beginning of the fantastic street opera ``Houdini the Great'', by the
+Danish composer Andy Pape. The music is put inside a
+@code{floatingfigure} environment, and the music will be aligned by
+the right marging if you set floatingfigure width and lilypond linewidth
+to the same value. The code looks like this:
+
+@lilypond[verbatim]
+\score{
+ \notes\relative c'{
+ \time 12/8;
+ r4.-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--]
+ [f16-.( )f-. dis8-- gis16-.( )gis-.] cis8.-\fermata |
+
+ r4.-\fermata [cis,16 cis g'8 f16 f b8]
+ [g16 g f8 b16 b] dis4.-\fermata
+ }
+ \paper{linewidth = 7.\cm;}
+}
+@end lilypond
+
+If you have a lot of small music examples like this in the middle of
+your text, you might get a nicer look by using ``double'' line
+spacing. Put the @code{\linespread@{1.6@}} command into the preamble of
+your document. Then the line spacing will not be increased between the
+lines where you have music printed with the smallest font size.
+
+Lilypond-book does know about @code{\onecolumn} and @code{\twocolumn}.
+So the music will be adjusted to the new linewith:
+
+Verbatim environments will also ignore the page margins. That is
+a feature of La@TeX{}. (But you usually put things inside a verbatim
+environment when you don't want La@TeX{} to do any linebreaking)
+
+@end ignore
@c Move to Reference Manual?
* Internals:(lilypond-internals). Auto generated detailed documentation.
* More information:: Where to turn to for more help.
-* convert-mudela:: Upgrading input files.
+* convert-ly:: Upgrading input files.
@c Hmm, having the generated doco in a separate file,
@c the index can't refer to that.
* Index:: Unified index.
@include moreinfo.itexi
-@include convert-mudela.itexi
+@include convert-ly.itexi
@node Index, , , Top
@unnumbered Index
@section DESCRIPTION
ly2dvi is a Python script which creates input file for La@TeX{},
based on information from the output files from LilyPond.
-The script handles multiple files. If a mudela file name is
+The script handles multiple files. If a lilypond file name is
specified LilyPond is run to make an output (@TeX{}) file.
One or more La@TeX{} files are created, based on information found
@section Features
-ly2dvi responds to several parameters specified in the mudela
+ly2dvi responds to several parameters specified in the lilypond
file. They are overridden by corresponding command line options.
@table @samp
@section Files
@file{titledefs.tex} is inspected for definitions used to extract
-additional text definitions from the mudela file. In the current
+additional text definitions from the lilypond file. In the current
version the following are defined:
@table @samp
+++ /dev/null
-\input texinfo @c -*-texinfo-*-
-@setfilename mudela-book.info
-@settitle mudela-book Manual
-@afourpaper
-@titlepage
-@title mudela-book Manual
-@subtitle Integrating mudela with La@TeX{} and TeXinfo
-@author Tom Cato Amundsen and Han-Wen Nienhuys
-
- Copyright @copyright{} 1999 by the authors
-
-@vskip 0pt plus 1filll
-
-Permission is granted to make and distribute verbatim
-copies of this manual provided the copyright notice and
-this permission notice are preserved on all copies.
-
-Permission is granted to copy and distribute modified
-versions of this manual under the conditions for
-verbatim copying, provided also that the sections
-entitled ``Copying'' and ``GNU General Public License''
-are included exactly as in the original, and provided
-that the entire resulting derived work is distributed
-under the terms of a permission notice identical to this
-one.
-
-Permission is granted to copy and distribute
-translations of this manual into another language,
-under the above conditions for modified versions,
-except that this permission notice may be stated in a
-translation approved by the Free Software Foundation.
-
-@end titlepage
-
-@ifinfo
-This file documents GNU LilyPond.
-
-Copyright 1999 Tom Cato Amundsen and Han-Wen Nienhuys
-
-
-Permission is granted to make and distribute verbatim
-copies of this manual provided the copyright notice and
-this permission notice are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX
-and print the results, provided the printed document
-carries a copying permission notice identical to this
-one except for the removal of this paragraph (this
-paragraph not being relevant to the printed manual).
-
-@end ignore
-
-Permission is granted to copy and distribute modified
-versions of this manual under the conditions for
-verbatim copying, provided also that the sections
-entitled ``Copying'' and ``GNU General Public License''
-are included exactly as in the original, and provided
-that the entire resulting derived work is distributed
-under the terms of a permission notice identical to this
-one.
-
-Permission is granted to copy and distribute
-translations of this manual into another language,
-under the above conditions for modified versions,
-except that this permission notice may be stated in a
-translation approved by the Free Software Foundation.
-
-@end ifinfo
-@tex
-\def\preMudelaExample{\vspace{0.5cm}}
-@end tex
-
-@contents
-@node Top, , , (dir)
-@top
-
-
-
-@section Introduction
-
-[ The tutorial part is at the moment commented out and moved to
-the end of this document ]
-
-
-[TODO: THIS MANUAL IS NOT FINISHED YET. FIXME.]
-
-@command{mudela-book} is a script that helps integrating mudela with
-La@TeX{} or TeXinfo. @command{mudela-book} runs Lilypond on fragments
-of mudela in your source file, and includes the results into a
-document that can be processed with La@TeX{}, @command{makeinfo}
-or @command{texi2dvi}.
-The result is a text document with formatted music integrated.
-
-@command{mudela-book} will do its best to try to align the music to
-the left and right margins. Currently the most used papersizes and
-one- and twocolumn mode is supported. But if you use some more
-advances features, like the geometry-package or change the margins in
-La@TeX{} or use @code{@@pagesize} in texinfo, will break.
-
-This document assumes you have basic knowledge of GNU LilyPond and
-La@TeX{} or texinfo.
-
-@section TeXinfo reference
-
-Your markup the mudela code like this:
-@example
-@@mudela[options, go, here]
- YOUR MUDELA CODE
-@@end mudela
-@end example
-
-or
-
-@example
-@@mudela[option, go, here]@{ YOUR MUDELA CODE @}
-@end example
-
-@command{mudela-book} knows the default margins, and a few papersizes.
-These commands should be in the beginning of the document:
-@itemize @bullet
-@item @code{@@afourpaper}
-@item @code{@@afourwide}
-@item @code{@@smallbook}
-@end itemize
-@code{@@pagesizes} are not supported.
-
-@subsection Examples
-
-Two simple examples. First a complete block:
-
-@example
-@@mudela[26pt]
-c' d' e' f' g'2 g'
-@@end mudela
-@end example
-
-produces this music:
-@mudela
-c' d' e' f' g'2 g'
-@end mudela
-
-Then the short version:
-@example
-@@mudela[11pt]@{<c' e' g'>@}
-@end example
-
-and its music:
-
-@mudela[11pt]{<c' e' g'>}
-
-
-@subsection @@example and @@code
-
-I'm not sure if this will go into the final documentation, this is
-here mostly to remember me on why things are the way they are.
-
-@command{mudela-book} will do nothing with special with @code{@@code} and
-@code{@@example} environments. The 'code' and 'example' commands
-should work just as normal. People looking at document that should be
-processed by @command{mudela-book}, should notice nothing special, except from
-some block like this:
-@example
-@@mudela
-BLABLA
-@@end mudela
-@end example
-
-or this:
-
-@code{@@mudela@{ BLABLA @}}
-
-Anything other is a bug in @command{mudela-book}.
-
-So to get this in the printed manual:
-
-@example
-@@mudela[26pt]
-\relative c'@{c d e f g2 g@}
-@@end mudela
-@end example
-
-you have to write this:
-
-@example
-@@example
-@@@@mudela[26pt]
-\relative c'@@@{c d e f g2 g@@@}
-@@@@end mudela
-@@end example
-@end example
-
-Simply explained, every '@{', '@}' and '@@' has to be written as '@@@{',
-'@@@}' and '@@@@'. This is how it works in plain texinfo too.
-
-@section La@TeX{} reference
-
-Your markup the mudela code like this:
-@example
-\begin[option, go, here]@{mudela@}
- YOUR MUDELA CODE
-\end@{mudela@}
-@end example
-
-or
-
-@example
-\mudela@{ YOUR MUDELA CODE @}
-@end example
-
-The 'geometry' package is is not supported. The most popular
-papersizes should work.
-
-Mudela-book know about the @code{\onecolumn} and
-@code{\twocolumn} commands.
-
-The music will be surrounded by @code{\preMudelaExample} and
-@code{\postMudelaExample}. The variables are
-defined to nothing by default, and the user can redefine them
-to whatever he wants.
-@strong{[UGH: THIS DOES NOT HAPPEN WHEN
-YOU USE THE SHORT FORM, \MUDELA@{ ... @}, CHECK OUT WHY]}
-
-@subsection @code{landscape} package
-There is some simple support for landscape paper format, and this
-can be combined with the @code{\twocolumn} command. Only a4 and
-letter paper is supported, more to come...
-
-A more complete
-support, maybe also supporting the geometry package is planned, but
-there are more work that has to be done on @command{mudela-book}
-first.
-
-This should work:
-@example
-\documentclass@{article@}
-\usepackage@{landscape@}
-\begin@{document@}
-\twocolumn
-BLA BLA BLA
-\end@{document@}
-@end example
-
-@subsection Examples
-
-@example
-\begin[26pt]@{mudela@}
-c' d' e' f' g'2 g'2
-\end@{mudela@}
-@end example
-
-produces this music:
-
-@mudela[26pt]
-c' d' e' f' g'2 g'2
-@end mudela
-
-Then the short version:
-@example
-\mudela[11pt]@{<c' e' g'>@}
-@end example
-
-and its music:
-
-@mudela[11pt]{<c' e' g'>}
-
-
-@subsection \begin@{verbatim@} and \verb|\verb|
-
-There work just as expected. Look at @file{mb-latex.tex} for details.
-
-@section Options
-
-@table @samp
-@item eps
- the music is created as eps graphics that can be inserted in
- the middle of a text line, not only as a separate paragraph.
- (La@TeX{} only)
-@item verbatim
- CONTENTS is copied into the source enclosed in a verbatim block,
- followed by any text given with the @code{intertext} option, then
- the actual music is displayed. This option does not work with
- the short version of the mudela blocks:
-
- @code{ @@mudela@{ CONTENTS @} } and @code{ \mudela@{ CONTENTS @} }
-
-@item intertext="text inside apostrophs"
- Used in conjunction with @code{verbatim} option.
-@item filename=FILENAME
- Save the mudela code to FILENAME instead of using a hash value
- of CONTENTS.
-@item 11pt, 13pt, 16pt, 20pt, 26pt
- set the fontsize to use for the music
-@item singleline
- linewidth = -1.
-@item multiline
- linewidth = textwidth
-@item fragment
-@item nonfragment
- Override @command{mudela-book} autodetection of what type of code is in the
- mudela block, voice contents or complete code.
-@end table
-
-@section Invocation
-
-When you run @command{mudela-book} it will generate lots of small
-files that Lilypond will process. So to avoid all the garbage in
-your source directory, you should either change to a temporary
-directory, or use the @code{--outdir} commandline options:
-
-@code{cd out && mudela-book ../yourfile.tex}
-
-@code{mudela-book --outdir=out yourfile.tex}
-
-
-For latex input, the file to give to latex has ext @file{.latex}.
-TeXinfo input will be written to a file with ext @file{.texi}. So be
-careful, don't give the source file that ext, or the file will be
-overwritten.
-
-If you use @code{--outdir}, you should also @code{cd} to that directory
-before running LaTeX or makeinfo.
-
-@strong{[UGH: IS THIS THE BEST WAY TO DO IT. MAYBE ADD A COMMENT LINE TO THE
-GENERATED FILE, SO MUDELA-BOOK CAN TEST IF THE FILE IT IS TO OVERWRITE
-IS GENERATED.]}
-
-@strong{About the input}
-
-If the file contains the ``block''
-
-@example
-
- \begin@{mudela@}
- CONTENTS
- \end@{mudela@}
-
-@end example
-
-then LilyPond is run on CONTENTS. @command{mudela-book} puts the result back,
-surrounded by @code{\preMudelaExample} and @code{\postMudelaExample}
-commands. @code{\preMudelaExample} and @code{posMudelaExample} is
-defined to nothing by default, and the user can redefine them
-to whatever he wants.
-
-
-@subsection Command line options
-
-@table @samp
-
-@item @option{-f}, @option{--format=}
- Specify the document type to process, @code{latex} or @code{texi}.
- @command{mudela-book} usually figure out this automatically.
-@item --default-music-fontsize=??pt
- Set the fontsize to use for mudela if no fontsize is given
- as option.
-@item --force-music-fontsize=??pt
- Force all mudela to use this fontsize, overriding options
- given to \begin@{mudela@}
-@item -I DIR, --include=DIR
- include path
-@item -M, --dependencies
- Write dependencies to out-www/filename.dep
-@item --dep-prefix=PREF
- prepend PREF before each -M dependency
-@item -n, --no-lily
- don't run lilypond
-@item --no-pictures
- don't generate pictures
-@item --read-lys
- don't write ly files. This way you can do
- @example
- mudela-book file.tely
- convert-mudela
- mudela-book --read-lys
- @end example
-@item --outname=FILE
- The name of La@TeX{} file to output. If this option is not given,
- the output name derived from the input name.
-@item --outdir=
- where to place generated files
-@item --version
- print version information
-@item --help
- Print a short help message
-@end table
-
-
-
-@command{mudela-book} is written in python 1.5, so you have to install
-@uref{http://www.python.org,python}.
-
-
-
-@section Bugs
-
-The La@TeX{} \includeonly@{...@} command is ignored.
-
-Ignores almost all La@TeX{} commands that changes margins and linewidths.
-
-@section Authors
-
-@email{hanwen@@cs.uu.nl, Han-Wen Nienhuys}, @uref{http://www.cs.uu.nl/people/hanwen}
-
-@email{tca@@gnu.org, Tom Cato Amundsen}
-
-@bye
-@ignore
-
-So what does this look like? Well, here is an example:
-@mudela[veryverbatim, intertext="produces this music:"]
-\score{
- \notes\relative c'{
- \time 5/8;
- [e16( g b c a g][e a b d] | )e2 d,8 |
- [e16( g b c a g][e a b d] | )b2 [a16( f] |
- [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] |
- [f( a b d b a][f a b d] | )e2
- }
-}
-@end mudela
-If you are lucky, the above example show a nice feature of LilyPond
-and La@TeX{}. Since LilyPond can output the music as @TeX{} graphics,
-La@TeX{} can insert pagebreaks between the lines of music.
-
-Notice that there is no @code{\paper} statement in the example
-above. Mudela-book will insert some code for you that defines the
-linewidth and the font to use. If you don't want to change the default,
-there is no need to put an empty @code{\paper@{@}} inside the @code{\score}.
-In the example above, something like
-this might be inserted before your code:
-@example
-\include "paper16.ly"
-\paper@{ \paper_sixteen
- linewidth = 390.\pt;
- castingalgorithm = \Gourlay;
-@}
-@end example
-The actual values for linewidth will differ depending on papersize and
-number of columns. Also, if you use a different fontsize for the
-music, another file than @code{paper16.ly} will be included.
-
-If you want to make the music not so wide, you can insert a
-@code{\paper} statement that set the linewidth:
-
-@mudela[veryverbatim, intertext="produces this music:"]
-\score{
- \notes\relative c'{
- \time 5/8;
- [e16( g b c a g][e a b d] | )e2 d,8 |
- [e16( g b c a g][e a b d] | )b2 [a16( f] |
- [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] |
- [f( a b d b a][f a b d] | )e2
- }
- \paper{linewidth = 10.\cm;}
-}
-@end mudela
-
-Very often, if you mix music and text, the music is often only a
-few notes or at most a few bars. This music should be as short as
-possible and not stretched to be aligned to the right margin.
-
-If you only write voice-contents in the mudela block, @command{mudela-book}
-will set the @code{linewidth} variable to -1, so Lilypond
-will make the music as short as possible but without breaking the
-line. Here is a well know harmonic progression:
-@mudela[veryverbatim, intertext="produce a well known harmonic progression:"]
- \context Voice { <c' e g> <b d g> <c2 e g> }
-@end mudela
-
-If you want to place music examples in the text,
-@mudela[eps]
-\context Voice { <c' e g> <b d g> <c2 e g>}
-@end mudela
-, you can use the @code{eps} option. This will create the music as
-eps graphics and include it into the document with the
-@code{\includegraphics} command.
-
-The code used look like this:
-@example
-@@mudela[eps]
- \context Voice { <c' e g> <b d g> <c2 e g> }
-@@end mudela
-@end example
-
-You can also use the @code{eps} option if the block is a complete
-mudela source. This 5 cm long empty line,
-@mudela[eps]
-\score{
- \notes{s}
- \paper{ linewidth = 5.\cm;}
-}
-@end mudela
-was created with this code:
-@example
-@@mudela[eps]
-\score@{
- \notes@{s@}
- \paper@{ linewidth = 5.\cm;@}
-@}
-@@end mudela
-@end example
-
-To avoid that La@TeX{} places the music on a line of its one, there should
-be no empty lines between the normal text and the mudela
-environment.
-
-You can also use @code{mudelafile} (on a separate line, FIXME), to
-include another file.
-
-@section Fontsize options You can use all lilypond fontsizes in
-@command{mudela-book}. The default 16pt fontsize is probably to big to be
-included in the middle of the text, 11pt or 13pt is probably better.
-
-The code can look like this:
-@example
-@@mudela[13pt, eps]
-<c' e g>
-@@end mudela
-@end example
-
-The following options set the fontsize:
-@itemize
-@item @code{11pt}
-@mudela[11pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end mudela
-@item @code{13pt}
-@mudela[13pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end mudela
-@item @code{16pt}
-@mudela[16pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end mudela
-@item @code{20pt}
-@mudela[20pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end mudela
-@item @code{26pt}
-@mudela[26pt, eps]
- \relative c'{
- r16 [c d e][f d e c] [g'8 c][b-\prall c] |
- [d16 g, a b][c a b g][d'8 g f-\prall g]
- }
-@end mudela
-@end itemize
-
-
-@section More options
-@itemize
-@item The @code{singleline} option set @code{linewidth} to -1.0.
-@item The @code{multiline} option set @code{linewidth} to a value letting
-the music be aligned to the right margin. The music can span several
-lines.
-@end itemize
-
-@section Just in case...
-The options @code{fragment} and @code{nonfragment} will override
-@command{mudela-book} when it scans the mudela code to see if it is voice
-contents or complete code. This might be useful if @command{mudela-book} choose
-wrong.
-
-Since there is no finder's fee which doubles every year, there is no
-need to wait for the price money to grow. So send a bug report today
-if you need this one of these options.
-
-@section Examples
-
-This was all options to @code{\begin}. The rest of the mudela
-document will show some ways you can use mudela in
-La@TeX{} documents. It will also act as a simple test-suite for
-mudela-book. You can place @code{eps} mudela in and marginspars just
-as any other included eps graphics.
-
-@mudela
-\score{
- \notes\relative c'{
- \time 12/8;
- r4-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--]
- [f16-.( )f-. dis8-- gis16-.( )gis-.] cis4.-\fermata |
-
- r4.-\fermata [cis,16 cis g'8 f16 f b8][g16 g f8 b16 b] dis4.-\fermata
- }
- \paper{linewidth = 7.\cm;}
-}
-@end mudela
-
-
-To the right you can see some bars from the trumpet fanfara from the
-beginning of the fantastic street opera ``Houdini the Great'', by the
-Danish composer Andy Pape. The music is put inside a
-@code{floatingfigure} environment, and the music will be aligned by
-the right marging if you set floatingfigure width and mudela linewidth
-to the same value. The code looks like this:
-
-@mudela[verbatim]
-\score{
- \notes\relative c'{
- \time 12/8;
- r4.-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--]
- [f16-.( )f-. dis8-- gis16-.( )gis-.] cis8.-\fermata |
-
- r4.-\fermata [cis,16 cis g'8 f16 f b8]
- [g16 g f8 b16 b] dis4.-\fermata
- }
- \paper{linewidth = 7.\cm;}
-}
-@end mudela
-
-If you have a lot of small music examples like this in the middle of
-your text, you might get a nicer look by using ``double'' line
-spacing. Put the @code{\linespread@{1.6@}} command into the preamble of
-your document. Then the line spacing will not be increased between the
-lines where you have music printed with the smallest font size.
-
-Mudela-book does know about @code{\onecolumn} and @code{\twocolumn}.
-So the music will be adjusted to the new linewith:
-
-Verbatim environments will also ignore the page margins. That is
-a feature of La@TeX{}. (But you usually put things inside a verbatim
-environment when you don't want La@TeX{} to do any linebreaking)
-
-@end ignore
Currently, the standard layout @code{""} and mensural notation
@code{"mensural"} are available. Mensural rests of duration
32 or shorter are not available.
-@mudela[verbatim]
+@lilypond[verbatim]
r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128
\property Staff.restStyle = "mensural"
r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128
-@end mudela
+@end lilypond
@item @code{transposing}@indexcode{transposing} @propertytype{integer}
Transpose the MIDI output. Set this property to the number of
The different time signature characters are shown below with its
names:
-@mudela[center,verbatim]
+@lilypond[center,verbatim]
\score {
\notes\relative c'' {
}
}
-@end mudela
+@end lilypond
@end table
@section Overview
This document@footnote{This document has been revised for
-LilyPond 1.2.} describes the the GNU LilyPond input format, which is
-a language for defining music. We call this language @emph{Music
-Definition Language} or @emph{Mudela}, for short.@footnote{If anybody
-comes up with a better name, we'd gladly take this. Gourlay already
-uses a ``Musical Description Language,'' ISO standard 10743 defines a
-``Standard Music Description Language.'' We're not being original
-here.}
+LilyPond 1.2.} describes the the GNU LilyPond input format
-@emph{Mudela} is a language that allows you to
+with @emph{Lilypond}-input you can
@itemize @bullet
@item create musical expressions by combining pitches, durations
you can enter them in manageable chunks.
@end itemize
-@emph{Mudela} aims to define a piece of music completely, both from
+@emph{Lilypond} input aims to define a piece of music completely, both from
typesetting and from a performance point of view.
Specify the version of LilyPond that a file was written for. The
argument is a version string in quotes, for example @code{"1.2.0"}.
This is used to detect invalid input, and to aid
-@code{convert-mudela}, a tool that automatically upgrades input files.
+@code{convert-ly}, a tool that automatically upgrades input files.
@node modes, , , Reference Manual
-To simplify entering notes, lyrics, and chords, @emph{Mudela} has three
+To simplify entering notes, lyrics, and chords, @emph{Lilypond} has three
special input modes on top of the default mode. In each mode, words
are identified on the input. If @code{"word"} is encountered, it is
treated as a string. If @code{\word} is encountered, it is treated as
@item Normal mode.
@cindex mode!normal
- At the start of parsing, @emph{Mudela} is in Normal mode. In Normal
+ At the start of parsing, @emph{Lilypond} is in Normal mode. In Normal
mode, a word is an alphabetic character followed by alphanumeric
characters. If @code{word} is encountered on the input it is
treated as a string.
@cindex types and identifiers
-@emph{Mudela} has a limited set of types:
+@emph{Lilypond} has a limited set of types:
@itemize @bullet
@item integers
@item score definitions (@code{\score}@keyindex{score} blocks)
@end itemize
-Type is a syntactical property: @emph{Mudela} has no real type system,
+Type is a syntactical property: @emph{Lilypond} has no real type system,
so there is no support for generic expressions, functions, or user
defined types. For the same reason, it is not possible to mix reals
and integers in arithmetic expressions, and ``type
identifier, you use `@var{name}=@var{value}' and to refer to an
identifier, you preceed its name with a backslash:
`@code{\}@var{name}'. Identifier assignments must appear at top level
-in the @emph{Mudela} file. Semicolons are forbidden after assignments
+in the @emph{Lilypond} file. Semicolons are forbidden after assignments
appearing at top level but they are obligatory after assignments
appearing in the @code{\paper} block, see Section XREF-paper [FIXME].
@cindex music expressions
-Music in @emph{Mudela} is entered as a music expression. Notes, rests,
+Music in @emph{Lilypond} is entered as a music expression. Notes, rests,
lyric syllables are music expressions (the atomic
expressions)
@cindex atomic music expressions
(`@code{,}@indexcode{,}') characters. Each @code{'} raises the pitch by one
octave; each @code{,} lowers the pitch by an octave.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
c' d' e' f' g' a' b' c''
-@end mudela
+@end lilypond
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
cis' dis' eis' fis' gis' ais' bis'
-@end mudela
+@end lilypond
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
ces' des' es' fes' ges' as' bes'
-@end mudela
+@end lilypond
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
cisis' eisis' gisis' aisis' beses'
-@end mudela
+@end lilypond
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
ceses' eses' geses' ases' beses'
-@end mudela
+@end lilypond
Whenever a C-sharp is desired, you must specify a C-sharp. LilyPond
will determine what accidentals to typeset depending on the key and
accidental within parentheses can be obtained by adding the question
mark `@code{?}@indexcode{?}' after the pitch.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
cis' d' e' cis' c'? d' e' c'!
-@end mudela
+@end lilypond
@cindex duration
@quotation
-@mudela[]
+@lilypond[]
\score {
\notes \relative c'' {
a\longa a\breve
} %}
}
}
-@end mudela
+@end lilypond
@end quotation
@quotation
@quotation
-@mudela[]
+@lilypond[]
\score {
\notes \relative c'' {
r\longa r\breve
}
}
}
-@end mudela
+@end lilypond
@end quotation
If the duration is omitted then it is set equal to the previous
assumed. The duration can be followed by a dot (`@code{.}@indexcode{.}')
to obtain dotted note lengths.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
a'4. b'4.
-@end mudela
+@end lilypond
You can alter the length of duration by writing
`@code{*}@var{fraction}' after it. This will not affect the
you need to know exactly how the backend works. Example:
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
\relative c'' { c4
\context Staff \outputproperty
#(make-type-checker 'Note_head)
#'extra-offset = #'(5.0 . 7.5)
<c8 e g> }
-@end mudela
+@end lilypond
This selects all note heads occurring at current staff level, and sets
the extra-offset of those heads to (5,7.5), shifting them up and
@quotation
-@mudela[]
+@lilypond[]
\score {
\notes {
\cadenzaOn
linewidth = -1.0;
}
}
-@end mudela
+@end lilypond
@end quotation
@quotation
-@mudela[]
+@lilypond[]
\score {
\notes {
\cadenzaOn
linewidth = 4.5 \in;
}
}
-@end mudela
+@end lilypond
@end quotation
The three clef symbols can also be obtained using the names `@code{G}',
A beam is specified by surrounding the beamed notes with brackets
`@code{[}@indexcode{[}' and `@code{]}@indexcode{]}'.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
[a'8 a'] [a'16 a' a' a']
-@end mudela
+@end lilypond
Some more elaborate constructions:
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
[a'16 <a' c''> c'' <a' c''>]
\times 2/3 { [e'8 f' g'] }
-@end mudela
+@end lilypond
Beaming can be generated automatically; see section XREF-autobeam [FIXME].
XREF-tremolo [FIXME]).
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
\repeat "tremolo" 8 { c16 d16 }
\repeat "tremolo" 4 { c16 d16 }
-@end mudela
+@end lilypond
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
c'4:32
-@end mudela
+@end lilypond
@cindex --@@@code{-}@code{-}
If you try to tie together chords which have no common pitches, a
warning message will appear and no ties will be created.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
e' ~ e' <c' e' g'> ~ <c' e' g'>
-@end mudela
+@end lilypond
respectively. Here is a chart showing symbols above notes, with the
name of the corresponding symbol appearing underneath.
-@mudela[]
+@lilypond[]
\score {
< \notes {
}
}
-@end mudela
+@end lilypond
In addition, it is possible to place arbitrary strings of text or
@TeX{} above or below notes by using a string instead of an
supported) and single characters shorthands exist for a few
common symbols
-@mudela[]
+@lilypond[]
\score {
\notes {
}
}
-@end mudela
+@end lilypond
Dynamic marks are specified by using an identifier after a note:
`@code{c4-\ff}' (the dash is optional for dynamics: `@code{c4 \ff})'.
first note in the slur. This makes it possible to put a note in
slurs from both sides:
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
f'()g'()a' [a'8 b'(] a'4 g'2 )f'4
-@end mudela
+@end lilypond
@cindex crescendo
bound to notes, if you want to get several marks during one note, you
must use spacer notes.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
c'' \< \! c'' d'' \decr e'' \rced
< f''1 { s4 \< \! s2 \> \! s4 } >
-@end mudela
+@end lilypond
@example
You can attach a (general) span request to a note using
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
c'4-\spanrequest \start "slur"
c'4-\spanrequest \stop "slur"
-@end mudela
+@end lilypond
The slur syntax with parentheses is a shorthand for this.
used, or the value of the @code{tremoloFlags}@indexcode{tremoloFlags} property if there was
no last value.
-@mudela[verbatim,fragment,center]
+@lilypond[verbatim,fragment,center]
c'2:8 c':32
-@end mudela
+@end lilypond
expressions any way you like. This simple example shows how three
chords can be expressed in two different ways:
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
\notes \context Staff {
\cadenzaOn
<a c'> <b d' > <c' e'>
< { a b c' } { c' d' e' } >
}
-@end mudela
+@end lilypond
@cindex context selection
@c @keyindex{context}
If you try to use a chord as the first thing in your score, you might
get multiple staffs instead of a chord.
-@mudela[verbatim,center]
+@lilypond[verbatim,center]
\score {
\notes <c''4 e''>
\paper {
linewidth = -1.;
}
}
-@end mudela
+@end lilypond
This happens because the chord is interpreted by a score context.
Each time a note is encountered a default Voice context (along with a
Staff context) is created. The solution is to explicitly instantiate
a Voice context:
-@mudela[verbatim,center]
+@lilypond[verbatim,center]
\score {
\notes\context Voice <c''4 e''>
\paper {
linewidth = -1.;
}
}
-@end mudela
+@end lilypond
Entering scales is straightforward in relative mode.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
\relative c' {
c d e f g a b c c,
}
-@end mudela
+@end lilypond
And octave changing marks are used for intervals greater than a fourth.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
\relative c'' {
c g c f, c' a, e'' }
-@end mudela
+@end lilypond
If the preceding item is a chord, the first note of the chord is used
to determine the first note of the next chord. But other notes
within the second chord are determined by looking at the immediately
preceding note.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
\relative c' {
c <c e g>
<c' e g>
<c, e' g>
}
-@end mudela
+@end lilypond
The pitch after the @code{\relative} contains a notename. To parse
the pitch as a notename, you have to be in note mode, so there must
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
\transpose c'' {
\chords {
c1 c:3- c:7 c:8
}
}
-@end mudela
+@end lilypond
@end quotation
The second type of modifier that may appear after the `@code{:}' is a
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
\transpose c'' {
\chords {
c1:m c:min7 c:maj c:aug c:dim c:sus
}
}
-@end mudela
+@end lilypond
@end quotation
notes to be subtracted are listed after a `@code{^}' character,
separated by dots.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
\transpose c'' {
\chords {
c1^3 c:7^5.3 c:8^7
}
}
-@end mudela
+@end lilypond
Chord inversions can be specified by appending `@code{/}@indexcode{/}' and
the name of a single note to a chord. This has the effect of
note in the chord. If the specified note is not in the chord, a
warning will be printed.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
\transpose c''' {
\chords {
c1 c/e c/g c:7/e
}
}
-@end mudela
+@end lilypond
Bass notes can be added by `@code{/+}@indexcode{/+}' and
the name of a single note to a chord. This has the effect of
adding the specified note to the chord, lowered by an octave,
so it becomes the lowest note in the chord.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
\transpose c''' {
\chords {
c1 c/+c c/+g c:7/+b
}
}
-@end mudela
+@end lilypond
Throughout these examples, chords have been shifted around the staff
using @code{\transpose}.
which 3 notes have the length of 2, so the notes are 2/3 of
their written length:
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
g'4 \times 2/3 {c'4 c' c'} d'4 d'4
-@end mudela
+@end lilypond
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
\relative c'' {
\grace c8 c4 \grace { [c16 c16] } c4
\grace { \property Grace.flagStyle = "" c16 } c4
}
-@end mudela
+@end lilypond
@end quotation
At present, nesting @code{\grace}@keyindex{grace} notes, e.g.
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
c'1
\repeat volta 2 { c'4 d' e' f' }
\repeat volta 2 { f' e' d' c' }
-@end mudela
+@end lilypond
@end quotation
With alternative endings:
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
c'1
\repeat volta 2 {c'4 d' e' f'}
\alternative { {d'2 d'} {f' f} }
-@end mudela
+@end lilypond
@end quotation
Folded repeats look like this:@footnote{Folded repeats offer little
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
c'1
\repeat fold 2 {c'4 d' e' f'}
\alternative { {d'2 d'} {f' f} }
-@end mudela
+@end lilypond
@end quotation
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
\context Staff {
\relative c' {
\partial 4;
}
}
-@end mudela
+@end lilypond
@end quotation
If you don't give enough alternatives for all of the repeats, then
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
\context Staff {
\relative c' {
\repeat volta 3 { \partial 4; e | c2 d2 | e2 f2 | }
}
}
-@end mudela
+@end lilypond
@end quotation
It is possible to nest @code{\repeat}. This is not entirely
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
\context Staff {
\clef "F";
{ \key e \major; c d e f }
\transpose cis'' { \key e \major; c d e f }
}
-@end mudela
+@end lilypond
@end quotation
If you want to use both @code{\transpose} and @code{\relative}, then
@quotation
-@mudela[verbatim,fragment]
+@lilypond[verbatim,fragment]
\addlyrics
\transpose c'' {
\property Voice.automaticMelismata = ##t
\context Lyrics \lyrics {
do4 re mi fa }
-@end mudela
+@end lilypond
@end quotation
You should use a single rhythm melody, and single rhythm lyrics (a
@quotation
-@mudela[verbatim,fragment]
+@lilypond[verbatim,fragment]
\addlyrics
\transpose c'' {
c8 () cis d8. e16 f2
< { do4 re mi fa }
{ do8 re mi fa } >
-@end mudela
+@end lilypond
@end quotation
It is valid (but probably not very useful) to use notes instead of
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
<
\context ChordNames {
\chords{a b c} \notes{<d f g> <e g b>}
}
>
-@end mudela
+@end lilypond
@end quotation
LilyPond examines chords specified as lists of notes to determine a
name to give the chord. By default, LilyPond will not try to
identify chord inversions:
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
<
\context ChordNameVoice \notes {
<e'1 g' c''>
<e'1 g' c''>
}
>
-@end mudela
+@end lilypond
If you want inversions to be recognized, you must set the property
@code{ChordNames.chordInversion}@indexcode{ChordNames.chordInversion}:
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
<
\property Score.chordInversion = ##t
\context ChordNameVoice \notes {
<e'1 g' c''>
}
>
-@end mudela
+@end lilypond
@quotation
-@mudela[verbatim]
+@lilypond[verbatim]
\score {
<
\notes \transpose c'' {
>
}
-@end mudela
+@end lilypond
@end quotation
You may want a continuous line after the syllables to show melismata.
@quotation
-@mudela[verbatim]
+@lilypond[verbatim]
\score {
<
\notes \relative c'' {
>
}
-@end mudela
+@end lilypond
@end quotation
@quotation
-@mudela[verbatim]
+@lilypond[verbatim]
\score {
<
\notes \transpose c'' {
>
}
-@end mudela
+@end lilypond
@end quotation
@quotation
-@mudela[verbatim]
+@lilypond[verbatim]
\score {
\notes \relative c'' {
c4 <d4 \context Staff = "another" e4> f
}
}
-@end mudela
+@end lilypond
@end quotation
In this example, the @code{c} and @code{d} are printed on the
doesn't result in this:
-@mudela[]
+@lilypond[]
\score {
\notes \relative c'' {
}
}
-@end mudela
+@end lilypond
For the @code{c4}, a default @code{Staff} (with a contained
@code{Voice}) context is created. After the @code{c4} ends, no
LilyPond prints music from a specification that you, the user, supply.
You have to give that specification using a @emph{language}. This
document is a gentle introduction to that language, which is called
-Mudela, an acronym of Music Definition Language.
+Lilypond, an acronym of Music Definition Language.
-This tutorial will demonstrate how to use Mudela by presenting
+This tutorial will demonstrate how to use Lilypond by presenting
examples of input along with resulting output. We will use English
terms for notation. In case you are not familiar with those, you may
consult the glossary that is distributed with LilyPond.
The examples discussed are included in the distribution, in the
subdirectory @file{input/tutorial/}. It is recommended that you
-experiment with writing Mudela input yourself, to get a feel for
+experiment with writing Lilypond input yourself, to get a feel for
how LilyPond behaves.
@node The first tune, , , Tutorial
full fledged, yet simple example. It is a convoluted version
of the famous menuet in J. S. Bach's @emph{Klavierbuechlein}.
-@mudela[verbatim]
+@lilypond[verbatim]
% lines preceded by a percent are comments which
% are ignored by Lilypond.
\include "paper16.ly"
linewidth = 14.0 \cm;
}
}
-@end mudela
+@end lilypond
Enter it (or copy it, the filename is @file{menuet.ly}), compile it
with LilyPond and view the output. Details of this procedure may vary
\score @{
@end example
- A mudela file combines music with directions for outputting that
+ A lilypond file combines music with directions for outputting that
music. The music is combined with the output directions by putting
them into a @code{\score} block.
@example
the start of a measure. This can help you track down errors.
So far, no notes were chromatically altered. Here is the first one
-that is: @code{fis}. Mudela by default uses Dutch note names, and
+that is: @code{fis}. Lilypond by default uses Dutch note names, and
``Fis'' is the Dutch note name for ``F sharp''. However, there is no
sharp sign in the output. The program keeps track of key signatures,
and will only print accidentals if they are needed.
@center @strong{The river is flowing}
@center Traditional
-@mudela[center]
+@lilypond[center]
\header {
title = "The river is flowing";
composer = "Traditional (?)";
\midi { \tempo 4=72;}
\paper { linewidth = 10.0\cm; }
}
-@end mudela
+@end lilypond
Again, we will dissect the file line by line.
@example
file is a piano reduction of the G major Sinfonia by Giovanni Battista
Sammartini. It was composed around 1740.
-@mudela[verbatim]
+@lilypond[verbatim]
\version "1.3.60";
\include "paper16.ly";
indent = 0.0;
linewidth = 15.0 \cm; }
}
-@end mudela
+@end lilypond
If it looks like incomprehensible gibberish to you@dots{} Then you are
right. The author has doctored this example to have as many quirks in
@example
\version "1.3.61";
@end example
-Lilypond and the Mudela language is still under development, therefore
+Lilypond and the Lilypond language is still under development, therefore
it is useful to indicate the Lilypond version of the file. Lilypond
will check the version number and warn you when the syntax has
-changed. Also, the @code{convert-mudela} program will be able to
+changed. Also, the @code{convert-ly} program will be able to
update most of the syntax changes automatically.
@example
viola = \notes \relative c' \context Voice = viola @{
/usr/local/man/man1/midi2ly.1
/usr/local/man/man1/abc2ly.1
/usr/local/man/man1/etf2ly.1
- /usr/local/man/man1/convert-mudela.1
- /usr/local/man/man1/mudela-book.1
+ /usr/local/man/man1/convert-ly.1
+ /usr/local/man/man1/lilypond-book.1
/usr/local/man/man1/lilypond.1
/usr/local/bin/lilypond
/usr/local/bin/midi2ly
- /usr/local/bin/convert-mudela
- /usr/local/bin/mudela-book
+ /usr/local/bin/convert-ly
+ /usr/local/bin/lilypond-book
/usr/local/bin/abc2ly
+ /usr/local/bin/pmx2ly
+ /usr/local/bin/musedata2ly
/usr/local/bin/etf2ly
/usr/local/share/lilypond/*
/usr/local/share/locale/{....}/LC_MESSAGES/lilypond.mo
PACKAGE_NAME=LilyPond
MAJOR_VERSION=1
MINOR_VERSION=3
-PATCH_LEVEL=106
-MY_PATCH_LEVEL=jcn2
+PATCH_LEVEL=107
+MY_PATCH_LEVEL=
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
+
# AC_HAVE_HEADERS(limits.h malloc.h string.h unistd.h values.h)
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1508: checking how to run the C preprocessor" >&5
+echo "configure:1509: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1523 "configure"
+#line 1524 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1529: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1530: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1540 "configure"
+#line 1541 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1546: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1547: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1557 "configure"
+#line 1558 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1563: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1564: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1591: checking for $ac_hdr" >&5
+echo "configure:1592: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1596 "configure"
+#line 1597 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1602: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
done
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:1628: checking whether stat file-mode macros are broken" >&5
+echo "configure:1629: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1633 "configure"
+#line 1634 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
-echo "configure:1694: checking how to run the C++ preprocessor" >&5
+echo "configure:1695: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross
CXXCPP="${CXX-g++} -E"
cat > conftest.$ac_ext <<EOF
-#line 1707 "configure"
+#line 1708 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1712: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1713: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1749: checking for $ac_word" >&5
+echo "configure:1750: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1781: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:1782: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cat > conftest.$ac_ext << EOF
-#line 1792 "configure"
+#line 1793 "configure"
#include "confdefs.h"
int main(){return(0);}
EOF
-if { (eval echo configure:1797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cxx_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1823: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1824: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross
echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:1828: checking whether we are using GNU C++" >&5
+echo "configure:1829: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1838: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gxx=yes
else
ac_cv_prog_gxx=no
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:1856: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1857: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_safe=`echo "FlexLexer.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for FlexLexer.h""... $ac_c" 1>&6
-echo "configure:1890: checking for FlexLexer.h" >&5
+echo "configure:1891: checking for FlexLexer.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1895 "configure"
+#line 1896 "configure"
#include "confdefs.h"
#include <FlexLexer.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1901: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
echo $ac_n "checking whether explicit instantiation is needed""... $ac_c" 1>&6
-echo "configure:1951: checking whether explicit instantiation is needed" >&5
+echo "configure:1952: checking whether explicit instantiation is needed" >&5
if eval "test \"`echo '$''{'lily_cv_need_explicit_instantiation'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1956 "configure"
+#line 1957 "configure"
#include "confdefs.h"
template <class T> struct foo { static int baz; };
return foo<int>::baz;
; return 0; }
EOF
-if { (eval echo configure:1966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lily_cv_need_explicit_instantiation=no
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1993: checking for $ac_word" >&5
+echo "configure:1994: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2036: checking for $ac_word" >&5
+echo "configure:2037: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2071: checking for $ac_word" >&5
+echo "configure:2072: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2139: checking for $ac_word" >&5
+echo "configure:2140: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2172: checking for $ac_word" >&5
+echo "configure:2173: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking language""... $ac_c" 1>&6
-echo "configure:2228: checking language" >&5
+echo "configure:2229: checking language" >&5
case "$language" in
En* | en* | Am* | am* | US* | us*)
lang=English;;
echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6
-echo "configure:2264: checking for gettext in -lintl" >&5
+echo "configure:2265: checking for gettext in -lintl" >&5
ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2272 "configure"
+#line 2273 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
gettext()
; return 0; }
EOF
-if { (eval echo configure:2286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
for ac_func in gettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2316: checking for $ac_func" >&5
+echo "configure:2317: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2321 "configure"
+#line 2322 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:2347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2379: checking for $ac_word" >&5
+echo "configure:2380: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
test -n "$MSGFMT" || MSGFMT="\$(SHELL) \$(step-bindir)/fake-msgfmt.sh "
echo $ac_n "checking whether msgfmt accepts -o""... $ac_c" 1>&6
-echo "configure:2410: checking whether msgfmt accepts -o" >&5
+echo "configure:2411: checking whether msgfmt accepts -o" >&5
msgfmt_output="`msgfmt -o bla 2>&1 | grep usage`"
if test "$msgfmt_output" = ""; then
echo "$ac_t""yes" 1>&6
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2438: checking for $ac_word" >&5
+echo "configure:2439: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_METAFONT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2474: checking for $ac_word" >&5
+echo "configure:2475: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MFONT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2512: checking for $ac_word" >&5
+echo "configure:2513: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_METAPOST'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2548: checking for $ac_word" >&5
+echo "configure:2549: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MPOST'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2587: checking for $ac_word" >&5
+echo "configure:2588: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_INIMETAFONT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2623: checking for $ac_word" >&5
+echo "configure:2624: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_INIMFONT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2661: checking for $ac_word" >&5
+echo "configure:2662: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_INIMETAPOST'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2697: checking for $ac_word" >&5
+echo "configure:2698: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_INIMPOST'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for working metafont mode""... $ac_c" 1>&6
-echo "configure:2731: checking for working metafont mode" >&5
+echo "configure:2732: checking for working metafont mode" >&5
modelist='ljfour lj4 lj3 lj2 ljet laserjet'
for MFMODE in $modelist; do
$METAFONT "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
echo "$ac_t""$MFMODE" 1>&6
echo $ac_n "checking for mfplain.mp""... $ac_c" 1>&6
-echo "configure:2742: checking for mfplain.mp" >&5
+echo "configure:2743: checking for mfplain.mp" >&5
#
# For now let people define these in their environments
#
echo "$ac_t""$MFPLAIN_MP" 1>&6
echo $ac_n "checking for inimetapost flags""... $ac_c" 1>&6
-echo "configure:2750: checking for inimetapost flags" >&5
+echo "configure:2751: checking for inimetapost flags" >&5
if test ${INIMETAPOST} = "inimp" ; then
: ${INIMETAPOST_FLAGS=''}
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2783: checking for $ac_word" >&5
+echo "configure:2784: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_KPSEWHICH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
test -n "$KPSEWHICH" || KPSEWHICH="no"
echo $ac_n "checking for tfm path""... $ac_c" 1>&6
-echo "configure:2814: checking for tfm path" >&5
+echo "configure:2815: checking for tfm path" >&5
TFM_FONTS="cmr msam"
## First, let's just see if we can find Guile at all.
echo $ac_n "checking "for guile-config"""... $ac_c" 1>&6
-echo "configure:2842: checking "for guile-config"" >&5
+echo "configure:2843: checking "for guile-config"" >&5
for guile_config in guile-config $target-guile-config $build-guile-config; do
echo "$ac_t"""$guile_config"" 1>&6
if ! $guile_config --version > /dev/null 2>&1 ; then
echo "configure: warning: "cannot execute $guile_config"" 1>&2
echo $ac_n "checking "if we are cross compiling"""... $ac_c" 1>&6
-echo "configure:2848: checking "if we are cross compiling"" >&5
+echo "configure:2849: checking "if we are cross compiling"" >&5
guile_config=error
else
break
exit 1
fi
echo $ac_n "checking "Guile version"""... $ac_c" 1>&6
-echo "configure:2859: checking "Guile version"" >&5
+echo "configure:2860: checking "Guile version"" >&5
need_guile_version="1.3.4"
need_guile_version_numeric=100304
guile_version=`$guile_config --version 2>&1 | awk '{print $NF}'`
## The GUILE_FLAGS macro.
echo $ac_n "checking for Guile""... $ac_c" 1>&6
-echo "configure:2878: checking for Guile" >&5
+echo "configure:2879: checking for Guile" >&5
if ! $guile_config link > /dev/null ; then
echo "$ac_t"""cannot execute $guile_config"" 1>&6
{ echo "configure: error: "cannot find guile-config; is Guile installed?"" 1>&2; exit 1; }
# Extract the first word of "guile", so it can be a program name with args.
set dummy guile; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2893: checking for $ac_word" >&5
+echo "configure:2894: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GUILE'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2943: checking for $ac_hdr" >&5
+echo "configure:2944: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2948 "configure"
+#line 2949 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
done
echo $ac_n "checking for kpse_find_file in -lkpathsea""... $ac_c" 1>&6
-echo "configure:2980: checking for kpse_find_file in -lkpathsea" >&5
+echo "configure:2981: checking for kpse_find_file in -lkpathsea" >&5
ac_lib_var=`echo kpathsea'_'kpse_find_file | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lkpathsea $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2988 "configure"
+#line 2989 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
kpse_find_file()
; return 0; }
EOF
-if { (eval echo configure:3002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
for ac_func in kpse_find_file
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3035: checking for $ac_func" >&5
+echo "configure:3036: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3040 "configure"
+#line 3041 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:3066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
fi
echo $ac_n "checking whether to use kpathsea""... $ac_c" 1>&6
-echo "configure:3095: checking whether to use kpathsea" >&5
+echo "configure:3096: checking whether to use kpathsea" >&5
if test $kpathsea_b = yes; then
echo "$ac_t""yes" 1>&6
KPATHSEA=1
echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:3113: checking for 8-bit clean memcmp" >&5
+echo "configure:3114: checking for 8-bit clean memcmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_func_memcmp_clean=no
else
cat > conftest.$ac_ext <<EOF
-#line 3121 "configure"
+#line 3122 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
}
EOF
-if { (eval echo configure:3134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_memcmp_clean=yes
else
test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:3152: checking for vprintf" >&5
+echo "configure:3153: checking for vprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3157 "configure"
+#line 3158 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */
; return 0; }
EOF
-if { (eval echo configure:3183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vprintf=yes"
else
if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:3207: checking for _doprnt" >&5
+echo "configure:3208: checking for _doprnt" >&5
if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3212 "configure"
+#line 3213 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */
; return 0; }
EOF
-if { (eval echo configure:3238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func__doprnt=yes"
else
for ac_func in memmem snprintf vsnprintf gettext isinf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3265: checking for $ac_func" >&5
+echo "configure:3266: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3270 "configure"
+#line 3271 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:3296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3335: checking for $ac_word" >&5
+echo "configure:3336: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3368: checking for $ac_word" >&5
+echo "configure:3369: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
s%@subdirs@%$subdirs%g
s%@CC@%$CC%g
s%@LD@%$LD%g
+s%@cross_compiling@%$cross_compiling%g
s%@ICFLAGS@%$ICFLAGS%g
s%@ILDFLAGS@%$ILDFLAGS%g
s%@DEFINES@%$DEFINES%g
\score { \notes
\relative c'' \context Staff {
\emptyText
- \repeat "semi" 2 { \time 4/4; c4^"cuivr\\'e"_\fermata }
+ \repeat volta 2 { \time 4/4; c4^"cuivr\\'e"_\fermata }
\alternative {
{ \property Voice.textStyle = "italic" d-4_"cantabile" }
{ e } } \grace { c16 }
\score {
\context Voice \notes\relative c {
[f8 f] [f64 f] \grace { [f8 e8] }
- \property Voice.noStemExtend = ##t
+ \property Grace.Stem \push #'no-stem-extend = ##t
[f8 f]
}
\context Staff \chord
>
\paper{
- linewidth = -1.0;
+
\translator {
\ChordNamesContext
ChordName \push #'word-space = #1
threevoice = \context Staff \notes <
\context Voice=i { \stemUp g4 f e f g a g2 }
- \context Voice=ii { \stemUp \property Voice.horizontalNoteShift = 1 e2 e2 e2 e2 }
+ \context Voice=ii { \stemUp \property Voice.NoteColumn \push #'horizontal-shift = #1
+ e2 e2 e2 e2 }
\context Voice=iii { \stemDown c4 d e d c d es }
>
hairyChord = \context Staff \notes\relative c' <
\context Voice=one {
- \property Voice.horizontalNoteShift=0
+ \property Voice.NoteColumn \push #'horizontal-shift = #0
\stemUp
e4
}
\context Voice=two {
\stemUp
- \property Voice.horizontalNoteShift=1
+ \property Voice.NoteColumn \push #'horizontal-shift = #1
cis
}
\context Voice=three {
- \property Voice.horizontalNoteShift=2
+ \property Voice.NoteColumn \push #'horizontal-shift = #2
+
\stemUp
ais
}
\context Voice=four {
\stemDown
- \property Voice.horizontalNoteShift=-1
+ \property Voice.NoteColumn \push #'horizontal-shift = #1
+
fis
}
>
\context Staff <
\context Voice = VA {
- \property Voice.forceHorizontalShift = #0.1
+ \property Voice.NoteColumn \push #'forced-hshift = #0.1
\stemUp
- \property Voice.horizontalNoteShift=1
+ \property Voice.NoteColumn \push #'horizontal-shift = #1
<g' d'>
- }
-
+ }
\context Voice = VB {
\stemDown
- \property Voice.horizontalNoteShift=1
- \property Voice.forceHorizontalShift = #-0.1
+ \property Voice.NoteColumn \push #'horizontal-shift = #1
+ \property Voice.NoteColumn \push #'forced-hshift = #-0.1
<bes f'>
}
>
-
}
\paper {
linewidth=-1.0;
+
+shiftI \property Voice.NoteColumn \push #'horizontal-shift = #0
+shiftII \property Voice.NoteColumn \push #'horizontal-shift = #1
+shiftIII \property Voice.NoteColumn \push #'horizontal-shift = #2
+shiftIV \property Voice.NoteColumn \push #'horizontal-shift = #3
+shiftV \property Voice.NoteColumn \push #'horizontal-shift = #4
+
\score {
\context Voice \notes\relative c {
\context Staff <
- \context Voice =VA {\property Voice.verticalDirection=1 \property Voice.horizontalNoteShift = 0 g'' }
- \context Voice =VB {\property Voice.verticalDirection=1 \property Voice.horizontalNoteShift = 1 e }
- \context Voice =VC {\property Voice.verticalDirection=1 \property Voice.horizontalNoteShift = 2 c }
- \context Voice =VD {\property Voice.verticalDirection=1 \property Voice.horizontalNoteShift = 3 a }
- \context Voice =VE {\property Voice.verticalDirection=1 \property Voice.horizontalNoteShift = 4 f }
- >
-
-
-
+ \context Voice =VA {\stemUp \shiftI g'' }
+ \context Voice =VB {\stemUp \shiftII e }
+ \context Voice =VC {\stemUp \shiftIII c }
+ \context Voice =VD {\stemUp \shiftIV a }
+ \context Voice =VE {\stemUp \shiftV f }
+ >
}
\paper { }
\midi { }
shortest_mom_ = Moment (1, 8);
}
}
-
+
void
Auto_beam_engraver::typeset_beam ()
{
return ;
}
- int durlog =rhythmic_req->duration_.durlog_i_;
+ int durlog = unsmob_duration (rhythmic_req->get_mus_property ("duration"))->duration_log ();
+
if (durlog <= 2)
{
if (stem_l_arr_p_)
if shortest duration would change
reconsider ending/starting beam first.
*/
- Moment mom = rhythmic_req->duration_.length_mom ();
+ Moment mom = unsmob_duration (rhythmic_req->get_mus_property ("duration"))->length_mom ();
consider_end_and_begin (mom);
if (!stem_l_arr_p_)
return;
for (SCM s = muses; gh_pair_p (s); s=gh_cdr (s))
if (Note_req* nr = dynamic_cast<Note_req*> (unsmob_music (gh_car (s))))
{
- ps.push (nr->pitch_);
+ ps.push (*unsmob_pitch (nr->get_mus_property ("pitch")));
}
if (ps.size ())
{
where_dir_ = CENTER;
}
+
+IMPLEMENT_CTOR_CALLBACK(Auto_change_iterator);
-
/*
- auto-switch-music.cc -- implement
+ auto-switch-music.cc -- implement Auto_change_music
source file of the GNU LilyPond music typesetter
*/
#include "auto-change-music.hh"
+#include "auto-change-iterator.hh"
Auto_change_music::Auto_change_music (Music * m)
: Music_wrapper (m)
{
- set_mus_property ("type", ly_symbol2scm ("auto-change-music"));
+ set_mus_property ("type", Auto_change_iterator::constructor_cxx_function);
}
#include "bar.hh"
#include "score-engraver.hh"
#include "musical-request.hh"
-#include "multi-measure-rest.hh"
-#include "command-request.hh"
-
#include "engraver-group-engraver.hh"
#include "warn.hh"
#include "item.hh"
/*
generate bars. Either user ("|:"), or default (new measure)
- TODO
-
- - document this
-
- - document how barlines and line breaks interact.
*/
class Bar_engraver : public Engraver
{
return;
}
- if (rhythmic_req->duration_.durlog_i_<= 2)
+ int durlog = unsmob_duration (rhythmic_req->get_mus_property ("duration"))-> duration_log ();
+ if (durlog <= 2)
{
rhythmic_req->origin ()->warning (_ ("stem doesn't fit in beam"));
prev_start_req_->origin ()->warning (_ ("beam was started here"));
}
stem_l->set_elt_property ("duration-log",
- gh_int2scm (rhythmic_req->duration_.durlog_i_));
+ gh_int2scm (durlog));
Moment stem_location = now_mom () - beam_start_mom_ + beam_start_location_;
beam_info_p_->add_stem (stem_location,
- (rhythmic_req->duration_.durlog_i_ - 2) >? 1);
+ (durlog- 2) >? 1);
Beam::add_stem (beam_p_, stem_l);
}
}
}
+
+IMPLEMENT_CTOR_CALLBACK(Change_iterator);
Chord_name_engraver::acknowledge_element (Score_element_info i)
{
if (Note_req* n = dynamic_cast<Note_req*> (i.req_l_))
- pitch_arr_.push (n->pitch_);
+ pitch_arr_.push (* unsmob_pitch (n->get_mus_property ("pitch")));
}
bool
{
if (Note_req* n = dynamic_cast<Note_req*> (m))
{
- pitch_arr_.push (n->pitch_);
+ pitch_arr_.push (* unsmob_pitch (n->get_mus_property ("pitch")));
return true;
}
if (Tonic_req* t = dynamic_cast<Tonic_req*> (m))
*/
SCM plist = SCM_EOL;
for (int i= chord_p_->pitch_arr_.size (); i--; )
- plist = gh_cons (chord_p_->pitch_arr_[i].to_scm (), plist);
+ plist = gh_cons (chord_p_->pitch_arr_[i].smobbed_copy (), plist);
chord_name_p_->set_elt_property ("pitches", plist);
if (chord_p_->inversion_b_)
chord_name_p_->set_elt_property ("inversion",
- chord_p_->inversion_pitch_.to_scm ());
+ chord_p_->inversion_pitch_.smobbed_copy ());
if (chord_p_->bass_b_)
- chord_name_p_->set_elt_property ("bass", chord_p_->bass_pitch_.to_scm ());
+ chord_name_p_->set_elt_property ("bass", chord_p_->bass_pitch_.smobbed_copy ());
}
void
#include "note-head.hh"
#include "spanner.hh"
#include "item.hh"
+#include "chord-tremolo-iterator.hh"
/**
This acknowledges repeated music with "tremolo" style. It typesets
Chord_tremolo_engraver::do_try_music (Music * m)
{
Repeated_music * rp = dynamic_cast<Repeated_music*> (m);
- if (rp && rp->type_ == "tremolo" && !repeat_)
+ if (rp
+ && rp->get_mus_property ("type") == Chord_tremolo_iterator::constructor_cxx_function
+ && !repeat_)
{
Moment l = rp->body_length_mom ();
repeat_ = rp;
Chord_tremolo_iterator::construct_children ()
{
Repeated_music * rep = dynamic_cast<Repeated_music*> (music_l_);
- factor_ = Moment (1, rep->repeats_i_);
+ factor_ = Moment (1, rep->repeat_count ());
child_iter_p_ = get_iterator_p (rep->body ());
}
}
+
+IMPLEMENT_CTOR_CALLBACK(Chord_tremolo_iterator);
+
#include "music-list.hh"
#include "musical-request.hh"
+/*
+ UGH
+
+ should compare SCM lists.
+ */
int
compare (Chord* left, Chord* right)
{
/*
FIXME: should use SCM iso. arrays and have-to-delete pointers.
- FIXME: this contains memleaks.
+ FIXME: a real function looks like
+
+
+ Return_value func (Input_value),
+
+ not
+
+ void func (Input_value *);
+
+ FIXME:
+
+ pitch is really a tuple, hence an immutable object. We
+ should remove all mutating operations.
+
*/
/*
for (int i=0; i < add_arr_p->size (); i++)
{
Musical_pitch* p = &(*add_arr_p)[i];
- if (p->octave_i_ == -100)
+ if (p->octave_i () == -100)
{
p->octave_i_ = 0;
dim_b = true;
else if (dim_b)
{
Musical_pitch* p = &add_arr_p->top ();
- p->accidental_i_--;
+ p->alteration_i_--;
}
/*
{
for (int i=0; i < missing_arr.size (); i++)
{
- missing_arr[i].accidental_i_--;
+ missing_arr[i].alteration_i_--;
}
}
C-sus (4) = c f g (1 4 5)
*/
Musical_pitch sus = tonic;
- sus.transpose (Musical_pitch (3));
+ sus.transpose (Musical_pitch (0,3,0));
if (Chord::find_pitch_i (add_arr_p, sus) != -1)
{
int i = Chord::find_pitch_i (&missing_arr, third);
if (bass_req)
{
- assert (pitch_arr[0].notename_i_ == bass_req->pitch_.notename_i_);
+ assert (pitch_arr[0].notename_i_ == unsmob_pitch (bass_req->get_mus_property ("pitch"))->notename_i_);
bass_p = new Musical_pitch (pitch_arr.get (0));
}
if (inversion_req)
{
- assert (pitch_arr[0].notename_i_ == inversion_req->pitch_.notename_i_);
- inversion_p = new Musical_pitch (inversion_req->pitch_);
+ assert (pitch_arr[0].notename_i_ == unsmob_pitch (inversion_req->get_mus_property ("pitch"))->notename_i_);
+ inversion_p = new Musical_pitch (* unsmob_pitch (inversion_req->get_mus_property ("pitch")));
assert (tonic_req);
- int tonic_i = Chord::find_notename_i (&pitch_arr, tonic_req->pitch_);
+ int tonic_i = Chord::find_notename_i (&pitch_arr,
+ *unsmob_pitch (tonic_req->get_mus_property ("pitch")));
if (tonic_i)
Chord::rebuild_insert_inversion (&pitch_arr, tonic_i);
}
if (find_inversion_b && !inversion_p)
{
int tonic_i = tonic_req
- ? Chord::find_notename_i (&pitch_arr, tonic_req->pitch_)
+ ? Chord::find_notename_i (&pitch_arr, *unsmob_pitch (tonic_req->get_mus_property ("pitch")))
: Chord::find_tonic_i (&pitch_arr);
if (tonic_i)
if (tonic_req)
{
- assert (pitch_arr[0].notename_i_ == tonic_req->pitch_.notename_i_);
+ assert (pitch_arr[0].notename_i_ == unsmob_pitch (tonic_req->get_mus_property ("pitch"))->notename_i_);
}
return Chord (pitch_arr, inversion_p, bass_p);
{
Array<Musical_pitch> base;
base.push (p);
- p.transpose (Musical_pitch (2));
+ p.transpose (Musical_pitch (0,2,0));
base.push (p);
- p.transpose (Musical_pitch (2, -1));
+ p.transpose (Musical_pitch (0, 2, -1));
base.push (p);
return base;
}
p.transpose (q);
// duh, c7 should mean <c bes>
if (fix7_b && (step_i (tonic, p) == 7))
- p.accidental_i_--;
+ p.alteration_i_--;
(*pitch_arr_p)[i] = p;
}
pitch_arr_p->sort (Musical_pitch::compare);
{
for (int i = 0; i < pitch_arr_p->size (); i++)
{
- p.octave_i_ = (*pitch_arr_p)[i].octave_i_;
+ p.octave_i_ = (*pitch_arr_p)[i].octave_i () ;
if (p == (*pitch_arr_p)[i])
return i;
}
Chord::step_i (Musical_pitch tonic, Musical_pitch p)
{
int i = p.notename_i_ - tonic.notename_i_
- + (p.octave_i_ - tonic.octave_i_) * 7;
+ + (p.octave_i () - tonic.octave_i () ) * 7;
while (i < 0)
i += 7;
i++;
/* is the third c-e, d-f, etc. small or large? */
int minormajor_a[] = {0, -1, -1, 0,0,-1,-1};
for (int i=0; i < 7; i++)
- thirds.push (Musical_pitch( 2, minormajor_a[i]));
+ thirds.push (Musical_pitch( 0, 2, minormajor_a[i]));
Musical_pitch tonic = (*pitch_arr_p)[0];
Musical_pitch last = tonic;
if ((last.notename_i_ - tonic.notename_i_ + 7) % 7 == 6)
{
Musical_pitch special_seven = last;
- Musical_pitch lower (0, -1);
+ Musical_pitch lower (0, 0, -1);
special_seven.transpose (lower);
missing_arr.push (special_seven);
}
for (; i < pitch_arr.size (); i++)
{
if ((pitch_arr[i].notename_i_ == inversion_pitch_.notename_i_)
- && (pitch_arr[i].accidental_i_ == inversion_pitch_.accidental_i_))
+ && (pitch_arr[i].alteration_i_ == inversion_pitch_.alteration_i_))
break;
}
if (i == pitch_arr.size ())
Musical_pitch p = (*pitch_arr_p)[(base_i + i) % pitch_arr_p->size ()];
if (p < last)
{
- p.octave_i_ = last.octave_i_;
+ p.octave_i_ = last.octave_i () ;
if (p < last)
p.octave_i_++;
}
rebuild_from_base (pitch_arr_p, tonic_i - 1);
if (pitch_arr_p->size ())
{
- inversion.octave_i_ = (*pitch_arr_p)[0].octave_i_ - 1;
+ inversion.octave_i_ = (*pitch_arr_p)[0].octave_i () - 1;
while (inversion < (*pitch_arr_p)[0])
inversion.octave_i_++;
}
// junk me
Simultaneous_music *
-get_chord (Musical_pitch tonic,
- Array<Musical_pitch>* add_arr_p,
- Array<Musical_pitch>* sub_arr_p,
- Musical_pitch* inversion_p,
- Musical_pitch* bass_p,
- Duration d)
+get_chord (SCM stonic,
+ SCM sadd_arr_p,
+ SCM ssub_arr_p,
+ SCM sinversion_p,
+ SCM sbass_p,
+ SCM dur)
{
+ Musical_pitch tonic = *unsmob_pitch (stonic);
+
+ Musical_pitch *inversion_p = unsmob_pitch( sinversion_p);
+ Musical_pitch *bass_p = unsmob_pitch (sbass_p);
+
+ Array<Musical_pitch> add_arr_p;
+ Array<Musical_pitch> sub_arr_p;
+
+ for (SCM s = sadd_arr_p ; gh_pair_p (s); s = gh_cdr (s))
+ add_arr_p.push (*unsmob_pitch (gh_car (s)));
+ for (SCM s = ssub_arr_p ; gh_pair_p (s); s = gh_cdr (s))
+ sub_arr_p.push (*unsmob_pitch (gh_car (s)));
+
+ sub_arr_p.reverse ();
+ add_arr_p.reverse ();
/*
UARGAUGRAGRUAUGRUINAGRAUGIRNA
ugh
*/
- Chord chord = to_chord (tonic, add_arr_p, sub_arr_p, inversion_p, bass_p);
+ Chord chord = to_chord (tonic, &add_arr_p, &sub_arr_p, inversion_p, bass_p);
inversion_p = 0;
bass_p = 0;
Tonic_req* t = new Tonic_req;
- t->pitch_ = tonic;
+ t->set_mus_property ("pitch", tonic.smobbed_copy ());
SCM l = gh_cons (t->self_scm (), SCM_EOL);
//urg
&& Chord::find_notename_i (&chord.pitch_arr_, chord.inversion_pitch_) > 0)
{
Inversion_req* i = new Inversion_req;
- i->pitch_ = chord.inversion_pitch_;
+ i->set_mus_property ("pitch", chord.inversion_pitch_.smobbed_copy ());
l = gh_cons (i->self_scm (), l);
+ scm_unprotect_object (i->self_scm ());
}
if (chord.bass_b_)
{
Bass_req* b = new Bass_req;
- b->pitch_ = chord.bass_pitch_;
- l = gh_cons (b->self_scm (), l);
+ b->set_mus_property ("pitch", chord.bass_pitch_.smobbed_copy ());
+
+ l = gh_cons (b->self_scm (), l);
+ scm_unprotect_object (b->self_scm ());
}
Array<Musical_pitch> pitch_arr = chord.to_pitch_arr ();
for (int i = pitch_arr.size (); --i >= 0;)
{
- Musical_pitch p = pitch_arr[i];
Note_req* n = new Note_req;
- n->pitch_ = p;
- n->duration_ = d;
+ n->set_mus_property ("pitch", pitch_arr[i].smobbed_copy ());
+ n->set_mus_property ("duration", dur);
l = gh_cons (n->self_scm (), l);
+
+ scm_unprotect_object (n->self_scm ());
}
Simultaneous_music*v = new Request_chord (l);
#include "note-head.hh"
#include "staff-symbol-referencer.hh"
#include "debug.hh"
-#include "command-request.hh"
#include "engraver.hh"
#include "direction.hh"
#include "side-position-interface.hh"
private:
Item * clef_p_;
Item * octavate_p_;
- Clef_change_req * clef_req_l_;
SCM prev_glyph_;
SCM prev_cpos_;
Clef_engraver::Clef_engraver ()
{
clef_p_ = 0;
- clef_req_l_ = 0;
octave_dir_ = CENTER;
octavate_p_ = 0;
#include "font-interface.hh"
/*
-FIXME: should use symbol for #'style.
+ FIXME: should use symbol for #'style.
*/
MAKE_SCHEME_CALLBACK(Clef,before_line_breaking,1);
SCM
{
String str = ly_scm2string (glyph);
- /*
- FIXME: should use fontsize property to set clef changes.
- */
- if (s->get_elt_property ("non-default") &&
- s->break_status_dir() != RIGHT && style != "fullSizeChanges")
+ if (to_boolean (s->get_elt_property ("non-default")) &&
+ s->break_status_dir() != RIGHT &&
+ to_boolean (s->get_elt_property ("full-size-change")))
{
str += "_change";
s->set_elt_property ("glyph", ly_str02scm (str.ch_C()));
me->set_interface (ly_symbol2scm ("clef-interface"));
}
-
-
-
MAKE_SCHEME_CALLBACK(Clef,brew_molecule,1)
SCM
Clef::brew_molecule (SCM smob)
#include "musical-request.hh"
-Bar_req::Bar_req (String s)
-{
- set_mus_property ("type", ly_str02scm (s.ch_C()));
-}
-
bool
Barcheck_req::do_equal_b (Request const *r) const
{
}
-Clef_change_req::Clef_change_req ()
-{
-
-}
-
-
-bool
-Time_signature_change_req::do_equal_b (Request const *r) const
-{
- Time_signature_change_req const* m
- = dynamic_cast <Time_signature_change_req const*> (r);
-
-#if 0
- return m && m->beats_i_ == beats_i_
- && one_beat_i_ == m->one_beat_i_;
-#endif
- return m;
-}
-
-Time_signature_change_req::Time_signature_change_req ()
-{
-}
Tempo_req::Tempo_req ()
{
- dur_. durlog_i_ = 2;
+ set_mus_property ("duration", Duration(2,0).smobbed_copy ());
}
SCM pa = get_mus_property ("pitch-alist");
for (SCM s = pa; gh_pair_p (s); s = gh_cdr (s))
{
- SCM k = gh_caar (s);
-
- if (gh_pair_p (k))
+ SCM key = gh_caar (s);
+ SCM alter = gh_cdar (s);
+ if (gh_pair_p (key))
{
- Musical_pitch orig (gh_list (gh_car (k), gh_cdr (k), gh_cdr (s), SCM_UNDEFINED));
+ Musical_pitch orig (gh_scm2int (gh_car (key)),
+ gh_scm2int (gh_cdr (key)),
+ gh_scm2int (alter));
orig.transpose (p);
- SCM key = gh_cons (gh_int2scm (orig.octave_i_),
+ SCM key = gh_cons (gh_int2scm (orig.octave_i () ),
gh_int2scm (orig.notename_i_));
- newlist = gh_cons (gh_cons (key, gh_int2scm (orig.accidental_i_)),
+ newlist = gh_cons (gh_cons (key, gh_int2scm (orig.alteration_i_)),
newlist);
}
- else if (gh_number_p (k))
+ else if (gh_number_p (key))
{
- Musical_pitch orig (gh_list (gh_int2scm (0), k, gh_cdar (s), SCM_UNDEFINED));
+ Musical_pitch orig (0, gh_scm2int (key), gh_scm2int (alter));
orig.transpose (p);
- SCM key =gh_int2scm (orig.notename_i_);
- newlist = gh_cons (gh_cons (key, gh_int2scm (orig.accidental_i_)),
- newlist);
+ key =gh_int2scm (orig.notename_i_);
+ alter = gh_int2scm (orig.alteration_i_);
+ newlist = gh_cons (gh_cons (key, alter), newlist);
}
}
*/
#include "context-specced-music.hh"
-
Context_specced_music::Context_specced_music(Music *m)
: Music_wrapper (m)
{
- set_mus_property ("type", ly_symbol2scm ("context-specced-music"));
+ set_mus_property ("type",
+
+ ly_symbol2scm ("context-specced-music"));
}
+
don't look at the staff-position, since we can't be sure
whether Clef_engraver already applied a vertical shift.
*/
-
- pitches_.push (dynamic_cast<Note_req*> (info.req_l_)->pitch_);
+ Note_req * nr = dynamic_cast<Note_req*> (info.req_l_);
+ if (nr)
+ pitches_.push (*unsmob_pitch (nr->get_mus_property ("pitch")));
}
}
}
#include "string.hh"
#include "moment.hh"
#include "duration.hh"
+#include "ly-smobs.icc"
+
-int
-compare (Array<Duration>* left, Array<Duration>* right)
-{
- assert (left);
- assert (right);
-
- if (left->size () == right->size ())
- {
- for (int i = 0; i < left->size (); i++)
- {
- int r = Duration::compare ((*left)[i], (*right)[i]);
- if (r)
- return r;
- }
- }
- else
- return 1;
- return 0;
-}
int
Duration::compare (Duration const &left, Duration const &right)
{
durlog_i_ = 0;
dots_i_ = 0;
- tuplet_iso_i_ = 1;
- tuplet_type_i_ = 1;
+ factor_ = Moment (1,1);
+}
+
+Duration::Duration (int l, int d)
+{
+ durlog_i_ = l;
+ dots_i_ = d;
+ factor_ = Moment (1,1);
}
-void
-Duration::compress (Rational m)
+Duration
+Duration::compressed (Rational m) const
{
- tuplet_iso_i_ *= m.num_i ();
- tuplet_type_i_ *= m.den_i ();
+ Duration d (*this);
+ d.factor_ *= m;
+ return d;
}
Rational
mom += delta;
}
- return mom * Moment (tuplet_iso_i_, tuplet_type_i_);
+ return mom * factor_;
}
-void
-Duration::set_plet (int i, int t)
-{
- tuplet_iso_i_ = i;
- tuplet_type_i_ = t;
-}
String
Duration::str () const
{
- return to_str (durlog_i_) + to_str ('.', dots_i_);
+ String s = to_str (durlog_i_) + to_str ('.', dots_i_);
+ if (factor_ != Moment (1,1))
+ {
+ s += "*" + factor_.str ();
+ }
+ return s;
}
-bool
-Duration::plet_b ()
+IMPLEMENT_TYPE_P(Duration, "duration?");
+IMPLEMENT_UNSMOB(Duration, duration);
+
+SCM
+Duration::mark_smob (SCM )
{
- return tuplet_iso_i_ != 1 || tuplet_type_i_ != 1;
+ return SCM_EOL;
}
+IMPLEMENT_SIMPLE_SMOBS(Duration);
+
+
+int
+Duration::print_smob (SCM s, SCM port, scm_print_state *)
+{
+ Duration *r = (Duration *) gh_cdr (s);
+
+ scm_puts ("#<Duration ", port);
+ scm_display (gh_str02scm (r->str().ch_C()), port);
+ scm_puts (" >", port);
+
+ return 1;
+}
+
+SCM
+Duration::equal_p (SCM a , SCM b)
+{
+ Duration *p = (Duration *) gh_cdr (a);
+ Duration *q = (Duration *) gh_cdr (b);
+
+ bool eq = p->dots_i_ == q->dots_i_
+ && p->durlog_i_ == q->durlog_i_
+ && p->factor_ == q->factor_;
+
+ return eq ? SCM_BOOL_T : SCM_BOOL_F;
+}
+
+MAKE_SCHEME_CALLBACK(Duration, less_p, 2);
+SCM
+Duration::less_p (SCM p1, SCM p2)
+{
+ Duration *a = unsmob_duration (p1);
+ Duration *b = unsmob_duration (p2);
+
+ if (compare(*a, *b) < 0 )
+ return SCM_BOOL_T;
+ else
+ return SCM_BOOL_F;
+}
+
+
+static SCM
+make_duration (SCM l, SCM d)
+{
+ Duration p( gh_scm2int (l), gh_scm2int (d));
+ return p.smobbed_copy ();
+}
+
+static void
+add_funcs()
+{
+ scm_make_gsubr ("make-duration", 2, 0, 0, (Scheme_function_unknown)make_duration);
+}
+
+ADD_SCM_INIT_FUNC(duration, add_funcs);
+
+SCM
+Duration::smobbed_copy ()const
+{
+ Duration * p = new Duration (*this);
+ return p->smobbed_self ();
+}
+
+int
+Duration::duration_log () const
+{
+ return durlog_i_;
+}
+
+int
+Duration::dot_count () const
+{
+ return dots_i_;
+}
return alternative_iter_p_->try_music (m);
return 0;
}
+
+IMPLEMENT_CTOR_CALLBACK(Folded_repeat_iterator);
return 0;
}
+
+IMPLEMENT_CTOR_CALLBACK(Grace_iterator);
*/
#include "grace-music.hh"
+#include "grace-iterator.hh"
void
Grace_music::compress (Moment)
Grace_music::Grace_music (Music *p)
: Music_wrapper (p)
{
- set_mus_property ("type", ly_symbol2scm ("grace-music"));
+ set_mus_property ("type",
+ Grace_iterator::constructor_cxx_function);
}
DUMMY_STR(Score);
DUMMY_STR(Music_output_def);
-DUMMY_STR(Duration);
#define DEFAULT_STR(Class) \
}
-IMPLEMENT_ID_CLASS(Duration);
IMPLEMENT_ID_CLASS(Score);
IMPLEMENT_ID_CLASS(Music_output_def);
VIRTUAL_ACCESSOR(Music_output_def);
-DEFAULT_ACCESSOR(Duration);
DEFAULT_ACCESSOR(Score);
{
public:
VIRTUAL_COPY_CONS (Music_iterator);
+ static SCM constructor_cxx_function;
+
Auto_change_iterator ();
protected:
VIRTUAL_COPY_CONS (Music_iterator);
/* constructor is public */
virtual void process (Moment);
-
+ static SCM constructor_cxx_function;
private:
void error (String);
};
{
public:
VIRTUAL_COPY_CONS (Music_iterator);
+ static SCM constructor_cxx_function;
Chord_tremolo_iterator ();
protected:
int compare (Chord*, Chord*);
-Simultaneous_music *get_chord (Musical_pitch tonic,
- Array<Musical_pitch>* add_arr_p,
- Array<Musical_pitch>* sub_arr_p,
- Musical_pitch* inversion_p,
- Musical_pitch* bass_p,
- Duration d);
+Simultaneous_music *get_chord (SCM tonic,
+ SCM add_arr_p,
+ SCM sub_arr_p,
+ SCM inversion_p,
+ SCM bass_p,
+ SCM d);
#include "musical-pitch.hh"
#include "protected-scm.hh"
-/*
- Real penalty_f_;
- */
class Break_req : public Request {
public:
VIRTUAL_COPY_CONS(Music);
};
-
-/** Baseclass for time_signature/partial req. It has to be handled by
- Staff_{walker,column} baseclass. */
-class Timing_req : public Request {
-public:
- VIRTUAL_COPY_CONS(Music);
-};
-
/*
int metronome_i_;
*/
-class Tempo_req : public Timing_req
+class Tempo_req : public Request
{
public:
Duration dur_;
bool do_equal_b (Request const *) const;
};
-
-/**
- todo: allow C time_signature
-
- int beats_i_;
- int one_beat_i_;
-
- */
-class Time_signature_change_req : public Timing_req {
-public:
- Time_signature_change_req();
-
-protected:
- bool do_equal_b (Request const *) const;
- VIRTUAL_COPY_CONS(Music);
-};
-
-
/// check if we're at start of a measure.
-class Barcheck_req : public Timing_req {
+class Barcheck_req : public Request {
public:
bool do_equal_b (Request const *) const;
VIRTUAL_COPY_CONS(Music);
};
-
-/** draw a (repeat)-bar. This something different than #Barcheck_req#,
- the latter should only happen at the start of a measure. */
-class Bar_req : public Request {
-public:
-
- Bar_req (String);
-protected:
- VIRTUAL_COPY_CONS(Music);
-};
-
class Breathing_sign_req : public Request {
VIRTUAL_COPY_CONS(Music);
};
bool do_equal_b (Request const * )const;
};
-/*
- String clef_str_;
- */
-
-class Clef_change_req : public Request {
-public:
-
- Clef_change_req ();
-protected:
-
- VIRTUAL_COPY_CONS(Music);
-};
-
-
#endif // COMMANDREQUEST_HH
class Context_specced_music : public Music_wrapper
{
-
-/*
- /// The kind of translation needed for this music.
- String translator_type_str_;
-
- /// what identification for the translation unit
- String translator_id_str_;
-*/
public:
Context_specced_music (Music*);
VIRTUAL_COPY_CONS(Music);
-
};
#endif /* CONTEXT_SPECCED_MUSIC_HH */
#define DURATION_HH
#include "flower-proto.hh"
-#include "rational.hh"
-
+#include "moment.hh"
+#include "smobs.hh"
/**
A musical duration.
*/
struct Duration {
Duration ();
- /// is the "plet factor" of this note != 1 ?
- bool plet_b ();
+ Duration (int, int);
String str () const;
void set_plet (int,int );
- void compress (Rational);
+ Duration compressed (Rational) const;
Rational length_mom () const ;
static int compare (Duration const&, Duration const&);
- /// Logarithm of the base duration.
+ SCM smobbed_copy () const;
+ DECLARE_SCHEME_CALLBACK(less_p, (SCM a, SCM b));
+ DECLARE_SIMPLE_SMOBS(Duration,);
+
+public:
+ int duration_log ()const;
+ int dot_count () const;
+
+private:
+ /// Logarithm of the base duration.
int durlog_i_;
int dots_i_;
- /*
- JUNKME.
- */
- int tuplet_iso_i_; // 2/3; 2 is not duration, maar of count!
- int tuplet_type_i_;
+ Moment factor_;
};
#include "compare.hh"
INSTANTIATE_COMPARE(Duration, Duration::compare);
-
-int compare (Array<Duration>*, Array<Duration>*);
+Duration*unsmob_duration(SCM);
+// int compare (Array<Duration>*, Array<Duration>*);
#endif // DURATION_HH
{
public:
VIRTUAL_COPY_CONS (Music_iterator);
+ static SCM constructor_cxx_function;
+
Folded_repeat_iterator ();
~Folded_repeat_iterator ();
~Grace_iterator ();
virtual void construct_children () ;
virtual void process (Moment);
-
+ static SCM constructor_cxx_function;
Moment pending_moment () const;
};
class Output_def_identifier;
class Score_identifier;
-class Duration_identifier;
-
#define IDACCESSOR(Class)\
/**
- A declarable data structure in mudela.
+ A declarable data structure in lilypond.
TODO: use SMOBS for the union type, and junk all derived classes.
*/
String str () const;
IDACCESSOR(Music_output_def)
IDACCESSOR(Score)
- IDACCESSOR(Duration)
VIRTUAL_COPY_CONS(Identifier);
DECLARE_SMOBS(Identifier, foo);
}\
-DECLARE_ID_CLASS(Duration);
DECLARE_ID_CLASS(Score);
DECLARE_ID_CLASS(Music_output_def);
class Auto_change_music;
class Axis_group_engraver;
class Bar_engraver;
-class Bar_req;
class Bar_req_collect_engraver;
class Barcheck_req;
class Base_span_bar_engraver;
class Change_iterator;
class Change_translator;
class Chord_tremolo_iterator;
-class Clef_change_req;
+
class Column_x_positions;
class Context_specced_music;
class Engraver;
public:
VIRTUAL_COPY_CONS (Music_iterator);
Lyric_combine_music_iterator ();
-
+ static SCM constructor_cxx_function;
protected:
virtual void construct_children ();
virtual Moment pending_moment () const;
extern All_font_metrics *all_fonts_global_p;
class ostream;
-void print_mudela_versions (ostream &os);
+void print_lilypond_versions (ostream &os);
#endif
/*
Deliver a copy of THIS as a smobified SCM
*/
- SCM make_scm () const;
+ SCM smobbed_copy () const;
};
+++ /dev/null
-/*
- mudela-version.hh -- declare Mudela_version
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
-
-*/
-
-#ifndef MUDELA_VERSION_HH
-#define MUDELA_VERSION_HH
-
-#include "string.hh"
-
-struct Mudela_version
-{
- Mudela_version (int major, int minor, int patch);
- Mudela_version (String str);
-
- String str () const;
- operator int () const;
-
- int major_i_;
- int minor_i_;
- int patch_i_;
-};
-
-extern Mudela_version oldest_version;
-
-#endif // MUDELA_VERSION_HH
#include "lily-proto.hh"
#include "lily-guile.hh"
-typedef void * (*Cpp_function) (SCM param);
-SCM smobify_cpp_function (Cpp_function cb);
+typedef void * (*Cxx_function) (SCM param);
+Cxx_function unsmob_cxx_function (SCM x);
+SCM smobify_cxx_function (Cxx_function cb);
#endif /* SCORE_ELEMENT_CALLBACK_HH */
#include "moment.hh"
#include "virtual-methods.hh"
#include "interpretation-context-handle.hh"
+#include "music-iterator-ctor.hh"
/**
Conceptually a music-iterator operates on a queue of musical events
report to.
*/
virtual void construct_children ();
-
+ static SCM constructor_cxx_function;
+
protected:
Music * music_l_;
};
+/*
+ implement Class::constructor, a SCM function that
+ returns an encapsulated factory function.
+ */
+#define IMPLEMENT_CTOR_CALLBACK(Class) \
+static void * \
+Class ## _ctor (SCM) \
+{ \
+ return new Class ; \
+} \
+SCM Class :: constructor_cxx_function;\
+void \
+Class ## _constructor_init() \
+{ \
+ SCM s = smobify_cxx_function (& Class ## _ctor); \
+ scm_permanent_object (s);\
+ gh_define (#Class "::constructor", s);\
+ Class :: constructor_cxx_function = s;\
+}\
+ADD_SCM_INIT_FUNC(Class ## _ctor_init, Class ## _constructor_init);
+
-
+
+
};
/**
- The request is a collection of Requests. A note that you enter in mudela is
+ The request is a collection of Requests. A note that you enter in lilypond is
one Request_chord, one syllable of lyrics is one Request_chord
*/
class Request_chord : public Simultaneous_music
#include "virtual-methods.hh"
/**
- Definition of how to output mudela.
+ Definition of how to output lilypond.
+
+ TODO: smobify, remove Music_output_def_identifier.
*/
class Music_output_def
{
#include "lily-proto.hh"
/**
- Output something that was defined in a mudela file.
+ Output something that was defined in a lilypond file.
*/
class Music_output
{
{
public:
VIRTUAL_COPY_CONS (Music_iterator);
+ static SCM constructor_cxx_function;
Music_wrapper_iterator ();
Music_wrapper_iterator (Music_wrapper_iterator const&);
~Music_wrapper_iterator ();
#define MUSICAL_PITCH_HH
#include "lily-proto.hh"
-#include "input.hh"
-#include "lily-guile.hh" // we need SCM
+#include "smobs.hh"
/** A "tonal" pitch. This is a pitch as it figures in diatonal western
music (12 semitones in an octave), as opposed to a frequence in Hz
or a integer number of semitones.
- It is not Music because, it has no duration associated.
+
+
+
*/
-struct Musical_pitch : public Input
+class Musical_pitch
{
- Musical_pitch (int notename=0, int accidental=0, int octave=0);
-
- /// construct from '(octave name acc)
- Musical_pitch (SCM);
-
+public: // fixme
+
/// 0 is c, 6 is b
int notename_i_;
/// 0 natural, 1 sharp, etc
- int accidental_i_;
+ int alteration_i_;
/// 0 is central c
int octave_i_;
+public:
+
+ int octave_i () const;
+ int notename_i () const;
+ int alteration_i () const;
+
+ /*
+ Musical_pitch is lexicographically ordered by (octave, notename,
+ alteration).
+ */
+ Musical_pitch (int octave, int notename,int accidental);
+ Musical_pitch ();
Musical_pitch to_relative_octave (Musical_pitch);
void transpose (Musical_pitch);
void down_to (int);
String str () const;
- SCM to_scm () const;
+ SCM smobbed_copy () const;
+ DECLARE_SCHEME_CALLBACK(less_p, (SCM a, SCM b));
+ DECLARE_SIMPLE_SMOBS(Musical_pitch,);
};
+Musical_pitch* unsmob_pitch (SCM);
+
#include "compare.hh"
INSTANTIATE_COMPARE(Musical_pitch, Musical_pitch::compare);
*/
class Rhythmic_req : public virtual Request {
public:
- Duration duration_;
-
bool do_equal_b (Request const*) const;
void compress (Moment);
virtual Moment length_mom () const;
- static int compare (Rhythmic_req const&,Rhythmic_req const&);
VIRTUAL_COPY_CONS(Music);
};
/// request which has some kind of pitch
struct Melodic_req :virtual Request
{
- Musical_pitch pitch_;
-
- static int compare (Melodic_req const&,Melodic_req const&);
-
protected:
/// transpose. #delta# is relative to central c.
virtual void transpose (Musical_pitch delta);
VIRTUAL_COPY_CONS(Music);
};
+
+/*
+ TODO: junk these, and set
+
+ (tonic . #t)
+
+ or maybe
+
+ (chord-type . tonic/inversion/bass)
+
+
+ */
/// specify tonic of a chord
struct Tonic_req : public Melodic_req
{
};
/*
- Put a note of specified type, height, and with accidental on the staff.
- /// force/supress printing of accidental.
- bool forceacc_b_;
- /// Cautionary, i.e. parenthesized accidental.
- bool cautionary_b_;
+ Put a note of specified type, height, and with accidental on the staff.
+
+ force-accidental -- force/supress printing of accidental.
+
+ cautionary -- Cautionary, i.e. parenthesized accidental.
*/
class Note_req : public Rhythmic_req, virtual public Melodic_req {
void kill_lexer();
void set_lexer();
-/// lexer for Mudela
+/// lexer for Lilypond
class My_lily_lexer : public Includable_lexer
{
public:
static Direction static_dir (Score_element*);
static void translate_rests(Score_element*me,int dy);
static Score_element * first_head (Score_element*me);
- static Interval rest_dim (Score_element*me);
static void set_stem (Score_element*me,Score_element*);
static void set_dotcol (Score_element*me,Score_element*);
static void add_head (Score_element*me,Score_element*);
{
public:
VIRTUAL_COPY_CONS (Music_iterator);
+ static SCM constructor_cxx_function;
/* construction */
protected:
virtual void process (Moment);
Part_combine_music_iterator ();
enum State { UNKNOWN, UNRELATED=1, SOLO1=2, SOLO2=4, UNIRHYTHM=8, UNISON=16, UNISILENCE=32, SPLIT_INTERVAL=64 };
-
+ static SCM constructor_cxx_function;
protected:
virtual ~Part_combine_music_iterator ();
{
public:
VIRTUAL_COPY_CONS (Music_iterator);
+ static SCM constructor_cxx_function;
/* construction */
protected:
virtual void process (Moment);
{
public:
VIRTUAL_COPY_CONS (Music_iterator);
+ static SCM constructor_cxx_function;
protected:
/* construction */
virtual void process (Moment);
class Pop_property_iterator : public Simple_music_iterator
{
public:
+ static SCM constructor_cxx_function;
VIRTUAL_COPY_CONS (Music_iterator);
protected:
/* construction */
BODY A B C
- is called "semi" folded. This is common notation
+ is called volta. This is common notation
BODY A BODY B BODY C
is called unfolded. Useful for MIDI.
-
If the number of repeats is smaller than the number of alternatives, then
the excess alternatives are ignored for all timing purposes.
public:
Music * body () const;
Music_sequence * alternatives () const;
- String type_;
-
- bool fold_b_;
- /// if FOLD_B_ is false, semifold this.
- bool volta_fold_b_;
/// how often do we repeat?
- int repeats_i_;
+ int repeat_count( ) const;
virtual Musical_pitch to_relative_octave (Musical_pitch);
- /// The duration of this piece of music
- virtual Moment length_mom () const;
Moment body_length_mom () const;
- Moment alternatives_length_mom () const;
+ Moment alternatives_length_mom (bool fold) const;
+ DECLARE_SCHEME_CALLBACK(unfolded_music_length, (SCM));
+ DECLARE_SCHEME_CALLBACK(volta_music_length, (SCM));
+ DECLARE_SCHEME_CALLBACK(folded_music_length, (SCM));
+
/// Transpose, with the interval central C to #p#
virtual void transpose (Musical_pitch p);
enum { NONE_DONE, START_DONE, END_DONE } status_;
public:
VIRTUAL_COPY_CONS (Music_iterator);
+ static SCM constructor_cxx_function;
Request_chord_iterator ();
Request_chord_iterator (Request_chord_iterator const&);
{
public:
VIRTUAL_COPY_CONS (Music_iterator);
+ static SCM constructor_cxx_function;
Sequential_music_iterator ();
Sequential_music_iterator (Sequential_music_iterator const&);
virtual ~Sequential_music_iterator ();
Moment last_processed_mom_;
public:
VIRTUAL_COPY_CONS (Music_iterator);
+ static SCM constructor_cxx_function;
Simple_music_iterator ();
Simple_music_iterator (Simple_music_iterator const &);
virtual void process (Moment);
Simultaneous_music_iterator ();
Simultaneous_music_iterator (Simultaneous_music_iterator const&);
virtual ~Simultaneous_music_iterator ();
-
+ static SCM constructor_cxx_function;
+
/// make a new context for every child.
bool separate_contexts_b_;
int cursor_i_;
{
public:
VIRTUAL_COPY_CONS (Music_iterator);
+ static SCM constructor_cxx_function;
/* construction */
protected:
virtual void process (Moment);
#ifndef TIME_SIGNATURE_PERFORMER_HH
#define TIME_SIGNATURE_PERFORMER_HH
-#include "lily-proto.hh"
-#include "performer.hh"
-
-class Time_signature_performer : public Performer
-{
-public:
- VIRTUAL_COPY_CONS(Translator);
-
- Time_signature_performer();
- ~Time_signature_performer();
-
-protected:
-
- virtual bool do_try_music (Music* req_l);
- virtual void do_process_music();
- virtual void do_pre_move_processing ();
-
-private:
- Time_signature_change_req* time_signature_req_l_;
- Audio_time_signature* audio_p_;
-};
#endif // TIME_SIGNATURE_PERFORMER_HH
class Timing_translator : public virtual Translator
{
+
+ SCM last_time_sig_;
public:
VIRTUAL_COPY_CONS(Translator);
Timing_translator ();
- Link_array<Timing_req> timing_req_l_arr_;
+ Music *check_;
protected:
virtual void do_creation_processing ();
public:
Moment measure_position () const;
Moment measure_length () const;
- void set_time_signature (int, int);
+ void set_time_signature ();
};
#endif // TIMING_TRANSLATOR_HH
How often have we done the body (assuming bodies are interspersed.)?
*/
int done_count_;
+ static SCM constructor_cxx_function;
/*
are we now busy doing the body?
*/
bool do_main_b_;
+ /*
+ are we doing volta's?
+ */
+ bool volta_b_;
+
/** How far have we progressed into the repeat.
This excludes the elt currently being iterated.
*/
virtual bool ok () const;
virtual void next_element (bool side_effect);
};
+
+class Volta_repeat_iterator : public Unfolded_repeat_iterator
+{
+public:
+ Volta_repeat_iterator ();
+ static SCM constructor_cxx_function;
+ VIRTUAL_COPY_CONS(Music_iterator);
+};
+
+
#endif /* UNFOLDED_REPEAT_ITERATOR_HH */
{
if (!item_p_)
{
- item_p_ = new Item ( get_property ("KeySignature"));
+ item_p_ = new Item (get_property ("KeySignature"));
item_p_->set_elt_property ("c0-position", gh_int2scm (0));
#include "musical-request.hh"
#include "identifier.hh"
#include "version.hh"
-#include "mudela-version.hh"
+#include "lilypond-input-version.hh"
#include "translator-def.hh"
+/*
+RH 7 fix (?)
+*/
#define isatty HORRIBLEKLUDGE
void strip_trailing_white (String&);
return SCM_T;
}
yylval.scm = ly_parse_scm (s, &n);
- DEBUG_OUT << "Scheme: ";
- if (flower_dstream)
- ly_display_scm (yylval.scm);
for (int i=0; i < n; i++)
{
}
[{}] {
-
DEBUG_OUT << "parens\n";
return YYText ()[0];
}
yylval.scm = sid;
return dynamic_cast<Request*> (mus) ? REQUEST_IDENTIFIER : MUSIC_IDENTIFIER;
+ } else if (unsmob_duration (sid)) {
+ yylval.scm = sid;
+ return DURATION_IDENTIFIER;
}
+
Identifier * id = unsmob_identifier (sid);
if (id) {
yylval.id = id;
}
if ((YYSTATE != notes) && (YYSTATE != chords)) {
- SCM pitch = scm_hashq_ref (pitchname_tab_, sym, SCM_BOOL_F);
+ SCM pitch = scm_hashq_get_handle (pitchname_tab_, sym);
- if (pitch != SCM_BOOL_F)
+ if (gh_pair_p (pitch))
{
- yylval.pitch = new Musical_pitch (pitch);
- yylval.pitch->set_spot (Input (source_file_l (),
- here_ch_C ()));
+ yylval.scm = gh_cdr (pitch);
return NOTENAME_PITCH;
}
}
{
SCM sym = ly_symbol2scm (str.ch_C ());
if ((YYSTATE == notes) || (YYSTATE == chords)) {
- SCM pitch = scm_hashq_ref (pitchname_tab_, sym, SCM_BOOL_F);
- if (pitch != SCM_BOOL_F) {
- yylval.pitch = new Musical_pitch (pitch);
- yylval.pitch->set_spot (Input (source_file_l (),
- here_ch_C ()));
+ SCM pitch = scm_hashq_get_handle (pitchname_tab_, sym);
+ if (gh_pair_p (pitch)) {
+ yylval.scm = gh_cdr (pitch);
return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH;
- } else if ((pitch = scm_hashq_ref (chordmodifier_tab_, sym, SCM_BOOL_F))!= SCM_BOOL_F)
+ } else if ((pitch = scm_hashq_get_handle (chordmodifier_tab_, sym))!= SCM_BOOL_F)
{
- yylval.pitch = new Musical_pitch (pitch);
- yylval.pitch->set_spot (Input (source_file_l (),
- here_ch_C ()));
+ yylval.scm = gh_cdr (pitch);
return CHORDMODIFIER_PITCH;
}
}
bool
valid_version_b (String s)
{
- Mudela_version current ( MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL );
- Mudela_version ver (s);
+ Lilypond_version current ( MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL );
+ Lilypond_version ver (s);
if (!((ver >= oldest_version) && (ver <= current)))
{
- non_fatal_error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), current.str ()));
- non_fatal_error (_("Consider converting the input with the convert-mudela script"));
+ non_fatal_error (_f ("incorrect lilypond version: %s (%s, %s)", ver.str (), oldest_version.str (), current.str ()));
+ non_fatal_error (_("Consider converting the input with the convert-ly script"));
return false;
}
return true;
scm_init_funcs_->push (f);
}
+extern void init_cxx_function_smobs();
void
init_lily_guile ()
{
+ init_cxx_function_smobs();
for (int i=scm_init_funcs_->size() ; i--;)
(scm_init_funcs_->elem (i)) ();
}
Score_element * support_l = support_l_arr_[i];
Note_req * note_l = mel_l_arr_[i];
- int n = note_l->pitch_.notename_i_;
- int o = note_l->pitch_.octave_i_;
- int a = note_l->pitch_.accidental_i_;
+ int n = unsmob_pitch (note_l->get_mus_property ("pitch"))->notename_i_;
+ int o = unsmob_pitch (note_l->get_mus_property ("pitch"))->octave_i () ;
+ int a = unsmob_pitch (note_l->get_mus_property ("pitch"))->alteration_i_;
/* see if there's a tie that "changes" the accidental */
/* works because if there's a tie, the note to the left
sign (prev_acc) * (prev_acc - a) == 1
&& abs(prev_acc) == 2;
- Local_key_item::add_pitch (key_item_p_, note_l->pitch_,
+ Local_key_item::add_pitch (key_item_p_, *unsmob_pitch (note_l->get_mus_property ("pitch")),
to_boolean (note_l->get_mus_property ("cautionary")),
extra_natural);
Side_position::add_support (key_item_p_,support_l);
#include "misc.hh"
#include "lookup.hh"
-SCM
+static SCM
pitch_less (SCM p1, SCM p2)
{
- for (int i = 3; i--; p1 = gh_cdr (p1), p2 = gh_cdr (p2))
- {
- if (scm_less_p (gh_car (p1), gh_car (p2)))
- return SCM_BOOL_T;
- if (gh_car (p1) != gh_car (p2))
- return SCM_BOOL_F;
- }
- return SCM_BOOL_T;
+ return Musical_pitch::less_p (gh_car (p1), gh_car (p2));
}
-SCM pitch_less_proc;
-
+static SCM pitch_less_proc;
void
init_pitch_funcs ()
{
- pitch_less_proc = gh_new_procedure2_0 ("pitch-less", &pitch_less);
+ pitch_less_proc = gh_new_procedure2_0 ("pits-less", &pitch_less);
}
-ADD_SCM_INIT_FUNC(pitch,init_pitch_funcs);
+ADD_SCM_INIT_FUNC(lkpitch,init_pitch_funcs);
void
Local_key_item::add_pitch (Score_element*me, Musical_pitch p, bool cautionary, bool natural)
{
SCM acs = me->get_elt_property ("accidentals");
- SCM pitch = p.to_scm ();
+ SCM pitch = p.smobbed_copy ();
SCM opts = SCM_EOL;
if (cautionary)
opts = gh_cons (ly_symbol2scm ("cautionary"), opts);
if (natural)
opts = gh_cons (ly_symbol2scm ("natural"), opts);
- pitch = gh_append2 (pitch, opts);
+ pitch = gh_cons (pitch, opts);
acs = scm_merge_x (acs, gh_cons (pitch, SCM_EOL), pitch_less_proc);
me->set_elt_property ("accidentals", acs);
for (SCM s = accs;
gh_pair_p (s); s = gh_cdr (s))
{
- Musical_pitch p (gh_car (s));
+ Musical_pitch p (*unsmob_pitch (gh_caar (s)));
+ SCM opts = gh_cdar (s);
// do one octave
- if (p.octave_i_ != lastoct)
+ if (p.octave_i () != lastoct)
{
if (oct_b)
{
oct_b = true;
}
- lastoct = p.octave_i_;
+ lastoct = p.octave_i () ;
SCM c0 = me->get_elt_property ("c0-position");
Real dy = (gh_number_p (c0) ? gh_scm2int (c0) : 0 + p.notename_i_)
* note_distance;
Molecule acc (Font_interface::get_default_font (me)->find_by_name (String ("accidentals-")
- + to_str (p.accidental_i_)));
+ + to_str (p.alteration_i_)));
- if (scm_memq (ly_symbol2scm ("natural"), gh_car (s)) != SCM_BOOL_F)
+ if (scm_memq (ly_symbol2scm ("natural"), opts) != SCM_BOOL_F)
{
Molecule prefix = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-0"));
acc.add_at_edge(X_AXIS, LEFT, Molecule(prefix), 0);
}
- if (scm_memq (ly_symbol2scm ("cautionary"), gh_car (s)) != SCM_BOOL_F)
+ if (scm_memq (ly_symbol2scm ("cautionary"), opts) != SCM_BOOL_F)
acc = parenthesize (me, acc);
acc.translate_axis (dy, Y_AXIS);
return lyric_iter_p_->try_music (m);
}
+
+IMPLEMENT_CTOR_CALLBACK(Lyric_combine_music_iterator);
*/
#include "lyric-combine-music.hh"
+#include "lyric-combine-music-iterator.hh"
#include "musical-pitch.hh"
Lyric_combine_music::Lyric_combine_music (Music * m, Music * l)
set_mus_property ("music", m->self_scm ());
set_mus_property ("lyrics", l->self_scm ());
- set_mus_property ("type", ly_symbol2scm ("lyric-combine-music"));
+ set_mus_property ("type",
+ Lyric_combine_music_iterator::constructor_cxx_function);
}
Moment beats_per_second = Moment (beats_per_minute_i) / Moment (60);
Moment m = Moment(1)/Moment(beats_per_second * one_beat_mom);
- scope_p_->set ("whole-in-seconds", m.make_scm());
+ scope_p_->set ("whole-in-seconds", m.smobbed_copy());
}
SCM
-Moment::make_scm () const
+Moment::smobbed_copy () const
{
Moment * m = new Moment (*this);
return m->smobbed_self();
::error ("make-moment takes two integer arguments. Using 1/1");
}
- return m.make_scm ();
+ return m.smobbed_copy ();
}
return 0;
}
-static
-void start_callback_smobs()
+
+void init_cxx_function_smobs()
{
callback_tag = scm_make_smob_type_mfpe ("callback", 0,
mark_smob, free_smob,
}
SCM
-smobify_callback (Cpp_function cb )
+smobify_cxx_function (Cxx_function cb )
{
SCM z;
return z;
}
-
-ADD_SCM_INIT_FUNC(callback, start_callback_smobs);
+
+
+Cxx_function
+unsmob_cxx_function (SCM x)
+{
+ if (SCM_CELL_TYPE(x) == callback_tag)
+ return (Cxx_function) SCM_CELL_WORD_1(x);
+ else
+ return 0;
+}
+
+
*/
#include "debug.hh"
#include "music-iterator.hh"
-#include "property-iterator.hh"
-#include "request-chord-iterator.hh"
-#include "sequential-music-iterator.hh"
-#include "simultaneous-music-iterator.hh"
#include "translator-group.hh"
-#include "change-iterator.hh"
#include "music-wrapper.hh"
#include "music-wrapper-iterator.hh"
-#include "time-scaled-music-iterator.hh"
-#include "repeated-music.hh"
-#include "folded-repeat-iterator.hh"
-#include "unfolded-repeat-iterator.hh"
-#include "grace-iterator.hh"
-#include "lyric-combine-music-iterator.hh"
-#include "auto-change-iterator.hh"
-#include "part-combine-music-iterator.hh"
#include "simple-music-iterator.hh"
-#include "output-property-music-iterator.hh"
-#include "chord-tremolo-iterator.hh"
#include "context-specced-music.hh"
Music_iterator::Music_iterator ()
return SCM_EOL;
}
-
-
-/* We could do this decentrally:
-
- - Declare a new smob-type, which stores a function ptr in its CDR
- (and not a struct ptr). The function ptr has signature
-
- Music_iterator* (*)()
-
- - initialize all music with a set_mus_property("iterator-ctor"),
-
- - do
-
- func_ptr p = (func_ptr) gh_cdr (get_mus_property ("iterator-ctor"));
- iter_p = (*p)();
-
-*/
-
Music_iterator*
Music_iterator::static_get_iterator_p (Music *m)
{
Music_iterator * p =0;
SCM type = m->get_mus_property ("type") ;
-
- if (type == ly_symbol2scm ("property-set"))
- p = new Property_iterator;
- else if (type == ly_symbol2scm ("property-push"))
- p = new Push_property_iterator;
- else if (type == ly_symbol2scm ("property-pop"))
- p = new Pop_property_iterator;
- else if (type == ly_symbol2scm ("output-property"))
- p = new Output_property_music_iterator;
- else if (type == ly_symbol2scm ("request-chord"))
- p = new Request_chord_iterator;
- else if (type == ly_symbol2scm ("lyric-combine-music"))
- p = new Lyric_combine_music_iterator;
- else if (type == ly_symbol2scm ("simultaneous-music"))
- p = new Simultaneous_music_iterator;
- else if (type == ly_symbol2scm ("sequential-music"))
- p = new Sequential_music_iterator;
- else if (type == ly_symbol2scm ("change-translator"))
- p = new Change_iterator;
- else if (type == ly_symbol2scm ("time-scaled-music"))
- p = new Time_scaled_music_iterator;
- else if (type == ly_symbol2scm ("grace-music"))
- p = new Grace_iterator;
- else if (type == ly_symbol2scm ("auto-change-music"))
- p = new Auto_change_iterator;
- else if (type == ly_symbol2scm ("part-combined-music"))
- p = new Part_combine_music_iterator;
- else if (dynamic_cast<Music_wrapper *> (m))
- p = new Music_wrapper_iterator;
- else if (Repeated_music * n = dynamic_cast<Repeated_music *> (m))
+ if (unsmob_cxx_function (type))
{
- if (n->type_ == "tremolo")
- p = new Chord_tremolo_iterator;
- else if (n->fold_b_)
- p = new Folded_repeat_iterator;
- else
- p = new Unfolded_repeat_iterator;
+ Cxx_function f = unsmob_cxx_function (type);
+
+ p = (Music_iterator*) (*f) (SCM_EOL);
}
+ else if (dynamic_cast<Music_wrapper *> (m))
+ p = new Music_wrapper_iterator;
else
{
p = new Simple_music_iterator ;
return 0;
}
+IMPLEMENT_CTOR_CALLBACK(Music_iterator);
#include "music-iterator.hh"
#include "main.hh"
#include "killing-cons.tcc"
+#include "simultaneous-music-iterator.hh"
+#include "sequential-music-iterator.hh"
+#include "request-chord-iterator.hh"
Moment
Simultaneous_music::length_mom () const
Simultaneous_music::Simultaneous_music(SCM head)
: Music_sequence (head)
{
- set_mus_property ("type", ly_symbol2scm ("simultaneous-music"));
+ set_mus_property ("type",
+ Simultaneous_music_iterator::constructor_cxx_function);
}
Sequential_music::Sequential_music(SCM head)
: Music_sequence (head)
{
- set_mus_property ("type", ly_symbol2scm ("sequential-music"));
+ set_mus_property ("type",
+ Sequential_music_iterator::constructor_cxx_function);
}
Request_chord::Request_chord(SCM s)
: Simultaneous_music (s)
{
- set_mus_property ("type", ly_symbol2scm ("request-chord"));
+ set_mus_property ("type",
+ Request_chord_iterator::constructor_cxx_function);
}
Musical_pitch
Music * mus = unsmob_music (gh_car (s));
if (Melodic_req *m= dynamic_cast <Melodic_req *> (mus))
{
- Musical_pitch &pit = m->pitch_;
+ Musical_pitch pit = *unsmob_pitch (m->get_mus_property ("pitch"));
+
pit.to_relative_octave (last);
+ m->set_mus_property ("pitch", pit.smobbed_copy());
+
return pit;
}
}
{
return child_iter_p_->try_music (m);
}
+
+IMPLEMENT_CTOR_CALLBACK(Music_wrapper_iterator);
Moment
Music::length_mom () const
{
+ SCM l = get_mus_property ("length");
+ if (unsmob_moment (l))
+ return *unsmob_moment(l);
+ else if (gh_procedure_p (l))
+ {
+ SCM res = gh_call1(l, self_scm( ));
+ return *unsmob_moment(res);
+ }
+
return 0;
}
#include "musical-pitch.hh"
#include "debug.hh"
#include "main.hh"
+#include "ly-smobs.icc"
int
compare (Array<Musical_pitch>* left, Array<Musical_pitch>* right)
return 0;
}
-SCM
-Musical_pitch::to_scm ()const
+Musical_pitch::Musical_pitch (int o, int n, int a)
{
- return gh_list (gh_int2scm (octave_i_),
- gh_int2scm (notename_i_),
- gh_int2scm (accidental_i_),
- SCM_UNDEFINED);
-}
-
+ notename_i_ = n;
+ alteration_i_ = a;
+ octave_i_ = o;
-Musical_pitch::Musical_pitch (SCM s)
-{
- octave_i_ = gh_scm2int (gh_car (s));
- notename_i_ = gh_scm2int (gh_cadr (s));
- accidental_i_ = gh_scm2int (gh_caddr (s));
+ if (n < 0 || n >= 7 ||
+ a < -2 || a > 2)
+ {
+ String s = _("Pitch arguments out of range");
+ s += ": alteration = " + to_str (a);
+ s += ", notename = " + to_str (n);
+ warning (s);
+ }
}
-Musical_pitch::Musical_pitch (int n, int a, int o)
+Musical_pitch::Musical_pitch ()
{
- notename_i_ = n;
- accidental_i_ = a;
- octave_i_ = o;
+ notename_i_ = 0;
+ alteration_i_ = 0;
+ octave_i_ = 0;
}
-
int
Musical_pitch::compare (Musical_pitch const &m1, Musical_pitch const &m2)
{
- int o= m1.octave_i_ - m2.octave_i_;
+ int o= m1.octave_i_ - m2.octave_i_;
int n = m1.notename_i_ - m2.notename_i_;
- int a = m1.accidental_i_ - m2.accidental_i_;
+ int a = m1.alteration_i_ - m2.alteration_i_;
if (o)
return o;
}
/*
- should be settable from input to allow "viola"-mode
+ should be settable from input?
*/
static Byte pitch_byte_a[ ] = { 0, 2, 4, 5, 7, 9, 11 };
int
Musical_pitch::semitone_pitch () const
{
- return pitch_byte_a[ notename_i_ % 7 ] + accidental_i_ + octave_i_ * 12;
+ return pitch_byte_a[ notename_i_ % 7 ] + alteration_i_ + octave_i_ * 12;
}
void
int new_pitch = semitone_pitch ();
int delta_acc = new_pitch - old_pitch - delta_pitch;
- accidental_i_ -= delta_acc;
+ alteration_i_ -= delta_acc;
}
{
int n = (notename_i_ + 2) % 7;
String s = to_str (char(n + 'a'));
- if (accidental_i_)
- s += String (accname[accidental_i_ + 2]);
+ if (alteration_i_)
+ s += String (accname[alteration_i_ + 2]);
if (octave_i_ > 0)
{
Musical_pitch up_pitch (p);
Musical_pitch down_pitch (p);
- up_pitch.accidental_i_ = accidental_i_;
- down_pitch.accidental_i_ = accidental_i_;
+ up_pitch.alteration_i_ = alteration_i_;
+ down_pitch.alteration_i_ = alteration_i_;
Musical_pitch n = *this;
up_pitch.up_to (notename_i_);
notename_i_ = notename;
}
+/****************************************************************/
+
+
+IMPLEMENT_TYPE_P(Musical_pitch, "pitch?");
+IMPLEMENT_UNSMOB(Musical_pitch, pitch);
+SCM
+Musical_pitch::mark_smob (SCM )
+{
+ return SCM_EOL;
+}
+
+IMPLEMENT_SIMPLE_SMOBS(Musical_pitch);
+
+
+int
+Musical_pitch::print_smob (SCM s, SCM port, scm_print_state *)
+{
+ Musical_pitch *r = (Musical_pitch *) gh_cdr (s);
+
+ scm_puts ("#<Musical_pitch ", port);
+ scm_display (gh_str02scm (r->str().ch_C()), port);
+ scm_puts (" >", port);
+
+ return 1;
+}
+
+SCM
+Musical_pitch::equal_p (SCM a , SCM b)
+{
+ Musical_pitch *p = (Musical_pitch *) gh_cdr (a);
+ Musical_pitch *q = (Musical_pitch *) gh_cdr (b);
+
+ bool eq = p->notename_i_ == q->notename_i_
+ && p->octave_i_ == q->octave_i_
+ && p->alteration_i_ == q->alteration_i_;
+
+ return eq ? SCM_BOOL_T : SCM_BOOL_F;
+}
+
+MAKE_SCHEME_CALLBACK(Musical_pitch, less_p, 2);
+SCM
+Musical_pitch::less_p (SCM p1, SCM p2)
+{
+ Musical_pitch *a = unsmob_pitch (p1);
+ Musical_pitch *b = unsmob_pitch (p2);
+
+ if (compare(*a, *b) < 0 )
+ return SCM_BOOL_T;
+ else
+ return SCM_BOOL_F;
+}
+
+/*
+ should add optional args
+ */
+
+static SCM
+make_pitch (SCM o, SCM n, SCM a)
+{
+ Musical_pitch p;
+ p.octave_i_ = gh_scm2int (o);
+ p.notename_i_ = gh_scm2int (n);
+ p.alteration_i_ = gh_scm2int (a);
+ return p.smobbed_copy ();
+}
+
+static SCM
+pitch_octave (SCM pp)
+{
+ Musical_pitch *p = unsmob_pitch (pp);
+ int q = 0;
+ if (!p)
+ warning ("Not a pitch");
+ else
+ q = p->octave_i();
+
+ return gh_int2scm (q);
+}
+
+static SCM
+pitch_alteration (SCM pp)
+{
+ Musical_pitch *p = unsmob_pitch (pp);
+ int q = 0;
+ if (!p)
+ warning ("Not a pitch");
+ else
+ q = p->alteration_i();
+
+ return gh_int2scm (q);
+}
+
+static SCM
+pitch_notename (SCM pp)
+{
+ Musical_pitch *p = unsmob_pitch (pp);
+ int q = 0;
+ if (!p)
+ warning ("Not a pitch");
+ else
+ q = p->notename_i();
+
+ return gh_int2scm (q);
+}
+
+static SCM
+pitch_semitones (SCM pp)
+{
+ Musical_pitch *p = unsmob_pitch (pp);
+ int q = 0;
+ if (!p)
+ warning ("Not a pitch");
+ else
+ q = p->steps();
+
+ return gh_int2scm (q);
+}
+
+static void
+add_funcs()
+{
+ scm_make_gsubr ("make-pitch", 3, 0, 0, (Scheme_function_unknown)make_pitch);
+ scm_make_gsubr ("pitch-octave", 1, 0, 0, (Scheme_function_unknown)pitch_octave);
+ scm_make_gsubr ("pitch-notename", 1, 0, 0, (Scheme_function_unknown)pitch_notename);
+ scm_make_gsubr ("pitch-alteration", 1, 0, 0, (Scheme_function_unknown)pitch_alteration);
+ scm_make_gsubr ("pitch-semitones", 1, 0, 0, (Scheme_function_unknown)pitch_semitones);
+}
+
+ADD_SCM_INIT_FUNC(pitch, add_funcs);
+
+SCM
+Musical_pitch::smobbed_copy ()const
+{
+ Musical_pitch * p = new Musical_pitch (*this);
+ return p->smobbed_self ();
+}
+
+int
+Musical_pitch::octave_i ()const
+{
+ return octave_i_;
+}
+
+int
+Musical_pitch::notename_i () const
+{
+ return notename_i_;
+}
+
+int
+Musical_pitch::alteration_i () const
+{
+ return alteration_i_;
+}
void
Melodic_req::transpose (Musical_pitch delta)
{
- pitch_.transpose (delta);
+ Musical_pitch p = *unsmob_pitch (get_mus_property ("pitch"));
- if (abs (pitch_.accidental_i_) > 2)
+ p.transpose (delta);
+
+ if (abs (p.alteration_i_) > 2)
{
warning (_f ("Transposition by %s makes accidental larger than two",
delta.str ()));
}
+
+ set_mus_property ("pitch", p.smobbed_copy ());
}
bool
Melodic_req::do_equal_b (Request const* r) const
{
Melodic_req const* m= dynamic_cast <Melodic_req const*> (r);
- return m&& !compare (*m, *this);
-}
-
-int
-Melodic_req::compare (Melodic_req const &m1 , Melodic_req const&m2)
-{
- return Musical_pitch::compare (m1.pitch_, m2.pitch_);
-}
-
-int
-Rhythmic_req::compare (Rhythmic_req const &r1, Rhythmic_req const &r2)
-{
- return (r1.length_mom () - r2.length_mom ());
+ return m; // && !compare (*m, *this);
}
bool
{
Rhythmic_req const* rh = dynamic_cast <Rhythmic_req const*> (r);
- return rh && !compare (*this, *rh);
+ return rh; // ; && !compare (*this, *rh);
}
Moment
Rhythmic_req::length_mom () const
{
- return duration_.length_mom ();
+ return unsmob_duration ( get_mus_property( "duration"))->length_mom ();
+
}
void
Rhythmic_req::compress (Moment m)
{
- duration_.compress (m);
-}
-
+ Duration *d = unsmob_duration (get_mus_property( "duration"));
+ set_mus_property ("duration", d ->compressed (m).smobbed_copy());
+}
bool
Note_req::do_equal_b (Request const* r) const
{
source_l_ = source_l;
lexer_p_ = 0;
- default_duration_.durlog_i_ = 2;
+ default_duration_ = Duration (2,0);
error_level_i_ = 0;
-Interval
-Note_column::rest_dim (Score_element*me)
-{
- Score_element * r = unsmob_element (me->get_elt_property ("rest"));
- return r->extent (r, Y_AXIS); // ??
-}
Score_element*
Note_column::first_head (Score_element*me)
- Note_req * note_req_l = note_req_l_arr_[i];
+ Music * req = note_req_l_arr_[i];
+ Duration dur = *unsmob_duration (req->get_mus_property ("duration"));
note_p->set_elt_property ("duration-log",
- gh_int2scm (note_req_l->duration_.durlog_i_ <? 2));
+ gh_int2scm (dur.duration_log () <? 2));
- if (note_req_l->duration_.dots_i_)
+ if (dur.dot_count ())
{
Item * d = new Item (get_property ("Dots"));
Rhythmic_head::set_dots (note_p, d);
- if (note_req_l->duration_.dots_i_
+ if (dur.dot_count ()
!= gh_scm2int (d->get_elt_property ("dot-count")))
- d->set_elt_property ("dot-count", gh_int2scm (note_req_l->duration_.dots_i_));
+ d->set_elt_property ("dot-count", gh_int2scm (dur.dot_count ()));
d->set_parent (note_p, Y_AXIS);
announce_element (d,0);
dot_p_arr_.push (d);
}
- note_p->set_elt_property("staff-position", gh_int2scm (note_req_l->pitch_.steps ()));
+ note_p->set_elt_property("staff-position", gh_int2scm (unsmob_pitch (req->get_mus_property ("pitch"))->steps ()));
- announce_element (note_p,note_req_l);
+ announce_element (note_p,req);
note_p_arr_.push (note_p);
}
}
{
if (i)
s += " ";
- s += req_l_arr_[i]->pitch_.str ();
+ s += unsmob_pitch (req_l_arr_[i]->get_mus_property ("pitch"))->str ();
}
if (s.length_i())
{
while (note_req_l_arr_.size ())
{
Note_req* n = note_req_l_arr_.pop ();
- Audio_note* p = new Audio_note (n->pitch_, n->length_mom (), transposing_i);
+ Musical_pitch pit = * unsmob_pitch (n->get_mus_property ("pitch"));
+ Audio_note* p = new Audio_note (pit, n->length_mom (), transposing_i);
Audio_element_info info (p, n);
announce_element (info);
note_p_arr_.push (p);
#include "engraver.hh"
#include "score-element.hh"
+#include "output-property-music-iterator.hh"
class Output_property_engraver : public Engraver
{
bool
Output_property_engraver::do_try_music (Music* m)
{
- if (m->get_mus_property ("type") == ly_symbol2scm ("output-property"))
+ if (m->get_mus_property ("type") ==
+ Output_property_music_iterator::constructor_cxx_function)
{
props_.push (m);
return true;
skip (m);
}
+
+IMPLEMENT_CTOR_CALLBACK(Output_property_music_iterator);
else
id_str += String (", ") + version_str ();
- output_String_def ( "mudelatagline", id_str);
+ output_String_def ( "lilypondtagline", id_str);
output_String_def ( "LilyPondVersion", version_str ());
}
outputter_l_->output_version ();
if (header_global_p)
- outputter_l_->output_scope (header_global_p, "mudela");
+ outputter_l_->output_scope (header_global_p, "lilypond");
if (header_l_)
- outputter_l_->output_scope (header_l_, "mudela");
+ outputter_l_->output_scope (header_l_, "lilypond");
outputter_l_->output_comment (_ ("Outputting Score, defined at: "));
outputter_l_->output_comment (origin_str_);
if (paper_l_->scope_p_)
- outputter_l_->output_scope (paper_l_->scope_p_, "mudelapaper");
+ outputter_l_->output_scope (paper_l_->scope_p_, "lilypondpaper");
SCM scm;
if (experimental_features_global_b)
%{ // -*-Fundamental-*-
/*
- parser.yy -- Bison/C++ parser for mudela
+ parser.yy -- Bison/C++ parser for lilypond
source file of the GNU LilyPond music typesetter
#include <iostream.h>
#include "translator-def.hh"
#include "lily-guile.hh"
-
-#include "lookup.hh"
+#include "change-iterator.hh"
#include "misc.hh"
#include "my-lily-lexer.hh"
#include "paper-def.hh"
#include "context-specced-music.hh"
#include "score.hh"
#include "music-list.hh"
-
+#include "output-property-music-iterator.hh"
+#include "property-iterator.hh"
#include "file-results.hh"
#include "input.hh"
#include "scope.hh"
#include "transposed-music.hh"
#include "time-scaled-music.hh"
#include "repeated-music.hh"
-#include "mudela-version.hh"
+#include "lilypond-input-version.hh"
#include "grace-music.hh"
#include "auto-change-music.hh"
#include "part-combine-music.hh"
}
+void
+set_music_properties (Music *p, SCM a)
+{
+ for (SCM k = a; gh_pair_p (k); k = gh_cdr (k))
+ {
+ p->set_mus_property (gh_caar (k), gh_cdar (k));
+ }
+}
+
+
// mmm JUNKME ?
-Mudela_version oldest_version ("1.3.59");
+Lilypond_version oldest_version ("1.3.59");
void
-print_mudela_versions (ostream &os)
+print_lilypond_versions (ostream &os)
{
os << _f ("Oldest supported input version: %s", oldest_version.str ())
<< endl;
%union {
- Array<Musical_pitch> *pitch_arr;
+
Link_array<Request> *reqvec;
- Duration *duration;
Identifier *id;
String * string;
Music *music;
Musical_req* musreq;
Music_output_def * outputdef;
- Musical_pitch * pitch;
+
Midi_def* midi;
Real real;
Request * request;
%token CLEF
%token CM_T
%token CONSISTS
+%token DURATION
%token SEQUENTIAL
%token ELEMENTDESCRIPTIONS
%token SIMULTANEOUS
%token E_CHAR E_EXCLAMATION E_SMALLER E_BIGGER
%token CHORD_BASS CHORD_COLON CHORD_MINUS CHORD_CARET
-%type <i> exclamations questions
+%type <i> exclamations questions dots
%token <i> DIGIT
-%token <pitch> NOTENAME_PITCH
-%token <pitch> TONICNAME_PITCH
-%token <pitch> CHORDMODIFIER_PITCH
-%token <id> DURATION_IDENTIFIER
+%token <scm> NOTENAME_PITCH
+%token <scm> TONICNAME_PITCH
+%token <scm> CHORDMODIFIER_PITCH
+%token <scm> DURATION_IDENTIFIER
%token <id> IDENTIFIER
%token <scm> REQUEST_IDENTIFIER
%token <scm> MUSIC_IDENTIFIER TRANSLATOR_IDENTIFIER
%token <scm> STRING_IDENTIFIER SCM_IDENTIFIER
-%token <scm> DURATION RESTNAME
+%token <scm> RESTNAME
%token <scm> STRING
%token <scm> SCM_T
%token <i> UNSIGNED
%token <real> REAL
%type <outputdef> output_def
-%type <scope> mudela_header mudela_header_body
+%type <scope> lilypond_header lilypond_header_body
%type <request> open_request_parens close_request_parens open_request close_request
%type <request> request_with_dir request_that_take_dir verbose_request
%type <i> sub_quotes sup_quotes
%type <scm> identifier_init
-%type <duration> steno_duration optional_notemode_duration
-%type <duration> entered_notemode_duration explicit_duration
+%type <scm> steno_duration optional_notemode_duration
+%type <scm> entered_notemode_duration explicit_duration
%type <reqvec> pre_requests post_requests
%type <request> gen_text_def
-%type <pitch> steno_musical_pitch musical_pitch absolute_musical_pitch
-%type <pitch> steno_tonic_pitch
+%type <scm> steno_musical_pitch musical_pitch absolute_musical_pitch
+%type <scm> steno_tonic_pitch
-%type <pitch_arr> chord_additions chord_subtractions chord_notes chord_step
+%type <scm> chord_additions chord_subtractions chord_notes chord_step
%type <music> chord
-%type <pitch> chord_note chord_inversion chord_bass
-%type <duration> duration_length
+%type <scm> chord_note chord_inversion chord_bass
+%type <scm> duration_length
%type <scm> embedded_scm scalar
%type <music> Music Sequential_music Simultaneous_music Music_sequence
%%
-mudela: /* empty */
- | mudela toplevel_expression {}
- | mudela assignment { }
- | mudela error {
+lilypond: /* empty */
+ | lilypond toplevel_expression {}
+ | lilypond assignment { }
+ | lilypond error {
THIS->error_level_i_ = 1;
//THIS->parser_error (_ ("ly invalid"));
}
- | mudela INVALID {
+ | lilypond INVALID {
THIS->error_level_i_ = 1;
//THIS->parser_error (_ ("ly invalid"));
}
| chordmodifiers_block {
THIS->lexer_p_->chordmodifier_tab_ = $1;
}
- | mudela_header {
+ | lilypond_header {
delete header_global_p;
header_global_p = $1;
}
int i = scm_ilength ($1);
SCM tab = scm_make_vector (gh_int2scm (i), SCM_EOL);
- for (SCM s = $1; s != SCM_EOL; s = gh_cdr (s)) {
+ for (SCM s = $1; gh_pair_p (s); s = gh_cdr (s)) {
SCM pt = gh_cdar (s);
- if (scm_ilength (pt) != 3)
- THIS->parser_error ("Need three args");
- scm_hashq_set_x (tab, gh_caar(s), pt);
+ if (!unsmob_pitch (pt))
+ THIS->parser_error ("Need pitch object.");
+ else
+ scm_hashq_set_x (tab, gh_caar(s), pt);
}
$$ = tab;
}
;
-mudela_header_body:
+lilypond_header_body:
{
$$ = new Scope;
THIS->lexer_p_-> scope_l_arr_.push ($$);
}
- | mudela_header_body assignment semicolon {
+ | lilypond_header_body assignment semicolon {
}
;
-mudela_header:
- HEADER '{' mudela_header_body '}' {
+lilypond_header:
+ HEADER '{' lilypond_header_body '}' {
$$ = $3;
THIS->lexer_p_-> scope_l_arr_.pop ();
}
scm_unprotect_object ($$);
}
| explicit_duration {
- $$ = (new Duration_identifier ($1, DURATION_IDENTIFIER))->self_scm ();
+ $$ = $1;
}
| number_expression {
$$ = $1;
| SCORE_IDENTIFIER {
$$ = $1->access_content_Score (true);
}
- | score_body mudela_header {
+ | score_body lilypond_header {
$$->header_p_ = $2;
}
| score_body output_def {
tempo_request:
TEMPO steno_duration '=' bare_unsigned {
$$ = new Tempo_req;
- $$->dur_ = *$2;
- delete $2;
- $$-> set_mus_property ("metronome-count", gh_int2scm ( $4));
+ $$->set_mus_property ("duration", $2);
+ $$->set_mus_property ("metronome-count", gh_int2scm ( $4));
}
;
if (m && $3 < m->length_i ())
$5->origin ()->warning (_ ("More alternatives than repeats. Junking excess alternatives."));
+ SCM func = scm_eval2 (ly_symbol2scm ("repeat-name-to-ctor"), SCM_EOL);
+ SCM result = gh_call1 (func, $2);
Repeated_music * r = new Repeated_music ($4, $3 >? 1, m);
- $$ = r;
- r->type_ = ly_scm2string ($2);
- r->fold_b_ = (r->type_ == "fold");
- r->volta_fold_b_ = (r->type_ == "volta");
+ set_music_properties (r, result);
+
r->set_spot (*$4->origin ());
+ $$ = r;
}
;
m->set_mus_property ("predicate", pred);
m->set_mus_property ("symbol", $3);
m->set_mus_property ("value", $5);
- m->set_mus_property ("type", ly_symbol2scm ("output-property"));
+ m->set_mus_property ("type",
+ Output_property_music_iterator::constructor_cxx_function);
$$ = m;
}
| Simultaneous_music { $$ = $1; }
| Sequential_music { $$ = $1; }
| TRANSPOSE musical_pitch Music {
- $$ = new Transposed_music ($3, *$2);
- delete $2; // ugh
+ $$ = new Transposed_music ($3, *unsmob_pitch ($2));
}
| TRANSPOSE steno_tonic_pitch Music {
- $$ = new Transposed_music ($3, *$2);
- delete $2; // ugh
+ $$ = new Transposed_music ($3, *unsmob_pitch ($2));
}
| APPLY embedded_scm Music {
SCM ret = gh_call1 ($2, $3->self_scm ());
relative_music:
RELATIVE absolute_musical_pitch Music {
- $$ = new Relative_octave_music ($3, *$2);
- delete $2; // ugh
+ $$ = new Relative_octave_music ($3, *unsmob_pitch ($2));
}
;
TRANSLATOR STRING '=' STRING {
Music * t = new Music;
t->set_mus_property ("type",
- ly_symbol2scm ("change-translator"));
+ Change_iterator::constructor_cxx_function);
t-> set_mus_property ("change-to-type", $2);
t-> set_mus_property ("change-to-id", $4);
PROPERTY STRING '.' STRING '=' scalar {
Music *t = new Music;
- t->set_mus_property ("type", ly_symbol2scm ("property-set"));
+ t->set_mus_property ("type",
+ Property_iterator::constructor_cxx_function);
t->set_mus_property ("symbol", scm_string_to_symbol ($4));
t->set_mus_property ("value", $6);
}
| PROPERTY STRING '.' STRING PUSH embedded_scm '=' embedded_scm {
Music *t = new Music;
- t->set_mus_property ("type", ly_symbol2scm ("property-push"));
+ t->set_mus_property ("type",
+ Push_property_iterator::constructor_cxx_function);
t->set_mus_property ("symbols", scm_string_to_symbol ($4));
t->set_mus_property ("element-property", $6);
t->set_mus_property ("element-value", $8);
}
| PROPERTY STRING '.' STRING POP embedded_scm {
Music *t = new Music;
- t->set_mus_property ("type", ly_symbol2scm ("property-pop"));
+ t->set_mus_property ("type",
+ Pop_property_iterator::constructor_cxx_function);
t->set_mus_property ("symbols", scm_string_to_symbol ($4));
t->set_mus_property ("element-property", $6);
| BAR STRING ';' {
Music *t = new Music;
- t->set_mus_property ("type", ly_symbol2scm ("property-set"));
+ t->set_mus_property ("type",
+ Property_iterator::constructor_cxx_function);
t->set_mus_property ("symbol", ly_symbol2scm ("whichBar"));
t->set_mus_property ("value", $2);
| PARTIAL duration_length ';' {
Music * p = new Music;
p->set_mus_property ("symbol", ly_symbol2scm ( "measurePosition"));
- p->set_mus_property ("type", ly_symbol2scm ("property-set"));
+ p->set_mus_property ("type",
+ Property_iterator::constructor_cxx_function);
+
+ Moment m = - unsmob_duration($2)->length_mom ();
+ p->set_mus_property ("value", m.smobbed_copy ());
- Moment m = - $2->length_mom ();
- p->set_mus_property ("value", m.make_scm());
- delete $2; // ugh
Context_specced_music * sp = new Context_specced_music (p);
$$ =sp ;
sp-> set_mus_property ("context-type", ly_str02scm ( "Score"));
SCM func = scm_eval2 (ly_symbol2scm ("clef-name-to-properties"), SCM_EOL);
SCM result = gh_call1 (func, $2);
- SCM l = SCM_EOL;
+ SCM l = SCM_EOL;
for (SCM s = result ; gh_pair_p (s); s = gh_cdr (s)) {
Music * p = new Music;
- for (SCM k = gh_car (s) ; gh_pair_p (k); k = gh_cdr (k)) {
- p->set_mus_property (gh_caar (k), gh_cdar (k));
- }
+ set_music_properties(p, gh_car (s));
l = gh_cons (p->self_scm (), l);
scm_unprotect_object (p->self_scm ());
}
$$ =sp ;
sp-> set_mus_property("context-type", ly_str02scm("Staff"));
}
+ | TIME_T bare_unsigned '/' bare_unsigned ';' {
+ Music * p = new Music;
+ p->set_mus_property ("symbol",
+ ly_symbol2scm ( "timeSignatureFraction"));
+ p->set_mus_property ("type",
+ Property_iterator::constructor_cxx_function);
+
+ p->set_mus_property ("value", gh_cons (gh_int2scm ($2),
+ gh_int2scm ($4)));
+
+ Context_specced_music * sp = new Context_specced_music (p);
+ $$ =sp ;
+ sp-> set_mus_property ("context-type", ly_str02scm ( "Score"));
+ }
;
command_req:
m->set_mus_property ("label", gh_int2scm ($2));
$$ = m;
}
-
- | TIME_T bare_unsigned '/' bare_unsigned {
- Time_signature_change_req *m = new Time_signature_change_req;
- m->set_mus_property ("beats", gh_int2scm ( $2));
- m->set_mus_property ("one-beat", gh_int2scm ($4));
- $$ = m;
- }
| PENALTY bare_int {
Break_req * b = new Break_req;
b->set_mus_property ("penalty", gh_double2scm ( $2 / 100.0));
}
| SKIP duration_length {
Skip_req * skip_p = new Skip_req;
- skip_p->duration_ = *$2;
- delete $2; // ugh
+ skip_p->set_mus_property ("duration", $2);
+
$$ = skip_p;
}
| tempo_request {
Key_change_req *key_p= new Key_change_req;
key_p->set_mus_property ("pitch-alist", $3);
- ((Music* )key_p)->transpose (* $2);
+ ((Music* )key_p)->transpose (* unsmob_pitch ($2));
$$ = key_p;
}
;
$$ = $1;
}
| NOTENAME_PITCH sup_quotes {
- $$ = $1;
- $$->octave_i_ += $2;
+ Musical_pitch p = *unsmob_pitch ($1);
+ p.octave_i_ += $2;
+ $$ = p.smobbed_copy ();
}
| NOTENAME_PITCH sub_quotes {
- $$ = $1;
- $$->octave_i_ += - $2;
+ Musical_pitch p =* unsmob_pitch ($1);
+
+ p.octave_i_ += -$2;
+ $$ = p.smobbed_copy ();
+
}
;
+/*
+ugh. duplication
+*/
+
steno_tonic_pitch:
TONICNAME_PITCH {
$$ = $1;
}
| TONICNAME_PITCH sup_quotes {
- $$ = $1;
- $$->octave_i_ += $2;
+ Musical_pitch p = *unsmob_pitch ($1);
+ p.octave_i_ += $2;
+ $$ = p.smobbed_copy ();
}
| TONICNAME_PITCH sub_quotes {
- $$ = $1;
- $$->octave_i_ += - $2;
+ Musical_pitch p =* unsmob_pitch ($1);
+
+ p.octave_i_ += -$2;
+ $$ = p.smobbed_copy ();
+
}
;
$$ = $1;
}
| MUSICAL_PITCH embedded_scm {
- int sz = scm_ilength ($2);
- if (sz != 3) {
- THIS->parser_error (_f ("Expecting %d arguments", 3));
- $2 = gh_list (gh_int2scm (0), gh_int2scm (0), gh_int2scm (0), SCM_UNDEFINED);
- }
- $$ = new Musical_pitch ($2);
+ if (!unsmob_pitch ($2))
+ THIS->parser_error (_f ("Expecting musical-pitch value", 3));
+ Musical_pitch m;
+ $$ = m.smobbed_copy ();
}
;
explicit_duration:
DURATION embedded_scm {
- $$ = new Duration;
- if (scm_ilength ($2) == 2)
- {
- $$-> durlog_i_ = gh_scm2int (gh_car($2));
- $$-> dots_i_ = gh_scm2int (gh_cadr($2));
- }
- else
- THIS->parser_error (_("Must have 2 arguments for duration"));
+ $$ = $2;
+ if (!unsmob_duration ($2))
+ {
+ THIS->parser_error (_("Must have duration object"));
+ $$ = Duration ().smobbed_copy ();
+ }
}
;
$$ = $1;
}
| duration_length '*' bare_unsigned {
- $$->tuplet_iso_i_ *= $3;
+ $$ = unsmob_duration ($$)->compressed ( $3) .smobbed_copy ();
}
| duration_length '/' bare_unsigned {
- $$->tuplet_type_i_ *= $3;
+ $$ = unsmob_duration ($$)->compressed (Moment (1,$3)).smobbed_copy ();
}
;
entered_notemode_duration:
steno_duration {
- THIS->set_last_duration ($1);
+ THIS->set_last_duration (unsmob_duration ($1));
}
;
optional_notemode_duration:
{
- $$ = new Duration (THIS->default_duration_);
+ $$ = THIS->default_duration_.smobbed_copy ();
}
| entered_notemode_duration {
$$ = $1;
;
steno_duration:
- bare_unsigned {
- $$ = new Duration;
+ bare_unsigned dots {
+ int l = 0;
if (!is_duration_b ($1))
THIS->parser_error (_f ("not a duration: %d", $1));
- else {
- $$->durlog_i_ = intlog2 ($1);
- }
+ else
+ l = intlog2 ($1);
+
+ $$ = Duration (l, $2).smobbed_copy ();
+ }
+ | DURATION_IDENTIFIER dots {
+ Duration *d =unsmob_duration ($1);
+ Duration k (d->duration_log (),d->dot_count () + $2);
+ $$ = k.smobbed_copy ();
}
- | DURATION_IDENTIFIER {
- $$ = $1->access_content_Duration (true);
+ ;
+
+dots:
+ /* empty */ {
+ $$ = 0;
}
- | steno_duration '.' {
- $$->dots_i_ ++;
+ | dots '.' {
+ $$ ++;
}
;
if (!THIS->lexer_p_->note_state_b ())
THIS->parser_error (_ ("Have to be in Note mode for notes"));
-
Note_req *n = new Note_req;
- n->pitch_ = *$1;
- n->duration_ = *$4;
+ n->set_mus_property ("pitch", $1);
+ n->set_mus_property ("duration", $4);
if ($3 % 2)
n->set_mus_property ("cautionary", SCM_BOOL_T);
- if ( $2 % 2 || $3 % 2)
+ if ($2 % 2 || $3 % 2)
n->set_mus_property ("force-accidental", SCM_BOOL_T);
-
Simultaneous_music*v = new Request_chord (gh_list (n->self_scm (), SCM_UNDEFINED));
- v->set_spot ($1->spot ());
- n->set_spot ($1->spot ());
- $$ = v;
+
+/*
+FIXME
+*/
+ v->set_spot (THIS->here_input ());
+ n->set_spot (THIS->here_input ());
- delete $1;
- delete $4;
+ $$ = v;
}
| RESTNAME optional_notemode_duration {
if (ly_scm2string ($1) =="s")
{ /* Space */
Skip_req * skip_p = new Skip_req;
- skip_p->duration_ = *$2;
+ skip_p->set_mus_property ("duration" ,$2);
skip_p->set_spot (THIS->here_input());
e = skip_p->self_scm ();
else
{
Rest_req * rest_req_p = new Rest_req;
- rest_req_p->duration_ = *$2;
+ rest_req_p->set_mus_property ("duration", $2);
rest_req_p->set_spot (THIS->here_input());
e = rest_req_p->self_scm ();
}
Simultaneous_music* velt_p = new Request_chord (gh_list (e,SCM_UNDEFINED));
velt_p->set_spot (THIS->here_input());
- delete $2; // ugh
+
$$ = velt_p;
}
| MEASURES optional_notemode_duration {
Skip_req * sk = new Skip_req;
- sk->duration_ = *$2;
-
-
+ sk->set_mus_property ("duration", $2);
Span_req *sp1 = new Span_req;
Span_req *sp2 = new Span_req;
sp1-> set_span_dir ( START);
THIS->pop_spot ();
Lyric_req* lreq_p = new Lyric_req;
lreq_p->set_mus_property ("text", $1);
- lreq_p->duration_ = *$3;
+ lreq_p->set_mus_property ("duration",$3);
lreq_p->set_spot (THIS->here_input());
Simultaneous_music* velt_p = new Request_chord (gh_list (lreq_p->self_scm (), SCM_UNDEFINED));
- delete $3; // ugh
+
$$= velt_p;
}
chord:
steno_tonic_pitch optional_notemode_duration chord_additions chord_subtractions chord_inversion chord_bass {
- $$ = get_chord (*$1, $3, $4, $5, $6, *$2);
+ $$ = get_chord ($1, $3, $4, $5, $6, $2);
$$->set_spot (THIS->here_input ());
};
chord_additions:
{
- $$ = new Array<Musical_pitch>;
+ $$ = SCM_EOL;
}
| CHORD_COLON chord_notes {
$$ = $2;
$$ = $1
}
| chord_notes '.' chord_step {
- $$ = $1;
- $$->concat (*$3);
+ $$ = gh_append2 ($$, $3);
}
;
chord_subtractions:
{
- $$ = new Array<Musical_pitch>;
+ $$ = SCM_EOL;
}
| CHORD_CARET chord_notes {
$$ = $2;
chord_inversion:
{
- $$ = 0;
+ $$ = SCM_EOL;
}
| '/' steno_tonic_pitch {
$$ = $2;
- $$->set_spot (THIS->here_input ());
}
;
chord_bass:
{
- $$ = 0;
+ $$ = SCM_EOL;
}
| CHORD_BASS steno_tonic_pitch {
$$ = $2;
- $$->set_spot (THIS->here_input ());
}
;
chord_step:
chord_note {
- $$ = new Array<Musical_pitch>;
- $$->push (*$1);
+ $$ = gh_cons ($1, SCM_EOL);
}
| CHORDMODIFIER_PITCH {
- $$ = new Array<Musical_pitch>;
- $$->push (*$1);
+ $$ = gh_cons ($1, SCM_EOL);
}
| CHORDMODIFIER_PITCH chord_note { /* Ugh. */
- $$ = new Array<Musical_pitch>;
- $$->push (*$1);
- $$->push (*$2);
+ $$ = gh_list ($1, $2, SCM_UNDEFINED);
}
;
chord_note:
bare_unsigned {
- $$ = new Musical_pitch;
- $$->notename_i_ = ($1 - 1) % 7;
- $$->octave_i_ = $1 > 7 ? 1 : 0;
- $$->accidental_i_ = 0;
+ Musical_pitch m;
+ m.notename_i_ = ($1 - 1) % 7;
+ m.octave_i_ = $1 > 7 ? 1 : 0;
+ m.alteration_i_ = 0;
+
+ $$ = m.smobbed_copy ();
}
| bare_unsigned '+' {
- $$ = new Musical_pitch;
- $$->notename_i_ = ($1 - 1) % 7;
- $$->octave_i_ = $1 > 7 ? 1 : 0;
- $$->accidental_i_ = 1;
+ Musical_pitch m;
+ m.notename_i_ = ($1 - 1) % 7;
+ m.octave_i_ = $1 > 7 ? 1 : 0;
+ m.alteration_i_ = 1;
+
+
+ $$ = m.smobbed_copy ();
}
| bare_unsigned CHORD_MINUS {
- $$ = new Musical_pitch;
- $$->notename_i_ = ($1 - 1) % 7;
- $$->octave_i_ = $1 > 7 ? 1 : 0;
- $$->accidental_i_ = -1;
+ Musical_pitch m;
+ m.notename_i_ = ($1 - 1) % 7;
+ m.octave_i_ = $1 > 7 ? 1 : 0;
+ m.alteration_i_ = -1;
+
+ $$ = m.smobbed_copy ();
}
;
#include "music-sequence.hh"
#include "warn.hh"
+
+/*
+ DOCUMENTME
+ */
+int
+compare (Array<Duration> const * left, Array<Duration> const * right)
+{
+ assert (left);
+ assert (right);
+
+ if (left->size () == right->size ())
+ {
+ for (int i = 0; i < left->size (); i++)
+ {
+ int r = Duration::compare ((*left)[i], (*right)[i]);
+ if (r)
+ return r;
+ }
+ }
+ else
+ return 1;
+ return 0;
+}
+
Part_combine_music_iterator::Part_combine_music_iterator ()
{
first_iter_p_ = 0;
{
Music *m = unsmob_music (gh_car (i));
if (Melodic_req *r = dynamic_cast<Melodic_req *> (m))
- pitches->push (r->pitch_);
+ pitches->push (*unsmob_pitch (r->get_mus_property("pitch")));
if (Rhythmic_req *r = dynamic_cast<Rhythmic_req *> (m))
- durations->push (r->duration_);
+ durations->push (*unsmob_duration (r->get_mus_property("duration")));
}
}
}
s = gh_append2 (second_iter_p_->get_music (m),s);
return s;
}
+
+IMPLEMENT_CTOR_CALLBACK(Part_combine_music_iterator);
*/
#include "part-combine-music.hh"
+#include "part-combine-music-iterator.hh"
#include "musical-pitch.hh"
Part_combine_music::Part_combine_music (SCM what, Music * f, Music * s)
scm_unprotect_object (f->self_scm());
scm_unprotect_object (s->self_scm());
- set_mus_property ("type", ly_symbol2scm ("part-combined-music"));
+ set_mus_property ("type",
+ Part_combine_music_iterator::constructor_cxx_function);
}
void
Simple_music_iterator::process (m);
}
+
+IMPLEMENT_CTOR_CALLBACK(Pop_property_iterator);
+IMPLEMENT_CTOR_CALLBACK(Push_property_iterator);
+IMPLEMENT_CTOR_CALLBACK(Property_iterator);
set_mus_property ("body", beg->self_scm ());
scm_unprotect_object (beg->self_scm ());
}
- fold_b_ = false;
- repeats_i_ = times;
- volta_fold_b_ = true;
+ set_mus_property ("repeat-count", gh_int2scm (times));
+
if (alts)
{
alts->truncate (times);
Repeated_music::Repeated_music (Repeated_music const &s)
: Music (s)
{
- repeats_i_ = s.repeats_i_;
- fold_b_ = s.fold_b_;
- volta_fold_b_ = s.volta_fold_b_;
- type_ = s.type_;
}
}
Moment
-Repeated_music::alternatives_length_mom () const
+Repeated_music::alternatives_length_mom (bool fold) const
{
if (!alternatives () )
return 0;
- if (fold_b_)
+ if (fold)
return alternatives ()->maximum_length ();
Moment m =0;
int done =0;
SCM p = alternatives ()->music_list ();
- while (gh_pair_p (p) && done < repeats_i_)
+ while (gh_pair_p (p) && done < repeat_count ())
{
m = m + unsmob_music (gh_car (p))->length_mom ();
done ++;
- if (volta_fold_b_
- || repeats_i_ - done < alternatives ()->length_i ())
- p = gh_cdr (p);
+ if (repeat_count () - done < alternatives ()->length_i ())
+ p = gh_cdr (p);
}
return m;
}
if (body ())
{
m = body ()->length_mom ();
- if (!fold_b_ && !volta_fold_b_)
- m *= Rational (repeats_i_);
}
return m;
}
-Moment
-Repeated_music::length_mom () const
+int
+Repeated_music::repeat_count () const
{
- return body_length_mom () + alternatives_length_mom ();
+ return gh_scm2int (get_mus_property ("repeat-count"));
}
+
+MAKE_SCHEME_CALLBACK(Repeated_music,unfolded_music_length, 1);
+MAKE_SCHEME_CALLBACK(Repeated_music,folded_music_length, 1);
+MAKE_SCHEME_CALLBACK(Repeated_music,volta_music_length, 1);
+
+SCM
+Repeated_music::unfolded_music_length (SCM m)
+{
+ Repeated_music* r = dynamic_cast<Repeated_music*> (unsmob_music (m));
+
+ Moment l = Moment (r->repeat_count ()) * r->body_length_mom () + r->alternatives_length_mom (false);
+ return l.smobbed_copy ();
+}
+
+SCM
+Repeated_music::folded_music_length (SCM m)
+{
+ Repeated_music* r = dynamic_cast<Repeated_music*> (unsmob_music (m));
+
+ Moment l = r->body_length_mom () + r->alternatives_length_mom (true);
+ return l.smobbed_copy ();
+}
+
+SCM
+Repeated_music::volta_music_length (SCM m)
+{
+ Repeated_music* r = dynamic_cast<Repeated_music*> (unsmob_music (m));
+ Moment l = r->body_length_mom () + r->alternatives_length_mom (false);
+ return l.smobbed_copy ();
+}
}
skip (m);
}
+
+IMPLEMENT_CTOR_CALLBACK(Request_chord_iterator);
*/
Link_array<Score_element> rests;
Link_array<Score_element> notes;
-
+ Score_element * commony = 0;
for (SCM s = elts; gh_pair_p (s); s = gh_cdr (s))
{
+
Score_element * e = unsmob_element (gh_car (s));
- if (e && unsmob_element (e->get_elt_property ("rest")))
+ if (!e)
+ continue;
+
+ if (!commony)
+ commony = e;
+ else
+ commony= commony->common_refpoint (e, Y_AXIS);
+
+ if (unsmob_element (e->get_elt_property ("rest")))
rests.push (e);
else
notes.push (e);
// try to be opposite of noteheads.
Direction dir = - Note_column::dir (notes[0]);
- Interval restdim = Note_column::rest_dim (rcol);
+ Score_element * r = unsmob_element (rcol->get_elt_property ("rest"));
+ Interval restdim = r->extent (r, Y_AXIS); // ??
+
if (restdim.empty_b ())
return SCM_UNSPECIFIED;
- // staff ref'd?
+ // FIXME: staff ref'd?
Real staff_space = 1.0;
- /* FIXME
- staff_space = rcol->rests[0]->staff_space ();
- */
Real minimum_dist = gh_scm2double (me->get_elt_property ("minimum-distance")) * staff_space;
/*
Interval notedim;
for (int i = 0; i < notes.size(); i++)
{
- notedim.unite (notes[i]->extent (notes[i],Y_AXIS)); // refp?
+ Score_element * stem = Note_column::stem_l (notes[i]);
+ Score_element * head = Stem::first_head (stem);
+ notedim.unite (head->extent (commony, Y_AXIS));
}
Interval inter (notedim);
Staff_symbol_referencer::set_interface (rest_p_);
+ int durlog = unsmob_duration (rest_req_l_->get_mus_property ("duration"))-> duration_log ();
+
rest_p_->set_elt_property ("duration-log",
- gh_int2scm (rest_req_l_->duration_.durlog_i_));
+ gh_int2scm (durlog));
+
+ int dots =unsmob_duration (rest_req_l_->get_mus_property ("duration"))->dot_count ();
- if (rest_req_l_->duration_.dots_i_)
+ if (dots)
{
dot_p_ = new Item (get_property ("Dots"));
Rhythmic_head::set_dots (rest_p_, dot_p_);
dot_p_->set_parent (rest_p_, Y_AXIS);
- dot_p_->set_elt_property ("dot-count",
- gh_int2scm (rest_req_l_->duration_.dots_i_));
+ dot_p_->set_elt_property ("dot-count", gh_int2scm (dots));
announce_element (dot_p_,0);
}
set_columns (new Paper_column (get_property (ly_symbol2scm ("NonMusicalPaperColumn"))),
new Paper_column (get_property (ly_symbol2scm ("PaperColumn"))));
- command_column_l_->set_elt_property ("when", w.make_scm());
- musical_column_l_->set_elt_property ("when", w.make_scm());
+ command_column_l_->set_elt_property ("when", w.smobbed_copy());
+ musical_column_l_->set_elt_property ("when", w.smobbed_copy());
command_column_l_->set_elt_property ("breakable", SCM_BOOL_T);
Score_element_info i1(command_column_l_, 0), i2 (musical_column_l_,0);
{
return iter_p_ ? iter_p_->try_music (m) : 0;
}
+IMPLEMENT_CTOR_CALLBACK(Sequential_music_iterator);
skip (m);
}
+
+IMPLEMENT_CTOR_CALLBACK(Simple_music_iterator);
}
+
+IMPLEMENT_CTOR_CALLBACK(Simultaneous_music_iterator);
Paper_column * sc
= dynamic_cast<Paper_column*> (unsmob_element (get_property ("currentMusicalColumn")));
- SCM sh = shortest_playing.make_scm( );
- SCM st = starter.make_scm();
+ SCM sh = shortest_playing.smobbed_copy( );
+ SCM st = starter.smobbed_copy();
sc->set_elt_property ("shortest-playing-duration", sh);
sc->set_elt_property ("shortest-starter-duration", st);
if (Rhythmic_head::stem_l (h))
return;
- Rhythmic_req * r = dynamic_cast <Rhythmic_req *> (i.req_l_);
- int duration_log = r->duration_.durlog_i_;
+ int duration_log = unsmob_duration (i.req_l_->get_mus_property ("duration"))-> duration_log ();
+
if (!stem_p_)
{
stem_p_ = new Item (get_property ("Stem"));
gh_int2scm (tremolo_flags));
}
}
- announce_element (stem_p_, r);
+ announce_element (stem_p_, i.req_l_);
}
if (Stem::flag_i (stem_p_) != duration_log)
{
- r->origin ()->warning (_f ("Adding note head to incompatible stem (type = %d)", 1 << Stem::flag_i (stem_p_)));
+ i.req_l_->origin ()->warning (_f ("Adding note head to incompatible stem (type = %d)", 1 << Stem::flag_i (stem_p_)));
}
Stem::add_head (stem_p_,h);
MAKE_SCHEME_CALLBACK(Stem,dim_callback,2);
SCM
-Stem::dim_callback (SCM e, SCM )
+Stem::dim_callback (SCM e, SCM ax)
{
- Score_element *se = unsmob_element (e);
+ Axis a = (Axis) gh_scm2int (ax);
+ assert (a == X_AXIS);
+ Score_element *se = unsmob_element (e);
Interval r (0, 0);
if (unsmob_element (se->get_elt_property ("beam")) || abs (flag_i (se)) <= 2)
; // TODO!
while (i >= 0 && j >=0)
{
int comp
- = Musical_pitch::compare (now_heads_[i].req_l_->pitch_ ,
- stopped_heads_[j].req_l_->pitch_);
+ = Musical_pitch::compare (*unsmob_pitch (now_heads_[i].req_l_->get_mus_property ("pitch") ),
+ *unsmob_pitch (stopped_heads_[j].req_l_->get_mus_property ("pitch")));
if (comp)
{
CHead_melodic_tuple::pitch_compare (CHead_melodic_tuple const&h1,
CHead_melodic_tuple const &h2)
{
- return Melodic_req::compare (*h1.req_l_, *h2.req_l_);
+ SCM p1 = h1.req_l_->get_mus_property ("pitch");
+ SCM p2 = h2.req_l_->get_mus_property ("pitch");
+
+ return Musical_pitch::equal_p (p1,p2) == SCM_BOOL_T;
}
int
while ( i < now_notes_.size () && j < stopped_notes_.size ())
{
int comp
- = Musical_pitch::compare (now_notes_[i].req_l_->pitch_ ,
- stopped_notes_[j].req_l_->pitch_);
+ = Musical_pitch::compare (*unsmob_pitch (now_notes_[i].req_l_->get_mus_property ("pitch") ),
+ *unsmob_pitch (stopped_notes_[j].req_l_->get_mus_property ("pitch")));
if (comp)
{
CNote_melodic_tuple::pitch_compare (CNote_melodic_tuple const&h1,
CNote_melodic_tuple const &h2)
{
- return Melodic_req::compare (*h1.req_l_, *h2.req_l_);
+ SCM p1 = h1.req_l_->get_mus_property ("pitch");
+ SCM p2 = h2.req_l_->get_mus_property ("pitch");
+ return Musical_pitch::compare (*unsmob_pitch (p1),
+ *unsmob_pitch (p2));
}
int
Music_wrapper_iterator::process (m);
}
+
+IMPLEMENT_CTOR_CALLBACK(Time_scaled_music_iterator);
*/
#include "time-scaled-music.hh"
-
+#include "time-scaled-music-iterator.hh"
Time_scaled_music::Time_scaled_music (int n, int d,Music *mp)
: Music_wrapper (mp)
num_i_ = n;
den_i_ = d;
compress (Moment (num_i_,den_i_));
- set_mus_property ("type", ly_symbol2scm ("time-scaled-music"));
+ set_mus_property ("type",
+ Time_scaled_music_iterator::constructor_cxx_function);
}
(c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
-#include "time-signature-performer.hh"
-#include "command-request.hh"
#include "audio-item.hh"
+#include "lily-proto.hh"
+#include "performer.hh"
+
+
+class Time_signature_performer : public Performer
+{
+public:
+ VIRTUAL_COPY_CONS(Translator);
+
+ Time_signature_performer();
+ ~Time_signature_performer();
+
+protected:
+
+ virtual void do_process_music();
+ virtual void do_pre_move_processing ();
+
+ SCM prev_fraction_;
+private:
+ Time_signature_change_req* time_signature_req_l_;
+ Audio_time_signature* audio_p_;
+};
-ADD_THIS_TRANSLATOR (Time_signature_performer);
Time_signature_performer::Time_signature_performer ()
{
- time_signature_req_l_ = 0;
+ prev_fraction_ = SCM_BOOL_F;
audio_p_ = 0;
}
void
Time_signature_performer::do_process_music ()
{
- if (time_signature_req_l_)
+ SCM fr = get_property ("timeSignatureFraction");
+ if (gh_pair_p (fr)
+ && scm_equal_p (fr, prev_fraction_) != SCM_BOOL_T)
{
- int b = gh_scm2int (time_signature_req_l_->get_mus_property ("beats"));
- int o = gh_scm2int (time_signature_req_l_->get_mus_property ("one-beat"));
+ int b = gh_scm2int (gh_car (fr));
+ int o = gh_scm2int (gh_cdr (fr));
audio_p_ = new Audio_time_signature (b,o);
- Audio_element_info info (audio_p_, time_signature_req_l_);
+ Audio_element_info info (audio_p_, 0);
announce_element (info);
time_signature_req_l_ = 0;
}
audio_p_ = 0;
}
}
-
-bool
-Time_signature_performer::do_try_music (Music* req_l)
-{
- if (time_signature_req_l_)
- return false;
-
- if (Time_signature_change_req *t =
- dynamic_cast <Time_signature_change_req *> (req_l))
- {
- time_signature_req_l_ = t;
- return true;
- }
-
- return false;
-}
+ADD_THIS_TRANSLATOR (Time_signature_performer);
*/
class Timing_engraver : public Timing_translator, public Engraver
{
- Bar_req * bar_req_l_;
protected:
- virtual bool do_try_music (Music * );
virtual void do_post_move_processing ();
- virtual void do_process_music ();
virtual void do_pre_move_processing ();
public:
VIRTUAL_COPY_CONS(Translator);
void
Timing_engraver::do_post_move_processing( )
{
- bar_req_l_ = 0;
Timing_translator::do_post_move_processing ();
SCM nonauto = get_property ("barNonAuto");
daddy_trans_l_->set_property ("whichBar", SCM_EOL);
}
-bool
-Timing_engraver::do_try_music (Music*m)
-{
- if (0) //
- {
- Bar_req * b= dynamic_cast <Bar_req *> (m);
- if (bar_req_l_ && !bar_req_l_->equal_b (b))
- return false;
-
- bar_req_l_ = b;
- return true;
- }
-
- return Timing_translator::do_try_music (m);
-}
-void
-Timing_engraver::do_process_music ()
-{
-}
+
bool
Timing_translator::do_try_music (Music*r)
{
- if (Timing_req *t = dynamic_cast <Timing_req *> (r))
+ if (dynamic_cast<Barcheck_req*> (r))
{
- for (int i=0; i < timing_req_l_arr_.size (); i++)
- {
- /*
- merge timing reqs.
- */
- if (timing_req_l_arr_[i]->equal_b(t))
- return true;
- if (String (classname (timing_req_l_arr_[i])) == classname (r))
- {
- r->origin ()->warning (_ ("conflicting timing request"));
- timing_req_l_arr_[i]->origin ()->warning (_("This is the other timing request"));
- return false;
- }
- }
-
- /*
- We have to do this soon enough. Maybe we'd better disguise
- \time as a \property. Then all settings will be `immediate'.
- */
- if (Time_signature_change_req *c
- = dynamic_cast <Time_signature_change_req *> (t))
- {
- int b = gh_scm2int (c->get_mus_property ("beats"));
- int o = gh_scm2int (c->get_mus_property ("one-beat"));
-
- set_time_signature (b, o);
-
- }
- timing_req_l_arr_.push(t);
+ check_ = r;
return true;
}
return false;
void
Timing_translator::do_process_music()
{
- for (int i=0; i < timing_req_l_arr_.size (); i++)
+ if (check_ && measure_position ())
{
- if (!dynamic_cast <Barcheck_req *> (timing_req_l_arr_[i]))
- continue;
- if (measure_position ())
- {
- timing_req_l_arr_[i]->origin ()->warning (_f ("barcheck failed at: %s",
- measure_position ().str ()));
- Moment zero;
-
- // resync
- daddy_trans_l_->set_property("measurePosition", zero.make_scm ());
- }
+ check_->origin ()->warning (_f ("barcheck failed at: %s",
+ measure_position ().str ()));
+ Moment zero;
+
+ if (!to_boolean (get_property ("barCheckNoSynchronize")))
+ daddy_trans_l_->set_property("measurePosition", zero.smobbed_copy ());
+ }
+
+ SCM fr = get_property ("timeSignatureFraction");
+
+ if (scm_equal_p (fr, last_time_sig_) == SCM_BOOL_F)
+ {
+ last_time_sig_ = fr;
+ set_time_signature ();
}
}
+
void
Timing_translator::do_pre_move_processing()
{
- timing_req_l_arr_.set_size (0);
+ check_ = 0;
+
Translator *t = this;
Global_translator *global_l =0;
do
Moment m;
daddy_trans_l_->set_property ("timing" , SCM_BOOL_T);
daddy_trans_l_->set_property ("currentBarNumber" , gh_int2scm (1));
- daddy_trans_l_->set_property ("measurePosition", m.make_scm ());
- daddy_trans_l_->set_property ("beatLength", Moment (1,4).make_scm ());
- daddy_trans_l_->set_property ("measureLength", Moment (1).make_scm());
+ daddy_trans_l_->set_property ("measurePosition", m.smobbed_copy ());
daddy_trans_l_->set_property ("timeSignatureFraction",
gh_cons (gh_int2scm (4), gh_int2scm (4)));
+
+ set_time_signature ();
}
Moment
void
-Timing_translator::set_time_signature (int l, int o)
+Timing_translator::set_time_signature ()
{
+ SCM fr = get_property ("timeSignatureFraction");
+ int l = gh_scm2int (gh_car (fr));
+ int o = gh_scm2int (gh_cdr (fr));
+
Moment one_beat = Moment (1)/Moment (o);
Moment len = Moment (l) * one_beat;
- daddy_trans_l_->set_property ("measureLength", len.make_scm ());
- daddy_trans_l_->set_property ("beatLength", one_beat.make_scm ());
- daddy_trans_l_->set_property ("timeSignatureFraction",
- gh_cons (gh_int2scm (l), gh_int2scm (o)));
+
+ daddy_trans_l_->set_property ("measureLength", len.smobbed_copy ());
+ daddy_trans_l_->set_property ("beatLength", one_beat.smobbed_copy ());
}
Timing_translator::Timing_translator()
{
+
+ last_time_sig_ = SCM_BOOL_F;
+
}
void
Timing_translator::do_post_move_processing()
{
+ check_ =00;
Translator *t = this;
Global_translator *global_l =0;
do
}
else
{
- daddy_trans_l_->set_property ("measurePosition", measposp.make_scm());
+ daddy_trans_l_->set_property ("measurePosition", measposp.smobbed_copy());
}
measposp += dt;
}
daddy_trans_l_->set_property ("currentBarNumber", gh_int2scm (b));
- daddy_trans_l_->set_property ("measurePosition", measposp.make_scm());
+ daddy_trans_l_->set_property ("measurePosition", measposp.smobbed_copy());
}
{
done_count_ =0;
current_iter_p_ =0;
+ volta_b_ = false;
do_main_b_ = false;
alternative_count_i_ =0;
}
delete current_iter_p_;
current_iter_p_ =0;
- bool do_repcommands = side_effect && repmus->volta_fold_b_;
+ bool do_repcommands = side_effect && volta_b_;
if (do_main_b_)
{
here_mom_ += repmus->body ()->length_mom ();
- if (!repmus->volta_fold_b_)
+ if (!volta_b_)
done_count_ ++;
if (gh_pair_p (alternative_cons_))
current_iter_p_ = get_iterator_p (unsmob_music (gh_car (alternative_cons_)));
do_main_b_ = false;
- if (repmus->volta_fold_b_)
+ if (volta_b_)
{
String repstr = to_str (done_count_ + 1);
if (do_repcommands)
ly_str02scm (repstr.ch_C()), SCM_UNDEFINED));
}
}
- else if (repmus->volta_fold_b_)
+ else if (volta_b_)
{
add_repeat_command (ly_symbol2scm ("end-repeat"));
}
- else if (done_count_ < repmus->repeats_i_)
+ else if (done_count_ < repmus->repeat_count ())
{
current_iter_p_ = get_iterator_p (repmus->body ());
do_main_b_ = true;
{
here_mom_ += unsmob_music (gh_car (alternative_cons_))->length_mom ();
- if (repmus->volta_fold_b_ ||
- repmus->repeats_i_ - done_count_ < alternative_count_i_)
+ if (volta_b_ ||
+ repmus->repeat_count () - done_count_ < alternative_count_i_)
alternative_cons_ = gh_cdr (alternative_cons_);
if (do_repcommands)
/*
we've done the main body as well, but didn't go over the other
increment. */
- if (repmus->volta_fold_b_)
+ if (volta_b_)
done_count_ ++;
}
if we're full unfold: go back to main body.
*/
- if (done_count_ < repmus->repeats_i_ && gh_pair_p (alternative_cons_))
+ if (done_count_ < repmus->repeat_count () && gh_pair_p (alternative_cons_))
{
if (do_repcommands)
{
}
- if (repmus->volta_fold_b_)
+ if (volta_b_)
current_iter_p_ = get_iterator_p (unsmob_music (gh_car (alternative_cons_)));
else
{
{
if (!m)
{
- if (dynamic_cast<Repeated_music*> (music_l_)->volta_fold_b_)
+ if (volta_b_)
add_repeat_command (ly_symbol2scm ("start-repeat"));
}
while (1)
{
return current_iter_p_->try_music (m);
}
+
+IMPLEMENT_CTOR_CALLBACK(Unfolded_repeat_iterator);
+IMPLEMENT_CTOR_CALLBACK(Volta_repeat_iterator);
+
+Volta_repeat_iterator::Volta_repeat_iterator ()
+{
+ volta_b_ = true;
+}
;; variable instead of quering the user.
(defvar LilyPond-command-force nil)
+(defvar LilyPond-xdvi-command "xdvik")
;; This is the major configuration variable.
(defcustom LilyPond-command-alist
("SmartView" . ("xdvi %d" . "LilyPond"))
;; refreshes when kicked USR1
- ("View" . ("xdvik %d" . "LilyPond"))
+ ("View" . ((concat LilyPond-xdvi-command " %d") . "LilyPond"))
)
"AList of commands to execute on the current document.
% For using "sostingut" notation, which is also correct
\notenames #'(
- (dobb . ( -1 0 -2 ))
- (dob . ( -1 0 -1 ))
- (do . ( -1 0 0 ))
- (dod . ( -1 0 1 ))
- (dodd . ( -1 0 2 ))
- (rebb . ( -1 1 -2 ))
- (reb . ( -1 1 -1 ))
- (re . ( -1 1 0 ))
- (red . ( -1 1 1 ))
- (redd . ( -1 1 2 ))
- (mibb . ( -1 2 -2 ))
- (mib . ( -1 2 -1 ))
- (mi . ( -1 2 0 ))
- (mid . ( -1 2 1 ))
- (midd . ( -1 2 2 ))
- (fabb . ( -1 3 -2 ))
- (fab . ( -1 3 -1 ))
- (fa . ( -1 3 0 ))
- (fad . ( -1 3 1 ))
- (fadd . ( -1 3 2 ))
- (solbb . ( -1 4 -2 ))
- (solb . ( -1 4 -1 ))
- (sol . ( -1 4 0 ))
- (sold . ( -1 4 1 ))
- (soldd . ( -1 4 2 ))
- (labb . ( -1 5 -2 ))
- (lab . ( -1 5 -1 ))
- (la . ( -1 5 0 ))
- (lad . ( -1 5 1 ))
- (ladd . ( -1 5 2 ))
- (sibb . ( -1 6 -2 ))
- (sib . ( -1 6 -1 ))
- (si . ( -1 6 0 ))
- (sid . ( -1 6 1 ))
- (sidd . ( -1 6 2 ))
- (dos . ( -1 0 1 ))
- (doss . ( -1 0 2 ))
- (res . ( -1 1 1 ))
- (ress . ( -1 1 2 ))
- (mis . ( -1 2 1 ))
- (miss . ( -1 2 2 ))
- (fas . ( -1 3 1 ))
- (fass . ( -1 3 2 ))
- (sols . ( -1 4 1 ))
- (solss . ( -1 4 2 ))
- (las . ( -1 5 1 ))
- (lass . ( -1 5 2 ))
- (sis . ( -1 6 1 ))
- (siss . ( -1 6 2 ))
+ (dobb . ,(make-pitch -1 0 -2 ))
+ (dob . ,(make-pitch -1 0 -1 ))
+ (do . ,(make-pitch -1 0 0 ))
+ (dod . ,(make-pitch -1 0 1 ))
+ (dodd . ,(make-pitch -1 0 2 ))
+ (rebb . ,(make-pitch -1 1 -2 ))
+ (reb . ,(make-pitch -1 1 -1 ))
+ (re . ,(make-pitch -1 1 0 ))
+ (red . ,(make-pitch -1 1 1 ))
+ (redd . ,(make-pitch -1 1 2 ))
+ (mibb . ,(make-pitch -1 2 -2 ))
+ (mib . ,(make-pitch -1 2 -1 ))
+ (mi . ,(make-pitch -1 2 0 ))
+ (mid . ,(make-pitch -1 2 1 ))
+ (midd . ,(make-pitch -1 2 2 ))
+ (fabb . ,(make-pitch -1 3 -2 ))
+ (fab . ,(make-pitch -1 3 -1 ))
+ (fa . ,(make-pitch -1 3 0 ))
+ (fad . ,(make-pitch -1 3 1 ))
+ (fadd . ,(make-pitch -1 3 2 ))
+ (solbb . ,(make-pitch -1 4 -2 ))
+ (solb . ,(make-pitch -1 4 -1 ))
+ (sol . ,(make-pitch -1 4 0 ))
+ (sold . ,(make-pitch -1 4 1 ))
+ (soldd . ,(make-pitch -1 4 2 ))
+ (labb . ,(make-pitch -1 5 -2 ))
+ (lab . ,(make-pitch -1 5 -1 ))
+ (la . ,(make-pitch -1 5 0 ))
+ (lad . ,(make-pitch -1 5 1 ))
+ (ladd . ,(make-pitch -1 5 2 ))
+ (sibb . ,(make-pitch -1 6 -2 ))
+ (sib . ,(make-pitch -1 6 -1 ))
+ (si . ,(make-pitch -1 6 0 ))
+ (sid . ,(make-pitch -1 6 1 ))
+ (sidd . ,(make-pitch -1 6 2 ))
+ (dos . ,(make-pitch -1 0 1 ))
+ (doss . ,(make-pitch -1 0 2 ))
+ (res . ,(make-pitch -1 1 1 ))
+ (ress . ,(make-pitch -1 1 2 ))
+ (mis . ,(make-pitch -1 2 1 ))
+ (miss . ,(make-pitch -1 2 2 ))
+ (fas . ,(make-pitch -1 3 1 ))
+ (fass . ,(make-pitch -1 3 2 ))
+ (sols . ,(make-pitch -1 4 1 ))
+ (solss . ,(make-pitch -1 4 2 ))
+ (las . ,(make-pitch -1 5 1 ))
+ (lass . ,(make-pitch -1 5 2 ))
+ (sis . ,(make-pitch -1 6 1 ))
+ (siss . ,(make-pitch -1 6 2 ))
)
% urg!
%
-\chordmodifiers #'(
- (m . ( 0 2 -1 ))
- (min . ( 0 2 -1 ))
- (aug . ( 0 4 1 ))
-; (dim . ( -100 4 -1 ))
- (dim . ( -100 2 -1 ))
+\chordmodifiers #`(
+ (m . ,(make-pitch 0 2 -1 ))
+ (min . ,(make-pitch 0 2 -1 ))
+ (aug . ,(make-pitch 0 4 1 ))
+; (dim . ,(make-pitch -100 4 -1 ))
+ (dim . ,(make-pitch -100 2 -1 ))
; urg, not actually a chord-modifier, but it works
; c7 -> <c bes>, c 7+ -> c b
- (maj . ( 0 6 1 ))
+ (maj . ,(make-pitch 0 6 1 ))
; sus4 should delete 2 too...
- (sus . ( 0 3 0 ))
+ (sus . ,(make-pitch 0 3 0 ))
)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UGH UGH UGH UGHUGH FIXME
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -> duplication!
-breve = \duration #'( -1 0)
-longa = \duration #'( -2 0 )
-maxima = \duration #'( -3 0 )
+breve = \duration #(make-duration -1 0)
+longa = \duration #'(make-duration -2 0 )
+maxima = \duration #'(make-duration -3 0 )
+
#(begin
(eval-string (ly-gulp-file "slur.scm"))
-breve = \duration #'( -1 0)
-longa = \duration #'( -2 0 )
-maxima = \duration #'( -3 0 )
+breve = \duration #(make-duration -1 0)
+longa = \duration #(make-duration -2 0 )
+maxima = \duration #(make-duration -3 0)
\include "nederlands.ly" % dutch
\include "chord-modifiers.ly"
\notenames #'(
- (ceses . ( -1 0 -2 ))
- (ces . ( -1 0 -1 ))
- (c . ( -1 0 0 ))
- (cis . ( -1 0 1 ))
- (cisis . ( -1 0 2 ))
- (deses . ( -1 1 -2 ))
- (des . ( -1 1 -1 ))
- (d . ( -1 1 0 ))
- (dis . ( -1 1 1 ))
- (disis . ( -1 1 2 ))
- (eses . ( -1 2 -2 ))
- (es . ( -1 2 -1 ))
- (e . ( -1 2 0 ))
- (eis . ( -1 2 1 ))
- (eisis . ( -1 2 2 ))
- (feses . ( -1 3 -2 ))
- (fes . ( -1 3 -1 ))
- (f . ( -1 3 0 ))
- (fis . ( -1 3 1 ))
- (fisis . ( -1 3 2 ))
- (geses . ( -1 4 -2 ))
- (ges . ( -1 4 -1 ))
- (g . ( -1 4 0 ))
- (gis . ( -1 4 1 ))
- (gisis . ( -1 4 2 ))
- (asas . ( -1 5 -2 ))
- (ases . ( -1 5 -2 )) ; non-standard name for asas
- (as . ( -1 5 -1 ))
- (a . ( -1 5 0 ))
- (ais . ( -1 5 1 ))
- (aisis . ( -1 5 2 ))
- (heses . ( -1 6 -2 ))
- (b . ( -1 6 -1 ))
- (h . ( -1 6 0 ))
- (his . ( -1 6 1 ))
- (hisis . ( -1 6 2 ))
+ (ceses . ,(make-pitch -1 0 -2 ))
+ (ces . ,(make-pitch -1 0 -1 ))
+ (c . ,(make-pitch -1 0 0 ))
+ (cis . ,(make-pitch -1 0 1 ))
+ (cisis . ,(make-pitch -1 0 2 ))
+ (deses . ,(make-pitch -1 1 -2 ))
+ (des . ,(make-pitch -1 1 -1 ))
+ (d . ,(make-pitch -1 1 0 ))
+ (dis . ,(make-pitch -1 1 1 ))
+ (disis . ,(make-pitch -1 1 2 ))
+ (eses . ,(make-pitch -1 2 -2 ))
+ (es . ,(make-pitch -1 2 -1 ))
+ (e . ,(make-pitch -1 2 0 ))
+ (eis . ,(make-pitch -1 2 1 ))
+ (eisis . ,(make-pitch -1 2 2 ))
+ (feses . ,(make-pitch -1 3 -2 ))
+ (fes . ,(make-pitch -1 3 -1 ))
+ (f . ,(make-pitch -1 3 0 ))
+ (fis . ,(make-pitch -1 3 1 ))
+ (fisis . ,(make-pitch -1 3 2 ))
+ (geses . ,(make-pitch -1 4 -2 ))
+ (ges . ,(make-pitch -1 4 -1 ))
+ (g . ,(make-pitch -1 4 0 ))
+ (gis . ,(make-pitch -1 4 1 ))
+ (gisis . ,(make-pitch -1 4 2 ))
+ (asas . ,(make-pitch -1 5 -2 ))
+ (ases . ,(make-pitch -1 5 -2 )) ; non-standard name for asas
+ (as . ,(make-pitch -1 5 -1 ))
+ (a . ,(make-pitch -1 5 0 ))
+ (ais . ,(make-pitch -1 5 1 ))
+ (aisis . ,(make-pitch -1 5 2 ))
+ (heses . ,(make-pitch -1 6 -2 ))
+ (b . ,(make-pitch -1 6 -1 ))
+ (h . ,(make-pitch -1 6 0 ))
+ (his . ,(make-pitch -1 6 1 ))
+ (hisis . ,(make-pitch -1 6 2 ))
)
with s for sharp and f for flat.
%}
-\notenames #'(
- (cflatflat . ( -1 0 -2 ))
- (cflat . ( -1 0 -1 ))
- (c . ( -1 0 0 ))
- (csharp . ( -1 0 1 ))
- (csharpsharp . ( -1 0 2 ))
- (dflatflat . ( -1 1 -2 ))
- (dflat . ( -1 1 -1 ))
- (d . ( -1 1 0 ))
- (dsharp . ( -1 1 1 ))
- (dsharpsharp . ( -1 1 2 ))
- (eflatflat . ( -1 2 -2 ))
- (eflat . ( -1 2 -1 ))
- (e . ( -1 2 0 ))
- (esharp . ( -1 2 1 ))
- (esharpsharp . ( -1 2 2 ))
- (fflatflat . ( -1 3 -2 ))
- (fflat . ( -1 3 -1 ))
- (f . ( -1 3 0 ))
- (fsharp . ( -1 3 1 ))
- (fsharpsharp . ( -1 3 2 ))
- (gflatflat . ( -1 4 -2 ))
- (gflat . ( -1 4 -1 ))
- (g . ( -1 4 0 ))
- (gsharp . ( -1 4 1 ))
- (gsharpsharp . ( -1 4 2 ))
- (aflatflat . ( -1 5 -2 ))
- (aflat . ( -1 5 -1 ))
- (a . ( -1 5 0 ))
- (asharp . ( -1 5 1 ))
- (asharpsharp . ( -1 5 2 ))
- (bflatflat . ( -1 6 -2 ))
- (bflat . ( -1 6 -1 ))
- (b . ( -1 6 0 ))
- (bsharp . ( -1 6 1 ))
- (bsharpsharp . ( -1 6 2 ))
+\notenames #`(
+ (cflatflat . ,(make-pitch -1 0 -2 ))
+ (cflat . ,(make-pitch -1 0 -1 ))
+ (c . ,(make-pitch -1 0 0 ))
+ (csharp . ,(make-pitch -1 0 1 ))
+ (csharpsharp . ,(make-pitch -1 0 2 ))
+ (dflatflat . ,(make-pitch -1 1 -2 ))
+ (dflat . ,(make-pitch -1 1 -1 ))
+ (d . ,(make-pitch -1 1 0 ))
+ (dsharp . ,(make-pitch -1 1 1 ))
+ (dsharpsharp . ,(make-pitch -1 1 2 ))
+ (eflatflat . ,(make-pitch -1 2 -2 ))
+ (eflat . ,(make-pitch -1 2 -1 ))
+ (e . ,(make-pitch -1 2 0 ))
+ (esharp . ,(make-pitch -1 2 1 ))
+ (esharpsharp . ,(make-pitch -1 2 2 ))
+ (fflatflat . ,(make-pitch -1 3 -2 ))
+ (fflat . ,(make-pitch -1 3 -1 ))
+ (f . ,(make-pitch -1 3 0 ))
+ (fsharp . ,(make-pitch -1 3 1 ))
+ (fsharpsharp . ,(make-pitch -1 3 2 ))
+ (gflatflat . ,(make-pitch -1 4 -2 ))
+ (gflat . ,(make-pitch -1 4 -1 ))
+ (g . ,(make-pitch -1 4 0 ))
+ (gsharp . ,(make-pitch -1 4 1 ))
+ (gsharpsharp . ,(make-pitch -1 4 2 ))
+ (aflatflat . ,(make-pitch -1 5 -2 ))
+ (aflat . ,(make-pitch -1 5 -1 ))
+ (a . ,(make-pitch -1 5 0 ))
+ (asharp . ,(make-pitch -1 5 1 ))
+ (asharpsharp . ,(make-pitch -1 5 2 ))
+ (bflatflat . ,(make-pitch -1 6 -2 ))
+ (bflat . ,(make-pitch -1 6 -1 ))
+ (b . ,(make-pitch -1 6 0 ))
+ (bsharp . ,(make-pitch -1 6 1 ))
+ (bsharpsharp . ,(make-pitch -1 6 2 ))
- (cff . ( -1 0 -2 ))
- (cf . ( -1 0 -1 ))
- (c . ( -1 0 0 ))
- (cs . ( -1 0 1 ))
- (css . ( -1 0 2 ))
- (dff . ( -1 1 -2 ))
- (df . ( -1 1 -1 ))
- (d . ( -1 1 0 ))
- (ds . ( -1 1 1 ))
- (dss . ( -1 1 2 ))
- (eff . ( -1 2 -2 ))
- (ef . ( -1 2 -1 ))
- (e . ( -1 2 0 ))
- (es . ( -1 2 1 )) ; es = E-flat in Dutch
- (ess . ( -1 2 2 ))
- (fff . ( -1 3 -2 ))
- (ff . ( -1 3 -1 ))
- (f . ( -1 3 0 ))
- (fs . ( -1 3 1 ))
- (fss . ( -1 3 2 ))
- (gff . ( -1 4 -2 ))
- (gf . ( -1 4 -1 ))
- (g . ( -1 4 0 ))
- (gs . ( -1 4 1 ))
- (gss . ( -1 4 2 ))
- (aff . ( -1 5 -2 ))
- (af . ( -1 5 -1 ))
- (a . ( -1 5 0 ))
- (as . ( -1 5 1 )) ; as = A-flat in Dutch
- (ass . ( -1 5 2 ))
- (bff . ( -1 6 -2 ))
- (bf . ( -1 6 -1 ))
- (b . ( -1 6 0 ))
- (bs . ( -1 6 1 ))
- (bss . ( -1 6 2 ))
+ (cff . ,(make-pitch -1 0 -2 ))
+ (cf . ,(make-pitch -1 0 -1 ))
+ (c . ,(make-pitch -1 0 0 ))
+ (cs . ,(make-pitch -1 0 1 ))
+ (css . ,(make-pitch -1 0 2 ))
+ (dff . ,(make-pitch -1 1 -2 ))
+ (df . ,(make-pitch -1 1 -1 ))
+ (d . ,(make-pitch -1 1 0 ))
+ (ds . ,(make-pitch -1 1 1 ))
+ (dss . ,(make-pitch -1 1 2 ))
+ (eff . ,(make-pitch -1 2 -2 ))
+ (ef . ,(make-pitch -1 2 -1 ))
+ (e . ,(make-pitch -1 2 0 ))
+ (es . ,(make-pitch -1 2 1 )) ; es = E-flat in Dutch
+ (ess . ,(make-pitch -1 2 2 ))
+ (fff . ,(make-pitch -1 3 -2 ))
+ (ff . ,(make-pitch -1 3 -1 ))
+ (f . ,(make-pitch -1 3 0 ))
+ (fs . ,(make-pitch -1 3 1 ))
+ (fss . ,(make-pitch -1 3 2 ))
+ (gff . ,(make-pitch -1 4 -2 ))
+ (gf . ,(make-pitch -1 4 -1 ))
+ (g . ,(make-pitch -1 4 0 ))
+ (gs . ,(make-pitch -1 4 1 ))
+ (gss . ,(make-pitch -1 4 2 ))
+ (aff . ,(make-pitch -1 5 -2 ))
+ (af . ,(make-pitch -1 5 -1 ))
+ (a . ,(make-pitch -1 5 0 ))
+ (as . ,(make-pitch -1 5 1 )) ; as = A-flat in Dutch
+ (ass . ,(make-pitch -1 5 2 ))
+ (bff . ,(make-pitch -1 6 -2 ))
+ (bf . ,(make-pitch -1 6 -1 ))
+ (b . ,(make-pitch -1 6 0 ))
+ (bs . ,(make-pitch -1 6 1 ))
+ (bss . ,(make-pitch -1 6 2 ))
)
\version "1.3.96";
% contributed by Paolo Zuliani <zuliap@easynet.it>
\notenames #'(
- (dobb . ( -1 0 -2 ))
- (dob . ( -1 0 -1 ))
- (do . ( -1 0 0 ))
- (dod . ( -1 0 1 ))
- (dodd . ( -1 0 2 ))
- (rebb . ( -1 1 -2 ))
- (reb . ( -1 1 -1 ))
- (re . ( -1 1 0 ))
- (red . ( -1 1 1 ))
- (redd . ( -1 1 2 ))
- (mibb . ( -1 2 -2 ))
- (mib . ( -1 2 -1 ))
- (mi . ( -1 2 0 ))
- (mid . ( -1 2 1 ))
- (midd . ( -1 2 2 ))
- (fabb . ( -1 3 -2 ))
- (fab . ( -1 3 -1 ))
- (fa . ( -1 3 0 ))
- (fad . ( -1 3 1 ))
- (fadd . ( -1 3 2 ))
- (solbb . ( -1 4 -2 ))
- (solb . ( -1 4 -1 ))
- (sol . ( -1 4 0 ))
- (sold . ( -1 4 1 ))
- (soldd . ( -1 4 2 ))
- (labb . ( -1 5 -2 ))
- (lab . ( -1 5 -1 ))
- (la . ( -1 5 0 ))
- (lad . ( -1 5 1 ))
- (ladd . ( -1 5 2 ))
- (sibb . ( -1 6 -2 ))
- (sib . ( -1 6 -1 ))
- (si . ( -1 6 0 ))
- (sid . ( -1 6 1 ))
- (sidd . ( -1 6 2 ))
+ (dobb . ,(make-pitch -1 0 -2 ))
+ (dob . ,(make-pitch -1 0 -1 ))
+ (do . ,(make-pitch -1 0 0 ))
+ (dod . ,(make-pitch -1 0 1 ))
+ (dodd . ,(make-pitch -1 0 2 ))
+ (rebb . ,(make-pitch -1 1 -2 ))
+ (reb . ,(make-pitch -1 1 -1 ))
+ (re . ,(make-pitch -1 1 0 ))
+ (red . ,(make-pitch -1 1 1 ))
+ (redd . ,(make-pitch -1 1 2 ))
+ (mibb . ,(make-pitch -1 2 -2 ))
+ (mib . ,(make-pitch -1 2 -1 ))
+ (mi . ,(make-pitch -1 2 0 ))
+ (mid . ,(make-pitch -1 2 1 ))
+ (midd . ,(make-pitch -1 2 2 ))
+ (fabb . ,(make-pitch -1 3 -2 ))
+ (fab . ,(make-pitch -1 3 -1 ))
+ (fa . ,(make-pitch -1 3 0 ))
+ (fad . ,(make-pitch -1 3 1 ))
+ (fadd . ,(make-pitch -1 3 2 ))
+ (solbb . ,(make-pitch -1 4 -2 ))
+ (solb . ,(make-pitch -1 4 -1 ))
+ (sol . ,(make-pitch -1 4 0 ))
+ (sold . ,(make-pitch -1 4 1 ))
+ (soldd . ,(make-pitch -1 4 2 ))
+ (labb . ,(make-pitch -1 5 -2 ))
+ (lab . ,(make-pitch -1 5 -1 ))
+ (la . ,(make-pitch -1 5 0 ))
+ (lad . ,(make-pitch -1 5 1 ))
+ (ladd . ,(make-pitch -1 5 2 ))
+ (sibb . ,(make-pitch -1 6 -2 ))
+ (sib . ,(make-pitch -1 6 -1 ))
+ (si . ,(make-pitch -1 6 0 ))
+ (sid . ,(make-pitch -1 6 1 ))
+ (sidd . ,(make-pitch -1 6 2 ))
)
\version "1.3.96";
\include "performer.ly"
% unfold_all = "1";
}
+
common dutch names for notes. es means flat, is means sharp
%}
-\notenames #'(
- (ceses . (-1 0 -2 ))
- (ces . ( -1 0 -1 ))
- (c . ( -1 0 0 ))
- (cis . ( -1 0 1 ))
- (cisis . ( -1 0 2 ))
- (deses . ( -1 1 -2 ))
- (des . ( -1 1 -1 ))
- (d . ( -1 1 0 ))
- (dis . ( -1 1 1 ))
- (disis . ( -1 1 2 ))
- (eeses . ( -1 2 -2 ))
- (eses . ( -1 2 -2 ))
- (ees . ( -1 2 -1 ))
- (es . ( -1 2 -1 ))
- (e . ( -1 2 0 ))
- (eis . ( -1 2 1 ))
- (eisis . ( -1 2 2 ))
- (feses . ( -1 3 -2 ))
- (fes . ( -1 3 -1 ))
- (f . ( -1 3 0 ))
- (fis . ( -1 3 1 ))
- (fisis . ( -1 3 2 ))
- (geses . ( -1 4 -2 ))
- (ges . ( -1 4 -1 ))
- (g . ( -1 4 0 ))
- (gis . ( -1 4 1 ))
- (gisis . ( -1 4 2 ))
- (aeses . ( -1 5 -2 ))
- (ases . ( -1 5 -2 ))
- (aes . ( -1 5 -1 ))
- (as . ( -1 5 -1 ))
- (a . ( -1 5 0 ))
- (ais . ( -1 5 1 ))
- (aisis . ( -1 5 2 ))
- (beses . ( -1 6 -2 ))
- (bes . ( -1 6 -1 ))
- (b . ( -1 6 0 ))
- (bis . ( -1 6 1 ))
- (bisis . ( -1 6 2 )))
+\notenames #`(
+ (ceses . ,(make-pitch -1 0 -2))
+ (ces . ,(make-pitch -1 0 -1 ))
+ (c . ,(make-pitch -1 0 0 ))
+ (cis . ,(make-pitch -1 0 1 ))
+ (cisis . ,(make-pitch -1 0 2 ))
+ (deses . ,(make-pitch -1 1 -2 ))
+ (des . ,(make-pitch -1 1 -1 ))
+ (d . ,(make-pitch -1 1 0 ))
+ (dis . ,(make-pitch -1 1 1 ))
+ (disis . ,(make-pitch -1 1 2 ))
+ (eeses . ,(make-pitch -1 2 -2 ))
+ (eses . ,(make-pitch -1 2 -2 ))
+ (ees . ,(make-pitch -1 2 -1 ))
+ (es . ,(make-pitch -1 2 -1 ))
+ (e . ,(make-pitch -1 2 0 ))
+ (eis . ,(make-pitch -1 2 1 ))
+ (eisis . ,(make-pitch -1 2 2 ))
+ (feses . ,(make-pitch -1 3 -2 ))
+ (fes . ,(make-pitch -1 3 -1 ))
+ (f . ,(make-pitch -1 3 0 ))
+ (fis . ,(make-pitch -1 3 1 ))
+ (fisis . ,(make-pitch -1 3 2 ))
+ (geses . ,(make-pitch -1 4 -2 ))
+ (ges . ,(make-pitch -1 4 -1 ))
+ (g . ,(make-pitch -1 4 0 ))
+ (gis . ,(make-pitch -1 4 1 ))
+ (gisis . ,(make-pitch -1 4 2 ))
+ (aeses . ,(make-pitch -1 5 -2 ))
+ (ases . ,(make-pitch -1 5 -2 ))
+ (aes . ,(make-pitch -1 5 -1 ))
+ (as . ,(make-pitch -1 5 -1 ))
+ (a . ,(make-pitch -1 5 0 ))
+ (ais . ,(make-pitch -1 5 1 ))
+ (aisis . ,(make-pitch -1 5 2 ))
+ (beses . ,(make-pitch -1 6 -2 ))
+ (bes . ,(make-pitch -1 6 -1 ))
+ (b . ,(make-pitch -1 6 0 ))
+ (bis . ,(make-pitch -1 6 1 ))
+ (bisis . ,(make-pitch -1 6 2 ))
+)
%}
\notenames #'(
- (ceses . ( -1 0 -2 ))
- (cessess . ( -1 0 -2 ))
- (ces . ( -1 0 -1 ))
- (cess . ( -1 0 -1 ))
- (c . ( -1 0 0 ))
- (cis . ( -1 0 1 ))
- (ciss . ( -1 0 1 ))
- (cisis . ( -1 0 2 ))
- (cississ . ( -1 0 2 ))
- (deses . ( -1 1 -2 ))
- (dessess . ( -1 1 -2 ))
- (des . ( -1 1 -1 ))
- (dess . ( -1 1 -1 ))
- (d . ( -1 1 0 ))
- (dis . ( -1 1 1 ))
- (diss . ( -1 1 1 ))
- (disis . ( -1 1 2 ))
- (dississ . ( -1 1 2 ))
- (eeses . ( -1 2 -2 ))
- (eessess . ( -1 2 -2 ))
- (eses . ( -1 2 -2 ))
- (essess . ( -1 2 -2 ))
- (ees . ( -1 2 -1 ))
- (eess . ( -1 2 -1 ))
- (es . ( -1 2 -1 ))
- (ess . ( -1 2 -1 ))
- (e . ( -1 2 0 ))
- (eis . ( -1 2 1 ))
- (eiss . ( -1 2 1 ))
- (eisis . ( -1 2 2 ))
- (eississ . ( -1 2 2 ))
- (feses . ( -1 3 -2 ))
- (fessess . ( -1 3 -2 ))
- (fes . ( -1 3 -1 ))
- (fess . ( -1 3 -1 ))
- (f . ( -1 3 0 ))
- (fis . ( -1 3 1 ))
- (fiss . ( -1 3 1 ))
- (fisis . ( -1 3 2 ))
- (fississ . ( -1 3 2 ))
- (geses . ( -1 4 -2 ))
- (gessess . ( -1 4 -2 ))
- (ges . ( -1 4 -1 ))
- (gess . ( -1 4 -1 ))
- (g . ( -1 4 0 ))
- (g . ( -1 4 0 ))
- (gis . ( -1 4 1 ))
- (giss . ( -1 4 1 ))
- (gisis . ( -1 4 2 ))
- (gississ . ( -1 4 2 ))
- (aeses . ( -1 5 -2 ))
- (aessess . ( -1 5 -2 ))
- (ases . ( -1 5 -2 ))
- (assess . ( -1 5 -2 ))
- (aes . ( -1 5 -1 ))
- (aess . ( -1 5 -1 ))
- (as . ( -1 5 -1 ))
- (ass . ( -1 5 -1 ))
- (a . ( -1 5 0 ))
- (ais . ( -1 5 1 ))
- (aiss . ( -1 5 1 ))
- (aisis . ( -1 5 2 ))
- (aississ . ( -1 5 2 ))
- (bes . ( -1 6 -2 ))
- (bess . ( -1 6 -2 ))
- (b . ( -1 6 -1 ))
- (b . ( -1 6 -1 ))
- (h . ( -1 6 0 ))
- (his . ( -1 6 1 ))
- (hiss . ( -1 6 1 ))
- (hisis . ( -1 6 2 ))
- (hississ . ( -1 6 2 ))
+ (ceses . ,(make-pitch -1 0 -2 ))
+ (cessess . ,(make-pitch -1 0 -2 ))
+ (ces . ,(make-pitch -1 0 -1 ))
+ (cess . ,(make-pitch -1 0 -1 ))
+ (c . ,(make-pitch -1 0 0 ))
+ (cis . ,(make-pitch -1 0 1 ))
+ (ciss . ,(make-pitch -1 0 1 ))
+ (cisis . ,(make-pitch -1 0 2 ))
+ (cississ . ,(make-pitch -1 0 2 ))
+ (deses . ,(make-pitch -1 1 -2 ))
+ (dessess . ,(make-pitch -1 1 -2 ))
+ (des . ,(make-pitch -1 1 -1 ))
+ (dess . ,(make-pitch -1 1 -1 ))
+ (d . ,(make-pitch -1 1 0 ))
+ (dis . ,(make-pitch -1 1 1 ))
+ (diss . ,(make-pitch -1 1 1 ))
+ (disis . ,(make-pitch -1 1 2 ))
+ (dississ . ,(make-pitch -1 1 2 ))
+ (eeses . ,(make-pitch -1 2 -2 ))
+ (eessess . ,(make-pitch -1 2 -2 ))
+ (eses . ,(make-pitch -1 2 -2 ))
+ (essess . ,(make-pitch -1 2 -2 ))
+ (ees . ,(make-pitch -1 2 -1 ))
+ (eess . ,(make-pitch -1 2 -1 ))
+ (es . ,(make-pitch -1 2 -1 ))
+ (ess . ,(make-pitch -1 2 -1 ))
+ (e . ,(make-pitch -1 2 0 ))
+ (eis . ,(make-pitch -1 2 1 ))
+ (eiss . ,(make-pitch -1 2 1 ))
+ (eisis . ,(make-pitch -1 2 2 ))
+ (eississ . ,(make-pitch -1 2 2 ))
+ (feses . ,(make-pitch -1 3 -2 ))
+ (fessess . ,(make-pitch -1 3 -2 ))
+ (fes . ,(make-pitch -1 3 -1 ))
+ (fess . ,(make-pitch -1 3 -1 ))
+ (f . ,(make-pitch -1 3 0 ))
+ (fis . ,(make-pitch -1 3 1 ))
+ (fiss . ,(make-pitch -1 3 1 ))
+ (fisis . ,(make-pitch -1 3 2 ))
+ (fississ . ,(make-pitch -1 3 2 ))
+ (geses . ,(make-pitch -1 4 -2 ))
+ (gessess . ,(make-pitch -1 4 -2 ))
+ (ges . ,(make-pitch -1 4 -1 ))
+ (gess . ,(make-pitch -1 4 -1 ))
+ (g . ,(make-pitch -1 4 0 ))
+ (g . ,(make-pitch -1 4 0 ))
+ (gis . ,(make-pitch -1 4 1 ))
+ (giss . ,(make-pitch -1 4 1 ))
+ (gisis . ,(make-pitch -1 4 2 ))
+ (gississ . ,(make-pitch -1 4 2 ))
+ (aeses . ,(make-pitch -1 5 -2 ))
+ (aessess . ,(make-pitch -1 5 -2 ))
+ (ases . ,(make-pitch -1 5 -2 ))
+ (assess . ,(make-pitch -1 5 -2 ))
+ (aes . ,(make-pitch -1 5 -1 ))
+ (aess . ,(make-pitch -1 5 -1 ))
+ (as . ,(make-pitch -1 5 -1 ))
+ (ass . ,(make-pitch -1 5 -1 ))
+ (a . ,(make-pitch -1 5 0 ))
+ (ais . ,(make-pitch -1 5 1 ))
+ (aiss . ,(make-pitch -1 5 1 ))
+ (aisis . ,(make-pitch -1 5 2 ))
+ (aississ . ,(make-pitch -1 5 2 ))
+ (bes . ,(make-pitch -1 6 -2 ))
+ (bess . ,(make-pitch -1 6 -2 ))
+ (b . ,(make-pitch -1 6 -1 ))
+ (b . ,(make-pitch -1 6 -1 ))
+ (h . ,(make-pitch -1 6 0 ))
+ (his . ,(make-pitch -1 6 1 ))
+ (hiss . ,(make-pitch -1 6 1 ))
+ (hisis . ,(make-pitch -1 6 2 ))
+ (hississ . ,(make-pitch -1 6 2 ))
)
% by Mats Bengtsson.
\notenames #'(
- (cessess . ( -1 0 -2 ))
- (cess . ( -1 0 -1 ))
- (c . ( -1 0 0 ))
- (ciss . ( -1 0 1 ))
- (cississ . ( -1 0 2 ))
- (dessess . ( -1 1 -2 ))
- (dess . ( -1 1 -1 ))
- (d . ( -1 1 0 ))
- (diss . ( -1 1 1 ))
- (dississ . ( -1 1 2 ))
- (essess . ( -1 2 -2 ))
- (ess . ( -1 2 -1 ))
- (e . ( -1 2 0 ))
- (eiss . ( -1 2 1 ))
- (eississ . ( -1 2 2 ))
- (fessess . ( -1 3 -2 ))
- (fess . ( -1 3 -1 ))
- (f . ( -1 3 0 ))
- (fiss . ( -1 3 1 ))
- (fississ . ( -1 3 2 ))
- (gessess . ( -1 4 -2 ))
- (gess . ( -1 4 -1 ))
- (g . ( -1 4 0 ))
- (giss . ( -1 4 1 ))
- (gississ . ( -1 4 2 ))
- (assess . ( -1 5 -2 ))
- (ass . ( -1 5 -1 ))
- (a . ( -1 5 0 ))
- (aiss . ( -1 5 1 ))
- (aississ . ( -1 5 2 ))
- (hessess . ( -1 6 -2 ))
- (b . ( -1 6 -1 ))
- (h . ( -1 6 0 ))
- (hiss . ( -1 6 1 ))
- (hississ . ( -1 6 2 ))
+ (cessess . ,(make-pitch -1 0 -2 ))
+ (cess . ,(make-pitch -1 0 -1 ))
+ (c . ,(make-pitch -1 0 0 ))
+ (ciss . ,(make-pitch -1 0 1 ))
+ (cississ . ,(make-pitch -1 0 2 ))
+ (dessess . ,(make-pitch -1 1 -2 ))
+ (dess . ,(make-pitch -1 1 -1 ))
+ (d . ,(make-pitch -1 1 0 ))
+ (diss . ,(make-pitch -1 1 1 ))
+ (dississ . ,(make-pitch -1 1 2 ))
+ (essess . ,(make-pitch -1 2 -2 ))
+ (ess . ,(make-pitch -1 2 -1 ))
+ (e . ,(make-pitch -1 2 0 ))
+ (eiss . ,(make-pitch -1 2 1 ))
+ (eississ . ,(make-pitch -1 2 2 ))
+ (fessess . ,(make-pitch -1 3 -2 ))
+ (fess . ,(make-pitch -1 3 -1 ))
+ (f . ,(make-pitch -1 3 0 ))
+ (fiss . ,(make-pitch -1 3 1 ))
+ (fississ . ,(make-pitch -1 3 2 ))
+ (gessess . ,(make-pitch -1 4 -2 ))
+ (gess . ,(make-pitch -1 4 -1 ))
+ (g . ,(make-pitch -1 4 0 ))
+ (giss . ,(make-pitch -1 4 1 ))
+ (gississ . ,(make-pitch -1 4 2 ))
+ (assess . ,(make-pitch -1 5 -2 ))
+ (ass . ,(make-pitch -1 5 -1 ))
+ (a . ,(make-pitch -1 5 0 ))
+ (aiss . ,(make-pitch -1 5 1 ))
+ (aississ . ,(make-pitch -1 5 2 ))
+ (hessess . ,(make-pitch -1 6 -2 ))
+ (b . ,(make-pitch -1 6 -1 ))
+ (h . ,(make-pitch -1 6 0 ))
+ (hiss . ,(make-pitch -1 6 1 ))
+ (hississ . ,(make-pitch -1 6 2 ))
)
\version "1.3.96";
# installed by 'make install'
INSTALL_DIST_FILES = \
- bin/convert-mudela\
- bin/mudela-book\
+ bin/convert-ly\
+ bin/lilypond-book\
bin/ly2dvi\
bin/$(program_prefix)lilypond$(program_suffix)\
bin/$(program_prefix)mi2mu$(program-suffix)\
info/lilypond.info\
man/man1/mi2mu.1\
man/man1/lilypond.1\
- man/man1/mudela-book.1\
+ man/man1/lilypond-book.1\
man/man1/ly2dvi.1\
- man/man1/convert-mudela.1\
+ man/man1/convert-ly.1\
lib/texmf/texmf/tex/lilypond\
lib/texmf/texmf/fonts/source/public/lilypond\
share/lilypond/\
--- /dev/null
+# Mudela_rules.make
+
+.SUFFIXES: .doc .dvi .mudtex .tely .texi
+
+SUBST_TEXI_DEPS=sed 's! \.\./! !g' < $(basename $@).dep > $(outdir)/temp.dep ; mv $(outdir)/temp.dep $(basename $@).dep
+
+$(outdir)/%.latex: %.doc
+ LILYPONDPREFIX=$(LILYPONDPREFIX)/.. $(PYTHON) $(script-dir)/lilypond-book.py --outdir=$(outdir) -I .. -I $(input-dir)/test/ --dependencies --dep-prefix=$(outdir)/ $<
+ $(SUBST_TEXI_DEPS)
+
+# don't do ``cd $(outdir)'', and assume that $(outdir)/.. is the src dir.
+# it is not, for --scrdir builds
+$(outdir)/%.texi: %.tely
+ LILYPONDPREFIX=$(LILYPONDPREFIX)/.. $(PYTHON) $(script-dir)/lilypond-book.py --outdir=$(outdir) -I .. -I $(input-dir)/test/ --dependencies --dep-prefix=$(outdir)/ --format=texi $<
+ $(SUBST_TEXI_DEPS)
+
+# nexi: no-lily texi
+# for plain info doco: don't run lily
+$(outdir)/%.nexi: %.tely
+ LILYPONDPREFIX=$(LILYPONDPREFIX)/.. $(PYTHON) $(script-dir)/lilypond-book.py --outdir=$(outdir) --no-lily -I .. -I $(input-dir)/test/ --dependencies --dep-prefix=$(outdir)/ --format=texi $<
+ mv $(@D)/$(*F).texi $@
+ $(SUBST_TEXI_DEPS)
+
+# nfo: info from non-lily texi
+$(outdir)/%.info: $(outdir)/%.nexi
+ -$(MAKEINFO) --force --output=$(outdir)/$(*F).info $<
+
+# nfo: info from non-lily texi
+#$(outdir)/%.nfo: $(outdir)/%.nexi
+# -$(MAKEINFO) --force --output=$(outdir)/$(*F).info $<
--- /dev/null
+# empty
+TELY_FILES := $(wildcard *.tely)
+EXTRA_DIST_FILES += $(TELY_FILES)
+
+++ /dev/null
-# Mudela_rules.make
-
-.SUFFIXES: .doc .dvi .mudtex .tely .texi
-
-SUBST_TEXI_DEPS=sed 's! \.\./! !g' < $(basename $@).dep > $(outdir)/temp.dep ; mv $(outdir)/temp.dep $(basename $@).dep
-
-$(outdir)/%.latex: %.doc
- LILYPONDPREFIX=$(LILYPONDPREFIX)/.. $(PYTHON) $(script-dir)/mudela-book.py --outdir=$(outdir) -I .. -I $(input-dir)/test/ --dependencies --dep-prefix=$(outdir)/ $<
- $(SUBST_TEXI_DEPS)
-
-# don't do ``cd $(outdir)'', and assume that $(outdir)/.. is the src dir.
-# it is not, for --scrdir builds
-$(outdir)/%.texi: %.tely
- LILYPONDPREFIX=$(LILYPONDPREFIX)/.. $(PYTHON) $(script-dir)/mudela-book.py --outdir=$(outdir) -I .. -I $(input-dir)/test/ --dependencies --dep-prefix=$(outdir)/ --format=texi $<
- $(SUBST_TEXI_DEPS)
-
-# nexi: no-lily texi
-# for plain info doco: don't run lily
-$(outdir)/%.nexi: %.tely
- LILYPONDPREFIX=$(LILYPONDPREFIX)/.. $(PYTHON) $(script-dir)/mudela-book.py --outdir=$(outdir) --no-lily -I .. -I $(input-dir)/test/ --dependencies --dep-prefix=$(outdir)/ --format=texi $<
- mv $(@D)/$(*F).texi $@
- $(SUBST_TEXI_DEPS)
-
-# nfo: info from non-lily texi
-$(outdir)/%.info: $(outdir)/%.nexi
- -$(MAKEINFO) --force --output=$(outdir)/$(*F).info $<
-
-# nfo: info from non-lily texi
-#$(outdir)/%.nfo: $(outdir)/%.nexi
-# -$(MAKEINFO) --force --output=$(outdir)/$(*F).info $<
+++ /dev/null
-# empty
-TELY_FILES := $(wildcard *.tely)
-EXTRA_DIST_FILES += $(TELY_FILES)
-
local-web:
$(MAKE) conf=www local-WWW
-convert-mudela: local-convert-mudela
+convert-ly: local-convert-ly
$(LOOP)
-local-convert-mudela:
- $(PYTHON) $(script-dir)/convert-mudela.py -e *ly
+local-convert-ly:
+ $(PYTHON) $(script-dir)/convert-ly.py -e *ly
Begin3
Title: LilyPond
-Version: 1.3.106
-Entered-date: 10NOV00
+Version: 1.3.107
+Entered-date: 13NOV00
Description:
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.106.tar.gz
+ 1000k lilypond-1.3.107.tar.gz
Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/
- 1000k lilypond-1.3.106.tar.gz
+ 1000k lilypond-1.3.107.tar.gz
Copying-policy: GPL
End
%define info yes
Name: lilypond
-Version: 1.3.106
+Version: 1.3.107
Release: 1
License: GPL
Group: Applications/Publishing
-Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.106.tar.gz
+Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.107.tar.gz
Summary: A program for printing sheet music.
URL: http://www.cs.uu.nl/~hanwen/lilypond
# Icon: lilypond-icon.gif
% hmm
% /setgray { 1 add } bind def
-/stafflinethickness mudelapaperstafflinethickness def
-/staffheight mudelapaperstaffheight def
+/stafflinethickness lilypondpaperstafflinethickness def
+/staffheight lilypondpaperstaffheight def
/xoffset 30 def
/yoffset 700 def
grestore
yoffset add /yoffset exch def
% urg...
- yoffset mudelapaperstaffheight 8 mul sub /yoffset exch def
+ yoffset lilypondpaperstaffheight 8 mul sub /yoffset exch def
} bind def
/turnOnExperimentalFeatures { } bind def
(define (lily-def key val)
(if
- (or (equal? key "mudelapaperlinewidth")
- (equal? key "mudelapaperstaffheight"))
+ (or (equal? key "lilypondpaperlinewidth")
+ (equal? key "lilypondpaperstaffheight"))
(string-append "(define " key " " (arg->string val) ")\n")
""))
;; * text definition is rather ad-hoc
;; * do without format module
;; * finish and check american names
-;; * make notename (tonic) configurable from mudela
+;; * make notename (tonic) configurable from lilypond
;; * fix append/cons stuff in inner-name-banter
-;;
+;; * doc strings.
;;;;;;;;;
;; DONT use non-ascii characters, even if ``it works'' in Windows
(define chord::names-alist-american '())
+
(set! chord::names-alist-american
(append
'(
(list 'super (step->text-banter p))
(if (pair? (cdr from))
'((super "/"))
- '()))))))
+ '())))))) ; nesting?
to))
(if (and (pair? base-and-inversion)
(or (car base-and-inversion)
(subtractions #f))
(chord::inner-name-banter tonic user-name additions subtractions base-and-inversion)))
+(define (new-to-old-pitch p)
+ (if (pitch? p)
+ (list (pitch-octave p) (pitch-notename p) (pitch-alteration p))
+ #f
+ ))
+
+
+
;; C++ entry point
;;
;; Check for each subset of chord, full chord first, if there's a
;(display "pitches:") (display pitches) (newline)
;(display "style:") (display style) (newline)
;(display "b&i:") (display base-and-inversion) (newline)
+ (set! pitches (map new-to-old-pitch pitches))
+ (set! base-and-inversion (cons (new-to-old-pitch (car base-and-inversion))
+ (new-to-old-pitch (cdr base-and-inversion))))
+
(let ((diff (pitch::diff '(0 0 0) (car pitches)))
(name-func
(ly-eval (string->symbol (string-append "chord::name-" style))))
(stem-shorten . (0.5))
; if stem is on middle line, choose this direction.
(default-neutral-direction . 1)
- (X-offset-callbacks . (,Stem::off_callback))
+ (X-offset-callbacks . (,Stem::off_callback))
+ (X-extent-callback . ,Stem::dim_callback)
(meta . ,(element-description "Stem" stem-interface font-interface))
))
)
))
-;; return that part of LIST for which PRED is true.
(define (filter-list pred? list)
+ "return that part of LIST for which PRED is true."
(if (null? list) '()
(let* (
(rest (filter-list pred? (cdr list)))
;; this is bad, since we generate garbage every font-lookup.
;; otoh, if the qualifiers is narrow enough , we don't generate much garbage.
-
-;; return those descriptions from FONT-DESCR-LIST whose FIELD-NAME matches VALUE
(define (filter-field field-name value font-descr-alist)
+ "return those descriptions from FONT-DESCR-LIST whose FIELD-NAME matches VALUE"
(filter-list
(lambda (x) (eq? value (font-field field-name (car x))))
font-descr-alist)
((-3 medium upright math msam 10) . "msam10")
))
-;; return a FONT-DESCR with relative size decremented by DECREMENT
+;;
(define (change-relative-size font-desc decrement)
+ "return a FONT-DESCR with relative size decremented by DECREMENT"
(cons (- (car font-desc) decrement) (cdr font-desc))
)
-;; map a function FUNC over the keys of an alist LIST, leaving the vals.
+;;
(define (map-alist-keys func list)
+ "map a function FUNC over the keys of an alist LIST, leaving the vals. "
(if (null? list)
'()
(cons (cons (func (caar list)) (cdar list))
(map-alist-keys func (cdr list)))
))
-;; map a function FUNC over the vals of LIST, leaving the keys.
+;;
(define (map-alist-vals func list)
+ "map a function FUNC over the vals of LIST, leaving the keys."
(if (null? list)
'()
(cons (cons (caar list) (func (cdar list)))
(dynamic . ((font-series . bold) (font-family . dynamic) (font-relative-size . 0)))
))
(properties-to-font .
-
,Font_interface::properties_to_font_name)
- ; ,properties-to-font-name)
;; FIXME: this is a not-so-cool idea to use ALIGN
;; RAISE, LOOKUP, since they are not proper elt-properties,
)
)
-;; reduce the font list by successively applying a font-qualifier.
(define (qualifiers-to-fontnames qualifiers font-descr-alist)
+ " reduce the font list by successively applying a font-qualifier."
(if (null? qualifiers)
font-descr-alist
)
))
-
-;; does FONT-DESC satisfy QUALIFIERS?
(define (font-qualifies? qualifiers font-desc)
+ "does FONT-DESC satisfy QUALIFIERS?"
(if (null? qualifiers) #t
(if (eq? (font-field (caar qualifiers) font-desc) (cdar qualifiers))
(font-qualifies? (cdr qualifiers) font-desc)
))
-;; return a single font from FONTS (or a default, if none found)
-;; and warn if the selected font is not unique.
(define (select-unique-font qualifiers fonts)
+ "return a single font from FONTS (or a default, if none found)
+and warn if the selected font is not unique.
+"
(let* (
(err (current-error-port))
)
)
;; TODO
-;; add support for override by font-name
-;; very often-used; hard-code in C++, and use SCM glue code.
-
+;; the C++ version in font-interface.cc is usually used.
(define (properties-to-font-name fonts properties-alist-list)
(let* (
;; change order to change priorities of qualifiers.
font) ; return the topmost.
))
+(if #f (begin
+ (define (test-module)
+ (display (filter-list pair? '(1 2 (1 2) (1 .2)))
+ (display (filter-field 'font-name 'cmbx paper20-style-sheet-alist))
+ (display (qualifiers-to-fontname '((font-name . cmbx)) paper20-style-sheet-alist))
+ (display (style-to-font-name 'paper20 'large))
+ )
+ )
+ )
-; (define (test-module)
-; (display (filter-list pair? '(1 2 (1 2) (1 .2)))
-;(display (filter-field 'font-name 'cmbx paper20-style-sheet-alist))
-
-; (display (qualifiers-to-fontname '((font-name . cmbx)) paper20-style-sheet-alist))
-; (display (style-to-font-name 'paper20 'large))
-; )
-
-
+)
"A clef sign"
(list
(elt-property-description 'non-default boolean? "not set because of existence of a bar?")
- (elt-property-description 'change boolean? "is this a change clef (smaller size)?")
+ (elt-property-description 'full-size-change boolean? "if set, don't make a change clef smaller.")
(elt-property-description 'glyph string? "a string determining what glyph is typeset")
))
)
(list
(elt-property-description 'grow-direction dir? "crescendo or decrescendo?")
(elt-property-description 'thickness number? "thickness, measured in stafflinethickness")
- (elt-property-description 'height number? "height, measured in staffspace in ")
+ (elt-property-description 'height number? "height, measured in staffspace.")
)))
(define arpeggio-interface
(ly-gulp-file "lily.ps") 'pre " %\n" 'post)
(ly-gulp-file "lily.ps"))
"}"
- "\\input lilyponddefs\\newdimen\\outputscale \\outputscale=\\mudelapaperoutputscale pt\\turnOnPostScript"))
+ "\\input lilyponddefs\\newdimen\\outputscale \\outputscale=\\lilypondpaperoutputscale pt\\turnOnPostScript"))
(define (header creator generate)
(string-append
(define (lily-def key val)
- (if (string=? (substring key 0 (min (string-length "mudelapaper") (string-length key))) "mudelapaper")
+ (if (string=? (substring key 0 (min (string-length "lilypondpaper") (string-length key))) "lilypondpaper")
(string-append "/" key " {" val "} bind def\n")
(string-append "/" key " (" val ") def\n")
)
)
(if (pair? e)
`(((symbol . clefGlyph)
- (type . property-set)
+ (type . ,Property_iterator::constructor)
(value . ,(cadr e))
)
((symbol . clefPosition)
- (type . property-set)
+ (type . ,Property_iterator::constructor)
(value . ,(caddr e))
)
((symbol . clefOctavation)
- (type . property-set)
+ (type . ,Property_iterator::constructor)
(value . ,(caddr (cdr e)))
)
)
(ly-warn (string-append "Unknown clef type `" cl "'\nSee scm/lily.scm for supported clefs"))
'())
)))
+
+
+
+(define (repeat-name-to-ctor name)
+ (let*
+ ((supported-reps
+ `(("volta" . ((type . ,Volta_repeat_iterator::constructor)
+ (length . ,Repeated_music::volta_music_length)
+ ))
+ ("unfold" . ((type . ,Unfolded_repeat_iterator::constructor)
+ (length . ,Repeated_music::unfolded_music_length)
+ ))
+ ("fold" . ((type . ,Folded_repeat_iterator::constructor)
+ (length . ,Repeated_music::folded_music_length)
+ ))
+ ("tremolo" . ((type . ,Chord_tremolo_iterator::constructor)
+ (length . ,Repeated_music::volta_music_length)
+ ))
+ ))
+
+ (handle (assoc name supported-reps))
+ )
+
+ (if (pair? handle)
+ (cdr handle)
+ (begin
+ (ly-warn
+ (string-append "Unknown repeat type `" name "'\nSee scm/lily.scm for supported repeats")
+ )
+ '(type . 'repeated-music))
+ )
+ ))
+
'Bar_engraver
(engraver-description
"Bar_engraver"
- "Create barlines."
+ "Create barlines. This engraver is controlled through the
+@code{whichBar} property. If it has no bar line to create, it will forbid a linebreak at this point"
'(BarLine)
(list
(translator-property-description 'whichBar string? "This property is read to determine what type of barline to create.
'Score_engraver
(engraver-description
"Score_engraver"
- "Top level engraver. Takes care of generating columns and the complete system (ie. LineOfScore)"
+ "Top level engraver. Takes care of generating columns and the complete system (ie. LineOfScore)
+
+This engraver decides whether a column is breakable. The default is
+that a column is always breakable. However, when every Bar_engraver
+that does not have a barline at a certain point will call
+Score_engraver::forbid_breaks to stop linebreaks. In practice, this
+means that you can make a breakpoint by creating a barline (assuming
+that there are no beams or notes that prevent a breakpoint.)
+
+"
'(LineOfScore PaperColumn NonMusicalPaperColumn)
(list
(translator-property-description 'currentMusicalColumn ly-element? "")
'()
(list
(translator-property-description 'timeSignatureFraction number-pair? "
-pair of numbers, signifying the time signature. For example #'(4 . 4) is a 4/4 time signature.")
-
+pair of numbers, signifying the time signature. For example #'(4 . 4) is a 4/4time signature.")
+ (translator-property-description 'barCheckNoSynchronize boolean?
+"If set, don't reset measurePosition when finding a bbarcheck. This
+makes bar-checks for polyphonic music easier.")
+
(translator-property-description 'barNonAuto boolean? " If set to true then bar lines will not be printed
automatically; they must be explicitly created with @code{\bar}
keywords. Unlike with the @code{\cadenza} keyword, measures are
@c my @vebatim patch would help...
@example
-@@mudela[fragment,verbatim,center]
+@@lilypond[fragment,verbatim,center]
r1 r1*3 R1*3\property Score.skipBars=1 r1*3 R1*3
-@@end mudela
+@@end lilypond
@end example
")
property, you can make brackets last shorter. Example
@example
-@@mudela[verbatim,fragment]
+@@lilypond[verbatim,fragment]
\context Voice \times 2/3 @{
\property Voice.tupletSpannerDuration = #(make-moment 1 4)
[c8 c c] [c c c]
@}
-@@end mudela
+@@end lilypond
@end example
")
(translator-property-description 'tupletInvisible boolean? "
# bin/Makefile
depth = ..
-SEXECUTABLES=convert-mudela mudela-book ly2dvi abc2ly as2text etf2ly musedata2ly pmx2ly
+SEXECUTABLES=convert-ly lilypond-book ly2dvi abc2ly as2text etf2ly musedata2ly pmx2ly
STEPMAKE_TEMPLATES=script help2man
HELP2MAN_EXECS = $(SEXECUTABLES)
# we use in this order specified accidental, active accidental for bar,
# active accidental for key
-def pitch_to_mudela_name (name, acc, bar_acc, key):
+def pitch_to_lilypond_name (name, acc, bar_acc, key):
s = ''
if acc == UNDEF:
if not nobarlines:
return(chr (name + ord('c')) + s)
-def octave_to_mudela_quotes (o):
+def octave_to_lilypond_quotes (o):
o = o + 2
s =''
if o < 0:
return (str,n)
-def duration_to_mudela_duration (multiply_tup, defaultlen, dots):
+def duration_to_lilypond_duration (multiply_tup, defaultlen, dots):
base = 1
# (num / den) / defaultlen < 1/base
while base * multiply_tup[0] < multiply_tup[1]:
str = str[1:]
(str, num,den,d) = parse_duration (str, parser_state)
- voices_append ('%s%s' % (rest, duration_to_mudela_duration ((num,den), default_len, d)))
+ voices_append ('%s%s' % (rest, duration_to_lilypond_duration ((num,den), default_len, d)))
if parser_state.next_articulation:
voices_append (parser_state.next_articulation)
parser_state.next_articulation = ''
voices_append ('%s' % ')' *slur_end )
bar_acc = get_bar_acc(notename, octave, parser_state)
- pit = pitch_to_mudela_name(notename, acc, bar_acc, global_key[notename])
- oct = octave_to_mudela_quotes (octave)
+ pit = pitch_to_lilypond_name(notename, acc, bar_acc, global_key[notename])
+ oct = octave_to_lilypond_quotes (octave)
if acc != UNDEF and (acc == global_key[notename] or acc == bar_acc):
mod='!'
else:
mod = ''
voices_append ("%s%s%s%s" %
(pit, oct, mod,
- duration_to_mudela_duration ((num,den), default_len, current_dots)))
+ duration_to_lilypond_duration ((num,den), default_len, current_dots)))
set_bar_acc(notename, octave, acc, parser_state)
if parser_state.next_articulation:
global nobarlines
if (str[0] == '%'):
if str[0:5] == '%MIDI':
-#the nobarlines option is necessary for an abc to mudela translator for
+#the nobarlines option is necessary for an abc to lilypond translator for
#exactly the same reason abc2midi needs it: abc requires the user to enter
#the note that will be printed, and MIDI and lilypond expect entry of the
#pitch that will be played.
def help ():
print r"""
-Convert ABC to Mudela.
+Convert ABC to Lilypond.
Usage: abc2ly [OPTIONS]... ABC-FILE
--- /dev/null
+#!@PYTHON@
+
+# convert-lilypond.py -- convertor for lilypond versions
+#
+# source file of the GNU LilyPond music typesetter
+#
+# (c) 1998
+
+# TODO
+# use -f and -t for -s output
+
+# NEWS
+# 0.2
+# - rewrite in python
+
+program_name = 'convert-ly'
+version = '@TOPLEVEL_VERSION@'
+
+import os
+import sys
+import __main__
+import getopt
+import string
+import re
+import time
+
+lilypond_version_re_str = '\\\\version *\"(.*)\"'
+lilypond_version_re = re.compile(lilypond_version_re_str)
+
+def program_id ():
+ return '%s (GNU LilyPond) %s' %(program_name, version);
+
+def identify ():
+ sys.stderr.write (program_id () + '\n')
+
+def usage ():
+ sys.stdout.write (
+ r"""Usage: %s [OPTION]... [FILE]...
+Try to convert to newer lilypond-versions. The version number of the
+input is guessed by default from \version directive
+
+Options:
+ -h, --help print this help
+ -e, --edit in place edit
+ -f, --from=VERSION start from version
+ -s, --show-rules print all rules.
+ -t, --to=VERSION target version
+ --version print program version
+
+Report bugs to bugs-gnu-music@gnu.org
+
+""" % program_name)
+
+
+ sys.exit (0)
+
+def print_version ():
+
+ sys.stdout.write (r"""%s
+
+This is free software. It is covered by the GNU General Public
+License, and you are welcome to change it and/or distribute copies of
+it under certain conditions. invoke as `%s --warranty' for more
+information.
+
+""" % (program_id() , program_name))
+
+def gulp_file(f):
+ try:
+ i = open(f)
+ i.seek (0, 2)
+ n = i.tell ()
+ i.seek (0,0)
+ except:
+ print 'can\'t open file: ' + f + '\n'
+ return ''
+ s = i.read (n)
+ if len (s) <= 0:
+ print 'gulped empty file: ' + f + '\n'
+ i.close ()
+ return s
+
+def str_to_tuple (s):
+ return tuple (map (string.atoi, string.split (s,'.')))
+
+def tup_to_str (t):
+ return string.join (map (lambda x: '%s' % x, list (t)), '.')
+
+def version_cmp (t1, t2):
+ for x in [0,1,2]:
+ if t1[x] - t2[x]:
+ return t1[x] - t2[x]
+ return 0
+
+def guess_lilypond_version(filename):
+ s = gulp_file (filename)
+ m = lilypond_version_re.search (s)
+ if m:
+ return m.group(1)
+ else:
+ return ''
+
+class FatalConversionError:
+ pass
+
+conversions = []
+
+def show_rules (file):
+ for x in conversions:
+ file.write ('%s: %s\n' % (tup_to_str (x[0]), x[2]))
+
+############################
+
+if 1: # need new a namespace
+ def conv (str):
+ if re.search ('\\\\octave', str):
+ sys.stderr.write ('\nNot smart enough to convert \\octave')
+ raise FatalConversionError()
+
+ return str
+
+ conversions.append (
+ ((0,1,19), conv, 'deprecated \\octave; can\'t convert automatically'))
+
+
+if 1: # need new a namespace
+ def conv (str):
+ str = re.sub ('\\\\textstyle([^;]+);',
+ '\\\\property Lyrics . textstyle = \\1', str)
+ str = re.sub ('\\\\key([^;]+);', '\\\\accidentals \\1;', str)
+
+ return str
+
+ conversions.append (
+ ((0,1,20), conv, 'deprecated \\textstyle, new \key syntax'))
+
+
+if 1:
+ def conv (str):
+ str = re.sub ('\\\\musical_pitch', '\\\\musicalpitch',str)
+ str = re.sub ('\\\\meter', '\\\\time',str)
+
+ return str
+
+ conversions.append (
+ ((0,1,21), conv, '\\musical_pitch -> \\musicalpitch, '+
+ '\\meter -> \\time'))
+
+if 1:
+ def conv (str):
+ return str
+
+ conversions.append (
+ ((1,0,0), conv, '0.1.21 -> 1.0.0 '))
+
+
+if 1:
+ def conv (str):
+ str = re.sub ('\\\\accidentals', '\\\\keysignature',str)
+ str = re.sub ('specialaccidentals *= *1', 'keyoctaviation = 0',str)
+ str = re.sub ('specialaccidentals *= *0', 'keyoctaviation = 1',str)
+
+ return str
+
+ conversions.append (
+ ((1,0,1), conv, '\\accidentals -> \\keysignature, ' +
+ 'specialaccidentals -> keyoctaviation'))
+
+if 1:
+ def conv(str):
+ if re.search ('\\\\header', str):
+ sys.stderr.write ('\nNot smart enough to convert to new \\header format')
+ return str
+
+ conversions.append ((1,0,2), conv, '\\header { key = concat + with + operator }')
+
+if 1:
+ def conv(str):
+ str = re.sub ('\\\\melodic', '\\\\notes',str)
+
+ return str
+
+ conversions.append ((1,0,3), conv, '\\melodic -> \\notes')
+
+if 1:
+ def conv(str):
+ str = re.sub ('default_paper *=', '',str)
+ str = re.sub ('default_midi *=', '',x)
+
+ return str
+
+ conversions.append ((1,0,4), conv, 'default_{paper,midi}')
+
+if 1:
+ def conv(str):
+ str = re.sub ('ChoireStaff', 'ChoirStaff',str)
+ str = re.sub ('\\output', 'output = ',str)
+
+ return str
+
+ conversions.append ((1,0,5), conv, 'ChoireStaff -> ChoirStaff')
+
+if 1:
+ def conv(str):
+ if re.search ('[a-zA-Z]+ = *\\translator',str):
+ sys.stderr.write ('\nNot smart enough to change \\translator syntax')
+ raise FatalConversionError()
+ return str
+
+ conversions.append ((1,0,6), conv, 'foo = \\translator {\\type .. } ->\\translator {\\type ..; foo; }')
+
+
+if 1:
+ def conv(str):
+ str = re.sub ('\\\\lyric', '\\\\lyrics',str)
+
+ return str
+
+ conversions.append ((1,0,7), conv, '\\lyric -> \\lyrics')
+
+if 1:
+ def conv(str):
+ str = re.sub ('\\\\\\[/3+', '\\\\times 2/3 { ',str)
+ str = re.sub ('\\[/3+', '\\\\times 2/3 { [',str)
+ str = re.sub ('\\\\\\[([0-9/]+)', '\\\\times \\1 {',str)
+ str = re.sub ('\\[([0-9/]+)', '\\\\times \\1 { [',str)
+ str = re.sub ('\\\\\\]([0-9/]+)', '}', str)
+ str = re.sub ('\\\\\\]', '}',str)
+ str = re.sub ('\\]([0-9/]+)', '] }', str)
+ return str
+
+ conversions.append ((1,0,10), conv, '[2/3 ]1/1 -> \\times 2/3 ')
+
+if 1:
+ def conv(str):
+ return str
+ conversions.append ((1,0,12), conv, 'Chord syntax stuff')
+
+
+if 1:
+ def conv(str):
+
+
+ str = re.sub ('<([^>~]+)~([^>]*)>','<\\1 \\2> ~', str)
+
+ return str
+
+ conversions.append ((1,0,13), conv, '<a ~ b> c -> <a b> ~ c')
+
+if 1:
+ def conv(str):
+ str = re.sub ('<\\[','[<', str)
+ str = re.sub ('\\]>','>]', str)
+
+ return str
+
+ conversions.append ((1,0,14), conv, '<[a b> <a b]>c -> [<a b> <a b>]')
+
+
+if 1:
+ def conv(str):
+ str = re.sub ('\\\\type','\\\\context', str)
+ str = re.sub ('textstyle','textStyle', str)
+
+ return str
+
+ conversions.append ((1,0,16), conv, '\\type -> \\context, textstyle -> textStyle')
+
+
+if 1:
+ def conv(str):
+ if re.search ('\\\\repeat',str):
+ sys.stderr.write ('\nNot smart enough to convert \\repeat')
+ raise FatalConversionError()
+ return str
+
+ conversions.append ((1,0,18), conv,
+ '\\repeat NUM Music Alternative -> \\repeat FOLDSTR Music Alternative')
+
+if 1:
+ def conv(str):
+ str = re.sub ('SkipBars','skipBars', str)
+ str = re.sub ('fontsize','fontSize', str)
+ str = re.sub ('midi_instrument','midiInstrument', str)
+
+ return str
+
+ conversions.append ((1,0,19), conv,
+ 'fontsize -> fontSize, midi_instrument -> midiInstrument, SkipBars -> skipBars')
+
+
+if 1:
+ def conv(str):
+ str = re.sub ('tieydirection','tieVerticalDirection', str)
+ str = re.sub ('slurydirection','slurVerticalDirection', str)
+ str = re.sub ('ydirection','verticalDirection', str)
+
+ return str
+
+ conversions.append ((1,0,20), conv,
+ '{,tie,slur}ydirection -> {v,tieV,slurV}erticalDirection')
+
+
+if 1:
+ def conv(str):
+ str = re.sub ('hshift','horizontalNoteShift', str)
+
+ return str
+
+ conversions.append ((1,0,21), conv,
+ 'hshift -> horizontalNoteShift')
+
+
+if 1:
+ def conv(str):
+ str = re.sub ('\\\\grouping[^;]*;','', str)
+
+ return str
+
+ conversions.append ((1,1,52), conv,
+ 'deprecate \\grouping')
+
+
+if 1:
+ def conv(str):
+ str = re.sub ('\\\\wheel','\\\\coda', str)
+
+ return str
+
+ conversions.append ((1,1,55), conv,
+ '\\wheel -> \\coda')
+
+if 1:
+ def conv(str):
+ str = re.sub ('keyoctaviation','keyOctaviation', str)
+ str = re.sub ('slurdash','slurDash', str)
+
+ return str
+
+ conversions.append ((1,1,65), conv,
+ 'slurdash -> slurDash, keyoctaviation -> keyOctaviation')
+
+if 1:
+ def conv(str):
+ str = re.sub ('\\\\repeat *\"?semi\"?','\\\\repeat "volta"', str)
+
+ return str
+
+ conversions.append ((1,1,66), conv,
+ 'semi -> volta')
+
+
+if 1:
+ def conv(str):
+ str = re.sub ('\"?beamAuto\"? *= *\"?0?\"?','noAutoBeaming = "1"', str)
+
+ return str
+
+ conversions.append ((1,1,67), conv,
+ 'beamAuto -> noAutoBeaming')
+
+if 1:
+ def conv(str):
+ str = re.sub ('automaticMelismas', 'automaticMelismata', str)
+
+ return str
+
+ conversions.append ((1,2,0), conv,
+ 'automaticMelismas -> automaticMelismata')
+
+if 1:
+ def conv(str):
+ str = re.sub ('dynamicDir\\b', 'dynamicDirection', str)
+
+ return str
+
+ conversions.append ((1,2,1), conv,
+ 'dynamicDir -> dynamicDirection')
+
+if 1:
+ def conv(str):
+ str = re.sub ('\\\\cadenza *0 *;', '\\\\cadenzaOff', str)
+ str = re.sub ('\\\\cadenza *1 *;', '\\\\cadenzaOn', str)
+
+ return str
+
+ conversions.append ((1,3,4), conv,
+ '\\cadenza -> \cadenza{On|Off}')
+
+if 1:
+ def conv (str):
+ str = re.sub ('beamAuto([^=]+)= *"([0-9]+)/([0-9]+)" *;',
+ 'beamAuto\\1 = #(make-moment \\2 \\3)',
+ str)
+ return str
+
+ conversions.append ((1,3,5), conv, 'beamAuto moment properties')
+
+if 1:
+ def conv (str):
+ str = re.sub ('stemStyle',
+ 'flagStyle',
+ str)
+ return str
+
+ conversions.append ((1,3,17), conv, 'stemStyle -> flagStyle')
+
+if 1:
+ def conv (str):
+ str = re.sub ('staffLineLeading',
+ 'staffSpace',
+ str)
+ return str
+
+ conversions.append ((1,3,18), conv, 'staffLineLeading -> staffSpace')
+
+if 1:
+ def conv (str):
+ str = re.sub ('textEmptyDimension *= *##t',
+ 'textNonEmpty = ##f',
+ str)
+ str = re.sub ('textEmptyDimension *= *##f',
+ 'textNonEmpty = ##t',
+ str)
+ return str
+
+ conversions.append ((1,3,35), conv, 'textEmptyDimension -> textNonEmpty')
+
+if 1:
+ def conv (str):
+ str = re.sub ("([a-z]+)[ \t]*=[ \t]*\\\\musicalpitch *{([- 0-9]+)} *\n",
+ "(\\1 . (\\2))\n", str)
+ str = re.sub ("\\\\musicalpitch *{([0-9 -]+)}",
+ "\\\\musicalpitch #'(\\1)", str)
+ if re.search ('\\\\notenames',str):
+ sys.stderr.write ('\nNot smart enough to convert to new \\notenames format')
+ return str
+
+ conversions.append ((1,3,38), conv, '\musicalpitch { a b c } -> #\'(a b c)')
+
+if 1:
+ def conv (str):
+ def replace (match):
+ return '\\key %s;' % string.lower (match.group (1))
+
+ str = re.sub ("\\\\key ([^;]+);", replace, str)
+ return str
+
+ conversions.append ((1,3,39), conv, '\\key A ; ->\\key a;')
+
+if 1:
+ def conv (str):
+ if re.search ('\\[:',str):
+ sys.stderr.write ('\nNot smart enough to convert to new tremolo format')
+ return str
+
+ conversions.append ((1,3,41), conv,
+ '[:16 c4 d4 ] -> \\repeat "tremolo" 2 { c16 d16 }')
+
+if 1:
+ def conv (str):
+ str = re.sub ('Staff_margin_engraver' , 'Instrument_name_engraver', str)
+ return str
+
+ conversions.append ((1,3,42), conv,
+ 'Staff_margin_engraver deprecated, use Instrument_name_engraver')
+
+if 1:
+ def conv (str):
+ str = re.sub ('note[hH]eadStyle\\s*=\\s*"?(\\w+)"?' , "noteHeadStyle = #'\\1", str)
+ return str
+
+ conversions.append ((1,3,49), conv,
+ 'noteHeadStyle value: string -> symbol')
+
+if 1:
+ def conv (str):
+ str = re.sub (r"""\\key *([a-z]+) *;""", r"""\\key \1 \major;""",str);
+ return str
+ conversions.append ((1,3,59), conv,
+ '\key X ; -> \key X major; ')
+
+if 1:
+ def conv (str):
+ str = re.sub (r'latexheaders *= *"\\\\input ',
+ 'latexheaders = "',
+ str)
+ return str
+ conversions.append ((1,3,68), conv, 'latexheaders = "\\input global" -> latexheaders = "global"')
+
+
+
+################ TODO: lots of other syntax change should be done here as well
+
+
+
+if 1:
+ def conv (str):
+ str = re.sub ('basicCollisionProperties', 'NoteCollision', str)
+ str = re.sub ('basicVoltaSpannerProperties' , "VoltaBracket", str)
+ str = re.sub ('basicKeyProperties' , "KeySignature", str)
+
+ str = re.sub ('basicClefItemProperties' ,"Clef", str)
+
+
+ str = re.sub ('basicLocalKeyProperties' ,"Accidentals", str)
+ str = re.sub ('basicMarkProperties' ,"Accidentals", str)
+ str = re.sub ('basic([A-Za-z_]+)Properties', '\\1', str)
+ return str
+
+ conversions.append ((1,3,92), conv, 'basicXXXProperties -> XXX')
+
+if 1:
+ def conv (str):
+ str = re.sub ('\\\\stemup', '\\\\stemUp', str)
+ str = re.sub ('\\\\stemdown', '\\\\stemDown', str)
+ str = re.sub ('\\\\stemboth', '\\\\stemBoth', str)
+ str = re.sub ('\\\\slurup', '\\\\slurUp', str)
+ str = re.sub ('\\\\slurboth', '\\\\slurBoth', str)
+ str = re.sub ('\\\\slurdown', '\\\\slurDown', str)
+ str = re.sub ('\\\\slurdotted', '\\\\slurDotted', str)
+ str = re.sub ('\\\\slurnormal', '\\\\slurNoDots', str)
+
+ str = re.sub ('\\\\shiftoff', '\\\\shiftOff', str)
+ str = re.sub ('\\\\shifton', '\\\\shiftOn', str)
+ str = re.sub ('\\\\shiftonn', '\\\\shiftOnn', str)
+ str = re.sub ('\\\\shiftonnn', '\\\\shiftOnnn', str)
+
+ str = re.sub ('\\\\onevoice', '\\\\oneVoice', str)
+ str = re.sub ('\\\\voiceone', '\\\\voiceOne', str)
+ str = re.sub ('\\\\voicetwo', '\\\\voiceTwo', str)
+ str = re.sub ('\\\\voicethree', '\\\\voiceThree', str)
+ str = re.sub ('\\\\voicefour', '\\\\voiceFour', str)
+
+ return str
+
+ conversions.append ((1,3,93), conv,
+ 'property definiton case (eg. onevoice -> oneVoice)')
+
+
+if 1:
+ def conv (str):
+ str = re.sub ('ChordNames*', 'ChordNames', str)
+ if re.search ('\\\\textscript "[^"]* *"[^"]*"', str):
+ sys.stderr.write ('\nNot smart enough to convert to new \\textscript markup text')
+
+ str = re.sub ('\\textscript +("[^"]*")', '\\textscript #\\1', str)
+
+ return str
+
+ conversions.append ((1,3,97), conv, 'ChordName -> ChordNames')
+
+if 1:
+ def conv (str):
+ str = re.sub ('beamAutoEnd_([0-9]*) *= *(#\\([^)]*\\))', 'autoBeamSettings \\push #\'(end 1 \\1 * *) = \\2', str)
+ str = re.sub ('beamAutoBegin_([0-9]*) *= *(#\\([^)]*\))', 'autoBeamSettings \\push #\'(begin 1 \\1 * *) = \\2', str)
+ str = re.sub ('beamAutoEnd *= *(#\\([^)]*\\))', 'autoBeamSettings \\push #\'(end * * * *) = \\1', str)
+ str = re.sub ('beamAutoBegin *= *(#\\([^)]*\\))', 'autoBeamSettings \\push #\'(begin * * * *) = \\1', str)
+
+
+ return str
+
+ conversions.append ((1,3,102), conv, 'beamAutoEnd -> autoBeamSettings \\push (end * * * *)')
+
+############################
+
+
+def get_conversions (from_version, to_version):
+ def version_b (v, f = from_version, t = to_version):
+ return version_cmp (v[0], f) > 0 and version_cmp (v[0], t) <= 0
+ return filter (version_b, conversions)
+
+
+def latest_version ():
+ return conversions[-1][0]
+
+def do_conversion (infile, from_version, outfile, to_version):
+ conv_list = get_conversions (from_version, to_version)
+
+ sys.stderr.write ('Applying conversions: ')
+ str = infile.read ()
+ last_conversion = ()
+ try:
+ for x in conv_list:
+ sys.stderr.write (tup_to_str (x[0]) + ', ')
+ str = x[1] (str)
+ last_conversion = x[0]
+
+ except FatalConversionError:
+ sys.stderr.write ('Error while converting; I won\'t convert any further')
+
+ if last_conversion:
+ sys.stderr.write ('\n')
+ new_ver = '\\\\version \"%s\"' % tup_to_str (last_conversion)
+ if re.search (lilypond_version_re_str, str):
+ str = re.sub (lilypond_version_re_str,new_ver , str)
+ else:
+ str = new_ver + '\n' + str
+
+ outfile.write(str)
+
+ return last_conversion
+
+class UnknownVersion:
+ pass
+
+def do_one_file (infile_name):
+ sys.stderr.write ('Processing `%s\' ... '% infile_name)
+ outfile_name = ''
+ if __main__.edit:
+ outfile_name = infile_name + '.NEW'
+ elif __main__.outfile_name:
+ outfile_name = __main__.outfile_name
+
+ if __main__.from_version:
+ from_version = __main__.from_version
+ else:
+ guess = guess_lilypond_version (infile_name)
+ if not guess:
+ raise UnknownVersion()
+ from_version = str_to_tuple (guess)
+
+ if __main__.to_version:
+ to_version = __main__.to_version
+ else:
+ to_version = latest_version ()
+
+
+ if infile_name:
+ infile = open (infile_name,'r')
+ else:
+ infile = sys.stdin
+
+ if outfile_name:
+ outfile = open (outfile_name, 'w')
+ else:
+ outfile = sys.stdout
+
+ touched = do_conversion (infile, from_version, outfile, to_version)
+
+ if infile_name:
+ infile.close ()
+
+ if outfile_name:
+ outfile.close ()
+
+ if __main__.edit and touched:
+ try:
+ os.remove(infile_name + '~')
+ except:
+ pass
+ os.rename (infile_name, infile_name + '~')
+ os.rename (infile_name + '.NEW', infile_name)
+
+ sys.stderr.write ('\n')
+ sys.stderr.flush ()
+
+edit = 0
+to_version = ()
+from_version = ()
+outfile_name = ''
+
+(options, files) = getopt.getopt (
+ sys.argv[1:], 'o:f:t:seh', ['version', 'output', 'show-rules', 'help', 'edit', 'from=', 'to'])
+
+for opt in options:
+ o = opt[0]
+ a = opt[1]
+ if o== '--help' or o == '-h':
+ usage ()
+ sys.exit (0)
+ if o == '--version' or o == '-v':
+ print_version ()
+ sys.exit (0)
+ elif o== '--from' or o=='-f':
+ from_version = str_to_tuple (a)
+ elif o== '--to' or o=='-t':
+ to_version = str_to_tuple (a)
+ elif o== '--edit' or o == '-e':
+ edit = 1
+ elif o== '--show-rules' or o == '-s':
+ show_rules (sys.stdout)
+ sys.exit(0)
+ elif o == '--output' or o == '-o':
+ outfile_name = a
+ else:
+ print o
+ raise getopt.error
+
+identify ()
+for f in files:
+ if f == '-':
+ f = ''
+ try:
+ do_one_file (f)
+ except UnknownVersion:
+ pass
+++ /dev/null
-#!@PYTHON@
-
-# convert-mudela.py -- convertor for mudela versions
-#
-# source file of the GNU LilyPond music typesetter
-#
-# (c) 1998
-
-# TODO
-# use -f and -t for -s output
-
-# NEWS
-# 0.2
-# - rewrite in python
-
-program_name = 'convert-mudela'
-version = '@TOPLEVEL_VERSION@'
-
-import os
-import sys
-import __main__
-import getopt
-import string
-import re
-import time
-
-mudela_version_re_str = '\\\\version *\"(.*)\"'
-mudela_version_re = re.compile(mudela_version_re_str)
-
-def program_id ():
- return '%s (GNU LilyPond) %s' %(program_name, version);
-
-def identify ():
- sys.stderr.write (program_id () + '\n')
-
-def usage ():
- sys.stdout.write (
- r"""Usage: %s [OPTION]... [FILE]...
-Try to convert to newer mudela-versions. The version number of the
-input is guessed by default from \version directive
-
-Options:
- -h, --help print this help
- -e, --edit in place edit
- -f, --from=VERSION start from version
- -s, --show-rules print all rules.
- -t, --to=VERSION target version
- --version print program version
-
-Report bugs to bugs-gnu-music@gnu.org
-
-""" % program_name)
-
-
- sys.exit (0)
-
-def print_version ():
-
- sys.stdout.write (r"""%s
-
-This is free software. It is covered by the GNU General Public
-License, and you are welcome to change it and/or distribute copies of
-it under certain conditions. invoke as `%s --warranty' for more
-information.
-
-""" % (program_id() , program_name))
-
-def gulp_file(f):
- try:
- i = open(f)
- i.seek (0, 2)
- n = i.tell ()
- i.seek (0,0)
- except:
- print 'can\'t open file: ' + f + '\n'
- return ''
- s = i.read (n)
- if len (s) <= 0:
- print 'gulped empty file: ' + f + '\n'
- i.close ()
- return s
-
-def str_to_tuple (s):
- return tuple (map (string.atoi, string.split (s,'.')))
-
-def tup_to_str (t):
- return string.join (map (lambda x: '%s' % x, list (t)), '.')
-
-def version_cmp (t1, t2):
- for x in [0,1,2]:
- if t1[x] - t2[x]:
- return t1[x] - t2[x]
- return 0
-
-def guess_mudela_version(filename):
- s = gulp_file (filename)
- m = mudela_version_re.search (s)
- if m:
- return m.group(1)
- else:
- return ''
-
-class FatalConversionError:
- pass
-
-conversions = []
-
-def show_rules (file):
- for x in conversions:
- file.write ('%s: %s\n' % (tup_to_str (x[0]), x[2]))
-
-############################
-
-if 1: # need new a namespace
- def conv (str):
- if re.search ('\\\\octave', str):
- sys.stderr.write ('\nNot smart enough to convert \\octave')
- raise FatalConversionError()
-
- return str
-
- conversions.append (
- ((0,1,19), conv, 'deprecated \\octave; can\'t convert automatically'))
-
-
-if 1: # need new a namespace
- def conv (str):
- str = re.sub ('\\\\textstyle([^;]+);',
- '\\\\property Lyrics . textstyle = \\1', str)
- str = re.sub ('\\\\key([^;]+);', '\\\\accidentals \\1;', str)
-
- return str
-
- conversions.append (
- ((0,1,20), conv, 'deprecated \\textstyle, new \key syntax'))
-
-
-if 1:
- def conv (str):
- str = re.sub ('\\\\musical_pitch', '\\\\musicalpitch',str)
- str = re.sub ('\\\\meter', '\\\\time',str)
-
- return str
-
- conversions.append (
- ((0,1,21), conv, '\\musical_pitch -> \\musicalpitch, '+
- '\\meter -> \\time'))
-
-if 1:
- def conv (str):
- return str
-
- conversions.append (
- ((1,0,0), conv, '0.1.21 -> 1.0.0 '))
-
-
-if 1:
- def conv (str):
- str = re.sub ('\\\\accidentals', '\\\\keysignature',str)
- str = re.sub ('specialaccidentals *= *1', 'keyoctaviation = 0',str)
- str = re.sub ('specialaccidentals *= *0', 'keyoctaviation = 1',str)
-
- return str
-
- conversions.append (
- ((1,0,1), conv, '\\accidentals -> \\keysignature, ' +
- 'specialaccidentals -> keyoctaviation'))
-
-if 1:
- def conv(str):
- if re.search ('\\\\header', str):
- sys.stderr.write ('\nNot smart enough to convert to new \\header format')
- return str
-
- conversions.append ((1,0,2), conv, '\\header { key = concat + with + operator }')
-
-if 1:
- def conv(str):
- str = re.sub ('\\\\melodic', '\\\\notes',str)
-
- return str
-
- conversions.append ((1,0,3), conv, '\\melodic -> \\notes')
-
-if 1:
- def conv(str):
- str = re.sub ('default_paper *=', '',str)
- str = re.sub ('default_midi *=', '',x)
-
- return str
-
- conversions.append ((1,0,4), conv, 'default_{paper,midi}')
-
-if 1:
- def conv(str):
- str = re.sub ('ChoireStaff', 'ChoirStaff',str)
- str = re.sub ('\\output', 'output = ',str)
-
- return str
-
- conversions.append ((1,0,5), conv, 'ChoireStaff -> ChoirStaff')
-
-if 1:
- def conv(str):
- if re.search ('[a-zA-Z]+ = *\\translator',str):
- sys.stderr.write ('\nNot smart enough to change \\translator syntax')
- raise FatalConversionError()
- return str
-
- conversions.append ((1,0,6), conv, 'foo = \\translator {\\type .. } ->\\translator {\\type ..; foo; }')
-
-
-if 1:
- def conv(str):
- str = re.sub ('\\\\lyric', '\\\\lyrics',str)
-
- return str
-
- conversions.append ((1,0,7), conv, '\\lyric -> \\lyrics')
-
-if 1:
- def conv(str):
- str = re.sub ('\\\\\\[/3+', '\\\\times 2/3 { ',str)
- str = re.sub ('\\[/3+', '\\\\times 2/3 { [',str)
- str = re.sub ('\\\\\\[([0-9/]+)', '\\\\times \\1 {',str)
- str = re.sub ('\\[([0-9/]+)', '\\\\times \\1 { [',str)
- str = re.sub ('\\\\\\]([0-9/]+)', '}', str)
- str = re.sub ('\\\\\\]', '}',str)
- str = re.sub ('\\]([0-9/]+)', '] }', str)
- return str
-
- conversions.append ((1,0,10), conv, '[2/3 ]1/1 -> \\times 2/3 ')
-
-if 1:
- def conv(str):
- return str
- conversions.append ((1,0,12), conv, 'Chord syntax stuff')
-
-
-if 1:
- def conv(str):
-
-
- str = re.sub ('<([^>~]+)~([^>]*)>','<\\1 \\2> ~', str)
-
- return str
-
- conversions.append ((1,0,13), conv, '<a ~ b> c -> <a b> ~ c')
-
-if 1:
- def conv(str):
- str = re.sub ('<\\[','[<', str)
- str = re.sub ('\\]>','>]', str)
-
- return str
-
- conversions.append ((1,0,14), conv, '<[a b> <a b]>c -> [<a b> <a b>]')
-
-
-if 1:
- def conv(str):
- str = re.sub ('\\\\type','\\\\context', str)
- str = re.sub ('textstyle','textStyle', str)
-
- return str
-
- conversions.append ((1,0,16), conv, '\\type -> \\context, textstyle -> textStyle')
-
-
-if 1:
- def conv(str):
- if re.search ('\\\\repeat',str):
- sys.stderr.write ('\nNot smart enough to convert \\repeat')
- raise FatalConversionError()
- return str
-
- conversions.append ((1,0,18), conv,
- '\\repeat NUM Music Alternative -> \\repeat FOLDSTR Music Alternative')
-
-if 1:
- def conv(str):
- str = re.sub ('SkipBars','skipBars', str)
- str = re.sub ('fontsize','fontSize', str)
- str = re.sub ('midi_instrument','midiInstrument', str)
-
- return str
-
- conversions.append ((1,0,19), conv,
- 'fontsize -> fontSize, midi_instrument -> midiInstrument, SkipBars -> skipBars')
-
-
-if 1:
- def conv(str):
- str = re.sub ('tieydirection','tieVerticalDirection', str)
- str = re.sub ('slurydirection','slurVerticalDirection', str)
- str = re.sub ('ydirection','verticalDirection', str)
-
- return str
-
- conversions.append ((1,0,20), conv,
- '{,tie,slur}ydirection -> {v,tieV,slurV}erticalDirection')
-
-
-if 1:
- def conv(str):
- str = re.sub ('hshift','horizontalNoteShift', str)
-
- return str
-
- conversions.append ((1,0,21), conv,
- 'hshift -> horizontalNoteShift')
-
-
-if 1:
- def conv(str):
- str = re.sub ('\\\\grouping[^;]*;','', str)
-
- return str
-
- conversions.append ((1,1,52), conv,
- 'deprecate \\grouping')
-
-
-if 1:
- def conv(str):
- str = re.sub ('\\\\wheel','\\\\coda', str)
-
- return str
-
- conversions.append ((1,1,55), conv,
- '\\wheel -> \\coda')
-
-if 1:
- def conv(str):
- str = re.sub ('keyoctaviation','keyOctaviation', str)
- str = re.sub ('slurdash','slurDash', str)
-
- return str
-
- conversions.append ((1,1,65), conv,
- 'slurdash -> slurDash, keyoctaviation -> keyOctaviation')
-
-if 1:
- def conv(str):
- str = re.sub ('\\\\repeat *\"?semi\"?','\\\\repeat "volta"', str)
-
- return str
-
- conversions.append ((1,1,66), conv,
- 'semi -> volta')
-
-
-if 1:
- def conv(str):
- str = re.sub ('\"?beamAuto\"? *= *\"?0?\"?','noAutoBeaming = "1"', str)
-
- return str
-
- conversions.append ((1,1,67), conv,
- 'beamAuto -> noAutoBeaming')
-
-if 1:
- def conv(str):
- str = re.sub ('automaticMelismas', 'automaticMelismata', str)
-
- return str
-
- conversions.append ((1,2,0), conv,
- 'automaticMelismas -> automaticMelismata')
-
-if 1:
- def conv(str):
- str = re.sub ('dynamicDir\\b', 'dynamicDirection', str)
-
- return str
-
- conversions.append ((1,2,1), conv,
- 'dynamicDir -> dynamicDirection')
-
-if 1:
- def conv(str):
- str = re.sub ('\\\\cadenza *0 *;', '\\\\cadenzaOff', str)
- str = re.sub ('\\\\cadenza *1 *;', '\\\\cadenzaOn', str)
-
- return str
-
- conversions.append ((1,3,4), conv,
- '\\cadenza -> \cadenza{On|Off}')
-
-if 1:
- def conv (str):
- str = re.sub ('beamAuto([^=]+)= *"([0-9]+)/([0-9]+)" *;',
- 'beamAuto\\1 = #(make-moment \\2 \\3)',
- str)
- return str
-
- conversions.append ((1,3,5), conv, 'beamAuto moment properties')
-
-if 1:
- def conv (str):
- str = re.sub ('stemStyle',
- 'flagStyle',
- str)
- return str
-
- conversions.append ((1,3,17), conv, 'stemStyle -> flagStyle')
-
-if 1:
- def conv (str):
- str = re.sub ('staffLineLeading',
- 'staffSpace',
- str)
- return str
-
- conversions.append ((1,3,18), conv, 'staffLineLeading -> staffSpace')
-
-if 1:
- def conv (str):
- str = re.sub ('textEmptyDimension *= *##t',
- 'textNonEmpty = ##f',
- str)
- str = re.sub ('textEmptyDimension *= *##f',
- 'textNonEmpty = ##t',
- str)
- return str
-
- conversions.append ((1,3,35), conv, 'textEmptyDimension -> textNonEmpty')
-
-if 1:
- def conv (str):
- str = re.sub ("([a-z]+)[ \t]*=[ \t]*\\\\musicalpitch *{([- 0-9]+)} *\n",
- "(\\1 . (\\2))\n", str)
- str = re.sub ("\\\\musicalpitch *{([0-9 -]+)}",
- "\\\\musicalpitch #'(\\1)", str)
- if re.search ('\\\\notenames',str):
- sys.stderr.write ('\nNot smart enough to convert to new \\notenames format')
- return str
-
- conversions.append ((1,3,38), conv, '\musicalpitch { a b c } -> #\'(a b c)')
-
-if 1:
- def conv (str):
- def replace (match):
- return '\\key %s;' % string.lower (match.group (1))
-
- str = re.sub ("\\\\key ([^;]+);", replace, str)
- return str
-
- conversions.append ((1,3,39), conv, '\\key A ; ->\\key a;')
-
-if 1:
- def conv (str):
- if re.search ('\\[:',str):
- sys.stderr.write ('\nNot smart enough to convert to new tremolo format')
- return str
-
- conversions.append ((1,3,41), conv,
- '[:16 c4 d4 ] -> \\repeat "tremolo" 2 { c16 d16 }')
-
-if 1:
- def conv (str):
- str = re.sub ('Staff_margin_engraver' , 'Instrument_name_engraver', str)
- return str
-
- conversions.append ((1,3,42), conv,
- 'Staff_margin_engraver deprecated, use Instrument_name_engraver')
-
-if 1:
- def conv (str):
- str = re.sub ('note[hH]eadStyle\\s*=\\s*"?(\\w+)"?' , "noteHeadStyle = #'\\1", str)
- return str
-
- conversions.append ((1,3,49), conv,
- 'noteHeadStyle value: string -> symbol')
-
-if 1:
- def conv (str):
- str = re.sub (r"""\\key *([a-z]+) *;""", r"""\\key \1 \major;""",str);
- return str
- conversions.append ((1,3,59), conv,
- '\key X ; -> \key X major; ')
-
-if 1:
- def conv (str):
- str = re.sub (r'latexheaders *= *"\\\\input ',
- 'latexheaders = "',
- str)
- return str
- conversions.append ((1,3,68), conv, 'latexheaders = "\\input global" -> latexheaders = "global"')
-
-
-
-################ TODO: lots of other syntax change should be done here as well
-
-
-
-if 1:
- def conv (str):
- str = re.sub ('basicCollisionProperties', 'NoteCollision', str)
- str = re.sub ('basicVoltaSpannerProperties' , "VoltaBracket", str)
- str = re.sub ('basicKeyProperties' , "KeySignature", str)
-
- str = re.sub ('basicClefItemProperties' ,"Clef", str)
-
-
- str = re.sub ('basicLocalKeyProperties' ,"Accidentals", str)
- str = re.sub ('basicMarkProperties' ,"Accidentals", str)
- str = re.sub ('basic([A-Za-z_]+)Properties', '\\1', str)
- return str
-
- conversions.append ((1,3,92), conv, 'basicXXXProperties -> XXX')
-
-if 1:
- def conv (str):
- str = re.sub ('\\\\stemup', '\\\\stemUp', str)
- str = re.sub ('\\\\stemdown', '\\\\stemDown', str)
- str = re.sub ('\\\\stemboth', '\\\\stemBoth', str)
- str = re.sub ('\\\\slurup', '\\\\slurUp', str)
- str = re.sub ('\\\\slurboth', '\\\\slurBoth', str)
- str = re.sub ('\\\\slurdown', '\\\\slurDown', str)
- str = re.sub ('\\\\slurdotted', '\\\\slurDotted', str)
- str = re.sub ('\\\\slurnormal', '\\\\slurNoDots', str)
-
- str = re.sub ('\\\\shiftoff', '\\\\shiftOff', str)
- str = re.sub ('\\\\shifton', '\\\\shiftOn', str)
- str = re.sub ('\\\\shiftonn', '\\\\shiftOnn', str)
- str = re.sub ('\\\\shiftonnn', '\\\\shiftOnnn', str)
-
- str = re.sub ('\\\\onevoice', '\\\\oneVoice', str)
- str = re.sub ('\\\\voiceone', '\\\\voiceOne', str)
- str = re.sub ('\\\\voicetwo', '\\\\voiceTwo', str)
- str = re.sub ('\\\\voicethree', '\\\\voiceThree', str)
- str = re.sub ('\\\\voicefour', '\\\\voiceFour', str)
-
- return str
-
- conversions.append ((1,3,93), conv,
- 'property definiton case (eg. onevoice -> oneVoice)')
-
-
-if 1:
- def conv (str):
- str = re.sub ('ChordNames*', 'ChordNames', str)
- if re.search ('\\\\textscript "[^"]* *"[^"]*"', str):
- sys.stderr.write ('\nNot smart enough to convert to new \\textscript markup text')
-
- str = re.sub ('\\textscript +("[^"]*")', '\\textscript #\\1', str)
-
- return str
-
- conversions.append ((1,3,97), conv, 'ChordName -> ChordNames')
-
-if 1:
- def conv (str):
- str = re.sub ('beamAutoEnd_([0-9]*) *= *(#\\([^)]*\\))', 'autoBeamSettings \\push #\'(end 1 \\1 * *) = \\2', str)
- str = re.sub ('beamAutoBegin_([0-9]*) *= *(#\\([^)]*\))', 'autoBeamSettings \\push #\'(begin 1 \\1 * *) = \\2', str)
- str = re.sub ('beamAutoEnd *= *(#\\([^)]*\\))', 'autoBeamSettings \\push #\'(end * * * *) = \\1', str)
- str = re.sub ('beamAutoBegin *= *(#\\([^)]*\\))', 'autoBeamSettings \\push #\'(begin * * * *) = \\1', str)
-
-
- return str
-
- conversions.append ((1,3,102), conv, 'beamAutoEnd -> autoBeamSettings \\push (end * * * *)')
-
-############################
-
-
-def get_conversions (from_version, to_version):
- def version_b (v, f = from_version, t = to_version):
- return version_cmp (v[0], f) > 0 and version_cmp (v[0], t) <= 0
- return filter (version_b, conversions)
-
-
-def latest_version ():
- return conversions[-1][0]
-
-def do_conversion (infile, from_version, outfile, to_version):
- conv_list = get_conversions (from_version, to_version)
-
- sys.stderr.write ('Applying conversions: ')
- str = infile.read ()
- last_conversion = ()
- try:
- for x in conv_list:
- sys.stderr.write (tup_to_str (x[0]) + ', ')
- str = x[1] (str)
- last_conversion = x[0]
-
- except FatalConversionError:
- sys.stderr.write ('Error while converting; I won\'t convert any further')
-
- if last_conversion:
- sys.stderr.write ('\n')
- new_ver = '\\\\version \"%s\"' % tup_to_str (last_conversion)
- if re.search (mudela_version_re_str, str):
- str = re.sub (mudela_version_re_str,new_ver , str)
- else:
- str = new_ver + '\n' + str
-
- outfile.write(str)
-
- return last_conversion
-
-class UnknownVersion:
- pass
-
-def do_one_file (infile_name):
- sys.stderr.write ('Processing `%s\' ... '% infile_name)
- outfile_name = ''
- if __main__.edit:
- outfile_name = infile_name + '.NEW'
- elif __main__.outfile_name:
- outfile_name = __main__.outfile_name
-
- if __main__.from_version:
- from_version = __main__.from_version
- else:
- guess = guess_mudela_version (infile_name)
- if not guess:
- raise UnknownVersion()
- from_version = str_to_tuple (guess)
-
- if __main__.to_version:
- to_version = __main__.to_version
- else:
- to_version = latest_version ()
-
-
- if infile_name:
- infile = open (infile_name,'r')
- else:
- infile = sys.stdin
-
- if outfile_name:
- outfile = open (outfile_name, 'w')
- else:
- outfile = sys.stdout
-
- touched = do_conversion (infile, from_version, outfile, to_version)
-
- if infile_name:
- infile.close ()
-
- if outfile_name:
- outfile.close ()
-
- if __main__.edit and touched:
- try:
- os.remove(infile_name + '~')
- except:
- pass
- os.rename (infile_name, infile_name + '~')
- os.rename (infile_name + '.NEW', infile_name)
-
- sys.stderr.write ('\n')
- sys.stderr.flush ()
-
-edit = 0
-to_version = ()
-from_version = ()
-outfile_name = ''
-
-(options, files) = getopt.getopt (
- sys.argv[1:], 'o:f:t:seh', ['version', 'output', 'show-rules', 'help', 'edit', 'from=', 'to'])
-
-for opt in options:
- o = opt[0]
- a = opt[1]
- if o== '--help' or o == '-h':
- usage ()
- sys.exit (0)
- if o == '--version' or o == '-v':
- print_version ()
- sys.exit (0)
- elif o== '--from' or o=='-f':
- from_version = str_to_tuple (a)
- elif o== '--to' or o=='-t':
- to_version = str_to_tuple (a)
- elif o== '--edit' or o == '-e':
- edit = 1
- elif o== '--show-rules' or o == '-s':
- show_rules (sys.stdout)
- sys.exit(0)
- elif o == '--output' or o == '-o':
- outfile_name = a
- else:
- print o
- raise getopt.error
-
-identify ()
-for f in files:
- if f == '-':
- f = ''
- try:
- do_one_file (f)
- except UnknownVersion:
- pass
--- /dev/null
+#!@PYTHON@
+# vim: set noexpandtab:
+# TODO:
+# * Figure out clean set of options. Hmm, isn't it pretty ok now?
+# * add support for .lilyrc
+# * EndLilyPondOutput is def'd as vfil. Causes large white gaps.
+
+# todo: dimension handling (all the x2y) is clumsy.
+
+# This is was the idea for handling of comments:
+# Multiline comments, @ignore .. @end ignore is scanned for
+# in read_doc_file, and the chunks are marked as 'ignore', so
+# lilypond-book will not touch them any more. The content of the
+# chunks are written to the output file. Also 'include' and 'input'
+# regex has to check if they are commented out.
+#
+# Then it is scanned for 'lilypond', 'lilypond-file' and 'lilypond-block'.
+# These three regex's has to check if they are on a commented line,
+# % for latex, @c for texinfo.
+#
+# Then lines that are commented out with % (latex) and @c (Texinfo)
+# are put into chunks marked 'ignore'. This cannot be done before
+# searching for the lilypond-blocks because % is also the comment character
+# for lilypond.
+#
+# The the rest of the rexeces are searched for. They don't have to test
+# if they are on a commented out line.
+
+import os
+import stat
+import string
+import re
+import getopt
+import sys
+import __main__
+import operator
+
+
+program_version = '@TOPLEVEL_VERSION@'
+if program_version == '@' + 'TOPLEVEL_VERSION' + '@':
+ program_version = '1.3.106'
+
+include_path = [os.getcwd()]
+
+
+# g_ is for global (?)
+
+g_here_dir = os.getcwd ()
+g_dep_prefix = ''
+g_outdir = ''
+g_force_lilypond_fontsize = 0
+g_read_lys = 0
+g_do_pictures = 1
+g_num_cols = 1
+format = ''
+g_run_lilypond = 1
+no_match = 'a\ba'
+
+default_music_fontsize = 16
+default_text_fontsize = 12
+
+
+class LatexPaper:
+ def __init__(self):
+ self.m_paperdef = {
+ # the dimentions are from geometry.sty
+ 'a0paper': (mm2pt(841), mm2pt(1189)),
+ 'a1paper': (mm2pt(595), mm2pt(841)),
+ 'a2paper': (mm2pt(420), mm2pt(595)),
+ 'a3paper': (mm2pt(297), mm2pt(420)),
+ 'a4paper': (mm2pt(210), mm2pt(297)),
+ 'a5paper': (mm2pt(149), mm2pt(210)),
+ 'b0paper': (mm2pt(1000), mm2pt(1414)),
+ 'b1paper': (mm2pt(707), mm2pt(1000)),
+ 'b2paper': (mm2pt(500), mm2pt(707)),
+ 'b3paper': (mm2pt(353), mm2pt(500)),
+ 'b4paper': (mm2pt(250), mm2pt(353)),
+ 'b5paper': (mm2pt(176), mm2pt(250)),
+ 'letterpaper': (in2pt(8.5), in2pt(11)),
+ 'legalpaper': (in2pt(8.5), in2pt(14)),
+ 'executivepaper': (in2pt(7.25), in2pt(10.5))}
+ self.m_use_geometry = None
+ self.m_papersize = 'letterpaper'
+ self.m_fontsize = 10
+ self.m_num_cols = 1
+ self.m_landscape = 0
+ self.m_geo_landscape = 0
+ self.m_geo_width = None
+ self.m_geo_textwidth = None
+ self.m_geo_lmargin = None
+ self.m_geo_rmargin = None
+ self.m_geo_includemp = None
+ self.m_geo_marginparwidth = {10: 57, 11: 50, 12: 35}
+ self.m_geo_marginparsep = {10: 11, 11: 10, 12: 10}
+ self.m_geo_x_marginparwidth = None
+ self.m_geo_x_marginparsep = None
+ self.__body = None
+ def set_geo_option(self, name, value):
+ if name == 'body' or name == 'text':
+ if type(value) == type(""):
+ self._set_dimen('m_geo_textwidth', value)
+ else:
+ self._set_dimen('m_geo_textwidth', value[0])
+ self.__body = 1
+ elif name == 'portrait':
+ self.m_geo_landscape = 0
+ elif name == 'reversemp' or name == 'reversemarginpar':
+ if self.m_geo_includemp == None:
+ self.m_geo_includemp = 1
+ elif name == 'marginparwidth' or name == 'marginpar':
+ self._set_dimen('m_geo_x_marginparwidth', value)
+ self.m_geo_includemp = 1
+ elif name == 'marginparsep':
+ self._set_dimen('m_geo_x_marginparsep', value)
+ self.m_geo_includemp = 1
+ elif name == 'scale':
+ if type(value) == type(""):
+ self.m_geo_width = self.get_paperwidth() * float(value)
+ else:
+ self.m_geo_width = self.get_paperwidth() * float(value[0])
+ elif name == 'hscale':
+ self.m_geo_width = self.get_paperwidth() * float(value)
+ elif name == 'left' or name == 'lmargin':
+ self._set_dimen('m_geo_lmargin', value)
+ elif name == 'right' or name == 'rmargin':
+ self._set_dimen('m_geo_rmargin', value)
+ elif name == 'hdivide' or name == 'divide':
+ if value[0] not in ('*', ''):
+ self._set_dimen('m_geo_lmargin', value[0])
+ if value[1] not in ('*', ''):
+ self._set_dimen('m_geo_width', value[1])
+ if value[2] not in ('*', ''):
+ self._set_dimen('m_geo_rmargin', value[2])
+ elif name == 'hmargin':
+ if type(value) == type(""):
+ self._set_dimen('m_geo_lmargin', value)
+ self._set_dimen('m_geo_rmargin', value)
+ else:
+ self._set_dimen('m_geo_lmargin', value[0])
+ self._set_dimen('m_geo_rmargin', value[1])
+ elif name == 'margin':#ugh there is a bug about this option in
+ # the geometry documentation
+ if type(value) == type(""):
+ self._set_dimen('m_geo_lmargin', value)
+ self._set_dimen('m_geo_rmargin', value)
+ else:
+ self._set_dimen('m_geo_lmargin', value[0])
+ self._set_dimen('m_geo_rmargin', value[0])
+ elif name == 'total':
+ if type(value) == type(""):
+ self._set_dimen('m_geo_width', value)
+ else:
+ self._set_dimen('m_geo_width', value[0])
+ elif name == 'width' or name == 'totalwidth':
+ self._set_dimen('m_geo_width', value)
+ elif name == 'paper' or name == 'papername':
+ self.m_papersize = value
+ elif name[-5:] == 'paper':
+ self.m_papersize = name
+ else:
+ self._set_dimen('m_geo_'+name, value)
+ def _set_dimen(self, name, value):
+ if type(value) == type("") and value[-2:] == 'pt':
+ self.__dict__[name] = float(value[:-2])
+ elif type(value) == type("") and value[-2:] == 'mm':
+ self.__dict__[name] = mm2pt(float(value[:-2]))
+ elif type(value) == type("") and value[-2:] == 'cm':
+ self.__dict__[name] = 10 * mm2pt(float(value[:-2]))
+ elif type(value) == type("") and value[-2:] == 'in':
+ self.__dict__[name] = in2pt(float(value[:-2]))
+ else:
+ self.__dict__[name] = value
+ def display(self):
+ print "LatexPaper:\n-----------"
+ for v in self.__dict__.keys():
+ if v[:2] == 'm_':
+ print v, self.__dict__[v]
+ print "-----------"
+ def get_linewidth(self):
+ w = self._calc_linewidth()
+ if self.m_num_cols == 2:
+ return (w - 10) / 2
+ else:
+ return w
+ def get_paperwidth(self):
+ #if self.m_use_geometry:
+ return self.m_paperdef[self.m_papersize][self.m_landscape or self.m_geo_landscape]
+ #return self.m_paperdef[self.m_papersize][self.m_landscape]
+
+ def _calc_linewidth(self):
+ # since geometry sometimes ignores 'includemp', this is
+ # more complicated than it should be
+ mp = 0
+ if self.m_geo_includemp:
+ if self.m_geo_x_marginparsep is not None:
+ mp = mp + self.m_geo_x_marginparsep
+ else:
+ mp = mp + self.m_geo_marginparsep[self.m_fontsize]
+ if self.m_geo_x_marginparwidth is not None:
+ mp = mp + self.m_geo_x_marginparwidth
+ else:
+ mp = mp + self.m_geo_marginparwidth[self.m_fontsize]
+ if self.__body:#ugh test if this is necessary
+ mp = 0
+ def tNone(a, b, c):
+ return a == None, b == None, c == None
+ if not self.m_use_geometry:
+ return latex_linewidths[self.m_papersize][self.m_fontsize]
+ else:
+ if tNone(self.m_geo_lmargin, self.m_geo_width,
+ self.m_geo_rmargin) == (1, 1, 1):
+ if self.m_geo_textwidth:
+ return self.m_geo_textwidth
+ w = self.get_paperwidth() * 0.8
+ return w - mp
+ elif tNone(self.m_geo_lmargin, self.m_geo_width,
+ self.m_geo_rmargin) == (0, 1, 1):
+ if self.m_geo_textwidth:
+ return self.m_geo_textwidth
+ return self.f1(self.m_geo_lmargin, mp)
+ elif tNone(self.m_geo_lmargin, self.m_geo_width,
+ self.m_geo_rmargin) == (1, 1, 0):
+ if self.m_geo_textwidth:
+ return self.m_geo_textwidth
+ return self.f1(self.m_geo_rmargin, mp)
+ elif tNone(self.m_geo_lmargin, self.m_geo_width,
+ self.m_geo_rmargin) \
+ in ((0, 0, 1), (1, 0, 0), (1, 0, 1)):
+ if self.m_geo_textwidth:
+ return self.m_geo_textwidth
+ return self.m_geo_width - mp
+ elif tNone(self.m_geo_lmargin, self.m_geo_width,
+ self.m_geo_rmargin) in ((0, 1, 0), (0, 0, 0)):
+ w = self.get_paperwidth() - self.m_geo_lmargin - self.m_geo_rmargin - mp
+ if w < 0:
+ w = 0
+ return w
+ raise "Never do this!"
+ def f1(self, m, mp):
+ tmp = self.get_paperwidth() - m * 2 - mp
+ if tmp < 0:
+ tmp = 0
+ return tmp
+ def f2(self):
+ tmp = self.get_paperwidth() - self.m_geo_lmargin \
+ - self.m_geo_rmargin
+ if tmp < 0:
+ return 0
+ return tmp
+
+class TexiPaper:
+ def __init__(self):
+ self.m_papersize = 'a4'
+ self.m_fontsize = 12
+ def get_linewidth(self):
+ return texi_linewidths[self.m_papersize][self.m_fontsize]
+
+def mm2pt(x):
+ return x * 2.8452756
+def in2pt(x):
+ return x * 72.26999
+def em2pt(x, fontsize):
+ return {10: 10.00002, 11: 10.8448, 12: 11.74988}[fontsize] * x
+def ex2pt(x, fontsize):
+ return {10: 4.30554, 11: 4.7146, 12: 5.16667}[fontsize] * x
+
+# latex linewidths:
+# indices are no. of columns, papersize, fontsize
+# Why can't this be calculated?
+latex_linewidths = {
+ 'a4paper':{10: 345, 11: 360, 12: 390},
+ 'a4paper-landscape': {10: 598, 11: 596, 12:592},
+ 'a5paper':{10: 276, 11: 276, 12: 276},
+ 'b5paper':{10: 345, 11: 356, 12: 356},
+ 'letterpaper':{10: 345, 11: 360, 12: 390},
+ 'letterpaper-landscape':{10: 598, 11: 596, 12:596},
+ 'legalpaper': {10: 345, 11: 360, 12: 390},
+ 'executivepaper':{10: 345, 11: 360, 12: 379}}
+
+texi_linewidths = {
+ 'a4': {12: 455},
+ 'a4wide': {12: 470},
+ 'smallbook': {12: 361},
+ 'texidefault': {12: 433}}
+
+option_definitions = [
+ ('EXT', 'f', 'format', 'set format. EXT is one of texi and latex.'),
+ ('DIM', '', 'default-music-fontsize', 'default fontsize for music. DIM is assumed to be in points'),
+ ('DIM', '', 'default-lilypond-fontsize', 'deprecated, use --default-music-fontsize'),
+ ('DIM', '', 'force-music-fontsize', 'force fontsize for all inline lilypond. DIM is assumed be to in points'),
+ ('DIM', '', 'force-lilypond-fontsize', 'deprecated, use --force-music-fontsize'),
+ ('DIR', 'I', 'include', 'include path'),
+ ('', 'M', 'dependencies', 'write dependencies'),
+ ('PREF', '', 'dep-prefix', 'prepend PREF before each -M dependency'),
+ ('', 'n', 'no-lily', 'don\'t run lilypond'),
+ ('', '', 'no-pictures', "don\'t generate pictures"),
+ ('', '', 'read-lys', "don't write ly files."),
+ ('FILE', 'o', 'outname', 'filename main output file'),
+ ('FILE', '', 'outdir', "where to place generated files"),
+ ('', 'v', 'version', 'print version information' ),
+ ('', 'h', 'help', 'print help'),
+ ]
+
+# format specific strings, ie. regex-es for input, and % strings for output
+output_dict= {
+ 'latex': {
+ 'output-lilypond-fragment' : r"""\begin[eps,singleline,%s]{lilypond}
+ \context Staff <
+ \context Voice{
+ %s
+ }
+ >
+\end{lilypond}""",
+ 'output-lilypond':r"""\begin[%s]{lilypond}
+%s
+\end{lilypond}""",
+ 'output-verbatim': "\\begin{verbatim}%s\\end{verbatim}",
+ 'output-default-post': "\\def\postLilypondExample{}\n",
+ 'output-default-pre': "\\def\preLilypondExample{}\n",
+ 'usepackage-graphics': '\\usepackage{graphics}\n',
+ 'output-eps': '\\noindent\\parbox{\\lilypondepswidth{%(fn)s.eps}}{\includegraphics{%(fn)s.eps}}',
+ 'output-tex': '\\preLilypondExample \\input %(fn)s.tex \\postLilypondExample\n',
+ 'pagebreak': r'\pagebreak',
+ },
+ 'texi' : {'output-lilypond': """@lilypond[%s]
+%s
+@end lilypond
+""",
+ 'output-lilypond-fragment': """@lilypond[%s]
+\context Staff\context Voice{ %s }
+@end lilypond """,
+ 'pagebreak': None,
+ 'output-verbatim': r"""@example
+%s
+@end example
+""",
+
+# do some tweaking: @ is needed in some ps stuff.
+# override EndLilyPondOutput, since @tex is done
+# in a sandbox, you can't do \input lilyponddefs at the
+# top of the document.
+
+# should also support fragment in
+
+ 'output-all': r"""@tex
+\catcode`\@=12
+\input lilyponddefs
+\def\EndLilyPondOutput{}
+\input %(fn)s.tex
+\catcode`\@=0
+@end tex
+@html
+<p>
+<img src=%(fn)s.png>
+@end html
+""",
+ }
+ }
+
+def output_verbatim (body):
+ if __main__.format == 'texi':
+ body = re.sub ('([@{}])', '@\\1', body)
+ return get_output ('output-verbatim') % body
+
+
+re_dict = {
+ 'latex': {'input': r'(?m)^[^%\n]*?(?P<match>\\mbinput{?([^}\t \n}]*))',
+ 'include': r'(?m)^[^%\n]*?(?P<match>\\mbinclude{(?P<filename>[^}]+)})',
+ 'option-sep' : ', *',
+ 'header': r"\\documentclass\s*(\[.*?\])?",
+ 'geometry': r"^(?m)[^%\n]*?\\usepackage\s*(\[(?P<options>.*)\])?\s*{geometry}",
+ 'preamble-end': r'(?P<code>\\begin{document})',
+ 'verbatim': r"(?s)(?P<code>\\begin{verbatim}.*?\\end{verbatim})",
+ 'verb': r"(?P<code>\\verb(?P<del>.).*?(?P=del))",
+ 'lilypond-file': r'(?m)^[^%\n]*?(?P<match>\\lilypondfile(\[(?P<options>.*?)\])?\{(?P<filename>.+)})',
+ 'lilypond' : r'(?m)^[^%\n]*?(?P<match>\\lilypond(\[(?P<options>.*?)\])?{(?P<code>.*?)})',
+ 'lilypond-block': r"(?sm)^[^%\n]*?(?P<match>\\begin(\[(?P<options>.*?)\])?{lilypond}(?P<code>.*?)\\end{lilypond})",
+ 'def-post-re': r"\\def\\postLilypondExample",
+ 'def-pre-re': r"\\def\\preLilypondExample",
+ 'usepackage-graphics': r"\usepackage{graphics}",
+ 'intertext': r',?\s*intertext=\".*?\"',
+ 'multiline-comment': no_match,
+ 'singleline-comment': r"(?m)^.*?(?P<match>(?P<code>^%.*$\n+))",
+ 'numcols': r"(?P<code>\\(?P<num>one|two)column)",
+ },
+
+ 'texi': {
+ 'include': '(?m)^[^%\n]*?(?P<match>@mbinclude[ \n\t]+(?P<filename>[^\t \n]*))',
+ 'input': no_match,
+ 'header': no_match,
+ 'preamble-end': no_match,
+ 'landscape': no_match,
+ 'verbatim': r"""(?s)(?P<code>@example\s.*?@end example\s)""",
+ 'verb': r"""(?P<code>@code{.*?})""",
+ 'lilypond-file': '(?m)^(?!@c)(?P<match>@lilypondfile(\[(?P<options>.*?)\])?{(?P<filename>[^}]+)})',
+ 'lilypond' : '(?m)^(?!@c)(?P<match>@lilypond(\[(?P<options>.*?)\])?{(?P<code>.*?)})',
+ 'lilypond-block': r"""(?m)^(?!@c)(?P<match>(?s)(?P<match>@lilypond(\[(?P<options>.*?)\])?\s(?P<code>.*?)@end lilypond\s))""",
+ 'option-sep' : ', *',
+ 'intertext': r',?\s*intertext=\".*?\"',
+ 'multiline-comment': r"(?sm)^\s*(?!@c\s+)(?P<code>@ignore\s.*?@end ignore)\s",
+ 'singleline-comment': r"(?m)^.*?(?P<match>(?P<code>@c.*$\n+))",
+ 'numcols': no_match,
+ }
+ }
+
+
+for r in re_dict.keys ():
+ olddict = re_dict[r]
+ newdict = {}
+ for k in olddict.keys ():
+ newdict[k] = re.compile (olddict[k])
+ re_dict[r] = newdict
+
+
+def uniq (list):
+ list.sort ()
+ s = list
+ list = []
+ for x in s:
+ if x not in list:
+ list.append (x)
+ return list
+
+
+def get_output (name):
+ return output_dict[format][name]
+
+def get_re (name):
+ return re_dict[format][name]
+
+def bounding_box_dimensions(fname):
+ try:
+ fd = open(fname)
+ except IOError:
+ error ("Error opening `%s'" % fname)
+ str = fd.read ()
+ s = re.search('%%BoundingBox: ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)', str)
+ if s:
+ return (int(s.group(3))-int(s.group(1)),
+ int(s.group(4))-int(s.group(2)))
+ else:
+ return (0,0)
+
+
+def error (str):
+ sys.stderr.write (str + "\n Exiting ... \n\n")
+ raise 'Exiting.'
+
+
+def compose_full_body (body, opts):
+ """Construct the lilypond code to send to Lilypond.
+ Add stuff to BODY using OPTS as options."""
+ music_size = default_music_fontsize
+ latex_size = default_text_fontsize
+ for o in opts:
+ if g_force_lilypond_fontsize:
+ music_size = g_force_lilypond_fontsize
+ else:
+ m = re.match ('([0-9]+)pt', o)
+ if m:
+ music_size = string.atoi(m.group (1))
+
+ m = re.match ('latexfontsize=([0-9]+)pt', o)
+ if m:
+ latex_size = string.atoi (m.group (1))
+
+ if re.search ('\\\\score', body):
+ is_fragment = 0
+ else:
+ is_fragment = 1
+ if 'fragment' in opts:
+ is_fragment = 1
+ if 'nonfragment' in opts:
+ is_fragment = 0
+
+ if is_fragment and not 'multiline' in opts:
+ opts.append('singleline')
+ if 'singleline' in opts:
+ l = -1.0;
+ else:
+ l = paperguru.get_linewidth()
+
+ if 'relative' in opts:#ugh only when is_fragment
+ body = '\\relative c { %s }' % body
+
+ if is_fragment:
+ body = r"""\score {
+ \notes { %s }
+ \paper { }
+}""" % body
+
+ opts = uniq (opts)
+ optstring = string.join (opts, ' ')
+ optstring = re.sub ('\n', ' ', optstring)
+ body = r"""
+%% Generated by lilypond-book.py; options are %s %%ughUGH not original options
+\include "paper%d.ly"
+\paper { linewidth = %f \pt; }
+""" % (optstring, music_size, l) + body
+ return body
+
+def parse_options_string(s):
+ d = {}
+ r1 = re.compile("((\w+)={(.*?)})((,\s*)|$)")
+ r2 = re.compile("((\w+)=(.*?))((,\s*)|$)")
+ r3 = re.compile("(\w+?)((,\s*)|$)")
+ while s:
+ m = r1.match(s)
+ if m:
+ s = s[m.end():]
+ d[m.group(2)] = re.split(",\s*", m.group(3))
+ continue
+ m = r2.match(s)
+ if m:
+ s = s[m.end():]
+ d[m.group(2)] = m.group(3)
+ continue
+ m = r3.match(s)
+ if m:
+ s = s[m.end():]
+ d[m.group(1)] = 1
+ continue
+ print "trøbbel:%s:" % s
+ return d
+
+def scan_latex_preamble(chunks):
+ # first we want to scan the \documentclass line
+ # it should be the first non-comment line
+ idx = 0
+ while 1:
+ if chunks[idx][0] == 'ignore':
+ idx = idx + 1
+ continue
+ m = get_re ('header').match(chunks[idx][1])
+ options = re.split (',[\n \t]*', m.group(1)[1:-1])
+ for o in options:
+ if o == 'landscape':
+ paperguru.m_landscape = 1
+ m = re.match("(.*?)paper", o)
+ if m:
+ paperguru.m_papersize = m.group()
+ else:
+ m = re.match("(\d\d)pt", o)
+ if m:
+ paperguru.m_fontsize = int(m.group(1))
+
+ break
+ while chunks[idx][0] != 'preamble-end':
+ if chunks[idx] == 'ignore':
+ idx = idx + 1
+ continue
+ m = get_re ('geometry').search(chunks[idx][1])
+ if m:
+ paperguru.m_use_geometry = 1
+ o = parse_options_string(m.group('options'))
+ for k in o.keys():
+ paperguru.set_geo_option(k, o[k])
+ idx = idx + 1
+
+def scan_texi_preamble (chunks):
+ # this is not bulletproof..., it checks the first 10 chunks
+ idx = 0
+ while 1:
+ if chunks[idx][0] == 'input':
+ if string.find(chunks[idx][1], "@afourpaper") != -1:
+ paperguru.m_papersize = 'a4'
+ elif string.find(chunks[idx][1], "@afourwide") != -1:
+ paperguru.m_papersize = 'a4wide'
+ elif string.find(chunks[idx][1], "@smallbook") != -1:
+ paperguru.m_papersize = 'smallbook'
+ idx = idx + 1
+ if idx == 10 or idx == len(chunks):
+ break
+
+def scan_preamble (chunks):
+ if __main__.format == 'texi':
+ scan_texi_preamble(chunks)
+ else:
+ assert __main__.format == 'latex'
+ scan_latex_preamble(chunks)
+
+
+def completize_preamble (chunks):
+ if __main__.format == 'texi':
+ return chunks
+ pre_b = post_b = graphics_b = None
+ for chunk in chunks:
+ if chunk[0] == 'preamble-end':
+ break
+ if chunk[0] == 'input':
+ m = get_re('def-pre-re').search(chunk[1])
+ if m:
+ pre_b = 1
+ if chunk[0] == 'input':
+ m = get_re('def-post-re').search(chunk[1])
+ if m:
+ post_b = 1
+ if chunk[0] == 'input':
+ m = get_re('usepackage-graphics').search(chunk[1])
+ if m:
+ graphics_b = 1
+ x = 0
+ while chunks[x][0] != 'preamble-end':
+ x = x + 1
+ if not pre_b:
+ chunks.insert(x, ('input', get_output ('output-default-pre')))
+ if not post_b:
+ chunks.insert(x, ('input', get_output ('output-default-post')))
+ if not graphics_b:
+ chunks.insert(x, ('input', get_output ('usepackage-graphics')))
+ return chunks
+
+
+read_files = []
+def find_file (name):
+ f = None
+ for a in include_path:
+ try:
+ nm = os.path.join (a, name)
+ f = open (nm)
+ __main__.read_files.append (nm)
+ break
+ except IOError:
+ pass
+ if f:
+ return f.read ()
+ else:
+ error ("File not found `%s'\n" % name)
+ return ''
+
+def do_ignore(match_object):
+ return [('ignore', match_object.group('code'))]
+def do_preamble_end(match_object):
+ return [('preamble-end', match_object.group('code'))]
+
+def make_verbatim(match_object):
+ return [('verbatim', match_object.group('code'))]
+
+def make_verb(match_object):
+ return [('verb', match_object.group('code'))]
+
+def do_include_file(m):
+ "m: MatchObject"
+ return [('input', get_output ('pagebreak'))] \
+ + read_doc_file(m.group('filename')) \
+ + [('input', get_output ('pagebreak'))]
+
+def do_input_file(m):
+ return read_doc_file(m.group('filename'))
+
+def make_lilypond(m):
+ if m.group('options'):
+ options = m.group('options')
+ else:
+ options = ''
+ return [('input', get_output('output-lilypond-fragment') %
+ (options, m.group('code')))]
+
+def make_lilypond_file(m):
+ if m.group('options'):
+ options = m.group('options')
+ else:
+ options = ''
+ return [('input', get_output('output-lilypond') %
+ (options, find_file(m.group('filename'))))]
+
+def make_lilypond_block(m):
+ if m.group('options'):
+ options = get_re('option-sep').split (m.group('options'))
+ else:
+ options = []
+ options = filter(lambda s: s != '', options)
+ return [('lilypond', m.group('code'), options)]
+
+def do_columns(m):
+ if __main__.format != 'latex':
+ return []
+ if m.group('num') == 'one':
+ return [('numcols', m.group('code'), 1)]
+ if m.group('num') == 'two':
+ return [('numcols', m.group('code'), 2)]
+
+def chop_chunks(chunks, re_name, func, use_match=0):
+ newchunks = []
+ for c in chunks:
+ if c[0] == 'input':
+ str = c[1]
+ while str:
+ m = get_re (re_name).search (str)
+ if m == None:
+ newchunks.append (('input', str))
+ str = ''
+ else:
+ if use_match:
+ newchunks.append (('input', str[:m.start ('match')]))
+ else:
+ newchunks.append (('input', str[:m.start (0)]))
+ #newchunks.extend(func(m))
+ # python 1.5 compatible:
+ newchunks = newchunks + func(m)
+ str = str [m.end(0):]
+ else:
+ newchunks.append(c)
+ return newchunks
+
+def read_doc_file (filename):
+ """Read the input file, find verbatim chunks and do \input and \include
+ """
+ str = ''
+ str = find_file(filename)
+
+ if __main__.format == '':
+ latex = re.search ('\\\\document', str[:200])
+ texinfo = re.search ('@node|@setfilename', str[:200])
+ if (texinfo and latex) or not (texinfo or latex):
+ error("error: can't determine format, please specify")
+ if texinfo:
+ __main__.format = 'texi'
+ else:
+ __main__.format = 'latex'
+ if __main__.format == 'texi':
+ __main__.paperguru = TexiPaper()
+ else:
+ __main__.paperguru = LatexPaper()
+ chunks = [('input', str)]
+ # we have to check for verbatim before doing include,
+ # because we don't want to include files that are mentioned
+ # inside a verbatim environment
+ chunks = chop_chunks(chunks, 'verbatim', make_verbatim)
+ chunks = chop_chunks(chunks, 'verb', make_verb)
+ chunks = chop_chunks(chunks, 'multiline-comment', do_ignore)
+ #ugh fix input
+ chunks = chop_chunks(chunks, 'include', do_include_file, 1)
+ chunks = chop_chunks(chunks, 'input', do_input_file, 1)
+ return chunks
+
+
+taken_file_names = {}
+def schedule_lilypond_block (chunk):
+ """Take the body and options from CHUNK, figure out how the
+ real .ly should look, and what should be left MAIN_STR (meant
+ for the main file). The .ly is written, and scheduled in
+ TODO.
+
+ Return: a chunk (TYPE_STR, MAIN_STR, OPTIONS, TODO, BASE)
+
+ TODO has format [basename, extension, extension, ... ]
+
+ """
+ (type, body, opts) = chunk
+ assert type == 'lilypond'
+ file_body = compose_full_body (body, opts)
+ basename = `abs(hash (file_body))`
+ for o in opts:
+ m = re.search ('filename="(.*?)"', o)
+ if m:
+ basename = m.group (1)
+ if not taken_file_names.has_key(basename):
+ taken_file_names[basename] = 0
+ else:
+ taken_file_names[basename] = taken_file_names[basename] + 1
+ basename = basename + "-%i" % taken_file_names[basename]
+ if not g_read_lys:
+ update_file(file_body, os.path.join(g_outdir, basename) + '.ly')
+ needed_filetypes = ['tex']
+
+ if format == 'texi':
+ needed_filetypes.append('eps')
+ needed_filetypes.append('png')
+ if 'eps' in opts and not ('eps' in needed_filetypes):
+ needed_filetypes.append('eps')
+ outname = os.path.join(g_outdir, basename)
+ def f(base, ext1, ext2):
+ a = os.path.isfile(base + ext2)
+ if (os.path.isfile(base + ext1) and
+ os.path.isfile(base + ext2) and
+ os.stat(base+ext1)[stat.ST_MTIME] >
+ os.stat(base+ext2)[stat.ST_MTIME]) or \
+ not os.path.isfile(base + ext2):
+ return 1
+ todo = []
+ if 'tex' in needed_filetypes and f(outname, '.ly', '.tex'):
+ todo.append('tex')
+ if 'eps' in needed_filetypes and f(outname, '.tex', '.eps'):
+ todo.append('eps')
+ if 'png' in needed_filetypes and f(outname, '.eps', '.png'):
+ todo.append('png')
+ newbody = ''
+ if 'verbatim' in opts:
+ newbody = output_verbatim (body)
+
+ for o in opts:
+ m = re.search ('intertext="(.*?)"', o)
+ if m:
+ newbody = newbody + m.group (1) + "\n\n"
+ if format == 'latex':
+ if 'eps' in opts:
+ s = 'output-eps'
+ else:
+ s = 'output-tex'
+ else: # format == 'texi'
+ s = 'output-all'
+ newbody = newbody + get_output(s) % {'fn': basename }
+ return ('lilypond', newbody, opts, todo, basename)
+
+def process_lilypond_blocks(outname, chunks):#ugh rename
+ newchunks = []
+ # Count sections/chapters.
+ for c in chunks:
+ if c[0] == 'lilypond':
+ c = schedule_lilypond_block (c)
+ elif c[0] == 'numcols':
+ paperguru.m_num_cols = c[2]
+ newchunks.append (c)
+ return newchunks
+
+
+def find_eps_dims (match):
+ "Fill in dimensions of EPS files."
+
+ fn =match.group (1)
+ dims = bounding_box_dimensions (fn)
+ if g_outdir:
+ fn = os.path.join(g_outdir, fn)
+
+ return '%ipt' % dims[0]
+
+
+def system (cmd):
+ sys.stderr.write ("invoking `%s'\n" % cmd)
+ st = os.system (cmd)
+ if st:
+ error ('Error command exited with value %d\n' % st)
+ return st
+
+def compile_all_files (chunks):
+ eps = []
+ tex = []
+ png = []
+
+ for c in chunks:
+ if c[0] <> 'lilypond':
+ continue
+ base = c[4]
+ exts = c[3]
+ for e in exts:
+ if e == 'eps':
+ eps.append (base)
+ elif e == 'tex':
+ #ugh
+ if base + '.ly' not in tex:
+ tex.append (base + '.ly')
+ elif e == 'png' and g_do_pictures:
+ png.append (base)
+ d = os.getcwd()
+ if g_outdir:
+ os.chdir(g_outdir)
+ if tex:
+ # fixme: be sys-independent.
+ def incl_opt (x):
+ if g_outdir and x[0] <> '/' :
+ x = os.path.join (g_here_dir, x)
+ return ' -I %s' % x
+
+ incs = map (incl_opt, include_path)
+ lilyopts = string.join (incs, ' ' )
+ texfiles = string.join (tex, ' ')
+ system ('lilypond %s %s' % (lilyopts, texfiles))
+ for e in eps:
+ system(r"tex '\nonstopmode \input %s'" % e)
+ system(r"dvips -E -o %s %s" % (e + '.eps', e))
+ for g in png:
+ cmd = r"""gs -sDEVICE=pgm -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=- -r90 -dNOPAUSE %s -c quit | pnmcrop | pnmtopng > %s"""
+ cmd = cmd % (g + '.eps', g + '.png')
+ system (cmd)
+ if g_outdir:
+ os.chdir(d)
+
+
+def update_file (body, name):
+ """
+ write the body if it has changed
+ """
+ same = 0
+ try:
+ f = open (name)
+ fs = f.read (-1)
+ same = (fs == body)
+ except:
+ pass
+
+ if not same:
+ f = open (name , 'w')
+ f.write (body)
+ f.close ()
+
+ return not same
+
+
+def getopt_args (opts):
+ "Construct arguments (LONG, SHORT) for getopt from list of options."
+ short = ''
+ long = []
+ for o in opts:
+ if o[1]:
+ short = short + o[1]
+ if o[0]:
+ short = short + ':'
+ if o[2]:
+ l = o[2]
+ if o[0]:
+ l = l + '='
+ long.append (l)
+ return (short, long)
+
+def option_help_str (o):
+ "Transform one option description (4-tuple ) into neatly formatted string"
+ sh = ' '
+ if o[1]:
+ sh = '-%s' % o[1]
+
+ sep = ' '
+ if o[1] and o[2]:
+ sep = ','
+
+ long = ''
+ if o[2]:
+ long= '--%s' % o[2]
+
+ arg = ''
+ if o[0]:
+ if o[2]:
+ arg = '='
+ arg = arg + o[0]
+ return ' ' + sh + sep + long + arg
+
+
+def options_help_str (opts):
+ "Convert a list of options into a neatly formatted string"
+ w = 0
+ strs =[]
+ helps = []
+
+ for o in opts:
+ s = option_help_str (o)
+ strs.append ((s, o[3]))
+ if len (s) > w:
+ w = len (s)
+
+ str = ''
+ for s in strs:
+ str = str + '%s%s%s\n' % (s[0], ' ' * (w - len(s[0]) + 3), s[1])
+ return str
+
+def help():
+ sys.stdout.write("""Usage: lilypond-book [options] FILE\n
+Generate hybrid LaTeX input from Latex + lilypond
+Options:
+""")
+ sys.stdout.write (options_help_str (option_definitions))
+ sys.stdout.write (r"""Warning all output is written in the CURRENT directory
+
+
+
+Report bugs to bug-gnu-music@gnu.org.
+
+Written by Tom Cato Amundsen <tca@gnu.org> and
+Han-Wen Nienhuys <hanwen@cs.uu.nl>
+""")
+
+ sys.exit (0)
+
+
+def write_deps (fn, target):
+ sys.stdout.write('writing `%s\'\n' % os.path.join(g_outdir, fn))
+ f = open (os.path.join(g_outdir, fn), 'w')
+ f.write ('%s%s: ' % (g_dep_prefix, target))
+ for d in __main__.read_files:
+ f.write ('%s ' % d)
+ f.write ('\n')
+ f.close ()
+ __main__.read_files = []
+
+def identify():
+ sys.stdout.write ('lilypond-book (GNU LilyPond) %s\n' % program_version)
+
+def print_version ():
+ identify()
+ sys.stdout.write (r"""Copyright 1998--1999
+Distributed under terms of the GNU General Public License. It comes with
+NO WARRANTY.
+""")
+
+def do_file(input_filename):
+ file_settings = {}
+ if outname:
+ my_outname = outname
+ else:
+ my_outname = os.path.basename(os.path.splitext(input_filename)[0])
+ my_depname = my_outname + '.dep'
+
+ chunks = read_doc_file(input_filename)
+ chunks = chop_chunks(chunks, 'lilypond', make_lilypond, 1)
+ chunks = chop_chunks(chunks, 'lilypond-file', make_lilypond_file, 1)
+ chunks = chop_chunks(chunks, 'lilypond-block', make_lilypond_block, 1)
+ chunks = chop_chunks(chunks, 'singleline-comment', do_ignore, 1)
+ chunks = chop_chunks(chunks, 'preamble-end', do_preamble_end)
+ chunks = chop_chunks(chunks, 'numcols', do_columns)
+ #print "-" * 50
+ #for c in chunks: print "c:", c;
+ #sys.exit()
+ scan_preamble(chunks)
+ chunks = process_lilypond_blocks(my_outname, chunks)
+ # Do It.
+ if __main__.g_run_lilypond:
+ compile_all_files (chunks)
+ newchunks = []
+ # finishing touch.
+ for c in chunks:
+ if c[0] == 'lilypond' and 'eps' in c[2]:
+ body = re.sub (r"""\\lilypondepswidth{(.*?)}""", find_eps_dims, c[1])
+ newchunks.append (('lilypond', body))
+ else:
+ newchunks.append (c)
+ chunks = newchunks
+ x = 0
+ chunks = completize_preamble (chunks)
+ foutn = os.path.join(g_outdir, my_outname + '.' + format)
+ sys.stderr.write ("Writing `%s'\n" % foutn)
+ fout = open (foutn, 'w')
+ for c in chunks:
+ fout.write (c[1])
+ fout.close ()
+
+ if do_deps:
+ write_deps (my_depname, foutn)
+
+
+outname = ''
+try:
+ (sh, long) = getopt_args (__main__.option_definitions)
+ (options, files) = getopt.getopt(sys.argv[1:], sh, long)
+except getopt.error, msg:
+ sys.stderr.write("error: %s" % msg)
+ sys.exit(1)
+
+do_deps = 0
+for opt in options:
+ o = opt[0]
+ a = opt[1]
+
+ if o == '--include' or o == '-I':
+ include_path.append (a)
+ elif o == '--version' or o == '-v':
+ print_version ()
+ sys.exit (0)
+ elif o == '--format' or o == '-f':
+ __main__.format = a
+ elif o == '--outname' or o == '-o':
+ if len(files) > 1:
+ #HACK
+ sys.stderr.write("Lilypond-book is confused by --outname on multiple files")
+ sys.exit(1)
+ outname = a
+ elif o == '--help' or o == '-h':
+ help ()
+ elif o == '--no-lily' or o == '-n':
+ __main__.g_run_lilypond = 0
+ elif o == '--dependencies' or o == '-M':
+ do_deps = 1
+ elif o == '--default-music-fontsize':
+ default_music_fontsize = string.atoi (a)
+ elif o == '--default-lilypond-fontsize':
+ print "--default-lilypond-fontsize is deprecated, use --default-music-fontsize"
+ default_music_fontsize = string.atoi (a)
+ elif o == '--force-music-fontsize':
+ g_force_lilypond_fontsize = string.atoi(a)
+ elif o == '--force-lilypond-fontsize':
+ print "--force-lilypond-fontsize is deprecated, use --default-lilypond-fontsize"
+ g_force_lilypond_fontsize = string.atoi(a)
+ elif o == '--dep-prefix':
+ g_dep_prefix = a
+ elif o == '--no-pictures':
+ g_do_pictures = 0
+ elif o == '--read-lys':
+ g_read_lys = 1
+ elif o == '--outdir':
+ g_outdir = a
+
+identify()
+if g_outdir:
+ if os.path.isfile(g_outdir):
+ error ("outdir is a file: %s" % g_outdir)
+ if not os.path.exists(g_outdir):
+ os.mkdir(g_outdir)
+for input_filename in files:
+ do_file(input_filename)
+
+#
+# Petr, ik zou willen dat ik iets zinvoller deed,
+# maar wat ik kan ik doen, het verandert toch niets?
+# --hwn 20/aug/99
titles={}
for line in this.__fd.readlines():
- m=re.match('\\\\def\\\\mudela([\w]+){(.*)}',line)
+ m=re.match('\\\\def\\\\lilypond([\w]+){(.*)}',line)
if m:
for var in varTable:
if m.group(1) == var[0]:
This class handles all ly2dvi.py output file methods
private methods:
- __mudelaDefs(opt) Send title info to output file
+ __lilypondDefs(opt) Send title info to output file
Public methods:
__init__() Constructor
#
# __medelaDefs
#
- def __mudelaDefs(this,opt):
+ def __lilypondDefs(this,opt):
"""
Write titles to output
titles = Props.get('titles')
for key in titles.keys():
- this.write('%s\\mudela%s{%s}%%\n' % (opt,key,titles[key]))
+ this.write('%s\\lilypond%s{%s}%%\n' % (opt,key,titles[key]))
#
# write
\renewcommand{\@oddhead}{\parbox{\textwidth}%%
{\mbox{}\small\theheader\hfill\textbf{\thepage}}}%%
%% UGR.
-%%\renewcommand{\@evenhead}{eve!{\small\mudelainstrument{,}\quad\textbf{\thepage}}\hfil}%%
+%%\renewcommand{\@evenhead}{eve!{\small\lilypondinstrument{,}\quad\textbf{\thepage}}\hfil}%%
\renewcommand{\@oddfoot}{\parbox{\textwidth}{\mbox{}\thefooter}}%%
\begin{document}
""" % ( program_id(), Props.get('filename'), now, Props.get('papersize'),
except:
sys.exit('ExitNoWrite', this.__outfile)
this.write(top)
- this.__mudelaDefs('')
+ this.__lilypondDefs('')
this.write("""\
\\makelilytitle
""")
this.write("""\
\\def\\theopus{}%
\\def\\thepiece{}%
-\\def\\mudelaopus{}%
-\\def\\mudelapiece{}%
+\\def\\lilypondopus{}%
+\\def\\lilypondpiece{}%
""")
- this.__mudelaDefs("\\def")
+ this.__lilypondDefs("\\def")
this.write("""\
-\\def\\theopus{\\mudelaopus}% ugh
-\\def\\thepiece{\\mudelapiece}%
+\\def\\theopus{\\lilypondopus}% ugh
+\\def\\thepiece{\\lilypondpiece}%
\\makelilypiecetitle
""")
outfile = os.path.join(Props.get('output'), outfile )
this.write(r"""
-%% \vfill\hfill{\mudelatagline}
+%% \vfill\hfill{\lilypondtagline}
\makeatletter
-\renewcommand{\@oddfoot}{\parbox{\textwidth}{\mbox{}\mudelatagline}}%%
+\renewcommand{\@oddfoot}{\parbox{\textwidth}{\mbox{}\lilypondtagline}}%%
\makeatother
\end{document}
""")
mudefs=[]
for line in fd.readlines():
- m=re.match('\\\\newcommand\*{\\\\mudela([\w]+)}',line)
+ m=re.match('\\\\newcommand\*{\\\\lilypond([\w]+)}',line)
if m:
mudefs.append(m.group(1))
fd.close
this.__set('tmp',dir,requester)
#
- # Set mudela source file name
+ # Set lilypond source file name
#
def setFilename(this,file, requester):
this.__set('filename',file,requester)
+++ /dev/null
-#!@PYTHON@
-# vim: set noexpandtab:
-# TODO:
-# * Figure out clean set of options. Hmm, isn't it pretty ok now?
-# * add support for .lilyrc
-
-
-# todo: dimension handling (all the x2y) is clumsy.
-
-# This is was the idea for handling of comments:
-# Multiline comments, @ignore .. @end ignore is scanned for
-# in read_doc_file, and the chunks are marked as 'ignore', so
-# mudela-book will not touch them any more. The content of the
-# chunks are written to the output file. Also 'include' and 'input'
-# regex has to check if they are commented out.
-#
-# Then it is scanned for 'mudela', 'mudela-file' and 'mudela-block'.
-# These three regex's has to check if they are on a commented line,
-# % for latex, @c for texinfo.
-#
-# Then lines that are commented out with % (latex) and @c (Texinfo)
-# are put into chunks marked 'ignore'. This cannot be done before
-# searching for the mudela-blocks because % is also the comment character
-# for lilypond.
-#
-# The the rest of the rexeces are searched for. They don't have to test
-# if they are on a commented out line.
-
-import os
-import stat
-import string
-import re
-import getopt
-import sys
-import __main__
-import operator
-
-
-program_version = '@TOPLEVEL_VERSION@'
-if program_version == '@' + 'TOPLEVEL_VERSION' + '@':
- program_version = '1.3.106'
-
-include_path = [os.getcwd()]
-
-
-# g_ is for global (?)
-
-g_here_dir = os.getcwd ()
-g_dep_prefix = ''
-g_outdir = ''
-g_force_mudela_fontsize = 0
-g_read_lys = 0
-g_do_pictures = 1
-g_num_cols = 1
-format = ''
-g_run_lilypond = 1
-no_match = 'a\ba'
-
-default_music_fontsize = 16
-default_text_fontsize = 12
-
-
-class LatexPaper:
- def __init__(self):
- self.m_paperdef = {
- # the dimentions are from geometry.sty
- 'a0paper': (mm2pt(841), mm2pt(1189)),
- 'a1paper': (mm2pt(595), mm2pt(841)),
- 'a2paper': (mm2pt(420), mm2pt(595)),
- 'a3paper': (mm2pt(297), mm2pt(420)),
- 'a4paper': (mm2pt(210), mm2pt(297)),
- 'a5paper': (mm2pt(149), mm2pt(210)),
- 'b0paper': (mm2pt(1000), mm2pt(1414)),
- 'b1paper': (mm2pt(707), mm2pt(1000)),
- 'b2paper': (mm2pt(500), mm2pt(707)),
- 'b3paper': (mm2pt(353), mm2pt(500)),
- 'b4paper': (mm2pt(250), mm2pt(353)),
- 'b5paper': (mm2pt(176), mm2pt(250)),
- 'letterpaper': (in2pt(8.5), in2pt(11)),
- 'legalpaper': (in2pt(8.5), in2pt(14)),
- 'executivepaper': (in2pt(7.25), in2pt(10.5))}
- self.m_use_geometry = None
- self.m_papersize = 'letterpaper'
- self.m_fontsize = 10
- self.m_num_cols = 1
- self.m_landscape = 0
- self.m_geo_landscape = 0
- self.m_geo_width = None
- self.m_geo_textwidth = None
- self.m_geo_lmargin = None
- self.m_geo_rmargin = None
- self.m_geo_includemp = None
- self.m_geo_marginparwidth = {10: 57, 11: 50, 12: 35}
- self.m_geo_marginparsep = {10: 11, 11: 10, 12: 10}
- self.m_geo_x_marginparwidth = None
- self.m_geo_x_marginparsep = None
- self.__body = None
- def set_geo_option(self, name, value):
- if name == 'body' or name == 'text':
- if type(value) == type(""):
- self._set_dimen('m_geo_textwidth', value)
- else:
- self._set_dimen('m_geo_textwidth', value[0])
- self.__body = 1
- elif name == 'portrait':
- self.m_geo_landscape = 0
- elif name == 'reversemp' or name == 'reversemarginpar':
- if self.m_geo_includemp == None:
- self.m_geo_includemp = 1
- elif name == 'marginparwidth' or name == 'marginpar':
- self._set_dimen('m_geo_x_marginparwidth', value)
- self.m_geo_includemp = 1
- elif name == 'marginparsep':
- self._set_dimen('m_geo_x_marginparsep', value)
- self.m_geo_includemp = 1
- elif name == 'scale':
- if type(value) == type(""):
- self.m_geo_width = self.get_paperwidth() * float(value)
- else:
- self.m_geo_width = self.get_paperwidth() * float(value[0])
- elif name == 'hscale':
- self.m_geo_width = self.get_paperwidth() * float(value)
- elif name == 'left' or name == 'lmargin':
- self._set_dimen('m_geo_lmargin', value)
- elif name == 'right' or name == 'rmargin':
- self._set_dimen('m_geo_rmargin', value)
- elif name == 'hdivide' or name == 'divide':
- if value[0] not in ('*', ''):
- self._set_dimen('m_geo_lmargin', value[0])
- if value[1] not in ('*', ''):
- self._set_dimen('m_geo_width', value[1])
- if value[2] not in ('*', ''):
- self._set_dimen('m_geo_rmargin', value[2])
- elif name == 'hmargin':
- if type(value) == type(""):
- self._set_dimen('m_geo_lmargin', value)
- self._set_dimen('m_geo_rmargin', value)
- else:
- self._set_dimen('m_geo_lmargin', value[0])
- self._set_dimen('m_geo_rmargin', value[1])
- elif name == 'margin':#ugh there is a bug about this option in
- # the geometry documentation
- if type(value) == type(""):
- self._set_dimen('m_geo_lmargin', value)
- self._set_dimen('m_geo_rmargin', value)
- else:
- self._set_dimen('m_geo_lmargin', value[0])
- self._set_dimen('m_geo_rmargin', value[0])
- elif name == 'total':
- if type(value) == type(""):
- self._set_dimen('m_geo_width', value)
- else:
- self._set_dimen('m_geo_width', value[0])
- elif name == 'width' or name == 'totalwidth':
- self._set_dimen('m_geo_width', value)
- elif name == 'paper' or name == 'papername':
- self.m_papersize = value
- elif name[-5:] == 'paper':
- self.m_papersize = name
- else:
- self._set_dimen('m_geo_'+name, value)
- def _set_dimen(self, name, value):
- if type(value) == type("") and value[-2:] == 'pt':
- self.__dict__[name] = float(value[:-2])
- elif type(value) == type("") and value[-2:] == 'mm':
- self.__dict__[name] = mm2pt(float(value[:-2]))
- elif type(value) == type("") and value[-2:] == 'cm':
- self.__dict__[name] = 10 * mm2pt(float(value[:-2]))
- elif type(value) == type("") and value[-2:] == 'in':
- self.__dict__[name] = in2pt(float(value[:-2]))
- else:
- self.__dict__[name] = value
- def display(self):
- print "LatexPaper:\n-----------"
- for v in self.__dict__.keys():
- if v[:2] == 'm_':
- print v, self.__dict__[v]
- print "-----------"
- def get_linewidth(self):
- w = self._calc_linewidth()
- if self.m_num_cols == 2:
- return (w - 10) / 2
- else:
- return w
- def get_paperwidth(self):
- #if self.m_use_geometry:
- return self.m_paperdef[self.m_papersize][self.m_landscape or self.m_geo_landscape]
- #return self.m_paperdef[self.m_papersize][self.m_landscape]
-
- def _calc_linewidth(self):
- # since geometry sometimes ignores 'includemp', this is
- # more complicated than it should be
- mp = 0
- if self.m_geo_includemp:
- if self.m_geo_x_marginparsep is not None:
- mp = mp + self.m_geo_x_marginparsep
- else:
- mp = mp + self.m_geo_marginparsep[self.m_fontsize]
- if self.m_geo_x_marginparwidth is not None:
- mp = mp + self.m_geo_x_marginparwidth
- else:
- mp = mp + self.m_geo_marginparwidth[self.m_fontsize]
- if self.__body:#ugh test if this is necessary
- mp = 0
- def tNone(a, b, c):
- return a == None, b == None, c == None
- if not self.m_use_geometry:
- return latex_linewidths[self.m_papersize][self.m_fontsize]
- else:
- if tNone(self.m_geo_lmargin, self.m_geo_width,
- self.m_geo_rmargin) == (1, 1, 1):
- if self.m_geo_textwidth:
- return self.m_geo_textwidth
- w = self.get_paperwidth() * 0.8
- return w - mp
- elif tNone(self.m_geo_lmargin, self.m_geo_width,
- self.m_geo_rmargin) == (0, 1, 1):
- if self.m_geo_textwidth:
- return self.m_geo_textwidth
- return self.f1(self.m_geo_lmargin, mp)
- elif tNone(self.m_geo_lmargin, self.m_geo_width,
- self.m_geo_rmargin) == (1, 1, 0):
- if self.m_geo_textwidth:
- return self.m_geo_textwidth
- return self.f1(self.m_geo_rmargin, mp)
- elif tNone(self.m_geo_lmargin, self.m_geo_width,
- self.m_geo_rmargin) \
- in ((0, 0, 1), (1, 0, 0), (1, 0, 1)):
- if self.m_geo_textwidth:
- return self.m_geo_textwidth
- return self.m_geo_width - mp
- elif tNone(self.m_geo_lmargin, self.m_geo_width,
- self.m_geo_rmargin) in ((0, 1, 0), (0, 0, 0)):
- w = self.get_paperwidth() - self.m_geo_lmargin - self.m_geo_rmargin - mp
- if w < 0:
- w = 0
- return w
- raise "Never do this!"
- def f1(self, m, mp):
- tmp = self.get_paperwidth() - m * 2 - mp
- if tmp < 0:
- tmp = 0
- return tmp
- def f2(self):
- tmp = self.get_paperwidth() - self.m_geo_lmargin \
- - self.m_geo_rmargin
- if tmp < 0:
- return 0
- return tmp
-
-class TexiPaper:
- def __init__(self):
- self.m_papersize = 'a4'
- self.m_fontsize = 12
- def get_linewidth(self):
- return texi_linewidths[self.m_papersize][self.m_fontsize]
-
-def mm2pt(x):
- return x * 2.8452756
-def in2pt(x):
- return x * 72.26999
-def em2pt(x, fontsize):
- return {10: 10.00002, 11: 10.8448, 12: 11.74988}[fontsize] * x
-def ex2pt(x, fontsize):
- return {10: 4.30554, 11: 4.7146, 12: 5.16667}[fontsize] * x
-
-# latex linewidths:
-# indices are no. of columns, papersize, fontsize
-# Why can't this be calculated?
-latex_linewidths = {
- 'a4paper':{10: 345, 11: 360, 12: 390},
- 'a4paper-landscape': {10: 598, 11: 596, 12:592},
- 'a5paper':{10: 276, 11: 276, 12: 276},
- 'b5paper':{10: 345, 11: 356, 12: 356},
- 'letterpaper':{10: 345, 11: 360, 12: 390},
- 'letterpaper-landscape':{10: 598, 11: 596, 12:596},
- 'legalpaper': {10: 345, 11: 360, 12: 390},
- 'executivepaper':{10: 345, 11: 360, 12: 379}}
-
-texi_linewidths = {
- 'a4': {12: 455},
- 'a4wide': {12: 470},
- 'smallbook': {12: 361},
- 'texidefault': {12: 433}}
-
-option_definitions = [
- ('EXT', 'f', 'format', 'set format. EXT is one of texi and latex.'),
- ('DIM', '', 'default-music-fontsize', 'default fontsize for music. DIM is assumed to be in points'),
- ('DIM', '', 'default-mudela-fontsize', 'deprecated, use --default-music-fontsize'),
- ('DIM', '', 'force-music-fontsize', 'force fontsize for all inline mudela. DIM is assumed be to in points'),
- ('DIM', '', 'force-mudela-fontsize', 'deprecated, use --force-music-fontsize'),
- ('DIR', 'I', 'include', 'include path'),
- ('', 'M', 'dependencies', 'write dependencies'),
- ('PREF', '', 'dep-prefix', 'prepend PREF before each -M dependency'),
- ('', 'n', 'no-lily', 'don\'t run lilypond'),
- ('', '', 'no-pictures', "don\'t generate pictures"),
- ('', '', 'read-lys', "don't write ly files."),
- ('FILE', 'o', 'outname', 'filename main output file'),
- ('FILE', '', 'outdir', "where to place generated files"),
- ('', 'v', 'version', 'print version information' ),
- ('', 'h', 'help', 'print help'),
- ]
-
-# format specific strings, ie. regex-es for input, and % strings for output
-output_dict= {
- 'latex': {
- 'output-mudela-fragment' : r"""\begin[eps,singleline,%s]{mudela}
- \context Staff <
- \context Voice{
- %s
- }
- >
-\end{mudela}""",
- 'output-mudela':r"""\begin[%s]{mudela}
-%s
-\end{mudela}""",
- 'output-verbatim': "\\begin{verbatim}%s\\end{verbatim}",
- 'output-default-post': "\\def\postMudelaExample{}\n",
- 'output-default-pre': "\\def\preMudelaExample{}\n",
- 'usepackage-graphics': '\\usepackage{graphics}\n',
- 'output-eps': '\\noindent\\parbox{\\mudelaepswidth{%(fn)s.eps}}{\includegraphics{%(fn)s.eps}}',
- 'output-tex': '\\preMudelaExample \\input %(fn)s.tex \\postMudelaExample\n',
- 'pagebreak': r'\pagebreak',
- },
- 'texi' : {'output-mudela': """@mudela[%s]
-%s
-@end mudela
-""",
- 'output-mudela-fragment': """@mudela[%s]
-\context Staff\context Voice{ %s }
-@end mudela """,
- 'pagebreak': None,
- 'output-verbatim': r"""@example
-%s
-@end example
-""",
-
-# do some tweaking: @ is needed in some ps stuff.
-# override EndLilyPondOutput, since @tex is done
-# in a sandbox, you can't do \input lilyponddefs at the
-# top of the document.
-
-# should also support fragment in
-
- 'output-all': r"""@tex
-\catcode`\@=12
-\input lilyponddefs
-\def\EndLilyPondOutput{}
-\input %(fn)s.tex
-\catcode`\@=0
-@end tex
-@html
-<p>
-<img src=%(fn)s.png>
-@end html
-""",
- }
- }
-
-def output_verbatim (body):
- if __main__.format == 'texi':
- body = re.sub ('([@{}])', '@\\1', body)
- return get_output ('output-verbatim') % body
-
-
-re_dict = {
- 'latex': {'input': r'(?m)^[^%\n]*?(?P<match>\\mbinput{?([^}\t \n}]*))',
- 'include': r'(?m)^[^%\n]*?(?P<match>\\mbinclude{(?P<filename>[^}]+)})',
- 'option-sep' : ', *',
- 'header': r"\\documentclass\s*(\[.*?\])?",
- 'geometry': r"^(?m)[^%\n]*?\\usepackage\s*(\[(?P<options>.*)\])?\s*{geometry}",
- 'preamble-end': r'(?P<code>\\begin{document})',
- 'verbatim': r"(?s)(?P<code>\\begin{verbatim}.*?\\end{verbatim})",
- 'verb': r"(?P<code>\\verb(?P<del>.).*?(?P=del))",
- 'mudela-file': r'(?m)^[^%\n]*?(?P<match>\\mudelafile(\[(?P<options>.*?)\])?\{(?P<filename>.+)})',
- 'mudela' : r'(?m)^[^%\n]*?(?P<match>\\mudela(\[(?P<options>.*?)\])?{(?P<code>.*?)})',
- 'mudela-block': r"(?sm)^[^%\n]*?(?P<match>\\begin(\[(?P<options>.*?)\])?{mudela}(?P<code>.*?)\\end{mudela})",
- 'def-post-re': r"\\def\\postMudelaExample",
- 'def-pre-re': r"\\def\\preMudelaExample",
- 'usepackage-graphics': r"\usepackage{graphics}",
- 'intertext': r',?\s*intertext=\".*?\"',
- 'multiline-comment': no_match,
- 'singleline-comment': r"(?m)^.*?(?P<match>(?P<code>^%.*$\n+))",
- 'numcols': r"(?P<code>\\(?P<num>one|two)column)",
- },
-
- 'texi': {
- 'include': '(?m)^[^%\n]*?(?P<match>@mbinclude[ \n\t]+(?P<filename>[^\t \n]*))',
- 'input': no_match,
- 'header': no_match,
- 'preamble-end': no_match,
- 'landscape': no_match,
- 'verbatim': r"""(?s)(?P<code>@example\s.*?@end example\s)""",
- 'verb': r"""(?P<code>@code{.*?})""",
- 'mudela-file': '(?m)^(?!@c)(?P<match>@mudelafile(\[(?P<options>.*?)\])?{(?P<filename>[^}]+)})',
- 'mudela' : '(?m)^(?!@c)(?P<match>@mudela(\[(?P<options>.*?)\])?{(?P<code>.*?)})',
- 'mudela-block': r"""(?m)^(?!@c)(?P<match>(?s)(?P<match>@mudela(\[(?P<options>.*?)\])?\s(?P<code>.*?)@end mudela\s))""",
- 'option-sep' : ', *',
- 'intertext': r',?\s*intertext=\".*?\"',
- 'multiline-comment': r"(?sm)^\s*(?!@c\s+)(?P<code>@ignore\s.*?@end ignore)\s",
- 'singleline-comment': r"(?m)^.*?(?P<match>(?P<code>@c.*$\n+))",
- 'numcols': no_match,
- }
- }
-
-
-for r in re_dict.keys ():
- olddict = re_dict[r]
- newdict = {}
- for k in olddict.keys ():
- newdict[k] = re.compile (olddict[k])
- re_dict[r] = newdict
-
-
-def uniq (list):
- list.sort ()
- s = list
- list = []
- for x in s:
- if x not in list:
- list.append (x)
- return list
-
-
-def get_output (name):
- return output_dict[format][name]
-
-def get_re (name):
- return re_dict[format][name]
-
-def bounding_box_dimensions(fname):
- try:
- fd = open(fname)
- except IOError:
- error ("Error opening `%s'" % fname)
- str = fd.read ()
- s = re.search('%%BoundingBox: ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)', str)
- if s:
- return (int(s.group(3))-int(s.group(1)),
- int(s.group(4))-int(s.group(2)))
- else:
- return (0,0)
-
-
-def error (str):
- sys.stderr.write (str + "\n Exiting ... \n\n")
- raise 'Exiting.'
-
-
-def compose_full_body (body, opts):
- """Construct the mudela code to send to Lilypond.
- Add stuff to BODY using OPTS as options."""
- music_size = default_music_fontsize
- latex_size = default_text_fontsize
- for o in opts:
- if g_force_mudela_fontsize:
- music_size = g_force_mudela_fontsize
- else:
- m = re.match ('([0-9]+)pt', o)
- if m:
- music_size = string.atoi(m.group (1))
-
- m = re.match ('latexfontsize=([0-9]+)pt', o)
- if m:
- latex_size = string.atoi (m.group (1))
-
- if re.search ('\\\\score', body):
- is_fragment = 0
- else:
- is_fragment = 1
- if 'fragment' in opts:
- is_fragment = 1
- if 'nonfragment' in opts:
- is_fragment = 0
-
- if is_fragment and not 'multiline' in opts:
- opts.append('singleline')
- if 'singleline' in opts:
- l = -1.0;
- else:
- l = paperguru.get_linewidth()
-
- if 'relative' in opts:#ugh only when is_fragment
- body = '\\relative c { %s }' % body
-
- if is_fragment:
- body = r"""\score {
- \notes { %s }
- \paper { }
-}""" % body
-
- opts = uniq (opts)
- optstring = string.join (opts, ' ')
- optstring = re.sub ('\n', ' ', optstring)
- body = r"""
-%% Generated by mudela-book.py; options are %s %%ughUGH not original options
-\include "paper%d.ly"
-\paper { linewidth = %f \pt; }
-""" % (optstring, music_size, l) + body
- return body
-
-def parse_options_string(s):
- d = {}
- r1 = re.compile("((\w+)={(.*?)})((,\s*)|$)")
- r2 = re.compile("((\w+)=(.*?))((,\s*)|$)")
- r3 = re.compile("(\w+?)((,\s*)|$)")
- while s:
- m = r1.match(s)
- if m:
- s = s[m.end():]
- d[m.group(2)] = re.split(",\s*", m.group(3))
- continue
- m = r2.match(s)
- if m:
- s = s[m.end():]
- d[m.group(2)] = m.group(3)
- continue
- m = r3.match(s)
- if m:
- s = s[m.end():]
- d[m.group(1)] = 1
- continue
- print "trøbbel:%s:" % s
- return d
-
-def scan_latex_preamble(chunks):
- # first we want to scan the \documentclass line
- # it should be the first non-comment line
- idx = 0
- while 1:
- if chunks[idx][0] == 'ignore':
- idx = idx + 1
- continue
- m = get_re ('header').match(chunks[idx][1])
- options = re.split (',[\n \t]*', m.group(1)[1:-1])
- for o in options:
- if o == 'landscape':
- paperguru.m_landscape = 1
- m = re.match("(.*?)paper", o)
- if m:
- paperguru.m_papersize = m.group()
- else:
- m = re.match("(\d\d)pt", o)
- if m:
- paperguru.m_fontsize = int(m.group(1))
-
- break
- while chunks[idx][0] != 'preamble-end':
- if chunks[idx] == 'ignore':
- idx = idx + 1
- continue
- m = get_re ('geometry').search(chunks[idx][1])
- if m:
- paperguru.m_use_geometry = 1
- o = parse_options_string(m.group('options'))
- for k in o.keys():
- paperguru.set_geo_option(k, o[k])
- idx = idx + 1
-
-def scan_texi_preamble (chunks):
- # this is not bulletproof..., it checks the first 10 chunks
- idx = 0
- while 1:
- if chunks[idx][0] == 'input':
- if string.find(chunks[idx][1], "@afourpaper") != -1:
- paperguru.m_papersize = 'a4'
- elif string.find(chunks[idx][1], "@afourwide") != -1:
- paperguru.m_papersize = 'a4wide'
- elif string.find(chunks[idx][1], "@smallbook") != -1:
- paperguru.m_papersize = 'smallbook'
- idx = idx + 1
- if idx == 10 or idx == len(chunks):
- break
-
-def scan_preamble (chunks):
- if __main__.format == 'texi':
- scan_texi_preamble(chunks)
- else:
- assert __main__.format == 'latex'
- scan_latex_preamble(chunks)
-
-
-def completize_preamble (chunks):
- if __main__.format == 'texi':
- return chunks
- pre_b = post_b = graphics_b = None
- for chunk in chunks:
- if chunk[0] == 'preamble-end':
- break
- if chunk[0] == 'input':
- m = get_re('def-pre-re').search(chunk[1])
- if m:
- pre_b = 1
- if chunk[0] == 'input':
- m = get_re('def-post-re').search(chunk[1])
- if m:
- post_b = 1
- if chunk[0] == 'input':
- m = get_re('usepackage-graphics').search(chunk[1])
- if m:
- graphics_b = 1
- x = 0
- while chunks[x][0] != 'preamble-end':
- x = x + 1
- if not pre_b:
- chunks.insert(x, ('input', get_output ('output-default-pre')))
- if not post_b:
- chunks.insert(x, ('input', get_output ('output-default-post')))
- if not graphics_b:
- chunks.insert(x, ('input', get_output ('usepackage-graphics')))
- return chunks
-
-
-read_files = []
-def find_file (name):
- f = None
- for a in include_path:
- try:
- nm = os.path.join (a, name)
- f = open (nm)
- __main__.read_files.append (nm)
- break
- except IOError:
- pass
- if f:
- return f.read ()
- else:
- error ("File not found `%s'\n" % name)
- return ''
-
-def do_ignore(match_object):
- return [('ignore', match_object.group('code'))]
-def do_preamble_end(match_object):
- return [('preamble-end', match_object.group('code'))]
-
-def make_verbatim(match_object):
- return [('verbatim', match_object.group('code'))]
-
-def make_verb(match_object):
- return [('verb', match_object.group('code'))]
-
-def do_include_file(m):
- "m: MatchObject"
- return [('input', get_output ('pagebreak'))] \
- + read_doc_file(m.group('filename')) \
- + [('input', get_output ('pagebreak'))]
-
-def do_input_file(m):
- return read_doc_file(m.group('filename'))
-
-def make_mudela(m):
- if m.group('options'):
- options = m.group('options')
- else:
- options = ''
- return [('input', get_output('output-mudela-fragment') %
- (options, m.group('code')))]
-
-def make_mudela_file(m):
- if m.group('options'):
- options = m.group('options')
- else:
- options = ''
- return [('input', get_output('output-mudela') %
- (options, find_file(m.group('filename'))))]
-
-def make_mudela_block(m):
- if m.group('options'):
- options = get_re('option-sep').split (m.group('options'))
- else:
- options = []
- options = filter(lambda s: s != '', options)
- return [('mudela', m.group('code'), options)]
-
-def do_columns(m):
- if __main__.format != 'latex':
- return []
- if m.group('num') == 'one':
- return [('numcols', m.group('code'), 1)]
- if m.group('num') == 'two':
- return [('numcols', m.group('code'), 2)]
-
-def chop_chunks(chunks, re_name, func, use_match=0):
- newchunks = []
- for c in chunks:
- if c[0] == 'input':
- str = c[1]
- while str:
- m = get_re (re_name).search (str)
- if m == None:
- newchunks.append (('input', str))
- str = ''
- else:
- if use_match:
- newchunks.append (('input', str[:m.start ('match')]))
- else:
- newchunks.append (('input', str[:m.start (0)]))
- #newchunks.extend(func(m))
- # python 1.5 compatible:
- newchunks = newchunks + func(m)
- str = str [m.end(0):]
- else:
- newchunks.append(c)
- return newchunks
-
-def read_doc_file (filename):
- """Read the input file, find verbatim chunks and do \input and \include
- """
- str = ''
- str = find_file(filename)
-
- if __main__.format == '':
- latex = re.search ('\\\\document', str[:200])
- texinfo = re.search ('@node|@setfilename', str[:200])
- if (texinfo and latex) or not (texinfo or latex):
- error("error: can't determine format, please specify")
- if texinfo:
- __main__.format = 'texi'
- else:
- __main__.format = 'latex'
- if __main__.format == 'texi':
- __main__.paperguru = TexiPaper()
- else:
- __main__.paperguru = LatexPaper()
- chunks = [('input', str)]
- # we have to check for verbatim before doing include,
- # because we don't want to include files that are mentioned
- # inside a verbatim environment
- chunks = chop_chunks(chunks, 'verbatim', make_verbatim)
- chunks = chop_chunks(chunks, 'verb', make_verb)
- chunks = chop_chunks(chunks, 'multiline-comment', do_ignore)
- #ugh fix input
- chunks = chop_chunks(chunks, 'include', do_include_file, 1)
- chunks = chop_chunks(chunks, 'input', do_input_file, 1)
- return chunks
-
-
-taken_file_names = {}
-def schedule_mudela_block (chunk):
- """Take the body and options from CHUNK, figure out how the
- real .ly should look, and what should be left MAIN_STR (meant
- for the main file). The .ly is written, and scheduled in
- TODO.
-
- Return: a chunk (TYPE_STR, MAIN_STR, OPTIONS, TODO, BASE)
-
- TODO has format [basename, extension, extension, ... ]
-
- """
- (type, body, opts) = chunk
- assert type == 'mudela'
- file_body = compose_full_body (body, opts)
- basename = `abs(hash (file_body))`
- for o in opts:
- m = re.search ('filename="(.*?)"', o)
- if m:
- basename = m.group (1)
- if not taken_file_names.has_key(basename):
- taken_file_names[basename] = 0
- else:
- taken_file_names[basename] = taken_file_names[basename] + 1
- basename = basename + "-%i" % taken_file_names[basename]
- if not g_read_lys:
- update_file(file_body, os.path.join(g_outdir, basename) + '.ly')
- needed_filetypes = ['tex']
-
- if format == 'texi':
- needed_filetypes.append('eps')
- needed_filetypes.append('png')
- if 'eps' in opts and not ('eps' in needed_filetypes):
- needed_filetypes.append('eps')
- outname = os.path.join(g_outdir, basename)
- def f(base, ext1, ext2):
- a = os.path.isfile(base + ext2)
- if (os.path.isfile(base + ext1) and
- os.path.isfile(base + ext2) and
- os.stat(base+ext1)[stat.ST_MTIME] >
- os.stat(base+ext2)[stat.ST_MTIME]) or \
- not os.path.isfile(base + ext2):
- return 1
- todo = []
- if 'tex' in needed_filetypes and f(outname, '.ly', '.tex'):
- todo.append('tex')
- if 'eps' in needed_filetypes and f(outname, '.tex', '.eps'):
- todo.append('eps')
- if 'png' in needed_filetypes and f(outname, '.eps', '.png'):
- todo.append('png')
- newbody = ''
- if 'verbatim' in opts:
- newbody = output_verbatim (body)
-
- for o in opts:
- m = re.search ('intertext="(.*?)"', o)
- if m:
- newbody = newbody + m.group (1) + "\n\n"
- if format == 'latex':
- if 'eps' in opts:
- s = 'output-eps'
- else:
- s = 'output-tex'
- else: # format == 'texi'
- s = 'output-all'
- newbody = newbody + get_output(s) % {'fn': basename }
- return ('mudela', newbody, opts, todo, basename)
-
-def process_mudela_blocks(outname, chunks):#ugh rename
- newchunks = []
- # Count sections/chapters.
- for c in chunks:
- if c[0] == 'mudela':
- c = schedule_mudela_block (c)
- elif c[0] == 'numcols':
- paperguru.m_num_cols = c[2]
- newchunks.append (c)
- return newchunks
-
-
-def find_eps_dims (match):
- "Fill in dimensions of EPS files."
-
- fn =match.group (1)
- dims = bounding_box_dimensions (fn)
- if g_outdir:
- fn = os.path.join(g_outdir, fn)
-
- return '%ipt' % dims[0]
-
-
-def system (cmd):
- sys.stderr.write ("invoking `%s'\n" % cmd)
- st = os.system (cmd)
- if st:
- error ('Error command exited with value %d\n' % st)
- return st
-
-def compile_all_files (chunks):
- eps = []
- tex = []
- png = []
-
- for c in chunks:
- if c[0] <> 'mudela':
- continue
- base = c[4]
- exts = c[3]
- for e in exts:
- if e == 'eps':
- eps.append (base)
- elif e == 'tex':
- #ugh
- if base + '.ly' not in tex:
- tex.append (base + '.ly')
- elif e == 'png' and g_do_pictures:
- png.append (base)
- d = os.getcwd()
- if g_outdir:
- os.chdir(g_outdir)
- if tex:
- # fixme: be sys-independent.
- def incl_opt (x):
- if g_outdir and x[0] <> '/' :
- x = os.path.join (g_here_dir, x)
- return ' -I %s' % x
-
- incs = map (incl_opt, include_path)
- lilyopts = string.join (incs, ' ' )
- texfiles = string.join (tex, ' ')
- system ('lilypond %s %s' % (lilyopts, texfiles))
- for e in eps:
- system(r"tex '\nonstopmode \input %s'" % e)
- system(r"dvips -E -o %s %s" % (e + '.eps', e))
- for g in png:
- cmd = r"""gs -sDEVICE=pgm -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=- -r90 -dNOPAUSE %s -c quit | pnmcrop | pnmtopng > %s"""
- cmd = cmd % (g + '.eps', g + '.png')
- system (cmd)
- if g_outdir:
- os.chdir(d)
-
-
-def update_file (body, name):
- """
- write the body if it has changed
- """
- same = 0
- try:
- f = open (name)
- fs = f.read (-1)
- same = (fs == body)
- except:
- pass
-
- if not same:
- f = open (name , 'w')
- f.write (body)
- f.close ()
-
- return not same
-
-
-def getopt_args (opts):
- "Construct arguments (LONG, SHORT) for getopt from list of options."
- short = ''
- long = []
- for o in opts:
- if o[1]:
- short = short + o[1]
- if o[0]:
- short = short + ':'
- if o[2]:
- l = o[2]
- if o[0]:
- l = l + '='
- long.append (l)
- return (short, long)
-
-def option_help_str (o):
- "Transform one option description (4-tuple ) into neatly formatted string"
- sh = ' '
- if o[1]:
- sh = '-%s' % o[1]
-
- sep = ' '
- if o[1] and o[2]:
- sep = ','
-
- long = ''
- if o[2]:
- long= '--%s' % o[2]
-
- arg = ''
- if o[0]:
- if o[2]:
- arg = '='
- arg = arg + o[0]
- return ' ' + sh + sep + long + arg
-
-
-def options_help_str (opts):
- "Convert a list of options into a neatly formatted string"
- w = 0
- strs =[]
- helps = []
-
- for o in opts:
- s = option_help_str (o)
- strs.append ((s, o[3]))
- if len (s) > w:
- w = len (s)
-
- str = ''
- for s in strs:
- str = str + '%s%s%s\n' % (s[0], ' ' * (w - len(s[0]) + 3), s[1])
- return str
-
-def help():
- sys.stdout.write("""Usage: mudela-book [options] FILE\n
-Generate hybrid LaTeX input from Latex + mudela
-Options:
-""")
- sys.stdout.write (options_help_str (option_definitions))
- sys.stdout.write (r"""Warning all output is written in the CURRENT directory
-
-
-
-Report bugs to bug-gnu-music@gnu.org.
-
-Written by Tom Cato Amundsen <tca@gnu.org> and
-Han-Wen Nienhuys <hanwen@cs.uu.nl>
-""")
-
- sys.exit (0)
-
-
-def write_deps (fn, target):
- sys.stdout.write('writing `%s\'\n' % os.path.join(g_outdir, fn))
- f = open (os.path.join(g_outdir, fn), 'w')
- f.write ('%s%s: ' % (g_dep_prefix, target))
- for d in __main__.read_files:
- f.write ('%s ' % d)
- f.write ('\n')
- f.close ()
- __main__.read_files = []
-
-def identify():
- sys.stdout.write ('mudela-book (GNU LilyPond) %s\n' % program_version)
-
-def print_version ():
- identify()
- sys.stdout.write (r"""Copyright 1998--1999
-Distributed under terms of the GNU General Public License. It comes with
-NO WARRANTY.
-""")
-
-def do_file(input_filename):
- file_settings = {}
- if outname:
- my_outname = outname
- else:
- my_outname = os.path.basename(os.path.splitext(input_filename)[0])
- my_depname = my_outname + '.dep'
-
- chunks = read_doc_file(input_filename)
- chunks = chop_chunks(chunks, 'mudela', make_mudela, 1)
- chunks = chop_chunks(chunks, 'mudela-file', make_mudela_file, 1)
- chunks = chop_chunks(chunks, 'mudela-block', make_mudela_block, 1)
- chunks = chop_chunks(chunks, 'singleline-comment', do_ignore, 1)
- chunks = chop_chunks(chunks, 'preamble-end', do_preamble_end)
- chunks = chop_chunks(chunks, 'numcols', do_columns)
- #print "-" * 50
- #for c in chunks: print "c:", c;
- #sys.exit()
- scan_preamble(chunks)
- chunks = process_mudela_blocks(my_outname, chunks)
- # Do It.
- if __main__.g_run_lilypond:
- compile_all_files (chunks)
- newchunks = []
- # finishing touch.
- for c in chunks:
- if c[0] == 'mudela' and 'eps' in c[2]:
- body = re.sub (r"""\\mudelaepswidth{(.*?)}""", find_eps_dims, c[1])
- newchunks.append (('mudela', body))
- else:
- newchunks.append (c)
- chunks = newchunks
- x = 0
- chunks = completize_preamble (chunks)
- foutn = os.path.join(g_outdir, my_outname + '.' + format)
- sys.stderr.write ("Writing `%s'\n" % foutn)
- fout = open (foutn, 'w')
- for c in chunks:
- fout.write (c[1])
- fout.close ()
-
- if do_deps:
- write_deps (my_depname, foutn)
-
-
-outname = ''
-try:
- (sh, long) = getopt_args (__main__.option_definitions)
- (options, files) = getopt.getopt(sys.argv[1:], sh, long)
-except getopt.error, msg:
- sys.stderr.write("error: %s" % msg)
- sys.exit(1)
-
-do_deps = 0
-for opt in options:
- o = opt[0]
- a = opt[1]
-
- if o == '--include' or o == '-I':
- include_path.append (a)
- elif o == '--version' or o == '-v':
- print_version ()
- sys.exit (0)
- elif o == '--format' or o == '-f':
- __main__.format = a
- elif o == '--outname' or o == '-o':
- if len(files) > 1:
- #HACK
- sys.stderr.write("Mudela-book is confused by --outname on multiple files")
- sys.exit(1)
- outname = a
- elif o == '--help' or o == '-h':
- help ()
- elif o == '--no-lily' or o == '-n':
- __main__.g_run_lilypond = 0
- elif o == '--dependencies' or o == '-M':
- do_deps = 1
- elif o == '--default-music-fontsize':
- default_music_fontsize = string.atoi (a)
- elif o == '--default-mudela-fontsize':
- print "--default-mudela-fontsize is deprecated, use --default-music-fontsize"
- default_music_fontsize = string.atoi (a)
- elif o == '--force-music-fontsize':
- g_force_mudela_fontsize = string.atoi(a)
- elif o == '--force-mudela-fontsize':
- print "--force-mudela-fontsize is deprecated, use --default-mudela-fontsize"
- g_force_mudela_fontsize = string.atoi(a)
- elif o == '--dep-prefix':
- g_dep_prefix = a
- elif o == '--no-pictures':
- g_do_pictures = 0
- elif o == '--read-lys':
- g_read_lys = 1
- elif o == '--outdir':
- g_outdir = a
-
-identify()
-if g_outdir:
- if os.path.isfile(g_outdir):
- error ("outdir is a file: %s" % g_outdir)
- if not os.path.exists(g_outdir):
- os.mkdir(g_outdir)
-for input_filename in files:
- do_file(input_filename)
-
-#
-# Petr, ik zou willen dat ik iets zinvoller deed,
-# maar wat ik kan ik doen, het verandert toch niets?
-# --hwn 20/aug/99
def get_num_instruments (s):
return ''
-def get_mudela_notename (p, ac):
+def get_lilypond_notename (p, ac):
if p > 5:
p = p - 7
s = chr (p + ord ('c'))
\rhead{}
\chead{}
\lfoot{}
-\cfoot{\ifnum\thepage=1{\hfill\mudelatagline}\fi}
+\cfoot{\ifnum\thepage=1{\hfill\lilypondtagline}\fi}
\rfoot{\ifnum\thepage>1{\hfill\thepage\hfill}\fi}
\headrulewidth0mm
\pagestyle{fancy}
\newdimen\lypdf@bracket_t
\def\lypdf@load_bracket_dimens{
- \lypdf@interline=\mudelapaperinterline pt
+ \lypdf@interline=\lilypondpaperinterline pt
\lypdf@bracket_b=0.3333\lypdf@interline
\lypdf@bracket_w=2\lypdf@interline
\lypdf@bracket_v=1.5\lypdf@interline
\lypdf@bracket_u=\lypdf@bracket_v
- \lypdf@bracket_t=\mudelapaperstaffline pt
+ \lypdf@bracket_t=\lilypondpaperstaffline pt
\lypdf@bracket_t=2\lypdf@bracket_t
\relax
}
% by executing a 0 0 moveto
\def\embeddedps##1{%
\special{ps: @beginspecial @setspecial
- \mudelapaperoutputscale\lilySpace
- \mudelapaperoutputscale\lilySpace scale
+ \lilypondpaperoutputscale\lilySpace
+ \lilypondpaperoutputscale\lilySpace scale
##1 @endspecial}%
}
}
\renewcommand{\@evenfoot}{}%
\renewcommand{\@evenhead}{}%
\renewcommand{\@oddfoot}{%
- \ifnum\thepage=1{\hfil \mudelatagline}%
+ \ifnum\thepage=1{\hfil \lilypondtagline}%
\else{%
foo\hfil\the\pageno\hfil}%
\fi}}
\renewcommand{\@evenfoot}{}%
\renewcommand{\@evenhead}{}%
\renewcommand{\@oddfoot}{%
- \ifnum\thepage=1{\hfil \mudelatagline}%
+ \ifnum\thepage=1{\hfil \lilypondtagline}%
\else{foo\hfil\the\pageno\hfil}%
\fi}}%
\nopagenumbers
\def\texsuffix{PlainTeX}
\def\lilyfooterPlainTeX{
- \footline={\ifnum\pageno=1\smalltextfont\mudelacopyright\hfil \mudelatagline
+ \footline={\ifnum\pageno=1\smalltextfont\lilypondcopyright\hfil \lilypondtagline
\else\hfil\the\pageno\hfil\fi}%
}
\advance\hoffset by -.6in
\def\myfilbreak{\par\vfil\penalty200\vfilneg}
% stacked horizontal lines
-\ifundefined{mudelapaperinterscoreline}
- \def\mudelapaperinterscoreline{16}
+\ifundefined{lilypondpaperinterscoreline}
+ \def\lilypondpaperinterscoreline{16}
\fi
-\ifundefined{mudelapaperinterscorelinefill}
- \def\mudelapaperinterscorelinefill{0}
+\ifundefined{lilypondpaperinterscorelinefill}
+ \def\lilypondpaperinterscorelinefill{0}
\fi
-\def\interscoreline{\vskip\mudelapaperinterscoreline pt plus %
- \mudelapaperinterscorelinefill fill\myfilbreak}
+\def\interscoreline{\vskip\lilypondpaperinterscoreline pt plus %
+ \lilypondpaperinterscorelinefill fill\myfilbreak}
\def\placebox#1#2#3{%
\botalign{\hbox{\raise #1\leftalign{\kern #2{}#3}}}}%
% ugh: trick to get examples not generate par
% these are for 16pt
-\def\mudelapaperlinewidth{-28.452756}%
-\def\mudelapaperindent{28.452756}%
-\def\mudelapaperrulethickness{0.400000}%
-\def\mudelapaperbarsize{16.000000}%
-\def\mudelapaperinterline{4.000000}%
-\def\mudelapapernotewidth{5.930000}%
-\def\mudelapaperwholewidth{8.640000}%
-\def\mudelapaperunitspace{22.000000}%
-\def\mudelapaperbasicspace{4.000000}%
-\def\mudelapapergeometric{0.000000}%
-\def\mudelapaperarithmetic_basicspace{2.000000}%
-\def\mudelapaperarithmetic_multiplier{4.800000}%
-\def\mudelapaperinterbeam{3.140000}%
-\def\mudelapapergourlay_energybound{100000.000000}%
-\def\mudelapapergourlay_maxmeasures{14.000000}%
+\def\lilypondpaperlinewidth{-28.452756}%
+\def\lilypondpaperindent{28.452756}%
+\def\lilypondpaperrulethickness{0.400000}%
+\def\lilypondpaperbarsize{16.000000}%
+\def\lilypondpaperinterline{4.000000}%
+\def\lilypondpapernotewidth{5.930000}%
+\def\lilypondpaperwholewidth{8.640000}%
+\def\lilypondpaperunitspace{22.000000}%
+\def\lilypondpaperbasicspace{4.000000}%
+\def\lilypondpapergeometric{0.000000}%
+\def\lilypondpaperarithmetic_basicspace{2.000000}%
+\def\lilypondpaperarithmetic_multiplier{4.800000}%
+\def\lilypondpaperinterbeam{3.140000}%
+\def\lilypondpapergourlay_energybound{100000.000000}%
+\def\lilypondpapergourlay_maxmeasures{14.000000}%
% huh?
-% \def\exampleheight{2\mudelapaperbarsize pt}
+% \def\exampleheight{2\lilypondpaperbarsize pt}
\def\exampleheight{2cm}
% ful of pars, needs the above
\newcommand*{\meter}[1]{\def\themeter{#1}}
\newcommand*{\poet}[1]{\def\thepoet{#1}}
%
-\newcommand*{\mudelatitle}[1]{\def\thetitle{#1}}
-\newcommand*{\mudelasubtitle}[1]{\def\thesubtitle{#1}}
-\newcommand*{\mudelafooter}[1]{\def\thefooter{#1}}
-\newcommand*{\mudelahead}[1]{\def\theheader{#1}}
-\newcommand*{\mudelacomposer}[1]{\def\thecomposer{#1}}
-\newcommand*{\mudelaarranger}[1]{\def\thearranger{#1}}
-\newcommand*{\mudelainstrument}[1]{\def\theinstrument{#1}}
-\newcommand*{\mudelaopus}[1]{\def\theopus{#1}}
-\newcommand*{\mudelapiece}[1]{\def\thepiece{#1}}
-\newcommand*{\mudelametre}[1]{\def\themeter{#1}}
-\newcommand*{\mudelameter}[1]{\def\themeter{#1}}
-\newcommand*{\mudelapoet}[1]{\def\thepoet{#1}}
+\newcommand*{\lilypondtitle}[1]{\def\thetitle{#1}}
+\newcommand*{\lilypondsubtitle}[1]{\def\thesubtitle{#1}}
+\newcommand*{\lilypondfooter}[1]{\def\thefooter{#1}}
+\newcommand*{\lilypondhead}[1]{\def\theheader{#1}}
+\newcommand*{\lilypondcomposer}[1]{\def\thecomposer{#1}}
+\newcommand*{\lilypondarranger}[1]{\def\thearranger{#1}}
+\newcommand*{\lilypondinstrument}[1]{\def\theinstrument{#1}}
+\newcommand*{\lilypondopus}[1]{\def\theopus{#1}}
+\newcommand*{\lilypondpiece}[1]{\def\thepiece{#1}}
+\newcommand*{\lilypondmetre}[1]{\def\themeter{#1}}
+\newcommand*{\lilypondmeter}[1]{\def\themeter{#1}}
+\newcommand*{\lilypondpoet}[1]{\def\thepoet{#1}}
%
%
-\def\mudelanull{}%
+\def\lilypondnull{}%
%
\def\makelilytitle{%
\begin{center}
\bfseries
- \ifx\mudelanull\thetitle\else{\huge\thetitle}\\ \fi
- \ifx\mudelanull\thesubtitle\else{\Large\thesubtitle}\\ \fi
+ \ifx\lilypondnull\thetitle\else{\huge\thetitle}\\ \fi
+ \ifx\lilypondnull\thesubtitle\else{\Large\thesubtitle}\\ \fi
\end{center}
\bigskip
% urg
\edef\saveparskip{\parskip}\parskip-5mm
\begin{minipage}[t]{0.45\textwidth}
- \ifx\mudelanull\thepoet\else{\thepoet}\\ \fi
- \ifx\mudelanull\themeter\else{\themeter}\\ \fi
+ \ifx\lilypondnull\thepoet\else{\thepoet}\\ \fi
+ \ifx\lilypondnull\themeter\else{\themeter}\\ \fi
\end{minipage}\hspace*{\fill}
\begin{minipage}[t]{0.45\textwidth}
\begin{flushright}
- \ifx\mudelanull\thecomposer\else{\large\normalfont\scshape\thecomposer}\\ \fi
- \ifx\mudelanull\theopus\else{\theopus}\\ \fi
- \ifx\mudelanull\thearranger\else{\thearranger}\\ \fi
+ \ifx\lilypondnull\thecomposer\else{\large\normalfont\scshape\thecomposer}\\ \fi
+ \ifx\lilypondnull\theopus\else{\theopus}\\ \fi
+ \ifx\lilypondnull\thearranger\else{\thearranger}\\ \fi
\end{flushright}%
\end{minipage}\par
\parskip\saveparskip