From 3d9696e22da65590c6cb373d7d7ed0ea80c05821 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 00:32:56 +0000 Subject: [PATCH] lilypond-1.3.107 --- CHANGES | 40 + Documentation/GNUmakefile | 2 +- Documentation/bibliography/GNUmakefile | 2 +- Documentation/index.texi | 4 +- Documentation/regression-test.tely | 124 +- Documentation/topdocs/AUTHORS.texi | 4 +- Documentation/topdocs/GNUmakefile | 2 +- Documentation/topdocs/INSTALL.texi | 10 +- Documentation/topdocs/index.tely | 4 +- Documentation/user/GNUmakefile | 26 +- Documentation/user/convert-ly.itexi | 36 + Documentation/user/glossary.tely | 276 ++--- Documentation/user/invoking.itexi | 2 +- .../user/latex-lilypond-example.latex | 163 +++ Documentation/user/lilypond-book.tely | 636 ++++++++++ Documentation/user/lilypond.tely | 4 +- Documentation/user/ly2dvi.texi | 6 +- Documentation/user/tutorial.itely | 26 +- aclocal.m4 | 1 + config.make.in | 1 + input/test/allfontstyle.ly | 2 +- input/test/beam-position.ly | 2 +- input/test/chord-names.ly | 2 +- input/test/collisions.ly | 13 +- input/test/force-hshift.ly | 12 +- input/test/hshift.ly | 22 +- lily/auto-beam-engraver.cc | 7 +- lily/auto-change-iterator.cc | 4 +- lily/auto-change-music.cc | 6 +- lily/bar-engraver.cc | 8 - lily/beam-engraver.cc | 7 +- lily/change-iterator.cc | 2 + lily/chord-name-engraver.cc | 10 +- lily/chord-tremolo-engraver.cc | 5 +- lily/chord-tremolo-iterator.cc | 5 +- lily/chord.cc | 108 +- lily/clef-engraver.cc | 3 - lily/clef-item.cc | 13 +- lily/command-request.cc | 53 +- lily/context-specced-music.cc | 6 +- lily/custos-engraver.cc | 5 +- lily/duration.cc | 139 ++- lily/folded-repeat-iterator.cc | 2 + lily/grace-iterator.cc | 2 + lily/grace-music.cc | 4 +- lily/identifier.cc | 3 - lily/include/auto-change-iterator.hh | 2 + lily/include/change-iterator.hh | 2 +- lily/include/chord-tremolo-iterator.hh | 1 + lily/include/chord.hh | 12 +- lily/include/command-request.hh | 58 +- lily/include/context-specced-music.hh | 9 - lily/include/duration.hh | 30 +- lily/include/folded-repeat-iterator.hh | 2 + lily/include/grace-iterator.hh | 2 +- lily/include/identifier.hh | 6 +- lily/include/lily-proto.hh | 3 +- lily/include/lilypond-input-version.hh | 30 + lily/include/lyric-combine-music-iterator.hh | 2 +- lily/include/main.hh | 2 +- lily/include/moment.hh | 2 +- lily/include/music-iterator-ctor.hh | 5 +- lily/include/music-iterator.hh | 28 +- lily/include/music-list.hh | 2 +- lily/include/music-output-def.hh | 4 +- lily/include/music-output.hh | 2 +- lily/include/music-wrapper-iterator.hh | 1 + lily/include/musical-pitch.hh | 36 +- lily/include/musical-request.hh | 29 +- lily/include/my-lily-lexer.hh | 2 +- lily/include/note-column.hh | 1 - .../include/output-property-music-iterator.hh | 1 + lily/include/part-combine-music-iterator.hh | 2 +- lily/include/property-iterator.hh | 3 + lily/include/repeated-music.hh | 18 +- lily/include/request-chord-iterator.hh | 1 + lily/include/sequential-music-iterator.hh | 1 + lily/include/simple-music-iterator.hh | 1 + lily/include/simultaneous-music-iterator.hh | 3 +- lily/include/time-scaled-music-iterator.hh | 1 + lily/include/time-signature-performer.hh | 21 - lily/include/unfolded-repeat-iterator.hh | 16 + lily/key-engraver.cc | 2 +- lily/lexer.ll | 43 +- lily/lily-guile.cc | 2 + lily/lilypond-version.cc | 42 + lily/local-key-engraver.cc | 8 +- lily/local-key-item.cc | 35 +- lily/lyric-combine-music-iterator.cc | 2 + lily/lyric-combine-music.cc | 4 +- lily/midi-def.cc | 2 +- lily/moment.cc | 4 +- lily/music-iterator-ctor.cc | 20 +- lily/music-iterator.cc | 76 +- lily/music-list.cc | 17 +- lily/music-wrapper-iterator.cc | 2 + lily/music.cc | 9 + lily/musical-pitch.cc | 207 +++- lily/musical-request.cc | 33 +- lily/my-lily-parser.cc | 2 +- lily/note-column.cc | 6 - lily/note-heads-engraver.cc | 15 +- lily/note-name-engraver.cc | 2 +- lily/note-performer.cc | 3 +- lily/output-property-engraver.cc | 4 +- lily/output-property-music-iterator.cc | 2 + lily/paper-outputter.cc | 2 +- lily/paper-score.cc | 6 +- lily/parser.yy | 350 +++--- lily/part-combine-music-iterator.cc | 30 +- lily/part-combine-music.cc | 4 +- lily/property-iterator.cc | 4 + lily/repeated-music.cc | 58 +- lily/request-chord-iterator.cc | 2 + lily/rest-collision.cc | 26 +- lily/rest-engraver.cc | 11 +- lily/score-engraver.cc | 4 +- lily/sequential-music-iterator.cc | 1 + lily/simple-music-iterator.cc | 2 + lily/simultaneous-music-iterator.cc | 2 + lily/spacing-engraver.cc | 4 +- lily/stem-engraver.cc | 8 +- lily/stem.cc | 6 +- lily/tie-engraver.cc | 9 +- lily/tie-performer.cc | 9 +- lily/time-scaled-music-iterator.cc | 2 + lily/time-scaled-music.cc | 5 +- lily/time-signature-performer.cc | 54 +- lily/unfolded-repeat-iterator.cc | 31 +- lilypond-mode.el | 3 +- ly/catalan.ly | 98 +- ly/chord-modifiers.ly | 16 +- ly/declarations-as.ly | 7 +- ly/declarations.ly | 6 +- ly/deutsch.ly | 72 +- ly/english.ly | 142 +-- ly/italiano.ly | 70 +- ly/midi.ly | 1 + ly/nederlands.ly | 81 +- ly/norsk.ly | 146 +-- ly/svenska.ly | 70 +- ps/lilyponddefs.ps | 6 +- scm/ascii-script.scm | 4 +- scm/chord-names.scm | 19 +- scm/element-descriptions.scm | 3 +- scm/font.scm | 49 +- scm/interface.scm | 13 +- scm/lily.scm | 43 +- scm/translator-description.scm | 29 +- scripts/abc2ly.py | 18 +- scripts/convert-ly.py | 697 +++++++++++ scripts/lilypond-book.py | 1102 +++++++++++++++++ scripts/ly2dvi.py | 30 +- scripts/musedata2ly.py | 2 +- stepmake/aclocal.m4 | 1 + stepmake/make/stepmake.make | 15 +- stepmake/stepmake/no-builtin-rules.make | 242 ++++ stepmake/stepmake/texinfo-targets.make | 4 +- tex/headers.tex | 2 +- tex/lily-pdf-defs.tex | 4 +- tex/lily-ps-defs.tex | 4 +- tex/lilypond-latex.tex | 4 +- tex/lilypond-plaintex.tex | 2 +- tex/lilyponddefs.tex | 12 +- tex/mudela-book.tex | 32 +- tex/titledefs.tex | 40 +- 166 files changed, 4898 insertions(+), 1518 deletions(-) create mode 100644 Documentation/user/convert-ly.itexi create mode 100644 Documentation/user/latex-lilypond-example.latex create mode 100644 Documentation/user/lilypond-book.tely create mode 100644 lily/include/lilypond-input-version.hh create mode 100644 lily/lilypond-version.cc create mode 100644 scripts/convert-ly.py create mode 100644 scripts/lilypond-book.py create mode 100644 stepmake/stepmake/no-builtin-rules.make diff --git a/CHANGES b/CHANGES index ecca8a8e2d..b4796d80bc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,43 @@ +1.3.106.jcn2 +============ + +* Cross compilation and info build fixes, really cancel all builtin +rules, sigh. + +* 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 ============ diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile index 6a80c86165..1b3462f693 100644 --- a/Documentation/GNUmakefile +++ b/Documentation/GNUmakefile @@ -3,7 +3,7 @@ depth = .. 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= diff --git a/Documentation/bibliography/GNUmakefile b/Documentation/bibliography/GNUmakefile index bca6b910c8..2c193065be 100644 --- a/Documentation/bibliography/GNUmakefile +++ b/Documentation/bibliography/GNUmakefile @@ -7,7 +7,7 @@ BIB_FILES= $(wildcard *.bib) 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 diff --git a/Documentation/index.texi b/Documentation/index.texi index bdc4f52267..16bdae85a3 100644 --- a/Documentation/index.texi +++ b/Documentation/index.texi @@ -25,9 +25,9 @@ also available in @uref{../user/out-www/lilypond.ps.gz,Postscript} @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} diff --git a/Documentation/regression-test.tely b/Documentation/regression-test.tely index 63774881e4..a2d0289437 100644 --- a/Documentation/regression-test.tely +++ b/Documentation/regression-test.tely @@ -29,7 +29,7 @@ Rests. Note that the dot of 8th, 16th and 32nd rests rest should be 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, @@ -39,7 +39,7 @@ Harmonic notes have a different shape and different 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 @@ -47,12 +47,12 @@ should go up, but in case of multiple parts, the down stems have down 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 @@ -60,20 +60,20 @@ multi-measure-rest is a Spanner, minimum distances are set to keep it 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 @@ -82,7 +82,7 @@ crossing stems. If the stem is in a beam, the tremolo must be parallel 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 @@ -90,7 +90,7 @@ leave a gap. Chord tremolo beams on half notes are not ambiguous, 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 @@ -100,28 +100,28 @@ Stems, beams, ties and slurs should behave similarly, when placed 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} @@ -131,7 +131,7 @@ Chord names are generated from a list pitches, and are customisable from guile. For some unlogical names, guile customisation is used by default. -@mudelafile{chord-names.ly} +@lilypondfile{chord-names.ly} @section Grace notes @@ -147,7 +147,7 @@ main note. Grace notes can also be positioned after the main note. 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 @@ -155,45 +155,45 @@ Beaming is generated automatically. Beams may cross bar lines. In that 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 @@ -203,32 +203,32 @@ boundaries should be explicit. 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 @@ -243,26 +243,26 @@ the number of 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 @@ -276,11 +276,11 @@ precook a chord of staffs/lyrics and label those. Of course 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 @@ -290,26 +290,26 @@ inside the staff, and by half spaces outside. Notice that the half 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 @@ -323,25 +323,25 @@ must stretch like the space within the measure. 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} @@ -355,19 +355,19 @@ textNonEmpty is used to respect the horizontal size of text. 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 @@ -375,37 +375,37 @@ room for the breathing sign. Breathing signs break beams running 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 @@ -416,7 +416,7 @@ size. For octaviated clefs, the ``8'' should appear closely above or 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 @@ -424,7 +424,7 @@ appear without barlines. The restoration accidentals are not printed at the start of the line. If @code{createKeyOnClefChange} is set, they're also created on a clef change. -@mudelafile{keys.ly} +@lilypondfile{keys.ly} @@ -449,11 +449,11 @@ signatures. 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 diff --git a/Documentation/topdocs/AUTHORS.texi b/Documentation/topdocs/AUTHORS.texi index c1fa015491..de250b805c 100644 --- a/Documentation/topdocs/AUTHORS.texi +++ b/Documentation/topdocs/AUTHORS.texi @@ -17,7 +17,7 @@ list is alphabetically ordered. @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. @@ -73,7 +73,7 @@ list is alphabetically ordered. @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 diff --git a/Documentation/topdocs/GNUmakefile b/Documentation/topdocs/GNUmakefile index 254c98a837..cfef864200 100644 --- a/Documentation/topdocs/GNUmakefile +++ b/Documentation/topdocs/GNUmakefile @@ -2,7 +2,7 @@ depth = ../.. 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)) diff --git a/Documentation/topdocs/INSTALL.texi b/Documentation/topdocs/INSTALL.texi index c414acdcc5..e76f50d0eb 100644 --- a/Documentation/topdocs/INSTALL.texi +++ b/Documentation/topdocs/INSTALL.texi @@ -172,14 +172,16 @@ This will install a number of files, something close to: /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 diff --git a/Documentation/topdocs/index.tely b/Documentation/topdocs/index.tely index 41261c7836..5082a16de6 100644 --- a/Documentation/topdocs/index.tely +++ b/Documentation/topdocs/index.tely @@ -29,9 +29,9 @@ editor to enter it, you can put it in mail or embed it in an article like 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 diff --git a/Documentation/user/GNUmakefile b/Documentation/user/GNUmakefile index b586a9a4f5..98ee073466 100644 --- a/Documentation/user/GNUmakefile +++ b/Documentation/user/GNUmakefile @@ -21,7 +21,7 @@ PS_GZ_FILES= $(addsuffix .gz, $(PS_FILES)) 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 @@ -29,6 +29,11 @@ dvi: $(DVI_FILES) ps: $(PS_FILES) +# Cancel default info rule +$(outdir)/%.info: $(outdir)/%.texi + +# info is now built by default via texinfo-rules +# we must build them by default, otherwise they get built during make install info: $(INFO_FILES) default: @@ -59,16 +64,21 @@ backdoc-WWW: $(outdir)/lilypond-internals/lilypond-internals.html #ugh. lily/OUT/lilypond hardcoded. # when cross-compiling, we don't have lilypond -$(outdir)/lilypond-internals.texi: - if [ -e $(depth)/$(builddir)/lily/out/lilypond ]; then \ - cd $(outdir) && ../$(depth)/$(builddir)/lily/out/lilypond ../$(src-depth)/ly/generate-documentation; \ - else \ - touch $@; \ - fi +ifneq ($(CROSS),yes) +$(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: + cd $(outdir) && ../$(depth)/$(builddir)/lily/out/lilypond ../$(src-depth)/ly/generate-documentation + -ln $(outdir)/lilypond-internals.texi $(outdir)/lilypond-internals.nexi +else +$(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: +## -cd $(outdir) && lilypond ../$(src-depth)/ly/generate-documentation +##programming error: Improbable offset for translation: setting to zero (Continuing; cross thumbs) +##programming error: Molecule::add_at_edge: adding empty molecule. (Continuing; cross thumbs) + touch $@ + touch $(outdir)/$(*F).nexi +endif # Generic rule not possible? # $(outdir)/%/%.html: $(outdir)/%.texi - $(outdir)/lilypond/lilypond.html: $(outdir)/lilypond.texi -$(MAKEINFO) --force --output=$@ --html $< # we want footers even if website builds (or is built) partly diff --git a/Documentation/user/convert-ly.itexi b/Documentation/user/convert-ly.itexi new file mode 100644 index 0000000000..5c413c6227 --- /dev/null +++ b/Documentation/user/convert-ly.itexi @@ -0,0 +1,36 @@ +@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}. + + + diff --git a/Documentation/user/glossary.tely b/Documentation/user/glossary.tely index 484f9fa621..eb37c2d8ac 100644 --- a/Documentation/user/glossary.tely +++ b/Documentation/user/glossary.tely @@ -60,7 +60,7 @@ accidental. @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Score.barNonAuto = ##t \property Voice.textStyle = "large" \notes\relative c'' { @@ -70,7 +70,7 @@ accidental. 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: @@ -115,11 +115,11 @@ mode hell@'enique D: reines Moll, NL: , DK: ren mol, S: ren mollskala, 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, @@ -139,7 +139,7 @@ the duration of the long a. is proportionate to that of the main note. @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \emptyText %\property Voice.textEmptyDimension = ##t \property Voice.textStyle = "large" @@ -155,13 +155,13 @@ fis8 e16 fis g8 fis16 g | a4 \bar "||"; } \notes\relative c'' { 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'' { @@ -175,7 +175,7 @@ An appoggiatura may have more notes preceding the main note. \context Voice = vb { \stemDown as16 ~ as8. as16 ~ as8. } > \bar "||"; } -@end mudela +@end lilypond @item arpeggio I: arpeggio, F: arp@`ege, D: Arpeggio, Akkordbrechungen, gebrochener @@ -183,7 +183,7 @@ Akkord, NL: gebroken akoord, DK: arpeggio, akkordbrydning, S: arpeggio, N: @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \context GrandStaff < \notes\relative c'' { \time 4/4; @@ -201,7 +201,7 @@ Akkord, NL: gebroken akoord, DK: arpeggio, akkordbrydning, S: arpeggio, N: c2 c | c c } > } > -@end mudela +@end lilypond @item ascending interval I: intervallo ascendente, F: intervalle ascendant, D: steigendes Intervall, @@ -274,7 +274,7 @@ beams determine the note value of the connected notes. @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Score.barNonAuto = ##t \emptyText \property Voice.textStyle = "large" @@ -283,7 +283,7 @@ beams determine the note value of the connected notes. [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: @@ -295,13 +295,13 @@ start of the music. @ -@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}} @@ -316,22 +316,22 @@ orchestral or choral score. @ -@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, @@ -356,10 +356,10 @@ in pre-1650 music. @ -@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 @@ -373,7 +373,7 @@ lines. @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Score.barNonAuto = ##t \property Staff.clefStyle = #"fullSizeChanges" \property Staff.textStyle = #"large" @@ -389,7 +389,7 @@ lines. \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: . @@ -433,7 +433,7 @@ chords are denoted open chords @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Score.barNonAuto = ##t \property Voice.textNonEmpty = ##t \property Voice.textStyle = "large" @@ -446,7 +446,7 @@ chords are denoted open chords s s2 } -@end mudela +@end lilypond @item chromatic scale I: scala cromatica, F: gamme chromatique, D: Chromatische Tonleiter, NL: @@ -456,10 +456,10 @@ A scale consisting of all 11 @w{@ar{}@strong{semitone}}s. @ -@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: @@ -511,10 +511,10 @@ Melody moving in the narrow steps of the scale; @ -@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: @@ -542,7 +542,7 @@ composition methods. @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Score.timeSignatureStyle = "C2/2" \context GrandStaff < \notes\relative c' { @@ -576,7 +576,7 @@ composition methods. } > } > -@end mudela +@end lilypond @item counter tenor I: controtenore, F: contre-tenor, D: Kontratenor, NL: contratenor, DK: @@ -600,10 +600,10 @@ abbreviation "cresc.". @ -@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, @@ -631,11 +631,11 @@ frequently near the beginning marked by a sign: @ -@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: @@ -646,10 +646,10 @@ or the abbreviation "decresc.". @ -@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, @@ -671,7 +671,7 @@ also to some extent in newer jazz music. @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \emptyText \property Score.barNonAuto = ##t \property Lyrics.textStyle = "large" @@ -684,9 +684,9 @@ also to some extent in newer jazz music. \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" @@ -700,9 +700,9 @@ also to some extent in newer jazz music. \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" @@ -715,9 +715,9 @@ also to some extent in newer jazz music. \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" @@ -730,9 +730,9 @@ also to some extent in newer jazz music. \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" @@ -745,9 +745,9 @@ also to some extent in newer jazz music. \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" @@ -760,14 +760,14 @@ also to some extent in newer jazz music. \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" @@ -780,9 +780,9 @@ harmonic minor scale type an augmented second (A) occurs between the 6th and \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" @@ -795,9 +795,9 @@ harmonic minor scale type an augmented second (A) occurs between the 6th and \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" @@ -814,9 +814,9 @@ harmonic minor scale type an augmented second (A) occurs between the 6th and 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" @@ -834,7 +834,7 @@ harmonic minor scale type an augmented second (A) occurs between the 6th and 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, @@ -859,13 +859,13 @@ scale. Opposite of @ar{}@strong{conjunct movement}. @ -@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: @@ -1004,14 +1004,14 @@ Two notes, intervals, or scales are enharmonic if they have different names 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 @@ -1044,7 +1044,7 @@ example bass recorder) while 8 below the clef symbol indicates playing an 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" @@ -1071,7 +1071,7 @@ octave lower (for example on double bass @w{@ar{}@strong{strings}}). "octaved up" "octaved down" } -@end mudela +@end lilypond @item fermata I: corona, F: pause, D: Fermate, NL: fermate, DK: fermat, S: fermat, N: . @@ -1079,11 +1079,11 @@ 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: @@ -1108,7 +1108,7 @@ Ornament at the end of the stem of a note used for notes with values less than 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" @@ -1117,7 +1117,7 @@ a quarter note. The number of flags determines the @w{@ar{}@strong{note value}}. 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: . @@ -1155,7 +1155,7 @@ of the base chords. @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \emptyText \property Score.barNonAuto = ##t \property Lyrics.textStyle = "large" @@ -1165,7 +1165,7 @@ of the base chords. < 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. @@ -1182,7 +1182,7 @@ that). @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Score.barNonAuto = ##t \property Staff.clefStyle = #"fullSizeChanges" \property Lyrics.textStyle = "large" @@ -1203,7 +1203,7 @@ that). "octaved up" "octaved down" } -@end mudela +@end lilypond @item glissando I: glissando, F: glissando, D: Glissando, NL: glissando, DK: glissando, S: @@ -1253,7 +1253,7 @@ section. @ar{}@w{}@strong{functional harmony} @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \context GrandStaff < \notes\relative c'' { \time 4/4; @@ -1266,7 +1266,7 @@ section. @ar{}@w{}@strong{functional harmony} \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: @@ -1279,7 +1279,7 @@ Consonances: @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Score.barNonAuto = ##t \property Voice.textStyle = "large" \notes\relative c'' { @@ -1291,13 +1291,13 @@ Consonances: s s s } -@end mudela +@end lilypond Dissonances: @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Score.barNonAuto = ##t \property Voice.textStyle = "large" \notes\relative c'' { @@ -1305,7 +1305,7 @@ Dissonances: s s s } -@end mudela +@end lilypond Three note harmony @w{@ar{}@strong{chord}} @@ -1328,7 +1328,7 @@ forms an octave. @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Score.barNonAuto = ##t \property Lyrics.textStyle = "large" \property Voice.textStyle = "large" @@ -1345,11 +1345,11 @@ forms an octave. } \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" @@ -1366,11 +1366,11 @@ forms an octave. } \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" @@ -1387,7 +1387,7 @@ forms an octave. } \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: @@ -1397,7 +1397,7 @@ The difference between an interval and an octave. @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Score.barNonAuto = ##t \property Voice.textStyle = "large" \notes\relative c'' { @@ -1405,7 +1405,7 @@ The difference between an interval and an octave. < 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 @@ -1453,10 +1453,10 @@ A ledger line is an extension of the staff. @ -@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: @@ -1468,7 +1468,7 @@ unlike @emph{leggiero} or @emph{non-legato} (b), @emph{portato} (c) and @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Score.barNonAuto = ##t \emptyText \property Lyrics.textStyle = "large" @@ -1480,7 +1480,7 @@ unlike @emph{leggiero} or @emph{non-legato} (b), @emph{portato} (c) and 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}} @@ -1510,13 +1510,13 @@ note value: double length of @w{@ar{}@strong{brevis}}. @w{@ar{}@strong{note valu @ -@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: @@ -1573,28 +1573,28 @@ one speaks of @emph{duple} (2/2, 2/4, 2/8), @emph{triple} (3/2, 3/4, 3/8) or @ -@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, @@ -1625,7 +1625,7 @@ First C below the 440 Hz A. @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Score.barNonAuto = ##t \property Staff.clefStyle = #"fullSizeChanges" \notes\relative c' { @@ -1633,7 +1633,7 @@ First C below the 440 Hz A. \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 @@ -1674,7 +1674,7 @@ subject. @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Score.timeSignatureStyle = "C2/2" \emptyText \property Voice.textStyle = "large" @@ -1685,7 +1685,7 @@ subject. 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: . @@ -1700,12 +1700,12 @@ mehrtaktige Pause, DK: flertaktspause, S: flertaktspaus, 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}} @@ -1758,7 +1758,7 @@ but sometimes (mostly in pre baroque music) the double length note value @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Voice.textStyle = "large" \property Score.barNonAuto = ##t \notes\relative c'' { @@ -1767,30 +1767,30 @@ but sometimes (mostly in pre baroque music) the double length note value \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 @@ -1799,7 +1799,7 @@ frequently used. @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Voice.textStyle = "large" \emptyText \notes\relative c'' { @@ -1811,7 +1811,7 @@ frequently used. g4 g g \bar "||"; \times 6/4 {g8_"quadruplets" g g g} | g8 g g g g4 \bar "||";} -@end mudela +@end lilypond @ @@ -1834,7 +1834,7 @@ middle of the 19th century and onwards the trill is performed with the main 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 @@ -1849,14 +1849,14 @@ the upper note is played first. 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 @@ -1873,7 +1873,7 @@ Other frequently used ornaments are the @emph{turn}, the @emph{mordent} and the e'4 [e8 ~ e32 d e d] c2 } > -@end mudela +@end lilypond @w{@ar{}@strong{appoggiatura}} @@ -2001,7 +2001,7 @@ the same @w{@ar{}@strong{signature}}. @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \emptyText \property Score.barNonAuto = ##t \property Voice.textStyle = "large" @@ -2012,7 +2012,7 @@ the same @w{@ar{}@strong{signature}}. \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: @@ -2020,13 +2020,13 @@ gen@-ta@-gel@-se, S: repris, N: . @ -@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: . @@ -2072,7 +2072,7 @@ sub@-do@-mi@-nant (S) and V = dominant (D). @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \emptyText \property Score.barNonAuto = ##t \property Lyrics.textStyle = "large" @@ -2084,7 +2084,7 @@ sub@-do@-mi@-nant (S) and V = dominant (D). < { I II III IV V VI VII I } { T "" "" S D } > } -@end mudela +@end lilypond @w{@ar{}@strong{functional harmony}} @@ -2116,10 +2116,10 @@ semitones. @w{@ar{}@strong{interval}} @w{@ar{}@strong{chromatic scale}} @ -@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: . @@ -2232,14 +2232,14 @@ notehead. @ -@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; @@ -2259,7 +2259,7 @@ note. @w{@ar{}@strong{beam}} @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Score.noAutoBeaming = ##t \property Score.barNonAuto = ##t \emptyText @@ -2270,7 +2270,7 @@ note. @w{@ar{}@strong{beam}} 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: @@ -2335,7 +2335,7 @@ the underlaying (normal) pulse and the actual (abnormal) rhythm. @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \emptyText \property Voice.textStyle = "large" \time 4/4; @@ -2344,7 +2344,7 @@ the underlaying (normal) pulse and the actual (abnormal) rhythm. d8 dis | e c'4 e,8 c'4 e,8 c' ( | ) c2 } -@end mudela +@end lilypond @item syntonic comma; dydimic comma @@ -2420,7 +2420,7 @@ with figures designating the chief @w{@ar{}@strong{interval}}s and @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \context GrandStaff < \notes\relative c'' { \time 4/4; @@ -2448,7 +2448,7 @@ with figures designating the chief @w{@ar{}@strong{interval}}s and { "" "" "2" "" "2" "" "2" "" } > } > -@end mudela +@end lilypond @item tie; bind I: legatura (di valore), F: liaison, D: Haltebogen, NL: overbinding, DK: @@ -2460,10 +2460,10 @@ uniting them into a single sound equal to the combined durations. @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \property Score.barNonAuto = ##t \notes\relative c'' { g2 ~ g4. } -@end mudela +@end lilypond @item time signature @@ -2493,7 +2493,7 @@ Shifting a melody up or down in pitch, while keeping the same relative pitches. @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \context Staff { \time 3/4; \notes\relative c'' { @@ -2503,7 +2503,7 @@ Shifting a melody up or down in pitch, while keeping the same relative pitches. \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, @@ -2524,7 +2524,7 @@ a @w{@ar{}@strong{chord}}, usually in the distance of a third @ -@mudela[13pt,eps] +@lilypond[13pt,eps] \emptyText \property Score.barNonAuto = ##t \property Voice.textStyle = "large" @@ -2533,7 +2533,7 @@ a @w{@ar{}@strong{chord}}, usually in the distance of a third % 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: @@ -2592,13 +2592,13 @@ line. @w{@ar{}@strong{measure}} @w{@ar{}@strong{meter}} @ -@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: , diff --git a/Documentation/user/invoking.itexi b/Documentation/user/invoking.itexi index c0e8228338..14786887a3 100644 --- a/Documentation/user/invoking.itexi +++ b/Documentation/user/invoking.itexi @@ -42,7 +42,7 @@ code and named output. @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 diff --git a/Documentation/user/latex-lilypond-example.latex b/Documentation/user/latex-lilypond-example.latex new file mode 100644 index 0000000000..6906eab7e9 --- /dev/null +++ b/Documentation/user/latex-lilypond-example.latex @@ -0,0 +1,163 @@ +% 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{} +% \lilypond{} + +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"]{} & major \\ +\lilypond[11pt]{} & minor \\ +\lilypond[11pt]{} & diminished \\ +\lilypond[11pt]{} & 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} diff --git a/Documentation/user/lilypond-book.tely b/Documentation/user/lilypond-book.tely new file mode 100644 index 0000000000..49fc1f8256 --- /dev/null +++ b/Documentation/user/lilypond-book.tely @@ -0,0 +1,636 @@ +\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]@{@} +@end example + +and its music: + +@lilypond[11pt]{} + + +@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]@{@} +@end example + +and its music: + +@lilypond[11pt]{} + + +@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 { } +@end lilypond + +If you want to place music examples in the text, +@lilypond[eps] +\context Voice { } +@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 { } +@@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] + +@@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 diff --git a/Documentation/user/lilypond.tely b/Documentation/user/lilypond.tely index 71a42333d1..b1a4a3a92c 100644 --- a/Documentation/user/lilypond.tely +++ b/Documentation/user/lilypond.tely @@ -88,7 +88,7 @@ than the names being similar :-)" @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. @@ -118,7 +118,7 @@ than the names being similar :-)" @include moreinfo.itexi -@include convert-mudela.itexi +@include convert-ly.itexi @node Index, , , Top @unnumbered Index diff --git a/Documentation/user/ly2dvi.texi b/Documentation/user/ly2dvi.texi index 89793cf696..94ac18a465 100644 --- a/Documentation/user/ly2dvi.texi +++ b/Documentation/user/ly2dvi.texi @@ -7,7 +7,7 @@ @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 @@ -72,7 +72,7 @@ Arne Fagertun name @file{ly2dvi}. @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 @@ -102,7 +102,7 @@ file. They are overridden by corresponding command line options. @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 diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index 2a6e64e63a..cc4b30e881 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -18,16 +18,16 @@ 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 @@ -38,7 +38,7 @@ To demonstrate what LilyPond input looks like, we start off with a 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" @@ -69,7 +69,7 @@ of the famous menuet in J. S. Bach's @emph{Klavierbuechlein}. 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 @@ -123,7 +123,7 @@ that size, which is done. \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 @@ -219,7 +219,7 @@ processing the music, LilyPond will verify that bar checks are found at 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. @@ -394,7 +394,7 @@ may differ, since the titling in this document is not generated by @center @strong{The river is flowing} @center Traditional -@mudela[center] +@lilypond[center] \header { title = "The river is flowing"; composer = "Traditional (?)"; @@ -435,7 +435,7 @@ accompaniment =\chords { \midi { \tempo 4=72;} \paper { linewidth = 10.0\cm; } } -@end mudela +@end lilypond Again, we will dissect the file line by line. @example @@ -706,7 +706,7 @@ Our third subject is a piece of piano music. The fragment in the input 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"; @@ -766,7 +766,7 @@ bassvoices = \notes \relative c' { 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 @@ -774,10 +774,10 @@ one system as possible. @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 @{ diff --git a/aclocal.m4 b/aclocal.m4 index e812c5f830..724a91b40b 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -76,6 +76,7 @@ AC_DEFUN(AC_STEPMAKE_COMPILE, [ CFLAGS="$CFLAGS $OPTIMIZE" CPPFLAGS=${CPPFLAGS:-""} + AC_SUBST(cross_compiling) AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) diff --git a/config.make.in b/config.make.in index 0676f025c0..97b7d70045 100644 --- a/config.make.in +++ b/config.make.in @@ -9,6 +9,7 @@ USER_CXXFLAGS = @CXXFLAGS@ @CPPFLAGS@ @GUILE_CFLAGS@ USER_LDFLAGS = @LDFLAGS@ @GUILE_LDFLAGS@ CC = @CC@ +CROSS = @cross_compiling@ CXX = @CXX@ GCC = @GCC@ LD = @LD@ diff --git a/input/test/allfontstyle.ly b/input/test/allfontstyle.ly index f463eefda3..8c48cd1780 100644 --- a/input/test/allfontstyle.ly +++ b/input/test/allfontstyle.ly @@ -4,7 +4,7 @@ \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 } diff --git a/input/test/beam-position.ly b/input/test/beam-position.ly index 940843afc5..a8f63a9de2 100644 --- a/input/test/beam-position.ly +++ b/input/test/beam-position.ly @@ -1,7 +1,7 @@ \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] } diff --git a/input/test/chord-names.ly b/input/test/chord-names.ly index cccabf2568..1d029981a8 100644 --- a/input/test/chord-names.ly +++ b/input/test/chord-names.ly @@ -20,7 +20,7 @@ chord = \notes\transpose c''\chords{ \context Staff \chord > \paper{ - linewidth = -1.0; + \translator { \ChordNamesContext ChordName \push #'word-space = #1 diff --git a/input/test/collisions.ly b/input/test/collisions.ly index 6ae299fb0b..e2c3ce45f1 100644 --- a/input/test/collisions.ly +++ b/input/test/collisions.ly @@ -20,7 +20,8 @@ twovoicesteminvert = \context Staff \notes < 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 } > @@ -35,26 +36,28 @@ chordstest = \context Staff \notes < 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 } > diff --git a/input/test/force-hshift.ly b/input/test/force-hshift.ly index 097ddc3812..715e9d580c 100644 --- a/input/test/force-hshift.ly +++ b/input/test/force-hshift.ly @@ -4,20 +4,18 @@ \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 - } - + } \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 } > - } \paper { linewidth=-1.0; diff --git a/input/test/hshift.ly b/input/test/hshift.ly index be09c586ab..b9b011e87c 100644 --- a/input/test/hshift.ly +++ b/input/test/hshift.ly @@ -1,16 +1,20 @@ + +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 { } diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index d703831ed3..1ef88f13cc 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -258,7 +258,7 @@ Auto_beam_engraver::end_beam () shortest_mom_ = Moment (1, 8); } } - + void Auto_beam_engraver::typeset_beam () { @@ -364,7 +364,8 @@ Auto_beam_engraver::acknowledge_element (Score_element_info info) 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_) @@ -376,7 +377,7 @@ Auto_beam_engraver::acknowledge_element (Score_element_info info) 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; diff --git a/lily/auto-change-iterator.cc b/lily/auto-change-iterator.cc index 605363c488..183c5fece4 100644 --- a/lily/auto-change-iterator.cc +++ b/lily/auto-change-iterator.cc @@ -88,7 +88,7 @@ Auto_change_iterator::pending_pitch (Moment m) const for (SCM s = muses; gh_pair_p (s); s=gh_cdr (s)) if (Note_req* nr = dynamic_cast (unsmob_music (gh_car (s)))) { - ps.push (nr->pitch_); + ps.push (*unsmob_pitch (nr->get_mus_property ("pitch"))); } if (ps.size ()) @@ -135,3 +135,5 @@ Auto_change_iterator::Auto_change_iterator( ) { where_dir_ = CENTER; } + +IMPLEMENT_CTOR_CALLBACK(Auto_change_iterator); diff --git a/lily/auto-change-music.cc b/lily/auto-change-music.cc index c75cb9e605..71d134cb3c 100644 --- a/lily/auto-change-music.cc +++ b/lily/auto-change-music.cc @@ -1,6 +1,5 @@ - /* - auto-switch-music.cc -- implement + auto-switch-music.cc -- implement Auto_change_music source file of the GNU LilyPond music typesetter @@ -9,9 +8,10 @@ */ #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); } diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index 9240449235..dc2d162fc2 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -10,9 +10,6 @@ #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" @@ -21,11 +18,6 @@ /* generate bars. Either user ("|:"), or default (new measure) - TODO - - - document this - - - document how barlines and line breaks interact. */ class Bar_engraver : public Engraver { diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index d79b545e41..84ff88a5dc 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -257,7 +257,8 @@ Beam_engraver::acknowledge_element (Score_element_info info) 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")); @@ -269,10 +270,10 @@ Beam_engraver::acknowledge_element (Score_element_info info) } 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); } } diff --git a/lily/change-iterator.cc b/lily/change-iterator.cc index d1fc2006f0..3bf8101690 100644 --- a/lily/change-iterator.cc +++ b/lily/change-iterator.cc @@ -83,3 +83,5 @@ Change_iterator::process (Moment m) } + +IMPLEMENT_CTOR_CALLBACK(Change_iterator); diff --git a/lily/chord-name-engraver.cc b/lily/chord-name-engraver.cc index aa5c6f27ee..50ece53329 100644 --- a/lily/chord-name-engraver.cc +++ b/lily/chord-name-engraver.cc @@ -58,7 +58,7 @@ void Chord_name_engraver::acknowledge_element (Score_element_info i) { if (Note_req* n = dynamic_cast (i.req_l_)) - pitch_arr_.push (n->pitch_); + pitch_arr_.push (* unsmob_pitch (n->get_mus_property ("pitch"))); } bool @@ -66,7 +66,7 @@ Chord_name_engraver::do_try_music (Music* m) { if (Note_req* n = dynamic_cast (m)) { - pitch_arr_.push (n->pitch_); + pitch_arr_.push (* unsmob_pitch (n->get_mus_property ("pitch"))); return true; } if (Tonic_req* t = dynamic_cast (m)) @@ -123,14 +123,14 @@ Chord_name_engraver::create_chord_name () */ 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 diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc index f21bcb3150..ee310fb044 100644 --- a/lily/chord-tremolo-engraver.cc +++ b/lily/chord-tremolo-engraver.cc @@ -19,6 +19,7 @@ #include "note-head.hh" #include "spanner.hh" #include "item.hh" +#include "chord-tremolo-iterator.hh" /** This acknowledges repeated music with "tremolo" style. It typesets @@ -75,7 +76,9 @@ bool Chord_tremolo_engraver::do_try_music (Music * m) { Repeated_music * rp = dynamic_cast (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; diff --git a/lily/chord-tremolo-iterator.cc b/lily/chord-tremolo-iterator.cc index 0f86e33d98..5ddad95983 100644 --- a/lily/chord-tremolo-iterator.cc +++ b/lily/chord-tremolo-iterator.cc @@ -20,7 +20,7 @@ void Chord_tremolo_iterator::construct_children () { Repeated_music * rep = dynamic_cast (music_l_); - factor_ = Moment (1, rep->repeats_i_); + factor_ = Moment (1, rep->repeat_count ()); child_iter_p_ = get_iterator_p (rep->body ()); } @@ -70,3 +70,6 @@ Chord_tremolo_iterator::try_music_in_children (Music *m) const } + +IMPLEMENT_CTOR_CALLBACK(Chord_tremolo_iterator); + diff --git a/lily/chord.cc b/lily/chord.cc index 5cb2870461..26602a5e78 100644 --- a/lily/chord.cc +++ b/lily/chord.cc @@ -13,6 +13,11 @@ #include "music-list.hh" #include "musical-request.hh" +/* + UGH + + should compare SCM lists. + */ int compare (Chord* left, Chord* right) { @@ -27,7 +32,20 @@ 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. + */ /* @@ -41,7 +59,7 @@ to_chord (Musical_pitch tonic, Array* add_arr_p, Arraysize (); 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; @@ -75,7 +93,7 @@ to_chord (Musical_pitch tonic, Array* add_arr_p, Arraytop (); - p->accidental_i_--; + p->alteration_i_--; } /* @@ -92,7 +110,7 @@ to_chord (Musical_pitch tonic, Array* add_arr_p, Array* add_arr_p, Array pitch_arr, Tonic_req* tonic_req, Inversion_req* i 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); } @@ -193,7 +212,7 @@ to_chord (Array pitch_arr, Tonic_req* tonic_req, Inversion_req* 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) @@ -205,7 +224,7 @@ to_chord (Array pitch_arr, Tonic_req* tonic_req, Inversion_req* 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); @@ -253,9 +272,9 @@ Chord::base_arr (Musical_pitch p) { Array 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; } @@ -270,7 +289,7 @@ Chord::rebuild_transpose (Array* pitch_arr_p, Musical_pitch tonic p.transpose (q); // duh, c7 should mean 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); @@ -293,7 +312,7 @@ Chord::find_notename_i (Array const* pitch_arr_p, Musical_pitch p { 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; } @@ -305,7 +324,7 @@ int 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++; @@ -324,7 +343,7 @@ Chord::missing_thirds_pitch_arr (Array const* pitch_arr_p) /* 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; @@ -343,7 +362,7 @@ Chord::missing_thirds_pitch_arr (Array const* pitch_arr_p) 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); } @@ -378,7 +397,7 @@ Chord::to_pitch_arr () const 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 ()) @@ -472,7 +491,7 @@ Chord::rebuild_from_base (Array* pitch_arr_p, int base_i) 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_++; } @@ -490,7 +509,7 @@ Chord::rebuild_insert_inversion (Array* pitch_arr_p, int tonic_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_++; } @@ -517,25 +536,40 @@ Chord::rebuild_with_bass (Array* pitch_arr_p, int bass_i) // junk me Simultaneous_music * -get_chord (Musical_pitch tonic, - Array* add_arr_p, - Array* 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 add_arr_p; + Array 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 @@ -543,25 +577,29 @@ get_chord (Musical_pitch tonic, && 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 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); diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 818e3544a0..b57a2cc4f4 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -17,7 +17,6 @@ #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" @@ -43,7 +42,6 @@ protected: private: Item * clef_p_; Item * octavate_p_; - Clef_change_req * clef_req_l_; SCM prev_glyph_; SCM prev_cpos_; @@ -56,7 +54,6 @@ private: Clef_engraver::Clef_engraver () { clef_p_ = 0; - clef_req_l_ = 0; octave_dir_ = CENTER; octavate_p_ = 0; diff --git a/lily/clef-item.cc b/lily/clef-item.cc index 1f6ac5627a..2ef28ba767 100644 --- a/lily/clef-item.cc +++ b/lily/clef-item.cc @@ -14,7 +14,7 @@ #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 @@ -33,11 +33,9 @@ Clef::before_line_breaking (SCM smob) { 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())); @@ -65,9 +63,6 @@ Clef::set_interface (Score_element* me) me->set_interface (ly_symbol2scm ("clef-interface")); } - - - MAKE_SCHEME_CALLBACK(Clef,brew_molecule,1) SCM Clef::brew_molecule (SCM smob) diff --git a/lily/command-request.cc b/lily/command-request.cc index 2f5f83b3f8..aef049e980 100644 --- a/lily/command-request.cc +++ b/lily/command-request.cc @@ -11,11 +11,6 @@ #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 { @@ -24,33 +19,11 @@ 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 (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 ()); } @@ -82,28 +55,30 @@ Key_change_req::transpose (Musical_pitch p) 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); } } diff --git a/lily/context-specced-music.cc b/lily/context-specced-music.cc index cf3f520773..7e52caf957 100644 --- a/lily/context-specced-music.cc +++ b/lily/context-specced-music.cc @@ -7,9 +7,11 @@ */ #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")); } + diff --git a/lily/custos-engraver.cc b/lily/custos-engraver.cc index 5f15194535..77e354d632 100644 --- a/lily/custos-engraver.cc +++ b/lily/custos-engraver.cc @@ -96,8 +96,9 @@ Custos_engraver::acknowledge_element (Score_element_info info) 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 (info.req_l_)->pitch_); + Note_req * nr = dynamic_cast (info.req_l_); + if (nr) + pitches_.push (*unsmob_pitch (nr->get_mus_property ("pitch"))); } } } diff --git a/lily/duration.cc b/lily/duration.cc index 7710e4dcc0..163b849d2a 100644 --- a/lily/duration.cc +++ b/lily/duration.cc @@ -14,26 +14,9 @@ #include "string.hh" #include "moment.hh" #include "duration.hh" +#include "ly-smobs.icc" + -int -compare (Array* left, Array* 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) @@ -45,15 +28,22 @@ Duration::Duration () { 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 @@ -72,28 +62,105 @@ Duration::length_mom () const 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 ("#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_; +} diff --git a/lily/folded-repeat-iterator.cc b/lily/folded-repeat-iterator.cc index ddc6e68839..71328c87d2 100644 --- a/lily/folded-repeat-iterator.cc +++ b/lily/folded-repeat-iterator.cc @@ -129,3 +129,5 @@ Folded_repeat_iterator::try_music_in_children (Music * m) const return alternative_iter_p_->try_music (m); return 0; } + +IMPLEMENT_CTOR_CALLBACK(Folded_repeat_iterator); diff --git a/lily/grace-iterator.cc b/lily/grace-iterator.cc index c2459b310e..b0c89c9214 100644 --- a/lily/grace-iterator.cc +++ b/lily/grace-iterator.cc @@ -50,3 +50,5 @@ Grace_iterator::pending_moment () const return 0; } + +IMPLEMENT_CTOR_CALLBACK(Grace_iterator); diff --git a/lily/grace-music.cc b/lily/grace-music.cc index 532bd07aaf..a072d37a59 100644 --- a/lily/grace-music.cc +++ b/lily/grace-music.cc @@ -8,6 +8,7 @@ */ #include "grace-music.hh" +#include "grace-iterator.hh" void Grace_music::compress (Moment) @@ -24,5 +25,6 @@ Grace_music::length_mom () const 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); } diff --git a/lily/identifier.cc b/lily/identifier.cc index d46460f71b..28e450ac49 100644 --- a/lily/identifier.cc +++ b/lily/identifier.cc @@ -71,7 +71,6 @@ Class ## _identifier::do_str () const { \ DUMMY_STR(Score); DUMMY_STR(Music_output_def); -DUMMY_STR(Duration); #define DEFAULT_STR(Class) \ @@ -115,11 +114,9 @@ Class ## _identifier::Class ## _identifier (Class ## _identifier const &s) \ } -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); diff --git a/lily/include/auto-change-iterator.hh b/lily/include/auto-change-iterator.hh index ac3c8dbd6d..aba977192f 100644 --- a/lily/include/auto-change-iterator.hh +++ b/lily/include/auto-change-iterator.hh @@ -17,6 +17,8 @@ class Auto_change_iterator : public Music_wrapper_iterator { public: VIRTUAL_COPY_CONS (Music_iterator); + static SCM constructor_cxx_function; + Auto_change_iterator (); protected: diff --git a/lily/include/change-iterator.hh b/lily/include/change-iterator.hh index 8714801b3f..929271bcdf 100644 --- a/lily/include/change-iterator.hh +++ b/lily/include/change-iterator.hh @@ -19,7 +19,7 @@ public: VIRTUAL_COPY_CONS (Music_iterator); /* constructor is public */ virtual void process (Moment); - + static SCM constructor_cxx_function; private: void error (String); }; diff --git a/lily/include/chord-tremolo-iterator.hh b/lily/include/chord-tremolo-iterator.hh index 3f08463c36..3ac4d45cfd 100644 --- a/lily/include/chord-tremolo-iterator.hh +++ b/lily/include/chord-tremolo-iterator.hh @@ -16,6 +16,7 @@ class Chord_tremolo_iterator : public Music_iterator { public: VIRTUAL_COPY_CONS (Music_iterator); + static SCM constructor_cxx_function; Chord_tremolo_iterator (); protected: diff --git a/lily/include/chord.hh b/lily/include/chord.hh index 561032eefb..98290e29c2 100644 --- a/lily/include/chord.hh +++ b/lily/include/chord.hh @@ -52,12 +52,12 @@ Chord to_chord (Array pitch_arr, Tonic_req* tonic_req, Inversion_ int compare (Chord*, Chord*); -Simultaneous_music *get_chord (Musical_pitch tonic, - Array* add_arr_p, - Array* 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); diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index 862ef287a3..2acf5d4ba1 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -16,9 +16,6 @@ #include "musical-pitch.hh" #include "protected-scm.hh" -/* - Real penalty_f_; - */ class Break_req : public Request { public: @@ -34,18 +31,10 @@ 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_; @@ -58,42 +47,13 @@ protected: 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); }; @@ -112,18 +72,4 @@ protected: 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 diff --git a/lily/include/context-specced-music.hh b/lily/include/context-specced-music.hh index e6eb7c8b0f..0c293c8166 100644 --- a/lily/include/context-specced-music.hh +++ b/lily/include/context-specced-music.hh @@ -14,18 +14,9 @@ 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 */ diff --git a/lily/include/duration.hh b/lily/include/duration.hh index 3f352fccc2..54c4793fb8 100644 --- a/lily/include/duration.hh +++ b/lily/include/duration.hh @@ -11,38 +11,42 @@ #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*, Array*); +Duration*unsmob_duration(SCM); +// int compare (Array*, Array*); #endif // DURATION_HH diff --git a/lily/include/folded-repeat-iterator.hh b/lily/include/folded-repeat-iterator.hh index 6217df1bee..2dba3733c7 100644 --- a/lily/include/folded-repeat-iterator.hh +++ b/lily/include/folded-repeat-iterator.hh @@ -20,6 +20,8 @@ class Folded_repeat_iterator : public Music_iterator { public: VIRTUAL_COPY_CONS (Music_iterator); + static SCM constructor_cxx_function; + Folded_repeat_iterator (); ~Folded_repeat_iterator (); diff --git a/lily/include/grace-iterator.hh b/lily/include/grace-iterator.hh index 4806037d28..37c78b7b35 100644 --- a/lily/include/grace-iterator.hh +++ b/lily/include/grace-iterator.hh @@ -19,7 +19,7 @@ public: ~Grace_iterator (); virtual void construct_children () ; virtual void process (Moment); - + static SCM constructor_cxx_function; Moment pending_moment () const; }; diff --git a/lily/include/identifier.hh b/lily/include/identifier.hh index 7f87c08b8f..2a82889757 100644 --- a/lily/include/identifier.hh +++ b/lily/include/identifier.hh @@ -17,8 +17,6 @@ class Output_def_identifier; class Score_identifier; -class Duration_identifier; - #define IDACCESSOR(Class)\ @@ -26,7 +24,7 @@ virtual Class * access_content_ ## Class (bool) const { error (#Class + String /** - A declarable data structure in mudela. + A declarable data structure in lilypond. TODO: use SMOBS for the union type, and junk all derived classes. */ @@ -44,7 +42,6 @@ struct Identifier : public Input { String str () const; IDACCESSOR(Music_output_def) IDACCESSOR(Score) - IDACCESSOR(Duration) VIRTUAL_COPY_CONS(Identifier); DECLARE_SMOBS(Identifier, foo); @@ -67,7 +64,6 @@ struct Class ## _identifier : Identifier {\ }\ -DECLARE_ID_CLASS(Duration); DECLARE_ID_CLASS(Score); DECLARE_ID_CLASS(Music_output_def); diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index b1673f79f1..5dea72d5b5 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -33,7 +33,6 @@ class Auto_change_iterator; 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; @@ -48,7 +47,7 @@ class Busy_playing_req; class Change_iterator; class Change_translator; class Chord_tremolo_iterator; -class Clef_change_req; + class Column_x_positions; class Context_specced_music; class Engraver; diff --git a/lily/include/lilypond-input-version.hh b/lily/include/lilypond-input-version.hh new file mode 100644 index 0000000000..79f7e06ef0 --- /dev/null +++ b/lily/include/lilypond-input-version.hh @@ -0,0 +1,30 @@ +/* + lilypond-version.hh -- declare Lilypond_version + + source file of the GNU LilyPond music typesetter + + (c) 1998--2000 Jan Nieuwenhuizen + +*/ + +#ifndef LILYPOND_VERSION_HH +#define LILYPOND_VERSION_HH + +#include "string.hh" + +struct Lilypond_version +{ + Lilypond_version (int major, int minor, int patch); + Lilypond_version (String str); + + String str () const; + operator int () const; + + int major_i_; + int minor_i_; + int patch_i_; +}; + +extern Lilypond_version oldest_version; + +#endif // LILYPOND_VERSION_HH diff --git a/lily/include/lyric-combine-music-iterator.hh b/lily/include/lyric-combine-music-iterator.hh index 5d519abf66..0f200cad89 100644 --- a/lily/include/lyric-combine-music-iterator.hh +++ b/lily/include/lyric-combine-music-iterator.hh @@ -18,7 +18,7 @@ class Lyric_combine_music_iterator : public Music_iterator 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; diff --git a/lily/include/main.hh b/lily/include/main.hh index 1adae59d0e..de6cf4f417 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -43,5 +43,5 @@ extern int default_count_global; extern All_font_metrics *all_fonts_global_p; class ostream; -void print_mudela_versions (ostream &os); +void print_lilypond_versions (ostream &os); #endif diff --git a/lily/include/moment.hh b/lily/include/moment.hh index 55a5c87a81..46628e211f 100644 --- a/lily/include/moment.hh +++ b/lily/include/moment.hh @@ -29,7 +29,7 @@ public: /* Deliver a copy of THIS as a smobified SCM */ - SCM make_scm () const; + SCM smobbed_copy () const; }; diff --git a/lily/include/music-iterator-ctor.hh b/lily/include/music-iterator-ctor.hh index 56fc3c03c2..9a99f59e6d 100644 --- a/lily/include/music-iterator-ctor.hh +++ b/lily/include/music-iterator-ctor.hh @@ -13,8 +13,9 @@ #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 */ diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index 30dae48a33..39919db96b 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -15,6 +15,7 @@ #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 @@ -90,7 +91,8 @@ public: report to. */ virtual void construct_children (); - + static SCM constructor_cxx_function; + protected: Music * music_l_; @@ -106,8 +108,30 @@ private: }; +/* + 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); + - + + diff --git a/lily/include/music-list.hh b/lily/include/music-list.hh index 6abf926c4d..63d39edc37 100644 --- a/lily/include/music-list.hh +++ b/lily/include/music-list.hh @@ -26,7 +26,7 @@ public: }; /** - 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 diff --git a/lily/include/music-output-def.hh b/lily/include/music-output-def.hh index 6d77fbebdc..b19f89ca32 100644 --- a/lily/include/music-output-def.hh +++ b/lily/include/music-output-def.hh @@ -16,7 +16,9 @@ #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 { diff --git a/lily/include/music-output.hh b/lily/include/music-output.hh index 9ff2f50790..9b4a046493 100644 --- a/lily/include/music-output.hh +++ b/lily/include/music-output.hh @@ -14,7 +14,7 @@ #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 { diff --git a/lily/include/music-wrapper-iterator.hh b/lily/include/music-wrapper-iterator.hh index d7a346a566..3aec129825 100644 --- a/lily/include/music-wrapper-iterator.hh +++ b/lily/include/music-wrapper-iterator.hh @@ -22,6 +22,7 @@ class Music_wrapper_iterator : public Music_iterator { public: VIRTUAL_COPY_CONS (Music_iterator); + static SCM constructor_cxx_function; Music_wrapper_iterator (); Music_wrapper_iterator (Music_wrapper_iterator const&); ~Music_wrapper_iterator (); diff --git a/lily/include/musical-pitch.hh b/lily/include/musical-pitch.hh index ed9f63857a..a78973b563 100644 --- a/lily/include/musical-pitch.hh +++ b/lily/include/musical-pitch.hh @@ -11,30 +11,40 @@ #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); @@ -47,9 +57,13 @@ struct Musical_pitch : public Input 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); diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index 55aaebe5d6..f98b1bee86 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -21,12 +21,9 @@ */ 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); }; @@ -76,10 +73,6 @@ protected: /// 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); @@ -88,6 +81,18 @@ protected: 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 { @@ -107,11 +112,11 @@ struct Bass_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 { diff --git a/lily/include/my-lily-lexer.hh b/lily/include/my-lily-lexer.hh index f731d0d545..a76957edf6 100644 --- a/lily/include/my-lily-lexer.hh +++ b/lily/include/my-lily-lexer.hh @@ -25,7 +25,7 @@ bool busy_parsing(); void kill_lexer(); void set_lexer(); -/// lexer for Mudela +/// lexer for Lilypond class My_lily_lexer : public Includable_lexer { public: diff --git a/lily/include/note-column.hh b/lily/include/note-column.hh index 855d655cd6..65dd50c2ab 100644 --- a/lily/include/note-column.hh +++ b/lily/include/note-column.hh @@ -34,7 +34,6 @@ 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*); diff --git a/lily/include/output-property-music-iterator.hh b/lily/include/output-property-music-iterator.hh index 6728324d3e..e7bd04a45a 100644 --- a/lily/include/output-property-music-iterator.hh +++ b/lily/include/output-property-music-iterator.hh @@ -15,6 +15,7 @@ class Output_property_music_iterator : public Simple_music_iterator { public: VIRTUAL_COPY_CONS (Music_iterator); + static SCM constructor_cxx_function; /* construction */ protected: virtual void process (Moment); diff --git a/lily/include/part-combine-music-iterator.hh b/lily/include/part-combine-music-iterator.hh index 32a6bc951c..61db1ad3ca 100644 --- a/lily/include/part-combine-music-iterator.hh +++ b/lily/include/part-combine-music-iterator.hh @@ -19,7 +19,7 @@ public: 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 (); diff --git a/lily/include/property-iterator.hh b/lily/include/property-iterator.hh index cd8aace3f0..71b0441dd2 100644 --- a/lily/include/property-iterator.hh +++ b/lily/include/property-iterator.hh @@ -22,6 +22,7 @@ class Property_iterator : public Simple_music_iterator { public: VIRTUAL_COPY_CONS (Music_iterator); + static SCM constructor_cxx_function; /* construction */ protected: virtual void process (Moment); @@ -31,6 +32,7 @@ class Push_property_iterator : public Simple_music_iterator { public: VIRTUAL_COPY_CONS (Music_iterator); + static SCM constructor_cxx_function; protected: /* construction */ virtual void process (Moment); @@ -39,6 +41,7 @@ protected: class Pop_property_iterator : public Simple_music_iterator { public: + static SCM constructor_cxx_function; VIRTUAL_COPY_CONS (Music_iterator); protected: /* construction */ diff --git a/lily/include/repeated-music.hh b/lily/include/repeated-music.hh index beca7dc1d0..b222111fe4 100644 --- a/lily/include/repeated-music.hh +++ b/lily/include/repeated-music.hh @@ -33,13 +33,12 @@ 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. @@ -52,21 +51,18 @@ class Repeated_music : public Music 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); diff --git a/lily/include/request-chord-iterator.hh b/lily/include/request-chord-iterator.hh index 5d6602add1..204598bdd0 100644 --- a/lily/include/request-chord-iterator.hh +++ b/lily/include/request-chord-iterator.hh @@ -31,6 +31,7 @@ class Request_chord_iterator : public Simple_music_iterator 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&); diff --git a/lily/include/sequential-music-iterator.hh b/lily/include/sequential-music-iterator.hh index a2dee9359d..5da129b286 100644 --- a/lily/include/sequential-music-iterator.hh +++ b/lily/include/sequential-music-iterator.hh @@ -19,6 +19,7 @@ class Sequential_music_iterator : public Music_iterator { 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 (); diff --git a/lily/include/simple-music-iterator.hh b/lily/include/simple-music-iterator.hh index 963eb0c616..d03601a6dc 100644 --- a/lily/include/simple-music-iterator.hh +++ b/lily/include/simple-music-iterator.hh @@ -18,6 +18,7 @@ protected: 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); diff --git a/lily/include/simultaneous-music-iterator.hh b/lily/include/simultaneous-music-iterator.hh index 1198a7dc84..9197129477 100644 --- a/lily/include/simultaneous-music-iterator.hh +++ b/lily/include/simultaneous-music-iterator.hh @@ -20,7 +20,8 @@ public: 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_; diff --git a/lily/include/time-scaled-music-iterator.hh b/lily/include/time-scaled-music-iterator.hh index e18716adc9..c13e0bdbd6 100644 --- a/lily/include/time-scaled-music-iterator.hh +++ b/lily/include/time-scaled-music-iterator.hh @@ -16,6 +16,7 @@ class Time_scaled_music_iterator : public Music_wrapper_iterator { public: VIRTUAL_COPY_CONS (Music_iterator); + static SCM constructor_cxx_function; /* construction */ protected: virtual void process (Moment); diff --git a/lily/include/time-signature-performer.hh b/lily/include/time-signature-performer.hh index ef3d20bb27..5a827b54bc 100644 --- a/lily/include/time-signature-performer.hh +++ b/lily/include/time-signature-performer.hh @@ -9,26 +9,5 @@ #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 diff --git a/lily/include/unfolded-repeat-iterator.hh b/lily/include/unfolded-repeat-iterator.hh index 3aa3ceae32..a3c757a381 100644 --- a/lily/include/unfolded-repeat-iterator.hh +++ b/lily/include/unfolded-repeat-iterator.hh @@ -26,6 +26,7 @@ public: 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? @@ -33,6 +34,11 @@ public: */ 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. */ @@ -56,5 +62,15 @@ protected: 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 */ diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index 46f4d3f656..5546180906 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -64,7 +64,7 @@ Key_engraver::create_key (bool def) { 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)); diff --git a/lily/lexer.ll b/lily/lexer.ll index 208e703420..b1c3afab5d 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -38,9 +38,12 @@ #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&); @@ -240,9 +243,6 @@ HYPHEN -- 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++) { @@ -401,7 +401,6 @@ HYPHEN -- } [{}] { - DEBUG_OUT << "parens\n"; return YYText ()[0]; } @@ -487,10 +486,14 @@ My_lily_lexer::scan_escaped_word (String str) yylval.scm = sid; return dynamic_cast (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; @@ -501,13 +504,11 @@ My_lily_lexer::scan_escaped_word (String str) } 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; } } @@ -524,17 +525,13 @@ My_lily_lexer::scan_bare_word (String str) { 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; } } @@ -593,12 +590,12 @@ strip_trailing_white (String&s) 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; diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 91096bce8e..39dfa8c57e 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -219,10 +219,12 @@ void add_scm_init_func (void (*f)()) 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)) (); } diff --git a/lily/lilypond-version.cc b/lily/lilypond-version.cc new file mode 100644 index 0000000000..e252710185 --- /dev/null +++ b/lily/lilypond-version.cc @@ -0,0 +1,42 @@ +/* + lilypond-version.cc -- implement Lilypond_version + + source file of the GNU LilyPond music typesetter + + (c) 1998--2000 Jan Nieuwenhuizen + +*/ + +#include "lilypond-input-version.hh" +#include "string-convert.hh" +#include "array.hh" + +Lilypond_version::Lilypond_version (int major, int minor, int patch) +{ + major_i_ = major; + minor_i_ = minor; + patch_i_ = patch; +} + +Lilypond_version::Lilypond_version (String str) +{ + Array version; + version = String_convert::split_arr (str, '.'); + assert (version.size () == 3); + major_i_ = version[0].value_i (); + minor_i_ = version[1].value_i (); + patch_i_ = version[2].value_i (); +} + +String +Lilypond_version::str () const +{ + return to_str (major_i_) + "." + to_str (minor_i_) + "." + to_str (patch_i_); +} + +Lilypond_version::operator int () const +{ + // ugh + return 100000 * major_i_ + 1000 * minor_i_ + patch_i_; +} + diff --git a/lily/local-key-engraver.cc b/lily/local-key-engraver.cc index 115a5d3a60..271b61606a 100644 --- a/lily/local-key-engraver.cc +++ b/lily/local-key-engraver.cc @@ -83,9 +83,9 @@ Local_key_engraver::process_acknowledged () 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 @@ -117,7 +117,7 @@ Local_key_engraver::process_acknowledged () 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); diff --git a/lily/local-key-item.cc b/lily/local-key-item.cc index 1b37fb22a3..5caf337451 100644 --- a/lily/local-key-item.cc +++ b/lily/local-key-item.cc @@ -15,43 +15,35 @@ #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); @@ -90,10 +82,11 @@ Local_key_item::brew_molecule (SCM smob) 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) { @@ -105,22 +98,22 @@ Local_key_item::brew_molecule (SCM smob) 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); diff --git a/lily/lyric-combine-music-iterator.cc b/lily/lyric-combine-music-iterator.cc index 8ab8f2920a..72453e5659 100644 --- a/lily/lyric-combine-music-iterator.cc +++ b/lily/lyric-combine-music-iterator.cc @@ -108,3 +108,5 @@ Lyric_combine_music_iterator::try_music_in_children (Music *m) const return lyric_iter_p_->try_music (m); } + +IMPLEMENT_CTOR_CALLBACK(Lyric_combine_music_iterator); diff --git a/lily/lyric-combine-music.cc b/lily/lyric-combine-music.cc index dbbbfab278..f474443bca 100644 --- a/lily/lyric-combine-music.cc +++ b/lily/lyric-combine-music.cc @@ -8,6 +8,7 @@ */ #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) @@ -15,7 +16,8 @@ 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); } diff --git a/lily/midi-def.cc b/lily/midi-def.cc index f5cbd2a952..685076461b 100644 --- a/lily/midi-def.cc +++ b/lily/midi-def.cc @@ -40,7 +40,7 @@ Midi_def::set_tempo (Moment one_beat_mom, int beats_per_minute_i) 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()); } diff --git a/lily/moment.cc b/lily/moment.cc index ff21fb5ebf..7b92cdbdcc 100644 --- a/lily/moment.cc +++ b/lily/moment.cc @@ -25,7 +25,7 @@ Moment::mark_smob (SCM) SCM -Moment::make_scm () const +Moment::smobbed_copy () const { Moment * m = new Moment (*this); return m->smobbed_self(); @@ -59,7 +59,7 @@ make_rational (SCM n, SCM d) ::error ("make-moment takes two integer arguments. Using 1/1"); } - return m.make_scm (); + return m.smobbed_copy (); } diff --git a/lily/music-iterator-ctor.cc b/lily/music-iterator-ctor.cc index 0af9158698..c599c57817 100644 --- a/lily/music-iterator-ctor.cc +++ b/lily/music-iterator-ctor.cc @@ -30,8 +30,8 @@ scm_sizet free_smob (SCM) 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, @@ -39,7 +39,7 @@ void start_callback_smobs() } SCM -smobify_callback (Cpp_function cb ) +smobify_cxx_function (Cxx_function cb ) { SCM z; @@ -49,6 +49,16 @@ smobify_callback (Cpp_function cb ) 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; +} + + diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index 08f454fae1..93de6c3e3b 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -11,25 +11,10 @@ */ #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 () @@ -99,68 +84,20 @@ Music_iterator::get_music (Moment)const 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 (m)) - p = new Music_wrapper_iterator; - else if (Repeated_music * n = dynamic_cast (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 (m)) + p = new Music_wrapper_iterator; else { p = new Simple_music_iterator ; @@ -233,3 +170,4 @@ Music_iterator::try_music_in_children (Music *) const return 0; } +IMPLEMENT_CTOR_CALLBACK(Music_iterator); diff --git a/lily/music-list.cc b/lily/music-list.cc index 81eee92a02..1a1847783e 100644 --- a/lily/music-list.cc +++ b/lily/music-list.cc @@ -14,6 +14,9 @@ #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 @@ -24,13 +27,15 @@ 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); } @@ -49,7 +54,8 @@ Simultaneous_music::to_relative_octave (Musical_pitch p) 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 @@ -60,8 +66,11 @@ Request_chord::to_relative_octave (Musical_pitch last) Music * mus = unsmob_music (gh_car (s)); if (Melodic_req *m= dynamic_cast (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; } } diff --git a/lily/music-wrapper-iterator.cc b/lily/music-wrapper-iterator.cc index 132ba004d4..096eee3140 100644 --- a/lily/music-wrapper-iterator.cc +++ b/lily/music-wrapper-iterator.cc @@ -80,3 +80,5 @@ Music_wrapper_iterator::try_music_in_children (Music *m) const { return child_iter_p_->try_music (m); } + +IMPLEMENT_CTOR_CALLBACK(Music_wrapper_iterator); diff --git a/lily/music.cc b/lily/music.cc index 5cf0e78476..e12ea41ea5 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -69,6 +69,15 @@ Music::compress (Moment) 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; } diff --git a/lily/musical-pitch.cc b/lily/musical-pitch.cc index 5a834db780..9a798b59e9 100644 --- a/lily/musical-pitch.cc +++ b/lily/musical-pitch.cc @@ -9,6 +9,7 @@ #include "musical-pitch.hh" #include "debug.hh" #include "main.hh" +#include "ly-smobs.icc" int compare (Array* left, Array* right) @@ -31,37 +32,35 @@ compare (Array* left, Array* 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; @@ -79,14 +78,14 @@ Musical_pitch::steps () const } /* - 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 @@ -106,7 +105,7 @@ Musical_pitch::transpose (Musical_pitch delta) int new_pitch = semitone_pitch (); int delta_acc = new_pitch - old_pitch - delta_pitch; - accidental_i_ -= delta_acc; + alteration_i_ -= delta_acc; } @@ -123,8 +122,8 @@ Musical_pitch::str () const { 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) { @@ -154,8 +153,8 @@ Musical_pitch::to_relative_octave (Musical_pitch p) 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_); @@ -193,3 +192,157 @@ Musical_pitch::down_to (int notename) 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 ("#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_; +} diff --git a/lily/musical-request.cc b/lily/musical-request.cc index 0e7ad15a80..15c881df04 100644 --- a/lily/musical-request.cc +++ b/lily/musical-request.cc @@ -20,32 +20,24 @@ Tremolo_req::Tremolo_req () 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 (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 @@ -53,7 +45,7 @@ Rhythmic_req::do_equal_b (Request const* r) const { Rhythmic_req const* rh = dynamic_cast (r); - return rh && !compare (*this, *rh); + return rh; // ; && !compare (*this, *rh); } @@ -61,16 +53,17 @@ Rhythmic_req::do_equal_b (Request const* r) const 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 diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index a44e3c6d45..14b22940d8 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -19,7 +19,7 @@ My_lily_parser::My_lily_parser (Sources * source_l) { source_l_ = source_l; lexer_p_ = 0; - default_duration_.durlog_i_ = 2; + default_duration_ = Duration (2,0); error_level_i_ = 0; diff --git a/lily/note-column.cc b/lily/note-column.cc index dde7969295..10956eefbb 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -127,12 +127,6 @@ Note_column::set_dotcol (Score_element*me,Score_element *d) -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) diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index ec47cb0442..414e2aedbb 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -86,28 +86,29 @@ Note_heads_engraver::do_process_music() - 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_ 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); } } diff --git a/lily/note-name-engraver.cc b/lily/note-name-engraver.cc index df2c487214..b5ce78e561 100644 --- a/lily/note-name-engraver.cc +++ b/lily/note-name-engraver.cc @@ -42,7 +42,7 @@ Note_name_engraver::do_process_music () { 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()) { diff --git a/lily/note-performer.cc b/lily/note-performer.cc index 9433e8714c..946b604c00 100644 --- a/lily/note-performer.cc +++ b/lily/note-performer.cc @@ -36,7 +36,8 @@ Note_performer::do_process_music () 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); diff --git a/lily/output-property-engraver.cc b/lily/output-property-engraver.cc index ad596bea3e..9f0338afe3 100644 --- a/lily/output-property-engraver.cc +++ b/lily/output-property-engraver.cc @@ -9,6 +9,7 @@ #include "engraver.hh" #include "score-element.hh" +#include "output-property-music-iterator.hh" class Output_property_engraver : public Engraver { @@ -39,7 +40,8 @@ protected: 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; diff --git a/lily/output-property-music-iterator.cc b/lily/output-property-music-iterator.cc index f2376b6b8c..0cf119c3ea 100644 --- a/lily/output-property-music-iterator.cc +++ b/lily/output-property-music-iterator.cc @@ -23,3 +23,5 @@ Output_property_music_iterator::process (Moment m) skip (m); } + +IMPLEMENT_CTOR_CALLBACK(Output_property_music_iterator); diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index ec2cbab2c5..2c2f179019 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -194,7 +194,7 @@ Paper_outputter::output_version () else id_str += String (", ") + version_str (); - output_String_def ( "mudelatagline", id_str); + output_String_def ( "lilypondtagline", id_str); output_String_def ( "LilyPondVersion", version_str ()); } diff --git a/lily/paper-score.cc b/lily/paper-score.cc index 2cc6685bf3..362dbbf3cd 100644 --- a/lily/paper-score.cc +++ b/lily/paper-score.cc @@ -100,15 +100,15 @@ Paper_score::process () 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) diff --git a/lily/parser.yy b/lily/parser.yy index 6853bc91fd..8b1fd7b85b 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1,7 +1,7 @@ %{ // -*-Fundamental-*- /* - parser.yy -- Bison/C++ parser for mudela + parser.yy -- Bison/C++ parser for lilypond source file of the GNU LilyPond music typesetter @@ -12,8 +12,7 @@ #include #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" @@ -29,7 +28,8 @@ #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" @@ -38,7 +38,7 @@ #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" @@ -52,11 +52,21 @@ is_duration_b (int t) } +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; @@ -83,9 +93,8 @@ print_mudela_versions (ostream &os) %union { - Array *pitch_arr; + Link_array *reqvec; - Duration *duration; Identifier *id; String * string; Music *music; @@ -94,7 +103,7 @@ print_mudela_versions (ostream &os) Musical_req* musreq; Music_output_def * outputdef; - Musical_pitch * pitch; + Midi_def* midi; Real real; Request * request; @@ -141,6 +150,7 @@ yylex (YYSTYPE *s, void * v_l) %token CLEF %token CM_T %token CONSISTS +%token DURATION %token SEQUENTIAL %token ELEMENTDESCRIPTIONS %token SIMULTANEOUS @@ -195,12 +205,12 @@ yylex (YYSTYPE *s, void * v_l) %token E_CHAR E_EXCLAMATION E_SMALLER E_BIGGER %token CHORD_BASS CHORD_COLON CHORD_MINUS CHORD_CARET -%type exclamations questions +%type exclamations questions dots %token DIGIT -%token NOTENAME_PITCH -%token TONICNAME_PITCH -%token CHORDMODIFIER_PITCH -%token DURATION_IDENTIFIER +%token NOTENAME_PITCH +%token TONICNAME_PITCH +%token CHORDMODIFIER_PITCH +%token DURATION_IDENTIFIER %token IDENTIFIER @@ -211,14 +221,14 @@ yylex (YYSTYPE *s, void * v_l) %token REQUEST_IDENTIFIER %token MUSIC_IDENTIFIER TRANSLATOR_IDENTIFIER %token STRING_IDENTIFIER SCM_IDENTIFIER -%token DURATION RESTNAME +%token RESTNAME %token STRING %token SCM_T %token UNSIGNED %token REAL %type output_def -%type mudela_header mudela_header_body +%type lilypond_header lilypond_header_body %type open_request_parens close_request_parens open_request close_request %type request_with_dir request_that_take_dir verbose_request %type sub_quotes sup_quotes @@ -230,18 +240,18 @@ yylex (YYSTYPE *s, void * v_l) %type identifier_init -%type steno_duration optional_notemode_duration -%type entered_notemode_duration explicit_duration +%type steno_duration optional_notemode_duration +%type entered_notemode_duration explicit_duration %type pre_requests post_requests %type gen_text_def -%type steno_musical_pitch musical_pitch absolute_musical_pitch -%type steno_tonic_pitch +%type steno_musical_pitch musical_pitch absolute_musical_pitch +%type steno_tonic_pitch -%type chord_additions chord_subtractions chord_notes chord_step +%type chord_additions chord_subtractions chord_notes chord_step %type chord -%type chord_note chord_inversion chord_bass -%type duration_length +%type chord_note chord_inversion chord_bass +%type duration_length %type embedded_scm scalar %type Music Sequential_music Simultaneous_music Music_sequence @@ -270,14 +280,14 @@ yylex (YYSTYPE *s, void * v_l) %% -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")); } @@ -290,7 +300,7 @@ toplevel_expression: | chordmodifiers_block { THIS->lexer_p_->chordmodifier_tab_ = $1; } - | mudela_header { + | lilypond_header { delete header_global_p; header_global_p = $1; } @@ -332,29 +342,30 @@ notenames_body: 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 (); } @@ -405,7 +416,7 @@ identifier_init: scm_unprotect_object ($$); } | explicit_duration { - $$ = (new Duration_identifier ($1, DURATION_IDENTIFIER))->self_scm (); + $$ = $1; } | number_expression { $$ = $1; @@ -523,7 +534,7 @@ score_body: | SCORE_IDENTIFIER { $$ = $1->access_content_Score (true); } - | score_body mudela_header { + | score_body lilypond_header { $$->header_p_ = $2; } | score_body output_def { @@ -604,9 +615,8 @@ music_output_def_body: 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)); } ; @@ -655,12 +665,13 @@ Repeated_music: 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; } ; @@ -705,7 +716,8 @@ Simple_music: 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; } @@ -766,12 +778,10 @@ Composite_music: | 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 ()); @@ -809,8 +819,7 @@ Composite_music: relative_music: RELATIVE absolute_musical_pitch Music { - $$ = new Relative_octave_music ($3, *$2); - delete $2; // ugh + $$ = new Relative_octave_music ($3, *unsmob_pitch ($2)); } ; @@ -832,7 +841,7 @@ translator_change: 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); @@ -845,7 +854,8 @@ property_def: 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); @@ -857,7 +867,8 @@ property_def: } | 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); @@ -869,7 +880,8 @@ property_def: } | 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); @@ -914,7 +926,8 @@ command_element: | 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); @@ -927,11 +940,12 @@ command_element: | 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")); @@ -940,12 +954,10 @@ command_element: 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 ()); } @@ -955,6 +967,20 @@ command_element: $$ =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: @@ -1016,13 +1042,6 @@ verbose_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)); @@ -1031,8 +1050,8 @@ verbose_command_req: } | 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 { @@ -1046,7 +1065,7 @@ verbose_command_req: 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; } ; @@ -1161,26 +1180,38 @@ steno_musical_pitch: $$ = $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 (); + } ; @@ -1189,25 +1220,21 @@ musical_pitch: $$ = $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 (); + } } ; @@ -1345,22 +1372,22 @@ duration_length: $$ = $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; @@ -1368,19 +1395,28 @@ optional_notemode_duration: ; 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 '.' { + $$ ++; } ; @@ -1402,25 +1438,25 @@ simple_element: 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 { @@ -1428,7 +1464,7 @@ simple_element: 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 (); @@ -1436,21 +1472,19 @@ simple_element: 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); @@ -1481,11 +1515,11 @@ simple_element: 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; } @@ -1499,13 +1533,13 @@ simple_element: 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; + $$ = SCM_EOL; } | CHORD_COLON chord_notes { $$ = $2; @@ -1517,14 +1551,13 @@ chord_notes: $$ = $1 } | chord_notes '.' chord_step { - $$ = $1; - $$->concat (*$3); + $$ = gh_append2 ($$, $3); } ; chord_subtractions: { - $$ = new Array; + $$ = SCM_EOL; } | CHORD_CARET chord_notes { $$ = $2; @@ -1534,58 +1567,59 @@ chord_subtractions: 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; - $$->push (*$1); + $$ = gh_cons ($1, SCM_EOL); } | CHORDMODIFIER_PITCH { - $$ = new Array; - $$->push (*$1); + $$ = gh_cons ($1, SCM_EOL); } | CHORDMODIFIER_PITCH chord_note { /* Ugh. */ - $$ = new Array; - $$->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 (); } ; diff --git a/lily/part-combine-music-iterator.cc b/lily/part-combine-music-iterator.cc index 68e41dce09..1f813a7445 100644 --- a/lily/part-combine-music-iterator.cc +++ b/lily/part-combine-music-iterator.cc @@ -13,6 +13,30 @@ #include "music-sequence.hh" #include "warn.hh" + +/* + DOCUMENTME + */ +int +compare (Array const * left, Array 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; @@ -116,9 +140,9 @@ get_music_info (Moment m, Music_iterator* iter, Array *pitches, A { Music *m = unsmob_music (gh_car (i)); if (Melodic_req *r = dynamic_cast (m)) - pitches->push (r->pitch_); + pitches->push (*unsmob_pitch (r->get_mus_property("pitch"))); if (Rhythmic_req *r = dynamic_cast (m)) - durations->push (r->duration_); + durations->push (*unsmob_duration (r->get_mus_property("duration"))); } } } @@ -408,3 +432,5 @@ Part_combine_music_iterator::get_music (Moment m)const s = gh_append2 (second_iter_p_->get_music (m),s); return s; } + +IMPLEMENT_CTOR_CALLBACK(Part_combine_music_iterator); diff --git a/lily/part-combine-music.cc b/lily/part-combine-music.cc index 1375f8d06f..91c351fc02 100644 --- a/lily/part-combine-music.cc +++ b/lily/part-combine-music.cc @@ -8,6 +8,7 @@ */ #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) @@ -20,7 +21,8 @@ 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 diff --git a/lily/property-iterator.cc b/lily/property-iterator.cc index 3799ba0e2f..302f9752df 100644 --- a/lily/property-iterator.cc +++ b/lily/property-iterator.cc @@ -45,3 +45,7 @@ Pop_property_iterator::process (Moment m) Simple_music_iterator::process (m); } + +IMPLEMENT_CTOR_CALLBACK(Pop_property_iterator); +IMPLEMENT_CTOR_CALLBACK(Push_property_iterator); +IMPLEMENT_CTOR_CALLBACK(Property_iterator); diff --git a/lily/repeated-music.cc b/lily/repeated-music.cc index 4cdd682761..6f2a0913be 100644 --- a/lily/repeated-music.cc +++ b/lily/repeated-music.cc @@ -31,9 +31,8 @@ Repeated_music::Repeated_music(Music *beg, int times, Music_sequence * alts) 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); @@ -46,10 +45,6 @@ Repeated_music::Repeated_music(Music *beg, int times, Music_sequence * alts) 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_; } @@ -89,25 +84,24 @@ Repeated_music::compress (Moment p) } 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; } @@ -119,15 +113,43 @@ Repeated_music::body_length_mom () const 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 (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 (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 (unsmob_music (m)); + Moment l = r->body_length_mom () + r->alternatives_length_mom (false); + return l.smobbed_copy (); +} diff --git a/lily/request-chord-iterator.cc b/lily/request-chord-iterator.cc index 79df69f6da..61efb38797 100644 --- a/lily/request-chord-iterator.cc +++ b/lily/request-chord-iterator.cc @@ -78,3 +78,5 @@ Request_chord_iterator::process (Moment m) } skip (m); } + +IMPLEMENT_CTOR_CALLBACK(Request_chord_iterator); diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index efb217c73e..090ded8527 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -80,11 +80,20 @@ Rest_collision::do_shift (Score_element *me, SCM elts) */ Link_array rests; Link_array 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); @@ -184,16 +193,15 @@ Rest_collision::do_shift (Score_element *me, SCM elts) // 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; /* @@ -202,7 +210,9 @@ Rest_collision::do_shift (Score_element *me, SCM elts) 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); diff --git a/lily/rest-engraver.cc b/lily/rest-engraver.cc index c7cada9b3d..ead302fbb4 100644 --- a/lily/rest-engraver.cc +++ b/lily/rest-engraver.cc @@ -71,17 +71,20 @@ Rest_engraver::do_process_music () 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); } diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 67801e884c..3bd5dd257b 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -35,8 +35,8 @@ Score_engraver::prepare (Moment w) 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); diff --git a/lily/sequential-music-iterator.cc b/lily/sequential-music-iterator.cc index 7260e3eb83..281b97c167 100644 --- a/lily/sequential-music-iterator.cc +++ b/lily/sequential-music-iterator.cc @@ -211,3 +211,4 @@ Sequential_music_iterator::try_music_in_children (Music *m) const { return iter_p_ ? iter_p_->try_music (m) : 0; } +IMPLEMENT_CTOR_CALLBACK(Sequential_music_iterator); diff --git a/lily/simple-music-iterator.cc b/lily/simple-music-iterator.cc index 855ff70780..ed118ec11f 100644 --- a/lily/simple-music-iterator.cc +++ b/lily/simple-music-iterator.cc @@ -54,3 +54,5 @@ Simple_music_iterator::process (Moment m) skip (m); } + +IMPLEMENT_CTOR_CALLBACK(Simple_music_iterator); diff --git a/lily/simultaneous-music-iterator.cc b/lily/simultaneous-music-iterator.cc index 4cc8d0c316..791dbd6185 100644 --- a/lily/simultaneous-music-iterator.cc +++ b/lily/simultaneous-music-iterator.cc @@ -143,3 +143,5 @@ Simultaneous_music_iterator::try_music_in_children (Music *m) const } + +IMPLEMENT_CTOR_CALLBACK(Simultaneous_music_iterator); diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc index d457007176..324c05cf2c 100644 --- a/lily/spacing-engraver.cc +++ b/lily/spacing-engraver.cc @@ -138,8 +138,8 @@ Spacing_engraver::do_pre_move_processing () Paper_column * sc = dynamic_cast (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); diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index caebede28b..c909039b50 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -58,8 +58,8 @@ Stem_engraver::acknowledge_element(Score_element_info i) if (Rhythmic_head::stem_l (h)) return; - Rhythmic_req * r = dynamic_cast (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")); @@ -107,12 +107,12 @@ Stem_engraver::acknowledge_element(Score_element_info i) 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); diff --git a/lily/stem.cc b/lily/stem.cc index 94ddf6ca93..46cc32163d 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -423,9 +423,11 @@ Stem::flag (Score_element*me) 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! diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc index bec3b7f0fa..277a4206e2 100644 --- a/lily/tie-engraver.cc +++ b/lily/tie-engraver.cc @@ -146,8 +146,8 @@ Tie_engraver::process_acknowledged () 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) { @@ -291,7 +291,10 @@ int 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 diff --git a/lily/tie-performer.cc b/lily/tie-performer.cc index f1088d4c8e..feb335d6e8 100644 --- a/lily/tie-performer.cc +++ b/lily/tie-performer.cc @@ -74,8 +74,8 @@ Tie_performer::process_acknowledged () 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) { @@ -157,7 +157,10 @@ int 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 diff --git a/lily/time-scaled-music-iterator.cc b/lily/time-scaled-music-iterator.cc index f68a4d7d88..cea13bf68b 100644 --- a/lily/time-scaled-music-iterator.cc +++ b/lily/time-scaled-music-iterator.cc @@ -27,3 +27,5 @@ Time_scaled_music_iterator::process (Moment m) Music_wrapper_iterator::process (m); } + +IMPLEMENT_CTOR_CALLBACK(Time_scaled_music_iterator); diff --git a/lily/time-scaled-music.cc b/lily/time-scaled-music.cc index 75547b17b4..868cedf3c0 100644 --- a/lily/time-scaled-music.cc +++ b/lily/time-scaled-music.cc @@ -8,7 +8,7 @@ */ #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) @@ -16,7 +16,8 @@ Time_scaled_music::Time_scaled_music (int n, int d,Music *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); } diff --git a/lily/time-signature-performer.cc b/lily/time-signature-performer.cc index 4c2076fd00..8127dd940d 100644 --- a/lily/time-signature-performer.cc +++ b/lily/time-signature-performer.cc @@ -6,15 +6,34 @@ (c) 1997--2000 Jan Nieuwenhuizen */ -#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; } @@ -26,13 +45,15 @@ Time_signature_performer::~Time_signature_performer () 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; } @@ -47,20 +68,5 @@ Time_signature_performer::do_pre_move_processing () 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 (req_l)) - { - time_signature_req_l_ = t; - return true; - } - - return false; -} +ADD_THIS_TRANSLATOR (Time_signature_performer); diff --git a/lily/unfolded-repeat-iterator.cc b/lily/unfolded-repeat-iterator.cc index 044ba7e842..c8a6fd404d 100644 --- a/lily/unfolded-repeat-iterator.cc +++ b/lily/unfolded-repeat-iterator.cc @@ -23,6 +23,7 @@ Unfolded_repeat_iterator::Unfolded_repeat_iterator () { done_count_ =0; current_iter_p_ =0; + volta_b_ = false; do_main_b_ = false; alternative_count_i_ =0; } @@ -44,7 +45,7 @@ Unfolded_repeat_iterator::next_element (bool side_effect) 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_) { @@ -60,7 +61,7 @@ Unfolded_repeat_iterator::next_element (bool side_effect) here_mom_ += repmus->body ()->length_mom (); - if (!repmus->volta_fold_b_) + if (!volta_b_) done_count_ ++; if (gh_pair_p (alternative_cons_)) @@ -68,7 +69,7 @@ Unfolded_repeat_iterator::next_element (bool side_effect) 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) @@ -76,11 +77,11 @@ Unfolded_repeat_iterator::next_element (bool side_effect) 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; @@ -101,8 +102,8 @@ Unfolded_repeat_iterator::next_element (bool side_effect) { 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) @@ -113,7 +114,7 @@ Unfolded_repeat_iterator::next_element (bool side_effect) /* 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_ ++; } @@ -125,7 +126,7 @@ Unfolded_repeat_iterator::next_element (bool side_effect) 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) { @@ -136,7 +137,7 @@ Unfolded_repeat_iterator::next_element (bool side_effect) } - if (repmus->volta_fold_b_) + if (volta_b_) current_iter_p_ = get_iterator_p (unsmob_music (gh_car (alternative_cons_))); else { @@ -207,7 +208,7 @@ Unfolded_repeat_iterator::process (Moment m) { if (!m) { - if (dynamic_cast (music_l_)->volta_fold_b_) + if (volta_b_) add_repeat_command (ly_symbol2scm ("start-repeat")); } while (1) @@ -282,3 +283,11 @@ Unfolded_repeat_iterator::try_music_in_children (Music * m) const { 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; +} diff --git a/lilypond-mode.el b/lilypond-mode.el index 5f570c77fd..6e3de95f4d 100644 --- a/lilypond-mode.el +++ b/lilypond-mode.el @@ -110,6 +110,7 @@ in LilyPond-include-path." ;; 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 @@ -121,7 +122,7 @@ in LilyPond-include-path." ("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. diff --git a/ly/catalan.ly b/ly/catalan.ly index 1739ae0862..403494d2cb 100644 --- a/ly/catalan.ly +++ b/ly/catalan.ly @@ -18,55 +18,55 @@ % 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 )) ) diff --git a/ly/chord-modifiers.ly b/ly/chord-modifiers.ly index 673620ddf8..5c61876a88 100644 --- a/ly/chord-modifiers.ly +++ b/ly/chord-modifiers.ly @@ -1,16 +1,16 @@ % 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 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 )) ) diff --git a/ly/declarations-as.ly b/ly/declarations-as.ly index ac43481fab..c45df5aea2 100644 --- a/ly/declarations-as.ly +++ b/ly/declarations-as.ly @@ -2,9 +2,10 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 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")) diff --git a/ly/declarations.ly b/ly/declarations.ly index b2781c3dd2..468fc57529 100644 --- a/ly/declarations.ly +++ b/ly/declarations.ly @@ -1,6 +1,6 @@ -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" diff --git a/ly/deutsch.ly b/ly/deutsch.ly index 25f2f87431..4ac2fd4022 100644 --- a/ly/deutsch.ly +++ b/ly/deutsch.ly @@ -8,42 +8,42 @@ \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 )) ) diff --git a/ly/english.ly b/ly/english.ly index 4f125fe764..0ce982f826 100644 --- a/ly/english.ly +++ b/ly/english.ly @@ -3,78 +3,78 @@ 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"; diff --git a/ly/italiano.ly b/ly/italiano.ly index 4df74b22cc..3db0e86dbe 100644 --- a/ly/italiano.ly +++ b/ly/italiano.ly @@ -11,41 +11,41 @@ % contributed by Paolo Zuliani \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"; diff --git a/ly/midi.ly b/ly/midi.ly index b41614cc2b..f367eafe59 100644 --- a/ly/midi.ly +++ b/ly/midi.ly @@ -6,3 +6,4 @@ \include "performer.ly" % unfold_all = "1"; } + diff --git a/ly/nederlands.ly b/ly/nederlands.ly index dc8c4919e4..9d16eb3cbb 100644 --- a/ly/nederlands.ly +++ b/ly/nederlands.ly @@ -2,46 +2,47 @@ 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 )) +) diff --git a/ly/norsk.ly b/ly/norsk.ly index 2dce7f7fd6..36a2dae712 100644 --- a/ly/norsk.ly +++ b/ly/norsk.ly @@ -1,5 +1,5 @@ -% $Id: norsk.ly,v 1.7 2000/10/22 00:11:33 fred Exp $ +% $Id: norsk.ly,v 1.8 2000/11/12 22:29:58 fred Exp $ %{ @@ -28,78 +28,78 @@ %} \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 )) ) diff --git a/ly/svenska.ly b/ly/svenska.ly index 09cfad936e..8fdb6abcc1 100644 --- a/ly/svenska.ly +++ b/ly/svenska.ly @@ -4,40 +4,40 @@ % 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"; diff --git a/ps/lilyponddefs.ps b/ps/lilyponddefs.ps index 768713c521..5f9a9f1451 100644 --- a/ps/lilyponddefs.ps +++ b/ps/lilyponddefs.ps @@ -3,8 +3,8 @@ % hmm % /setgray { 1 add } bind def -/stafflinethickness mudelapaperstafflinethickness def -/staffheight mudelapaperstaffheight def +/stafflinethickness lilypondpaperstafflinethickness def +/staffheight lilypondpaperstaffheight def /xoffset 30 def /yoffset 700 def @@ -57,7 +57,7 @@ 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 diff --git a/scm/ascii-script.scm b/scm/ascii-script.scm index ea9bc54a30..ada96b4592 100644 --- a/scm/ascii-script.scm +++ b/scm/ascii-script.scm @@ -83,8 +83,8 @@ (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") "")) diff --git a/scm/chord-names.scm b/scm/chord-names.scm index 1cac00d032..25ddef79a9 100644 --- a/scm/chord-names.scm +++ b/scm/chord-names.scm @@ -24,9 +24,9 @@ ;; * 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. ;;;;;;;;; @@ -68,6 +68,7 @@ ;; DONT use non-ascii characters, even if ``it works'' in Windows (define chord::names-alist-american '()) + (set! chord::names-alist-american (append '( @@ -428,7 +429,7 @@ (list 'super (step->text-banter p)) (if (pair? (cdr from)) '((super "/")) - '())))))) + '())))))) ; nesting? to)) (if (and (pair? base-and-inversion) (or (car base-and-inversion) @@ -461,6 +462,14 @@ (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 @@ -472,6 +481,10 @@ ;(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)))) diff --git a/scm/element-descriptions.scm b/scm/element-descriptions.scm index 9adc6639cb..72c8e72edd 100644 --- a/scm/element-descriptions.scm +++ b/scm/element-descriptions.scm @@ -419,7 +419,8 @@ (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)) )) diff --git a/scm/font.scm b/scm/font.scm index e436fb4866..fec9446ef5 100644 --- a/scm/font.scm +++ b/scm/font.scm @@ -24,8 +24,8 @@ ) )) -;; 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))) @@ -42,9 +42,8 @@ ;; 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) @@ -123,21 +122,24 @@ ((-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))) @@ -189,9 +191,7 @@ (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, @@ -215,8 +215,8 @@ ) ) -;; 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 @@ -226,9 +226,8 @@ ) )) - -;; 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) @@ -247,9 +246,10 @@ )) -;; 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)) ) @@ -287,9 +287,7 @@ ) ;; 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. @@ -342,15 +340,16 @@ 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)) -; ) - - +) diff --git a/scm/interface.scm b/scm/interface.scm index 3c201da7eb..7a5683c887 100644 --- a/scm/interface.scm +++ b/scm/interface.scm @@ -113,7 +113,7 @@ more than this (in staffspace)") "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") )) ) @@ -386,7 +386,7 @@ Align_interface::center_on_element). ") (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 @@ -828,15 +828,6 @@ Calc dimensions for the Separating_group_spanner; this has to be ) )) -(define text-script-interface - (lily-interface - 'text-script-interface - "" - (list - - ))) - - (define tie-interface (lily-interface 'tie-interface diff --git a/scm/lily.scm b/scm/lily.scm index 6876a9cb65..0e664d2ebd 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -303,7 +303,7 @@ (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 @@ -579,7 +579,7 @@ (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") ) @@ -828,15 +828,15 @@ ) (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))) ) ) @@ -844,3 +844,36 @@ (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)) + ) + )) + diff --git a/scm/translator-description.scm b/scm/translator-description.scm index ee58d6ba18..5cad9dbf56 100644 --- a/scm/translator-description.scm +++ b/scm/translator-description.scm @@ -245,7 +245,8 @@ The head of the list: '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. @@ -678,7 +679,16 @@ Description of scripts to use. (fixme) '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? "") @@ -852,8 +862,11 @@ either unison, unisilence or soloADue is set" '() (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 @@ -879,10 +892,10 @@ defaultBarType, barAlways, barNonAuto and measurePosition. @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 ") @@ -913,12 +926,12 @@ Normally a tuplet bracket is as wide as the 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? " diff --git a/scripts/abc2ly.py b/scripts/abc2ly.py index 8d769e2c7a..b31a56bc3c 100644 --- a/scripts/abc2ly.py +++ b/scripts/abc2ly.py @@ -583,7 +583,7 @@ def try_parse_header_line (ln, state): # 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: @@ -600,7 +600,7 @@ def pitch_to_mudela_name (name, acc, bar_acc, key): 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: @@ -623,7 +623,7 @@ def parse_num (str): 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]: @@ -711,7 +711,7 @@ def try_parse_rest (str, parser_state): 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 = '' @@ -841,15 +841,15 @@ def try_parse_note (str, parser_state): 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: @@ -1021,7 +1021,7 @@ def try_parse_comment (str): 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. @@ -1103,7 +1103,7 @@ def identify(): def help (): print r""" -Convert ABC to Mudela. +Convert ABC to Lilypond. Usage: abc2ly [OPTIONS]... ABC-FILE diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py new file mode 100644 index 0000000000..e974394f10 --- /dev/null +++ b/scripts/convert-ly.py @@ -0,0 +1,697 @@ +#!@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, ' c -> ~ c') + +if 1: + def conv(str): + str = re.sub ('<\\[','[<', str) + str = re.sub ('\\]>','>]', str) + + return str + + conversions.append ((1,0,14), conv, '<[a b> c -> [ ]') + + +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 diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py new file mode 100644 index 0000000000..07de5b75bd --- /dev/null +++ b/scripts/lilypond-book.py @@ -0,0 +1,1102 @@ +#!@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 +

+ +@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\\mbinput{?([^}\t \n}]*))', + 'include': r'(?m)^[^%\n]*?(?P\\mbinclude{(?P[^}]+)})', + 'option-sep' : ', *', + 'header': r"\\documentclass\s*(\[.*?\])?", + 'geometry': r"^(?m)[^%\n]*?\\usepackage\s*(\[(?P.*)\])?\s*{geometry}", + 'preamble-end': r'(?P\\begin{document})', + 'verbatim': r"(?s)(?P\\begin{verbatim}.*?\\end{verbatim})", + 'verb': r"(?P\\verb(?P.).*?(?P=del))", + 'lilypond-file': r'(?m)^[^%\n]*?(?P\\lilypondfile(\[(?P.*?)\])?\{(?P.+)})', + 'lilypond' : r'(?m)^[^%\n]*?(?P\\lilypond(\[(?P.*?)\])?{(?P.*?)})', + 'lilypond-block': r"(?sm)^[^%\n]*?(?P\\begin(\[(?P.*?)\])?{lilypond}(?P.*?)\\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(?P^%.*$\n+))", + 'numcols': r"(?P\\(?Pone|two)column)", + }, + + 'texi': { + 'include': '(?m)^[^%\n]*?(?P@mbinclude[ \n\t]+(?P[^\t \n]*))', + 'input': no_match, + 'header': no_match, + 'preamble-end': no_match, + 'landscape': no_match, + 'verbatim': r"""(?s)(?P@example\s.*?@end example\s)""", + 'verb': r"""(?P@code{.*?})""", + 'lilypond-file': '(?m)^(?!@c)(?P@lilypondfile(\[(?P.*?)\])?{(?P[^}]+)})', + 'lilypond' : '(?m)^(?!@c)(?P@lilypond(\[(?P.*?)\])?{(?P.*?)})', + 'lilypond-block': r"""(?m)^(?!@c)(?P(?s)(?P@lilypond(\[(?P.*?)\])?\s(?P.*?)@end lilypond\s))""", + 'option-sep' : ', *', + 'intertext': r',?\s*intertext=\".*?\"', + 'multiline-comment': r"(?sm)^\s*(?!@c\s+)(?P@ignore\s.*?@end ignore)\s", + 'singleline-comment': r"(?m)^.*?(?P(?P@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 and +Han-Wen Nienhuys +""") + + 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 diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index a6b4af0972..635932dc28 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -151,7 +151,7 @@ class Input: 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]: @@ -171,7 +171,7 @@ class TeXOutput: 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 @@ -192,7 +192,7 @@ class TeXOutput: # # __medelaDefs # - def __mudelaDefs(this,opt): + def __lilypondDefs(this,opt): """ Write titles to output @@ -203,7 +203,7 @@ class TeXOutput: 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 @@ -271,7 +271,7 @@ class TeXOutput: \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'), @@ -289,7 +289,7 @@ class TeXOutput: except: sys.exit('ExitNoWrite', this.__outfile) this.write(top) - this.__mudelaDefs('') + this.__lilypondDefs('') this.write("""\ \\makelilytitle """) @@ -311,13 +311,13 @@ class TeXOutput: 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 """) @@ -339,9 +339,9 @@ class TeXOutput: 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} """) @@ -494,7 +494,7 @@ class Properties: 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 @@ -839,7 +839,7 @@ class Properties: 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) diff --git a/scripts/musedata2ly.py b/scripts/musedata2ly.py index ec139d467c..81bb7bcc9e 100644 --- a/scripts/musedata2ly.py +++ b/scripts/musedata2ly.py @@ -119,7 +119,7 @@ def get_transposing (s): 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')) diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4 index e812c5f830..724a91b40b 100644 --- a/stepmake/aclocal.m4 +++ b/stepmake/aclocal.m4 @@ -76,6 +76,7 @@ AC_DEFUN(AC_STEPMAKE_COMPILE, [ CFLAGS="$CFLAGS $OPTIMIZE" CPPFLAGS=${CPPFLAGS:-""} + AC_SUBST(cross_compiling) AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) diff --git a/stepmake/make/stepmake.make b/stepmake/make/stepmake.make index 2834b7bc17..6e524643e0 100644 --- a/stepmake/make/stepmake.make +++ b/stepmake/make/stepmake.make @@ -2,12 +2,6 @@ include $(depth)/make/toplevel-version.make -# Don't try to outsmart us, you puny computer! -ifeq (0,${MAKELEVEL}) - MAKE:=$(MAKE) --no-builtin-rules -endif -.SUFFIXES: - # Use alternate configurations alongside eachother: # # ./configure --enable-config=debug @@ -64,6 +58,15 @@ STEPMAKE_TEMPLATES := generic $(STEPMAKE_TEMPLATES) LOCALSTEPMAKE_TEMPLATES:= generic $(LOCALSTEPMAKE_TEMPLATES) +# Don't try to outsmart us, you puny computer! +# Well, UGH. This only removes builtin rules from +# subsequent $(MAKE)s, *not* from the current run! +ifeq (0,${MAKELEVEL}) + MAKE:=$(MAKE) --no-builtin-rules + include $(stepdir)/no-builtin-rules.make +endif +.SUFFIXES: + all: -include $(addprefix $(depth)/make/,$(addsuffix -inclusions.make, $(LOCALSTEPMAKE_TEMPLATES))) diff --git a/stepmake/stepmake/no-builtin-rules.make b/stepmake/stepmake/no-builtin-rules.make new file mode 100644 index 0000000000..e8e2718eb5 --- /dev/null +++ b/stepmake/stepmake/no-builtin-rules.make @@ -0,0 +1,242 @@ +# UGH. GNU make comes with implicit rules. +# We don't want any of them, and can't force users to run +# --no-builtin-rules + +.SUFFIXES: + +#Compiling C programs +# `N.o' is made automatically from `N.c' with a command of the form +# `$(CC) -c $(CPPFLAGS) $(CFLAGS)'. + +%.o: %.c + +# Compiling C++ programs +# `N.o' is made automatically from `N.cc' or `N.C' with a command of +# the form `$(CXX) -c $(CPPFLAGS) $(CXXFLAGS)'. We encourage you to +# use the suffix `.cc' for C++ source files instead of `.C'. + +%.o: %.cc + +# Compiling Pascal programs +# `N.o' is made automatically from `N.p' with the command `$(PC) -c +# $(PFLAGS)'. + +%.o: %.p + +# Compiling Fortran and Ratfor programs +# `N.o' is made automatically from `N.r', `N.F' or `N.f' by running +# the Fortran compiler. The precise command used is as follows: + +# `.f' +# `$(FC) -c $(FFLAGS)'. + +%.o: %.f + +# `.F' +# `$(FC) -c $(FFLAGS) $(CPPFLAGS)'. + +%.o: %.F + +# `.r' +# `$(FC) -c $(FFLAGS) $(RFLAGS)'. + +%.o: %.r + +# Preprocessing Fortran and Ratfor programs +# `N.f' is made automatically from `N.r' or `N.F'. This rule runs +# just the preprocessor to convert a Ratfor or preprocessable +# Fortran program into a strict Fortran program. The precise +# command used is as follows: + +# `.F' +# `$(FC) -F $(CPPFLAGS) $(FFLAGS)'. + +%.f: %.F + +# `.r' +# `$(FC) -F $(FFLAGS) $(RFLAGS)'. + +%.f: %.r + +# Compiling Modula-2 programs +# `N.sym' is made from `N.def' with a command of the form `$(M2C) +# $(M2FLAGS) $(DEFFLAGS)'. `N.o' is made from `N.mod'; the form is: +# `$(M2C) $(M2FLAGS) $(MODFLAGS)'. + +%.sym: %.def +%.o: %.mod + +# Assembling and preprocessing assembler programs +# `N.o' is made automatically from `N.s' by running the assembler, +# `as'. The precise command is `$(AS) $(ASFLAGS)'. + +%.o: %.s + +# `N.s' is made automatically from `N.S' by running the C +# preprocessor, `cpp'. The precise command is `$(CPP) $(CPPFLAGS)'. + +%.s: %.S + +# Linking a single object file +# `N' is made automatically from `N.o' by running the linker +# (usually called `ld') via the C compiler. The precise command +# used is `$(CC) $(LDFLAGS) N.o $(LOADLIBES) $(LDLIBS)'. + +%: %.o + +# This rule does the right thing for a simple program with only one +# source file. It will also do the right thing if there are multiple +# object files (presumably coming from various other source files), +# one of which has a name matching that of the executable file. +# Thus, + +# x: y.o z.o + +# when `x.c', `y.c' and `z.c' all exist will execute: + +# cc -c x.c -o x.o +# cc -c y.c -o y.o +# cc -c z.c -o z.o +# cc x.o y.o z.o -o x +# rm -f x.o +# rm -f y.o +# rm -f z.o + +# In more complicated cases, such as when there is no object file +# whose name derives from the executable file name, you must write +# an explicit command for linking. + +# Each kind of file automatically made into `.o' object files will +# be automatically linked by using the compiler (`$(CC)', `$(FC)' or +# `$(PC)'; the C compiler `$(CC)' is used to assemble `.s' files) +# without the `-c' option. This could be done by using the `.o' +# object files as intermediates, but it is faster to do the +# compiling and linking in one step, so that's how it's done. + +# Yacc for C programs +# `N.c' is made automatically from `N.y' by running Yacc with the +# command `$(YACC) $(YFLAGS)'. + +%.c: %.y + +# Lex for C programs +# `N.c' is made automatically from `N.l' by by running Lex. The +# actual command is `$(LEX) $(LFLAGS)'. + +%.c: %.l + +# Lex for Ratfor programs +# `N.r' is made automatically from `N.l' by by running Lex. The +# actual command is `$(LEX) $(LFLAGS)'. + +%.r: %.l + +# The convention of using the same suffix `.l' for all Lex files +# regardless of whether they produce C code or Ratfor code makes it +# impossible for `make' to determine automatically which of the two +# languages you are using in any particular case. If `make' is +# called upon to remake an object file from a `.l' file, it must +# guess which compiler to use. It will guess the C compiler, because +# that is more common. If you are using Ratfor, make sure `make' +# knows this by mentioning `N.r' in the makefile. Or, if you are +# using Ratfor exclusively, with no C files, remove `.c' from the +# list of implicit rule suffixes with: + +# .SUFFIXES: +# .SUFFIXES: .o .r .f .l ... + +# Making Lint Libraries from C, Yacc, or Lex programs +# `N.ln' is made from `N.c' by running `lint'. The precise command +# is `$(LINT) $(LINTFLAGS) $(CPPFLAGS) -i'. The same command is +# used on the C code produced from `N.y' or `N.l'. + +%.ln: %.c + +# TeX and Web +# `N.dvi' is made from `N.tex' with the command `$(TEX)'. `N.tex' +# is made from `N.web' with `$(WEAVE)', or from `N.w' (and from +# `N.ch' if it exists or can be made) with `$(CWEAVE)'. `N.p' is +# made from `N.web' with `$(TANGLE)' and `N.c' is made from `N.w' +# (and from `N.ch' if it exists or can be made) with `$(CTANGLE)'. + +%.dvi: %.tex +%.tex: %.web +%.tex: %.w +%.tex: %.ch +%.p: %.web +%.c: %.w +%.w: %.ch + +# Texinfo and Info +# `N.dvi' is made from `N.texinfo', `N.texi', or `N.txinfo', with +# the command `$(TEXI2DVI) $(TEXI2DVI_FLAGS)'. `N.info' is made from +# `N.texinfo', `N.texi', or `N.txinfo', with the command +# `$(MAKEINFO) $(MAKEINFO_FLAGS)'. + +%.dvi: %.texinfo +%.dvi: %.texi +%.dvi: %.txinfo + +%.info: %.texinfo +%.info: %.texi +%.info: %.txinfo + +# RCS +# Any file `N' is extracted if necessary from an RCS file named +# either `N,v' or `RCS/N,v'. The precise command used is +# `$(CO) $(COFLAGS)'. `N' will not be extracted from RCS if it +# already exists, even if the RCS file is newer. The rules for RCS +# are terminal (*note Match-Anything Pattern Rules: Match-Anything +# Rules.), so RCS files cannot be generated from another source; +# they must actually exist. + +%: %,v +%: RCS/%,v + +# SCCS +# Any file `N' is extracted if necessary from an SCCS file named +# either `s.N' or `SCCS/s.N'. The precise command used is +# `$(GET) $(GFLAGS)'. The rules for SCCS are terminal (*note +# Match-Anything Pattern Rules: Match-Anything Rules.), so SCCS +# files cannot be generated from another source; they must actually +# exist. + +%: s.% +%: SCCS/s.% + +# For the benefit of SCCS, a file `N' is copied from `N.sh' and made +# executable (by everyone). This is for shell scripts that are +# checked into SCCS. Since RCS preserves the execution permission +# of a file, you do not need to use this feature with RCS. + +%: %.sh + +# We recommend that you avoid using of SCCS. RCS is widely held to +# be superior, and is also free. By choosing free software in place +# of comparable (or inferior) proprietary software, you support the +# free software movement. + +# Usually, you want to change only the variables listed in the table +# above, which are documented in the following section. + +# However, the commands in built-in implicit rules actually use +# variables such as `COMPILE.c', `LINK.p', and `PREPROCESS.S', whose +# values contain the commands listed above. + +# `make' follows the convention that the rule to compile a `.X' source +# file uses the variable `COMPILE.X'. Similarly, the rule to produce an +# executable from a `.X' file uses `LINK.X'; and the rule to preprocess a +# `.X' file uses `PREPROCESS.X'. + +# Every rule that produces an object file uses the variable +# `OUTPUT_OPTION'. `make' defines this variable either to contain `-o +# $@', or to be empty, depending on a compile-time option. You need the +# `-o' option to ensure that the output goes into the right file when the +# source file is in a different directory, as when using `VPATH' (*note +# Directory Search::). However, compilers on some systems do not accept +# a `-o' switch for object files. If you use such a system, and use +# `VPATH', some compilations will put their output in the wrong place. A +# possible workaround for this problem is to give `OUTPUT_OPTION' the +# value `; mv $*.o $@'. + + diff --git a/stepmake/stepmake/texinfo-targets.make b/stepmake/stepmake/texinfo-targets.make index ca47789ef0..1e40d936cf 100644 --- a/stepmake/stepmake/texinfo-targets.make +++ b/stepmake/stepmake/texinfo-targets.make @@ -1,5 +1,7 @@ -# empty + +default: $(INFO_FILES) local-WWW: $(addprefix $(outdir)/,$(TEXI_FILES:.texi=.html)) local-doc: $(OUTTXT_FILES) + diff --git a/tex/headers.tex b/tex/headers.tex index cd4bc70c60..4da5d07f1e 100644 --- a/tex/headers.tex +++ b/tex/headers.tex @@ -9,7 +9,7 @@ \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} diff --git a/tex/lily-pdf-defs.tex b/tex/lily-pdf-defs.tex index 0c15069c38..5e91c0da92 100644 --- a/tex/lily-pdf-defs.tex +++ b/tex/lily-pdf-defs.tex @@ -215,12 +215,12 @@ \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 } diff --git a/tex/lily-ps-defs.tex b/tex/lily-ps-defs.tex index bfd4a8e40d..4f208653f2 100644 --- a/tex/lily-ps-defs.tex +++ b/tex/lily-ps-defs.tex @@ -13,8 +13,8 @@ % 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}% } } diff --git a/tex/lilypond-latex.tex b/tex/lilypond-latex.tex index e8a60fed86..1c7a3f5a3c 100644 --- a/tex/lilypond-latex.tex +++ b/tex/lilypond-latex.tex @@ -8,7 +8,7 @@ \renewcommand{\@evenfoot}{}% \renewcommand{\@evenhead}{}% \renewcommand{\@oddfoot}{% - \ifnum\thepage=1{\hfil \mudelatagline}% + \ifnum\thepage=1{\hfil \lilypondtagline}% \else{% foo\hfil\the\pageno\hfil}% \fi}} @@ -17,7 +17,7 @@ \renewcommand{\@evenfoot}{}% \renewcommand{\@evenhead}{}% \renewcommand{\@oddfoot}{% - \ifnum\thepage=1{\hfil \mudelatagline}% + \ifnum\thepage=1{\hfil \lilypondtagline}% \else{foo\hfil\the\pageno\hfil}% \fi}}% \nopagenumbers diff --git a/tex/lilypond-plaintex.tex b/tex/lilypond-plaintex.tex index 1e4fdec9f0..7dddb283b7 100644 --- a/tex/lilypond-plaintex.tex +++ b/tex/lilypond-plaintex.tex @@ -2,7 +2,7 @@ \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 diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex index 997fabd85b..91477809e4 100644 --- a/tex/lilyponddefs.tex +++ b/tex/lilyponddefs.tex @@ -34,15 +34,15 @@ \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}}}}% diff --git a/tex/mudela-book.tex b/tex/mudela-book.tex index 7350eb5d40..41431b1329 100644 --- a/tex/mudela-book.tex +++ b/tex/mudela-book.tex @@ -3,23 +3,23 @@ % 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 diff --git a/tex/titledefs.tex b/tex/titledefs.tex index b6c9c7570b..8e0bd60b00 100644 --- a/tex/titledefs.tex +++ b/tex/titledefs.tex @@ -28,40 +28,40 @@ \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 -- 2.39.5