]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of git://git.sv.gnu.org/lilypond
authorNicolas Sceaux <nicolas.sceaux@free.fr>
Fri, 5 Jan 2007 18:54:42 +0000 (19:54 +0100)
committerNicolas Sceaux <nicolas.sceaux@free.fr>
Fri, 5 Jan 2007 18:54:42 +0000 (19:54 +0100)
231 files changed:
.gitignore
Documentation/topdocs/INSTALL.texi
Documentation/topdocs/NEWS.tely
Documentation/user/advanced-notation.itely
Documentation/user/cheatsheet.itely
Documentation/user/music-glossary.tely
Documentation/user/non-music.itely
Documentation/user/point-and-click.itely [deleted file]
GNUmakefile.in
THANKS
VERSION
buildscripts/add_html_footer.py
buildscripts/build-coverage.sh
buildscripts/build-profile.sh [new file with mode: 0755]
buildscripts/coverage.py
buildscripts/output-distance.py
input/GNUmakefile
input/midi/GNUmakefile [deleted file]
input/midi/midi-drums.ly [deleted file]
input/midi/midi-grace.ly [deleted file]
input/midi/midi-lyric-barcheck.ly [deleted file]
input/midi/midi-scales.ly [deleted file]
input/midi/midi-tuplets.ly [deleted file]
input/midi/midi-volume-equaliser.ly [deleted file]
input/midi/transposition.ly [deleted file]
input/no-notation/GNUmakefile [deleted file]
input/no-notation/README [deleted file]
input/no-notation/bar-check.ly [deleted file]
input/no-notation/beam-warn.ly [deleted file]
input/no-notation/die-staff.ly [deleted file]
input/no-notation/display-lily-tests.ly [deleted file]
input/no-notation/dos-guile.ly [deleted file]
input/no-notation/dos-ps.ly [deleted file]
input/no-notation/dos-tex.ly [deleted file]
input/no-notation/dynamic-absolute-volume.ly [deleted file]
input/no-notation/embedded-scm.ly [deleted file]
input/no-notation/parse.ly [deleted file]
input/no-notation/parse2.ly [deleted file]
input/no-notation/parse3.ly [deleted file]
input/no-notation/parse4.ly [deleted file]
input/no-notation/parse5.ly [deleted file]
input/no-notation/recording.ly [deleted file]
input/no-notation/safe-guile.ly [deleted file]
input/no-notation/safe-include.ly [deleted file]
input/no-notation/safe-ps.ly [deleted file]
input/no-notation/safe-tex.ly [deleted file]
input/no-notation/textcresc.ly [deleted file]
input/no-notation/to-xml.ly [deleted file]
input/regression/accidental-clef-change.ly
input/regression/apply-context.ly
input/regression/bar-line-dotted.ly [new file with mode: 0644]
input/regression/beam-flat-retain-direction.ly [new file with mode: 0644]
input/regression/bend-dot.ly
input/regression/break.ly
input/regression/chord-tremolo-single.ly [new file with mode: 0644]
input/regression/cluster-break.ly [new file with mode: 0644]
input/regression/cluster-style.ly [new file with mode: 0644]
input/regression/cluster.ly
input/regression/completion-heads-polyphony.ly
input/regression/context-die-staff.ly [new file with mode: 0644]
input/regression/display-lily-tests.ly [new file with mode: 0644]
input/regression/dynamics-broken-hairpin.ly
input/regression/finger-chords-accidental.ly [new file with mode: 0644]
input/regression/general-scheme-bindings.ly [new file with mode: 0644]
input/regression/glissando.ly
input/regression/hairpin-to-rest.ly [new file with mode: 0644]
input/regression/identifiers.ly [new file with mode: 0644]
input/regression/instrument-name-dynamic.ly
input/regression/lyric-combine-switch-voice.ly [new file with mode: 0644]
input/regression/lyric-extender-broken.ly
input/regression/lyric-extender-no-heads.ly [new file with mode: 0644]
input/regression/lyric-hyphen-break.ly
input/regression/measure-grouping.ly
input/regression/midi-absolute-volume.ly [new file with mode: 0644]
input/regression/midi-drums.ly [new file with mode: 0644]
input/regression/midi-grace.ly [new file with mode: 0644]
input/regression/midi-lyric-barcheck.ly [new file with mode: 0644]
input/regression/midi-microtone.ly [new file with mode: 0644]
input/regression/midi-scales.ly [new file with mode: 0644]
input/regression/midi-transposition.ly [new file with mode: 0644]
input/regression/midi-tuplets.ly [new file with mode: 0644]
input/regression/midi-volume-equaliser.ly [new file with mode: 0644]
input/regression/multi-measure-rest-usebreve.ly [new file with mode: 0644]
input/regression/multi-measure-rest.ly
input/regression/non-empty-text.ly
input/regression/note-line.ly
input/regression/part-combine-tuplet.ly [new file with mode: 0644]
input/regression/profile-property-access.ly [new file with mode: 0644]
input/regression/relative-repeat.ly [new file with mode: 0644]
input/regression/safe.ly [new file with mode: 0644]
input/regression/skiptypesetting-bar-check.ly [new file with mode: 0644]
input/regression/slur-nice.ly
input/regression/spacing-mark-width.ly [new file with mode: 0644]
input/regression/tie-broken-minimum-length.ly
input/regression/to-xml.ly [new file with mode: 0644]
input/regression/tuplet-nest-beam.ly [new file with mode: 0644]
input/regression/warn-conflicting-key-signatures.ly [new file with mode: 0644]
input/test/compound-time.ly
input/test/makam.ly
lily/all-font-metrics.cc
lily/ambitus.cc
lily/auto-beam-engraver.cc
lily/axis-group-interface.cc
lily/beam-concave.cc
lily/beam-quanting.cc
lily/beam.cc
lily/bezier.cc
lily/book-scheme.cc
lily/break-alignment-interface.cc
lily/chord-tremolo-iterator.cc
lily/clef.cc
lily/cluster.cc
lily/context-scheme.cc
lily/context.cc
lily/duration-scheme.cc
lily/duration.cc
lily/dynamic-engraver.cc
lily/dynamic-performer.cc
lily/easy-notation.cc
lily/engraver.cc
lily/extender-engraver.cc
lily/figured-bass-engraver.cc
lily/font-config-scheme.cc
lily/font-metric-scheme.cc
lily/font-metric.cc
lily/function-documentation.cc
lily/general-scheme.cc
lily/grob-interface.cc
lily/grob-pitch-tuple.cc [deleted file]
lily/grob-property.cc
lily/grob.cc
lily/guile-init.cc
lily/hairpin.cc
lily/hara-kiri-group-spanner.cc
lily/includable-lexer.cc
lily/include/beam.hh
lily/include/grob-pitch-tuple.hh
lily/include/grob.hh
lily/include/includable-lexer.hh
lily/include/lily-guile.hh
lily/include/lily-lexer.hh
lily/include/lily-parser.hh
lily/include/lookup.hh
lily/include/profile.hh
lily/include/program-option.hh
lily/include/relocate.hh
lily/include/rest.hh
lily/include/stencil.hh
lily/include/tie.hh
lily/input-scheme.cc
lily/instrument-switch-engraver.cc
lily/lexer.ll
lily/lily-guile.cc
lily/lily-lexer-scheme.cc
lily/lily-lexer.cc
lily/lily-parser-scheme.cc
lily/lily-parser.cc
lily/lilypond-key.cc
lily/line-interface.cc
lily/lookup.cc
lily/lyric-combine-music-iterator.cc
lily/lyric-engraver.cc
lily/main.cc
lily/melody-spanner.cc
lily/midi-item.cc
lily/modified-font-metric.cc
lily/multi-measure-rest.cc
lily/new-fingering-engraver.cc
lily/note-name-engraver.cc
lily/note-spacing-engraver.cc
lily/open-type-font.cc
lily/pango-font.cc
lily/pango-select-scheme.cc
lily/pango-select.cc
lily/paper-book.cc
lily/paper-column.cc
lily/parser.yy
lily/pfb.cc
lily/pitch.cc
lily/prob.cc
lily/profile.cc
lily/program-option.cc
lily/repeat-acknowledge-engraver.cc
lily/rest-collision.cc
lily/rest.cc
lily/score-scheme.cc
lily/semi-tie-column.cc
lily/semi-tie.cc
lily/simple-spacer.cc
lily/slur-scoring.cc
lily/source-file.cc
lily/spaceable-grob.cc
lily/span-bar.cc
lily/stem-tremolo.cc
lily/stem.cc
lily/system.cc
lily/text-metrics.cc
lily/tie-column.cc
lily/tie-engraver.cc
lily/tie-formatting-problem.cc
lily/tie.cc
lily/time-scaled-music-iterator.cc
lily/time-signature-engraver.cc
lily/time-signature.cc
lily/translator-group-ctors.cc
lily/translator.cc
lily/ttf.cc
lily/tuplet-bracket.cc
lily/tuplet-engraver.cc
lily/vaticana-ligature-engraver.cc
lily/vertical-align-engraver.cc
lily/volta-repeat-iterator.cc
ly/engraver-init.ly
ly/init.ly
ly/lilypond-book-preamble.ly
ly/music-functions-init.ly
make/doclang-targets.make
make/ly-rules.make
scm/backend-library.scm
scm/define-context-properties.scm
scm/define-grob-properties.scm
scm/define-grobs.scm
scm/framework-eps.scm
scm/layout-beam.scm
scm/lily-library.scm
scm/lily.scm
scm/music-functions.scm
scm/output-ps.scm
scm/safe-lily.scm
scm/script.scm
scripts/lilypond-book.py

index 1f6b89a514ae8e4c8aadf570a168892d31d88e20..f69a725cab37b78e65ea408c0564edacbbf3a071 100644 (file)
@@ -54,5 +54,8 @@ configure
 gcstat*.scm
 lily-[0-9a-f][0-9a-f][0-9a-f]*
 out-scons
+out-cov
 tags
 test-output-distance
+config-*.hh
+config-*.make
index 52d8d8cf767d01049a9dc0f332873e3867dfa407..616eed601084caceba3f341beece0b8cc4338636 100644 (file)
@@ -116,7 +116,7 @@ software
 @item @uref{http://www.freetype.org/,FontConfig} (version 2.2).
 @item @uref{http://www.pango.org/,Pango} (version 1.12 or newer).
 @item @uref{http://www.gnu.org/software/guile/guile.html,GUILE}
-(version 1.8.2 or newer), or patch 1.8.x with
+(version 1.8.2 or newer), or patch 1.8.1 with
 @uref{http://lilypond.org/vc/gub.darcs/patches/guile-1.8-rational.patch}.
 @item @uref{http://www.python.org,Python} (version 2.4 or newer).
 @item @uref{http://www.ghostscript.com,Ghostscript} (version 8.15 or
@@ -157,6 +157,45 @@ make out=www web-install
 @end example
 @end quotation
 
+@section Testing LilyPond
+
+LilyPond comes with an extensive suite that excercises the entire
+program. This suite can be used to automatically check the impact of a
+change. This is done as follows
+
+@example
+  make test-baseline
+  @emph{## apply your changes, compile}
+  make check
+@end example
+
+This will leave an HTML page @file{out/test-results/index.html}.  This
+page shows all the important differences that your change introduced,
+whether in the layout, MIDI, performance or error reporting.
+
+To rerun tests, use
+
+@example
+  make test-redo           @emph{## redo files differing from baseline}
+  make test-clean          @emph{## remove all test results}
+@end example
+
+@noindent
+and then run @code{make check} again.
+
+For tracking memory usage as part of this test, you will need GUILE
+CVS; especially the following patch:
+@uref{http://lilypond.org/vc/gub.darcs/patches/guile-1.9-gcstats.patch}.
+
+For checking the coverage of the test suite, do the following
+
+@example
+  ./buildscripts/build-coverage.sh
+  @emph{# uncovered files, least covered first}
+  python ./buildscripts/coverage.py  --summary out-cov/*.cc
+  @emph{# consecutive uncovered lines, longest first} 
+  python ./buildscripts/coverage.py  --uncovered out-cov/*.cc
+@end example
 
 @section Building LilyPond
 
index df38af90cc7a0338e9c00b17b62bff603aafa9a1..f37f6ac49634f100dd177cdc1b4118accd8ab003 100644 (file)
@@ -67,6 +67,10 @@ which scares away people.
 @end ignore
 
 
+@item All @code{\score}s in a lilypond-book fragment are now inserted
+into the document. Also, toplevel markups don't result in an entire
+page.
+
 @item Alterations (such as a sharp and flat) may now be arbitrary
 fractions. This allows some forms of microtonal music.  For example,
 Turkish makam music uses 1/9th tone alterations.
index 1c19f5c0a76f2d028a4bfb6eaed386a17082c530..2c14fd82282979f640439b2fe8aca13c5a1d2793 100644 (file)
@@ -1713,7 +1713,7 @@ created with a markup text.  This markup text is inserted in the
 tsMarkup =\markup {
   \override #'(baseline-skip . 2) \number {
     \column { "2" "4" }
-    \lower #1 "+"
+    \vcenter "+"
     \bracket \column { "5" "8" }
   }
 }
index ced3e2efd0d6034d3bcf4682eab33cc439221216..634026393fc095d93d662e090b5377613d93f0cd 100644 (file)
@@ -115,7 +115,7 @@ c c,
 @tab
 @lilypond[fragment,relative=2]
 \set Score.timing = ##f
-\override Staff.TimeSignature #'break-visibility = #all-invisible
+\set Staff.implicitTimeSignatureVisibility = #all-invisible
 \set Staff.autoBeaming = ##f
 c( d e)
 @end lilypond
@@ -126,7 +126,7 @@ c( d e)
 @tab
 @lilypond[fragment,relative=2]
 \set Score.timing = ##f
-\override Staff.TimeSignature #'break-visibility = #all-invisible
+\set Staff.implicitTimeSignatureVisibility = #all-invisible
 \set Staff.autoBeaming = ##f
 c\( c( d) e\)
 @end lilypond
@@ -137,7 +137,7 @@ c\( c( d) e\)
 @tab
 @lilypond[fragment,relative=2]
 \set Score.timing = ##f
-\override Staff.TimeSignature #'break-visibility = #all-invisible
+\set Staff.implicitTimeSignatureVisibility = #all-invisible
 \set Staff.autoBeaming = ##f
 a8-[ b-]
 @end lilypond
@@ -156,7 +156,7 @@ a8-[ b-]
 @tab articulations
 @tab
 @lilypond[fragment,relative=2]
-\override Staff.TimeSignature #'break-visibility = #all-invisible
+\set Staff.implicitTimeSignatureVisibility = #all-invisible
 c-> c-.
 @end lilypond
 
@@ -165,7 +165,7 @@ c-> c-.
 @tab dynamics
 @tab
 @lilypond[fragment,relative=2]
-\override Staff.TimeSignature #'break-visibility = #all-invisible
+\set Staff.implicitTimeSignatureVisibility = #all-invisible
 c\mf c\sfz
 @end lilypond
 
@@ -175,7 +175,7 @@ c\mf c\sfz
 @tab
 @lilypond[fragment,relative=2]
 \set Score.timing = ##f
-\override Staff.TimeSignature #'break-visibility = #all-invisible
+\set Staff.implicitTimeSignatureVisibility = #all-invisible
 \set Staff.autoBeaming = ##f
 a\< a a\!
 @end lilypond
@@ -185,7 +185,7 @@ a\< a a\!
 @tab
 @lilypond[fragment,relative=2]
 \set Score.timing = ##f
-\override Staff.TimeSignature #'break-visibility = #all-invisible
+\set Staff.implicitTimeSignatureVisibility = #all-invisible
 \set Staff.autoBeaming = ##f
 a\> a a\!
 @end lilypond
index 55e07d2b2ac2f503874a9e415ee1dcfaa52b98ee..e5967140c35d6c0c036c4712beaed1ac75786669 100644 (file)
@@ -1348,6 +1348,7 @@ music of the baroque era, has been one of the most popular polyphonic
 composition methods.
 
 @lilypond[fragment,staffsize=12,line-width=13.0\cm]
+\set Score.implicitTimeSignatureVisibility = #all-invisible
 \override Score.TimeSignature #'break-visibility = #all-invisible
 \context PianoStaff <<
   \context Staff = SA \relative c' {
@@ -3270,8 +3271,8 @@ subject.
 @lilypond[line-width=13.0\cm]
 \score{
 \relative c'' {
+  \set Score.implicitTimeSignatureVisibility = #all-invisible
   \override Score.TimeSignature #'break-visibility = #all-invisible
-  %\override Score.TextScript #'font-style = #'large
   \time 4/4
   \key g \major
   \partial 8 g16\startGroup fis |
index 16ed517ad84b412c4e33fd5ec8e78d71cd557380..0743851592084f383d586f60f70e063d15de6392 100644 (file)
@@ -783,9 +783,20 @@ to a score, for example,
 @}
 @end example
 
-The tempo is specified using the @code{\tempo} command.  In this
-example the tempo of quarter notes is set to 72 beats per minute.
+The tempo can be specified using the @code{\tempo} command within the 
+actual music, see @ref{Metronome marks}.  An alternative, which does not
+result in a metronome mark in the printed score, is shown in the example
+above. In this example the tempo of quarter notes is set to 72 beats per
+minute. 
+This kind of tempo
+specification can not take dotted note lengths as an argument. In this
+case, break the dotted notes into smaller units. For example, a tempo
+of 90 dotted quarter notes per minute can be specified as 270 eighth
+notes per minute
 
+@example
+tempoWholesPerMinute = #(ly:make-moment 270 8)
+@end example
 
 If there is a @code{\midi} command in a @code{\score}, only MIDI will
 be produced.  When notation is needed too, a @code{\layout} block must
diff --git a/Documentation/user/point-and-click.itely b/Documentation/user/point-and-click.itely
deleted file mode 100644 (file)
index 8d74e79..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-@node Point and click
-@appendix Point and click
-@cindex point and click
-
-
-Point and click lets you find notes in the input by clicking on them
-in the PDF viewer.  This makes it easier to find input that causes
-some error in the sheet music.
-
-When this functionality is active, LilyPond adds hyperlinks to the PDF
-file. These hyperlinks are sent to the web-browser, which opens a
-text-editor with the cursor in the right place.
-
-To make this chain work, you should configure your PDF viewer to
-follow hyperlinks using the @file{lilypond-invoke-editor} script
-supplied with LilyPond.
-
-For Xpdf on Unix, the following should be present in
-@file{xpdfrc}@footnote{On unix, this file is found either in
-@file{/etc/xpdfrc} or as @file{.xpdfrc} in your home directory.}
-
-@example
-urlCommand     "lilypond-invoke-editor %s"
-@end example
-
-The program @file{lilypond-invoke-editor} is a small helper
-program. It will invoke an editor for the special @code{textedit}
-URIs, and run a web browser for others.  It tests the environment
-variable @code{EDITOR} for the following patterns,
-
-@table @code
-@item emacs
-  this will invoke
-@example
-emacsclient --no-wait +@var{line}:@var{column} @var{file}
-@end example
-@item vim
-  this will invoke
-@example
-gvim --remote +:@var{line}:norm@var{char} @var{file}
-@end example
-
-@item nedit
-this will invoke
-@example
-  nc -noask +@var{line} @var{file}'
-@end example
-@end table
-
-The environment variable @code{LYEDITOR} is used to override this. It
-contains the command line to start the editor, where @code{%(file)s},
-@code{%(column)s}, @code{%(line)s} is replaced with the file, column
-and line respectively. The  setting
-
-@example
-emacsclient --no-wait +%(line)s:%(column)s %(file)s
-@end example
-
-@noindent
-for @code{LYEDITOR} is equivalent to the standard emacsclient
-invocation.
-
-
-@cindex file size, output
-
-The point and click links enlarge the output files significantly. For
-reducing the size of PDF and PS files, point and click may be switched
-off by issuing
-
-@example
-#(ly:set-option 'point-and-click #f)
-@end example
-
-@noindent
-in a @file{.ly} file.  Alternately, you may pass this as an command-line
-option
-
-@example
-lilypond -dno-point-and-click file.ly
-@end example
-
index 04a002a282990b69939415516084896dc5c72d90..f51a05b19d471d2835f13ac1a3ffaa8e3a65176b 100644 (file)
@@ -35,7 +35,6 @@ include $(depth)/make/stepmake.make
 #
 # suggested settings
 #
-# CHECK_SOURCE=<input/regression/ reference dir>
 # LILYPOND_JOBS= -djob-count=X   ## for SMP/Multicore machine
 # 
 include local.make
@@ -206,18 +205,40 @@ $(config_h): config.hh.in
        @false
 
 
-test-clean:
-       $(MAKE) -C input/regression/ out=test clean
+################################################################
+# testing
+
+RESULT_DIR=$(top-build-dir)/out/test-results
+OUT_TEST=test
+
 
 test:
-## no aa-scaling, no PDF
-       $(MAKE) -C input/regression/ out=test LILYPOND_BOOK_LILYPOND_FLAGS="--backend=eps --formats=ps,png $(LILYPOND_JOBS) -dinclude-eps-fonts -dgs-load-fonts --header=texidoc -I $(top-src-dir)/input/manual -ddump-profile -dcheck-internal-types -ddump-signatures -danti-alias-factor=1" LILYPOND_BOOK_VERBOSE= out-test/collated-files.html 
+       rm -f input/regression/out-$(OUT_TEST)/collated-files.html
+       $(MAKE) -C input/regression/ out=$(OUT_TEST) LILYPOND_BOOK_LILYPOND_FLAGS="--backend=eps --formats=ps $(LILYPOND_JOBS) -dseparate-log-files -dinclude-eps-fonts -dgs-load-fonts --header=texidoc -I $(top-src-dir)/input/manual -ddump-profile -dcheck-internal-types -ddump-signatures -danti-alias-factor=1" LILYPOND_BOOK_VERBOSE= out-$(OUT_TEST)/collated-files.html 
        @find input ly -name '*.ly' -print |grep -v 'out.*/' | xargs grep '\\version' -L | grep -v "standard input" |sed 's/^/**** Missing version: /g' 
+       if test -d .git  ; then \
+               echo -e 'HEAD is:\n\n\t' ; \
+               git log --max-count=1 --pretty=oneline ;\
+               echo -e '\n\n\n' ; \
+               git diff ; \
+       fi > input/regression/out-test/tree.gittxt
 
+test-baseline: test
+       rm -rf input/regression/out-test-baseline
+       mv input/regression/out-test input/regression/out-test-baseline
 
-
-RESULT_DIR=$(top-build-dir)/out/test-results/
 local-check: test
        rm -rf $(RESULT_DIR)
        mkdir -p $(RESULT_DIR)
-       $(PYTHON) $(buildscript-dir)/output-distance.py --output-dir $(RESULT_DIR) $(CHECK_SOURCE) input/regression/out-test/
+       $(PYTHON) $(buildscript-dir)/output-distance.py --create-images --output-dir $(RESULT_DIR) input/regression/out-test-baseline input/regression/out-test/
+
+
+test-redo:
+       for a in `cat $(RESULT_DIR)/changed.txt` ; do \
+               echo removing $$a* ; \
+               rm -f $$a* ;\
+       done
+       $(MAKE) check
+
+test-clean:
+       $(MAKE) -C input/regression/ out=$(OUT_TEST) clean
diff --git a/THANKS b/THANKS
index d74eb3abd76457f51c997ccf44a905a47a6980ce..c15d646d2ba1875250c30b052e8f932462b8c346 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -10,6 +10,7 @@ Jan Nieuwenhuizen - Core development
 Joe Neeman        - Core development
 Graham Percival   - Documentation Editor and Bug Meister
 Mats Bengtsson    - Support Guru 
+John Mandereau    - Translation Meister
 
 CONTRIBUTORS
 
@@ -29,6 +30,7 @@ Carl Sorensen
 Christian Hitz
 David Bobroff
 Eduardo Vieira
+Georg Dummer
 Jay Anderson
 Jean-Marie Mouchel
 Kazuhiro Suzuki
diff --git a/VERSION b/VERSION
index 1a4814ec831a666491908bd9d33d400f8bad5995..1812453422c8b3b3fc8f34e126296426cc08310e 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=11
-PATCH_LEVEL=7
+PATCH_LEVEL=9
 MY_PATCH_LEVEL=
 
index 2935d456cfcb1141a8b02f18fca4e814037927f9..a7bc7e11d97e6a7c732a06f7d5887bb67b659feb 100644 (file)
@@ -125,9 +125,14 @@ def do_file (prefix, lang_ext, target, header, footer, pages_dict, out_root, nam
             # Strip .html, .png suffix for auto language selection (content
             # negotiation).  The menu must keep the full extension, so do
             # this before adding the menu.
-            page_flavors[file_name] = re.sub (
-                '''(href|src)=[\'"]([^/][.]*[^.:\'"]*)(.html|.png)(#[^"\']*|)[\'"]''',
-                '\\1="\\2\\4"', s)
+            # Don't strip .html suffix for documentation index because of
+            # lilypond/ vs. lilypond.html conflict
+            if prefix == 'Documentation/out-www/index':
+                page_flavors[file_name] = s
+            else:
+                page_flavors[file_name] = re.sub (
+                    '''(href|src)=[\'"]([^/][.]*[^.:\'"]*)(.html|.png)(#[^"\']*|)[\'"]''',
+                    '\\1="\\2\\4"', s)
         elif target == 'offline':
             if lang_ext == '':
                 page_flavors[file_name] = s
index 5af2bb1d7f116caf8cb234e5ba41ee48ffdf8e55..b238202c050b9c134f1163e5e776bf29fc53a281 100755 (executable)
@@ -1,18 +1,55 @@
 #!/bin/sh
-./configure --enable-config=cov --disable-optimising
-make conf=cov -j2 clean
-perl -i~ -pe 's/-pipe /-fprofile-arcs -ftest-coverage -pipe /g' config-cov.make
-perl -i~ -pe 's/ -ldl / -lgcov -ldl /g' config-cov.make
-make conf=cov -j2
-make conf=cov test-clean LILYPOND_JOBS=          
-make conf=cov test LILYPOND_JOBS= >& out-cov/test-run.log
-
-cd out-cov
-ln ../lily/* .
-ln ../lily/out-cov/*[ch] .
+
+if test "$1" == "--fresh"; then
+  fresh=yes
+fi
+
+if test ! -f config-cov.make; then
+  fresh=yes
+fi
+
+if test "$fresh" = "yes";
+then
+  ./configure --enable-config=cov --disable-optimising \
+   &&   make conf=cov -j2 clean \
+   &&   perl -i~ -pe 's/-pipe /-fprofile-arcs -ftest-coverage -pipe /g' config-cov.make \
+   &&   perl -i~ -pe 's/ -ldl / -lgcov -ldl /g' config-cov.make
+else
+  find -name '*.gcda' -exec rm  '{}' ';'
+fi
+
+mkdir -p scripts/out-cov/
+touch  scripts/out-cov/midi2ly.1
+make conf=cov -j2 &&  \
+  make conf=cov test-clean OUT_TEST=testcov LILYPOND_JOBS= && \
+  make conf=cov test OUT_TEST=testcov LILYPOND_JOBS= 
+
+if test "$?" != "0"; then
+  tail -100 out-cov/test-run.log
+  exit 1
+fi
+
+depth=../..
+resultdir=out/coverage-results
+
+rm -rf $resultdir
+mkdir $resultdir
+cd $resultdir
+
+ln $depth/lily/* .
+ln $depth/lily/out-cov/*[ch] .
 mkdir include
-ln ../lily/include/* include/
-for a in *[cyl]
+ln $depth/lily/include/* include/
+ln $depth/flower/include/* include/
+for a in *[cl] *.yy
 do
-   gcov -o ../lily/out-cov/  -p $a > $a.gcov-summary
+   gcov -o $depth/lily/out-cov/  -p $a > $a.gcov-summary
 done 
+
+cat <<EOF
+
+now run 
+
+         python buildscripts/coverage.py --uncovered $resultdir/*.cc
+
+EOF
diff --git a/buildscripts/build-profile.sh b/buildscripts/build-profile.sh
new file mode 100755 (executable)
index 0000000..92f23ab
--- /dev/null
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+if test "$1" == "--fresh"; then
+  fresh=yes
+fi
+
+if test ! -f config-prof.make; then
+  fresh=yes
+fi
+
+if test "$fresh" = "yes";
+then
+  ./configure --enable-config=prof --enable-optimising \
+   &&   perl -i~ -pe 's/-pipe /-pg -pipe /g' config-prof.make \
+   &&   perl -i~ -pe 's/ -ldl / -pg -ldl /g' config-prof.make
+fi
+
+make conf=prof -j2
+
+if test "$?" != "0"; then
+  exit 2
+fi
+
+depth=../..
+resultdir=out/profile-results
+
+rm -rf $resultdir
+mkdir $resultdir
+cd $resultdir
+
+
+echo 'foo = \new Staff \new Voice \repeat unfold 50 \relative { c4 d8[ d16( e]~ e16[ e e) f] g8  }
+\new ChoirStaff << 
+  \foo \foo \foo \foo 
+  \foo \foo \foo \foo 
+
+>>' > long-score.ly
+
+rm gmon.sum
+
+exe=$depth/out-prof/bin/lilypond
+
+## todo: figure out representative sample.
+files="wtk1-fugue2 wtk1-fugue2 wtk1-fugue2 wtk1-fugue2 mozart-hrn-3  mozart-hrn-3  long-score"
+
+for a in seq 1 3; do
+  $exe -ddump-profile -I $depth/input/ -I  $depth/input/mutopia/J.S.Bach/ \
+     -I $depth/input/mutopia/W.A.Mozart/ \
+     $files 
+
+  if test -f gmon.sum ; then
+    gprof -s $exe gmon.out gmon.sum
+  else
+    mv gmon.out gmon.sum
+  fi 
+done
+
+
+for a in *.profile; do
+  echo $a
+  cat $a
+done
+
+gprof $exe gmon.sum > profile
index e8cb903a97e14b11944675d70eb067e517bb59f9..4012b6b92ea0c8120a3f484d2ff0de5d69e781db 100644 (file)
 import os
 import glob
 import re
-
-os.chdir ('out-cov')
+import sys
+import optparse
 
 #File 'accidental-engraver.cc'
 #Lines executed:87.70% of 252
 
-results = []
-for f in glob.glob ('*.gcov-summary'):
-    str = open (f).read ()
-    m = re.search ("File '([^']+.cc)'\s*Lines executed:([0-9.]+)% of ([0-9]+)", str)
+def summary (args):
+    results = []
+    for f in args:
+        str = open (f).read ()
+        m = re.search ("File '([^']+.cc)'\s*Lines executed:([0-9.]+)% of ([0-9]+)", str)
 
-    if m and '/usr/lib' in m.group (1):
-        continue
-   
-    if m:
-        cov = float (m.group (2))
-        lines = int (m.group (3))
-        pain = lines * (100.0 - cov)
-        file = m.group (1)
-        tup = (pain, locals ().copy())
+        if m and '/usr/lib' in m.group (1):
+            continue
+
+        if m:
+            cov = float (m.group (2))
+            lines = int (m.group (3))
+            pain = lines * (100.0 - cov)
+            file = m.group (1)
+            tup = (pain, locals ().copy())
+
+            results.append(tup)
+
+    results.sort ()
+    results.reverse()
+
+    print 'files sorted by number of untested lines (decreasing)'
+    print
+    print '%5s (%6s): %s' % ('cov %', 'lines', 'file')
+    print '----------------------------------------------'
+
+    for (pain, d) in results:
+        print '%(cov)5.2f (%(lines)6d): %(file)s' % d
+
+class Chunk:
+    def __init__ (self, range, all_lines, file):
+        self.range = range
+        self.all_lines = all_lines
+        self.file = file
+
+    def length (self):
+        return self.range[1] - self.range[0]
+
+    def text (self):
+        return ''.join ([l[2] for l in self.lines()])
+        
+    def lines (self):
+        return self.all_lines[self.range[0]:
+                              self.range[1]]
+    def widen (self):
+        self.range = (min (self.range[0] -1, 0),
+                      self.range[0] +1)
+    def write (self):
+        print 'uncovered chunk in', self.file
+        for (c, n, l) in self.lines ():
+            sys.stdout.write ('%8s:%8d:%s' % (c,n,l))
+            
+def read_gcov (f):
+    ls = []
+
+    in_lines = [l for l in open (f).readlines ()]
+    (count_len, line_num_len) = tuple (map (len, in_lines[0].split( ':')[:2]))
+    
+    for l in in_lines:
+        c = l[:count_len].strip ()
+        l = l[count_len+1:]
+        n = int (l[:line_num_len].strip ())
+
+        if n == 0:
+            continue
         
-        results.append(tup)
+        l = l[line_num_len+1:]
 
-results.sort ()
-results.reverse()
-for (pain, d) in results:
-    print '%(cov)5.2f (%(lines)6d): %(file)s' % d
+        ls.append ((c,n,l))
+        
+    return ls
+
+def get_chunks (ls, file):
+    chunks = []
+    chunk = []
+    for (c,n,l) in ls:
+        if '#' in c:
+            chunk.append ((n,l))
+        elif c.strip () != '-' or l == '}\n':
+            if chunk:
+                nums = [n-1 for (n, l) in chunk]
+                chunks.append (Chunk ((min (nums), max (nums)+1),
+                                      ls, file))
+                chunk = []
+            
+    return chunks
+
+
+def widen_chunk (ch, ls):
+    a -= 1
+    b += 1
 
+    return [(n, l)  for (c, n, l) in ls[a:b]]
+    
+
+def extract_uncovered (file):
+    try:
+        ls = read_gcov (file)
+    except IOError, s :
+        print s
+        return []
+        
+    cs = get_chunks (ls, file)
+    def interesting (c):
+        t = c.text()
+        for stat in  ('warning', 'error', 'print', 'scm_gc_mark'):
+            if stat in t:
+                return False
+        return True
+   
+    return [c for c in cs if interesting (c)]
+    
+
+def main ():
+    p = optparse.OptionParser (usage="usage coverage.py [options] files",
+                               description="")
+    p.add_option ("--summary",
+                  action='store_true',
+                  default=False,
+                  dest="summary")
+    
+    p.add_option ("--uncovered",
+                  default=False,
+                  action='store_true',
+                  dest="uncovered")
+
+    
+    (options, args) = p.parse_args ()
+    
+
+    if options.summary:
+        summary (['%s.gcov-summary' % s for s in args])
+
+    if options.uncovered:
+        uncovered = []
+        for a in args:
+            uncovered += extract_uncovered ('%s.gcov' % a)
+            
+        uncovered = [(c.length (), c) for c in uncovered]
+        uncovered.sort ()
+        uncovered.reverse ()
+        for (score, c) in uncovered:
+            c.write ()
+
+            
+        
+if __name__ == '__main__':
+    main ()
index 5a83c490d0e4d3d875182e3bde2d4a241c14a1a2..5aa5dfcb6e0f4d292c14bce9be1cf1cb1b13fe1a 100644 (file)
@@ -2,6 +2,7 @@
 import sys
 import optparse
 import os
+import math
 
 ## so we can call directly as buildscripts/output-distance.py
 me_path = os.path.abspath (os.path.split (sys.argv[0])[0])
@@ -19,6 +20,38 @@ OUTPUT_EXPRESSION_PENALTY = 1
 ORPHAN_GROB_PENALTY = 1
 options = None
 
+################################################################
+# system interface.
+temp_dir = None
+class TempDirectory:
+    def __init__ (self):
+        import tempfile
+        self.dir = tempfile.mkdtemp ()
+        print 'dir is', self.dir
+    def __del__ (self):
+        print 'rm -rf %s' % self.dir 
+        os.system ('rm -rf %s' % self.dir )
+    def __call__ (self):
+        return self.dir
+
+
+def get_temp_dir  ():
+    global temp_dir
+    if not temp_dir:
+        temp_dir = TempDirectory ()
+    return temp_dir ()
+
+def read_pipe (c):
+    print 'pipe' , c
+    return os.popen (c).read ()
+
+def system (c):
+    print 'system' , c
+    s = os.system (c)
+    if s :
+        raise Exception ("failed")
+    return
+
 def shorten_string (s):
     threshold = 15 
     if len (s) > 2*threshold:
@@ -34,6 +67,38 @@ def max_distance (x1, x2):
     return dist
 
 
+def compare_png_images (old, new, dest_dir):
+    def png_dims (f):
+        m = re.search ('([0-9]+) x ([0-9]+)', read_pipe ('file %s' % f))
+        
+        return tuple (map (int, m.groups ()))
+
+    dest = os.path.join (dest_dir, new.replace ('.png', '.compare.jpeg'))
+    try:
+        dims1 = png_dims (old)
+        dims2 = png_dims (new)
+    except AttributeError:
+        ## hmmm. what to do?
+        system ('touch %(dest)s' % locals ())
+        return
+    
+    dims = (min (dims1[0], dims2[0]),
+            min (dims1[1], dims2[1]))
+
+    dir = get_temp_dir ()
+    system ('convert -depth 8 -crop %dx%d+0+0 %s %s/crop1.png' % (dims + (old, dir)))
+    system ('convert -depth 8 -crop %dx%d+0+0 %s %s/crop2.png' % (dims + (new, dir)))
+
+    system ('compare -depth 8 %(dir)s/crop1.png %(dir)s/crop2.png %(dir)s/diff.png' % locals ())
+
+    system ("convert  -depth 8 %(dir)s/diff.png -blur 0x3 -negate -channel alpha,blue -type TrueColorMatte -fx 'intensity'    %(dir)s/matte.png" % locals ())
+
+    system ("composite -quality 65 %(dir)s/matte.png %(new)s %(dest)s" % locals ())
+
+
+################################################################
+# interval/bbox arithmetic.
+
 empty_interval = (INFTY, -INFTY)
 empty_bbox = (empty_interval, empty_interval)
 
@@ -274,107 +339,208 @@ def read_signature_file (name):
 
 ################################################################
 # different systems of a .ly file.
-def read_pipe (c):
-    print 'pipe' , c
-    return os.popen (c).read ()
-
-def system (c):
-    print 'system' , c
-    s = os.system (c)
-    if s :
-        raise Exception ("failed")
-    return
-
-def compare_png_images (old, new, dir):
-    def png_dims (f):
-        m = re.search ('([0-9]+) x ([0-9]+)', read_pipe ('file %s' % f))
-        
-        return tuple (map (int, m.groups ()))
-
-    dest = os.path.join (dir, new.replace ('.png', '.compare.jpeg'))
-    try:
-        dims1 = png_dims (old)
-        dims2 = png_dims (new)
-    except AttributeError:
-        ## hmmm. what to do?
-        system ('touch %(dest)s' % locals ())
-        return
-    
-    dims = (min (dims1[0], dims2[0]),
-            min (dims1[1], dims2[1]))
-
-    system ('convert -depth 8 -crop %dx%d+0+0 %s crop1.png' % (dims + (old,)))
-    system ('convert -depth 8 -crop %dx%d+0+0 %s crop2.png' % (dims + (new,)))
-
-    system ('compare -depth 8 crop1.png crop2.png diff.png')
-
-    system ("convert  -depth 8 diff.png -blur 0x3 -negate -channel alpha,blue -type TrueColorMatte -fx 'intensity'    matte.png")
 
-    system ("composite -quality 65 matte.png %(new)s %(dest)s" % locals ())
+hash_to_original_name = {}
 
 class FileLink:
+    def __init__ (self, f1, f2):
+        self._distance = None
+        self.file_names = (f1, f2)
+        
     def text_record_string (self):
         return '%-30f %-20s\n' % (self.distance (),
                                   self.name ())
-    def distance (self):
+    def calc_distance (self):
         return 0.0
 
+    def distance (self):
+        if self._distance == None:
+           self._distance = self.calc_distance ()
+
+        return self._distance
+    
+        
     def name (self):
+        base = os.path.basename (self.file_names[1])
+        base = os.path.splitext (base)[0]
+        
+        base = hash_to_original_name.get (base, base)
+        base = os.path.splitext (base)[0]
+        return base
+    
+    def extension (self):
+        return os.path.splitext (self.file_names[1])[1]
+
+    def link_files_for_html (self, dest_dir):
+        for f in self.file_names:
+            link_file (f, os.path.join (dest_dir, f))
+
+    def get_distance_details (self):
         return ''
+
+    def get_cell (self, oldnew):
+        return ''
+    
+    def get_file (self, oldnew):
+        return self.file_names[oldnew]
     
-    def link_files_for_html (self, old_dir, new_dir, dest_dir):
-        pass
+    def html_record_string (self, dest_dir):
+        self.link_files_for_html (dest_dir)
+        
+        dist = self.distance()
+        
+        details = self.get_distance_details ()
+        if details:
+            details_base = os.path.splitext (self.file_names[1])[0]
+            details_base += '.details.html'
+            fn = dest_dir + '/'  + details_base
+            open (fn, 'w').write (details)
+
+            details = '<br>(<a href="%(details_base)s">details</a>)' % locals ()
+
+        cell1 = self.get_cell (0)
+        cell2 = self.get_cell (1)
 
-    def write_html_system_details (self, dir1, dir2, dest_dir):
-        pass
+        name = self.name () + self.extension ()
+        file1 = self.get_file (0)
+        file2 = self.get_file (1)
         
-    def html_record_string (self,  old_dir, new_dir):
-        return ''
+        return '''<tr>
+<td>
+%(dist)f
+%(details)s
+</td>
+<td>%(cell1)s<br><font size=-2><a href="%(file1)s"><tt>%(name)s</tt></font></td>
+<td>%(cell2)s<br><font size=-2><a href="%(file2)s"><tt>%(name)s</tt></font></td>
+</tr>''' % locals ()
+
 
-class MidiFileLink (FileLink):
-    def get_midi (self, f):
+class FileCompareLink (FileLink):
+    def __init__ (self, f1, f2):
+        FileLink.__init__ (self, f1, f2)
+        self.contents = (self.get_content (self.file_names[0]),
+                         self.get_content (self.file_names[1]))
+        
+
+    def calc_distance (self):
+        ## todo: could use import MIDI to pinpoint
+        ## what & where changed.
+
+        if self.contents[0] == self.contents[1]:
+            return 0.0
+        else:
+            return 100.0;
+        
+    def get_content (self, f):
+        print 'reading', f
         s = open (f).read ()
-        s = re.sub ('LilyPond [0-9.]+', '', s)
         return s
+
+
+class GitFileCompareLink (FileCompareLink):
+    def get_cell (self, oldnew):
+        str = self.contents[oldnew]
+
+        # truncate long lines
+        str = '\n'.join ([l[:80] for l in str.split ('\n')])
+
+        
+        str = '<font size="-2"><pre>%s</pre></font>' % str
+        return str
     
-    def __init__ (self, f1, f2):
-        self.files = (f1, f2)
+    def calc_distance (self):
+        if self.contents[0] == self.contents[1]:
+            d = 0.0
+        else:
+            d = 1.0001 *options.threshold
 
-        s1 = self.get_midi (self.files[0])
-        s2 = self.get_midi (self.files[1])
+        return d
         
-        self.same = (s1 == s2)
+class TextFileCompareLink (FileCompareLink):
+    def calc_distance (self):
+        import difflib
+        diff = difflib.unified_diff (self.contents[0].strip().split ('\n'),
+                                     self.contents[1].strip().split ('\n'),
+                                     fromfiledate = self.file_names[0],
+                                     tofiledate = self.file_names[1]
+                                     )
         
-    def name (self):
-        name = os.path.split (self.files[0])[1]
-        name = re.sub ('.midi', '', name)
-        return name
+        self.diff_lines =  [l for l in diff]
+        self.diff_lines = self.diff_lines[2:]
         
-    def distance (self):
-        ## todo: could use import MIDI to pinpoint
-        ## what & where changed.
-        if self.same:
-            return 0
-        else:
-            return 100;
-    def html_record_string (self, d1, d2):
-        return '''<tr>
-<td>
-%f
-</td>
-<td><tt>%s</tt></td>
-<td><tt>%s</tt></td>
-</tr>''' % ((self.distance(),) + self.files)
+        return math.sqrt (float (len ([l for l in self.diff_lines if l[0] in '-+'])))
+        
+    def get_cell (self, oldnew):
+        str = ''
+        if oldnew == 1:
+            str = '\n'.join ([d.replace ('\n','') for d in self.diff_lines])
+        str = '<font size="-2"><pre>%s</pre></font>' % str
+        return str
+
+        
+class ProfileFileLink (FileCompareLink):
+    def __init__ (self, f1, f2):
+        FileCompareLink.__init__ (self, f1, f2)
+        self.results = [{}, {}]
+    
+    def get_cell (self, oldnew):
+        str = ''
+        for k in ('time', 'cells'):
+            if oldnew==0:
+                str += '%-8s: %d\n' %  (k, int (self.results[oldnew][k]))
+            else:
+                str += '%-8s: %8d (%5.3f)\n' % (k, int (self.results[oldnew][k]),
+                                         self.get_ratio (k))
+
+        return '<pre>%s</pre>' % str
+            
+    def get_ratio (self, key):
+        (v1,v2) = (self.results[0].get (key, -1),
+                   self.results[1].get (key, -1))
+
+        if v1 <= 0 or v2 <= 0:
+            return 0.0
+
+        return (v1 - v2) / float (v1+v2)
+    
+    def calc_distance (self):
+        for oldnew in (0,1):
+            def note_info (m):
+                self.results[oldnew][m.group(1)] = float (m.group (2))
+            
+            re.sub ('([a-z]+): ([-0-9.]+)\n',
+                    note_info, self.contents[oldnew])
+
+        dist = 0.0
+        factor = {'time': 1.0 ,
+                  'cells': 10.0,
+                  }
+        
+        for k in ('time', 'cells'):
+            dist += math.tan (self.get_ratio (k) /(0.5* math.pi)) * factor[k]  - 1
+
+        dist = min (dist, 100)
+        return dist
+
+    
+class MidiFileLink (FileCompareLink):
+    def get_content (self, f):
+        s = FileCompareLink.get_content (self, f)
+        s = re.sub ('LilyPond [0-9.]+', '', s)
+        return s
+    
+    def get_cell (self, oldnew):
+        str = ''
+        if oldnew == 1 and self.distance () > 0:
+            str = 'changed' 
+        return str
+    
 
 class SignatureFileLink (FileLink):
-    def __init__ (self):
-        self.original_name = ''
-        self.base_names = ('','')
+    def __init__ (self, f1, f2 ):
+        FileLink.__init__ (self, f1, f2)
         self.system_links = {}
-        self._distance = None
-    def name (self):
-        return self.original_name
-    
+
     def add_system_link (self, link, number):
         self.system_links[number] = link
 
@@ -388,12 +554,6 @@ class SignatureFileLink (FileLink):
             
         return d + orphan_distance
 
-    def distance (self):
-        if type (self._distance) != type (0.0):
-            return self.calc_distance ()
-        
-        return self._distance
-
     def source_file (self):
         for ext in ('.ly', '.ly.txt'):
             if os.path.exists (self.base_names[1] + ext):
@@ -414,19 +574,16 @@ class SignatureFileLink (FileLink):
                            os.path.normpath (base2))
 
         def note_original (match):
-            self.original_name = match.group (1)
+            hash_to_original_name[os.path.basename (self.base_names[1])] = match.group (1)
             return ''
         
-        if not self.original_name:
-            self.original_name = os.path.split (base1)[1]
-
-            ## ugh: drop the .ly.txt
-            for ext in ('.ly', '.ly.txt'):
-                try:
-                    re.sub (r'\\sourcefilename "([^"]+)"',
-                            note_original, open (base1 + ext).read ())
-                except IOError:
-                    pass
+        ## ugh: drop the .ly.txt
+        for ext in ('.ly', '.ly.txt'):
+            try:
+                re.sub (r'\\sourcefilename "([^"]+)"',
+                        note_original, open (base1 + ext).read ())
+            except IOError:
+                pass
                 
         s1 = read_signature_file (f1)
         s2 = read_signature_file (f2)
@@ -435,23 +592,53 @@ class SignatureFileLink (FileLink):
 
         self.add_system_link (link, system_index[0])
 
-    def link_files_for_html (self, old_dir, new_dir, dest_dir):
-        png_linked = [[], []]
-        for ext in ('.png', '.ly', '-page*png'):
-            
+    
+    def create_images (self, dest_dir):
+
+        files_created = [[], []]
+        for oldnew in (0, 1):
+            pat = self.base_names[oldnew] + '.eps'
+
+            for f in glob.glob (pat):
+                infile = f
+                outfile = (dest_dir + '/' + f).replace ('.eps', '.png')
+
+                mkdir (os.path.split (outfile)[0])
+                cmd = ('gs -sDEVICE=png16m -dGraphicsAlphaBits=4 -dTextAlphaBits=4 '
+                       ' -r101 '
+                       ' -sOutputFile=%(outfile)s -dNOSAFER -dEPSCrop -q -dNOPAUSE '
+                       ' %(infile)s  -c quit '  % locals ())
+
+                files_created[oldnew].append (outfile)
+                system (cmd)
+
+        return files_created
+    
+    def link_files_for_html (self, dest_dir):
+        FileLink.link_files_for_html (self, dest_dir)
+        to_compare = [[], []]
+
+        exts = []
+        if options.create_images:
+            to_compare = self.create_images (dest_dir)
+        else:
+            exts += ['.png', '-page*png']
+        
+        for ext in exts:            
             for oldnew in (0,1):
                 for f in glob.glob (self.base_names[oldnew] + ext):
                     dst = dest_dir + '/' + f
                     link_file (f, dst)
 
                     if f.endswith ('.png'):
-                        png_linked[oldnew].append (f)
+                        to_compare[oldnew].append (f)
                         
         if options.compare_images:                
-            for (old,new) in zip (png_linked[0], png_linked[1]):
+            for (old, new) in zip (to_compare[0], to_compare[1]):
                 compare_png_images (old, new, dest_dir)
-                
-    def html_record_string (self,  old_dir, new_dir):
+
+
+    def get_cell (self, oldnew):
         def img_cell (ly, img, name):
             if not name:
                 name = 'source'
@@ -459,15 +646,10 @@ class SignatureFileLink (FileLink):
                 name = '<tt>%s</tt>' % name
                 
             return '''
-<td align="center">
 <a href="%(img)s">
 <img src="%(img)s" style="border-style: none; max-width: 500px;">
 </a><br>
-<font size="-2">(<a href="%(ly)s">%(name)s</a>)
-</font>
-</td>
 ''' % locals ()
-
         def multi_img_cell (ly, imgs, name):
             if not name:
                 name = 'source'
@@ -481,11 +663,7 @@ class SignatureFileLink (FileLink):
 
 
             return '''
-<td align="center">
 %(imgs_str)s
-<font size="-2">(<a href="%(ly)s">%(name)s</a>)
-</font>
-</td>
 ''' % locals ()
 
 
@@ -498,32 +676,17 @@ class SignatureFileLink (FileLink):
                 return multi_img_cell (base + '.ly', sorted (pages), name)
             else:
                 return img_cell (base + '.ly', base + '.png', name)
-            
 
-        html_2  = self.base_names[1] + '.html'
-        name = self.original_name
 
-        cell_1 = cell (self.base_names[0], name)
-        cell_2 = cell (self.base_names[1], name)
-        if options.compare_images:
-            cell_2 = cell_2.replace ('.png', '.compare.jpeg')
-        
-        html_entry = '''
-<tr>
-<td>
-%f<br>
-(<a href="%s">details</a>)
-</td>
 
-%s
-%s
-</tr>
-''' % (self.distance (), html_2, cell_1, cell_2)
-
-        return html_entry
+        str = cell (os.path.splitext (self.file_names[oldnew])[0], self.name ())  
+        if options.compare_images and oldnew == 1:
+            str = str.replace ('.png', '.compare.jpeg')
+            
+        return str
 
 
-    def html_system_details_string (self):
+    def get_distance_details (self):
         systems = self.system_links.items ()
         systems.sort ()
 
@@ -547,7 +710,7 @@ class SignatureFileLink (FileLink):
             e = '<tr>%s</tr>' % e
             html += e
             
-        original = self.original_name
+        original = self.name ()
         html = '''<html>
 <head>
 <title>comparison details for %(original)s</title>
@@ -569,11 +732,6 @@ class SignatureFileLink (FileLink):
 ''' % locals ()
         return html
 
-    def write_html_system_details (self, dir1, dir2, dest_dir):
-        dest_file =  os.path.join (dest_dir, self.base_names[1] + '.html')
-
-        details = open_write_file (dest_file)
-        details.write (self.html_system_details_string ())
 
 ################################################################
 # Files/directories
@@ -581,8 +739,6 @@ class SignatureFileLink (FileLink):
 import glob
 import re
 
-
-
 def compare_signature_files (f1, f2):
     s1 = read_signature_file (f1)
     s2 = read_signature_file (f2)
@@ -596,20 +752,23 @@ def paired_files (dir1, dir2, pattern):
     Return (PAIRED, MISSING-FROM-2, MISSING-FROM-1)
 
     """
-    
-    files1 = dict ((os.path.split (f)[1], 1) for f in glob.glob (dir1 + '/' + pattern))
-    files2 = dict ((os.path.split (f)[1], 1) for f in glob.glob (dir2 + '/' + pattern))
 
+    files = []
+    for d in (dir1,dir2):
+        found = [os.path.split (f)[1] for f in glob.glob (d + '/' + pattern)]
+        found = dict ((f, 1) for f in found)
+        files.append (found)
+        
     pairs = []
     missing = []
-    for f in files1.keys ():
+    for f in files[0].keys ():
         try:
-            files2.pop (f)
+            files[1].pop (f)
             pairs.append (f)
         except KeyError:
             missing.append (f)
 
-    return (pairs, files2.keys (), missing)
+    return (pairs, files[1].keys (), missing)
     
 class ComparisonData:
     def __init__ (self):
@@ -633,7 +792,7 @@ class ComparisonData:
                 self.compare_trees (d1, d2)
     
     def compare_directories (self, dir1, dir2):
-        for ext in ['signature', 'midi']:
+        for ext in ['signature', 'midi', 'log', 'profile', 'gittxt']:
             (paired, m1, m2) = paired_files (dir1, dir2, '*.' + ext)
 
             self.missing += [(dir1, m) for m in m1] 
@@ -642,7 +801,6 @@ class ComparisonData:
             for p in paired:
                 if (options.max_count
                     and len (self.file_links) > options.max_count):
-                    
                     continue
                 
                 f2 = dir2 +  '/' + p
@@ -652,13 +810,22 @@ class ComparisonData:
     def compare_files (self, f1, f2):
         if f1.endswith ('signature'):
             self.compare_signature_files (f1, f2)
-        elif f1.endswith ('midi'):
-            self.compare_midi_files (f1, f2)
+        else:
+            ext = os.path.splitext (f1)[1]
+            klasses = {
+                '.midi': MidiFileLink,
+                '.log' : TextFileCompareLink,
+                '.profile': ProfileFileLink,
+                '.gittxt': GitFileCompareLink, 
+                }
             
-    def compare_midi_files (self, f1, f2):
+            if klasses.has_key (ext):
+                self.compare_general_files (klasses[ext], f1, f2)
+
+    def compare_general_files (self, klass, f1, f2):
         name = os.path.split (f1)[1]
 
-        file_link = MidiFileLink (f1, f2)
+        file_link = klass (f1, f2)
         self.file_links[name] = file_link
         
     def compare_signature_files (self, f1, f2):
@@ -669,11 +836,35 @@ class ComparisonData:
         try:
             file_link = self.file_links[name]
         except KeyError:
-            file_link = SignatureFileLink ()
+            generic_f1 = re.sub ('-[0-9]+.signature', '.ly', f1)
+            generic_f2 = re.sub ('-[0-9]+.signature', '.ly', f2)
+            file_link = SignatureFileLink (generic_f1, generic_f2)
             self.file_links[name] = file_link
 
         file_link.add_file_compare (f1, f2)
 
+    def write_changed (self, dest_dir, threshold):
+        (changed, below, unchanged) = self.thresholded_results (threshold)
+
+        str = '\n'.join ([os.path.splitext (link.file_names[1])[0]
+                        for link in changed])
+        fn = dest_dir + '/changed.txt'
+        
+        open_write_file (fn).write (str)
+                
+    def thresholded_results (self, threshold):
+        ## todo: support more scores.
+        results = [(link.distance(), link)
+                   for link in self.file_links.values ()]
+        results.sort ()
+        results.reverse ()
+
+        unchanged = [r for (d,r) in results if d == 0.0]
+        below = [r for (d,r) in results if threshold >= d > 0.0]
+        changed = [r for (d,r) in results if d > threshold]
+
+        return (changed, below, unchanged)
+                
     def write_text_result_page (self, filename, threshold):
         out = None
         if filename == '':
@@ -682,21 +873,15 @@ class ComparisonData:
             print 'writing "%s"' % filename
             out = open_write_file (filename)
 
-        ## todo: support more scores.
-        results = [(link.distance(), link)
-                   for link in self.file_links.values ()]
-        results.sort ()
-        results.reverse ()
+        (changed, below, unchanged) = self.thresholded_results (threshold)
 
         
-        for (score, link) in results:
-            if score > threshold:
-                out.write (link.text_record_string ())
+        for link in changed:
+            out.write (link.text_record_string ())
 
         out.write ('\n\n')
-        out.write ('%d below threshold\n' % len ([1 for s,l  in results
-                                                    if threshold >=  s > 0.0]))
-        out.write ('%d unchanged\n' % len ([1 for (s,l) in results if s == 0.0]))
+        out.write ('%d below threshold\n' % len (below))
+        out.write ('%d unchanged\n' % len (unchanged))
         
     def create_text_result_page (self, dir1, dir2, dest_dir, threshold):
         self.write_text_result_page (dest_dir + '/index.txt', threshold)
@@ -704,22 +889,14 @@ class ComparisonData:
     def create_html_result_page (self, dir1, dir2, dest_dir, threshold):
         dir1 = dir1.replace ('//', '/')
         dir2 = dir2.replace ('//', '/')
-        
-        results = [(link.distance(), link)
-                   for link in self.file_links.values ()]
-        results.sort ()
-        results.reverse ()
+
+        (changed, below, unchanged) = self.thresholded_results (threshold)
+
 
         html = ''
         old_prefix = os.path.split (dir1)[1]
-        for (score, link) in results:
-            if score <= threshold:
-                continue
-
-            link.link_files_for_html (dir1, dir2, dest_dir) 
-            link.write_html_system_details (dir1, dir2, dest_dir)
-            
-            html += link.html_record_string (dir1, dir2)
+        for link in changed:
+            html += link.html_record_string (dest_dir)
 
 
         short_dir1 = shorten_string (dir1)
@@ -736,15 +913,12 @@ class ComparisonData:
 </html>''' % locals()
 
         html += ('<p>')
-        below_count  =len ([1 for s,l  in results
-                            if threshold >=  s > 0.0])
+        below_count = len (below)
 
         if below_count:
             html += ('<p>%d below threshold</p>' % below_count)
-
-        html += ('<p>%d unchanged</p>'
-                 % len ([1 for (s,l) in results if s == 0.0]))
-
+            
+        html += ('<p>%d unchanged</p>' % len (unchanged))
 
         dest_file = dest_dir + '/index.html'
         open_write_file (dest_file).write (html)
@@ -760,6 +934,7 @@ def compare_trees (dir1, dir2, dest_dir, threshold):
     if os.path.isdir (dest_dir):
         system ('rm -rf %s '% dest_dir)
 
+    data.write_changed (dest_dir, threshold)
     data.create_html_result_page (dir1, dir2, dest_dir, threshold)
     data.create_text_result_page (dir1, dir2, dest_dir, threshold)
     
@@ -774,6 +949,7 @@ def mkdir (x):
 def link_file (x, y):
     mkdir (os.path.split (y)[0])
     try:
+        print x, '->', y
         os.link (x, y)
     except OSError, z:
         print 'OSError', x, y, z
@@ -800,14 +976,17 @@ def test_paired_files ():
 def test_compare_trees ():
     system ('rm -rf dir1 dir2')
     system ('mkdir dir1 dir2')
-    system ('cp 20{-*.signature,.ly,.png} dir1')
-    system ('cp 20{-*.signature,.ly,.png} dir2')
-    system ('cp 20expr{-*.signature,.ly,.png} dir1')
-    system ('cp 19{-*.signature,.ly,.png} dir2/')
-    system ('cp 19{-*.signature,.ly,.png} dir1/')
-    system ('cp 19-1.signature 19-sub-1.signature')
-    system ('cp 19.ly 19-sub.ly')
-    system ('cp 19.png 19-sub.png')
+    system ('cp 20{-*.signature,.ly,.png,.eps,.log,.profile} dir1')
+    system ('cp 20{-*.signature,.ly,.png,.eps,.log,.profile} dir2')
+    system ('cp 20expr{-*.signature,.ly,.png,.eps,.log,.profile} dir1')
+    system ('cp 19{-*.signature,.ly,.png,.eps,.log,.profile} dir2/')
+    system ('cp 19{-*.signature,.ly,.png,.eps,.log,.profile} dir1/')
+    system ('cp 19-1.signature 19.sub-1.signature')
+    system ('cp 19.ly 19.sub.ly')
+    system ('cp 19.profile 19.sub.profile')
+    system ('cp 19.log 19.sub.log')
+    system ('cp 19.png 19.sub.png')
+    system ('cp 19.eps 19.sub.eps')
 
     system ('cp 20multipage* dir1')
     system ('cp 20multipage* dir2')
@@ -815,37 +994,41 @@ def test_compare_trees ():
 
     
     system ('mkdir -p dir1/subdir/ dir2/subdir/')
-    system ('cp 19-sub{-*.signature,.ly,.png} dir1/subdir/')
-    system ('cp 19-sub{-*.signature,.ly,.png} dir2/subdir/')
-    system ('cp 20grob{-*.signature,.ly,.png} dir2/')
-    system ('cp 20grob{-*.signature,.ly,.png} dir1/')
+    system ('cp 19.sub{-*.signature,.ly,.png,.eps,.log,.profile} dir1/subdir/')
+    system ('cp 19.sub{-*.signature,.ly,.png,.eps,.log,.profile} dir2/subdir/')
+    system ('cp 20grob{-*.signature,.ly,.png,.eps,.log,.profile} dir2/')
+    system ('cp 20grob{-*.signature,.ly,.png,.eps,.log,.profile} dir1/')
+    system ('echo HEAD is 1 > dir1/tree.gittxt')
+    system ('echo HEAD is 2 > dir2/tree.gittxt')
 
     ## introduce differences
     system ('cp 19-1.signature dir2/20-1.signature')
+    system ('cp 19.profile dir2/20.profile')
     system ('cp 19.png dir2/20.png')
     system ('cp 19multipage-page1.png dir2/20multipage-page1.png')
-    system ('cp 20-1.signature dir2/subdir/19-sub-1.signature')
-    system ('cp 20.png dir2/subdir/19-sub.png')
+    system ('cp 20-1.signature dir2/subdir/19.sub-1.signature')
+    system ('cp 20.png dir2/subdir/19.sub.png')
+    system ("sed 's/: /: 1/g'  20.profile > dir2/subdir/19.sub.profile")
 
     ## radical diffs.
     system ('cp 19-1.signature dir2/20grob-1.signature')
     system ('cp 19-1.signature dir2/20grob-2.signature')
     system ('cp 19multipage.midi dir1/midi-differ.midi')
     system ('cp 20multipage.midi dir2/midi-differ.midi')
+    system ('cp 19multipage.log dir1/log-differ.log')
+    system ('cp 19multipage.log dir2/log-differ.log &&  echo different >> dir2/log-differ.log &&  echo different >> dir2/log-differ.log')
 
-    compare_trees ('dir1', 'dir2', 'compare-dir1dir2', 0.5)
+    compare_trees ('dir1', 'dir2', 'compare-dir1dir2', options.threshold)
 
 
 def test_basic_compare ():
     ly_template = r"""
 
 \version "2.10.0"
-#(set! toplevel-score-handler print-score-with-defaults)
- #(set! toplevel-music-handler
-  (lambda (p m)
-  (if (not (eq? (ly:music-property m 'void) #t))
-     (print-score-with-defaults
-     p (scorify-music m p)))))
+#(define default-toplevel-book-handler
+  print-book-with-defaults-as-systems )
+
+#(ly:set-option (quote no-point-and-click))
 
 \sourcefilename "my-source.ly"
  
@@ -887,8 +1070,8 @@ def test_basic_compare ():
         open (d['name'] + '.ly','w').write (ly_template % d)
         
     names = [d['name'] for d in dicts]
-    
-    system ('lilypond -ddump-signatures --png -b eps ' + ' '.join (names))
+
+    system ('lilypond -ddump-profile -dseparate-log-files -ddump-signatures --png -b eps ' + ' '.join (names))
     
 
     multipage_str = r'''
@@ -900,9 +1083,9 @@ def test_basic_compare ():
     }
     '''
 
-    open ('20multipage', 'w').write (multipage_str.replace ('c1', 'd1'))
-    open ('19multipage', 'w').write ('#(set-global-staff-size 19.5)\n' + multipage_str)
-    system ('lilypond -ddump-signatures --png 19multipage 20multipage ')
+    open ('20multipage.ly', 'w').write (multipage_str.replace ('c1', 'd1'))
+    open ('19multipage.ly', 'w').write ('#(set-global-staff-size 19.5)\n' + multipage_str)
+    system ('lilypond -dseparate-log-files -ddump-signatures --png 19multipage 20multipage ')
  
     test_compare_signatures (names)
     
@@ -996,6 +1179,12 @@ def main ():
                   action="store_false",
                   help="Don't run graphical comparisons")
 
+    p.add_option ('--create-images',
+                  dest="create_images",
+                  default=False,
+                  action="store_true",
+                  help="Create PNGs from EPSes")
+
     p.add_option ('-o', '--output-dir',
                   dest="output_dir",
                   default=None,
index 4a45b45f4ac4c10897c93720fe8a9cf4ceb131a5..022f9c3f12a1407957ff54ed6c2b42f9fda6d8d4 100644 (file)
@@ -1,6 +1,6 @@
 depth = ..
 
-SUBDIRS = test regression tutorial midi no-notation mutopia manual
+SUBDIRS = test regression tutorial mutopia manual
 
 examples = typography-demo les-nereides wilhelmus proportional bach-schenker cary
 
diff --git a/input/midi/GNUmakefile b/input/midi/GNUmakefile
deleted file mode 100644 (file)
index 37d97aa..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-depth = ../..
-
-STEPMAKE_TEMPLATES=documentation texinfo tex
-LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc
-
-include $(depth)/make/stepmake.make
-TITLE=LilyPond MIDI Tests
-
diff --git a/input/midi/midi-drums.ly b/input/midi/midi-drums.ly
deleted file mode 100644 (file)
index 2b799be..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-
-\version "2.10.0"
-
-\version "2.10.1" 
-
-\score {
-  \new DrumStaff <<
-    \drummode {
-      bd4 sn4 bd4 sn4
-      <<
-       {\voiceOne \repeat unfold 16 hh16 }
-       \new DrumVoice { \voiceTwo bd4 sn4 bd4 sn4 }
-      >> \oneVoice
-    }
-  >>
-  \layout {}
-  \midi {}
-}
diff --git a/input/midi/midi-grace.ly b/input/midi/midi-grace.ly
deleted file mode 100644 (file)
index 213de79..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-\version "2.10.0"
-\header{ texidoc = "Tests MIDI output with grace notes. " }
-
-\score { 
-  \context Voice \relative c {
-    \new Voice = VoiceOne
-       \grace {
-  \override Stem  #'stroke-style = #"grace"
-   c8 
-  \revert Stem #'stroke-style }
- d4 d d d d
-       \grace {
-  \override Stem  #'stroke-style = #"grace"
-   e16 f e f 
-  \revert Stem #'stroke-style }
- d4 d d d d 
-       
-  }
-  \layout { }  
-  \midi { }
-}
-
diff --git a/input/midi/midi-lyric-barcheck.ly b/input/midi/midi-lyric-barcheck.ly
deleted file mode 100644 (file)
index 5c06916..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-\version "2.10.0"
-\header {
-
-    texidoc = "Lyrics in MIDI are aligned to ties and beams:
-this examples causes no bar checks in MIDI.
-"
-
-
-    }
-\score {
-
-    <<\relative c'' \new Voice =  A {
-       \autoBeamOff
-       c8[ c] c2.
-       c1~c4 c2.
-       c4 ( d e) d
-       c1
-
-    }
-    \lyricsto "A" \lyrics { bla bla | bla bla | bla bla | bla }
-    >>
-    \layout {}
-      \midi {}
-    }
diff --git a/input/midi/midi-scales.ly b/input/midi/midi-scales.ly
deleted file mode 100644 (file)
index d6e8ed9..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-
-\version "2.10.0"
-% candidate for regression.  -gp
-\header {
-  texidoc="Converting LilyPond input to MIDI and then again back with
-  @code{midi2ly.py} is a reversible procedure in some simple cases,
-  which mean that the original @code{.ly} -file and the one converted 
-  back from the generated @code{.midi} -file do not differ.
-  Here are produced some scales.
-  
-  "
-}
-
-%{
-  This means, doing:
-
-    lilypond input/test/midi-scales.ly
-    midi2ly midi-scales.midi
-    diff -u input/test/midi-scales.ly midi-scales-midi.ly
-
-  should show no differences at all in \key commands or notes.
-
-  Therefore, do not reformat this file unless midi2ly changes.
-
-  1.7.30 reformatted, because
-  midi2ly now outpts 1 bar per line and adds bar checks and numbers.
-
-%}
-
-scales =  \relative c {
-
-  % [INSTRUMENT_NAME] bright acoustic
-  \key c \major  % sharp-major
-  c'4 d e f |
-  g a b c |
-
-  \key g \major
-  g a b c |
-  d e fis g |
-
-  \key d \major
-  d, e fis g |
-  a b cis d |
-
-  \key a \major
-  a b cis d |
-  e fis gis a |
-
-  \key e \major
-  e, fis gis a |
-  b cis dis e |
-
-  \key b \major
-  b cis dis e |
-  fis gis ais b |
-
-  \key fis \major
-  fis, gis ais b |
-  cis dis eis fis |
-
-  \key cis \major
-  cis, dis eis fis |
-  gis ais bis cis |
-
-  \key a \minor  % sharp-minor
-  a b c d |
-  e f gis a |
-
-  \key e \minor
-  e, fis g a |
-  b c dis e |
-
-  \key b \minor
-  b cis d e |
-  fis g ais b |
-
-  \key fis \minor
-  fis, gis a b |
-  cis d eis fis |
-
-  \key cis \minor
-  cis, dis e fis |
-  gis a bis cis |
-
-  \key gis \minor
-  gis ais b cis |
-  dis e fisis gis |
-
-  \key dis \minor
-  dis, eis fis gis |
-  ais b cisis dis |
-
-  \key ais \minor
-  ais bis cis dis |
-  eis fis gisis ais |
-
-  \key f \major  % flat-major
-  f, g a bes |
-  c d e f |
-
-  \key bes \major
-  bes c d ees |
-  f g a bes |
-
-  \key ees \major
-  ees,, f g aes |
-  bes c d ees |
-
-  \key aes \major
-  aes, bes c des |
-  ees f g aes |
-
-  \key des \major
-  des,, ees f ges |
-  aes bes c des |
-
-  \key ges \major
-  ges, aes bes ces |
-  des ees f ges |
-
-  \key ces \major
-  ces,, des ees fes |
-  ges aes bes ces |
-
-  \key d \minor  % flat-minor
-  d, e f g |
-  a bes cis d |
-
-  \key g \minor
-  g, a bes c |
-  d ees fis g |
-
-  \key c \minor
-  c,, d ees f |
-  g aes b c |
-
-  \key f \minor
-  f, g aes bes |
-  c des e f |
-
-  \key bes \minor
-  bes,, c des ees |
-  f ges a bes |
-
-  \key ees \minor
-  ees, f ges aes |
-  bes ces d ees |
-
-  \key aes \minor
-  aes, bes ces des |
-  ees fes g aes |
-}
-
-\score {
-  \context Voice \scales
-  \layout { }
-  \midi { }
-}
-
diff --git a/input/midi/midi-tuplets.ly b/input/midi/midi-tuplets.ly
deleted file mode 100644 (file)
index 0a0f5ef..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-\version "2.10.0"
-\header {
-texidoc = "
-
-Midi2ly tuplet test.
-
-@example
-  python scripts/midi2ly.py --duration-quant=32 \
-      --allow-tuplet=4*2/3 \
-      --allow-tuplet=8*2/3 \
-      --allow-tuplet=4*3/5 \
-      --allow-tuplet=8*3/5 \
-      tu.midi 
-@end example
-"
-}
-
-
-\score { 
-  \context Voice  \relative c' {
-
-    a1 a2 a2. a4 a4. a8 a8. a16 a16. a32 a32. a64
-
-    \times 2/3 { b4 b4 b4 }
-    \times 3/5 { b4 b4 b4 b4 b4 }
-
-    \times 2/3 { c8 c8 c8 }
-    \times 3/5 { c8 c8 c8 c8 c8 }
-
-  }
-  \layout { }  
-  \midi { }
-}
-
-
diff --git a/input/midi/midi-volume-equaliser.ly b/input/midi/midi-volume-equaliser.ly
deleted file mode 100644 (file)
index 0ad06cb..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-\version "2.10.0"
-\header {
-  texidoc = "@cindex Midi Volume Equaliser
-The full orchestra plays a notes, where groups stop one after
-another. Use this to tune equalizer settings. "
-}
-
-#(set-global-staff-size 16)
-
-%{
-
-Override, see scm/midi.scm:
-
-#(set! instrument-equalizer-alist
-  (append 
-   '(
-     ("flute" . (0 . 0.7))
-   )
-   instrument-equalizer-alist))
-
-%}
-
-flauti =  \relative c' {
-  \set Staff.midiInstrument = #"flute"
-  \set Staff.instrumentName = #"2 Flauti"
-  \set Staff.shortInstrumentName = #"Fl."
-
-  c1\f R1*10
-}
-
-oboi =  \relative c' {
-  \set Staff.midiInstrument = #"oboe"
-  \set Staff.instrumentName = #"2 Oboi"
-  \set Staff.shortInstrumentName = #"Ob."
-
-  R1*1 c1\f R1*9
-}
-
-clarinetti =  \relative c' {
-  \set Staff.midiInstrument = #"clarinet"
-  \set Staff.instrumentName = #"Clarinetti"
-  \set Staff.shortInstrumentName = #"Cl"
-
-  R1*2 c1\f R1*8
-}
-
-fagotti =  \relative c' {
-  \set Staff.midiInstrument = #"bassoon"
-  \set Staff.instrumentName = #"2 Fagotti"
-  \set Staff.shortInstrumentName = #"Fg."
-
-  \clef bass
-  R1*3 c1\f R1*7
-}
-
-corni =  \relative c' {
-  \set Staff.midiInstrument = #"french horn"
-  \set Staff.instrumentName = #"Corni"
-  \set Staff.shortInstrumentName = #"Cor"
-
-  R1*4 c1\f R1*6
-}
-
-trombe =  \relative c' {
-  \set Staff.midiInstrument = #"trumpet"
-  \set Staff.instrumentName = #"Trombe"
-  \set Staff.shortInstrumentName = #"Tp."
-
-  \clef bass
-  R1*5 c1\f R1*5
-}
-
-timpani =  \relative c' {
-  \set Staff.midiInstrument = #"timpani"
-  \set Staff.instrumentName = #"Timpani"
-  \set Staff.shortInstrumentName = #"Timp."
-
-  R1*6 c1\f R1*4
-}
-
-violinoI =  \relative c' {
-  \set Staff.midiInstrument = #"violin"
-  \set Staff.instrumentName = #"Violino I "
-  \set Staff.shortInstrumentName = #"Vl. I "
-
-  R1*7 c1\f R1*3
-}
-
-violinoII =  \relative c' {
-  \set Staff.midiInstrument = #"violin"
-  \set Staff.instrumentName = #"Violino II "
-  \set Staff.shortInstrumentName = #"Vl. II "
-  
-  R1*8 c1\f R1*2
-}
-
-viola =  \relative c' {
-  \set Staff.midiInstrument = #"viola"
-  \set Staff.instrumentName = #"Viola"
-  \set Staff.shortInstrumentName = #"Vla."
-
-  \clef alto
-  R1*9 c1\f R1*1
-}
-
-violoncello =  \relative c' {
-  \set Staff.midiInstrument = #"cello"
-                               %\set Staff.midiInstrument = #"contrabass"
-  \set Staff.instrumentName = #"Violoncello"
-  \set Staff.shortInstrumentName = #"Vc."
-  
-  \clef bass
-  R1*10 c1\f
-}
-
-
-\score {
-  << 
-    \new StaffGroup = "legni" << 
-      \new Staff = "flauti" \flauti
-      \new Staff = "oboi" \oboi
-      \new Staff = "clarinetti" \clarinetti 
-      \new Staff = "fagotti" \fagotti 
-    >>
-    \new StaffGroup = "ottoni" <<
-      \new Staff = "corni" \corni
-      \new Staff = "trombe" \trombe
-    >>
-    \new StaffGroup = "timpani" <<
-      \new Staff = "timpani" \timpani
-      { 
-       \skip 1 
-       %% Hmm: this forces a staff-bracket, that's good!
-       %% However, I can't find where is decided on staff-bracket yes/no
-      }
-    >>
-    \new StaffGroup = "archi" <<
-      \new GrandStaff = "violini" <<
-        \new Staff = "violino1" \violinoI
-        \new Staff = "violino2" \violinoII
-      >>
-      \new Staff = "viola" \viola
-      \new Staff = "violoncello" \violoncello
-    >>
-  >>
-
-  \layout {
-    \context {
-      \RemoveEmptyStaffContext
-    }
-  }
-  
-  \midi {
-    \context {
-      \Score
-      tempoWholesPerMinute = #(ly:make-moment 60 1)
-    }
-  }
-}
-
-
diff --git a/input/midi/transposition.ly b/input/midi/transposition.ly
deleted file mode 100644 (file)
index 2429fef..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-\header
-{
-  texidoc =  "should deliver f' in MIDI"
-}
-\version "2.10.5"
-
-\score {
-  {
-    \transposition f
-    c''
-  }
-  \midi{}
-  \layout{}
-}
diff --git a/input/no-notation/GNUmakefile b/input/no-notation/GNUmakefile
deleted file mode 100644 (file)
index daedbb1..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-depth = ../..
-
-EXTRA_DIST_FILES=README
-LOCALSTEPMAKE_TEMPLATES=ly mutopia
-
-include $(depth)/make/stepmake.make
-
-
diff --git a/input/no-notation/README b/input/no-notation/README
deleted file mode 100644 (file)
index d162aad..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-These examples test various non-typesetting things. Since they 
-do not generate output, they are not in test/ or regression/
-
-Some (notably parse*.ly) are just error/warning generation tests
-and should remain here.
-
-Some (notably midi-*.ly) test midi output, which does not usually
-get tested in ../regression files.
-
diff --git a/input/no-notation/bar-check.ly b/input/no-notation/bar-check.ly
deleted file mode 100644 (file)
index e9a714e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-\version "2.10.0"
-
-\header {
-
-texidoc = "skipTypesetting doesn't affect bar checks."
-
-}
-
-\score {  {
-       \set Score.skipTypesetting = ##t
-       c4 c4
-       |
-       c4 c4 }}
diff --git a/input/no-notation/beam-warn.ly b/input/no-notation/beam-warn.ly
deleted file mode 100644 (file)
index 3a6586d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-\version "2.10.0"
-
-\header        {
-
-texidoc = "The first duration following a beam-open request is checked if it is short enough."
-
-}
-
-\score {
-   { [c4 c] }
-}
diff --git a/input/no-notation/die-staff.ly b/input/no-notation/die-staff.ly
deleted file mode 100644 (file)
index 4f94b3b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-\version "2.10.0"
-
-\header  {
-texidoc = "a staff should really die, if no one's referencing it."
-}
-\score {
- {
-    \new Staff =  "q" {
-       { a' b' c' d' }
-    }
-
-    \break
-
-    \context PianoStaff <<
-      \new Staff =  "i" {
-         { a' b' c' d' }
-      }
-      \new Staff =  "ii" {
-         { \clef "bass" a b c d }
-      }
-    >>
-  }
-}
diff --git a/input/no-notation/display-lily-tests.ly b/input/no-notation/display-lily-tests.ly
deleted file mode 100644 (file)
index 014f63c..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
-\version "2.10.0"
-
-#(use-modules (srfi srfi-13)
-              (ice-9 format))
-
-%%%
-%%% Testing utilities
-%%%
-
-#(define (parse-lily-and-compute-lily-string chr port)
-  (let ((lily-string (call-with-output-string
-                      (lambda (out)
-                        (do ((c (read-char port) (read-char port)))
-                            ((and (char=? c #\#)
-                                  (char=? (peek-char port) #\]))
-                             (read-char port))
-                          (display c out))))))
-    `(let* ((parser-clone (ly:clone-parser parser))
-            (input-str (string-trim-both ,lily-string))
-            (music (car (ly:music-property (parse-string-result input-str
-                                                                parser-clone)
-                                           'elements)))
-            (result-str (string-trim-both (music->lily-string music parser-clone))))
-       (cons input-str result-str))))
-
-#(read-hash-extend #\[ parse-lily-and-compute-lily-string) %{ ] %}
-
-#(define (lily-string->markup str)
-   (make-column-markup (string-split str #\NewLine)))
-
-#(define test-function
-  (let ((test-number 0))
-   (lambda (parser location result-info strings)
-    (let ((input (car strings))
-         (output (cdr strings)))
-     (set! test-number (1+ test-number))
-     (if (string=? input output)
-         (make-music 'SequentialMusic 'void #t)
-         (make-music 'SequentialMusic
-           'elements
-           (list (ly:parser-lookup parser 'fatText)
-                 (make-music 'EventChord
-                   'elements (list (make-music 'LineBreakEvent
-                                     'break-permission 'force)))
-                 (make-music 'EventChord
-                   'elements (list (make-music 'SkipEvent
-                                     'duration (ly:make-duration 0 0 1 1))
-                                   (make-music 'TextScriptEvent
-                                     'direction -1
-                                     'text (markup #:column
-                                            (#:simple (format #f "Test #~a " test-number)
-                                             (if (string-null? result-info) 
-                                                 (markup #:bold "BUG") 
-                                                 (markup #:simple result-info))
-                                             #:typewriter (lily-string->markup input)
-                                             #:typewriter (lily-string->markup output)))))))))))))
-    
-
-test = 
-#(define-music-function (parser location result-info strings) (string? pair?)
-   (test-function parser location result-info strings))
-
-%%%
-%%% Tests
-%%%
-\header {
-  texidoc = \markup \column { \line { \typewriter display-lily-music unit tests }
-                              \line { Real bugs (regressions) are marked as \bold BUG. }
-                              \line { Known bugs are marked as TODO. } }
-}
-
-\layout {
-  raggedright = ##t 
-  indent = 0\cm
-  \context {
-    \Staff
-    \override StaffSymbol #'line-count = #1
-    \remove "Time_signature_engraver"
-    \remove "Clef_engraver"
-  }
-  \context {
-    \Score
-    \remove "Bar_number_engraver"
-  }
-}
-
-%% Sequential music
-\test "" ##[ { { a b } { c d } } #]            % SequentialMusic
-\test "" ##[ << { a b } { c d } >> #]          % SimultaneousMusic
-\test "" ##[ << { a b } \\ { c d } >> #]       % VoiceSeparator
-
-%% Chords and Notes
-\test "" ##[ { ceses ces c cis cisis } #]      % NoteEvent
-\test "" ##[ { deses des d dis disis } #]
-\test "" ##[ { eeses ees e eis eisis } #]
-\test "" ##[ { feses fes f fis fisis } #]
-\test "" ##[ { geses ges g gis gisis } #]
-\test "" ##[ { aeses aes a ais aisis } #]
-\test "" ##[ { beses bes b bis bisis } #]
-\test "" ##[ { c,, d' } #]
-\test "" ##[ { c' d'=' } #]
-\test "" ##[ { c! c? } #]
-\test "" ##[ r1.*4/3 #]                % RestEvent
-\test "" ##[ c1\rest #]                % RestEvent
-\test "" ##[ s2..*3/4 #]               % SkipEvent
-\test "" ##[ R1.*2/3 #]                % MultiMeasureRestMusicGroup, MultiMeasureRestEvent
-\test "" ##[ \skip 2.*3/4 #]           % SkipMusic
-\test "" ##[ < c\1 e\3 >4.*3/4-. #]    % EventChord, NoteEvent, StringNumberEvent, ArticulationEvent
-
-%% tags
-\test "" ##[ { \tag #'foo { c4 d } } #]
-\test "" ##[ c-\tag #'foo -\tag #'baz -^ -. #]
-
-%% Graces
-\test "" ##[ { \grace c8 d2 } #]                       % GraceMusic
-\test "" ##[ { \appoggiatura c8 d2 } #]
-\test "" ##[ { \acciaccatura c8 d2 } #]
-\test "" ##[ { c1 \afterGrace { b,16 c } d2 } #]
-
-%% Clusters
-\test "" ##[ { \makeClusters { c4 g } } #]             % ClusterNoteEvent
-
-%% Figured bass
-\test "" ##[ \figures { < 6 > } #]                     % BassFigureEvent
-\test "" ##[ \figuremode { < 1-- 3- > < 2+ 4++ > < _! 7! > } #]
-\test "" ##[ \figuremode { < [6 > < 5] > } #]
-
-%% Lyrics
-\test "" ##[ \lyrics { a b } #]
-\test "" ##[ \lyricmode { a --  b } #]                 % HyphenEvent
-\test "" ##[ \lyricmode { a __  b } #]                 % ExtenderEvent
-\test "" ##[ \lyricmode { "a " } #]                    % LyricEvent
-\test "" ##[ \lyricsto "foo" { bla bla } #]            % LyricCombineMusic
-\test "" ##[ { { c d }
-  \addlyrics { bla bla } } #]
-
-%% Drums
-\test "" ##[ \drums { hihat } #]
-\test "" ##[ \drummode { hihat4.*3/4 } #]
-
-%% Expressive marks
-\test "" ##[ c4 ~ #]                                   % TieEvent
-\test "" ##[ c\noBeam #]                               % BeamForbidEvent
-\test "" ##[ c\1 #]                                    % StringNumberEvent
-\test "" ##[ { c:  c:1  } #]                           % TremoloEvent
-\test "" ##[ { c-^  c^^  c_^  } #]                     % ArticulationEvent
-\test "" ##[ { c-+  c^+  c_+  } #]
-\test "" ##[ { c--  c^-  c_-  } #]
-\test "" ##[ { c-|  c^|  c_|  } #]
-\test "" ##[ { c->  c^>  c_>  } #]
-\test "" ##[ { c-.  c^.  c_.  } #]
-\test "" ##[ { c-_  c^_  c__  } #]
-\test "" ##[ { c-\trill  c^\trill  c_\trill  } #]
-\test "" ##[ { c-1  c^2  c_3  } #]                     % FingerEvent
-\test "" ##[ { c-"foo"  c^"foo"  c_"foo"  } #] % TextScriptEvent
-\test "" ##[ { R1*4-"foo"  R^"foo"  R_"foo"  } #]      % MultiMeasureTextEvent
-\test "" ##[ { c4-\harmonic  c^\harmonic  c_\harmonic  } #]    % HarmonicEvent
-\test "" ##[ { c-\glissando  c^\glissando  c_\glissando  } #] % GlissandoEvent
-\test "" ##[ { c-\arpeggio  c^\arpeggio  c_\arpeggio  } #]     % ArpeggioEvent
-\test "" ##[ { c\p  c^\ff  c_\sfz  } #]                % AbsoluteDynamicEvent
-\test "" ##[ { c[  c]  c^[  c^]  c_[  c_]  } #]        % BeamEvent
-\test "" ##[ { c(  c)  c^(  c^)  c_(  c_)  } #]        % SlurEvent
-\test "" ##[ { c\<  c\!  c^\<  c^\!  c_\<  c_\!  } #]  % CrescendoEvent
-\test "" ##[ { c\>  c\!  c^\>  c^\!  c_\>  c_\!  } #]  % DecrescendoEvent
-\test "" ##[ { c\(  c\)  c^\(  c^\)  c_\(  c_\)  } #]  % PhrasingSlurEvent
-\test "" ##[ { c\sustainDown  c\sustainUp  } #] % SustainEvent
-\test "" ##[ { c\sostenutoDown  c\sostenutoUp  } #] % SostenutoEvent
-\test "" ##[ \melisma #]
-\test "" ##[ \melismaEnd #]
-\test "" ##[ { c\startTextSpan  c\stopTextSpan  } #] % TextSpanEvent
-\test "" ##[ { c\startTrillSpan  c\stopTrillSpan  } #] % TrillSpanEvent
-\test "" ##[ { c \startStaff c \stopStaff } #] % StaffSpanEvent
-\test "" ##[ { c\startGroup  c\stopGroup  c^\startGroup  c^\stopGroup  c_\startGroup  c_\stopGroup  } #] % NoteGroupingEvent
-\test "" ##[ { c\unaCorda  c\treCorde  } #] % UnaCordaEvent
-\test "" ##[ \breathe #]
-\test "" ##[ { c \[ c \] } #]                  % LigatureEvent
-\test "" ##[ \~ #]                                     % PesOrFlexaEvent
-
-\test "" ##[ \break #]
-\test "" ##[ \noBreak #]
-\test "" ##[ \pageBreak #]
-\test "" ##[ \noPageBreak #]
-\test "" ##[ \pageTurn #]
-\test "" ##[ \noPageTurn #]
-
-%% Checks
-\test "" ##[ \octave a' #]                             % RelativeOctaveCheck
-\test "" ##[ | #]                                      % BarCheck
-
-%% Marks
-\test "" ##[ \mark \default #]                 % MarkEvent
-\test "" ##[ \mark "Allegro" #]
-\test "" ##[ \tempo 4 = 120 #]                 % MetronomeChangeEvent
-
-%% key, time, clef, bar
-\test "" ##[ \key \default #]                  % KeyChangeEvent
-\test "" ##[ \key e \minor #]
-\test "" ##[ \clef "bass" #]
-\test "" ##[ \clef "french^2" #]
-\test "" ##[ \clef "alto_3" #]
-\test "" ##[ \time 2/4 #]
-\test "" ##[ #(set-time-signature 5 8 '(3 2)) #]
-\test "" ##[ \bar "|." #]
-
-%% staff switches
-\test "" ##[ \autochange { c d } #]                    % AutoChangeMusic
-\test "" ##[ { \change Staff = "up" { c d } } #]       % ContextChange
-
-%% Tuplets
-\test "" ##[ \times 2/3 { c8 d e } #]                          % TimeScaledMusic
-\test "" ##[ \times 4/6 { c16 d e f g a } #]
-%}
-%% \relative and \tranpose
-\test #"NOT A BUG" ##[ \relative c' { c b } #] % RelativeOctaveMusic
-\test #"NOT A BUG" ##[ \transpose c d { c d } #]       % TransposedMusic
-%}
-%% Repeats
-\test "" ##[ \repeat volta 2 { c d } #]                % VoltaRepeatedMusic
-\test "" ##[ \repeat unfold 2 { c d } #]               % UnfoldedRepeatedMusic
-\test "" ##[ \repeat fold 2 { c d } #]         % FoldedRepeatedMusic
-\test "" ##[ \repeat percent 2 { c d } #]              % PercentRepeatedMusic
-\test "" ##[ \repeat tremolo 4 { c16 d } #]            % TremoloRepeatedMusic
-\test "" ##[ \repeat volta 2 { c4 d } \alternative { { c d } { e f } } #] % 
-
-%% Context creation
-\test "" ##[ \new Staff { c d } #]                     % ContextSpeccedMusic
-\test "" ##[ \new Staff = "up" { c d } #]                      % ContextSpeccedMusic
-\test "" ##[ \context Staff { c d } #]
-\test "" ##[ \context Staff = "up" { c d } #]
-\test "" ##[
-\new Staff \with {
-  \consists "Timing_engraver"
-  \remove "Clef_engraver"
-} { c d } #]
-%% Context properties
-\test "" ##[ \once \set Score . skipBars = ##t #]      % PropertySet
-\test "" ##[ \set autoBeaming = ##f #]
-\test "" ##[ \unset Score . skipBars #]                % PropertyUnset
-\test "" ##[ \unset autoBeaming #]
-%% Layout properties
-\test "" ##[ \override Staff . Stem #'thickness = #4.0 #]      % OverrideProperty
-\test "" ##[ \once \override Beam #'thickness = #0.6 #]
-\test "" ##[ \revert Staff . Stem #'thickness #]       % RevertProperty
-\test "" ##[ \revert Beam #'thickness #]
-
-%% \applyOutput
-\test "" ##[ \applyOutput #'Foo #(lambda (arg) (list)) #]
-%% \applyContext
-\test "" ##[ \applyContext #(lambda (arg) (list)) #]
-
-%% \partial
-\test "" ##[ \partial 2 #]
-\test "" ##[ \partial 8. #]
-\test #"TODO? exotic durations in \\partial" ##[ \partial 4*2/3 #]
-
-%% \partcombine
-\test "" ##[ \partcombine { c e }
-{ d f } #]                                             % PartCombineMusic UnrelativableMusic
-
-%% Cue notes
-\test "" ##[ \cueDuring #"foo" #1 { c d } #]
-\test "" ##[ \quoteDuring #"foo" { c d } #]
diff --git a/input/no-notation/dos-guile.ly b/input/no-notation/dos-guile.ly
deleted file mode 100644 (file)
index 9858a59..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-\version "2.10.0"
-
-\header{
-    
-    texidoc = "This should not hang lilypond --safe-mode."
-    
-}
-
-% DOS
-#(do () (#f))
-
-\score{
-     c''
-}
\ No newline at end of file
diff --git a/input/no-notation/dos-ps.ly b/input/no-notation/dos-ps.ly
deleted file mode 100644 (file)
index 31c0da1..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-\version "2.10.0"
-
-\header{
-
-    texidoc = "This should not hang lilypond --safe-mode --no-pdf
-    --png run.
-
-}
-
-\score{
-    % DOS
-     c''-"\\embeddedps{ { 0 0 moveto } loop }"
-}
diff --git a/input/no-notation/dos-tex.ly b/input/no-notation/dos-tex.ly
deleted file mode 100644 (file)
index 859df66..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-\version "2.10.0"
-
-\header{
-    
-    texidoc = "This should not hang lilypond --safe-mode run."
-
-}
-
-\score{
-    % DOS
-     c''-"\\loop\\iftrue\\repeat"
-}
diff --git a/input/no-notation/dynamic-absolute-volume.ly b/input/no-notation/dynamic-absolute-volume.ly
deleted file mode 100644 (file)
index 8c3a24c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-
-\version "2.10.0"
-\header {
-    texidoc = "@cindex Dynamic Absolute Volume
-Absolute dynamics have an effect on MIDI files.
-"
-}
-
-
-\score{
-\relative c''{
-%segfault in engraver
-a1\ppp 
-a1\pp
-a\p
-a\mp
-a\mf
-a\f
-a\ff
-a\fff
-a\sf
-}
-\layout{ ragged-right = ##t }
-
-  \midi {
-    \context {
-      \Score
-      tempoWholesPerMinute = #(ly:make-moment 60 1)
-      }
-    }
-
-
-}
-
diff --git a/input/no-notation/embedded-scm.ly b/input/no-notation/embedded-scm.ly
deleted file mode 100644 (file)
index b84dfc8..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-\version "2.10.0"
-\header {
-    
-    texidoc = "@cindex Embedded scm
-
-You can embed scheme functions in your scores.  While generating the
-output, ``hello world'' is printed to the console.
-"
-     % see also: --safe-mode
-}
-
-#(begin
-  (newline)
-  (display "hello world")
-  (newline))
-
-\score {
-       \relative c' { c }
-       \layout {ragged-right = ##t}
-}
-
-
diff --git a/input/no-notation/parse.ly b/input/no-notation/parse.ly
deleted file mode 100644 (file)
index b851323..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-\version "2.10.0"
-
-% Test parser error
-
-\score{
diff --git a/input/no-notation/parse2.ly b/input/no-notation/parse2.ly
deleted file mode 100644 (file)
index 5096c6c..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-\version "2.10.0"
-
-% Test parser error
-
-foo = {
-
-
-\score{
-}
diff --git a/input/no-notation/parse3.ly b/input/no-notation/parse3.ly
deleted file mode 100644 (file)
index cdf9626..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-\version "2.10.0"
-
-% Test parser error
-
-foo = {
-
-
-\score{
-
diff --git a/input/no-notation/parse4.ly b/input/no-notation/parse4.ly
deleted file mode 100644 (file)
index cee8a6a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-\version "2.10.0"
-
-% Test parser error
-
-foo = {
-}
-
-
-\score{
-  burp
-}
-
diff --git a/input/no-notation/parse5.ly b/input/no-notation/parse5.ly
deleted file mode 100644 (file)
index 4b9756e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-\version "2.10.0"
-%If you specify two different key sigs at one point, a
-%warning is printed.
-
-\score { 
-\context Voice <<
- { \key cis \major cis4 \key bes \major bes4 }
- { \key cis \major fis4 \key es \major g4 }  
->>
-}
-
diff --git a/input/no-notation/recording.ly b/input/no-notation/recording.ly
deleted file mode 100644 (file)
index 39ea07d..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-\version "2.10.0"
-\header {
-
-texidoc = "The @code{Recording_group_engraver} will record events
-synchronized in time, collecting them in a list.  This file also shows
-how to skip the rendering and outputting step of the process, using
-@code{ly:run-translator}."
-
-}
-
-theMusic = \context Staff  { c4 d8-. }
-
-#(define (notice-the-events context lst)
-  (map (lambda (x) (display x) (newline))  lst))
-
-listener = \layout {
- \context {
-   \Voice
-   \type "Recording_group_engraver"
-   recordEventSequence = #notice-the-events
- }
-}
-
-#(ly:run-translator theMusic listener)
diff --git a/input/no-notation/safe-guile.ly b/input/no-notation/safe-guile.ly
deleted file mode 100644 (file)
index eeaf1f2..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-\version "2.10.0"
-
-\header{
-    
-    texidoc = "This should not survive lilypond --safe-mode, and
-    certainly not write /tmp/safe-guile.scm"
-    
-}
-
-#(write "hallo" (open-file "/tmp/safe-guile.scm" "w"))
-
-\score{
-     c''
-}
\ No newline at end of file
diff --git a/input/no-notation/safe-include.ly b/input/no-notation/safe-include.ly
deleted file mode 100644 (file)
index aa26b22..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-\version "2.10.0"
-
-\header{
-    
-    texidoc = "This should not survive lilypond --safe-mode"
-    
-}
-
-\include "safe-ps.ly"
-
-\score{
-     c''
-}
\ No newline at end of file
diff --git a/input/no-notation/safe-ps.ly b/input/no-notation/safe-ps.ly
deleted file mode 100644 (file)
index 8a0ccca..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-\version "2.10.0"
-
-\header{
-    texidoc = "This should not survive lilypond --safe-mode
-    --no-pdf --png run, and certainly not write /tmp/safe-ps.ps"
-}
-
-\score{
-     c''-"\\embeddedps{ (/tmp/safe-ps.ps) (w) file (hallo) writestring }"
-}
diff --git a/input/no-notation/safe-tex.ly b/input/no-notation/safe-tex.ly
deleted file mode 100644 (file)
index 516146e..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-\version "2.10.0"
-
-\header{
-    
-    texidoc = "This should not survive lilypond --safe-mode run, and
-    certainly not write /tmp/safe-tex.tex"
-
-    % beware
-    % openout_any=y lilypond --keep --safe-mode -S latexoptions=']{article}
-    % \let\nofiles\relax%' input/no-notation/safe-tex.ly
-
-}
-
-\score{
-     c''-"\\newwrite\\barf\\immediate\\openout\\barf=/tmp/safe-tex.tex\\immediate\\write\\barf{hallo}"
-}
diff --git a/input/no-notation/textcresc.ly b/input/no-notation/textcresc.ly
deleted file mode 100644 (file)
index 08b1fde..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-\version "2.10.0"
-\header{
-texidoc="crashes lily"
-}
-
-\score {  {
-  \context Voice {
-    \set crescendoText = "cresc."
-    \set crescendoSpanner = #'dashed-line
-    c2. r8 c8 \< \break \! c1
-  }
-}
-\layout { line-width = 5.\cm}
-}
-
diff --git a/input/no-notation/to-xml.ly b/input/no-notation/to-xml.ly
deleted file mode 100644 (file)
index 036063f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-\version "2.10.0"
-
-fooBar =  { << c''4 \\ g'4 >> }
-
-#(ly:set-option 'parse-protect #f)
-#(load-from-path "to-xml.scm")
-
-#(music-to-xml fooBar (current-output-port))
-
-\header {
-    texidoc = "@cindex To XML"
-       texidoc = #(string-append
-      "The input representation is very generic. Therefore, it
-      should not be hard to convert it to XML or a similar format:\n\n"
-
-      "@example\n"
-       (call-with-output-string
-              (lambda (p) (music-to-xml fooBar p))
-      )
-    "@end example" )
-}
-
-
-\score {
-\fooBar
-}
-
index 59a6b64b5882b393b051d667150a9f54894b35e6..fabf9546bba507053f7c0909aab94e761027f8cf 100644 (file)
@@ -2,6 +2,11 @@
   texidoc = "Accidentals are reset for clef changes."
 }
 
+\layout {
+  ragged-right = ##t
+}
+
+
 \version "2.10.0"
 \new Staff \relative c' {
     \clef treble
@@ -10,4 +15,3 @@
     <cis dis fis gis>
 }
 
-\layout {ragged-right = ##t} 
index 9024fbe8f460e819062819a09b4477e508ff6c36..abcbd3028165077e2555452d23d8ce2ade465238 100644 (file)
@@ -24,7 +24,7 @@ This example prints a bar-number during processing on stdout.
   
   \applyContext
   #(lambda (tr)
-    (format #t "\nWe were called in barnumber ~a.\n"
+    (ly:progress "\nWe were called in bar number ~a.\n"
      (ly:context-property tr 'currentBarNumber)))
   c1 c1
 }
diff --git a/input/regression/bar-line-dotted.ly b/input/regression/bar-line-dotted.ly
new file mode 100644 (file)
index 0000000..622ca75
--- /dev/null
@@ -0,0 +1,18 @@
+
+\header {
+  texidoc = "The dots in a dotted bar line are in spaces."
+
+}
+
+\version "2.10.0"
+
+\paper {  ragged-right = ##t }
+
+\relative \new StaffGroup <<
+  \new Staff {
+    c4 \bar ":" c }
+  \new Staff {
+    c c
+  }
+>>
+
diff --git a/input/regression/beam-flat-retain-direction.ly b/input/regression/beam-flat-retain-direction.ly
new file mode 100644 (file)
index 0000000..ba03734
--- /dev/null
@@ -0,0 +1,16 @@
+\header
+{
+  texidoc = "Even very flat but slanted patterns should give slanted beams. "
+}
+
+\version "2.10.7"
+\layout{
+  line-width = 15\cm
+  debug-beam-scoring = ##t
+}
+
+\relative c'''{
+  \time 2/4
+  \assertBeamQuant #'(0  . 1) #'(0 . 0) 
+  fis16[ dis b ais] cis4
+}
index 4b55de5cd431cc42e23e62c28a8bcd6e209004bd..67a354e2f905a34e25b407fd7ea55bd8045ca7ff 100644 (file)
@@ -3,6 +3,10 @@
   texidoc  = "Bends avoid dots, but only if necessary."
 }
 
+\paper {
+  ragged-right = ##t
+}
+
 \score {
   <<
     \new Staff \relative c' {
@@ -13,7 +17,3 @@
     }
   >>
 }
-
-\paper {
-  ragged-right = ##t
-}
index 1611f965322d77d441b2e2737d3ed361e7129936..b3a88c798ee9f08150a94adc0da12b1f97945c3e 100644 (file)
@@ -7,13 +7,13 @@ Breaks can be encouraged and discouraged using @code{\\break} and
 @code{\\noBreak}."
 }
 
+\layout {
+  indent = 0.0
+  line-width = 4.0\cm
+}
 
 \relative c'' \context Voice {
   \emptyText
   c1 \noBreak c1 \noBreak \mark "nobreak" c1 \noBreak
   c1 \break \mark "break" c1 \break \mark "break" c1 
 }
-\layout {
-  indent = 0.0
-  line-width = 4.0\cm
-}
diff --git a/input/regression/chord-tremolo-single.ly b/input/regression/chord-tremolo-single.ly
new file mode 100644 (file)
index 0000000..f4c03ab
--- /dev/null
@@ -0,0 +1,13 @@
+\version "2.10.0"
+
+\header{
+texidoc="Chord tremolos on a single note."
+}
+
+\context Voice \relative c' {
+  \time 4/4
+  \repeat "tremolo" 32 { d32 }
+
+  c4 c4 c4 c4 c4 
+}
+
diff --git a/input/regression/cluster-break.ly b/input/regression/cluster-break.ly
new file mode 100644 (file)
index 0000000..9b42b92
--- /dev/null
@@ -0,0 +1,21 @@
+
+\version "2.10.7"
+\header {
+  texidoc = "Clusters behave well across line breaks."
+}
+
+\layout { ragged-right = ##t }
+
+fragment = \relative c' {
+  \time 2/4 
+  <e d'>4
+  <g a>4 | \break
+  <e a>
+  <f a>
+}
+
+<< \new Staff \makeClusters \fragment
+   \new Staff \fragment
+>>
+
+
diff --git a/input/regression/cluster-style.ly b/input/regression/cluster-style.ly
new file mode 100644 (file)
index 0000000..9d4dfc8
--- /dev/null
@@ -0,0 +1,34 @@
+
+
+\version "2.10.7"
+\header {
+  texidoc = "Clusters behave well across line breaks."
+}
+
+\layout { ragged-right = ##t }
+
+fragment = \relative c' {
+  <e d'>4
+  <g a>4 
+  <e a>4
+}
+
+<<
+  \time 2/4 
+  \new Staff {
+    \override ClusterSpanner #'style = #'ramp
+    \makeClusters \fragment
+    r4
+    \override ClusterSpanner #'style = #'leftsided-stairs
+    \makeClusters \fragment
+    r4
+    \override ClusterSpanner #'style = #'rightsided-stairs
+    \makeClusters \fragment
+    r4
+    \override ClusterSpanner #'style = #'centered-stairs
+    \makeClusters \fragment
+    }
+  
+>>
+
+
index 289c1f8984fa5b419421a169d096aef4a6f59675..a05f2ac73d5b575bdb00b8b7d174b1f5e7b2cdc2 100644 (file)
@@ -15,7 +15,7 @@ fragment = \relative c' {
 
 <<
   \new Staff \fragment
-  \new Staff \applyMusic #notes-to-clusters \fragment
+  \new Staff \makeClusters \fragment
 >>
 
 
index 63c555519afe7b6043c7daff8749d9c6002dae6f..c2802689b378e6180c26db688ed0158274bef452 100644 (file)
@@ -8,11 +8,6 @@ Completion heads are not fooled by polyphony with a different rhythm.
 
 }
 
-\context Staff  \relative c'' << 
-  { c2. c bes2 } \\
-  { c2. a8 g4 f4. g4 f  }
->>
-
 \layout {
   \context{
     \Voice
@@ -20,3 +15,8 @@ Completion heads are not fooled by polyphony with a different rhythm.
     \consists "Completion_heads_engraver"
   }
 }
+
+\context Staff \relative c'' << 
+  { c2. c bes2 } \\
+  { c2. a8 g4 f4. g4 f  }
+>>
diff --git a/input/regression/context-die-staff.ly b/input/regression/context-die-staff.ly
new file mode 100644 (file)
index 0000000..b36ae93
--- /dev/null
@@ -0,0 +1,16 @@
+\version "2.10.0"
+
+\header  {
+texidoc = "a staff should die if there is reference to it."
+}
+\layout {
+  ragged-right = ##t
+  line-width = 2.5 \cm
+  indent = 0.0
+}
+
+{
+  << \new Staff =  "q" \new Voice ="V" c1  >>
+  %% no \break, BreakEvent causes spurious staff
+  \new RhythmicStaff = "R" \new Voice = "RV" c 
+}
diff --git a/input/regression/display-lily-tests.ly b/input/regression/display-lily-tests.ly
new file mode 100644 (file)
index 0000000..a6b1dac
--- /dev/null
@@ -0,0 +1,262 @@
+\version "2.11.6"
+
+#(use-modules (srfi srfi-13)
+              (ice-9 format))
+
+%%%
+%%% Testing utilities
+%%%
+
+#(define (parse-lily-and-compute-lily-string chr port)
+  (let ((lily-string (call-with-output-string
+                      (lambda (out)
+                        (do ((c (read-char port) (read-char port)))
+                            ((and (char=? c #\#)
+                                  (char=? (peek-char port) #\]))
+                             (read-char port))
+                          (display c out))))))
+    `(let* ((parser-clone (ly:parser-clone parser))
+            (input-str (string-trim-both ,lily-string))
+            (music (car (ly:music-property (parse-string-result input-str
+                                                                parser-clone)
+                                           'elements)))
+            (result-str (string-trim-both (music->lily-string music parser-clone))))
+       (cons input-str result-str))))
+
+#(read-hash-extend #\[ parse-lily-and-compute-lily-string) %{ ] %}
+
+#(define (lily-string->markup str)
+   (make-column-markup (string-split str #\NewLine)))
+
+#(define test-function
+  (let ((test-number 0))
+   (lambda (parser location result-info strings)
+    (let ((input (car strings))
+         (output (cdr strings)))
+     (set! test-number (1+ test-number))
+     (if (string=? input output)
+         (make-music 'SequentialMusic 'void #t)
+         (make-music 'SequentialMusic
+           'elements
+           (list (ly:parser-lookup parser 'fatText)
+                 (make-music 'EventChord
+                   'elements (list (make-music 'LineBreakEvent
+                                     'break-permission 'force)))
+                 (make-music 'EventChord
+                   'elements (list (make-music 'SkipEvent
+                                     'duration (ly:make-duration 0 0 1 1))
+                                   (make-music 'TextScriptEvent
+                                     'direction -1
+                                     'text (markup #:column
+                                            (#:simple (format #f "Test #~a " test-number)
+                                             (if (string-null? result-info) 
+                                                 (markup #:bold "BUG") 
+                                                 (markup #:simple result-info))
+                                             #:typewriter (lily-string->markup input)
+                                             #:typewriter (lily-string->markup output)))))))))))))
+    
+
+test = 
+#(define-music-function (parser location result-info strings) (string? pair?)
+   (test-function parser location result-info strings))
+
+%%%
+%%% Tests
+%%%
+\header {
+  texidoc = \markup \column { \line { \typewriter display-lily-music unit tests }
+                              \line { Real bugs (regressions) are marked as \bold BUG. }
+                              \line { Known bugs are marked as TODO. } }
+}
+
+\layout {
+  raggedright = ##t 
+  indent = 0\cm
+  \context {
+    \Staff
+    \override StaffSymbol #'line-count = #1
+    \remove "Time_signature_engraver"
+    \remove "Clef_engraver"
+  }
+  \context {
+    \Score
+    \remove "Bar_number_engraver"
+  }
+}
+
+%% Sequential music
+\test "" ##[ { { a b } { c d } } #]            % SequentialMusic
+\test "" ##[ << { a b } { c d } >> #]          % SimultaneousMusic
+\test "" ##[ << { a b } \\ { c d } >> #]       % VoiceSeparator
+
+%% Chords and Notes
+\test "" ##[ { ceses ces c cis cisis } #]      % NoteEvent
+\test "" ##[ { deses des d dis disis } #]
+\test "" ##[ { eeses ees e eis eisis } #]
+\test "" ##[ { feses fes f fis fisis } #]
+\test "" ##[ { geses ges g gis gisis } #]
+\test "" ##[ { aeses aes a ais aisis } #]
+\test "" ##[ { beses bes b bis bisis } #]
+\test "" ##[ { c,, d' } #]
+\test "" ##[ { c' d'=' } #]
+\test "" ##[ { c! c? } #]
+\test "" ##[ r1.*4/3 #]                % RestEvent
+\test "" ##[ c1\rest #]                % RestEvent
+\test "" ##[ s2..*3/4 #]               % SkipEvent
+\test "" ##[ R1.*2/3 #]                % MultiMeasureRestMusicGroup, MultiMeasureRestEvent
+\test "" ##[ \skip 2.*3/4 #]           % SkipMusic
+\test "" ##[ < c\1 e\3 >4.*3/4-. #]    % EventChord, NoteEvent, StringNumberEvent, ArticulationEvent
+
+%% tags
+\test "" ##[ { \tag #'foo { c4 d } } #]
+\test "" ##[ c-\tag #'foo -\tag #'baz -^ -. #]
+
+%% Graces
+\test "" ##[ { \grace c8 d2 } #]                       % GraceMusic
+\test "" ##[ { \appoggiatura c8 d2 } #]
+\test "" ##[ { \acciaccatura c8 d2 } #]
+\test "" ##[ { c1 \afterGrace { b,16 c } d2 } #]
+
+%% Clusters
+\test "" ##[ { \makeClusters { c4 g } } #]             % ClusterNoteEvent
+
+%% Figured bass
+\test "" ##[ \figures { < 6 > } #]                     % BassFigureEvent
+\test "" ##[ \figuremode { < 1-- 3- > < 2+ 4++ > < _! 7! > } #]
+\test "" ##[ \figuremode { < [6 > < 5] > } #]
+
+%% Lyrics
+\test "" ##[ \lyrics { a b } #]
+\test "" ##[ \lyricmode { a --  b } #]                 % HyphenEvent
+\test "" ##[ \lyricmode { a __  b } #]                 % ExtenderEvent
+\test "" ##[ \lyricmode { "a " } #]                    % LyricEvent
+\test "" ##[ \lyricsto "foo" { bla bla } #]            % LyricCombineMusic
+\test "" ##[ { { c d }
+  \addlyrics { bla bla } } #]
+
+%% Drums
+\test "" ##[ \drums { hihat } #]
+\test "" ##[ \drummode { hihat4.*3/4 } #]
+
+%% Expressive marks
+\test "" ##[ c4 ~ #]                                   % TieEvent
+\test "" ##[ c\noBeam #]                               % BeamForbidEvent
+\test "" ##[ c\1 #]                                    % StringNumberEvent
+\test "" ##[ { c:  c:1  } #]                           % TremoloEvent
+\test "" ##[ { c-^  c^^  c_^  } #]                     % ArticulationEvent
+\test "" ##[ { c-+  c^+  c_+  } #]
+\test "" ##[ { c--  c^-  c_-  } #]
+\test "" ##[ { c-|  c^|  c_|  } #]
+\test "" ##[ { c->  c^>  c_>  } #]
+\test "" ##[ { c-.  c^.  c_.  } #]
+\test "" ##[ { c-_  c^_  c__  } #]
+\test "" ##[ { c-\trill  c^\trill  c_\trill  } #]
+\test "" ##[ { c-1  c^2  c_3  } #]                     % FingerEvent
+\test "" ##[ { c-"foo"  c^"foo"  c_"foo"  } #] % TextScriptEvent
+\test "" ##[ { R1*4-"foo"  R^"foo"  R_"foo"  } #]      % MultiMeasureTextEvent
+\test "" ##[ { c4-\harmonic  c^\harmonic  c_\harmonic  } #]    % HarmonicEvent
+\test "" ##[ { c-\glissando  c^\glissando  c_\glissando  } #] % GlissandoEvent
+\test "" ##[ { c-\arpeggio  c^\arpeggio  c_\arpeggio  } #]     % ArpeggioEvent
+\test "" ##[ { c\p  c^\ff  c_\sfz  } #]                % AbsoluteDynamicEvent
+\test "" ##[ { c[  c]  c^[  c^]  c_[  c_]  } #]        % BeamEvent
+\test "" ##[ { c(  c)  c^(  c^)  c_(  c_)  } #]        % SlurEvent
+\test "" ##[ { c\<  c\!  c^\<  c^\!  c_\<  c_\!  } #]  % CrescendoEvent
+\test "" ##[ { c\>  c\!  c^\>  c^\!  c_\>  c_\!  } #]  % DecrescendoEvent
+\test "" ##[ { c\(  c\)  c^\(  c^\)  c_\(  c_\)  } #]  % PhrasingSlurEvent
+\test "" ##[ { c\sustainDown  c\sustainUp  } #] % SustainEvent
+\test "" ##[ { c\sostenutoDown  c\sostenutoUp  } #] % SostenutoEvent
+\test "" ##[ \melisma #]
+\test "" ##[ \melismaEnd #]
+\test "" ##[ { c\startTextSpan  c\stopTextSpan  } #] % TextSpanEvent
+\test "" ##[ { c\startTrillSpan  c\stopTrillSpan  } #] % TrillSpanEvent
+\test "" ##[ { c \startStaff c \stopStaff } #] % StaffSpanEvent
+\test "" ##[ { c\startGroup  c\stopGroup  c^\startGroup  c^\stopGroup  c_\startGroup  c_\stopGroup  } #] % NoteGroupingEvent
+\test "" ##[ { c\unaCorda  c\treCorde  } #] % UnaCordaEvent
+\test "" ##[ \breathe #]
+\test "" ##[ { c \[ c \] } #]                  % LigatureEvent
+\test "" ##[ \~ #]                                     % PesOrFlexaEvent
+
+\test "" ##[ \break #]
+\test "" ##[ \noBreak #]
+\test "" ##[ \pageBreak #]
+\test "" ##[ \noPageBreak #]
+\test "" ##[ \pageTurn #]
+\test "" ##[ \noPageTurn #]
+
+%% Checks
+\test "" ##[ \octave a' #]                             % RelativeOctaveCheck
+\test "" ##[ | #]                                      % BarCheck
+
+%% Marks
+\test "" ##[ \mark \default #]                 % MarkEvent
+\test "" ##[ \mark "Allegro" #]
+\test "" ##[ \tempo 4 = 120 #]                 % MetronomeChangeEvent
+
+%% key, time, clef, bar
+\test "" ##[ \key \default #]                  % KeyChangeEvent
+\test "" ##[ \key e \minor #]
+\test "" ##[ \clef "bass" #]
+\test "" ##[ \clef "french^2" #]
+\test "" ##[ \clef "alto_3" #]
+\test "" ##[ \time 2/4 #]
+\test "" ##[ #(set-time-signature 5 8 '(3 2)) #]
+\test "" ##[ \bar "|." #]
+
+%% staff switches
+\test "" ##[ \autochange { c d } #]                    % AutoChangeMusic
+\test "" ##[ { \change Staff = "up" { c d } } #]       % ContextChange
+
+%% Tuplets
+\test "" ##[ \times 2/3 { c8 d e } #]                          % TimeScaledMusic
+\test "" ##[ \times 4/6 { c16 d e f g a } #]
+%}
+%% \relative and \tranpose
+\test #"NOT A BUG" ##[ \relative c' { c b } #] % RelativeOctaveMusic
+\test #"NOT A BUG" ##[ \transpose c d { c d } #]       % TransposedMusic
+%}
+%% Repeats
+\test "" ##[ \repeat volta 2 { c d } #]                % VoltaRepeatedMusic
+\test "" ##[ \repeat unfold 2 { c d } #]               % UnfoldedRepeatedMusic
+\test "" ##[ \repeat fold 2 { c d } #]         % FoldedRepeatedMusic
+\test "" ##[ \repeat percent 2 { c d } #]              % PercentRepeatedMusic
+\test "" ##[ \repeat tremolo 4 { c16 d } #]            % TremoloRepeatedMusic
+\test "" ##[ \repeat volta 2 { c4 d } \alternative { { c d } { e f } } #] % 
+
+%% Context creation
+\test "" ##[ \new Staff { c d } #]                     % ContextSpeccedMusic
+\test "" ##[ \new Staff = "up" { c d } #]                      % ContextSpeccedMusic
+\test "" ##[ \context Staff { c d } #]
+\test "" ##[ \context Staff = "up" { c d } #]
+\test "" ##[
+\new Staff \with {
+  \consists "Timing_engraver"
+  \remove "Clef_engraver"
+} { c d } #]
+%% Context properties
+\test "" ##[ \once \set Score . skipBars = ##t #]      % PropertySet
+\test "" ##[ \set autoBeaming = ##f #]
+\test "" ##[ \unset Score . skipBars #]                % PropertyUnset
+\test "" ##[ \unset autoBeaming #]
+%% Layout properties
+\test "" ##[ \override Staff . Stem #'thickness = #4.0 #]      % OverrideProperty
+\test "" ##[ \once \override Beam #'thickness = #0.6 #]
+\test "" ##[ \revert Staff . Stem #'thickness #]       % RevertProperty
+\test "" ##[ \revert Beam #'thickness #]
+
+%% \applyOutput
+\test "" ##[ \applyOutput #'Foo #(lambda (arg) (list)) #]
+%% \applyContext
+\test "" ##[ \applyContext #(lambda (arg) (list)) #]
+
+%% \partial
+\test "" ##[ \partial 2 #]
+\test "" ##[ \partial 8. #]
+\test #"TODO? exotic durations in \\partial" ##[ \partial 4*2/3 #]
+
+%% \partcombine
+\test "" ##[ \partcombine { c e }
+{ d f } #]                                             % PartCombineMusic UnrelativableMusic
+
+%% Cue notes
+\test "" ##[ \cueDuring #"foo" #1 { c d } #]
+\test "" ##[ \quoteDuring #"foo" { c d } #]
index fac525db2421b37ab06d5eff3d615e881f108b2f..439e6bd01b1b6fd561e60b7d530b6c7edef70315 100644 (file)
@@ -4,11 +4,12 @@
 texidoc = "Broken crescendi should be open on one side."
 }
 
-\relative c'' { 
-  c1 \< \break c1\!  \> \break c1\!
-}
 \layout {
   line-width = 4.\cm
 }
 
 
+\relative c'' { 
+  c1 \< \break c1\!  \> \break c1\!
+}
+
diff --git a/input/regression/finger-chords-accidental.ly b/input/regression/finger-chords-accidental.ly
new file mode 100644 (file)
index 0000000..3ae06a4
--- /dev/null
@@ -0,0 +1,15 @@
+\version "2.10.8"
+\header
+{
+  texidoc = "Scripts left of a chord avoid accidentals."
+}
+
+\paper {
+  ragged-right = ##t
+}
+
+{
+  r4 
+  \set fingeringOrientations = #'(left)
+  <cis''-3 >
+}
diff --git a/input/regression/general-scheme-bindings.ly b/input/regression/general-scheme-bindings.ly
new file mode 100644 (file)
index 0000000..ad625ff
--- /dev/null
@@ -0,0 +1,18 @@
+\header {
+
+  texidoc = "This file tests various Scheme utiliity functions." 
+
+}
+
+
+\version "2.11.8"
+
+%% todo : use macro, to show the statement tested. 
+#(ly:progress "~a\n" (ly:expand-environment "${HOME} $HOME $$ "))
+#(ly:font-config-display-fonts)
+
+#(ly:progress "~A\n" (ly:duration->string (ly:make-duration 2 2 3 7)))
+#(ly:parser-parse-string (ly:parser-clone parser) "foo  = #1 #(ly:progress \"hello there\n\")")
+
+#(ly:progress "~a\n" (ly:truncate-list! (iota 5) 10))
+#(ly:progress "~a\n" (ly:truncate-list! (iota 10) 5))
index 407ad0b9cb7fada29ae2f5341c608ecb3379f5f9..2cea6f962158046d129c1689a86e8697541dbca6 100644 (file)
@@ -12,6 +12,11 @@ The engraver does no time-keeping, so it involves some trickery to get
 }
 
 
+\layout{
+  line-width = 50.\mm
+  indent = 0
+}
+
 \new Staff \relative c''{
                                % gliss non gliss and 
   c4 \glissando d e \glissando f \glissando \break
@@ -23,9 +28,4 @@ The engraver does no time-keeping, so it involves some trickery to get
   c4 \glissando c,, \glissando c' \glissando d
 }
 
-\layout{
-  line-width = 50.\mm
-  indent = 0
-}
-
 
diff --git a/input/regression/hairpin-to-rest.ly b/input/regression/hairpin-to-rest.ly
new file mode 100644 (file)
index 0000000..3ba757d
--- /dev/null
@@ -0,0 +1,11 @@
+\version "2.10.8"
+\header {
+  texidoc = "Hairpins end at the left edge of a rest."
+}
+
+\layout{
+  ragged-right=##t
+}
+\relative c'' {
+  c2\p\> r4\!
+}
diff --git a/input/regression/identifiers.ly b/input/regression/identifiers.ly
new file mode 100644 (file)
index 0000000..682a156
--- /dev/null
@@ -0,0 +1,31 @@
+
+\header {
+  texidoc = "test identifiers."
+  }
+\version "2.10.8"
+
+num = #3
+mus = { c'4 }
+paperId = \paper { line-width = 5.0 \cm }
+layoutId = \layout { ragged-right = ##t }
+perfId = \midi {}
+markupId = \markup { hoi }
+stringId = "title"
+
+% headers not allowed  as Id's
+
+scoreId = \score {
+  \repeat unfold \num \mus
+  \layout { \layoutId }
+  \midi { \perfId }
+  }
+
+bookId = \book {
+  \score { \scoreId }
+  \paper { \paperId }
+  }
+
+
+\book { \bookId }
+
+
index abc315f7f3dec38a78270e0659cb916b316307ab..a418315deedf191750c843152a0be23d35e7d4e9 100644 (file)
@@ -6,15 +6,15 @@
   pedal line spanners."
 }
 
+\paper {
+  line-width = 3\cm
+  indent = 0\cm
+}
+
 \relative {
   \set Staff.shortInstrumentName = "foo"
   f1 | f1 | f1 |
   f1\< | f1 | f1\! |
 }
 
-\paper {
-  line-width = 3\cm
-  indent = 0\cm
-}
-
 % EOF
diff --git a/input/regression/lyric-combine-switch-voice.ly b/input/regression/lyric-combine-switch-voice.ly
new file mode 100644 (file)
index 0000000..b0b6d19
--- /dev/null
@@ -0,0 +1,44 @@
+\header {
+
+  texidoc = "Switching melody to a different voice works even
+the switch occurs together with context instantiation."
+
+}
+
+\version "2.10.8"
+
+<<
+  \relative \new Voice = "lahlah" {
+    \set Staff.autoBeaming = ##f
+    c4
+    <<
+      \new Voice = "alternative" {
+        \voiceOne
+        \times 2/3 {
+         %% show associations clearly.
+          \override NoteColumn #'force-hshift = #-3
+          r8 f g
+        }
+      }
+      {
+        \voiceTwo
+        f8.[ g16]
+        \oneVoice
+      } >>
+    a8( b) c
+  }
+  \new Lyrics \lyricsto "lahlah" {
+    %% Tricky: need to set associatedVoice
+    %% one syllable too soon!
+    
+    \set associatedVoice = alternative % applies to "ran"
+    Ty --
+    ran --
+    \set associatedVoice = lahlah % applies to "sau"
+    no --
+    sau -- rus Rex
+  }
+>>
+
+
+
index c7db43946779e3a74fd105c9eba17e7e635ca67a..36aae288b5a9061de72c8fc158d917986a319c20 100644 (file)
@@ -8,6 +8,9 @@ of the melisma."
 
 }
 
+\layout {
+  ragged-right = ##t
+}
 
 << 
   \new Voice =A  {
@@ -17,7 +20,4 @@ of the melisma."
   }
   \lyricsto A \context Lyrics \lyricmode { a __ a __ ha }
 >>
-  \layout {
-    ragged-right = ##t
-  }
 
diff --git a/input/regression/lyric-extender-no-heads.ly b/input/regression/lyric-extender-no-heads.ly
new file mode 100644 (file)
index 0000000..958805a
--- /dev/null
@@ -0,0 +1,24 @@
+\header
+{
+  texidoc = "Extender engraver also notices the lack of note heads.
+Here the extender ends on the 2nd quarter note, despite the grace note
+without a lyric attached." 
+  
+}
+
+\version "2.10.7"
+
+\layout {
+  ragged-right = ##t
+}
+
+\relative c'' {
+  \time 3/4
+  d4~ d4 r4
+  \grace es8
+
+  d4
+  
+}
+\addlyrics { x __ x  }
+
index c78cd759c4087574218c4061ced48201e786c7f7..c48f7c8737a39817aa6461edb4c35b716b769432 100644 (file)
@@ -8,6 +8,17 @@ they go past the first note. "
 }
 
 
+\layout   {
+  indent = 0.0 \cm
+  line-width = 3.4 \cm
+
+  \context {
+    \Staff \remove "Time_signature_engraver"
+  }
+}
+
+
+
 <<
   \new Staff \relative c'' {
     \time 1/4 c16[ c c  c]
@@ -23,15 +34,5 @@ they go past the first note. "
     bla16 -- bla -- bla 
   }
 >>
-  \layout   {
-    indent = 0.0 \cm
-    line-width = 3.4 \cm
-
-    \context {
-      \Staff \remove "Time_signature_engraver"
-    }
-  }
-  
-
 
   
index 64a1e8153d4a2539b51fd70875bc9bc39016c656..cfea330422831ee7a4af3dbc2de8efb846ec5e57 100644 (file)
@@ -9,10 +9,16 @@ brackets above beats when the beats of a time signature are grouped.  "
 
 \version "2.10.0"
 
+\layout  {
+  ragged-right = ##t
+}
 
 %% TODO: should have 2/4 + 5/8 time sig style.
 
-\context Staff
+\context Staff \with {
+    \consists "Measure_grouping_engraver"
+  }
+
 \relative c' {
   #(set-time-signature 2 4) 
   c8 a'4 a8~
@@ -23,12 +29,5 @@ brackets above beats when the beats of a time signature are grouped.  "
   #(set-time-signature 5 8 '(3 2)) 
   g8 a4 g a4.->
 }
-\layout  {
-  ragged-right = ##t
-  \context {
-    \Staff
-    \consists "Measure_grouping_engraver"
-  }
-}
 
 
diff --git a/input/regression/midi-absolute-volume.ly b/input/regression/midi-absolute-volume.ly
new file mode 100644 (file)
index 0000000..8c3a24c
--- /dev/null
@@ -0,0 +1,34 @@
+
+\version "2.10.0"
+\header {
+    texidoc = "@cindex Dynamic Absolute Volume
+Absolute dynamics have an effect on MIDI files.
+"
+}
+
+
+\score{
+\relative c''{
+%segfault in engraver
+a1\ppp 
+a1\pp
+a\p
+a\mp
+a\mf
+a\f
+a\ff
+a\fff
+a\sf
+}
+\layout{ ragged-right = ##t }
+
+  \midi {
+    \context {
+      \Score
+      tempoWholesPerMinute = #(ly:make-moment 60 1)
+      }
+    }
+
+
+}
+
diff --git a/input/regression/midi-drums.ly b/input/regression/midi-drums.ly
new file mode 100644 (file)
index 0000000..2b799be
--- /dev/null
@@ -0,0 +1,18 @@
+
+\version "2.10.0"
+
+\version "2.10.1" 
+
+\score {
+  \new DrumStaff <<
+    \drummode {
+      bd4 sn4 bd4 sn4
+      <<
+       {\voiceOne \repeat unfold 16 hh16 }
+       \new DrumVoice { \voiceTwo bd4 sn4 bd4 sn4 }
+      >> \oneVoice
+    }
+  >>
+  \layout {}
+  \midi {}
+}
diff --git a/input/regression/midi-grace.ly b/input/regression/midi-grace.ly
new file mode 100644 (file)
index 0000000..213de79
--- /dev/null
@@ -0,0 +1,22 @@
+\version "2.10.0"
+\header{ texidoc = "Tests MIDI output with grace notes. " }
+
+\score { 
+  \context Voice \relative c {
+    \new Voice = VoiceOne
+       \grace {
+  \override Stem  #'stroke-style = #"grace"
+   c8 
+  \revert Stem #'stroke-style }
+ d4 d d d d
+       \grace {
+  \override Stem  #'stroke-style = #"grace"
+   e16 f e f 
+  \revert Stem #'stroke-style }
+ d4 d d d d 
+       
+  }
+  \layout { }  
+  \midi { }
+}
+
diff --git a/input/regression/midi-lyric-barcheck.ly b/input/regression/midi-lyric-barcheck.ly
new file mode 100644 (file)
index 0000000..5c06916
--- /dev/null
@@ -0,0 +1,24 @@
+\version "2.10.0"
+\header {
+
+    texidoc = "Lyrics in MIDI are aligned to ties and beams:
+this examples causes no bar checks in MIDI.
+"
+
+
+    }
+\score {
+
+    <<\relative c'' \new Voice =  A {
+       \autoBeamOff
+       c8[ c] c2.
+       c1~c4 c2.
+       c4 ( d e) d
+       c1
+
+    }
+    \lyricsto "A" \lyrics { bla bla | bla bla | bla bla | bla }
+    >>
+    \layout {}
+      \midi {}
+    }
diff --git a/input/regression/midi-microtone.ly b/input/regression/midi-microtone.ly
new file mode 100644 (file)
index 0000000..cf1f9f1
--- /dev/null
@@ -0,0 +1,10 @@
+\version "2.10.8"
+\header {
+  texidoc = "The pitch wheel is used for microtones."
+  }
+
+\score { 
+  { c4 cih cis cisih d }
+  \midi { }
+  }
+    
diff --git a/input/regression/midi-scales.ly b/input/regression/midi-scales.ly
new file mode 100644 (file)
index 0000000..d6e8ed9
--- /dev/null
@@ -0,0 +1,159 @@
+
+\version "2.10.0"
+% candidate for regression.  -gp
+\header {
+  texidoc="Converting LilyPond input to MIDI and then again back with
+  @code{midi2ly.py} is a reversible procedure in some simple cases,
+  which mean that the original @code{.ly} -file and the one converted 
+  back from the generated @code{.midi} -file do not differ.
+  Here are produced some scales.
+  
+  "
+}
+
+%{
+  This means, doing:
+
+    lilypond input/test/midi-scales.ly
+    midi2ly midi-scales.midi
+    diff -u input/test/midi-scales.ly midi-scales-midi.ly
+
+  should show no differences at all in \key commands or notes.
+
+  Therefore, do not reformat this file unless midi2ly changes.
+
+  1.7.30 reformatted, because
+  midi2ly now outpts 1 bar per line and adds bar checks and numbers.
+
+%}
+
+scales =  \relative c {
+
+  % [INSTRUMENT_NAME] bright acoustic
+  \key c \major  % sharp-major
+  c'4 d e f |
+  g a b c |
+
+  \key g \major
+  g a b c |
+  d e fis g |
+
+  \key d \major
+  d, e fis g |
+  a b cis d |
+
+  \key a \major
+  a b cis d |
+  e fis gis a |
+
+  \key e \major
+  e, fis gis a |
+  b cis dis e |
+
+  \key b \major
+  b cis dis e |
+  fis gis ais b |
+
+  \key fis \major
+  fis, gis ais b |
+  cis dis eis fis |
+
+  \key cis \major
+  cis, dis eis fis |
+  gis ais bis cis |
+
+  \key a \minor  % sharp-minor
+  a b c d |
+  e f gis a |
+
+  \key e \minor
+  e, fis g a |
+  b c dis e |
+
+  \key b \minor
+  b cis d e |
+  fis g ais b |
+
+  \key fis \minor
+  fis, gis a b |
+  cis d eis fis |
+
+  \key cis \minor
+  cis, dis e fis |
+  gis a bis cis |
+
+  \key gis \minor
+  gis ais b cis |
+  dis e fisis gis |
+
+  \key dis \minor
+  dis, eis fis gis |
+  ais b cisis dis |
+
+  \key ais \minor
+  ais bis cis dis |
+  eis fis gisis ais |
+
+  \key f \major  % flat-major
+  f, g a bes |
+  c d e f |
+
+  \key bes \major
+  bes c d ees |
+  f g a bes |
+
+  \key ees \major
+  ees,, f g aes |
+  bes c d ees |
+
+  \key aes \major
+  aes, bes c des |
+  ees f g aes |
+
+  \key des \major
+  des,, ees f ges |
+  aes bes c des |
+
+  \key ges \major
+  ges, aes bes ces |
+  des ees f ges |
+
+  \key ces \major
+  ces,, des ees fes |
+  ges aes bes ces |
+
+  \key d \minor  % flat-minor
+  d, e f g |
+  a bes cis d |
+
+  \key g \minor
+  g, a bes c |
+  d ees fis g |
+
+  \key c \minor
+  c,, d ees f |
+  g aes b c |
+
+  \key f \minor
+  f, g aes bes |
+  c des e f |
+
+  \key bes \minor
+  bes,, c des ees |
+  f ges a bes |
+
+  \key ees \minor
+  ees, f ges aes |
+  bes ces d ees |
+
+  \key aes \minor
+  aes, bes ces des |
+  ees fes g aes |
+}
+
+\score {
+  \context Voice \scales
+  \layout { }
+  \midi { }
+}
+
diff --git a/input/regression/midi-transposition.ly b/input/regression/midi-transposition.ly
new file mode 100644 (file)
index 0000000..2429fef
--- /dev/null
@@ -0,0 +1,14 @@
+\header
+{
+  texidoc =  "should deliver f' in MIDI"
+}
+\version "2.10.5"
+
+\score {
+  {
+    \transposition f
+    c''
+  }
+  \midi{}
+  \layout{}
+}
diff --git a/input/regression/midi-tuplets.ly b/input/regression/midi-tuplets.ly
new file mode 100644 (file)
index 0000000..0a0f5ef
--- /dev/null
@@ -0,0 +1,35 @@
+\version "2.10.0"
+\header {
+texidoc = "
+
+Midi2ly tuplet test.
+
+@example
+  python scripts/midi2ly.py --duration-quant=32 \
+      --allow-tuplet=4*2/3 \
+      --allow-tuplet=8*2/3 \
+      --allow-tuplet=4*3/5 \
+      --allow-tuplet=8*3/5 \
+      tu.midi 
+@end example
+"
+}
+
+
+\score { 
+  \context Voice  \relative c' {
+
+    a1 a2 a2. a4 a4. a8 a8. a16 a16. a32 a32. a64
+
+    \times 2/3 { b4 b4 b4 }
+    \times 3/5 { b4 b4 b4 b4 b4 }
+
+    \times 2/3 { c8 c8 c8 }
+    \times 3/5 { c8 c8 c8 c8 c8 }
+
+  }
+  \layout { }  
+  \midi { }
+}
+
+
diff --git a/input/regression/midi-volume-equaliser.ly b/input/regression/midi-volume-equaliser.ly
new file mode 100644 (file)
index 0000000..0ad06cb
--- /dev/null
@@ -0,0 +1,161 @@
+\version "2.10.0"
+\header {
+  texidoc = "@cindex Midi Volume Equaliser
+The full orchestra plays a notes, where groups stop one after
+another. Use this to tune equalizer settings. "
+}
+
+#(set-global-staff-size 16)
+
+%{
+
+Override, see scm/midi.scm:
+
+#(set! instrument-equalizer-alist
+  (append 
+   '(
+     ("flute" . (0 . 0.7))
+   )
+   instrument-equalizer-alist))
+
+%}
+
+flauti =  \relative c' {
+  \set Staff.midiInstrument = #"flute"
+  \set Staff.instrumentName = #"2 Flauti"
+  \set Staff.shortInstrumentName = #"Fl."
+
+  c1\f R1*10
+}
+
+oboi =  \relative c' {
+  \set Staff.midiInstrument = #"oboe"
+  \set Staff.instrumentName = #"2 Oboi"
+  \set Staff.shortInstrumentName = #"Ob."
+
+  R1*1 c1\f R1*9
+}
+
+clarinetti =  \relative c' {
+  \set Staff.midiInstrument = #"clarinet"
+  \set Staff.instrumentName = #"Clarinetti"
+  \set Staff.shortInstrumentName = #"Cl"
+
+  R1*2 c1\f R1*8
+}
+
+fagotti =  \relative c' {
+  \set Staff.midiInstrument = #"bassoon"
+  \set Staff.instrumentName = #"2 Fagotti"
+  \set Staff.shortInstrumentName = #"Fg."
+
+  \clef bass
+  R1*3 c1\f R1*7
+}
+
+corni =  \relative c' {
+  \set Staff.midiInstrument = #"french horn"
+  \set Staff.instrumentName = #"Corni"
+  \set Staff.shortInstrumentName = #"Cor"
+
+  R1*4 c1\f R1*6
+}
+
+trombe =  \relative c' {
+  \set Staff.midiInstrument = #"trumpet"
+  \set Staff.instrumentName = #"Trombe"
+  \set Staff.shortInstrumentName = #"Tp."
+
+  \clef bass
+  R1*5 c1\f R1*5
+}
+
+timpani =  \relative c' {
+  \set Staff.midiInstrument = #"timpani"
+  \set Staff.instrumentName = #"Timpani"
+  \set Staff.shortInstrumentName = #"Timp."
+
+  R1*6 c1\f R1*4
+}
+
+violinoI =  \relative c' {
+  \set Staff.midiInstrument = #"violin"
+  \set Staff.instrumentName = #"Violino I "
+  \set Staff.shortInstrumentName = #"Vl. I "
+
+  R1*7 c1\f R1*3
+}
+
+violinoII =  \relative c' {
+  \set Staff.midiInstrument = #"violin"
+  \set Staff.instrumentName = #"Violino II "
+  \set Staff.shortInstrumentName = #"Vl. II "
+  
+  R1*8 c1\f R1*2
+}
+
+viola =  \relative c' {
+  \set Staff.midiInstrument = #"viola"
+  \set Staff.instrumentName = #"Viola"
+  \set Staff.shortInstrumentName = #"Vla."
+
+  \clef alto
+  R1*9 c1\f R1*1
+}
+
+violoncello =  \relative c' {
+  \set Staff.midiInstrument = #"cello"
+                               %\set Staff.midiInstrument = #"contrabass"
+  \set Staff.instrumentName = #"Violoncello"
+  \set Staff.shortInstrumentName = #"Vc."
+  
+  \clef bass
+  R1*10 c1\f
+}
+
+
+\score {
+  << 
+    \new StaffGroup = "legni" << 
+      \new Staff = "flauti" \flauti
+      \new Staff = "oboi" \oboi
+      \new Staff = "clarinetti" \clarinetti 
+      \new Staff = "fagotti" \fagotti 
+    >>
+    \new StaffGroup = "ottoni" <<
+      \new Staff = "corni" \corni
+      \new Staff = "trombe" \trombe
+    >>
+    \new StaffGroup = "timpani" <<
+      \new Staff = "timpani" \timpani
+      { 
+       \skip 1 
+       %% Hmm: this forces a staff-bracket, that's good!
+       %% However, I can't find where is decided on staff-bracket yes/no
+      }
+    >>
+    \new StaffGroup = "archi" <<
+      \new GrandStaff = "violini" <<
+        \new Staff = "violino1" \violinoI
+        \new Staff = "violino2" \violinoII
+      >>
+      \new Staff = "viola" \viola
+      \new Staff = "violoncello" \violoncello
+    >>
+  >>
+
+  \layout {
+    \context {
+      \RemoveEmptyStaffContext
+    }
+  }
+  
+  \midi {
+    \context {
+      \Score
+      tempoWholesPerMinute = #(ly:make-moment 60 1)
+    }
+  }
+}
+
+
diff --git a/input/regression/multi-measure-rest-usebreve.ly b/input/regression/multi-measure-rest-usebreve.ly
new file mode 100644 (file)
index 0000000..444bece
--- /dev/null
@@ -0,0 +1,24 @@
+\version "2.10.0"
+\header{
+
+  texidoc="For longer measure lengths, the breve rest is used."
+
+}
+
+\layout {
+  \context {
+    \Score
+    skipBars = ##t
+  }
+  ragged-right = ##t   
+}
+
+
+{
+  \time 8/4
+  R1*12
+  \time 4/4
+  R1*6
+}
+
+
index 5fb534401811eca66b36fa032e84127b339accc2..8ea6f3155c34bd9d8324a23cefb85a343b206a98 100644 (file)
@@ -27,8 +27,7 @@ are used then a different symbol is used.
   \time 3/4 \key cis \major
   R2.*15
   
-  R2.
-  R2.*3
+  R2.*7
   R2.*9
   R2.*11
 
index efd1fa5d89f7e97da1d2f808a12fb6c7a8916ee2..82256aac1899a49edac0097d279fddfc856e4418 100644 (file)
@@ -6,6 +6,9 @@
 The boolean property @code{no-spacing-rods} in @code{TextScript} is used
 to control the horizontal size of text.  " }
 
+\layout {
+  line-width = 3.0\cm
+}
 
 \relative c''{
   %% \emptyText
@@ -15,8 +18,5 @@ to control the horizontal size of text.  " }
   \fatText
   c_"very wide and long text" c
 }
-\layout {
-  line-width = 3.0\cm
-}
 
 
index f6e1a555075d2d407c5e8064a7ce28feb0800f1d..c5ea8280016ed3b50ffa68387f241c32d1bd1f02 100644 (file)
@@ -9,6 +9,11 @@ su = { \change Staff = up}
 sd = { \change Staff = down}
 
 
+\layout {
+  line-width = 8.0 \cm
+}
+
+
 \context PianoStaff
 <<
   \new Staff = "up"   {
@@ -21,9 +26,4 @@ sd = { \change Staff = down}
     \clef F s1*4
   }
 >>
-  \layout {
-    line-width = 8.0 \cm
-  }
-
-
 
diff --git a/input/regression/part-combine-tuplet.ly b/input/regression/part-combine-tuplet.ly
new file mode 100644 (file)
index 0000000..b6bf597
--- /dev/null
@@ -0,0 +1,19 @@
+\header {
+  
+  texidoc = "End tuplets events are sent to the starting context, so
+even after a switch, a tuplet ends correctly."
+  
+}
+
+\version "2.10.8"
+
+\new Staff <<
+  \partcombine
+  \relative c'' {
+    r2
+    \times 2/3 { g8[ g g] }
+    \times 2/3 { g[ g g] } g1
+  }
+  \relative c'' { R1 g1 }
+>>
+
diff --git a/input/regression/profile-property-access.ly b/input/regression/profile-property-access.ly
new file mode 100644 (file)
index 0000000..39a4151
--- /dev/null
@@ -0,0 +1,47 @@
+% -*- Scheme -*-
+
+\header {
+  texidoc = "This file profiles property accesses; the log file shows the top properties examined."
+}
+
+
+#(ly:set-option 'profile-property-accesses #t)
+
+\version "2.10.8"
+
+\include "../../input/typography-demo.ly"
+%\book { \score { {c4 } } }
+
+#(define (prop-stats>?  x y)
+  (cond
+   ((> (cdr x) (cdr y)) #t)
+   ((= (cdr x) (cdr y))
+    (symbol<? (car x) (car y)))
+   (else #f)))
+
+#(define (display-stats what)
+  (let*
+   ((count 50)
+    (rnd 10)
+    (round-to (lambda (x) (* rnd (inexact->exact (round (/ x rnd))))))
+    (alist (map (lambda (entry) (cons (car entry) (round-to (cdr entry)))) (hash-table->alist (ly:property-lookup-stats what))))
+    (total (apply + (map cdr alist)))
+   )
+
+  (set! alist (acons 'TOTAL total alist))
+   
+  (ly:progress "\n\n~A properties, top ~a rounded to ~a\n\n~a"
+   what count rnd
+   (string-join
+    (map (lambda (x) (format "~30a: ~6@a" (car x) (cdr x)))
+     (ly:truncate-list! 
+    (sort alist prop-stats>?) count))
+    "\n"))))
+   
+
+                                
+#(display-stats 'prob)
+#(display-stats 'context)
+#(display-stats 'grob)
+
+  
diff --git a/input/regression/relative-repeat.ly b/input/regression/relative-repeat.ly
new file mode 100644 (file)
index 0000000..5f0c613
--- /dev/null
@@ -0,0 +1,10 @@
+\header {
+  texidoc = "Relative mode for repeats uses order of entry."
+  }
+\version "2.10.8"
+
+\relative {
+  \repeat "unfold" 3
+  { f2 bes2 }
+  \alternative { a1 e b } 
+}
diff --git a/input/regression/safe.ly b/input/regression/safe.ly
new file mode 100644 (file)
index 0000000..760d60f
--- /dev/null
@@ -0,0 +1,21 @@
+\version "2.10.0"
+
+"expect-error" = ##t
+
+% Ugh - this affects other files too.
+#(ly:set-option 'protected-scheme-parsing #t)
+#(ly:set-option 'safe #t)
+
+"force-finish" = ##t  
+
+\header{
+    texidoc = "This should not survive lilypond --safe-mode"
+
+    #(open-file "w")
+}
+
+
+#(open-file "/tmp/safe-guile.scm")
+
+\include "this-should-fail.ly"
+
diff --git a/input/regression/skiptypesetting-bar-check.ly b/input/regression/skiptypesetting-bar-check.ly
new file mode 100644 (file)
index 0000000..e418183
--- /dev/null
@@ -0,0 +1,17 @@
+\version "2.10.0"
+
+\header {
+
+texidoc = "skipTypesetting doesn't affect bar checks."
+
+}
+
+\relative {
+  c4
+  \set Score.skipTypesetting = ##t
+  c4 c4
+  |
+  c4 c4
+  \set Score.skipTypesetting = ##f
+  d
+}
index bb35666906ac036510f3dd6c875311cb20d6abed..8399155a527327cdb6ad8422d36d408952ea6023 100644 (file)
@@ -8,6 +8,9 @@ run through noteheads or stems.
 "
 }
 
+\layout{
+  line-width = 120.\mm
+}
 
 \relative c''{
   \time 3/4
@@ -19,8 +22,3 @@ run through noteheads or stems.
   \stemNeutral c ( \stemUp c \stemNeutral  c) c ( a  c) c( d,  c') c( f,  c')
   \stemDown c( f,  c')
 }
-\layout{
-  line-width = 120.\mm
-}
-
-
diff --git a/input/regression/spacing-mark-width.ly b/input/regression/spacing-mark-width.ly
new file mode 100644 (file)
index 0000000..b0b4614
--- /dev/null
@@ -0,0 +1,18 @@
+\header {
+
+  texidoc = "Width of marks does not affect spacing."
+
+}
+
+\version "2.10.7"
+
+\paper {
+  ragged-right = ##t
+}
+
+\relative c''
+{
+  \override Score.RehearsalMark #'break-visibility = #begin-of-line-invisible
+  c1
+  \mark "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "
+}
index 51f9708a3cf99aaf6929e73db149ca52385ebd65..2d3739e5ec7223ad4db120b1d33b9fe41c10683d 100644 (file)
@@ -8,13 +8,13 @@ has a @code{minimum-length} of 5."
 
 }
 
+\paper {
+  indent = 0.0\mm
+  line-width = 40.0\mm
+}
+
 \relative {
   \override Tie #'minimum-length = #5
   f2. f16  f  f  f ~ | \break
   f1
 }
-
-\paper {
-  indent = 0.0\mm
-  line-width = 40.0\mm
-}
diff --git a/input/regression/to-xml.ly b/input/regression/to-xml.ly
new file mode 100644 (file)
index 0000000..c2f3972
--- /dev/null
@@ -0,0 +1,18 @@
+\version "2.10.0"
+
+testMusic =  { << c''4 \\ g'4 >> }
+
+#(load-from-path "to-xml.scm")
+
+#(ly:progress "\nXML:\n\n~A\n"
+  (call-with-output-string
+   (lambda (p) (music-to-xml testMusic p))))
+
+\header {
+  texidoc =
+  "The input representation is generic, and may be translated to XML. "
+}
+
+
+{ \testMusic }
+
diff --git a/input/regression/tuplet-nest-beam.ly b/input/regression/tuplet-nest-beam.ly
new file mode 100644 (file)
index 0000000..d7dc560
--- /dev/null
@@ -0,0 +1,17 @@
+\header {
+
+  texidoc = "Nested tuplets do collision resolution, also when they
+  span beams."
+  
+}
+
+\version "2.10.8"
+\paper{
+  ragged-right=##t
+}
+
+{
+  \times 4/7 {
+    \times 4/5 { c'8 d' e' f' g' } a' b' c''
+  }
+}
diff --git a/input/regression/warn-conflicting-key-signatures.ly b/input/regression/warn-conflicting-key-signatures.ly
new file mode 100644 (file)
index 0000000..4b9756e
--- /dev/null
@@ -0,0 +1,11 @@
+\version "2.10.0"
+%If you specify two different key sigs at one point, a
+%warning is printed.
+
+\score { 
+\context Voice <<
+ { \key cis \major cis4 \key bes \major bes4 }
+ { \key cis \major fis4 \key es \major g4 }  
+>>
+}
+
index 525c5a776b27d2ed3d41e196da0d87a0910acdba..a74b0baa8b94229ec85a632cc172631acbed73d3 100644 (file)
@@ -12,20 +12,16 @@ compound time.
 
 \layout{ragged-right = ##t}
 
-#(define (compound-time grob one two num)
-  (interpret-markup
-   (ly:grob-layout grob)
-   '(((baseline-skip . 2)
-      (word-space . 2)
-      (font-family . number)))
-   (markup
-    #:line ( #:column (one num) #:lower 1 "+" #:column (two num)))))
+#(define (compound-time one two num)
+  (markup #:override '(baseline-skip . 0) #:number 
+   (#:line ((#:column (one num)) #:vcenter "+" (#:column (two num))))))
+
 
 \relative {
   %% compound time signature hack
   \time 5/8
-  \override Staff.TimeSignature  #'stencil
-  = #(lambda (grob) (compound-time grob "2" "3" "8"))
+  \override Staff.TimeSignature #'stencil = #ly:text-interface::print
+  \override Staff.TimeSignature #'text = #(compound-time "2" "3" "8" )
   #(override-auto-beam-setting '(end 1 8 5 8) 1 4)
   c8 c c8 c c
 }
index 53dd69cc1a5b9dfe57f946a852ab49cda8ea57d1..549df765c8a3c4b924648b5edcfc79b0c0f46ff8 100644 (file)
@@ -112,6 +112,20 @@ pitchnames = \makamPitchNames
   ragged-right = ##t
 }
 
+
+makamGlyphs = #'((1 . "accidentals.doublesharp")
+       (8/9 . "accidentals.sharp.slashslashslash.stemstem")
+       (5/9 . "accidentals.sharp.slashslashslash.stem")
+       (4/9 . "accidentals.sharp")
+       (1/9 . "accidentals.sharp.slashslash.stem")
+       (0 . "accidentals.natural")
+       (-1/9 . "accidentals.mirroredflat")
+       (-4/9 . "accidentals.flat.slash")
+       (-5/9 . "accidentals.flat")
+       (-8/9 . "accidentals.flat.slashslash")
+       (-1 . "accidentals.flatflat")
+       )
+
 \relative {
 
   %{ define alteration <-> symbol mapping. The following glyphs are available.
@@ -133,21 +147,12 @@ pitchnames = \makamPitchNames
 
   %}
 
+  \override Accidental #'glyph-name-alist =  \makamGlyphs
   
-  \override Accidental #'glyph-name-alist = #'((1 . "accidentals.doublesharp")
-       (8/9 . "accidentals.sharp.slashslashslash.stemstem")
-       (5/9 . "accidentals.sharp.slashslashslash.stem")
-       (4/9 . "accidentals.sharp")
-       (1/9 . "accidentals.sharp.slashslash.stem")
-       (0 . "accidentals.natural")
-       (-1/9 . "accidentals.mirroredflat")
-       (-4/9 . "accidentals.flat.slash")
-       (-5/9 . "accidentals.flat")
-       (-8/9 . "accidentals.flat.slashslash")
-       (-1 . "accidentals.flatflat")
-       )
-
-  
+  \override Staff.KeySignature #'glyph-name-alist = \makamGlyphs
+  \set Staff.keySignature =  #'(
+    (3 .  4/9)
+    (6 . -1/9))
   
   c cc db fk gbm gfc gfb efk dfbm
 }
index 61b0a60e6f988f741160882a2a2037db7070ed81..bc100e77bc39b7e967e1c3f880e8c0058a06ee53 100644 (file)
@@ -104,37 +104,12 @@ All_font_metrics::find_pango_font (PangoFontDescription *description,
 
 #endif
 
-string
-kpathsea_find_file (string name, string ext)
-{
-  name += "." + ext;
-  string path = global_path.find (name);
-  if (path.length () > 0)
-    return path;
-
-  static SCM proc;
-  if (!proc)
-    {
-      SCM module = scm_c_resolve_module ("scm kpathsea");
-      proc = scm_c_module_lookup (module, "ly:kpathsea-find-file");
-      proc = scm_variable_ref (proc);
-    }
-
-  if (ly_is_procedure (proc))
-    {
-      SCM kp_result = scm_call_1 (proc, scm_makfrom0str (name.c_str ()));
-      if (scm_is_string (kp_result))
-       return ly_scm2string (kp_result);
-    }
-
-  return "";
-}
 
 Open_type_font *
 All_font_metrics::find_otf (string name)
 {
   SCM sname = ly_symbol2scm (name.c_str ());
-  SCM name_string = scm_makfrom0str (name.c_str ());
+  SCM name_string = ly_string2scm (name);
   SCM val;
   if (!otf_dict_->try_retrieve (sname, &val))
     {
index 1e6da083bc1d13ae654c0858d5a06aa1cd5b4a3c..b733ef615ecebae0339225a03c2a9ec5b2d4251f 100644 (file)
@@ -24,7 +24,7 @@ Ambitus::print (SCM smob)
   Item *me = (Item *) unsmob_grob (smob);
   Stencil stencil;
 
-  // join heads
+  // FIXME : should be Ambitus_line join heads
   extract_grob_set (me, "note-heads", heads);
   if (to_boolean (me->get_property ("join-heads"))
       && heads.size () > 1)
index 48766e7e5245573324613f59e929431db0a4f31e..af6eae454a244ee1ac886e16a7be63bacf19a8d6 100644 (file)
@@ -427,5 +427,11 @@ ADD_TRANSLATOR (Auto_beam_engraver,
                "@ref{Stem_engraver} properties @code{stemLeftBeamCount} and "
                "@code{stemRightBeamCount}. ",
                /* create */ "Beam",
-               /* read */ "autoBeaming autoBeamSettings beatLength subdivideBeams",
+
+               /* read */
+               "autoBeaming "
+               "autoBeamSettings "
+               "beatLength "
+               "subdivideBeams ",
+               
                /* write */ "");
index 4319bb8b92cd0594311142bed40928dddeec28ae..3f4da03c93336f55d3a9c0c2236a26a40a8a8e93 100644 (file)
@@ -245,11 +245,11 @@ Axis_group_interface::pure_group_height (Grob *me, int start, int end)
       extract_grob_set (me, "elements", elts);
 
       vector<Grob*> relevant_elts;
-      SCM is_relevant = ly_lily_module_constant ("pure-relevant");
+      SCM pure_relevant_p = ly_lily_module_constant ("pure-relevant?");
 
       for (vsize i = 0; i < elts.size (); i++)
        {
-         if (to_boolean (scm_apply_1 (is_relevant, elts[i]->self_scm (), SCM_EOL)))
+         if (to_boolean (scm_apply_1 (pure_relevant_p, elts[i]->self_scm (), SCM_EOL)))
            relevant_elts.push_back (elts[i]);
 
          Item *it = dynamic_cast<Item*> (elts[i]);
@@ -258,7 +258,7 @@ Axis_group_interface::pure_group_height (Grob *me, int start, int end)
            do
              {
                Item *piece = it->find_prebroken_piece (d);
-               if (piece && to_boolean (scm_apply_1 (is_relevant, piece->self_scm (), SCM_EOL)))
+               if (piece && to_boolean (scm_apply_1 (pure_relevant_p, piece->self_scm (), SCM_EOL)))
                  relevant_elts.push_back (piece);
              }
            while (flip (&d) != LEFT);
index a37005c17ca35e57d9a59e4cc9f2b73e5aebc9e3..2b88e0807ac55a13af98475e17f29028188560e3 100644 (file)
@@ -106,7 +106,7 @@ Beam::calc_concaveness (SCM smob)
     }
 
   if (stems.size () <= 2)
-    return SCM_UNSPECIFIED;
+    return scm_from_int (0);
 
   vector<int> close_positions;
   vector<int> far_positions;
index e150a51594d3b0a4c8119f780769abac28e76254..0338ecd7ecccc6b1caccfa26f0905385790ed06e 100644 (file)
@@ -37,15 +37,17 @@ Beam_quant_parameters::fill (Grob *him)
 {
   SCM details = him->get_property ("details");
 
+  /*
+    TODO: put in define-grobs.scm
+   */
   INTER_QUANT_PENALTY = get_detail (details, ly_symbol2scm ("inter-quant-penalty"), 1000.0);
   SECONDARY_BEAM_DEMERIT = get_detail (details, ly_symbol2scm ("secondary-beam-demerit"), 10.0);
   STEM_LENGTH_DEMERIT_FACTOR = get_detail (details, ly_symbol2scm ("stem-length-demerit-factor"), 5);
   REGION_SIZE = get_detail (details, ly_symbol2scm ("region-size"), 2);
   BEAM_EPS = get_detail (details, ly_symbol2scm ("beam-eps"), 1e-3);
-
-  // possibly ridiculous, but too short stems just won't do
   STEM_LENGTH_LIMIT_PENALTY = get_detail (details, ly_symbol2scm ("stem-length-limit-penalty"), 5000);
   DAMPING_DIRECTION_PENALTY = get_detail (details, ly_symbol2scm ("damping-direction-penalty"), 800);
+  HINT_DIRECTION_PENALTY = get_detail (details, ly_symbol2scm ("hint-direction-penalty"), 20);
   MUSICAL_DIRECTION_FACTOR = get_detail (details, ly_symbol2scm ("musical-direction-factor"), 400);
   IDEAL_SLOPE_FACTOR = get_detail (details, ly_symbol2scm ("ideal-slope-factor"), 10);
   ROUND_TO_ZERO_SLOPE = get_detail (details, ly_symbol2scm ("round-to-zero-slope"), 0.02);
@@ -152,8 +154,8 @@ Beam::quanting (SCM smob, SCM posns)
   for (int a = 2; a--;)
     common[a] = common_refpoint_of_array (stems, me, Axis (a));
 
-  Grob *fvs = first_visible_stem (me);
-  Grob *lvs = last_visible_stem (me);
+  Grob *fvs = first_normal_stem (me);
+  Grob *lvs = last_normal_stem (me);
   Real xl = fvs ? fvs->relative_coordinate (common[X_AXIS], X_AXIS) : 0.0;
   Real xr = fvs ? lvs->relative_coordinate (common[X_AXIS], X_AXIS) : 0.0;
 
@@ -321,7 +323,7 @@ Beam::quanting (SCM smob, SCM posns)
 
       // debug quanting
       me->set_property ("quant-score",
-                       scm_makfrom0str (qscores[best_idx].score_card_.c_str ()));
+                       ly_string2scm (qscores[best_idx].score_card_));
     }
 #endif
 
@@ -401,10 +403,19 @@ Beam::score_slopes_dy (Real yl, Real yr,
     TODO: find a way to incorporate the complexity of the beam in this
     penalty.
   */
-  if (fabs (dy / dx) > parameters->ROUND_TO_ZERO_SLOPE
-      && sign (dy_damp) != sign (dy))
-    dem += parameters->DAMPING_DIRECTION_PENALTY;
-
+  if (sign (dy_damp) != sign (dy))
+    {
+      if (!dy)
+       {
+         if (fabs (dy_damp / dx) > parameters->ROUND_TO_ZERO_SLOPE)
+           dem += parameters->DAMPING_DIRECTION_PENALTY;
+         else
+           dem += parameters->HINT_DIRECTION_PENALTY;
+       }
+      else
+       dem += parameters->DAMPING_DIRECTION_PENALTY;
+    }
+  
   dem += parameters->MUSICAL_DIRECTION_FACTOR
     * max (0.0, (fabs (dy) - fabs (dy_mus)));
 
index a2e7a3cb9214a5ceecd79c0406f790049d50dba6..ba6dc277e9c87c8c163f6e07e3c0d3e9bfac84dc 100644 (file)
@@ -41,6 +41,7 @@
 #include "staff-symbol-referencer.hh"
 #include "stem.hh"
 #include "warn.hh"
+#include "grob-array.hh"
 
 #if DEBUG_BEAM_SCORING
 #include "text-interface.hh" // debug output.
@@ -119,6 +120,21 @@ Beam::get_beam_count (Grob *me)
   return m;
 }
 
+MAKE_SCHEME_CALLBACK (Beam, calc_normal_stems, 1);
+SCM
+Beam::calc_normal_stems (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  
+  extract_grob_set (me, "stems", stems);
+  SCM val = Grob_array::make_array ();
+  Grob_array *ga = unsmob_grob_array (val);
+  for (vsize i = 0; i < stems.size ();  i++)
+    if (Stem::is_normal_stem (stems[i]))
+      ga->add (stems[i]);
+  
+  return val;  
+}
 
 MAKE_SCHEME_CALLBACK (Beam, calc_direction, 1);
 SCM
@@ -135,7 +151,7 @@ Beam::calc_direction (SCM smob)
 
   Direction dir = CENTER;
 
-  int count = visible_stem_count (me);
+  int count = normal_stem_count (me);
   if (count < 2)
     {
       extract_grob_set (me, "stems", stems);
@@ -148,7 +164,7 @@ Beam::calc_direction (SCM smob)
        }
       else 
        {
-         Grob *stem = first_visible_stem (me);
+         Grob *stem = first_normal_stem (me);
 
          /*
            ugh: stems[0] case happens for chord tremolo.
@@ -265,6 +281,9 @@ Beam::calc_beaming (SCM smob)
        }
       else
        {
+         /*
+           FIXME: what's this for? 
+          */
          SCM s = scm_cdr (this_beaming);
          for (; scm_is_pair (s); s = scm_cdr (s))
            {
@@ -460,10 +479,10 @@ Beam::print (SCM grob)
   vector<Beam_segment> segments = get_beam_segments (me, &commonx);
 
   Interval span;
-  if (visible_stem_count (me))
+  if (normal_stem_count (me))
     {
-      span[LEFT] = first_visible_stem (me)->relative_coordinate (commonx, X_AXIS);
-      span[RIGHT] = last_visible_stem (me)->relative_coordinate (commonx, X_AXIS);
+      span[LEFT] = first_normal_stem (me)->relative_coordinate (commonx, X_AXIS);
+      span[RIGHT] = last_normal_stem (me)->relative_coordinate (commonx, X_AXIS);
     }
   else
     {
@@ -654,7 +673,7 @@ Beam::consider_auto_knees (Grob *me)
 
   gaps.set_full ();
 
-  extract_grob_set (me, "stems", stems);
+  extract_grob_set (me, "normal-stems", stems);
 
   Grob *common = common_refpoint_of_array (stems, me, Y_AXIS);
   Real staff_space = Staff_symbol_referencer::staff_space (me);
@@ -663,8 +682,6 @@ Beam::consider_auto_knees (Grob *me)
   for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *stem = stems[i];
-      if (Stem::is_invisible (stem))
-       continue;
 
       Interval head_extents = Stem::head_positions (stem);
       if (!head_extents.is_empty ())
@@ -724,9 +741,6 @@ Beam::consider_auto_knees (Grob *me)
       for (vsize i = 0; i < stems.size (); i++)
        {
          Grob *stem = stems[i];
-         if (Stem::is_invisible (stem))
-           continue;
-
          Interval head_extents = head_extents_array[j++];
 
          Direction d = (head_extents.center () < max_gap.center ())
@@ -789,7 +803,7 @@ Beam::calc_stem_shorten (SCM smob)
     return scm_from_int (0);
 
   Real forced_fraction = 1.0 * forced_stem_count (me)
-    / visible_stem_count (me);
+    / normal_stem_count (me);
 
   int beam_count = get_beam_count (me);
 
@@ -825,27 +839,27 @@ Beam::calc_least_squares_positions (SCM smob, SCM posns)
   
   Grob *me = unsmob_grob (smob);
 
-  int count = visible_stem_count (me);
+  int count = normal_stem_count (me);
   Interval pos (0,0);
   if (count < 1)
     return ly_interval2scm (pos);
 
   vector<Real> x_posns;
-  extract_grob_set (me, "stems", stems);
+  extract_grob_set (me, "normal-stems", stems);
   Grob *commonx = common_refpoint_of_array (stems, me, X_AXIS);
   Grob *commony = common_refpoint_of_array (stems, me, Y_AXIS);
 
   Real my_y = me->relative_coordinate (commony, Y_AXIS);
 
-  Grob *fvs = first_visible_stem (me);
-  Grob *lvs = last_visible_stem (me);
+  Grob *fvs = first_normal_stem (me);
+  Grob *lvs = last_normal_stem (me);
 
   Interval ideal (Stem::get_stem_info (fvs).ideal_y_
                  + fvs->relative_coordinate (commony, Y_AXIS) - my_y,
                  Stem::get_stem_info (lvs).ideal_y_
                  + lvs->relative_coordinate (commony, Y_AXIS) - my_y);
 
-  Real x0 = first_visible_stem (me)->relative_coordinate (commonx, X_AXIS);
+  Real x0 = first_normal_stem (me)->relative_coordinate (commonx, X_AXIS);
   for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *s = stems[i];
@@ -853,7 +867,7 @@ Beam::calc_least_squares_positions (SCM smob, SCM posns)
       Real x = s->relative_coordinate (commonx, X_AXIS) - x0;
       x_posns.push_back (x);
     }
-  Real dx = last_visible_stem (me)->relative_coordinate (commonx, X_AXIS) - x0;
+  Real dx = last_normal_stem (me)->relative_coordinate (commonx, X_AXIS) - x0;
 
   Real y = 0;
   Real slope = 0;
@@ -861,8 +875,8 @@ Beam::calc_least_squares_positions (SCM smob, SCM posns)
   Real ldy = 0.0;
   if (!ideal.delta ())
     {
-      Interval chord (Stem::chord_start_y (first_visible_stem (me)),
-                     Stem::chord_start_y (last_visible_stem (me)));
+      Interval chord (Stem::chord_start_y (stems[0]),
+                     Stem::chord_start_y (stems.back ()));
 
       /* Simple beams (2 stems) on middle line should be allowed to be
         slightly sloped.
@@ -894,9 +908,6 @@ Beam::calc_least_squares_positions (SCM smob, SCM posns)
       for (vsize i = 0; i < stems.size (); i++)
        {
          Grob *s = stems[i];
-         if (!Stem::is_normal_stem (s))
-           continue;
-
          ideals.push_back (Offset (x_posns[i],
                               Stem::get_stem_info (s).ideal_y_
                               + s->relative_coordinate (commony, Y_AXIS)
@@ -942,7 +953,7 @@ Beam::shift_region_to_valid (SCM grob, SCM posns)
   Grob *commonx = common_refpoint_of_array (stems, me, X_AXIS);
   Grob *commony = common_refpoint_of_array (stems, me, Y_AXIS);
 
-  Grob *fvs = first_visible_stem (me);
+  Grob *fvs = first_normal_stem (me);
 
   if (!fvs)
     return posns;
@@ -956,7 +967,7 @@ Beam::shift_region_to_valid (SCM grob, SCM posns)
       x_posns.push_back (x);
     }
 
-  Grob *lvs = last_visible_stem (me);
+  Grob *lvs = last_normal_stem (me);
   if (!lvs)
     return posns;
 
@@ -1033,7 +1044,7 @@ Beam::slope_damping (SCM smob, SCM posns)
   Grob *me = unsmob_grob (smob);
   Drul_array<Real> pos = ly_scm2interval (posns);
 
-  if (visible_stem_count (me) <= 1)
+  if (normal_stem_count (me) <= 1)
     return posns;
 
   
@@ -1053,13 +1064,13 @@ Beam::slope_damping (SCM smob, SCM posns)
 
       Real dy = pos[RIGHT] - pos[LEFT];
 
-      Grob *fvs = first_visible_stem (me);
-      Grob *lvs = last_visible_stem (me);
+      Grob *fvs = first_normal_stem (me);
+      Grob *lvs = last_normal_stem (me);
 
       Grob *commonx = fvs->common_refpoint (lvs, X_AXIS);
 
-      Real dx = last_visible_stem (me)->relative_coordinate (commonx, X_AXIS)
-       - first_visible_stem (me)->relative_coordinate (commonx, X_AXIS);
+      Real dx = last_normal_stem (me)->relative_coordinate (commonx, X_AXIS)
+       - first_normal_stem (me)->relative_coordinate (commonx, X_AXIS);
 
       Real slope = dy && dx ? dy / dx : 0;
 
@@ -1173,8 +1184,8 @@ Beam::set_stem_lengths (SCM smob)
       thick = get_thickness (me);
     }
 
-  Grob *fvs = first_visible_stem (me);
-  Grob *lvs = last_visible_stem (me);
+  Grob *fvs = first_normal_stem (me);
+  Grob *lvs = last_normal_stem (me);
 
   Real xl = fvs ? fvs->relative_coordinate (common[X_AXIS], X_AXIS) : 0.0;
   Real xr = lvs ? lvs->relative_coordinate (common[X_AXIS], X_AXIS) : 0.0;
@@ -1246,16 +1257,13 @@ Beam::set_beaming (Grob *me, Beaming_pattern const *beaming)
 int
 Beam::forced_stem_count (Grob *me)
 {
-  extract_grob_set (me, "stems", stems);
+  extract_grob_set (me, "normal-stems", stems);
 
   int f = 0;
   for (vsize i = 0; i < stems.size (); i++)
     {
       Grob *s = stems[i];
 
-      if (Stem::is_invisible (s))
-       continue;
-
       /* I can imagine counting those boundaries as a half forced stem,
         but let's count them full for now. */
       Direction defdir = to_dir (s->get_property ("default-direction"));
@@ -1269,42 +1277,24 @@ Beam::forced_stem_count (Grob *me)
 }
 
 int
-Beam::visible_stem_count (Grob *me)
+Beam::normal_stem_count (Grob *me)
 {
-  extract_grob_set (me, "stems", stems);
-  int c = 0;
-  for (vsize i = stems.size (); i--;)
-    {
-      if (!Stem::is_invisible (stems[i]))
-       c++;
-    }
-  return c;
+  extract_grob_set (me, "normal-stems", stems);
+  return stems.size ();
 }
 
 Grob *
-Beam::first_visible_stem (Grob *me)
+Beam::first_normal_stem (Grob *me)
 {
-  extract_grob_set (me, "stems", stems);
-
-  for (vsize i = 0; i < stems.size (); i++)
-    {
-      if (Stem::is_normal_stem (stems[i]))
-       return stems[i];
-    }
-  return 0;
+  extract_grob_set (me, "normal-stems", stems);
+  return stems.size () ? stems[0] : 0;
 }
 
 Grob *
-Beam::last_visible_stem (Grob *me)
+Beam::last_normal_stem (Grob *me)
 {
-  extract_grob_set (me, "stems", stems);
-
-  for (vsize i = stems.size (); i--;)
-    {
-      if (Stem::is_normal_stem (stems[i]))
-       return stems[i];
-    }
-  return 0;
+  extract_grob_set (me, "normal-stems", stems);
+  return stems.size () ? stems.back () : 0;
 }
 
 /*
@@ -1334,7 +1324,7 @@ Beam::rest_collision_callback (SCM smob, SCM prev_offset)
   Grob *beam = unsmob_grob (stem->get_object ("beam"));
   if (!beam
       || !Beam::has_interface (beam)
-      || !Beam::visible_stem_count (beam))
+      || !Beam::normal_stem_count (beam))
     return scm_from_double (0.0);
 
   Drul_array<Real> pos (robust_scm2drul (beam->get_property ("positions"),
@@ -1346,8 +1336,8 @@ Beam::rest_collision_callback (SCM smob, SCM prev_offset)
 
   Real dy = pos[RIGHT] - pos[LEFT];
 
-  Drul_array<Grob*> visible_stems (first_visible_stem (beam),
-                                  last_visible_stem (beam));
+  Drul_array<Grob*> visible_stems (first_normal_stem (beam),
+                                  last_normal_stem (beam));
   extract_grob_set (beam, "stems", stems);
   
   Grob *common = common_refpoint_of_array (stems, beam, X_AXIS);
@@ -1477,6 +1467,7 @@ ADD_INTERFACE (Beam,
               "length-fraction "
               "least-squares-dy "
               "neutral-direction "
+              "normal-stems "
               "positions "
               "quant-score "
               "quantized-positions "
index 77f3949992cbf1fb6eaa380245d190aa3da3ec47..3da46abe0f31ba67830cd5e6c99a2b2ecf60aa62 100644 (file)
@@ -14,21 +14,6 @@ Real binomial_coefficient_3[] = {
   1, 3, 3, 1
 };
 
-Real
-binomial_coefficient (Real over, int under)
-{
-  Real x = 1.0;
-
-  while (under)
-    {
-      x *= over / Real (under);
-
-      over -= 1.0;
-      under--;
-    }
-  return x;
-}
-
 void
 scale (vector<Offset> *array, Real x, Real y)
 {
index 750917187f65a86612d86fe0d21b2959010be73e..23d728edf202b2e50f21a143ff999bd3c7a933a0 100644 (file)
@@ -64,3 +64,33 @@ LY_DEFINE (ly_parser_print_book, "ly:book-process",
   return SCM_UNSPECIFIED;
 }
 
+
+LY_DEFINE (ly_parser_print_book_to_systems, "ly:book-process-to-systems",
+          4, 0, 0, (SCM book_smob,
+                    SCM default_paper,
+                    SCM default_layout,
+                    SCM output),
+          "Print book. @var{output} is passed to the backend unchanged. "
+          "Eg. it may be "
+          "a string (for file based outputs) or a socket (for network based "
+          "output).")
+{
+  Book *book = unsmob_book (book_smob);
+
+  SCM_ASSERT_TYPE (book, book_smob, SCM_ARG1, __FUNCTION__, "Book");
+  SCM_ASSERT_TYPE (unsmob_output_def (default_paper),
+                  default_layout, SCM_ARG2, __FUNCTION__, "\\paper block");
+  SCM_ASSERT_TYPE (unsmob_output_def (default_layout),
+                  default_layout, SCM_ARG3, __FUNCTION__, "\\layout block");
+
+  Paper_book *pb = book->process (unsmob_output_def (default_paper),
+                                 unsmob_output_def (default_layout));
+  if (pb)
+    {
+      pb->classic_output (output);
+      pb->unprotect ();
+    }
+
+  return SCM_UNSPECIFIED;
+}
+
index 37eae382978e3d53ea8dddc6ef7724f6f2ffcce7..893653041e2635ac2360ff2d2b8797b75e6566d2 100644 (file)
 #include "warn.hh"
 
 
-MAKE_SCHEME_CALLBACK (Break_alignment_interface, self_align_callback, 1);
-SCM
-Break_alignment_interface::self_align_callback (SCM smob)
-{
-  Grob *me = unsmob_grob (smob);
-
-  Item *item = dynamic_cast<Item *> (me);
-  Direction bsd = item->break_status_dir ();
-  if (bsd == LEFT)
-    me->set_property ("self-alignment-X", scm_from_int (RIGHT));
-
-  /*
-    Force break alignment itself to be done first, in the case
-  */
-  return Self_alignment_interface::aligned_on_self (me, X_AXIS);
-}
 
 /*
   This is tricky: we cannot modify 'elements, since callers are
index 45ddbc443d65121fc4b1b7fcadf009fb67fef568..1a785b9c4d379508699885b11ac0967cff8f3377 100644 (file)
@@ -29,7 +29,9 @@ Chord_tremolo_iterator::get_music_list () const
 
   int elt_count = body_is_sequential ? scm_ilength (body->get_property ("elements")) : 1;
 
-  if (body_is_sequential && elt_count != 2)
+  if (body_is_sequential &&
+      (elt_count != 2
+       && elt_count != 1))
     mus->origin ()->warning (_f ("expect 2 elements for chord tremolo, found %d", elt_count));
 
   if (elt_count <= 0)
index 36427055f525f4522af68132732fba502de4edc5..5cd041bfaeab5cefa92a5b2a742b2f9e4f0713eb 100644 (file)
@@ -31,7 +31,7 @@ Clef::calc_glyph_name (SCM smob)
          str += "_change";
        }
 
-      return scm_makfrom0str (str.c_str ());
+      return ly_string2scm (str);
     }
 
   s->suicide ();
index 90c2adcf5054a15f9f8151e878ec8220590890ca..2c41b9a1749e05e3ae7b0257f7e83954bd4845ca 100644 (file)
@@ -164,32 +164,22 @@ Cluster::print (SCM smob)
   /*
     Across a line break we anticipate on the next pitches.
   */
-  if (spanner->original ())
+  if (Spanner *next = spanner->broken_neighbor (RIGHT))
     {
-      Spanner *orig = dynamic_cast<Spanner *> (spanner->original ());
-
-      if (spanner->get_break_index () < orig->broken_intos_.size () - 1)
+      extract_grob_set (next, "columns", next_cols);
+      if (next_cols.size () > 0)
        {
-         Spanner *next = orig->broken_intos_[spanner->get_break_index () + 1];
-         vector<Grob*> const &next_cols = extract_grob_array (next, "columns");
-         if (next_cols.size () > 0)
-           {
-             Grob *next_commony = common_refpoint_of_array (next_cols, next, Y_AXIS);
-             Grob *col = next_cols[0];
-
-             Interval v = col->extent (next_commony, Y_AXIS);
-             Real x = right_bound->relative_coordinate (commonx, X_AXIS) - left_coord;
-
-             bottom_points.insert (bottom_points.begin (),
-                                   Offset (x, v[DOWN]));
-             top_points.insert (top_points.begin (), Offset (x, v[UP]));
-           }
+         Grob *next_commony = common_refpoint_of_array (next_cols, next, Y_AXIS);
+         Grob *col = next_cols[0];
+
+         Interval v = col->extent (next_commony, Y_AXIS);
+         Real x = right_bound->relative_coordinate (commonx, X_AXIS) - left_coord;
+
+         bottom_points.push_back (Offset (x, v[DOWN]));
+         top_points.push_back (Offset (x, v[UP]));
        }
     }
 
-  reverse (bottom_points);
-  reverse (top_points);
-
   Stencil out = brew_cluster_piece (me, bottom_points, top_points);
   out.translate_axis (- me->relative_coordinate (commony, Y_AXIS), Y_AXIS);
   return out.smobbed_copy ();
@@ -203,9 +193,12 @@ ADD_INTERFACE (Cluster,
               "The property @code{style} controls the shape of cluster segments.  Valid values "
               "include @code{leftsided-stairs}, @code{rightsided-stairs}, @code{centered-stairs}, "
               "and @code{ramp}.\n",
+
+              /* props */
               "style "
               "padding "
-              "columns ");
+              "columns "
+              );
 
 struct Cluster_beacon
 {
index 9827c8bd417161bb65539c9ec46b249a35598e5b..825a77112eaab40c6945894b48fa9a803145db8e 100644 (file)
@@ -20,7 +20,7 @@ LY_DEFINE (ly_context_id, "ly:context-id",
   Context *tr = unsmob_context (context);
   SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
 
-  return scm_makfrom0str (tr->id_string ().c_str ());
+  return ly_string2scm (tr->id_string ());
 }
 
 LY_DEFINE (ly_context_name, "ly:context-name",
index 45a1562b1f98a6d255c7da7d2af73f065744d66b..9d10d5378fd2c875c6dc24387ad238d7edc3d185 100644 (file)
@@ -337,7 +337,7 @@ Context::create_context (Context_def *cdef,
   send_stream_event (this, "CreateContext", 0,
                      ly_symbol2scm ("ops"), ops,
                      ly_symbol2scm ("type"), cdef->get_context_name (),
-                     ly_symbol2scm ("id"), scm_makfrom0str (id.c_str ()));
+                     ly_symbol2scm ("id"), ly_string2scm (id));
   event_source_->
     remove_listener (GET_LISTENER (acknowledge_infant),
                      ly_symbol2scm ("AnnounceNewContext"));
index 361036256d3642d70328db3614eda2f471f43615..de8646e85879a5e5fdd18057e172318ee8c56116 100644 (file)
@@ -121,6 +121,14 @@ LY_DEFINE (ly_duration_length, "ly:duration-length",
   return Moment (unsmob_duration (dur)->get_length ()).smobbed_copy ();
 }
 
+LY_DEFINE (ly_duration2string, "ly:duration->string",
+          1, 0, 0, (SCM dur),
+          "Convert @var{dur} to string.")
+{
+  SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
+  return ly_string2scm (unsmob_duration (dur)->to_string ());
+}
+
 LY_DEFINE (ly_duration_factor, "ly:duration-factor",
           1, 0, 0, (SCM dur),
           "Extract the compression factor from @var{dur}. Return as a pair.")
index 413ac889ec497e7447b5e443c8e783b3704513dd..8020cd42d4a161e33de1bd597e9ff06ee50d4de2 100644 (file)
@@ -91,7 +91,7 @@ Duration::print_smob (SCM s, SCM port, scm_print_state *)
   Duration *r = (Duration *) SCM_CELL_WORD_1 (s);
 
   scm_puts ("#<Duration ", port);
-  scm_display (scm_makfrom0str (r->to_string ().c_str ()), port);
+  scm_display (ly_string2scm (r->to_string ()), port);
   scm_puts (" >", port);
 
   return 1;
index 6882939d883904a7744d81809df69adfef1c9b1a..e3d4f095815eec9ad06fe95f6004fbc33beb39ed 100644 (file)
@@ -261,7 +261,7 @@ Dynamic_engraver::process_music ()
              if (scm_is_string (s) || scm_is_pair (s))
                {
                  cresc_->set_property ("edge-text",
-                                       scm_cons (s, scm_makfrom0str ("")));
+                                       scm_cons (s, scm_from_locale_string ("")));
                  context ()->set_property ((start_type + "Text").c_str (),
                                            SCM_EOL);
                }
@@ -390,7 +390,6 @@ Dynamic_engraver::typeset_all ()
     }
 }
 
-
 void
 Dynamic_engraver::acknowledge_accidental (Grob_info info)
 {
@@ -398,7 +397,6 @@ Dynamic_engraver::acknowledge_accidental (Grob_info info)
     Side_position_interface::add_support (line_spanner_, info.grob ());
 }
 
-
 void
 Dynamic_engraver::acknowledge_stem_tremolo (Grob_info info)
 {
@@ -406,7 +404,6 @@ Dynamic_engraver::acknowledge_stem_tremolo (Grob_info info)
     Side_position_interface::add_support (line_spanner_, info.grob ());
 }
 
-
 void
 Dynamic_engraver::acknowledge_slur (Grob_info info)
 {
@@ -414,7 +411,6 @@ Dynamic_engraver::acknowledge_slur (Grob_info info)
     Side_position_interface::add_support (line_spanner_, info.grob ());
 }
 
-
 void
 Dynamic_engraver::acknowledge_note_column (Grob_info info)
 {
index 0dd455606095a99c8326f447d3b30b245ede81ab..52939ec2e3c3f288273a1b19f622ab68f1b92025 100644 (file)
@@ -80,7 +80,7 @@ Dynamic_performer::process_music ()
            s = get_property ("instrumentName");
 
          if (!scm_is_string (s))
-           s = scm_makfrom0str ("piano");
+           s = scm_from_locale_string ("piano");
 
          SCM eq = get_property ("instrumentEqualizer");
          if (ly_is_procedure (eq))
index c6ecb0e20f4539a48301f0e959ac96f2240374c4..7931d08e482fb2e9647b53cebbc3a6bed6c63153 100644 (file)
@@ -47,7 +47,7 @@ Note_head::brew_ez_stencil (SCM smob)
       char s[2] = "a";
       s[0] = (pit->get_notename () + 2) % 7 + 'a';
       s[0] = toupper (s[0]);
-      charstr = scm_makfrom0str (s);
+      charstr = scm_from_locale_string (s);
     }
 
   SCM letter
index c8eb805638d4619ba378968f103c815842f162b4..544309138dee5fae3dd88b76202ccfc89e6bb133 100644 (file)
@@ -134,8 +134,8 @@ Engraver::internal_make_grob (SCM symbol, SCM cause, char const *name, char cons
 #ifndef NDEBUG
   if (ly_is_procedure (creation_callback))
     scm_apply_0 (creation_callback,
-                scm_list_n (grob->self_scm (), scm_makfrom0str (file),
-                            scm_from_int (line), scm_makfrom0str (fun), SCM_UNDEFINED));
+                scm_list_n (grob->self_scm (), scm_from_locale_string (file),
+                            scm_from_int (line), scm_from_locale_string (fun), SCM_UNDEFINED));
 #endif
 
   return grob;
index efea867822abf2b12ebab55865b6d5a5b266a2e1..c6998c5dde2c2025b677e250f82cd99d08c7a593 100644 (file)
@@ -98,7 +98,15 @@ Extender_engraver::stop_translation_timestep ()
                                                 ly_symbol2scm ("heads"), h);
            }
        }
-
+      else
+       {
+         if (pending_extender_)
+           {
+             completize_extender (pending_extender_);
+             pending_extender_ = 0;
+           }
+         
+       }
       if (extender_)
        {
          pending_extender_ = extender_;
index 025f7de6edd0590e97f4c8b1853be99424bc626c..d058f780596a9086cc724f02912bda119aa25d53 100644 (file)
@@ -286,7 +286,7 @@ Figured_bass_engraver::add_brackets ()
 void
 Figured_bass_engraver::process_music ()
 {
-  if (!to_boolean (get_property ("useBassFigureExtenders")))
+  if (alignment_ && !to_boolean (get_property ("useBassFigureExtenders")))
     clear_spanners ();
         
   if (rest_event_)
index 482a240c9f0b084f0f9f9486790af1c9be5925d5..351319c6626007b7f773fcd60b14906fde04c396 100644 (file)
@@ -8,13 +8,16 @@
 */
 
 #include "lily-guile.hh"
-#include "std-string.hh"
+#include "string-convert.hh"
+#include "warn.hh"
 
 #include <fontconfig/fontconfig.h>
 
-void
+string
 display_fontset (FcFontSet *fs)
 {
+  string retval;
+  
   int j;
   for (j = 0; j < fs->nfont; j++)
     {
@@ -23,36 +26,42 @@ display_fontset (FcFontSet *fs)
 
       font = FcNameUnparse (fs->fonts[j]);
       if (FcPatternGetString (fs->fonts[j], FC_FILE, 0, &str) == FcResultMatch)
-       printf ("FILE %s\n", str);
+       retval += String_convert::form_string ("FILE %s\n", str);
       if (FcPatternGetString (fs->fonts[j], FC_FAMILY, 0, &str) == FcResultMatch)
-       printf ("family %s\n ", str);
+       retval += String_convert::form_string ("family %s\n ", str);
       if (FcPatternGetString (fs->fonts[j],
                              "designsize", 0, &str) == FcResultMatch)
-       printf ("designsize %s\n ", str);
+       retval += String_convert::form_string ("designsize %s\n ", str);
       
-      printf ("%s\n", (const char*) font);
+      retval += String_convert::form_string ("%s\n", (const char*) font);
       free (font);
     }
+  
+  return retval;
 }
 
-void
+string
 display_strlist (char const*what, FcStrList *slist)
 {
+  string retval;
   while (FcChar8 *dir = FcStrListNext (slist))
     {
-      printf("%s: %s\n", what, dir);
+      retval += String_convert::form_string ("%s: %s\n", what, dir);
     }
+  return retval;
 }
 
-void
+string
 display_config (FcConfig *fcc)
 {
-  display_strlist ("Config files", FcConfigGetConfigFiles(fcc));
-  display_strlist ("Config dir", FcConfigGetConfigDirs(fcc));
-  display_strlist ("Font dir", FcConfigGetFontDirs(fcc));
+  string retval;
+  retval += display_strlist ("Config files", FcConfigGetConfigFiles(fcc));
+  retval +=  display_strlist ("Config dir", FcConfigGetConfigDirs(fcc));
+  retval +=  display_strlist ("Font dir", FcConfigGetFontDirs(fcc));
+  return retval;
 }
 
-void
+string
 display_list (FcConfig *fcc)
 {
   FcPattern*pat = FcPatternCreate ();
@@ -66,11 +75,13 @@ display_list (FcConfig *fcc)
   if (pat)
     FcPatternDestroy (pat);
 
+  string retval;
   if (fs)
     {
-      display_fontset (fs);
+      retval = display_fontset (fs);
       FcFontSetDestroy (fs);
     }
+  return retval;
 }
 
 
@@ -98,7 +109,7 @@ LY_DEFINE (ly_font_config_get_font_file, "ly:font-config-get-font-file", 1, 0, 0
   pat = FcFontMatch(NULL, pat, &result);
   FcChar8 *str = 0;
   if (FcPatternGetString (pat, FC_FILE, 0, &str) == FcResultMatch)
-    scm_result = scm_makfrom0str ((char const*) str);
+    scm_result = scm_from_locale_string ((char const*) str);
 
   FcPatternDestroy (pat);
 
@@ -109,8 +120,10 @@ LY_DEFINE (ly_font_config_display_fonts, "ly:font-config-display-fonts", 0, 0, 0
           (),
           "Dump a list of all fonts visible to FontConfig.")
 {
-  display_list (NULL);
-  display_config (NULL);
+  string str = display_list (NULL);
+  str += display_config (NULL);
+
+  progress_indication (str);
   
   return SCM_UNSPECIFIED;
 }
index d04d1eab8ad8c7213a1cdb3468b2f5310a357bda..319ef80fe8c56f1d194adfc825a41455cb6675c5 100644 (file)
@@ -122,7 +122,7 @@ LY_DEFINE (ly_font_name, "ly:font-name",
   Font_metric *fm = unsmob_metrics (font);
 
   SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
-  return scm_makfrom0str (fm->font_name ().c_str ());
+  return ly_string2scm (fm->font_name ());
 }
 
 LY_DEFINE (ly_font_magnification, "ly:font-magnification", 1, 0, 0,
index 03625cc946b6bd9c405bb157611c82d2a0fbbf41..17c7796ded08812545092920265059ac6705603a 100644 (file)
@@ -40,7 +40,7 @@ Font_metric::find_by_name (string s) const
     {
       expr = scm_list_3 (ly_symbol2scm ("named-glyph"),
                         self_scm (),
-                        scm_makfrom0str (s.c_str ()));
+                        ly_string2scm (s));
       b = get_indexed_char (idx);
     }
 
@@ -187,12 +187,9 @@ Font_metric::word_stencil (string str) const
 Stencil
 Font_metric::text_stencil (string str) const
 {
-  SCM lst = scm_list_3 (ly_symbol2scm ("text"),
-                       this->self_scm (),
-                       scm_makfrom0str (str.c_str ()));
-
-  Box b = text_dimension (str);
-  return Stencil (b, lst);
+  (void) str;
+  assert (false);
+  return Stencil (Box (), SCM_EOL);
 }
 
 Box
index 5081d7eb58592dc082eabe6af715e3d000225dbc..11b655497f976792dd3611549dc39badd15ba945 100644 (file)
@@ -29,8 +29,8 @@ void ly_add_function_documentation (SCM func,
     + "\n" + doc;
 
   scm_set_procedure_property_x (func, ly_symbol2scm ("documentation"),
-                               scm_makfrom0str (s.c_str ()));
-  SCM entry = scm_cons (scm_makfrom0str (varlist), scm_makfrom0str (doc));
+                               ly_string2scm (s));
+  SCM entry = scm_cons (scm_from_locale_string (varlist), scm_from_locale_string (doc));
   scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname), entry);
 }
 
index 5e161474dc312fbebb1b8c7a5a1e02cbbc999841..dc236aa34ff60c001b860b383757a3e61cd958d8 100644 (file)
@@ -22,6 +22,7 @@ using namespace std;
 #include "dimensions.hh"
 #include "main.hh"
 #include "file-path.hh"
+#include "relocate.hh"
 
 LY_DEFINE (ly_find_file, "ly:find-file",
           1, 0, 0, (SCM name),
@@ -35,7 +36,7 @@ LY_DEFINE (ly_find_file, "ly:find-file",
   if (file_name.empty ())
     return SCM_BOOL_F;
 
-  return scm_makfrom0str (file_name.c_str ());
+  return ly_string2scm (file_name);
 }
 
 /*
@@ -168,7 +169,7 @@ LY_DEFINE (ly_number2string, "ly:number->string",
   else
     snprintf (str, sizeof (str), "%d", int (scm_to_int (s)));
 
-  return scm_makfrom0str (str);
+  return scm_from_locale_string (str);
 }
 
 LY_DEFINE (ly_version, "ly:version", 0, 0, 0, (),
@@ -182,7 +183,7 @@ LY_DEFINE (ly_version, "ly:version", 0, 0, 0, (),
 LY_DEFINE (ly_unit, "ly:unit", 0, 0, 0, (),
           "Return the unit used for lengths as a string.")
 {
-  return scm_makfrom0str (INTERNAL_UNIT);
+  return scm_from_locale_string (INTERNAL_UNIT);
 }
 
 LY_DEFINE (ly_dimension_p, "ly:dimension?", 1, 0, 0, (SCM d),
@@ -208,14 +209,14 @@ LY_DEFINE (ly_gettext, "ly:gettext",
 {
   SCM_ASSERT_TYPE (scm_is_string (string), string, SCM_ARG1,
                   __FUNCTION__, "string");
-  return scm_makfrom0str (_ (scm_i_string_chars (string)).c_str ());
+  return ly_string2scm (_ (scm_i_string_chars (string)));
 }
 
 LY_DEFINE (ly_output_backend, "ly:output-backend",
           0, 0, 0, (),
           "Return name of output backend.")
 {
-  return scm_makfrom0str (output_backend_global.c_str ());
+  return ly_string2scm (output_backend_global);
 }
 
 LY_DEFINE (ly_output_formats, "ly:output-formats",
@@ -228,7 +229,7 @@ LY_DEFINE (ly_output_formats, "ly:output-formats",
   SCM lst = SCM_EOL;
   int output_formats_count = output_formats.size ();
   for (int i = 0; i < output_formats_count; i++)
-    lst = scm_cons (scm_makfrom0str (output_formats[i].c_str ()), lst);
+    lst = scm_cons (ly_string2scm (output_formats[i]), lst);
 
   return lst;
 }
@@ -265,14 +266,14 @@ LY_DEFINE (ly_wchar_to_utf_8, "ly:wide-char->utf-8",
     }
   *p = 0;
 
-  return scm_makfrom0str (buf);
+  return scm_from_locale_string (buf);
 }
 
 LY_DEFINE (ly_effective_prefix, "ly:effective-prefix",
           0, 0, 0, (),
           "Return effective prefix.")
 {
-  return scm_makfrom0str (prefix_directory.c_str ());
+  return ly_string2scm (prefix_directory);
 }
 
 LY_DEFINE (ly_chain_assoc_get, "ly:chain-assoc-get",
@@ -303,6 +304,7 @@ LY_DEFINE (ly_stderr_redirect, "ly:stderr-redirect",
     m = ly_scm2newstr (mode, 0);
   /* dup2 and (fileno (current-error-port)) do not work with mingw'c
      gcc -mwindows.  */
+  fflush (stderr); 
   freopen (ly_scm2newstr (file_name, 0), m, stderr);
   return SCM_UNSPECIFIED;
 }
@@ -339,3 +341,38 @@ LY_DEFINE (ly_camel_case_to_lisp_identifier, "ly:camel-case->lisp-identifier",
 
   return ly_symbol2scm (result.c_str ());
 }
+
+LY_DEFINE (ly_expand_environment, "ly:expand-environment",
+          1, 0, 0, (SCM str),
+          "Expand $VAR and $@{VAR@} in @var{str}.")
+{
+  SCM_ASSERT_TYPE(scm_is_string (str), str,
+                 SCM_ARG1, __FUNCTION__, "string");
+
+  return ly_string2scm (expand_environment_variables (ly_scm2string (str)));
+}
+                
+
+LY_DEFINE (ly_truncate_list_x, "ly:truncate-list!",
+          2, 0, 0, (SCM lst, SCM i),
+          "Take at most the first @var{i} of list @var{lst}")
+{
+  SCM_ASSERT_TYPE(scm_is_integer (i), i,
+                 SCM_ARG1, __FUNCTION__, "integer");
+
+  int k = scm_to_int (i);
+  if (k == 0)
+    lst = SCM_EOL;
+  else
+    {
+      SCM s = lst;
+      k--;
+      for (; scm_is_pair (s) && k--; s = scm_cdr (s))
+       ;
+
+      if (scm_is_pair (s))
+       scm_set_cdr_x (s, SCM_EOL);
+    }
+  return lst;
+}
+
index c47937db0f2737ef292f8a5ffba97583a4b5c73e..278afa84e62eee172ae6763d681abb8eac8b3da2 100644 (file)
@@ -26,7 +26,7 @@ SCM add_interface (char const *cxx_name,
     lispy_name += suffix;
 
   SCM s = ly_symbol2scm (lispy_name.c_str ());
-  SCM d = scm_makfrom0str (descr);
+  SCM d = scm_from_locale_string (descr);
   SCM l = parse_symbol_list (vars);
 
   ly_add_interface (s, d, l);
diff --git a/lily/grob-pitch-tuple.cc b/lily/grob-pitch-tuple.cc
deleted file mode 100644 (file)
index eb72a36..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-  grob-pitch-tuple.cc -- implement Grob_pitch_tuple
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 2001--2006  Han-Wen Nienhuys <hanwen@xs4all.nl>
-*/
-
-#include "grob-pitch-tuple.hh"
-
-#include "music.hh"
-
-int compare (Grob_pitch_tuple const &a, Grob_pitch_tuple const &b)
-{
-  return Grob_pitch_tuple::time_compare (a, b);
-}
-
-Grob_pitch_tuple::Grob_pitch_tuple ()
-{
-  head_ = 0;
-  end_ = 0;
-}
-
-Grob_pitch_tuple::Grob_pitch_tuple (Grob *h, Music *m, Moment mom)
-{
-  head_ = h;
-  pitch_ = *unsmob_pitch (m->get_property ("pitch"));
-  end_ = mom;
-}
-
-/*
-  signed compare, should use pitch<?
-*/
-int
-Grob_pitch_tuple::pitch_compare (Grob_pitch_tuple const &h1,
-                                Grob_pitch_tuple const &h2)
-{
-  return Pitch::compare (h1.pitch_, h2.pitch_);
-}
-
-int
-Grob_pitch_tuple::time_compare (Grob_pitch_tuple const &h1,
-                               Grob_pitch_tuple const &h2)
-{
-  return Moment::compare (h1.end_, h2.end_);
-}
index f1242994d53fb696133cbedfc6e6b2bc1b9336ce..e8e74059ed3b6ca48c0a241b7aa8e566e5130640 100644 (file)
@@ -53,8 +53,8 @@ Grob::get_property_alist_chain (SCM def) const
 
 extern void check_interfaces_for_property (Grob const *me, SCM sym);
 
-void
 #ifndef NDEBUG
+void
 Grob::internal_set_property (SCM sym, SCM v, char const *file, int line, char const *fun)
 {
   SCM grob_p = ly_lily_module_constant ("ly:grob?");
@@ -68,11 +68,32 @@ Grob::internal_set_property (SCM sym, SCM v, char const *file, int line, char co
       scm_display (scm_list_2 (sym, type), scm_current_output_port ());
       assert (0);
     }
+  
+  internal_set_value_on_alist (&mutable_property_alist_,
+                              sym, v);
+
+
+  if (ly_is_procedure (modification_callback))
+    scm_apply_0 (modification_callback,
+                scm_list_n (self_scm (),
+                            scm_from_locale_string (file),
+                            scm_from_int (line),
+                            scm_from_locale_string (fun),
+                            sym, v, SCM_UNDEFINED));
+}
 #else
+void
 Grob::internal_set_property (SCM sym, SCM v)
 {
+  internal_set_value_on_alist (&mutable_property_alist_,
+                              sym, v);
+
+}
 #endif
 
+void
+Grob::internal_set_value_on_alist (SCM *alist, SCM sym, SCM v)
+{
   /* Perhaps we simply do the assq_set, but what the heck. */
   if (!is_live ())
     return;
@@ -87,20 +108,9 @@ Grob::internal_set_property (SCM sym, SCM v)
       check_interfaces_for_property (this, sym);
     }
 
-#ifndef NDEBUG
-  if (ly_is_procedure (modification_callback))
-      scm_apply_0 (modification_callback,
-                  scm_list_n (self_scm (),
-                              scm_makfrom0str (file),
-                              scm_from_int (line),
-                              scm_makfrom0str (fun),
-                              sym, v, SCM_UNDEFINED));
-#endif
-
-  mutable_property_alist_ = scm_assq_set_x (mutable_property_alist_, sym, v);
+  *alist = scm_assq_set_x (*alist, sym, v);
 }
 
-//#define PROFILE_PROPERTY_ACCESSES
 SCM
 Grob::internal_get_property_data (SCM sym) const
 {
@@ -137,7 +147,8 @@ Grob::internal_get_property (SCM sym) const
   if (ly_is_procedure (val)
       || is_simple_closure (val))
     {
-      val = ((Grob*)this)->try_callback (sym, val);
+      Grob *me = ((Grob*)this);
+      val = me->try_callback_on_alist (&me->mutable_property_alist_, sym, val);
     }
   
   return val;
@@ -151,15 +162,14 @@ bool debug_property_callbacks = 0;
 #endif
 
 SCM
-Grob::try_callback (SCM sym, SCM proc)
+Grob::try_callback_on_alist (SCM *alist, SCM sym, SCM proc)
 {      
   SCM marker = ly_symbol2scm ("calculation-in-progress");
   /*
     need to put a value in SYM to ensure that we don't get a
     cyclic call chain.
   */
-  mutable_property_alist_
-    = scm_assq_set_x (mutable_property_alist_, sym, marker);
+  *alist = scm_assq_set_x (*alist, sym, marker);
 
 #ifndef NDEBUG
   if (debug_property_callbacks)
@@ -175,6 +185,7 @@ Grob::try_callback (SCM sym, SCM proc)
                                            simple_closure_expression (proc),
                                            false, 0, 0);
     }
+  
 #ifndef NDEBUG
   if (debug_property_callbacks)
     grob_property_callback_stack = scm_cdr (grob_property_callback_stack);
@@ -188,12 +199,13 @@ Grob::try_callback (SCM sym, SCM proc)
   if (value == SCM_UNSPECIFIED)
     {
       value = internal_get_property (sym);
+      assert (value == SCM_EOL || value == marker);
       if (value == marker)
-       mutable_property_alist_ = scm_assq_remove_x (mutable_property_alist_, marker);
+       *alist = scm_assq_remove_x (*alist, marker);
     }
   else
-    set_property (sym, value);
-         
+    internal_set_value_on_alist (alist, sym, value);
+  
   return value;
 }
 
@@ -216,13 +228,25 @@ Grob::internal_del_property (SCM sym)
 SCM
 Grob::internal_get_object (SCM sym) const
 {
-#ifdef PROFILE_PROPERTY_ACCESSES
-  note_property_access (&grob_property_lookup_table, sym);
-#endif
+  if (profile_property_accesses)
+    note_property_access (&grob_property_lookup_table, sym);
 
   SCM s = scm_sloppy_assq (sym, object_alist_);
+  
+  if (s != SCM_BOOL_F)
+    {
+      SCM val = scm_cdr (s);
+      if (ly_is_procedure (val)
+         || is_simple_closure (val))
+       {
+         Grob *me = ((Grob*)this);
+         val = me->try_callback_on_alist (&me->object_alist_, sym, val);
+       }
+      
+      return val;
+    }
 
-  return (s == SCM_BOOL_F) ? SCM_EOL : scm_cdr (s);
+  return SCM_EOL;
 }
 
 bool
index 139a387989393209390a7704246c87402d0b3295..0591ab115f6cc6ac8ed0ffddb2960141c4e77695 100644 (file)
@@ -59,7 +59,16 @@ Grob::Grob (SCM basicprops,
 
   SCM meta = get_property ("meta");
   if (scm_is_pair (meta))
-    interfaces_ = scm_cdr (scm_assq (ly_symbol2scm ("interfaces"), meta));
+    {
+      interfaces_ = scm_cdr (scm_assq (ly_symbol2scm ("interfaces"), meta));
+
+      SCM object_cbs = scm_assq (ly_symbol2scm ("object-callbacks"), meta);
+      if (scm_is_pair (object_cbs))
+       {
+         for (SCM s = scm_cdr (object_cbs); scm_is_pair (s); s = scm_cdr (s))
+           set_object (scm_caar (s), scm_cdar (s)); 
+       }
+    }
   
   if (get_property_data ("X-extent") == SCM_EOL)
     set_property ("X-extent", Grob::stencil_width_proc);
@@ -633,15 +642,10 @@ ADD_INTERFACE (Grob,
               "transparent "
               );
 
-
-
-
-
 /****************************************************************
   CALLBACKS
 ****************************************************************/
 
-
 static SCM
 grob_stencil_extent (Grob *me, Axis a)
 {
index 77fd7c59f30630ddf4eccc8dc22f9ae0769c399e..e891fc76997332f14b503ca0cc64643e17b0bd08 100644 (file)
@@ -41,7 +41,7 @@ ly_init_ly_module (void *)
       progress_indication ("]\n");
     }
 
-  scm_primitive_load_path (scm_makfrom0str ("lily.scm"));
+  scm_primitive_load_path (scm_from_locale_string ("lily.scm"));
 }
 
 SCM global_lily_module;
index e0916cd99d98c4a0d524155d81fa57bf800b787a..6bb83b16a61fbb3ffaa90a1bb9be03b8e8a29856 100644 (file)
@@ -9,16 +9,15 @@
 #include "hairpin.hh"
 
 #include "dimensions.hh"
-#include "font-interface.hh"
 #include "international.hh"
 #include "line-interface.hh"
-#include "lookup.hh"
 #include "output-def.hh"
 #include "paper-column.hh"
 #include "pointer-group-interface.hh"
 #include "spanner.hh"
 #include "staff-symbol-referencer.hh"
 #include "text-interface.hh"
+#include "note-column.hh"
 #include "warn.hh"
 
 MAKE_SCHEME_CALLBACK (Hairpin, after_line_breaking, 1);
@@ -167,7 +166,12 @@ Hairpin::print (SCM smob)
                }
              else
                {
-                 x_points[d] = e[d];
+                 if (Note_column::has_interface (b)
+                     && Note_column::has_rests (b))
+                   x_points[d] = e[-d];
+                 else
+                   x_points[d] = e[d];
+                 
                  Item *bound = me->get_bound (d);
                  if (bound->is_non_musical (bound))
                    x_points[d] -=  d * padding;
index 90a06f145a9a0b0e7a05d0facf124d689792c2aa..061b4721264a957eb2fdd9337e90ee44ed3bc8dd 100644 (file)
@@ -119,15 +119,6 @@ Hara_kiri_group_spanner::consider_suicide (Grob *me)
   We can't rely on offsets and dimensions of elements in a hara-kiri
   group. Use a callback to make sure that hara-kiri has been done
   before asking for offsets.  */
-MAKE_SCHEME_CALLBACK (Hara_kiri_group_spanner, after_line_breaking, 1);
-SCM
-Hara_kiri_group_spanner::after_line_breaking (SCM smob)
-{
-  Grob *me = unsmob_grob (smob);
-  consider_suicide (me);
-  return SCM_UNSPECIFIED;
-}
-
 MAKE_SCHEME_CALLBACK (Hara_kiri_group_spanner, force_hara_kiri_callback, 1);
 SCM
 Hara_kiri_group_spanner::force_hara_kiri_callback (SCM smob)
index 65bea4d00b25973378509c0978fb8a3530024be3..29b7d9e5f3a025392571f0784ac1e2d3bad77497 100644 (file)
@@ -41,19 +41,12 @@ Includable_lexer::Includable_lexer ()
 #if HAVE_FLEXLEXER_YY_CURRENT_BUFFER
   yy_current_buffer = 0;
 #endif
-  allow_includes_b_ = true;
 }
 
 /** Set the new input file to NAME, remember old file.  */
 void
 Includable_lexer::new_input (string name, Sources *sources)
 {
-  if (!allow_includes_b_)
-    {
-      LexerError (_ ("include files are not allowed in safe mode").c_str ());
-      return;
-    }
-
   Source_file *file = sources->get_file (&name);
   if (!file)
     {
index 67daab8de8d26ea905b48eae3945b9a017797233..f521f180c233376c32eaf160729acc8e046bcfef 100644 (file)
@@ -34,6 +34,7 @@ struct Beam_quant_parameters
   Real STEM_LENGTH_LIMIT_PENALTY;
   Real DAMPING_DIRECTION_PENALTY;
   Real MUSICAL_DIRECTION_FACTOR;
+  Real HINT_DIRECTION_PENALTY;
   Real IDEAL_SLOPE_FACTOR;
   Real ROUND_TO_ZERO_SLOPE;
 
@@ -68,9 +69,9 @@ bool operator <(Beam_stem_segment const &a, Beam_stem_segment const &b);
 class Beam
 {
 public:
-  static int visible_stem_count (Grob *);
-  static Grob *first_visible_stem (Grob *);
-  static Grob *last_visible_stem (Grob *);
+  static int normal_stem_count (Grob *);
+  static Grob *first_normal_stem (Grob *);
+  static Grob *last_normal_stem (Grob *);
   DECLARE_GROB_INTERFACE();
   static void add_stem (Grob *, Grob *);
   static bool is_knee (Grob *);
@@ -89,6 +90,7 @@ public:
   DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_positions, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_least_squares_positions, (SCM, SCM));
+  DECLARE_SCHEME_CALLBACK (calc_normal_stems, (SCM));  
   DECLARE_SCHEME_CALLBACK (calc_concaveness, (SCM));
   DECLARE_SCHEME_CALLBACK (set_stem_lengths, (SCM));
 
index 325e3fa0a4a7698838c7c30722734a43e3666f58..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,30 +0,0 @@
-/*
-  grob-pitch-tuple.hh -- declare Grob_pitch_tuple
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 2001--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
-*/
-
-#ifndef GROB_PITCH_TUPLE_HH
-#define GROB_PITCH_TUPLE_HH
-
-#include "pitch.hh"
-#include "moment.hh"
-
-struct Grob_pitch_tuple
-{
-  Pitch pitch_;
-  Grob *head_;
-  Moment end_;
-
-  Grob_pitch_tuple ();
-  Grob_pitch_tuple (Grob *, Music *, Moment);
-  static int pitch_compare (Grob_pitch_tuple const &, Grob_pitch_tuple const &);
-  static int time_compare (Grob_pitch_tuple const &, Grob_pitch_tuple const &);
-};
-
-int compare (Grob_pitch_tuple const &, Grob_pitch_tuple const &);
-
-#endif /* GROB_PITCH_TUPLE_HH */
-
index 3a06afda205fe472ab318f3a7a7d8557e3fe2f03..08ad8c7835716aacb045ecd2ca9204c0075d97d8 100644 (file)
@@ -44,6 +44,9 @@ protected:
   void substitute_object_links (SCM, SCM);
   Real get_offset (Axis a) const;
   SCM try_callback (SCM, SCM);
+  SCM try_callback_on_alist (SCM *, SCM, SCM);
+  void internal_set_value_on_alist (SCM *alist, SCM sym, SCM val);
+
 public:
   
   /* friends */
index 5f03e978548579351b15ebb57f1eeb6ff43dd014..c103ba97f52579565aecc16ca7557cd308c7886f 100644 (file)
@@ -33,7 +33,6 @@ protected:
   vector<int> char_count_stack_;
 
 public:
-  bool allow_includes_b_;
 
   Includable_lexer ();
   ~Includable_lexer ();
@@ -42,9 +41,10 @@ public:
   vector<string> file_name_strings_;
 
   Source_file *get_source_file () const;
-  void new_input (string s, Sources *);
+  virtual void new_input (string s, Sources *);
+  
   void new_input (string name, string data, Sources *);
-
+  
   char const *here_str0 () const;
 };
 
index e94d8ef557aac4c4d0aaddd99abfddbc3689486e..c0621d26398cba2e74c804840bd88b9da680fdd0 100644 (file)
@@ -43,6 +43,7 @@ extern SCM global_lily_module;
 
 string gulp_file_to_string (string fn, bool must_exist, int size);
 
+SCM ly_string2scm (string const &s);
 string ly_scm2string (SCM s);
 string ly_symbol2string (SCM);
 Rational ly_scm2rational (SCM);
index 994d185f6f36a9b9ff07239e4912443054a44bd4..5609f53f4d17479254820e9df489b4465e539384 100644 (file)
@@ -55,7 +55,7 @@ public:
   Lily_lexer (Sources *, Lily_parser *);
   Lily_lexer (Lily_lexer const &, Lily_parser *);
   int yylex ();
-
+  
   void add_lexed_char (int);
 
   void prepare_for_next_token ();
@@ -69,6 +69,9 @@ public:
 
   void start_main_input ();
 
+  virtual void new_input (string s, Sources *);
+  virtual void new_input (string s, string d, Sources *);
+
   SCM keyword_list () const;
   SCM lookup_identifier (string s);
   SCM lookup_identifier_symbol (SCM s);
index b07734769a1b747a29cf55ceb1cb2ded2d50cb06..3acfd8a59683d1aaf777d8d1ce9ce041f801fc3e 100644 (file)
@@ -57,6 +57,8 @@ public:
   void parser_error (string);
   void parser_error (Input const &, string);
   void set_yydebug (bool);
+
+  SCM make_scope () const; 
 };
 
 DECLARE_UNSMOB (Lily_parser, lily_parser);
index db5f2d9cc78a631edcf8bcd480c695f35ed82448..cbd10549b001803fb7eeed4fb6d29bb156aa3c44 100644 (file)
@@ -31,6 +31,7 @@ struct Lookup
   static Stencil repeat_slash (Real w, Real slope, Real th);
   static Stencil horizontal_line (Interval w, Real th);
   static Stencil triangle (Interval, Real, Real);
+  static Stencil points_to_line_stencil (Real thick, vector<Offset> const &points);
 };
 
 #endif // LOOKUP_HH
index fff7fa225cb6c2bacdb53a463d947ac867178c28..d8d4eff95782ce3e068b2fa02e1cedc6937cc0fa 100644 (file)
@@ -14,5 +14,7 @@
 void note_property_access (SCM *table, SCM sym);
 extern SCM context_property_lookup_table;
 extern SCM grob_property_lookup_table;
+extern SCM prob_property_lookup_table;
+extern bool profile_property_accesses;
 
 #endif /* PROFILE_HH */
index 55971a1fa16ba6a74e451ad6e5ed81cc0bd36783..bf5e253d59d41887938c9652ec948162abc9a9d6 100644 (file)
@@ -15,7 +15,6 @@ extern bool do_midi_debugging_global;
 extern int testing_level_global;
 extern bool lily_1_8_relative;
 extern bool lily_1_8_compatibility_used;
-extern bool profile_property_accesses;
 
 SCM ly_get_option (SCM);
 SCM ly_set_option (SCM, SCM);
index e3af270a88e2c6d1bc9ab955abfa6c9bfc2cbb7f..df541f9d2037e01f68df4ff9496caa2da3c55e86 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  relocate.hh -- declare
+  relocate.hh -- declare relocation functions
 
   source file of the GNU LilyPond music typesetter
 
index 20107120b7c411bef2f4fa8bbbb4441cf04140db..5399c203fd88efff4161efe82e3d935d4f2bb520 100644 (file)
@@ -25,5 +25,6 @@ public:
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (width, (SCM));
   DECLARE_SCHEME_CALLBACK (height, (SCM));
+  DECLARE_SCHEME_CALLBACK (pure_height, (SCM, SCM, SCM));
 };
 #endif // REST_HH
index b80bcc1c3d77a281212a9701fe4ca66c926acb84..807ea6d110d5d3594720f0e239965b534995ddd1 100644 (file)
@@ -95,6 +95,5 @@ void register_stencil_head (SCM symbol);
 bool is_stencil_head (SCM symbol);
 SCM all_stencil_heads ();
 
-Stencil points_to_line_stencil (vector<Offset> points);
 
 #endif /* STENCIL_HH */
index 35d3d9596cb54767190fa8c4ec2ef7e85c530836..b68d73d24ba8229d0c6ce58f54f95bf8bcb029d0 100644 (file)
@@ -25,10 +25,10 @@ public:
   static int get_column_rank (Grob *, Direction);
   static int get_position (Grob *);
   static Direction get_default_dir (Grob *);  
-  static void set_control_points (Grob *, Grob *,
-                                 Tie_configuration const&,
-                                 Tie_details const&);
-  static void set_default_control_points (Grob *);
+  static SCM get_control_points (Grob *, Grob *,
+                                Tie_configuration const&,
+                                Tie_details const&);
+  static SCM get_default_control_points (Grob *);
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
index c24d2ed1b0d3e0cddfe8786daa81b6a0bb63c56f..97c82de82c9aa5b8510e1d79bd6f18a743ac56f7 100644 (file)
@@ -47,7 +47,7 @@ LY_DEFINE (ly_input_file_line_column,
   int ch = 0;
   int col = 0;
   ip->get_counts (&l, &ch, &col);
-  return scm_list_4 (scm_makfrom0str (ip->file_string ().c_str ()),
+  return scm_list_4 (ly_string2scm (ip->file_string ()),
                     scm_from_int (l),
                     scm_from_int (ch),
                     scm_from_int (col));
@@ -61,7 +61,7 @@ LY_DEFINE (ly_input_both_locations,
 {
   Input *ip = unsmob_input (sip);
   SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location");
-  return scm_list_5 (scm_makfrom0str (ip->file_string ().c_str ()),
+  return scm_list_5 (ly_string2scm (ip->file_string ()),
                     scm_from_int (ip->line_number ()),
                     scm_from_int (ip->column_number ()),
                     scm_from_int (ip->end_line_number ()),
index fe30a0423ce6eaf85368605a4574f1845072d92f..c9dce0aafb7ff1186a57d7b311027cbbb56b05a3 100644 (file)
@@ -31,6 +31,9 @@ Instrument_switch_engraver::Instrument_switch_engraver ()
   text_ = 0;
 }
 
+/*
+  TODO: should use an event.
+ */
 void
 Instrument_switch_engraver::process_music ()
 {
index 9cb2cac0c667baae3b1f24a893ab34acaaf3032b..9ce0da012d5faf14f5eff0fc00beb63e5cd3d6fd 100644 (file)
@@ -236,7 +236,7 @@ BOM_UTF8    \357\273\277
        progress_indication ("\n");
        scm_module_define (scm_car (scopes_),
                     ly_symbol2scm ("input-file-name"),
-                    scm_makfrom0str (s.c_str ()));
+                    ly_string2scm (s));
 
 }
 
@@ -271,7 +271,7 @@ BOM_UTF8    \357\273\277
        }
        <<EOF>>         {
                LexerError (_ ("EOF found inside a comment").c_str ());
-               is_main_input_ = false;
+               is_main_input_ = false; // should be safe , can't have \include in --safe.
                if (! close_input ()) 
                  yyterminate (); // can't move this, since it actually rets a YY_NULL
        }
@@ -323,7 +323,7 @@ BOM_UTF8    \357\273\277
 }
 <chords,notes,figures>{RESTNAME}       {
        char const *s = YYText ();
-       yylval.scm = scm_makfrom0str (s);
+       yylval.scm = scm_from_locale_string (s);
        return RESTNAME;
 }
 <chords,notes,figures>R                {
@@ -427,7 +427,7 @@ BOM_UTF8    \357\273\277
 
                /* yylval is union. Must remember STRING before setting SCM*/
                string *sp = yylval.string;
-               yylval.scm = scm_makfrom0str (sp->c_str ());
+               yylval.scm = ly_string2scm (*sp);
                delete sp;
                return is_lyric_state () ? LYRICS_STRING : STRING;
        }
@@ -464,7 +464,7 @@ BOM_UTF8    \357\273\277
                if (c == '{' ||  c == '}') // brace open is for not confusing dumb tools.
                        here_input ().warning (
                                _ ("Brace found at end of lyric.  Did you forget a space?"));
-               yylval.scm = scm_makfrom0str (s.c_str ());
+               yylval.scm = ly_string2scm (s);
 
 
                return LYRICS_STRING;
@@ -557,7 +557,7 @@ BOM_UTF8    \357\273\277
                if (c == '{' ||  c == '}')
                        here_input ().warning (
                                _ ("Brace found at end of markup.  Did you forget a space?"));
-               yylval.scm = scm_makfrom0str (s.c_str ());
+               yylval.scm = ly_string2scm (s);
 
 
                return STRING;
@@ -570,7 +570,11 @@ BOM_UTF8   \357\273\277
 <*><<EOF>> {
        if (is_main_input_)
        {
-               is_main_input_ = false;
+               /* 2 = init.ly + current file.
+                  > because we're before closing, but is_main_input_ should
+                  reflect after.
+               */ 
+               is_main_input_ = include_stack_.size () > 2;
                if (!close_input ())
                /* Returns YY_NULL */
                        yyterminate ();
@@ -774,7 +778,7 @@ Lily_lexer::scan_escaped_word (string str)
        string msg (_f ("unknown escaped string: `\\%s'", str));        
        LexerError (msg.c_str ());
 
-       yylval.scm = scm_makfrom0str (str.c_str ());
+       yylval.scm = ly_string2scm (str);
 
        return STRING;
 }
@@ -802,7 +806,7 @@ Lily_lexer::scan_bare_word (string str)
                }
        }
 
-       yylval.scm = scm_makfrom0str (str.c_str ());
+       yylval.scm = ly_string2scm (str);
        return STRING;
 }
 
@@ -937,7 +941,7 @@ SCM
 lookup_markup_command (string s)
 {
        SCM proc = ly_lily_module_constant ("lookup-markup-command");
-       return scm_call_1 (proc, scm_makfrom0str (s.c_str ()));
+       return scm_call_1 (proc, ly_string2scm (s));
 }
 
 /* Shut up lexer warnings.  */
index 8ba98a4a69a839f221db10d79cf7ace6fffb4279..85628e64f8d69572d36660f4ddad700f2d99afc8 100644 (file)
@@ -45,7 +45,7 @@ ly_to_string (SCM scm)
 {
   return scm_call_3 (ly_lily_module_constant ("format"), SCM_BOOL_F,
 
-                    scm_makfrom0str ("~S"), scm);
+                    scm_from_locale_string ("~S"), scm);
 }
 
 SCM
@@ -129,6 +129,14 @@ ly_scm2string (SCM str)
                 (int) scm_i_string_length (str));
 }
 
+SCM
+ly_string2scm (string const &str)
+{
+  return scm_from_locale_stringn (str.c_str(),
+                                 str.length ());
+}
+
+
 char *
 ly_scm2newstr (SCM str, size_t *lenp)
 {
@@ -335,37 +343,6 @@ ly_scm2offsets (SCM s)
   ALIST
 */
 
-/* looks the key up in the cdrs of the alist-keys
-   - ignoring the car and ignoring non-pair keys.
-   Returns first match found, i.e.
-
-   alist = ((1 . 10)
-   ((1 . 2) . 11)
-   ((2 . 1) . 12)
-   ((3 . 0) . 13)
-   ((4 . 1) . 14) )
-
-   I would like (ly_assoc_cdr 1) to return 12 - because it's the first
-   element with the cdr of the key = 1.  In other words (alloc_cdr key)
-   corresponds to call
-
-   (alloc (anything . key))
-*/
-SCM
-ly_assoc_cdr (SCM key, SCM alist)
-{
-  if (scm_is_pair (alist))
-    {
-      SCM trykey = scm_caar (alist);
-      if (scm_is_pair (trykey)
-         && to_boolean (scm_equal_p (key, scm_cdr (trykey))))
-       return scm_car (alist);
-      return ly_assoc_cdr (key, scm_cdr (alist));
-    }
-  return SCM_BOOL_F;
-}
-
-
 bool
 alist_equal_p (SCM a, SCM b)
 {
@@ -429,25 +406,6 @@ ly_deep_copy (SCM src)
 }
 
 
-SCM
-ly_truncate_list (int k, SCM lst)
-{
-  if (k == 0)
-    lst = SCM_EOL;
-  else
-    {
-      SCM s = lst;
-      k--;
-      for (; scm_is_pair (s) && k--; s = scm_cdr (s))
-       ;
-
-      if (scm_is_pair (s))
-       scm_set_cdr_x (s, SCM_EOL);
-    }
-  return lst;
-}
-
-
 
 
 
index 66e47d3d6b5e56b53253b0cd963e3f468f5ab895..7cb6d53691de01dd04a3bb281133ad57ac948984 100644 (file)
 #include "lily-lexer.hh"
 
 LY_DEFINE(ly_lexer_keywords, "ly:lexer-keywords",
-         1,0,0, (SCM lexer),
+         1, 0, 0, (SCM lexer),
          "Return a list of (KEY . CODE) pairs, signifying the lilypond reserved words list.")
 {
   Lily_lexer * lex = Lily_lexer::unsmob (lexer);
   SCM_ASSERT_TYPE(lex, lexer, SCM_ARG1, __FUNCTION__, "lily lexer");
   return lex->keyword_list ();
 }
-         
index 8d70783cb5989da22c5eede795ac94bcf6f72cc3..97d515aaaa278237c88de3722973588b21bf1984 100644 (file)
@@ -193,7 +193,7 @@ Lily_lexer::keyword_list () const
   SCM *tail = &l;
   for (vsize i = 0; i < keytable_->table_.size (); i++)
     {
-      *tail = scm_acons (scm_makfrom0str (keytable_->table_[i].name_),
+      *tail = scm_acons (scm_from_locale_string (keytable_->table_[i].name_),
                         scm_from_int (keytable_->table_[i].tokcode_),
                         SCM_EOL);
 
@@ -231,12 +231,27 @@ Lily_lexer::start_main_input ()
   
   new_input (main_input_name_, sources_);
 
-  /* Do not allow \include in --safe-mode */
-  allow_includes_b_ = allow_includes_b_ && !be_safe_global;
-
   scm_module_define (scm_car (scopes_),
                     ly_symbol2scm ("input-file-name"),
-                    scm_makfrom0str (main_input_name_.c_str ()));
+                    ly_string2scm (main_input_name_));
+}
+
+void
+Lily_lexer::new_input (string str, string d, Sources *ss)
+{
+  Includable_lexer::new_input (str, d, ss);
+}
+
+void
+Lily_lexer::new_input (string str, Sources *ss)
+{
+  if (is_main_input_ && be_safe_global)
+    {
+      LexerError (_ ("include files are not allowed in safe mode").c_str ());
+      return;
+    }
+
+  Includable_lexer::new_input (str, ss);
 }
 
 void
index 305359c3f57905180cf374740c39e0c64dadb27a..47a0095a445fed9e074dfa9b0f48ff504c31d2ae 100644 (file)
@@ -142,27 +142,11 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
   if (error)
     /* TODO: pass renamed input file too.  */
     scm_throw (ly_symbol2scm ("ly-file-failed"),
-              scm_list_1 (scm_makfrom0str (file_name.c_str ())));
+              scm_list_1 (ly_string2scm (file_name)));
   
   return SCM_UNSPECIFIED;
 }
 
-LY_DEFINE (ly_parse_string, "ly:parse-string",
-          1, 0, 0, (SCM ly_code),
-          "Parse the string LY_CODE.  "
-          "Upon failure, throw @code{ly-file-failed} key.")
-{
-  SCM_ASSERT_TYPE (scm_is_string (ly_code), ly_code, SCM_ARG1, __FUNCTION__, "string");
-
-  Sources sources;
-  sources.set_path (&global_path);
-  Lily_parser *parser = new Lily_parser (&sources);
-  parser->parse_string (ly_scm2string (ly_code));
-  parser->unprotect ();
-  parser = 0;
-
-  return SCM_UNSPECIFIED;
-}
 
 LY_DEFINE (ly_parser_lexer, "ly:parser-lexer",
           1, 0, 0, (SCM parser_smob),
@@ -251,7 +235,7 @@ LY_DEFINE (ly_parser_output_name, "ly:parser-output-name",
   Lily_parser *p = unsmob_lily_parser (parser);
   SCM_ASSERT_TYPE (p, parser, SCM_ARG1, __FUNCTION__, "Lilypond parser");
 
-  return scm_makfrom0str (p->output_basename_.c_str ());
+  return ly_string2scm (p->output_basename_);
 }
 
 LY_DEFINE (ly_parser_error, "ly:parser-error",
@@ -271,3 +255,26 @@ LY_DEFINE (ly_parser_error, "ly:parser-error",
 
   return parser;
 }
+
+LY_DEFINE (ly_parser_clear_error, "ly:parser-clear-error",
+          1, 0, 0, (SCM parser),
+          "Clear the error flag for the parser.")
+{
+  Lily_parser *p = unsmob_lily_parser (parser);
+  SCM_ASSERT_TYPE (p, parser, SCM_ARG1, __FUNCTION__, "Lilypond parser");
+
+  p->error_level_ = 0;
+  p->lexer_->error_level_ = 0;
+  
+  return SCM_UNSPECIFIED;
+}
+
+LY_DEFINE (ly_parser_has_error_p, "ly:parser-has-error?",
+          1, 0, 0, (SCM parser),
+          "Does @var{parser} have an error flag?")
+{
+  Lily_parser *p = unsmob_lily_parser (parser);
+  SCM_ASSERT_TYPE (p, parser, SCM_ARG1, __FUNCTION__, "Lilypond parser");
+
+  return scm_from_bool (p->error_level_ || p->lexer_->error_level_);
+}
index ae3943dbdb3e89061ba30ee53600b43215ad9123..cfa8d3f9400d51466db40aa57e005c5d2d5cb03c 100644 (file)
@@ -105,7 +105,7 @@ Lily_parser::parse_file (string init, string name, string out_name)
   File_name f (name);
   string s = global_path.find (f.base_ + ".twy");
   s = gulp_file_to_string (s, false, -1);
-  scm_eval_string (scm_makfrom0str (s.c_str ()));
+  scm_eval_string (ly_string2scm (s));
 
   /* Read .ly IN_FILE, lex, parse, write \score blocks from IN_FILE to
      OUT_FILE (unless IN_FILE redefines output file name).  */
@@ -140,8 +140,7 @@ Lily_parser::parse_string (string ly_code)
                          self_scm ());
 
   lexer_->main_input_name_ = "<string>";
-  lexer_->is_main_input_ = true;
-
+  lexer_->is_main_input_ = true; 
   lexer_->new_input (lexer_->main_input_name_, ly_code, sources_);
 
   SCM mod = lexer_->set_current_scope ();
@@ -241,13 +240,19 @@ get_header (Lily_parser *parser)
 {
   SCM id = parser->lexer_->lookup_identifier ("$defaultheader");
   if (!ly_is_module (id))
-    id = ly_make_anonymous_module (be_safe_global);
+    id = parser->make_scope ();
   else
     {
-      SCM nid = ly_make_anonymous_module (false);
-      ly_module_copy(nid,id);
+      SCM nid = parser->make_scope ();
+      ly_module_copy (nid, id);
       id = nid;
     }
   
   return id;
 }
+
+SCM 
+Lily_parser::make_scope () const
+{
+  return ly_make_anonymous_module (be_safe_global);
+}
index 99b190bcc4801346fe4624f6288b49eb57e3a7fd..b75d872699c7d456ef0744e19517ab4b8c9bdaaa 100644 (file)
@@ -63,7 +63,7 @@ Lilypond_grob_key::as_scheme () const
 {
   return scm_list_4 (context_ ? context_->self_scm () : SCM_BOOL_F,
                     creation_moment_.smobbed_copy (),
-                    scm_makfrom0str (grob_name_.c_str ()),
+                    ly_string2scm (grob_name_),
                     scm_from_int (disambiguation_count_));
 }
 
@@ -146,8 +146,8 @@ Lilypond_context_key::as_scheme () const
 {
   return scm_list_5 (parent_context_ ? parent_context_->self_scm () : SCM_BOOL_F,
                     start_moment_.smobbed_copy (),
-                    scm_makfrom0str (context_name_.c_str ()),
-                    scm_makfrom0str (id_.c_str ()),
+                    ly_string2scm (context_name_),
+                    ly_string2scm (id_),
                     scm_from_int (disambiguation_count_));
 }
 
@@ -213,7 +213,7 @@ SCM
 Lilypond_general_key::as_scheme () const
 {
   return scm_list_3 (parent_ ? parent_->self_scm () : SCM_BOOL_F,
-                    scm_makfrom0str (name_.c_str ()),
+                    ly_string2scm (name_),
                     scm_from_int (disambiguation_count_));
 }
 
index f65dc946f2c70b62d7196f66159d99c2c1307dde..c765ffcd4cb56d7db3cfe13fc1790da464f0a457 100644 (file)
@@ -156,21 +156,3 @@ ADD_INTERFACE (Line_interface,
               "arrow-length "
               "arrow-width")
 
-
-
-/* todo: move this somewhere else? */
-Stencil
-points_to_line_stencil (vector<Offset> points)
-{
-  Stencil ret;
-  for (vsize i = 1; i < points.size (); i++)
-    {
-      if (points[i-1].is_sane ()  && points[i].is_sane ())
-       {
-         Stencil line
-           = Line_interface::make_line (0.1, points[i-1], points[i]);
-         ret.add_stencil (line);
-       }
-    }
-  return ret;
-}
index d8c20c044fcd871b36f831b83adf022ed28c0c54..1a34881d80929daf2bb5a38c59f11d518372a685 100644 (file)
@@ -147,7 +147,7 @@ Lookup::horizontal_line (Interval w, Real th)
 Stencil
 Lookup::blank (Box b)
 {
-  return Stencil (b, scm_makfrom0str (""));
+  return Stencil (b, scm_from_locale_string (""));
 }
 
 Stencil
@@ -714,17 +714,29 @@ Lookup::triangle (Interval iv, Real thick, Real protude)
   b[X_AXIS] = Interval (0, iv.length ());
   b[Y_AXIS] = Interval (min (0., protude), max (0.0, protude));
 
-  Offset z1 (iv[LEFT], 0);
-  Offset z2 (iv[RIGHT], 0);
-  Offset z3 ((z1 + z2)[X_AXIS] / 2, protude);
+  vector<Offset> points;
+  points.push_back (Offset (iv[LEFT], 0));
+  points.push_back (Offset (iv[RIGHT], 0));
+  points.push_back (Offset (iv.center (), protude));
 
-  /*
-    TODO: move Triangle to Line_interface ?
-  */
-  Stencil tri = Line_interface::make_line (thick, z1, z2);
-  tri.add_stencil (Line_interface::make_line (thick, z2, z3));
-  tri.add_stencil (Line_interface::make_line (thick, z3, z1));
+  return points_to_line_stencil (thick, points);
 
-  return tri;
 }
 
+
+
+Stencil
+Lookup::points_to_line_stencil (Real thick, vector<Offset> const &points)
+{
+  Stencil ret;
+  for (vsize i = 1; i < points.size (); i++)
+    {
+      if (points[i-1].is_sane ()  && points[i].is_sane ())
+       {
+         Stencil line
+           = Line_interface::make_line (thick, points[i-1], points[i]);
+         ret.add_stencil (line);
+       }
+    }
+  return ret;
+}
index 85e72d3197961ff2144bc1f2094c84b6295cf8e5..88ef1d18e61388e789c0112271bd297cf036ea56 100644 (file)
 #include "music-iterator.hh"
 #include "music.hh"
 
+/*
+  This iterator is hairy.  It tracks both lyric and melody contexts,
+  and has a complicated communication route, reading/writing
+  properties in both.
+
+  In the future, this should rather be done with
+
+     \interpretAsMelodyFor { MUSIC } { LYRICS LYRICS LYRICS }
+
+  This can run an interpret step on MUSIC, generating a stream.  Then
+  the stream can be perused at leisure to apply durations to all of
+  the LYRICS.
+*/
+
 class Lyric_combine_music_iterator : public Music_iterator
 {
 public:
@@ -32,7 +46,7 @@ protected:
   virtual void derived_substitute (Context *, Context *);
   void set_music_context (Context *to);
 private:
-  bool start_new_syllable ();
+  bool start_new_syllable () const;
   Context *find_voice ();
   DECLARE_LISTENER (set_busy);
   DECLARE_LISTENER (check_new_context);
@@ -75,6 +89,7 @@ Lyric_combine_music_iterator::set_music_context (Context *to)
       music_context_->event_source()->remove_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
       lyrics_context_->unset_property (ly_symbol2scm ("associatedVoiceContext"));
     }
+
   music_context_ = to;
   if (to)
     {
@@ -85,13 +100,11 @@ Lyric_combine_music_iterator::set_music_context (Context *to)
 }
 
 bool
-Lyric_combine_music_iterator::start_new_syllable ()
+Lyric_combine_music_iterator::start_new_syllable () const
 {
   if (!busy_)
     return false;
 
-  busy_ = false;
-
   if (!lyrics_context_)
     return false;
 
@@ -169,15 +182,13 @@ Lyric_combine_music_iterator::construct_children ()
   Context *voice = find_voice ();
   if (voice)
     set_music_context (voice);
-  else
-    {
-      /*
-        Wait for a Create_context event. If this isn't done, lyrics can be 
-        delayed when voices are created implicitly.
-      */
-      Global_context *g = get_outlet ()->get_global_context ();
-      g->events_below ()->add_listener (GET_LISTENER (check_new_context), ly_symbol2scm ("CreateContext"));
-    }
+
+  /*
+    Wait for a Create_context event. If this isn't done, lyrics can be 
+    delayed when voices are created implicitly.
+  */
+  Global_context *g = get_outlet ()->get_global_context ();
+  g->events_below ()->add_listener (GET_LISTENER (check_new_context), ly_symbol2scm ("CreateContext"));
 
   /*
     We do not create a Lyrics context, because the user might
@@ -191,15 +202,15 @@ void
 Lyric_combine_music_iterator::check_new_context (SCM sev)
 {
   // TODO: Check first if type=Voice and if id matches
-  (void)sev;
-
+  Stream_event * ev = unsmob_stream_event (sev);
+  if (ev->get_property ("type") != ly_symbol2scm ("Voice"))
+    return ;
+  
   Context *voice = find_voice ();
+
   if (voice)
     {
       set_music_context (voice);
-
-      Global_context *g = voice->get_global_context ();
-      g->events_below ()->remove_listener (GET_LISTENER (check_new_context), ly_symbol2scm ("CreateContext"));
     }
 }
 
@@ -258,6 +269,7 @@ Lyric_combine_music_iterator::process (Moment)
       set_music_context (0);
     }
 
+
   if (music_context_
       && (start_new_syllable () || pending_grace_lyric_)
       && lyric_iter_->ok ())
@@ -275,6 +287,8 @@ Lyric_combine_music_iterator::process (Moment)
 
       music_found_ = true;
     }
+
+  busy_ = false;
 }
 
 void
index 06ffce0d50ad4cc354015a88e4e623beb2d1da53..3005760765b00c0cb5f4febb34fe1d1ba679df86 100644 (file)
@@ -59,7 +59,7 @@ Lyric_engraver::process_music ()
     {
       SCM text = event_->get_property ("text");
 
-      if (ly_is_equal (text, scm_makfrom0str (" ")))
+      if (ly_is_equal (text, scm_from_locale_string (" ")))
        {
          if (last_text_)
            last_text_->set_property ("self-alignment-X", scm_from_int (LEFT));
index 5aba63d78d255a480a88ed7cf9e5f777d82901bd..bf8132477b290b464f6585b2e864da13f5e2c7ca 100644 (file)
@@ -424,7 +424,7 @@ main_with_guile (void *, int, char **)
   SCM *tail = &files;
   while (char const *arg = option_parser->get_next_arg ())
     {
-      *tail = scm_cons (scm_makfrom0str (arg), SCM_EOL);
+      *tail = scm_cons (scm_from_locale_string (arg), SCM_EOL);
       tail = SCM_CDRLOC (*tail);
     }
   
@@ -566,10 +566,8 @@ parse_argv (int argc, char **argv)
          be_verbose_global = true;
          break;
        case 's':
-         be_safe_global = true;
          init_scheme_variables
            += "(cons \'safe #t)\n";
-
          break;
        case 'p':
          make_preview = true;
index d4901f2c9b1a12a9958132fdc7b133e0af3ef928..103a5c642744658ee6ad84d114605ebafc1ab69b 100644 (file)
@@ -27,7 +27,7 @@ Melody_spanner::calc_neutral_stem_direction (SCM smob)
   Grob *stem = unsmob_grob (smob);
   Grob *me =  unsmob_grob (stem->get_object ("melody-spanner"));
   if (!me || !me->is_live ())
-    return SCM_UNSPECIFIED;
+    return scm_from_int (DOWN);
   
   extract_grob_set (me, "stems", stems);
 
@@ -41,6 +41,7 @@ Melody_spanner::calc_neutral_stem_direction (SCM smob)
         &&  !dirs[next_nonneutral])
     next_nonneutral++;
 
+  SCM retval = SCM_EOL;
   while (last_nonneutral == VPOS || last_nonneutral < dirs.size () - 1) 
     {
       Direction d1 = CENTER;
@@ -61,8 +62,12 @@ Melody_spanner::calc_neutral_stem_direction (SCM smob)
        total = to_dir (me->get_property ("neutral-direction"));
       
       for (vsize i = last_nonneutral + 1; i <  next_nonneutral; i++)
-       stems[i]->set_property ("neutral-direction", scm_from_int (total));
-
+       {
+         if (stems[i] == stem)
+           retval = scm_from_int (total);
+         else
+           stems[i]->set_property ("neutral-direction", scm_from_int (total));
+       }
 
       last_nonneutral = next_nonneutral;
       while (last_nonneutral < dirs.size ()
@@ -76,8 +81,7 @@ Melody_spanner::calc_neutral_stem_direction (SCM smob)
        next_nonneutral++;
     }
 
-  me->suicide ();
-  return SCM_UNSPECIFIED;
+  return retval;
 }
 
 void
index 3fcdb4ca223d6c7ebea4a3b6e983cfc6cab6001d..82283201eba622755de6b9064a45498eecea6d21 100644 (file)
@@ -140,9 +140,6 @@ Midi_instrument::to_string () const
   Byte program_byte = 0;
   bool found = false;
 
-  /*
-    UGH. don't use eval.
-  */
   SCM proc = ly_lily_module_constant ("midi-program");
   SCM program = scm_call_1 (proc, ly_symbol2scm (audio_->str_.c_str ()));
   found = (program != SCM_BOOL_F);
index e0fb13044d14d239858aa83ccd0fb0e4aa9dae84..91e9698032ef28611004030946bcff12c5576ab9 100644 (file)
@@ -178,7 +178,7 @@ Modified_font_metric::text_stencil (string text) const
 Box
 Modified_font_metric::text_dimension (string text) const
 {
-  SCM stext = scm_makfrom0str (text.c_str ());
+  SCM stext = ly_string2scm (text);
   
   Box b;
   if (output_backend_global == "tex")
index 44d699b7ce1bcd0b35137945f03c1ad490c008cf..bc6f7927bcaff9aeae466bc3b0992677263d798a 100644 (file)
@@ -205,11 +205,11 @@ Multi_measure_rest::church_rest (Grob *me, Font_metric *musfont, int measures,
   int count = 0;
   Real symbols_width = 0.0;
 
-  SCM sml = me->get_property ("use-breve-rest");
+  bool use_breve = to_boolean (me->get_property ("use-breve-rest"));
 
   while (l)
     {
-      if (sml == SCM_BOOL_T)
+      if (use_breve)
        {
          int k;
          if (l >= 2)
index 1ae7794393cffa9dd7be84a82bad09b4f0d5c4c7..cd2d0487c05f434d252e876fb40f491041ea5a87 100644 (file)
@@ -250,6 +250,11 @@ New_fingering_engraver::position_scripts (SCM orientations,
       f->set_parent (ft.head_, X_AXIS);
       f->set_parent (ft.head_, Y_AXIS);
 
+      if (hordir == LEFT
+         && unsmob_grob (ft.head_->get_object ("accidental-grob")))
+       Side_position_interface::add_support (f,
+                                             unsmob_grob (ft.head_->get_object ("accidental-grob")));
+                                             
       Self_alignment_interface::set_align_self (f, Y_AXIS);
       Self_alignment_interface::set_center_parent (f, Y_AXIS);
       Side_position_interface::set_axis (f, X_AXIS);
index f3c081f0395a5af2f0c5a95bc2f0af302d539c32..dfff746e2705810e2b44bcfa4efda66257b4b590 100644 (file)
@@ -50,7 +50,7 @@ Note_name_engraver::process_music ()
   if (s.length ())
     {
       Item *t = make_item ("NoteName", events_[0]->self_scm ());
-      t->set_property ("text", scm_makfrom0str (s.c_str ()));
+      t->set_property ("text", ly_string2scm (s));
       texts_.push_back (t);
     }
 }
index 7b5f2ad7bd33c4f261dde5d08604da7e38373aec..8772ceec7b0daea9b8604cae5c56ee57fe7df129 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "engraver.hh"
 
+#include "grob-array.hh"
 #include "context.hh"
 #include "item.hh"
 #include "pointer-group-interface.hh"
@@ -86,7 +87,8 @@ Note_spacing_engraver::finalize ()
 {
   if (last_spacing_
       && last_spacing_parent_context_
-      && last_spacing_parent_context_ == context ()->get_parent_context ())
+      && last_spacing_parent_context_ == context ()->get_parent_context ()
+      && !unsmob_grob_array (last_spacing_->get_object ("right-items")))
     {
       SCM ccol = get_property ("currentCommandColumn");
       Grob *column = unsmob_grob (ccol);
index 2f2e5fdaad3d50b7eb2cc755ef0083243487d596..7e025bc5b2a0b0a323b4659c2e90726c6c57be6d 100644 (file)
@@ -296,7 +296,7 @@ Open_type_font::glyph_list () const
       if (code)
        warning (_f ("FT_Get_Glyph_Name() returned error: %u", unsigned (code)));
 
-      *tail = scm_cons (scm_makfrom0str (name), SCM_EOL);
+      *tail = scm_cons (scm_from_locale_string (name), SCM_EOL);
       tail = SCM_CDRLOC (*tail);
     }
   
index 3d58e0dd0ed69cbbd4a701b425d6c94e3d27549e..77d279ab906bb6c34c56004014d25899cc0a6f6a 100644 (file)
@@ -69,8 +69,8 @@ void
 Pango_font::register_font_file (string filename, string ps_name)
 {
   scm_hash_set_x (physical_font_tab_,
-                 scm_makfrom0str (ps_name.c_str ()),
-                 scm_makfrom0str (filename.c_str ()));
+                 ly_string2scm (ps_name),
+                 ly_string2scm (filename));
 }
 
 void
@@ -204,7 +204,7 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, string str,
          char_id = scm_from_uint32 (pg);
        }
       else
-       char_id = scm_makfrom0str (glyph_name);
+       char_id = scm_from_locale_string (glyph_name);
       
       *tail = scm_cons (scm_list_4 (scm_from_double (ggeo.width * scale_),
                                    scm_from_double (ggeo.x_offset * scale_),
@@ -261,7 +261,7 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, string str,
       pango_fc_font_unlock_face (fcfont);
 
       SCM expr = scm_list_5 (ly_symbol2scm ("glyph-string"),
-                            scm_makfrom0str (ps_name.c_str ()),
+                            ly_string2scm (ps_name),
                             scm_from_double (size),
                             scm_from_bool (cid_keyed),
                             ly_quote_scm (glyph_exprs));
@@ -355,8 +355,8 @@ Pango_font::text_stencil (string str, bool tight) const
       */
       SCM exp
        = scm_list_3 (ly_symbol2scm ("utf-8-string"),
-                     scm_makfrom0str (description_string ().c_str ()),
-                     scm_makfrom0str (str.c_str ()));
+                     ly_string2scm (description_string ()),
+                     ly_string2scm (str));
 
       Box b (Interval (0, 0), Interval (0, 0));
       b.unite (dest.extent_box ());
index 89330c842ab88a263c49669f2878f8c550ddb93f..7a48daf53584c0e7be0b18582398d3c8a9a6946e 100644 (file)
@@ -19,7 +19,7 @@ LY_DEFINE (ly_make_pango_description_string, "ly:make-pango-description-string",
   PangoFontDescription *pfd = properties_to_pango_description (chain, scm_to_double (size));
   char *str = pango_font_description_to_string (pfd);
 
-  SCM scm_str = scm_makfrom0str (str);
+  SCM scm_str = scm_from_locale_string (str);
   g_free (str);
   pango_font_description_free (pfd);
   return scm_str;
index bd684b92f857344bb7f91ff02d41b3940da660a8..5d032f252bcaecbd5ea890d5485e470968e45855 100644 (file)
@@ -56,7 +56,7 @@ select_pango_font (Output_def *layout, SCM chain)
                                       * layout->get_dimension (ly_symbol2scm ("text-font-size")));
 
   char *str = pango_font_description_to_string (pfd);
-  SCM scm_str = scm_makfrom0str (str);
+  SCM scm_str = scm_from_locale_string (str);
   g_free (str);
 
   return find_pango_font (layout, scm_str, 1.0);
index c66d1d6ae989cda7c6392a49a3096a9efea068f8..e53e2564a55f3657e197a0941fa72e8a5c0339dd 100644 (file)
@@ -136,6 +136,13 @@ Paper_book::output (SCM output_channel)
 void
 Paper_book::classic_output (SCM output)
 {
+  if (scm_is_pair (performances_))
+    {
+      SCM proc = ly_lily_module_constant ("write-performances-midis");
+      scm_call_2 (proc, performances (), output);
+    }
+  
   /* Generate all stencils to trigger font loads.  */
   systems ();
 
index 2636b20fe4bccee354e4b9b915f060f8e6f082af..ac653f0b6cba1bf2685ae01d7c34f5c1246f4eee 100644 (file)
@@ -152,10 +152,10 @@ Paper_column::print (SCM p)
 
   SCM scm_mol = Text_interface::interpret_markup (me->layout ()->self_scm (),
                                                  properties,
-                                                 scm_makfrom0str (r.c_str ()));
+                                                 ly_string2scm (r));
   SCM when_mol = Text_interface::interpret_markup (me->layout ()->self_scm (),
                                                   properties,
-                                                  scm_makfrom0str (when.c_str ()));
+                                                  ly_string2scm (when));
   Stencil t = *unsmob_stencil (scm_mol);
   t.add_at_edge (Y_AXIS, DOWN, *unsmob_stencil (when_mol), 0.1, 0.1);
   t.align_to (X_AXIS, CENTER);
index 7ea90f93da1d03fcf3fca901dcec1a6f0615537c..0d42a60a18ea1663bc3a5f1bd260de0457ca208c 100644 (file)
@@ -503,7 +503,7 @@ embedded_scm:
 
 lilypond_header_body:
        {
-               $$ = get_header(PARSER);
+               $$ = get_header (PARSER);
                PARSER->lexer_->add_scope ($$);
        }
        | lilypond_header_body assignment  {
@@ -1701,25 +1701,25 @@ gen_text_def:
 
 script_abbreviation:
        '^'             {
-               $$ = scm_makfrom0str ("Hat");
+               $$ = scm_from_locale_string ("Hat");
        }
        | '+'           {
-               $$ = scm_makfrom0str ("Plus");
+               $$ = scm_from_locale_string ("Plus");
        }
        | '-'           {
-               $$ = scm_makfrom0str ("Dash");
+               $$ = scm_from_locale_string ("Dash");
        }
        | '|'           {
-               $$ = scm_makfrom0str ("Bar");
+               $$ = scm_from_locale_string ("Bar");
        }
        | ANGLE_CLOSE   {
-               $$ = scm_makfrom0str ("Larger");
+               $$ = scm_from_locale_string ("Larger");
        }
        | '.'           {
-               $$ = scm_makfrom0str ("Dot");
+               $$ = scm_from_locale_string ("Dot");
        }
        | '_' {
-               $$ = scm_makfrom0str ("Underscore");
+               $$ = scm_from_locale_string ("Underscore");
        }
        ;
 
@@ -2384,7 +2384,7 @@ Lily_lexer::try_special_identifiers (SCM *destination, SCM sid)
 SCM
 get_next_unique_context_id ()
 {
-       return scm_makfrom0str ("$uniqueContextId");
+       return scm_from_locale_string ("$uniqueContextId");
 }
 
 
@@ -2394,7 +2394,7 @@ get_next_unique_lyrics_context_id ()
        static int new_context_count;
        char s[128];
        snprintf (s, sizeof (s)-1, "uniqueContext%d", new_context_count++);
-       return scm_makfrom0str (s);
+       return scm_from_locale_string (s);
 }
 
 
index a96aac7761deb7518e5c69e6c6132463b5ee5a16..11ee5d90c545c1159789f6b3ab81475586ab8be1 100644 (file)
@@ -85,7 +85,7 @@ LY_DEFINE (ly_pfb_to_pfa, "ly:pfb->pfa",
   vector<char> pfb_string = gulp_file (file_name, 0);
   char *pfa = pfb2pfa ((Byte *) &pfb_string[0], pfb_string.size ());
   
-  SCM pfa_scm = scm_makfrom0str (pfa);
+  SCM pfa_scm = scm_from_locale_string (pfa);
   free (pfa);
 
   if (be_verbose_global)
index da3a8a01dd6f4c2f12100799137da6a19cd7f3a3..c0a24f47b2b3a0fb79b067c0deb84c7cddf2d152 100644 (file)
@@ -245,7 +245,7 @@ Pitch::print_smob (SCM s, SCM port, scm_print_state *)
 {
   Pitch *r = (Pitch *) SCM_CELL_WORD_1 (s);
   scm_puts ("#<Pitch ", port);
-  scm_display (scm_makfrom0str (r->to_string ().c_str ()), port);
+  scm_display (ly_string2scm (r->to_string ()), port);
   scm_puts (" >", port);
   return 1;
 }
index a45e089a08fce1d1fa53a524b4a9726a04e387f8..9c3b40d712640c79aad814c8ed24c3b85c889c25 100644 (file)
@@ -10,6 +10,7 @@
 #include "main.hh"
 #include "item.hh"
 #include "input.hh"
+#include "profile.hh"
 
 #include "ly-smobs.icc"
 
@@ -140,6 +141,11 @@ Prob::print_smob (SCM smob, SCM port, scm_print_state*)
 SCM
 Prob::internal_get_property (SCM sym) const
 {
+#ifndef NDEBUG
+  if (profile_property_accesses)
+    note_property_access (&prob_property_lookup_table, sym);
+#endif
+
   /*
     TODO: type checking
    */
index 6531a3f3302f7877e0bbd3a331961bbafe842058..e1862c723647d2785e4a0b5de11259be6db83ff5 100644 (file)
@@ -12,22 +12,25 @@ void note_property_access (SCM *table, SCM sym);
 
 SCM context_property_lookup_table;
 SCM grob_property_lookup_table;
+SCM prob_property_lookup_table;
 
-LY_DEFINE (ly_context_property_lookup_stats, "ly:context-property-lookup-stats",
-          0, 0, 0, (),
-          "")
+LY_DEFINE (ly_property_lookup_stats, "ly:property-lookup-stats",
+          1, 0, 0, (SCM sym),
+          "Return hash table with a property access corresponding to @var{sym}. "
+          "Choices are prob, grob and context.")
 {
-  return context_property_lookup_table ? context_property_lookup_table
-    : scm_c_make_hash_table (1);
+  if (sym == ly_symbol2scm ("context"))
+    return context_property_lookup_table ? context_property_lookup_table
+      : scm_c_make_hash_table (1);
+  if (sym == ly_symbol2scm ("prob"))
+    return prob_property_lookup_table ? prob_property_lookup_table
+      : scm_c_make_hash_table (1);
+  if (sym == ly_symbol2scm ("grob"))
+    return grob_property_lookup_table ? grob_property_lookup_table
+      : scm_c_make_hash_table (1);
+  return scm_c_make_hash_table (1);
 }
 
-LY_DEFINE (ly_property_lookup_stats, "ly:grob-property-lookup-stats",
-          0, 0, 0, (),
-          "")
-{
-  return grob_property_lookup_table ? grob_property_lookup_table
-    : scm_c_make_hash_table (1);
-}
 
 void
 note_property_access (SCM *table, SCM sym)
index 02213e4c71a68d1cfdddc2276e7e1b35580f36bd..0c87be9dc8de10c108662ea8fd4bba7562ce1de5 100644 (file)
@@ -7,6 +7,7 @@
 */
 
 #include "program-option.hh"
+#include "profile.hh"
 
 #include <cstdio>
 #include <cstring>
@@ -73,6 +74,11 @@ void internal_set_option (SCM var, SCM val)
       parsed_objects_should_be_dead = to_boolean (val);
       val = scm_from_bool (parsed_objects_should_be_dead);
     }
+  else if (var == ly_symbol2scm ("safe"))
+    {
+      be_safe_global = to_boolean (val);
+      val = scm_from_bool (be_safe_global);
+    }
   else if (var == ly_symbol2scm ("old-relative"))
     {
       lily_1_8_relative = to_boolean (val);
@@ -216,6 +222,13 @@ LY_DEFINE (ly_command_line_verbose_p, "ly:command-line-verbose?", 0, 0, 0, (),
 
 
 
+LY_DEFINE (ly_all_option, "ly:all-options",
+          0, 0, 0, (),
+          "Get all option settings in an alist.")
+{
+  return ly_hash2alist (option_hash);
+}
+
 
 LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
           "Get a global option setting.")
@@ -226,6 +239,7 @@ LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
 }
 
 
+
 bool
 get_program_option (const char *s)
 {
index 56301cd2a33b9c9a5b51fb32f67e0bb95fde4be9..0f9438383824778f12690aa3cfe9e60b666e8f1a 100644 (file)
@@ -102,7 +102,7 @@ Repeat_acknowledge_engraver::process_music ()
   if (!scm_is_string (wb) || ly_is_equal (db, wb))
     {
       if (s != "" || (volta_found && !scm_is_string (wb)))
-       context ()->set_property ("whichBar", scm_makfrom0str (s.c_str ()));
+       context ()->set_property ("whichBar", ly_string2scm (s));
     }
 }
 
index 5825671a17c69eeb84c28020c2c435820b232bb8..588df93abeb33fa99002fd442dcecc0f8716bf1c 100644 (file)
@@ -117,7 +117,7 @@ Rest_collision::calc_positioning_done (SCM smob)
     no partners to collide with
   */
   if (rests.size () + notes.size () < 2)
-    return SCM_UNSPECIFIED;
+    return SCM_BOOL_T;
 
   Real staff_space = Staff_symbol_referencer::staff_space (me);
   /*
@@ -155,7 +155,7 @@ Rest_collision::calc_positioning_done (SCM smob)
              if (ordered_rests[-d].size () > 1)
                ordered_rests[-d][0]->warning (_ ("too many colliding rests"));
 
-             return SCM_UNSPECIFIED;
+             return SCM_BOOL_T;
            }
        }
       while (flip (&d) != LEFT);
@@ -210,14 +210,14 @@ Rest_collision::calc_positioning_done (SCM smob)
          }
 
       if (!rcol)
-       return SCM_UNSPECIFIED;
+       return SCM_BOOL_T;
 
       Grob *rest = Note_column::get_rest (rcol);
       Grob *common = common_refpoint_of_array (notes, rcol, Y_AXIS);
 
       Interval restdim = rcol->extent (common, Y_AXIS);
       if (restdim.is_empty ())
-       return SCM_UNSPECIFIED;
+       return SCM_BOOL_T;
 
       Real staff_space = Staff_symbol_referencer::staff_space (rcol);
       Real minimum_dist = robust_scm2double (me->get_property ("minimum-distance"), 1.0) * staff_space;
@@ -249,7 +249,7 @@ Rest_collision::calc_positioning_done (SCM smob)
 
       Note_column::translate_rests (rcol, discrete_y);
     }
-  return SCM_UNSPECIFIED;
+  return SCM_BOOL_T;
 }
 
 ADD_INTERFACE (Rest_collision,
index e3543e4cb9545f2bef8eee0b2ce1b8b48fcf5afa..64a3eb87cdb01bf4bbacbd739d7106523f983e69 100644 (file)
@@ -187,12 +187,25 @@ Rest::generic_extent_callback (Grob *me, Axis a)
   return ly_interval2scm (unsmob_stencil (m)->extent (a));
 }
 
+MAKE_SCHEME_CALLBACK (Rest, pure_height, 3);
+SCM
+Rest::pure_height (SCM smob, SCM start, SCM end)
+{
+  (void) start;
+  (void) end;
+  
+  Grob *me = unsmob_grob (smob);
+  SCM m = brew_internal_stencil (me, false);
+  return ly_interval2scm (unsmob_stencil (m)->extent (Y_AXIS));
+}
+
 ADD_INTERFACE (Rest,
               "A rest symbol.",
 
               /* properties */
                  
-              "style "
               "direction "
-              "minimum-distance");
+              "minimum-distance "
+              "style "
+              );
 
index b48219ad44895e36a0f1ec77a705ba0563186014..3b256b01f4dd92cf8038f5789974b2a6f1ad028b 100644 (file)
@@ -114,67 +114,3 @@ LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format",
   scm_remember_upto_here_1 (prot);
   return output;
 }
-
-LY_DEFINE (ly_score_process, "ly:render-music-as-systems",
-          5, 0, 0, (SCM music,
-                    SCM outdef,
-                    SCM book_outputdef,
-                    SCM header,
-                    SCM outname),
-          "Create output using a default \\book block. ")
-{
-  SCM_ASSERT_TYPE(unsmob_music(music), music,
-                 SCM_ARG1, __FUNCTION__, "music");
-  SCM_ASSERT_TYPE(unsmob_output_def (outdef), outdef,
-                 SCM_ARG2, __FUNCTION__, "output def");
-  SCM_ASSERT_TYPE(unsmob_output_def (book_outputdef), book_outputdef,
-                 SCM_ARG3, __FUNCTION__, "output def");
-  SCM_ASSERT_TYPE(scm_is_string (outname), outname,
-                 SCM_ARG5, __FUNCTION__, "string");
-  
-  
-  SCM scaled_def = outdef;
-  SCM scaled_bookdef = book_outputdef;
-
-  Output_def *bpd = unsmob_output_def (book_outputdef);
-
-  /* ugh .  */
-  assert (bpd->c_variable ("is-paper") == SCM_BOOL_T);
-
-  Real scale = scm_to_double (bpd->c_variable ("output-scale"));
-
-  Output_def *def = scale_output_def (unsmob_output_def (outdef), scale);
-  Output_def *bdef = scale_output_def (bpd, scale);
-  def->parent_ = bdef;
-
-  scaled_def = def->self_scm ();
-  scaled_bookdef = bdef->self_scm ();
-
-  def->unprotect ();
-  bdef->unprotect ();
-
-  SCM context = ly_run_translator (music, scaled_def, SCM_BOOL_F);
-  SCM output_as_scm = ly_format_output (context);
-  Music_output *output = unsmob_music_output (output_as_scm);
-
-  Paper_score *pscore = dynamic_cast<Paper_score *> (output);
-  assert (pscore);
-
-  /* ugh, this is strange, Paper_book without a Book object. */
-  Paper_book *paper_book = new Paper_book ();
-  paper_book->header_ = header;
-  paper_book->paper_ = unsmob_output_def (scaled_bookdef);
-
-  if (ly_is_module (header))
-    paper_book->add_score (header);
-
-  paper_book->add_score (pscore->self_scm ());
-  paper_book->classic_output (outname);
-  paper_book->unprotect ();
-
-  scm_remember_upto_here_1 (scaled_def);
-  scm_remember_upto_here_1 (scaled_bookdef);
-
-  return SCM_UNSPECIFIED;
-}
-
index 7a02ac578b6b3ba14e57fd6c203f5f1378cd9b09..7b3ff58f89e3d77ea92ef79e5fa6fbe1797015c9 100644 (file)
@@ -58,8 +58,10 @@ Semi_tie_column::calc_positioning_done (SCM smob)
   Ties_configuration base = problem.generate_optimal_chord_configuration ();
   for (vsize i = 0; i < lv_ties.size(); i++)
     {
-      Tie::set_control_points (lv_ties[i], problem.common_x_refpoint (), base[i],
-                              problem.details_);
+      SCM cp = Tie::get_control_points (lv_ties[i], problem.common_x_refpoint (), base[i],
+                                       problem.details_);
+
+      lv_ties[i]->set_property ("control-points", cp);
       set_grob_direction (lv_ties[i], base[i].dir_);
     }
 
index 77b266e6c43aeea6704dcaeccd5b3a4738a3d12c..80a56e4c74846e150515d7cbd952d312737e9716 100644 (file)
@@ -23,6 +23,7 @@ ADD_INTERFACE(Semi_tie,
              "control-points "
              "direction "
              "details "
+             "head-direction "
              "note-head "
              "thickness "
              );
@@ -43,8 +44,8 @@ Semi_tie::calc_control_points (SCM smob)
       programming_error ("lv tie without Semi_tie_column. Killing lv tie."); 
       me->suicide (); 
     }
-  
-  return SCM_UNSPECIFIED;
+
+  return me->get_property_data ("control-points");
 }
 
 int
index ffc4bfcbfce26bad151ab0240007c89602ed26bd..9c71e6c44808f3900a4ee8caf1f8c708b1d49b04 100644 (file)
@@ -356,29 +356,6 @@ next_spaceable_column (vector<Grob*> const &list, vsize starting)
   return 0;
 }
 
-static void
-get_column_spring (Grob *this_col, Grob *next_col, Real *ideal, Real *inv_hooke)
-{
-  Spring_smob *spring = 0;
-
-  for (SCM s = this_col->get_object ("ideal-distances");
-       !spring && scm_is_pair (s);
-       s = scm_cdr (s))
-    {
-      Spring_smob *sp = unsmob_spring (scm_car (s));
-
-      if (sp->other_ == next_col)
-       spring = sp;
-    }
-
-  if (!spring)
-    programming_error (_f ("No spring between column %d and next one",
-                          Paper_column::get_rank (this_col)));
-
-  *ideal = (spring) ? spring->distance_ : 5.0;
-  *inv_hooke = (spring) ? spring->inverse_strength_ : 1.0;
-}
-
 static Column_description
 get_column_description (vector<Grob*> const &cols, vsize col_index, bool line_starter)
 {
@@ -389,10 +366,10 @@ get_column_description (vector<Grob*> const &cols, vsize col_index, bool line_st
   Column_description description;
   Grob *next_col = next_spaceable_column (cols, col_index);
   if (next_col)
-    get_column_spring (col, next_col, &description.ideal_, &description.inverse_hooke_);
+    Spaceable_grob::get_spring (col, next_col, &description.ideal_, &description.inverse_hooke_);
   Grob *end_col = dynamic_cast<Item*> (cols[col_index+1])->find_prebroken_piece (LEFT);
   if (end_col)
-    get_column_spring (col, end_col, &description.end_ideal_, &description.end_inverse_hooke_);
+    Spaceable_grob::get_spring (col, end_col, &description.end_ideal_, &description.end_inverse_hooke_);
 
   for (SCM s = Spaceable_grob::get_minimum_distances (col);
        scm_is_pair (s); s = scm_cdr (s))
index bccee086c57491ec90024ff865f21d1fa9c2d29c..ef252da5ddac8191893816d0f45fefe6e8252166 100644 (file)
@@ -362,7 +362,7 @@ Slur_score_state::get_best_curve ()
        }
   
       slur_->set_property ("quant-score",
-                          scm_makfrom0str (total.c_str ()));
+                          ly_string2scm (total));
     }
 #endif
 
index 4415e8dad70978c15fef06b31c2f6cd6791f7a2b..e6aae1ceaebd05be3c197777c1032babc52c1450 100644 (file)
@@ -138,9 +138,9 @@ Source_file::Source_file (string filename_string)
 void
 Source_file::init_port ()
 {
-  SCM str = scm_makfrom0str (c_str ());
+  SCM str = scm_from_locale_string (c_str ());
   str_port_ = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG, __FUNCTION__);
-  scm_set_port_filename_x (str_port_, scm_makfrom0str (name_.c_str ()));
+  scm_set_port_filename_x (str_port_, ly_string2scm (name_));
 }
 
 
index 7d86ebf9195ac73a7356e1f187a2807430be2fca..4ec46bbd84ff24a6807847e400b0ce96065432f8 100644 (file)
@@ -15,6 +15,7 @@
 #include "pointer-group-interface.hh"
 #include "grob.hh"
 #include "paper-column.hh"
+#include "international.hh"
 
 SCM
 Spaceable_grob::get_minimum_distances (Grob *me)
@@ -98,20 +99,29 @@ Spaceable_grob::add_spring (Grob *me, Grob *other,
 }
 
 void
-Spaceable_grob::get_spring (Grob *me, Grob *other, Real *dist, Real *inv_strength)
+Spaceable_grob::get_spring (Grob *this_col, Grob *next_col, Real *dist, Real *inv_strength)
 {
-  for (SCM s = me->get_object ("ideal-distances");
-       scm_is_pair (s); s = scm_cdr (s))
+  Spring_smob *spring = 0;
+
+  for (SCM s = this_col->get_object ("ideal-distances");
+       !spring && scm_is_pair (s);
+       s = scm_cdr (s))
     {
-      Spring_smob *spring = unsmob_spring (scm_car (s));
-      if (spring && spring->other_ == other)
-       {
-         *dist = spring->distance_;
-         *inv_strength = spring->inverse_strength_;
-       }
+      Spring_smob *sp = unsmob_spring (scm_car (s));
+
+      if (sp && sp->other_ == next_col)
+       spring = sp;
     }
+
+  if (!spring)
+    programming_error (_f ("No spring between column %d and next one",
+                          Paper_column::get_rank (this_col)));
+
+  *dist = (spring) ? spring->distance_ : 5.0;
+  *inv_strength = (spring) ? spring->inverse_strength_ : 1.0;
 }
 
+
 void
 Spaceable_grob::remove_interface (Grob *me)
 {
index 4566d73f77080e486530436499324cc48f67b630..bd10b1c671223435cf97786178e7dfe74d4b68cb 100644 (file)
@@ -185,7 +185,7 @@ Span_bar::calc_glyph_name (SCM smob)
   else if (type == ":|:")
     type = ".|.";
 
-  return scm_makfrom0str (type.c_str ());
+  return ly_string2scm (type);
 }
 
 Interval
index cf927a5e51a8253a8df1ae5b45f5dc9693dad597..60cde74744edbf31b59b8c75ecb0ff0051705d60 100644 (file)
@@ -33,8 +33,8 @@ Stem_tremolo::calc_slope (SCM smob)
       if (is_number_pair (s))
        dy = - scm_to_double (scm_car (s)) + scm_to_double (scm_cdr (s));
 
-      Grob *s2 = Beam::last_visible_stem (beam);
-      Grob *s1 = Beam::first_visible_stem (beam);
+      Grob *s2 = Beam::last_normal_stem (beam);
+      Grob *s1 = Beam::first_normal_stem (beam);
       
       Grob *common = s1->common_refpoint (s2, X_AXIS);
       Real dx = s2->relative_coordinate (common, X_AXIS) -
index 6757582869960d15ecd600493113f6af459a225c..e155a0611e628b64657a09bf6a0f54241f5d80e0 100644 (file)
@@ -214,12 +214,9 @@ Stem::add_head (Grob *me, Grob *n)
 bool
 Stem::is_invisible (Grob *me)
 {
-  Real stemlet_length = robust_scm2double (me->get_property ("stemlet-length"),
-                                          0.0);
-
-  return !((head_count (me)
-           || stemlet_length > 0.0)
-          && scm_to_int (me->get_property ("duration-log")) >= 1);
+  return !is_normal_stem (me)
+    && (robust_scm2double (me->get_property ("stemlet-length"),
+                          0.0) == 0.0);
 }
 
 
@@ -236,14 +233,17 @@ Stem::pure_height (SCM smob, SCM start, SCM end)
 {
   (void) start;
   (void) end;
-  
-  
+
   Grob *me = unsmob_grob (smob);
+  Interval iv;
+
+  if (!is_normal_stem (me))
+    return ly_interval2scm (iv);
+  
   Real ss = Staff_symbol_referencer::staff_space (me);
   Real len = scm_to_double (calc_length (smob)) * ss / 2;
   Direction dir = get_grob_direction (me);
 
-  Interval iv;
   Interval hp = head_positions (me);
   if (dir == UP)
     iv = Interval (0, len);
index 8fee38257286408c69ed8df8ce4042ece36a7ca2..5070f9426cd92506b77d97e3a9f108200f55e1ff 100644 (file)
@@ -23,6 +23,7 @@
 #include "staff-symbol-referencer.hh"
 #include "tweak-registration.hh"
 #include "warn.hh"
+#include "lookup.hh"
 
 extern bool debug_skylines;
 
@@ -399,8 +400,8 @@ System::get_paper_system ()
                                 exprs));
   if (debug_skylines)
     {
-      sys_stencil.add_stencil (points_to_line_stencil (skylines_[UP].to_points ()).in_color (255, 0, 0));
-      sys_stencil.add_stencil (points_to_line_stencil (skylines_[DOWN].to_points ()).in_color (0, 255, 0));
+      sys_stencil.add_stencil (Lookup::points_to_line_stencil (0.1, skylines_[UP].to_points ()).in_color (255, 0, 0));
+      sys_stencil.add_stencil (Lookup::points_to_line_stencil (0.1, skylines_[DOWN].to_points ()).in_color (0, 255, 0));
     }
 
   Grob *left_bound = this->get_bound (LEFT);
@@ -445,9 +446,7 @@ System::broken_col_range (Item const *left, Item const *right) const
   
   extract_grob_set (this, "columns", cols);
 
-  vsize i = binary_search (cols, (Grob *) left,
-                          Paper_column::less_than);
-
+  vsize i = Paper_column::get_rank (left);
   int end_rank = Paper_column::get_rank (right);
   if (i < cols.size ())
     i++;
@@ -494,11 +493,7 @@ Grob*
 System::column (int which) const
 {
   extract_grob_set (this, "columns", columns);
-  for (vsize i = 0; i < columns.size (); i++)
-    if (dynamic_cast<Paper_column*> (columns[i])->get_rank () == which)
-      return columns[i];
-  programming_error ("couldn't find the column of the requested index");
-  return columns[0];
+  return columns[which];
 }
 
 Paper_score*
index 164d0062ffdf5452a97560207321591c2fe1347a..fcab0495f858d693f9efe9c548f036cdc0fabd99 100644 (file)
@@ -31,7 +31,7 @@ lookup_tex_text_dimension (Font_metric *font, SCM text)
   if (text_dimension_hash_tab)
     {
       scm_hash_ref (text_dimension_hash_tab,
-                   scm_makfrom0str (key_str.c_str ()),
+                   ly_string2scm (key_str),
                    SCM_BOOL_F);
     }
   if (scm_is_pair (val))
index dd54530e812edd8e5afcc581573ea0f8a393d0be..2121d318ce0edc54108aa612467db9c2662dabb4 100644 (file)
@@ -100,9 +100,11 @@ Tie_column::calc_positioning_done (SCM smob)
 
   for (vsize i = 0; i < base.size(); i++)
     {
-      Tie::set_control_points (ties[i], problem.common_x_refpoint (),
-                              base[i],
-                              problem.details_);
+      SCM cp = Tie::get_control_points (ties[i], problem.common_x_refpoint (),
+                                       base[i],
+                                       problem.details_);
+
+      ties[i]->set_property ("control-points", cp);
       set_grob_direction (ties[i],
                          base[i].dir_);
 
@@ -120,7 +122,7 @@ Tie_column::calc_positioning_done (SCM smob)
            card += to_string ("TOTAL=%.2f", base.score ());
          
          ties[i]->set_property ("quant-score",
-                                scm_makfrom0str (card.c_str ()));
+                                ly_string2scm (card));
        }
 #endif
       
index 243b14b43f86dad60776736f2006d89fb308e69e..9efe4784dc71a16da36a53ba484bc68bd85af1b9 100644 (file)
@@ -9,7 +9,6 @@
 #include "engraver.hh"
 
 #include "context.hh"
-#include "grob-pitch-tuple.hh"
 #include "international.hh"
 #include "item.hh"
 #include "note-head.hh"
@@ -160,8 +159,8 @@ Tie_engraver::start_translation_timestep ()
 {
   context ()->set_property ("tieMelismaBusy",
                            ly_bool2scm (heads_to_tie_.size ()));
-  
-  if (!to_boolean (get_property ("tieWaitForNote")))
+
+  if (heads_to_tie_.size () && !to_boolean (get_property ("tieWaitForNote")))
     {
       Moment now = now_mom ();
       for (vsize i = heads_to_tie_.size ();  i--; )
index d9d58cec70baa673fb738fff12573c0e662f44ee..7a751e14d2fb779025fb20467673519add0b1323 100644 (file)
@@ -294,8 +294,7 @@ Tie_formatting_problem::from_ties (vector<Grob*> const &ties)
       do
        {
          spec.note_head_drul_[d] = Tie::head (ties[i], d);
-         spec.column_ranks_[d] =
-           dynamic_cast<Spanner*> (ties[i])->get_bound (d)->get_column ()->get_rank ();
+         spec.column_ranks_[d] = Tie::get_column_rank (ties[i], d);
        }
       while (flip (&d) != LEFT);
       specifications_.push_back (spec);
@@ -328,7 +327,7 @@ Tie_formatting_problem::from_semi_ties (vector<Grob*> const &semi_ties, Directio
       spec.get_tie_manual_settings (semi_ties[i]);
       
       spec.note_head_drul_[head_dir] = head;
-      column_rank = dynamic_cast<Item*> (head)->get_column ()->get_rank ();
+      column_rank = Tie::get_column_rank (semi_ties[i], head_dir);
       spec.column_ranks_ = Drul_array<int> (column_rank, column_rank);
       heads.push_back (head);
       specifications_.push_back (spec);
index 50519bc4f55ab4ae5da1f4e25a59e593d2c4d7a3..1e94638f3981e5ad3551d94d2df8dc1704f15fa0 100644 (file)
@@ -152,16 +152,16 @@ Tie::calc_direction (SCM smob)
     {
       /* trigger positioning. */
       (void) yparent->get_property ("positioning-done");
+
+      return me->get_property_data ("direction");
     }
   else
-    set_grob_direction (me, Tie::get_default_dir (me));
-
-  return SCM_UNSPECIFIED;
+    return scm_from_int (Tie::get_default_dir (me));
 }
 
 
-void
-Tie::set_default_control_points (Grob *me_grob)
+SCM
+Tie::get_default_control_points (Grob *me_grob)
 {
   Spanner *me = dynamic_cast<Spanner*> (me_grob);
   Grob *common  = me;
@@ -174,17 +174,18 @@ Tie::set_default_control_points (Grob *me_grob)
   spec.has_manual_dir_ = true;
   spec.manual_dir_ = get_grob_direction (me);
 
-  if (me->is_live ())
-    {
-      Tie_configuration conf
-       = problem.find_optimal_tie_configuration (spec);
+  if (!me->is_live ())
+    return SCM_EOL;
+
+  Tie_configuration conf
+    = problem.find_optimal_tie_configuration (spec);
   
-      set_control_points (me, problem.common_x_refpoint (),
-                         conf, problem.details_);
-    }
+  return get_control_points (me, problem.common_x_refpoint (),
+                            conf, problem.details_);
 }
-void
-Tie::set_control_points (Grob *me,
+
+SCM
+Tie::get_control_points (Grob *me,
                         Grob *common,
                         Tie_configuration const &conf,
                         Tie_details const &details
@@ -200,9 +201,10 @@ Tie::set_control_points (Grob *me,
        programming_error ("Insane offset");
       controls = scm_cons (ly_offset2scm (b.control_[i]), controls);
     }
-  me->set_property ("control-points", controls);
+  return controls;
 }
 
+
 MAKE_SCHEME_CALLBACK(Tie, calc_control_points, 1);
 SCM
 Tie::calc_control_points (SCM smob)
@@ -222,12 +224,13 @@ Tie::calc_control_points (SCM smob)
       (void) yparent->get_property ("positioning-done");
     }
 
-  if (!scm_is_pair (me->get_property_data ("control-points")))
+  SCM cp = me->get_property_data ("control-points");
+  if (!scm_is_pair (cp))
     {
-      set_default_control_points (me);
+      cp = get_default_control_points (me);
     }
 
-  return SCM_UNSPECIFIED;
+  return cp;
 }
 
 /*
index 9ab2673eeb86a23a7694700e886f5b0a13242086..973a1d8c5eb696d13f802ca1c590b268431fd578 100644 (file)
 #include "input.hh"
 #include "international.hh"
 #include "music.hh"
-#include "sequential-iterator.hh"
+#include "music-wrapper-iterator.hh"
 
 /*
   Iterates \times, by sending TupletSpanEvents at the start/end of each
   tuplet bracket. Extra stop/start events are sent at regular
   intervals if tupletSpannerDuration is set.
 */
-class Time_scaled_music_iterator : public Sequential_iterator
+class Time_scaled_music_iterator : public Music_wrapper_iterator
 {
 public:
   DECLARE_SCHEME_CALLBACK (constructor, ());
@@ -26,7 +26,6 @@ public:
   DECLARE_CLASSNAME(Time_scaled_music_iterator);
   Time_scaled_music_iterator ();
 protected:
-  virtual SCM get_music_list () const;
   virtual void process (Moment m);
   virtual void construct_children ();
   virtual void derived_mark () const;
@@ -42,18 +41,26 @@ private:
   /* Recycle start/stop events if tupletSpannerDuration is set. */
   Music *start_;
   Music *stop_;
+
+  bool done_first_;
+  
+  Context_handle tuplet_handler_;
 };
 
 Time_scaled_music_iterator::Time_scaled_music_iterator ()
 {
   spanner_duration_ = next_split_mom_ = 0;
+  done_first_ = 0;
 }
 
 
 Moment
 Time_scaled_music_iterator::pending_moment () const
 {
-  Moment next_mom = Sequential_iterator::pending_moment ();
+  if (!done_first_)
+    return Moment (0);
+  
+  Moment next_mom = Music_wrapper_iterator::pending_moment ();
 
   if (spanner_duration_.to_bool () &&
       next_mom.main_part_ > next_split_mom_)
@@ -68,10 +75,21 @@ Time_scaled_music_iterator::pending_moment () const
 void
 Time_scaled_music_iterator::process (Moment m)
 {
+  if (!done_first_)
+    {
+      done_first_ = true;
+      descend_to_bottom_context ();
+      report_event (start_);
+      tuplet_handler_.set_context (get_outlet());
+    }
+
   if (spanner_duration_.to_bool () &&
       m.main_part_ == next_split_mom_)
     {
-      report_event (stop_);
+      descend_to_bottom_context ();
+      stop_->send_to_context (tuplet_handler_.get_outlet ());
+      
+      tuplet_handler_.set_context (get_outlet ());
       report_event (start_);
       
       next_split_mom_ += spanner_duration_;
@@ -79,7 +97,16 @@ Time_scaled_music_iterator::process (Moment m)
       if (next_split_mom_ == get_music ()->get_length ().main_part_)
        next_split_mom_.set_infinite (1);
     }
-  Sequential_iterator::process(m);
+
+  Music_wrapper_iterator::process(m);
+  if (child_iter_ && child_iter_->ok ())
+    descend_to_child (child_iter_->get_outlet ());
+  
+  if (m.main_part_ == music_get_length ().main_part_)
+    {
+      stop_->send_to_context (tuplet_handler_.get_outlet ());
+      tuplet_handler_.set_context (0);
+    }
 }
 
 void
@@ -117,16 +144,10 @@ Time_scaled_music_iterator::construct_children ()
       next_split_mom_ = spanner_duration_;
     }
 
-  Sequential_iterator::construct_children ();
-}
-
-SCM
-Time_scaled_music_iterator::get_music_list () const
-{
-  Music *mus = get_music ();
-  SCM child = mus->get_property ("element");
+  Music_wrapper_iterator::construct_children ();
 
-  return scm_list_3 (start_->self_scm (), child, stop_->self_scm ());
+  if (child_iter_ && child_iter_->ok ())
+    descend_to_child (child_iter_->get_outlet ());
 }
 
 void
@@ -137,7 +158,7 @@ Time_scaled_music_iterator::derived_mark () const
   if (stop_)
     scm_gc_mark (stop_->self_scm ());
 
-  Sequential_iterator::derived_mark ();
+  Music_wrapper_iterator::derived_mark ();
 }
 
 IMPLEMENT_CTOR_CALLBACK (Time_scaled_music_iterator);
index 68a7e178b042da9a83d4c9802521c939efad02fc..5cf3ebdc61d64c81954d72c90ad10acc54f6b48e 100644 (file)
@@ -66,9 +66,14 @@ Time_signature_engraver::process_music ()
                       int (scm_to_int (scm_car (fr)))));
        }
 
-      last_time_fraction_ = fr;
       time_signature_ = make_item ("TimeSignature", SCM_EOL);
       time_signature_->set_property ("fraction", fr);
+
+      if (last_time_fraction_ == SCM_BOOL_F)
+       time_signature_->set_property ("break-visibility",
+                                      get_property ("implicitTimeSignatureVisibility"));
+      
+      last_time_fraction_ = fr;
     }
 }
 
@@ -81,7 +86,13 @@ Time_signature_engraver::stop_translation_timestep ()
 #include "translator.icc"
 
 ADD_TRANSLATOR (Time_signature_engraver,
-               /* doc */ "Create a TimeSignature whenever @code{timeSignatureFraction} changes",
-               /* create */ "TimeSignature",
-               /* read */ "",
+               /* doc */ "Create a @ref{TimeSignature} whenever @code{timeSignatureFraction} changes",
+               /* create */
+               "TimeSignature ",
+               
+               /* read */
+               "implicitTimeSignatureVisibility "
+               "timeSignatureFraction "
+
+               ,
                /* write */ "");
index ced6468e8dbba8dcc2d0c042cedc4c924b1ff264..fa1bfadbd6954467bd9ba36122413e0aaed57eb7 100644 (file)
@@ -94,9 +94,9 @@ Time_signature::numbered_time_signature (Grob *me, int num, int den)
                    chain);
 
   SCM sn = Text_interface::interpret_markup (me->layout ()->self_scm (), chain,
-                                            scm_makfrom0str (to_string (num).c_str ()));
+                                            ly_string2scm (to_string (num)));
   SCM sd = Text_interface::interpret_markup (me->layout ()->self_scm (), chain,
-                                            scm_makfrom0str (to_string (den).c_str ()));
+                                            ly_string2scm (to_string (den)));
 
   Stencil n = *unsmob_stencil (sn);
   Stencil d = *unsmob_stencil (sd);
index 83feef1634468e1b33cd052d88e53fd532418606..bca809281bbb5f02eeca9372df8f5cfe9f010f8c 100644 (file)
@@ -9,6 +9,7 @@
 #include "score-engraver.hh"
 #include "score-performer.hh"
 #include "warn.hh"
+#include "international.hh"
 
 /*
   Quick & dirty.
@@ -25,11 +26,13 @@ get_translator_group (SCM sym)
   else if (sym == ly_symbol2scm ("Score_performer"))
     return new Score_performer ();
 
-  programming_error ("Couldn't find type");
+  error (_f ("fatal error. Couldn't find type: %s",
+            ly_symbol2string (sym).c_str ()));
   scm_flush (scm_current_error_port ());
   scm_display (sym, scm_current_error_port ());
   scm_flush (scm_current_error_port ());
   
-  assert (0);
+  exit (2);
+  
   return 0;
 }
index b7a46d29b65b20c67aa724b351012b0c18817da3..8820879e019cc168c438790003873660ac89b8a0 100644 (file)
@@ -199,7 +199,7 @@ Translator::static_translator_description (const char *grobs,
                                 parse_symbol_list (grobs), static_properties);
   
   static_properties = scm_acons (ly_symbol2scm ("description"),        
-                                scm_makfrom0str (desc), static_properties); 
+                                scm_from_locale_string (desc), static_properties); 
   
   SCM list = SCM_EOL;
   for (; listener_list; listener_list = listener_list->next_)
index 2e5eb8865d14a6223f787afda487d1745d49eab3..1cb6fdc83cb71f52a9310b08730a9b919ba77f41 100644 (file)
@@ -231,7 +231,7 @@ LY_DEFINE (ly_ttf_ps_name, "ly:ttf-ps-name",
 
   FT_Face face = open_ft_face (file_name);
   char const *ps_name_str0 = FT_Get_Postscript_Name (face);
-  SCM ps_name = scm_makfrom0str (ps_name_str0 ? ps_name_str0 : "");
+  SCM ps_name = scm_from_locale_string (ps_name_str0 ? ps_name_str0 : "");
   
   FT_Done_Face (face);
   
index d13cf1c613e50d7103533c0f9c779334e73008cb..4d4fbe9acb9b858fff0f76974566ddc862a1a133 100644 (file)
@@ -511,37 +511,10 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy)
   
   Direction dir = get_grob_direction (me);
 
-  /*
-    Use outer non-rest columns to determine slope
-  */
-  Grob *left_col = 0;
-  Grob *right_col = 0;
-  get_bounds (me, &left_col, &right_col);
-  if (left_col && right_col)
-    {
-      Interval rv = right_col->extent (commony, Y_AXIS);
-      Interval lv = left_col->extent (commony, Y_AXIS);
-      rv.unite (staff);
-      lv.unite (staff);
-      Real graphical_dy = rv[dir] - lv[dir];
-
-      Slice ls = Note_column::head_positions_interval (left_col);
-      Slice rs = Note_column::head_positions_interval (right_col);
-
-      Interval musical_dy;
-      musical_dy[UP] = rs[UP] - ls[UP];
-      musical_dy[DOWN] = rs[DOWN] - ls[DOWN];
-      if (sign (musical_dy[UP]) != sign (musical_dy[DOWN]))
-       *dy = 0.0;
-      else if (sign (graphical_dy) != sign (musical_dy[DOWN]))
-       *dy = 0.0;
-      else
-       *dy = graphical_dy;
-    }
-  else
-    *dy = 0;
+  bool equally_long = false;
+  Grob *par_beam = parallel_beam (me, columns, &equally_long);
+  
 
-  *offset = -dir * infinity_f;
 
   Item *lgr = get_x_bound_item (me, LEFT, dir);
   Item *rgr = get_x_bound_item (me, RIGHT, dir);
@@ -549,18 +522,82 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy)
   Real x1 = robust_relative_extent (rgr, commonx, X_AXIS)[RIGHT];
 
   vector<Offset> points;
-  points.push_back (Offset (x0 - x0, staff[dir]));
-  points.push_back (Offset (x1 - x0, staff[dir]));
 
-  for (vsize i = 0; i < columns.size (); i++)
+  if (columns.size ()
+      && par_beam
+      && get_grob_direction (par_beam) == dir 
+      && Note_column::get_stem (columns[0])
+      && Note_column::get_stem (columns.back ()))
+    {
+      /*
+       trigger set_stem_ends
+       */
+      (void) par_beam->get_property ("quantized-positions");
+
+
+      Drul_array<Grob *> stems (Note_column::get_stem (columns[0]),
+                               Note_column::get_stem (columns.back ()));
+
+      
+      
+
+      Real ss = 0.5 * Staff_symbol_referencer::staff_space (me);
+      Real lp = ss * robust_scm2double (stems[LEFT]->get_property ("stem-end-position"), 0.0);
+      Real rp = ss * robust_scm2double (stems[RIGHT]->get_property ("stem-end-position"), 0.0);
+
+      *dy = rp - lp;
+      points.push_back (Offset (stems[LEFT]->relative_coordinate (commonx, X_AXIS) - x0, lp));
+      points.push_back (Offset (stems[RIGHT]->relative_coordinate (commonx, X_AXIS) - x0, rp));
+    }
+  else
     {
-      Interval note_ext = columns[i]->extent (commony, Y_AXIS);
-      Real notey = note_ext[dir] - me->relative_coordinate (commony, Y_AXIS);
+      /*
+       Use outer non-rest columns to determine slope
+      */
+      Grob *left_col = 0;
+      Grob *right_col = 0;
+      get_bounds (me, &left_col, &right_col);
+      if (left_col && right_col)
+       {
+         Interval rv = right_col->extent (commony, Y_AXIS);
+         Interval lv = left_col->extent (commony, Y_AXIS);
+         rv.unite (staff);
+         lv.unite (staff);
+         Real graphical_dy = rv[dir] - lv[dir];
+
+         Slice ls = Note_column::head_positions_interval (left_col);
+         Slice rs = Note_column::head_positions_interval (right_col);
+
+         Interval musical_dy;
+         musical_dy[UP] = rs[UP] - ls[UP];
+         musical_dy[DOWN] = rs[DOWN] - ls[DOWN];
+         if (sign (musical_dy[UP]) != sign (musical_dy[DOWN]))
+           *dy = 0.0;
+         else if (sign (graphical_dy) != sign (musical_dy[DOWN]))
+           *dy = 0.0;
+         else
+           *dy = graphical_dy;
+       }
+      else
+       *dy = 0;
 
-      Real x = columns[i]->relative_coordinate (commonx, X_AXIS) - x0;
-      points.push_back (Offset (x, notey));
+      *offset = -dir * infinity_f;      
+      for (vsize i = 0; i < columns.size (); i++)
+       {
+         Interval note_ext = columns[i]->extent (commony, Y_AXIS);
+         Real notey = note_ext[dir] - me->relative_coordinate (commony, Y_AXIS);
+
+         Real x = columns[i]->relative_coordinate (commonx, X_AXIS) - x0;
+         points.push_back (Offset (x, notey));
+       }
     }
 
+  if (!(par_beam && get_grob_direction (par_beam) == dir))
+    {
+      points.push_back (Offset (x0 - x0, staff[dir]));
+      points.push_back (Offset (x1 - x0, staff[dir]));
+    }
+  
   /*
     This is a slight hack. We compute two encompass points from the
     bbox of the smaller tuplets.
@@ -647,7 +684,6 @@ SCM
 Tuplet_bracket::calc_positions (SCM smob)
 {
   Spanner *me = unsmob_spanner (smob);
-  extract_grob_set (me, "note-columns", columns);
 
   /*
     Don't print if it doesn't span time.
@@ -659,44 +695,9 @@ Tuplet_bracket::calc_positions (SCM smob)
       return SCM_EOL;
     }
 
-  
-  Direction dir = get_grob_direction (me);
-  bool equally_long = false;
-  Grob *par_beam = parallel_beam (me, columns, &equally_long);
-
-  /*
-    We follow the beam only if there is one, and we are next to it.
-  */
   Real dy = 0.0;
   Real offset = 0.0;
-  if (!par_beam
-      || get_grob_direction (par_beam) != dir)
-    calc_position_and_height (me, &offset, &dy);
-  else if  (columns.size ()
-           && Note_column::get_stem (columns[0])
-           && Note_column::get_stem (columns.back ()))
-    {
-      /*
-       trigger set_stem_ends
-       */
-      (void) par_beam->get_property ("quantized-positions");
-
-
-      Drul_array<Grob *> stems (Note_column::get_stem (columns[0]),
-                               Note_column::get_stem (columns.back ()));
-
-      
-      
-
-      Real ss = 0.5 * Staff_symbol_referencer::staff_space (me);
-      Real lp = ss * robust_scm2double (stems[LEFT]->get_property ("stem-end-position"), 0.0);
-      Real rp = ss * robust_scm2double (stems[RIGHT]->get_property ("stem-end-position"), 0.0);
-
-      
-      offset = lp + dir * (0.5 + scm_to_double (me->get_property ("padding")));
-      dy = (rp - lp);
-    }
-
+  calc_position_and_height (me, &offset, &dy);
   
   SCM x = scm_cons (scm_from_double (offset),
                    scm_from_double (offset + dy));
index 66930ce6bd892abff022f6ebfd1462b52c347e55..fd280e127e2978475315f8112afa848a9d798248 100644 (file)
@@ -81,7 +81,9 @@ Tuplet_engraver::process_music ()
 {
   for (vsize i = 0; i < stopped_tuplets_.size (); i++)
     {
-      if (stopped_tuplets_[i].bracket_)
+      Spanner *bracket = stopped_tuplets_[i].bracket_;
+      Spanner *number = stopped_tuplets_[i].number_;
+      if (bracket)
        {
          if (stopped_tuplets_[i].full_length_)
            {
@@ -90,20 +92,20 @@ Tuplet_engraver::process_music ()
                             ? get_property ("currentMusicalColumn")
                             : get_property ("currentCommandColumn"));
              
-             stopped_tuplets_[i].bracket_->set_bound (RIGHT, col);
-             stopped_tuplets_[i].number_->set_bound (RIGHT, col);
+             bracket->set_bound (RIGHT, col);
+             number->set_bound (RIGHT, col);
            }
-         else if (!stopped_tuplets_[i].bracket_->get_bound (RIGHT))
+         else if (!bracket->get_bound (RIGHT))
            {
-             stopped_tuplets_[i].bracket_->set_bound (RIGHT,
-                                                      stopped_tuplets_[i].bracket_->get_bound (LEFT));
-             stopped_tuplets_[i].number_->set_bound (RIGHT,
+             bracket->set_bound (RIGHT,
+                                 bracket->get_bound (LEFT));
+             number->set_bound (RIGHT,
                                                      stopped_tuplets_[i].bracket_->get_bound (LEFT));
            }
          // todo: scrap last_tuplets_, use stopped_tuplets_ only.
          // clear stopped_tuplets_ at start_translation_timestep
-         last_tuplets_.push_back (tuplets_[i].bracket_);
-         last_tuplets_.push_back (tuplets_[i].number_);
+         last_tuplets_.push_back (bracket);
+         last_tuplets_.push_back (number);
        }
     }
   stopped_tuplets_.clear ();
index 608cb16c66c87b23c5ed7411d29b4f565d4322d2..6cd3c0bdac6de7f13a4003c04e6f12c291160224 100644 (file)
@@ -681,7 +681,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
 
       if (prev_primitive)
        prev_primitive->set_property ("glyph-name",
-                                     scm_makfrom0str (prev_glyph_name.c_str ()));
+                                     ly_string2scm (prev_glyph_name));
 
       /*
        * In the backend, flexa shapes and joins need to know about line
@@ -699,7 +699,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
     }
 
   prev_primitive->set_property ("glyph-name",
-                               scm_makfrom0str (prev_glyph_name.c_str ()));
+                               ly_string2scm (prev_glyph_name));
 
   align_heads (primitives, flexa_width, thickness);
 
index 830aa78fd7283ac2ea37f460fee266f110647769..e1685077c197642a73deedf00a833af3edc7175c 100644 (file)
@@ -102,7 +102,7 @@ Vertical_align_engraver::acknowledge_axis_group (Grob_info i)
     {
       string id = i.context ()->id_string ();
 
-      scm_hash_set_x (id_to_group_hashtab_, scm_makfrom0str (id.c_str ()),
+      scm_hash_set_x (id_to_group_hashtab_, ly_string2scm (id),
                      i.grob ()->self_scm ());
 
       SCM before_id = i.context ()->get_property ("alignAboveContext");
index 1828dfdbca9b49d062752118c554abfc9cd7737d..7e803b81c8c038a721dc7e9e650483a1aaf74602 100644 (file)
@@ -98,7 +98,7 @@ Volta_repeat_iterator::next_element (bool side_effect)
 
          if (done_count_ <= alt_count_)
            add_repeat_command (scm_list_n (ly_symbol2scm ("volta"),
-                                           scm_makfrom0str (repstr.c_str ()), SCM_UNDEFINED));
+                                           ly_string2scm (repstr), SCM_UNDEFINED));
        }
       else
        add_repeat_command (ly_symbol2scm ("end-repeat"));
index 063b9b44f9a708c0743031f2df59858c1d28a669..afc251b00b1893fab647fdbdf0ab7f0f5b732e57 100644 (file)
@@ -521,6 +521,8 @@ AncientRemoveEmptyStaffContext = \context {
   
   explicitClefVisibility = #all-visible
   explicitKeySignatureVisibility = #all-visible
+  implicitTimeSignatureVisibility = #end-of-line-invisible
+  
   autoBeamSettings = #default-auto-beam-settings
   autoBeaming = ##t
   autoBeamCheck = #default-auto-beam-check
index eab90ef3d5905527c56ee3c36edabbc4cba0f243..f6c928e301ec8f6e6af0cca07b2a89241b8f25cc 100644 (file)
@@ -4,11 +4,6 @@
 #(if (and #t (defined? 'set-debug-cell-accesses!))
   (set-debug-cell-accesses! 5000))
 
-#(define-public midi-debug  #f)
-
-
-
-
 \version "2.10.0"
 
 \include "declarations-init.ly"
@@ -19,7 +14,8 @@
 #(define output-count 0) 
 #(define $defaultheader #f)
 #(define version-seen #f)
-
+#(define expect-error #f) 
+#(define output-empty-score-list #f)
 
 #(use-modules (scm clip-region))
 \maininput
       (defined? 'input-file-name))
   (version-not-seen-message input-file-name))
 
-#(if (pair? toplevel-scores)
-  (toplevel-book-handler
+#(if (or (pair? toplevel-scores) output-empty-score-list)
+  ((if (defined? 'default-toplevel-book-handler)
+    default-toplevel-book-handler
+    toplevel-book-handler)
    parser
    (apply ly:make-book $defaultpaper $defaultheader toplevel-scores)))
+
+
+#(if (eq? expect-error (ly:parser-has-error? parser))
+  (ly:parser-clear-error parser)
+  (ly:parser-error parser (_ "expected error, but none found")))
index aa82b7330c55c4e33e435f684f3e693f1f3f9e1a..063c69680b54aae89b801a2c2443ba4b0a286f99 100644 (file)
@@ -1,12 +1,33 @@
 
 \version "2.10.0"
 
-#(set! toplevel-score-handler print-score-with-defaults)
-#(set! toplevel-music-handler
-  (lambda (p m)
-   (if (not (eq? (ly:music-property m 'void) #t))
-        (print-score-with-defaults
-         p (scorify-music m p)))))
+%% toplevel \book gets output per page,
+%% everything else gets output per system/title
+#(define default-toplevel-book-handler
+  print-book-with-defaults-as-systems )
+
+#(define toplevel-book-handler
+
+  (lambda ( . rest)
+  (set! output-empty-score-list #f)
+  (apply print-book-with-defaults rest)))
+
+#(define toplevel-music-handler
+  (lambda ( . rest)
+   (set! output-empty-score-list #f)
+   (apply collect-music-for-book rest)))
+
+#(define toplevel-score-handler
+  (lambda ( . rest)
+   (set! output-empty-score-list #f)
+   (apply collect-scores-for-book rest)))
+#(define toplevel-text-handler
+  (lambda ( . rest)
+   (set! output-empty-score-list #f)
+   (apply collect-scores-for-book rest)))
+
+#(set! output-empty-score-list #t)
+
 
 #(ly:set-option (quote no-point-and-click))
 #(define inside-lilypond-book #t)
index 05ed471320d93d629567448e51ef7afe8a035df8..725ba480a59642102338ef6b8a4333f6264d4fe6 100644 (file)
@@ -16,11 +16,10 @@ acciaccatura =
 
 addquote =
 #(define-music-function (parser location name music) (string? ly:music?)
-   "Add a piece of music to be quoted "
+   (_i "Add a piece of music to be quoted ")
    (add-quotable parser name music)
    (make-music 'SequentialMusic 'void #t))
 
-
 afterGraceFraction =
 #(cons 6 8)
 
@@ -153,8 +152,7 @@ bendAfter =
 clef =
 #(define-music-function (parser location type)
    (string?)
-   
-   "Set the current clef."
+   (_i "Set the current clef.")
 
    (make-clef-set type))
 
@@ -194,9 +192,8 @@ displayMusic =
 
 featherDurations=
 #(define-music-function (parser location factor argument) (ly:moment? ly:music?)
-
-   "Rearrange durations in ARGUMENT so there is an
-acceleration/deceleration. "
+   (_i "Rearrange durations in ARGUMENT so there is an
+acceleration/deceleration. ")
    
    (let*
        ((orig-duration (ly:music-length argument))
@@ -304,9 +301,9 @@ overrideProperty =
    (string? symbol? scheme?)
 
 
-   "Set @var{property} to @var{value} in all grobs named @var{name}.
+   (_i "Set @var{property} to @var{value} in all grobs named @var{name}.
 The @var{name} argument is a string of the form @code{\"Context.GrobName\"}
-or @code{\"GrobName\"}"
+or @code{\"GrobName\"}")
 
    (let*
        ((name-components (string-split name #\.))
@@ -346,7 +343,7 @@ removeWithTag =
 
 octave =
 #(define-music-function (parser location pitch-note) (ly:music?)
-   "octave check"
+   (_i "octave check")
 
    (make-music 'RelativeOctaveCheck
               'origin location
@@ -387,7 +384,7 @@ pitchedTrill =
    
 parenthesize =
 #(define-music-function (parser loc arg) (ly:music?)
-   "Tag @var{arg} to be parenthesized."
+   (_i "Tag @var{arg} to be parenthesized.")
 
    (set! (ly:music-property arg 'parenthesize) #t)
    arg)
@@ -397,7 +394,7 @@ parenthesize =
 
 parallelMusic =
 #(define-music-function (parser location voice-ids music) (list? ly:music?)
-  "Define parallel music sequences, separated by '|' (bar check signs),
+  (_i "Define parallel music sequences, separated by '|' (bar check signs),
 and assign them to the identifiers provided in @var{voice-ids}.
 
 @var{voice-ids}: a list of music identifiers (symbols containing only letters)
@@ -416,7 +413,7 @@ Example:
   B = { d d | e e | }
   C = { e e | f f | }
 @end verbatim
-"
+")
   (let* ((voices (apply circular-list (make-list (length voice-ids) (list))))
          (current-voices voices)
          (current-sequence (list)))
@@ -503,7 +500,7 @@ resetRelativeOctave  =
 #(define-music-function
     (parser location reference-note)
     (ly:music?)
-    "Set the octave inside a \\relative section."
+    (_i "Set the octave inside a \\relative section.")
 
    (let*
     ((notes (ly:music-property reference-note 'elements))
@@ -521,8 +518,7 @@ resetRelativeOctave  =
 
 shiftDurations =
 #(define-music-function (parser location dur dots arg) (integer? integer? ly:music?)
-   ""
-
+   (_i "")
    
    (music-map
     (lambda (x)
@@ -530,8 +526,8 @@ shiftDurations =
 
 spacingTweaks =
 #(define-music-function (parser location parameters) (list?)
-   "Set the system stretch, by reading the 'system-stretch property of
-   the `parameters' assoc list."
+   (_i "Set the system stretch, by reading the 'system-stretch property of
+the `parameters' assoc list.")
    #{
       \overrideProperty #"Score.NonMusicalPaperColumn"
         #'line-break-system-details
@@ -543,8 +539,8 @@ spacingTweaks =
 
 includePageLayoutFile = 
 #(define-music-function (parser location) ()
-   "If page breaks and tweak dump is not asked, and the file
-   <basename>-page-layout.ly exists, include it."
+   (_i "If page breaks and tweak dump is not asked, and the file
+<basename>-page-layout.ly exists, include it.")
    (if (not (ly:get-option 'dump-tweaks))
        (let ((tweak-filename (format #f "~a-page-layout.ly"
                                     (ly:parser-output-name parser))))
@@ -560,7 +556,7 @@ includePageLayoutFile =
 
 rightHandFinger =
 #(define-music-function (parser location finger) (number-or-string?)
-   "Define a StrokeFingerEvent"
+   (_i "Define a StrokeFingerEvent")
    
    (apply make-music
          (append
@@ -573,7 +569,7 @@ rightHandFinger =
 
 scoreTweak =
 #(define-music-function (parser location name) (string?)
-   "Include the score tweak, if exists."
+   (_i "Include the score tweak, if exists.")
    (if (and page-layout-parser (not (ly:get-option 'dump-tweaks)))
        (let ((tweak-music (ly:parser-lookup page-layout-parser
                                             (string->symbol name))))
@@ -587,11 +583,11 @@ transposedCueDuring =
   (parser location what dir pitch-note main-music)
   (string? ly:dir? ly:music? ly:music?)
 
-  "Insert notes from the part @var{what} into a voice called @code{cue},
+  (_i "Insert notes from the part @var{what} into a voice called @code{cue},
 using the transposition defined by @var{pitch-note}.  This happens
 simultaneously with @var{main-music}, which is usually a rest.  The
 argument @var{dir} determines whether the cue notes should be notated
-as a first or second voice."
+as a first or second voice.")
 
   (make-music 'QuoteMusic
              'element main-music
@@ -606,7 +602,7 @@ as a first or second voice."
 
 transposition =
 #(define-music-function (parser location pitch-note) (ly:music?)
-   "Set instrument transposition"
+   (_i "Set instrument transposition")
 
    (context-spec-music
     (make-property-set 'instrumentTransposition
@@ -616,8 +612,7 @@ transposition =
 tweak = #(define-music-function (parser location sym val arg)
           (symbol? scheme? ly:music?)
 
-          "Add @code{sym . val} to the @code{tweaks} property of @var{arg}."
-
+          (_i "Add @code{sym . val} to the @code{tweaks} property of @var{arg}.")
           
           (set!
            (ly:music-property arg 'tweaks)
@@ -628,7 +623,7 @@ tweak = #(define-music-function (parser location sym val arg)
 tag = #(define-music-function (parser location tag arg)
    (symbol? ly:music?)
 
-   "Add @var{tag} to the @code{tags} property of @var{arg}."
+   (_i "Add @var{tag} to the @code{tags} property of @var{arg}.")
 
    (set!
     (ly:music-property arg 'tags)
@@ -645,7 +640,7 @@ unfoldRepeats =
 
 withMusicProperty =
 #(define-music-function (parser location sym val music) (symbol? scheme? ly:music?)
-   "Set @var{sym} to @var{val} in @var{music}."
+   (_i "Set @var{sym} to @var{val} in @var{music}.")
 
    (set! (ly:music-property music sym) val)
    music)
index b0cb5d4305436e4a0c8c50cb46a43a6e1295ca42..1411b8c5f7d96375c8cd74f58888097b66874092 100644 (file)
@@ -20,30 +20,11 @@ $(outdir)/lilypond/index.html: $(outdir)/lilypond.nexi doc-po
 $(outdir)/lilypond.html: $(outdir)/lilypond.nexi
        -$(MAKEINFO) -I$(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split --no-headers $< 
 
-local-WWW: png-ln $(outdir)/lilypond.html $(outdir)/lilypond/index.html deep-ln lang-merge
+local-WWW: $(outdir)/lilypond.html $(outdir)/lilypond/index.html lang-merge
 
 lang-merge:
        $(foreach i, $(shell find $(outdir) -name '*.html' | xargs grep -L --label="" 'UNTRANSLATED NODE: IGNORE ME'), ln -f $(i) $(i:$(outdir)/%.html=$(depth)/Documentation/user/$(outdir)/%.$(ISOLANG).html) &&) true
 
-png-ln:
-       mkdir -p $(outdir)/lilypond
-       # makeinfo is broken, it MUST have PNGs in output dir
-       # symlinking PNGs...
-
-## cmd too long FIXME / JUNKME.
-## $(foreach i, $(shell find $(depth)/Documentation/user/$(outdir) -maxdepth 1 -name '*.png'), ln -sf ../$(i) $(i:$(depth)/Documentation/user/$(outdir)/%.png=$(outdir)/%.png) &&) true
-##     $(foreach i, $(shell find $(depth)/Documentation/user/$(outdir)/lilypond -name '*.png'), ln -sf ../../$(i) $(i:$(depth)/Documentation/user/$(outdir)/%.png=$(outdir)/%.png) &&) true
-
-# Links referred to by Documentation index
-# BROKEN: the following makes broken symlinks
-#LILYPOND_LINKS = Reference-Manual.html Tutorial.html Ly2dvi.html Midi2ly.html
-
-
-deep-ln:
-       mkdir -p $(outdir)/lilypond
-       cd $(outdir)/lilypond && $(foreach i, $(LILYPOND_LINKS),\
-                rm -f $(i) && ln -s lilypond.html $(i) &&) true
-
 local-WWW-clean: deep-WWW-clean
 
 deep-WWW-clean:
index 8b59dc9619f2894321ddfbb13cc1fdc5ef7d3a95..2e9e5ff0224f7f2eaa02b62553fd417297d28925 100644 (file)
@@ -7,12 +7,10 @@ $(outdir)/%.latex:  %.doc
 # don't do ``cd $(outdir)'', and assume that $(outdir)/.. is the src dir.
 # it is not, for --srcdir builds
 $(outdir)/%.texi: %.tely
-       rm -f $$(grep -LF '% eof' $(outdir)/lily-*systems.*tex 2>/dev/null)
        $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BINARY) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS) $<
 
 
 $(outdir)/%.texi: $(outdir)/%.tely
-       rm -f $$(grep -LF '% eof' $(outdir)/lily-*systems.*tex 2>/dev/null)
        $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BINARY) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS) $<
 #
 # DON'T REMOVE SOURCE FILES, otherwise the .TEXI ALWAYS OUT OF DATE.
index 42c04b6e57f573047f922a53a634f5b50a12ce79..eaefaf786752821a525cdfa406a353cbac0e18c9 100644 (file)
   (let* ((completed (completize-formats formats))
         (base (string-regexp-substitute "\\.[a-z]+$" "" filename))
         (intermediate (remove (lambda (x) (member x formats)) completed)))
+    
     (for-each (lambda (f)
                ((eval (string->symbol (format "convert-to-~a" f))
                       module) paper-book filename)) completed)
index 43a738d6ae25a2a6241aaad830af50a63785d91e..ee889b916a079648e2e6dd7aa4209dcbcb354c6a 100644 (file)
@@ -249,6 +249,8 @@ selector for tab notation.")
      (ignoreBarChecks ,boolean? "Ignore bar checks")
      (ignoreMelismata ,boolean? "Ignore melismata for this @internalsref{Lyrics} line.")
 
+     (implicitTimeSignatureVisibility ,vector? "break visibility for the default timesignature.")
+
      (implicitBassFigures ,list? "List of bass figures that are not
 printed as numbers, but only as extender lines.")
      
index 918fe5d11f24711e19b3d0207a5392d4f07f1414..9d354b8d22e5d8b32e6c02e67ac5ebeb43824487 100644 (file)
@@ -508,6 +508,7 @@ where this is set in.")
 
      (note-columns ,pair? "list of NoteColumn grobs.")
 
+     (normal-stems ,ly:grob-array? "Array of visible stems.") 
      (note-heads ,ly:grob-array? "List of note head grobs")
      (note-head ,ly:grob? "A single note head")
      (right-items ,ly:grob-array? "")
index c4246b6589e5097c0626314e37b5f0338edc63ef..34618b9b774d0bb65719ca1722618fb8c89b1844 100644 (file)
        (after-line-breaking . ,ly:accidental-interface::after-line-breaking)
        (side-axis . ,X)
        (meta . ((class . Item)
-                (interfaces . (item-interface
+                (interfaces . (
                                accidental-interface
                                break-aligned-interface
                                side-position-interface
        (beaming . ,ly:beam::calc-beaming)
        (stencil . ,ly:beam::print)
        (clip-edges . #t)
-       
+
+       (details .  ((hint-direction-penalty . 20)))
        ;; TODO: should be in SLT.
        (thickness . 0.48) ; in staff-space
        (neutral-direction . ,DOWN)
        ;; only for debugging.
        (font-family . roman)
        (meta . ((class . Spanner)
+                (object-callbacks . ((normal-stems . ,ly:beam::calc-normal-stems))) 
                 (interfaces . (staff-symbol-referencer-interface
                                beam-interface))))))
 
                                rhythmic-grob-interface
                                text-interface
                                chord-name-interface
-                               item-interface))))))
+                               ))))))
 
     (CombineTextScript
      . (
        (self-alignment-X . 0)
        (self-alignment-Y . 0)
        (script-priority . 100)
-
        (stencil . ,ly:text-interface::print)
        (direction . ,ly:script-interface::calc-direction)
        (text . ,fingering::calc-text) 
                                text-interface
                                side-position-interface
                                self-alignment-interface
-                               item-interface))))))
+                               ))))))
     (FretBoard
      . ((stencil . ,fret-board::calc-stencil)
        (finger-code . below-string)
 
        ;; padding set in script definitions.
        (staff-padding . 0.25)
-       ;; (script-priority . 0) priorities for scripts, see script.scm
        (X-offset . ,ly:self-alignment-interface::centered-on-x-parent)
        (Y-offset . ,ly:side-position-interface::y-aligned-side)
        (side-axis . ,Y)
                                text-interface
                                side-position-interface
                                self-alignment-interface
-                               item-interface))))))
+                               ))))))
     
     (StrokeFinger
      . (
                                text-interface
                                side-position-interface
                                self-alignment-interface
-                               item-interface))))))
+                               ))))))
     
 
     (SustainPedal
        (stencil . ,ly:accidental-interface::print)
        (glyph-name-alist . ,standard-alteration-glyph-name-alist)
        (meta . ((class . Item)
-                (interfaces . (item-interface
-                               trill-pitch-accidental-interface
+                (interfaces . (trill-pitch-accidental-interface
                                side-position-interface
                                font-interface))))))
 
        (Y-offset . ,ly:staff-symbol-referencer::callback)
        (font-size . -4)
        (meta . ((class . Item)
-                (interfaces . (item-interface
-                               rhythmic-head-interface
+                (interfaces . (rhythmic-head-interface
                                font-interface
                                pitched-trill-interface
                                ledgered-interface
                               (cons 'spanner-interface ifaces-entry))))
      (else
       (ly:warning "Unknown class ~a" class)))
+
+    (set! ifaces-entry (uniq-list (sort ifaces-entry symbol<?)))
     (set! ifaces-entry (cons 'grob-interface ifaces-entry))
 
     (set! meta-entry (assoc-set! meta-entry 'name name-sym))
   (list
    `(,ly:slur::outside-slur-callback . ,ly:slur::pure-outside-slur-callback)
    `(,ly:stem::height . ,ly:stem::pure-height)
+   `(,ly:rest::height . ,ly:rest::pure-height)
    `(,ly:grob::stencil-height . ,pure-stencil-height)
    `(,ly:side-position-interface::y-aligned-side . ,ly:side-position-interface::pure-y-aligned-side)
    `(,ly:axis-group-interface::height . ,ly:axis-group-interface::pure-height)
    ly:staff-symbol-referencer::callback
    ly:staff-symbol::height))
 
-(define-public (pure-relevant grob)
+(define-public (pure-relevant? grob)
   (let ((extent-callback (ly:grob-property-data grob 'Y-extent)))
     (not (eq? #f
              (or
                  (or
                   (not (eq? extent-callback ly:grob::stencil-height))
                   (memq (ly:grob-property-data grob 'stencil) pure-print-callbacks)
-                  (ly:stencil? (ly:grob-property-data grob 'stencil))))))))))
+                  (ly:stencil? (ly:grob-property-data grob 'stencil))
+
+                  ))))))))
 
 (define-public (call-pure-function unpure args start end)
   (if (ly:simple-closure? unpure)
index e2215ede41b7b68913bc51bc6a41c93be9aac763..cf9bec54b30888aa08fc3526bcecb2a24fa8596a 100644 (file)
 stencil, so LaTeX includegraphics doesn't fuck up the alignment."
 
   (define left
-    (apply min
-          (map (lambda (stc)
-                 (interval-start (ly:stencil-extent stc X)))
-               stencils)))
+    (if (pair? stencils)
 
+       (apply min
+              (map (lambda (stc)
+                     (interval-start (ly:stencil-extent stc X)))
+                   stencils))
+       0.0))
+    
   (map (lambda (stil)
         
         (ly:make-stencil
@@ -79,18 +82,22 @@ stencil, so LaTeX includegraphics doesn't fuck up the alignment."
          (dump-stencils-as-separate-EPS rest (1+ count)))))
 
   ;; main body 
-  (let* ((tex-system-name (format "~a-systems.tex" basename))
-        (texi-system-name (format "~a-systems.texi" basename))
-        (tex-system-port (open-output-file tex-system-name))
-        (texi-system-port (open-output-file texi-system-name))
+  (let* ((write-file (lambda (str-port ext)
+                      (let*
+                          ((name (format "~a-systems.~a" basename ext))
+                           (port (open-output-file name)))
+                        (ly:message (_ "Writing ~a...") name)
+                        (display (get-output-string str-port) port)
+                        (close-output-port port)
+                        )))
+        
+        (tex-system-port (open-output-string))
+        (texi-system-port (open-output-string))
         (widened-stencils (widen-left-stencil-edges stencils))
         (counted-systems  (count-list widened-stencils))
         (eps-files (map dump-counted-stencil  counted-systems))
         )
     
-    (ly:message (_ "Writing ~a...") tex-system-name)
-    (ly:message (_ "Writing ~a...") texi-system-name)
-
     (if do-pdf
 
        ;; par-for-each: a bit faster ...  
@@ -113,15 +120,16 @@ stencil, so LaTeX includegraphics doesn't fuck up the alignment."
                                 basename (1+ c)) texi-system-port))
              (iota (length stencils)))
     
-    (display "@c eof - 'eof' is a Makefile marker; do not remove. " texi-system-port)
-    (display "% eof - 'eof' is Makefile marker; do not remove. " tex-system-port)
-    
-    (close-output-port texi-system-port)
-    (close-output-port tex-system-port)
+    (display "@c eof." texi-system-port)
+    (display "% eof. " tex-system-port)
     
     (dump-infinite-stack-EPS stencils)
     (postprocess-output book framework-eps-module
-                       (format "~a.eps" basename) (ly:output-formats))))
+                       (format "~a.eps" basename) (ly:output-formats))
+
+    (write-file texi-system-port "texi")
+    (write-file tex-system-port "tex")
+    ))
 
 
 
index d946890049fbb6653e4088f4dd7cdb736391a884..1ee840aa0bad03eaa939cdad2a074fabb67c475b 100644 (file)
@@ -59,7 +59,7 @@
        ly:beam::quanting
        (check-beam-quant l r)
        ))
-                       
+
 
 (define-public (check-slope-callbacks comparison)
   (list ly:beam::calc-least-squares-positions
index 1e8fe97e477809c669338cb9072e8594a31adb16..53b5e58f240bc4b39df8fcd9b37c43c90565c155 100644 (file)
 (define-public (moment-min a b)
   (if (ly:moment<? a b) a b))
 
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; arithmetic
 (define-public (average x . lst)
   (/ (+ x (apply + lst)) (1+ (length lst))))
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; lily specific variables.
-
-(define-public default-script-alist '())
-
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; parser <-> output hooks.
 
-;; parser stuff.
-(define-public (print-music-as-book parser music)
-  (let* ((head (ly:parser-lookup parser '$defaultheader))
-        (book (ly:make-book (ly:parser-lookup parser '$defaultpaper)
-                            head (scorify-music music parser))))
-    (print-book-with-defaults parser book)))
-
-(define-public (print-score-as-book parser score)
-  (let* ((head (ly:parser-lookup parser '$defaultheader))
-        (book (ly:make-book (ly:parser-lookup parser '$defaultpaper)
-                            head score)))
-    (print-book-with-defaults parser book)))
-
-(define-public (print-score parser score)
-  (let* ((head (ly:parser-lookup parser '$defaultheader))
-        (book (ly:make-book (ly:parser-lookup parser '$defaultpaper)
-                            head score)))
-    (ly:parser-print-score parser book)))
                
 (define-public (collect-scores-for-book parser score)
   (ly:parser-define!
    parser 'toplevel-scores
    (cons score (ly:parser-lookup parser 'toplevel-scores))))
 
+(define-public (collect-music-for-book parser music)
+  ;; discard music if its 'void property is true.
+  (let ((void-music (ly:music-property music 'void)))
+    (if (or (null? void-music) (not void-music))
+        (collect-scores-for-book parser (scorify-music music parser)))))
+
 (define-public (scorify-music music parser)
+  "Preprocess MUSIC."
   
   (for-each (lambda (func)
              (set! music (func music parser)))
 
   (ly:make-score music))
 
-(define-public (collect-music-for-book parser music)
-  ;; discard music if its 'void property is true.
-  (let ((void-music (ly:music-property music 'void)))
-    (if (or (null? void-music) (not void-music))
-        (collect-scores-for-book parser (scorify-music music parser)))))
-
-
-(define-public (print-book-with-defaults parser book)
+(define (print-book-with parser book process-procedure)
   (let*
       ((paper (ly:parser-lookup parser '$defaultpaper))
        (layout (ly:parser-lookup parser '$defaultlayout))
        (set! base (format #f "~a-~a" base count)))
 
     (ly:parser-define! parser 'output-count (1+ count))
-    (ly:book-process book paper layout base)
+    (process-procedure book paper layout base)
     ))
 
-(define-public (print-score-with-defaults parser score)
-  (let*
-      ((paper (ly:parser-lookup parser '$defaultpaper))
-       (count (ly:parser-lookup parser 'output-count))
-       (base (ly:parser-output-name parser)))
-
-    (if (not (integer? count))
-       (set! count 0))
-
-    (if (> count 0)
-       (set! base (format #f "~a-~a" base count)))
-
-    (ly:parser-define! parser 'output-count (1+ count))
-
-    (if (not (ly:score-error? score))
-       (let*
-           ((header (ly:score-header score))
-            (output-defs (ly:score-output-defs score))
-            (layout-defs (filter  (lambda (d) (eq? #t (ly:output-def-lookup d 'is-layout)))
-                                 output-defs))
-            (midi-defs (filter (lambda (d)  (eq? #t (ly:output-def-lookup d 'is-midi)))
-                               output-defs))
-            (music (ly:score-music score))
-            (layout-def (if (null? layout-defs)
-                            (ly:parser-lookup parser '$defaultlayout)
-                            (car layout-defs))))
-
-         (if (not (module? header))
-             (set! header (ly:parser-lookup parser '$defaultheader)))
-            
-         (ly:render-music-as-systems
-          music layout-def paper header base)
-
-         (if (pair? midi-defs)
-             (ly:performance-write (ly:format-output (ly:run-translator music (car midi-defs)))
-                                   (format #f "~a.midi" base)
-                                   ))
-             
-    ))))
-
-
-
+(define-public (print-book-with-defaults parser book)
+  (print-book-with parser book ly:book-process))
 
+(define-public (print-book-with-defaults-as-systems parser book)
+  (print-book-with parser book ly:book-process-to-systems))
 
 ;;;;;;;;;;;;;;;;
 ;; alist
@@ -647,14 +584,16 @@ possibly turned off."
 
 (define-public (version-not-seen-message input-file-name)
   (ly:message
-   (string-append
-    input-file-name ": 0: " (_ "warning: ")
-   (format #f
-          (_ "no \\version statement found, please add~afor future compatibility")
-          (format #f "\n\n\\version ~s\n\n" (lilypond-version))))))
+   "~a:0: ~a: ~a" 
+    input-file-name
+    (_ "warning: ")
+    (format #f
+           (_ "no \\version statement found, please add~afor future compatibility")
+           (format #f "\n\n\\version ~s\n\n" (lilypond-version)))))
 
 (define-public (old-relative-not-used-message input-file-name)
   (ly:message
-   (string-append
-    input-file-name ": 0: " (_ "warning: ")
-    (_ "old relative compatibility not used"))))
+   "~a:0: ~a: ~a" 
+    input-file-name
+    (_ "warning: ")
+    (_ "old relative compatibility not used")))
index d63890af0aca443419ab691ce6cc9029997ac2d3..c0e6fd911fa424cfa9bd0d90450d4286c3586573 100644 (file)
@@ -5,6 +5,14 @@
 ;;;; (c) 1998--2006 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl>
 
+;; Internationalisation: (_i "to be translated") gets an entry in the
+;; POT file (gettext ) must be invoked explicitely to do the actual
+;; "translation".
+;;(define-macro (_i x) x)
+;;(define-macro-public _i (x) x)
+;;(define-public-macro _i (x) x)
+;; Abbrv-PWR!
+(defmacro-public _i (x) x)
 
 (define (define-scheme-options)
   (for-each (lambda (x)
@@ -31,10 +39,9 @@ ensure that all refs to parsed objects are dead.  This is an internal option, an
                                         "delete unusable PostScript files")
              (dump-profile #f "dump timing information for each file")
              (dump-tweaks #f "dump page layout and tweaks for each score having the tweak-key layout property set.")
-             (dump-signatures #f "dump output signatures of each system")
+             (dump-signatures #f "dump output signatures of each system.  Used for regression testing.")
              
-             (eps-box-padding #f "Pad EPS bounding box left edge by this much to guarantee alignment between systems")
-
+             (eps-box-padding #f "Pad EPS bounding box left edge.  Guarantee alignment between systems in LaTeX.")
              (gs-load-fonts #f
                            "load fonts via Ghostscript.")
              (gui #f "running from gui; redirect stderr to log file")
@@ -61,14 +68,12 @@ on errors, and print a stack trace.")
              (read-file-list #f "Read files to be processed from command line arguments")
 
              (safe #f "Run safely")
-             (strict-infinity-checking #f "If yes, crash on encountering Inf/NaN")
-
+             (strict-infinity-checking #f "If yes, crash on encountering Inf/NaN.")
+             (separate-log-files #f "Output to FILE.log per file.")
              (ttf-verbosity 0
                             "how much verbosity for TTF font embedding?")
-
              (show-available-fonts #f
-                                   "List  font names available.")
-
+                                   "List font names available.")
              (verbose ,(ly:command-line-verbose?) "value for the --verbose flag")
              )))
 
@@ -93,12 +98,11 @@ on errors, and print a stack trace.")
             (srfi srfi-13)
             (srfi srfi-14)
             (scm clip-region)
-
             )
 
-
 ;; my display
-(define-public (myd k v) (display k) (display ": ") (display v) (display ", "))
+(define-public (myd k v) (display k) (display ": ") (display v) (display ", ")
+  v)
 
 (define-public (print . args)
   (apply format (cons (current-output-port) args)))
@@ -357,25 +361,26 @@ The syntax is the same as `define*-public'."
 (define (profile-measurements)
   (let* ((t (times))
         (stats (gc-stats)))
-
+    
     (list
-     (- (+ (tms:utime t)
-          (tms:stime t))
+     (- (+ (tms:cutime t)
+          (tms:utime t))
        (ly:assoc-get 'gc-time-taken stats))
-
-     ;; difficult to put memory amount stats into here.
      
+     (ly:assoc-get 'total-cells-allocated  stats 0)
      )))
 
-(define (dump-profile name last this)
+(define (dump-profile base last this)
   (let*
-      ((outname (format "~a.profile" (basename name ".ly")))
+      ((outname (format "~a.profile" (basename base ".ly")))
        (diff (map (lambda (y) (apply - y)) (zip this last))))
     
     (ly:progress "\nWriting timing to ~a..." outname)
     (format (open-file outname "w")
-           "time: ~a"
-           (car diff))))
+           "time: ~a\ncells: ~a\n"
+           (car diff)
+           (cadr diff)
+           )))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -501,7 +506,7 @@ The syntax is the same as `define*-public'."
            ))
   
   (if (and (number? (ly:get-option 'job-count))
-          (> (length files) (ly:get-option 'job-count)))
+          (>= (length files) (ly:get-option 'job-count)))
       
       (let*
          ((count (ly:get-option 'job-count))
@@ -543,6 +548,10 @@ The syntax is the same as `define*-public'."
              (if (pair? errors)
                  (ly:error "Children ~a exited with errors." errors))
 
+             ;; must overwrite individual entries
+             (if (ly:get-option 'dump-profile)
+                 (dump-profile "lily-run-total" '(0 0) (profile-measurements)))
+
            (exit (if (null? errors) 0 1))))))
              
           
@@ -569,27 +578,52 @@ The syntax is the same as `define*-public'."
        ))
   
   (let* ((failed '())
-        (start-measurements #f)
+        (separate-logs (ly:get-option 'separate-log-files))
+        (do-measurements (ly:get-option 'dump-profile))
         (handler (lambda (key failed-file)
                    (set! failed (append (list failed-file) failed)))))
 
     (for-each
      (lambda (x)
-
-       (gc)
-       (set! start-measurements (profile-measurements))
-       (lilypond-file handler x)
-       (if (ly:get-option 'dump-profile)
-          (dump-profile x start-measurements (profile-measurements)))
+       (let*
+          ((start-measurements (if do-measurements
+                                   (begin
+                                     (gc)
+                                     (profile-measurements))
+                                   #f))
+           (base (basename x ".ly"))
+           (all-settings (ly:all-options)))
+
+        (if separate-logs
+            (ly:stderr-redirect (format "~a.log" base) "w"))
        
+        (lilypond-file handler x)
+        (if start-measurements
+            (dump-profile x start-measurements (profile-measurements)))
        
-       (ly:clear-anonymous-modules)
-       (if (ly:get-option 'debug-gc)
-          (dump-gc-protects)
-          (if (= (random 40) 1)
-              (ly:reset-all-fonts))))
+        (for-each
+         (lambda (s)
+           (ly:set-option (car s) (cdr s)))
+         all-settings)
+        
+        (ly:clear-anonymous-modules)
+        (if (ly:get-option 'debug-gc)
+            (dump-gc-protects)
+            (if (= (random 40) 1)
+                (ly:reset-all-fonts)))))
 
      files)
+
+    ;; we want the failed-files notice in the aggregrate logfile.
+    (if (ly:get-option 'separate-logs)
+       (ly:stderr-redirect
+        (if (string-or-symbol? (ly:get-option 'log-file))
+            (format "~a.log" (ly:get-option 'log-file))
+            "/dev/tty") "a"))
+
+    (if (ly:get-option 'dump-profile)
+       (dump-profile "lily-run-total" '(0 0) (profile-measurements)))
+    
     failed))
 
 (define (lilypond-file handler file-name)
index 189f960ff696a9cc81babab737149e59af3c76be..08324e10776b1eff3cefdfb3c96527bbb62dc94e 100644 (file)
@@ -228,10 +228,15 @@ Returns `obj'.
          (if (memq 'sequential-music (ly:music-property main 'types))
              ;; \repeat "tremolo" { c4 d4 }
              (let ((children (length (ly:music-property main 'elements))))
-               (if (not (= children 2))
+
+               ;; fixme: should be more generic.
+               (if (and (not (= children 2))
+                        (not (= children 1)))
                    (ly:warning (_ "expecting 2 elements for chord tremolo, found ~a") children))
                (ly:music-compress r (ly:make-moment 1 children))
-               (shift-duration-log r (1- shift) dots))
+               (shift-duration-log r
+                                   (if (= children 2)  (1- shift) shift)
+                                   dots))
              ;; \repeat "tremolo" c4
              (shift-duration-log r shift dots)))
        r)))
index 9a65b0c5e56729714378bf9cefba074b1367abc4..42aecc1dbcb0364720adcb10a5bf687846a7bc3a 100644 (file)
@@ -68,6 +68,8 @@
   (if (or (nan? num) (inf? num))
       (begin
        (ly:warning (_ "Found infinity or nan in output. Substituting 0.0"))
+       (if (ly:get-option 'strict-infinity-checking)
+           (exit 1))
        "0.0")
       (format #f "~f" (round4 num))))
 
index ac89b1e2790177f1bb87d206bc516bddeb58a6c7..65c5bfa6dddc5d9f5c3b7946bb3967192e7b5e7f 100644 (file)
    ly:paper-get-number
    ly:paper-system?
    ly:output-def-lookup
-   ly:parse-string
    ly:parser-parse-string
    ly:pitch-alteration
    ly:pitch-diff
index 6044f61a1881cfaf88fa79c566258724e3410296..e12cdd07dd65a9c49ee47ec1b5676cb395c88854 100644 (file)
 ;;;; 
 ;;;; (c) 2000--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
-(set! default-script-alist
-      (append 
-       '(("thumb" .
-         ((script-stencil . (feta . ("thumb"  . "thumb")))
-          (avoid-slur . inside)
-          (padding . 0.20)        
-          (direction . 1)))
-         ("accent" .
-         ((avoid-slur . around)
-          (padding . 0.20)        
-          (quantize-position . #t)
-          (script-stencil . (feta . ("sforzato" .  "sforzato")))
-          (side-relative-direction . -1)))
-         ("espressivo" .
-         ((avoid-slur . around)
-          (padding . 0.20)        
-          (quantize-position . #t)
-          (script-stencil . (feta . ("espr" .  "espr")))
-          (side-relative-direction . -1)))      
-        ("marcato" .
-         ((script-stencil . (feta . ("dmarcato" . "umarcato")))
-          (padding . 0.20)
-          (avoid-slur . inside)
-;         (staff-padding . ())
-          (quantize-position . #t)
-          (side-relative-direction .  -1)))
-        ("staccatissimo" .
-         ((avoid-slur . inside) 
-          (script-stencil . (feta . ("dstaccatissimo" . "ustaccatissimo")))
-          (padding . 0.20)        
-          (side-relative-direction .  -1)))
-        
-        ("portato" .
-         ((script-stencil . (feta . ("uportato" . "dportato")))
-          (avoid-slur . around)
-          (slur-padding . 0.3)
-          (padding . 0.45)
-          (side-relative-direction . -1)))
+(define-public default-script-alist
+  '(("thumb" .
+     ((script-stencil . (feta . ("thumb"  . "thumb")))
+      (avoid-slur . inside)
+      (padding . 0.20)    
+      (direction . 1)))
+    ("accent" .
+     ((avoid-slur . around)
+      (padding . 0.20)    
+      (quantize-position . #t)
+      (script-stencil . (feta . ("sforzato" .  "sforzato")))
+      (side-relative-direction . -1)))
+    ("espressivo" .
+     ((avoid-slur . around)
+      (padding . 0.20)    
+      (quantize-position . #t)
+      (script-stencil . (feta . ("espr" .  "espr")))
+      (side-relative-direction . -1)))  
+    ("marcato" .
+     ((script-stencil . (feta . ("dmarcato" . "umarcato")))
+      (padding . 0.20)
+      (avoid-slur . inside)
+                                       ;          (staff-padding . ())
+      (quantize-position . #t)
+      (side-relative-direction .  -1)))
+    ("staccatissimo" .
+     ((avoid-slur . inside) 
+      (script-stencil . (feta . ("dstaccatissimo" . "ustaccatissimo")))
+      (padding . 0.20)    
+      (side-relative-direction .  -1)))
+    
+    ("portato" .
+     ((script-stencil . (feta . ("uportato" . "dportato")))
+      (avoid-slur . around)
+      (slur-padding . 0.3)
+      (padding . 0.45)
+      (side-relative-direction . -1)))
 
-        ("accentus" .
-         ((script-stencil . (feta . ("uaccentus" . "uaccentus")))
-          (side-relative-direction .  -1)
-          (padding . 0.20)        
-          (quantize-position . #t)
-          (script-priority . -100)
-          (direction  . 1)))
-        ("ictus" .
-         ((script-stencil . (feta . ("ictus" . "ictus")))
-          (side-relative-direction .  -1)
-          (quantize-position . #t)
-          (padding . 0.20)        
-          (script-priority . -100)
-          (direction  . -1)))
-        ("semicirculus" .
-         ((script-stencil . (feta . ("dsemicirculus" . "dsemicirculus")))
-          (side-relative-direction .  -1)
-          (quantize-position . #t)
-          (padding . 0.20)        
-          (script-priority . -100)
-          (direction  . 1)))
-        ("circulus" .
-         ((script-stencil . (feta . ("circulus" . "circulus")))
-          (side-relative-direction .  -1)
-          (padding . 0.20)        
-          (quantize-position . #t)
-          (script-priority . -100)
-          (direction  . 1)))
+    ("accentus" .
+     ((script-stencil . (feta . ("uaccentus" . "uaccentus")))
+      (side-relative-direction .  -1)
+      (padding . 0.20)    
+      (quantize-position . #t)
+      (script-priority . -100)
+      (direction  . 1)))
+    ("ictus" .
+     ((script-stencil . (feta . ("ictus" . "ictus")))
+      (side-relative-direction .  -1)
+      (quantize-position . #t)
+      (padding . 0.20)    
+      (script-priority . -100)
+      (direction  . -1)))
+    ("semicirculus" .
+     ((script-stencil . (feta . ("dsemicirculus" . "dsemicirculus")))
+      (side-relative-direction .  -1)
+      (quantize-position . #t)
+      (padding . 0.20)    
+      (script-priority . -100)
+      (direction  . 1)))
+    ("circulus" .
+     ((script-stencil . (feta . ("circulus" . "circulus")))
+      (side-relative-direction .  -1)
+      (padding . 0.20)    
+      (quantize-position . #t)
+      (script-priority . -100)
+      (direction  . 1)))
 
-        ("signumcongruentiae" .
-         ((script-stencil . (feta . ("dsignumcongruentiae" . "usignumcongruentiae")))
-          (padding . 0.20)        
-          (direction .  1)))
-        ("fermata" .
-         ((script-stencil . (feta . ("dfermata" . "ufermata")))
-          (padding . 0.20)        
-          (avoid-slur . around)
-          (script-priority . 4000)
-          (direction .  1)))
-        ("shortfermata" .
-         ((script-stencil . (feta . ("dshortfermata" . "ushortfermata")))
-          (padding . 0.20)        
-          (direction .  1)))
-        ("longfermata" .
-         ((script-stencil . (feta . ("dlongfermata" . "ulongfermata")))
-          (padding . 0.20)        
-          (direction .  1)))
-        ("verylongfermata" .
-         ((script-stencil . (feta . ("dverylongfermata" . "uverylongfermata")))
-          (padding . 0.20)        
-          (direction .  1)))
-        ("stopped" .
-         ((script-stencil . (feta . ("stopped" . "stopped")))
-          (avoid-slur . inside)
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("staccato" .
-         ((script-stencil . (feta . ("staccato" . "staccato")))
-          (side-relative-direction .  -1)
-          (quantize-position . #t)
-          (avoid-slur . inside) 
-          (padding . 0.20)        
-          (script-priority . -100)))
-        ("tenuto" .
-         ((script-stencil . (feta . ("tenuto" . "tenuto")))
-          (quantize-position . #t)
-          (avoid-slur . inside)
-          (padding . 0.20)        
-          (side-relative-direction . -1)))
-        ("comma" .
-         ((script-stencil . (feta . ("lcomma" . "rcomma")))
-          (quantize-position . #t)
-          (padding . 0.20)        
-          (direction . 1)))
-        ("varcomma" .
-         ((script-stencil . (feta . ("lvarcomma" . "rvarcomma")))
-          (quantize-position . #t)
-          (padding . 0.20)        
-          (direction . 1)))
-        ("upbow" .
-         ((script-stencil . (feta . ("upbow" . "upbow")))
-          (avoid-slur . around)
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("downbow" .
-         ((script-stencil . (feta . ("downbow" . "downbow")))
-          (padding . 0.20)        
-          (avoid-slur . around)
-          (direction  . 1)))
-        ("lheel" .
-         ((script-stencil . (feta . ("upedalheel" . "upedalheel")))
-          (padding . 0.20)        
-          (direction .  -1))
-         )
-        ("rheel" .
-         ((script-stencil . (feta . ("dpedalheel" . "dpedalheel")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("ltoe" .
-         ((script-stencil . (feta . ("upedaltoe" . "upedaltoe")))
-          (padding . 0.20)        
-          (direction  . -1)))
-        ("rtoe" .
-         ((script-stencil . (feta . ("dpedaltoe" . "dpedaltoe")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("turn" .
-         ((script-stencil . (feta . ("turn" . "turn")))
-          (avoid-slur . inside)
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("open" .
-         ((avoid-slur . outside)
-          (padding . 0.20)        
-          (script-stencil . (feta . ("open" . "open")))
-          (direction  . 1)))
-        ("flageolet" .
-         ((script-stencil . (feta . ("flageolet" . "flageolet")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("reverseturn" .
-         ((script-stencil . (feta . ("reverseturn" . "reverseturn")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("trill" .
-         ((script-stencil . (feta . ("trill" . "trill")))
-          (direction . 1)
-          (padding . 0.20)        
-          (avoid-slur . outside)
-          (script-priority . 2000)))
-        ("prall" .
-         ((script-stencil . (feta . ("prall" . "prall")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("mordent" .
-         ((script-stencil . (feta . ("mordent" . "mordent")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("prallprall" .
-         ((script-stencil . (feta . ("prallprall" . "prallprall")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("prallmordent" .
-         ((script-stencil . (feta . ("prallmordent" . "prallmordent")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("upprall" .
-         ((script-stencil . (feta . ("upprall" . "upprall")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("downprall" .
-         ((script-stencil . (feta . ("downprall" . "downprall")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("upmordent" .
-         ((script-stencil . (feta . ("upmordent" . "upmordent")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("downmordent" .
-         ((script-stencil . (feta . ("downmordent" . "downmordent")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("lineprall" .
-         ((script-stencil . (feta . ("lineprall" . "lineprall")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("pralldown" .
-         ((script-stencil . (feta . ("pralldown" . "pralldown")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("prallup" .
-         ((script-stencil . (feta . ("prallup" . "prallup")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("segno" .
-         ((script-stencil . (feta . ("segno" . "segno")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("coda" .
-         ((script-stencil . (feta . ("coda" . "coda")))
-          (padding . 0.20)        
-          (direction  . 1)))
-        ("varcoda" .
-         ((script-stencil . (feta . ("varcoda" . "varcoda")))
-          (padding . 0.20)        
-          (direction  . 1))))
-       default-script-alist)
-      )
+    ("signumcongruentiae" .
+     ((script-stencil . (feta . ("dsignumcongruentiae" . "usignumcongruentiae")))
+      (padding . 0.20)    
+      (direction .  1)))
+    ("fermata" .
+     ((script-stencil . (feta . ("dfermata" . "ufermata")))
+      (padding . 0.20)    
+      (avoid-slur . around)
+      (script-priority . 4000)
+      (direction .  1)))
+    ("shortfermata" .
+     ((script-stencil . (feta . ("dshortfermata" . "ushortfermata")))
+      (padding . 0.20)    
+      (direction .  1)))
+    ("longfermata" .
+     ((script-stencil . (feta . ("dlongfermata" . "ulongfermata")))
+      (padding . 0.20)    
+      (direction .  1)))
+    ("verylongfermata" .
+     ((script-stencil . (feta . ("dverylongfermata" . "uverylongfermata")))
+      (padding . 0.20)    
+      (direction .  1)))
+    ("stopped" .
+     ((script-stencil . (feta . ("stopped" . "stopped")))
+      (avoid-slur . inside)
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("staccato" .
+     ((script-stencil . (feta . ("staccato" . "staccato")))
+      (side-relative-direction .  -1)
+      (quantize-position . #t)
+      (avoid-slur . inside) 
+      (padding . 0.20)    
+      (script-priority . -100)))
+    ("tenuto" .
+     ((script-stencil . (feta . ("tenuto" . "tenuto")))
+      (quantize-position . #t)
+      (avoid-slur . inside)
+      (padding . 0.20)    
+      (side-relative-direction . -1)))
+    ("comma" .
+     ((script-stencil . (feta . ("lcomma" . "rcomma")))
+      (quantize-position . #t)
+      (padding . 0.20)    
+      (direction . 1)))
+    ("varcomma" .
+     ((script-stencil . (feta . ("lvarcomma" . "rvarcomma")))
+      (quantize-position . #t)
+      (padding . 0.20)    
+      (direction . 1)))
+    ("upbow" .
+     ((script-stencil . (feta . ("upbow" . "upbow")))
+      (avoid-slur . around)
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("downbow" .
+     ((script-stencil . (feta . ("downbow" . "downbow")))
+      (padding . 0.20)    
+      (avoid-slur . around)
+      (direction  . 1)))
+    ("lheel" .
+     ((script-stencil . (feta . ("upedalheel" . "upedalheel")))
+      (padding . 0.20)    
+      (direction .  -1))
+     )
+    ("rheel" .
+     ((script-stencil . (feta . ("dpedalheel" . "dpedalheel")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("ltoe" .
+     ((script-stencil . (feta . ("upedaltoe" . "upedaltoe")))
+      (padding . 0.20)    
+      (direction  . -1)))
+    ("rtoe" .
+     ((script-stencil . (feta . ("dpedaltoe" . "dpedaltoe")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("turn" .
+     ((script-stencil . (feta . ("turn" . "turn")))
+      (avoid-slur . inside)
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("open" .
+     ((avoid-slur . outside)
+      (padding . 0.20)    
+      (script-stencil . (feta . ("open" . "open")))
+      (direction  . 1)))
+    ("flageolet" .
+     ((script-stencil . (feta . ("flageolet" . "flageolet")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("reverseturn" .
+     ((script-stencil . (feta . ("reverseturn" . "reverseturn")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("trill" .
+     ((script-stencil . (feta . ("trill" . "trill")))
+      (direction . 1)
+      (padding . 0.20)    
+      (avoid-slur . outside)
+      (script-priority . 2000)))
+    ("prall" .
+     ((script-stencil . (feta . ("prall" . "prall")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("mordent" .
+     ((script-stencil . (feta . ("mordent" . "mordent")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("prallprall" .
+     ((script-stencil . (feta . ("prallprall" . "prallprall")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("prallmordent" .
+     ((script-stencil . (feta . ("prallmordent" . "prallmordent")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("upprall" .
+     ((script-stencil . (feta . ("upprall" . "upprall")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("downprall" .
+     ((script-stencil . (feta . ("downprall" . "downprall")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("upmordent" .
+     ((script-stencil . (feta . ("upmordent" . "upmordent")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("downmordent" .
+     ((script-stencil . (feta . ("downmordent" . "downmordent")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("lineprall" .
+     ((script-stencil . (feta . ("lineprall" . "lineprall")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("pralldown" .
+     ((script-stencil . (feta . ("pralldown" . "pralldown")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("prallup" .
+     ((script-stencil . (feta . ("prallup" . "prallup")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("segno" .
+     ((script-stencil . (feta . ("segno" . "segno")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("coda" .
+     ((script-stencil . (feta . ("coda" . "coda")))
+      (padding . 0.20)    
+      (direction  . 1)))
+    ("varcoda" .
+     ((script-stencil . (feta . ("varcoda" . "varcoda")))
+      (padding . 0.20)    
+      (direction  . 1)))))
index 89a974879e22128165354704774a373f07ef384a..d7f306947983243a672a588d6e33849717579083 100644 (file)
@@ -1448,10 +1448,12 @@ def process_snippets (cmd, ly_snippets, texstr_snippets, png_snippets):
                             be_verbose=global_options.verbose, 
                             progress_p=1)
 
-    if global_options.format in (HTML, TEXINFO):
+    if global_options.format in (HTML, TEXINFO) and '--formats' not in cmd:
         cmd += ' --formats=png '
-    if global_options.format in (DOCBOOK):
+    elif global_options.format in (DOCBOOK) and '--formats' not in cmd:
         cmd += ' --formats=png,pdf '
+
+        
     # UGH
     # the --process=CMD switch is a bad idea
     # it is too generic for lilypond-book.
@@ -1563,6 +1565,7 @@ def write_file_map (lys, name):
     snippet_map = open ('snippet-map.ly', 'w')
     snippet_map.write ("""
 #(define version-seen #t)
+#(define output-empty-score-list #f)
 #(ly:add-file-name-alist '(
 """)
     for ly in lys:
@@ -1575,7 +1578,7 @@ def write_file_map (lys, name):
 def do_process_cmd (chunks, input_name):
     all_lys = filter (lambda x: is_derived_class (x.__class__,
                            Lilypond_snippet),
-             chunks)
+                      chunks)
 
     write_file_map (all_lys, input_name)
     ly_outdated = filter (lambda x: is_derived_class (x.__class__,