From ae39dcf4c381bf1b53a428d74d6e3f65d3c218c1 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 01:00:03 +0000 Subject: [PATCH] lilypond-1.3.145 --- Documentation/GNUmakefile | 2 +- Documentation/regression-test.tely | 4 +- Documentation/topdocs/FAQ.texi | 19 - Documentation/topdocs/INSTALL.texi | 377 ++++++------------- Documentation/topdocs/README.texi | 49 ++- Documentation/topdocs/index.tely | 16 +- configure.in | 7 +- flower/file-path.cc | 6 +- flower/include/interval.hh | 2 +- flower/include/interval.tcc | 8 - input/GNUmakefile | 2 +- input/les-nereides.ly | 2 +- input/regression/dynamics-unbound-hairpin.ly | 11 + input/regression/key-signature-scordatura.ly | 15 + input/test/add-text-script.ly | 35 ++ input/test/beam-count.ly | 21 ++ input/test/beam-dir-function.ly | 41 ++ input/test/beam-neutral-direction.ly | 14 + input/test/beam-position.ly | 14 + input/test/beam-rest.ly | 18 + input/test/beam-slope.ly | 17 +- input/test/boxed-molecule.ly | 58 +++ input/test/crescendo-text.ly | 16 + input/test/drarn-slurs.ly | 19 + input/test/drums.ly | 59 +++ input/test/embedded-postscript.ly | 18 + input/test/embedded-tex.ly | 12 + input/test/fill-a4.ly | 2 +- input/test/follow-thread.ly | 30 ++ input/test/improv.ly | 46 +++ input/test/metronome.ly | 30 ++ input/test/mmrest-collision.ly | 25 ++ input/test/move-notehead.ly | 14 + input/test/move-specific-text.ly | 13 + input/test/no-bar-lines.ly | 16 + input/test/no-staff.ly | 14 + input/test/ottava.ly | 17 + input/test/part-combine.ly | 38 ++ input/test/partial-blank.ly | 28 ++ input/test/reverse-music.ly | 31 ++ input/test/slur-attachment-override.ly | 22 ++ input/test/slur-attachment.ly | 18 + input/test/slur-ugly.ly | 36 ++ input/test/smart-transpose.ly | 83 ++++ input/test/staff-container.ly | 39 ++ input/test/two-key.ly | 13 + input/test/vertical-extent.ly | 13 +- lily/axis-group-engraver.cc | 6 +- lily/bezier.cc | 2 +- lily/command-request.cc | 29 +- lily/dynamic-engraver.cc | 24 +- lily/include/command-request.hh | 3 +- lily/include/debug.hh | 3 +- lily/include/key-item.hh | 2 +- lily/key-engraver.cc | 14 +- lily/key-item.cc | 105 +++--- lily/lexer.ll | 18 +- lily/main.cc | 1 - lily/multi-measure-rest-engraver.cc | 33 +- lily/my-lily-parser.cc | 2 +- lily/slur-bezier-bow.cc | 5 - ly/engraver.ly | 28 +- scm/translator-property-description.scm | 32 +- scripts/convert-ly.py | 23 +- stepmake/aclocal.m4 | 29 +- 65 files changed, 1243 insertions(+), 506 deletions(-) create mode 100644 input/regression/dynamics-unbound-hairpin.ly create mode 100644 input/regression/key-signature-scordatura.ly create mode 100644 input/test/add-text-script.ly create mode 100644 input/test/beam-count.ly create mode 100644 input/test/beam-dir-function.ly create mode 100644 input/test/beam-neutral-direction.ly create mode 100644 input/test/beam-position.ly create mode 100644 input/test/beam-rest.ly create mode 100644 input/test/boxed-molecule.ly create mode 100644 input/test/crescendo-text.ly create mode 100644 input/test/drarn-slurs.ly create mode 100644 input/test/drums.ly create mode 100644 input/test/embedded-postscript.ly create mode 100644 input/test/embedded-tex.ly create mode 100644 input/test/follow-thread.ly create mode 100644 input/test/improv.ly create mode 100644 input/test/metronome.ly create mode 100644 input/test/mmrest-collision.ly create mode 100644 input/test/move-notehead.ly create mode 100644 input/test/move-specific-text.ly create mode 100644 input/test/no-bar-lines.ly create mode 100644 input/test/no-staff.ly create mode 100644 input/test/ottava.ly create mode 100644 input/test/part-combine.ly create mode 100644 input/test/partial-blank.ly create mode 100644 input/test/reverse-music.ly create mode 100644 input/test/slur-attachment-override.ly create mode 100644 input/test/slur-attachment.ly create mode 100644 input/test/slur-ugly.ly create mode 100644 input/test/smart-transpose.ly create mode 100644 input/test/staff-container.ly create mode 100644 input/test/two-key.ly diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile index 3a21d70c30..d4b99a936a 100644 --- a/Documentation/GNUmakefile +++ b/Documentation/GNUmakefile @@ -1,7 +1,7 @@ depth = .. NAME = documentation -SUBDIRS=user bibliography pictures topdocs ntweb misc +SUBDIRS=user bibliography pictures topdocs misc STEPMAKE_TEMPLATES=documentation texinfo tex LOCALSTEPMAKE_TEMPLATES=lilypond ly diff --git a/Documentation/regression-test.tely b/Documentation/regression-test.tely index 1f9b51238b..6965c068a9 100644 --- a/Documentation/regression-test.tely +++ b/Documentation/regression-test.tely @@ -68,7 +68,7 @@ and documenting bugfixes. @lilypondfile[printfilename]{dynamics-broken-hairpin.ly} - +@lilypondfile[printfilename]{dynamics-unbound-hairpin.ly} @section Chord names @@ -241,6 +241,8 @@ and documenting bugfixes. @lilypondfile[printfilename]{keys.ly} +@lilypondfile[printfilename]{key-signature-scordatura.ly} + @section Hacks and Features @lilypondfile[printfilename]{generic-output-property.ly} diff --git a/Documentation/topdocs/FAQ.texi b/Documentation/topdocs/FAQ.texi index 97d93cb614..257fccc37d 100644 --- a/Documentation/topdocs/FAQ.texi +++ b/Documentation/topdocs/FAQ.texi @@ -58,25 +58,6 @@ yourself: @end example -@subsection Is there an emacs mode? - -Yes. It is included with the source archive as -@file{lilypond-mode.el} and @file{lilypond-font-lock.el}. If you have -an RPM, it is in @file{/usr/share/doc/lilypond-X/}. You have to install -it yourself. - -Add this to your ~/.emacs or ~/.emacs.el: -@example - (load-library "lilypond-mode.el") - (setq auto-mode-alist - (cons '("\\.ly$" . LilyPond-mode) auto-mode-alist)) - (add-hook 'LilyPond-mode-hook (lambda () (turn-on-font-lock))) -@end example - -If you have the latest LilyPond-1.3.x Debian package, LilyPond-mode -is automatically loaded, so you need not modify your ~/.emacs file. - - @subsection I downloaded the windows32 port, and it doesn't match the website! The website is usually made from the latest snapshots. Binary releases, diff --git a/Documentation/topdocs/INSTALL.texi b/Documentation/topdocs/INSTALL.texi index 53966d411b..340221e642 100644 --- a/Documentation/topdocs/INSTALL.texi +++ b/Documentation/topdocs/INSTALL.texi @@ -13,140 +13,140 @@ You can get the latest version of LilyPond at @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/, ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/}. +There are three options for downloading sources. + +@itemize +@item if you don't have any version, then you can download + the entire @file{.tar.gz} file. + +@item if you have an unpacked source tree of a previous version, you +may use the diffs . + @emph{If you upgrade by patching do remember to rerun autoconf after applying the patch}. -If you do not want to download the entire archive for each version, the -safest method for upgrading is to use @file{xdelta}, see -@uref{ftp://ftp.xcf.berkeley.edu/pub/xdelta/}. + +@item if you have the @code{.tar.gz} file of a previous release, you can +use +@uref{ftp://ftp.xcf.berkeley.edu/pub/xdelta/, xdelta}. + This is much safer than using normal diffs, and is the recommended way. The following command produces @file{lilypond-1.3.122.tar.gz} from -@file{lilypond-1.3.121} identical (up to compression dates) to the .122 on -the FTP site. +@file{lilypond-1.3.121} identical (up to compression dates) to the .122 +on the FTP site. @example xdelta patch lilypond-1.3.121-1.3.122.xd lilypond-1.3.121.tar.gz @end example +@end itemize -@section Prerequisites - -For compilation you need: - -@itemize @bullet -@item A GNU system: GNU LilyPond is known to run on these GNU systems: Linux - (PPC, intel), FreeBSD, AIX, NeXTStep, IRIX, Digital Unix and - Solaris. +@section Build requirements -@item Lots of disk space: LilyPond takes between 30 and 100 mb to -compile if you use debugging information. If you are short on -disk-space run configure with @code{--disable-debugging}. +This document describes how to build LilyPond on Unix platforms. It is +also known to run and compile on Windows NT/95/98 as well. More +information on this topic can be found at +@uref{http://appel.lilypond.org/lilypond/gnu-windows/, Jan's windows +page}. -@item -Although we recommend to use Unix, LilyPond is known to run on Windows -NT/95/98 as well. See Section Windows NT/95,es. +You need the following packages to compile Lilypond. -@item A reasonable C++ compiler: EGCS 1.1, GCC 2.95.2 or newer. Check out @uref{ftp://ftp.gnu.org/gnu/gcc/}. +@itemize +@item A reasonably new C++ compiler: EGCS 1.1, GCC 2.95.2 or +newer. Check out @uref{ftp://ftp.gnu.org/gnu/gcc/, the gcc site}. @item Python 1.5, -Check out @uref{ftp://ftp.python.org} or -@uref{ftp://ftp.cwi.nl/pub/python}. +Check out @uref{http://www.python.org, the python website}. @item GUILE 1.3.4 or newer, check out -@uref{http://www.gnu.org/software/guile/guile.html,http://www.gnu.org/software/guile/guile.html}. +@uref{http://www.gnu.org/software/guile/guile.html,the GUILE webpage}. Version 1.4 is recommended for better performance. @item GNU Make. Check out -@uref{ftp://ftp.gnu.org/gnu/make/,ftp://ftp.gnu.org/gnu/make/}. +@uref{ftp://ftp.gnu.org/gnu/make/, the GNU +make FTP directory}. @item Flex (version 2.5.4a or newer). -Check out @uref{ftp://ftp.gnu.org/pub/gnu/non-gnu/flex/,ftp://ftp.gnu.org/pub/gnu/non-gnu/flex/}. +Check out @uref{http://www.gnu.org/software/flex/,the Flex webpage}. @item Bison (version 1.25 or newer). -Check out @uref{ftp://ftp.gnu.org/gnu/bison/,ftp://ftp.gnu.org/gnu/bison/}. +Check out @uref{http://www.gnu.org/software/bison/,the bison webpage} + +@item TeX. -@item TeX. If you want LilyPond to use kpathsea support (recommended), -make sure you have tetex 1.0 or newer (1.0.6 is known to work). You may -need to install a tetex-devel or tetex-dev package too. +If you want LilyPond to use kpathsea support (recommended), make sure +you have tetex 1.0 or newer (1.0.6 is known to work). You may need to +install a tetex-devel or tetex-dev package too. -@item Texinfo (version 4.0 or newer). -Check out @uref{ftp://ftp.gnu.org/gnu/texinfo/,ftp://ftp.gnu.org/gnu/texinfo/}. -Most documentation is in texinfo. +@item Texinfo (version 4.0 or newer). +The documentation of lily is written in texinfo. Check out +@uref{ftp://ftp.gnu.org/gnu/texinfo/,the texinfo FTP directory}. @item The geometry package for LaTeX is needed to use ly2dvi. -Available at -@uref{ftp://ftp.ctan.org/tex-archive/macros/latex/contrib/supported/geometry,ftp://ftp.ctan.org/tex-archive/macros/latex/contrib/supported/geometry} -or at mirror site @uref{ftp://ftp.dante.de,ftp://ftp.dante.de} +It is available at +@uref{ftp://ftp.ctan.org/tex-archive/macros/latex/contrib/supported/geometry,the +FTP directory for @code{geometry}}. This package is normally included +with the @TeX{} distribution. @item MetaPost, needed for generating PostScript fonts. Please note that tetex-0.4pl8 (included with Red Hat 5.x) does not include @file{mfplain.mp}, which is needed for producing the scalable font files. -If you do not want to use PostScript output, edit @file{mf/GNUmakefile}, -removing the line saying @code{PFA_FILES=} +If you don't have MetaPost and don't want to use PostScript output, then +edit @file{mf/GNUmakefile}, removing the line saying @code{PFA_FILES=}. @item kpathsea, a library for searching (TeX) files. @code{kpathsea} is usually included with your installation of TeX. @end itemize -@section Running +@section Running requirements GNU LilyPond does use a lot of resources. For operation you need the following software @itemize @bullet @item TeX. -@item A PostScript printer and/or viewer (such as Ghostscript) is strongly - recommended. Xdvi will show all embedded PostScript too if you have - Ghostscript installed. -@item GUILE 1.3.4, or newer. Check out @uref{http://www.gnu.org/programs/guile.html,http://www.gnu.org/software/guile/} +@item Xdvi and ghostscript +@item GUILE 1.3.4, or newer. Check out +@uref{http://www.gnu.org/software/guile.html,the GUILE webpage} @end itemize For running LilyPond successfully you have to help TeX and MetaFont find various files. The recommended way of doing so is adjusting the environment variables in the start-up scripts of your shell. Appropriate -Csh and sh scripts are left in @file{buildscripts/out/lilypond-profile} -and @file{buildscripts/out/lilypond-login} after compilation. - -The empty path component represents TeX and MetaFont's default search -paths. Scripts with the proper paths for the bourne and C-shell -respectively are generated in @file{buildscripts/out/lilypond-profile} -and @file{buildscripts/out/lilypond-login} during compilation. +Csh and bourne sh scripts are left in +@file{buildscripts/out/lilypond-profile} and +@file{buildscripts/out/lilypond-login} after compilation. LilyPond is a big and slow program. A fast CPU and plenty of RAM is recommended for comfortable use. -@section Website - -The website is the most convenient form to use for reading the -documentation on-line documentation. It is made by entering +@section Website requirements +The documentation comes in the form of a website. You can view this +website on the internet, but you can also build it locally. This process +requires a successful compile of lilypond. The website is built +by issuing @example make web-doc @end example -This does require a functioning LilyPond. The executable doesn't have -to be installed, though. -If you want to auto-generate Lily's website, you'll need some additional -conversion tools. +Building the website requires some additional tools: @itemize @bullet -@item xpmtoppm (from the netpbm package: the Portable Bitmap Utilities) (For Red Hat Linux - users: it is included within the package libgr-progs). +@item xpmtoppm (from the netpbm package: the Portable Bitmap Utilities). The original is at -@uref{ftp://ftp.x.org/contrib/utilities/netpbm-1mar1994.p1.tar.gz,ftp://ftp.x.org/contrib/utilities/netpbm-1mar1994.p1.tar.gz} +@uref{ftp://ftp.x.org/contrib/utilities/netpbm-1mar1994.p1.tar.gz,the +netpbm FTP site} -@item pnmtopng (also in libgr-progs for Red Hat). The original is +@item pnmtopng. The original is at -@uref{ftp://swrinde.nde.swri.edu/pub/png/applications/pnmtopng-2.37.2.tar.gz,ftp://swrinde.nde.swri.edu/pub/png/applications/pnmtopng-2.37.2.tar.gz}.i - -The version of @file{pnmtopng} that is distributed with Red Hat 5.1 and -5.2 contains a bug: pnmtopng is dynamically linked to the wrong -version of libpng. +@uref{ftp://swrinde.nde.swri.edu/pub/png/applications/pnmtopng-2.37.2.tar.gz,in +the pnmtopng FTP site}. @item @uref{http://www.lri.fr/~filliatr/ftp/bibtex2html/, Bibtex2html}, or @uref{http://www.uni-koblenz.de/ag-ki/ftp/bib2html/, Bib2html}. @@ -162,107 +162,68 @@ see our hypertextified bibliography. @section Configuring and compiling -to install GNU LilyPond, simply type: +to install GNU LilyPond, type: @example gunzip -c lilypond-x.y.z | tar xf - cd lilypond-x.y.z - ./configure # fill in your standard prefix with --prefix + ./configure # run with --help to see appropriate options make make install + sh buildscripts/clean-fonts.sh @end example -This will install a number of files, something close to: - -@example - /usr/local/man/man1/midi2ly.1 - /usr/local/man/man1/abc2ly.1 - /usr/local/man/man1/etf2ly.1 - /usr/local/man/man1/convert-ly.1 - /usr/local/man/man1/lilypond-book.1 - /usr/local/man/man1/lilypond.1 - /usr/local/bin/lilypond - /usr/local/bin/midi2ly - /usr/local/bin/convert-ly - /usr/local/bin/lilypond-book - /usr/local/bin/abc2ly - /usr/local/bin/pmx2ly - /usr/local/bin/musedata2ly - /usr/local/bin/etf2ly - /usr/local/share/lilypond/* - /usr/local/share/locale/@{....@}/LC_MESSAGES/lilypond.mo -@end example +If you are doing an upgrade, you should remove all @file{feta} +@code{.pk} and @file{.tfm} files. A script has been provided to do the +work for you, see @file{buildscripts/clean-fonts.sh}. -The above assumes that you are root and have the GNU development -tools, and your make is GNU make. If this is not the case, you can -adjust your environment variables to your taste: - +If you are not root, you should choose a @code{--prefix} argument that +points into your home directory, eg. @example - export CPPFLAGS="-I /home/me/my_include -DWEIRD_FOOBAR" - ./configure + ./configure --prefix=$HOME/usr @end example -@code{CPPFLAGS} are the preprocessor flags. +In this case, you have to insert the contents of +@code{buildscripts/out/lilypond-login} or +@code{buildscripts/out/lilypond-profile} into your start up scripts by +hand. -The configure script is Cygnus configure, and it will accept -@code{--help}. If you are not root, you will probably have to make it -with a different @code{--prefix} option. Our favourite location is + +@section Configuring for multiple platforms + +If you want to build multiple versions of LilyPond with different +configuration settings, you can use the @code{--enable-config=CONF} +option of configure. You should use @samp{make conf=CONF} to generate +the output in @file{out-CONF}. Example: suppose I want to build with +and without profiling. Then I'd use the following for the normal build, @example - ./configure --prefix=$HOME/usr - + ./configure --prefix=~ --enable-checking + make + make install @end example -In this case, you will have to set up MFINPUTS, and TEXINPUTS accordingly. - -Since GNU LilyPond currently is beta, you are advised to also use +and for the profiling version, I specify a different configuration. @example - --enable-debugging - --enable-checking - -@end example - -Options to configure include: + ./configure --prefix=~ --enable-profiling --enable-config=prof --disable-checking + make conf=prof + make conf=prof install -@table @samp -@item @code{--enable-printing} - Enable debugging print routines (lilypond @code{-D} option) -@item @code{--enable-optimise} - Set maximum optimisation: compile with @code{-O2}. This can be -unreliable on some compiler/platform combinations (eg, DEC Alpha and PPC) -@item @code{--enable-profiling} - Compile with support for profiling. -@item @code{--enable-config=CONF} - Output to different configuration files. Enables different binary - builds alongside eachother, eg, multi-configuration (debugging, - profiling), or multi-platform builds. Use `make conf=CONF' to - build for a specific configuration. -@end table +@end example -All options are documented in the @file{configure} help -The option @code{--enable-optimise} is recommended for Real Life usage. -If you do -@example - make all - -@end example -everything will be compiled, but nothing will be installed. The -resulting binaries can be found in the subdirectories @file{out/} (which -contain all files generated during compilation). @section Emacs mode - An emacs mode for LilyPond is included with the source archive as @file{lilypond-mode.el} and @file{lilypond-font-lock.el}. If you have an RPM, it is in @file{/usr/share/doc/lilypond-X/}. You have to install @@ -276,61 +237,18 @@ Add this to your ~/.emacs or ~/.emacs.el: (add-hook 'LilyPond-mode-hook (lambda () (turn-on-font-lock))) @end example -If you have the latest LilyPond-1.3.x Debian package, LilyPond-mode -is automatically loaded, so you need not modify your ~/.emacs file. - - -@section Configuring for multiple platforms - -If you want to build multiple versions of LilyPond with different -configuration settings, you can use the @code{--enable-config=CONF} -option. You should use @samp{make conf=CONF} to generate the output in -@file{out-CONF}. Example: suppose I want to build with and without -profiling. Then I'd use the following for the normal build, - -@example - - ./configure --prefix=~ --disable-optimise --enable-checking - make - make install - -@end example - -and for the profiling version, I specify a different configuration. - -@example - - ./configure --prefix=~ --enable-profiling --enable-config=prof --enable-optimise --disable-checking - make conf=prof - make conf=prof install - -@end example - - -@section Installing - -if you have done a successful @code{make}, then a simple - -@example - - make install - -@end example - -should do the trick. - -If you are doing an upgrade, please remember to remove obsolete -@file{.pk} and @file{.tfm} files of the fonts. A script has been -provided to do the work for you, see @file{bin/clean-fonts.sh}. +If you have the latest LilyPond-1.3.x Debian package, LilyPond-mode is +automatically loaded, so you need not modify your @code{~/.emacs} file. @section Red Hat Linux -Red Hat Linux users can compile an RPM. A spec file is in -@file{make/out/lilypond.spec}; it is distributed along with the -sources. +Red Hat 7.0 i386 RPMS are available from +@uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/RedHat/}. -You can make the rpm by issuing +You can also compile them yourself. A spec file is in +@file{make/out/lilypond.spec}. This file is distributed along with the +sources. You can make the rpm by issuing @example rpm -tb lilypond-x.y.z.tar.gz @@ -338,20 +256,12 @@ You can make the rpm by issuing @end example -Precompiled Red Hat 7.0 i386 RPMS are available from -@uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/RedHat/}. +For running on a Red Hat system you need these packages: guile, tetex, +tetex-dvips, libstdc++, python, ghostscript. -For compilation on a Red Hat system you need these packages, -in addition to the those needed for running: -@itemize @bullet -@item glibc-devel -@item libstdc++-devel -@item guile-devel -@item flex -@item bison -@item texinfo -@item tetex-devel -@end itemize +For compilation on a Red Hat system you need these packages, in addition +to the those needed for running: glibc-devel, gcc-c++, libstdc++-devel, +guile-devel, flex, bison, texinfo, tetex-devel, groff, libgr-progs. @section SuSE @@ -360,6 +270,10 @@ in addition to the those needed for running: Install @code{tetex}, @code{te_mpost}, @code{te_kpath}. +@section Mandrake + +[TODO] + @section Debian GNU/Linux A Debian package is also available. You may install it easily by using @@ -444,80 +358,15 @@ interfere with your build, you may want to do this before the build too: @end example -@section Windows NT/95 - -Separate instructions on building for W32 are available; See the files -in @file{Documentation/ntweb/}, included with the sources. @section Problems For help and questions use @email{help-gnu-music@@gnu.org} and @email{gnu-music-discuss@@gnu.org}. Please consult the faq before -mailing your problems. - -If you find bugs, please send bug reports to +mailing your problems. If you find bugs, please send bug reports to @email{bug-gnu-music@@gnu.org}. -Bugs that are LilyPond's fault are listed in our TODO list on the -web, or demonstrated in @file{input/bugs/}. - -Bugs that are not LilyPond's fault are documented here. - - -@unnumbered LinuxPPC Bugs: - -@itemize @bullet -@item egcs-1.1.2-12c (stock LinuxPPC R5) has a serious bug, upgrade to -fixed in egcs-1.1.2-12f or gcc-2.95-0a, @uref{ftp://dev.linuxppc.org/users/fsirl/R5/RPMS/ppc/} - -@item egcs-1.0.2 (LinuxPPC R4): -all compiling with @code{-O2} is suspect, in particular guile-1.3, and -Lily herself will break. -@end itemize - - - -@unnumbered Linux-i386 - -@itemize @bullet -@item SuSE6.2 and similar platforms (glibc 2.1, libstdc++ 2.9.0) - -Lily will crash during parsing (which suggests a C++ library -incompatibility). Precise cause, precise platform description or -solution are not known. - -Note that this only happens on some computers with the said platform. - -@item libg++ 2.7 - -LilyPond occasionally crashes while parsing the initialisation files. -This is a very obscure bug, and usually entering the commandline -differently "fixes" it. - -@example - lilypond input.ly -@end example - -and -@example - lilypond -I. ./input.ly -@end example -makes a difference - -Typical stacktrace: -@example - SIGSEGV - __libc_malloc (bytes=16384) - ?? () - yyFlexLexer::yy_create_buffer () - Includable_lexer::new_input (this=0x8209a00, s=@{strh_ = @{ -@end example - -This behaviour has been observed with machines that have old libg++ -versions (LinuxPPC feb '98, Red Hat 4.x). -@end itemize - - +Bugs that are not fault of LilyPond are documented here. @unnumbered Solaris: diff --git a/Documentation/topdocs/README.texi b/Documentation/topdocs/README.texi index 5c0af13b71..c10fa8db2a 100644 --- a/Documentation/topdocs/README.texi +++ b/Documentation/topdocs/README.texi @@ -26,7 +26,8 @@ problem with it, upgrade to the latest 1.3.x release. @section Requirements For the compilation and running of LilyPond you need some additional -packages. Please refer to the installation instructions. +packages. Please refer to the installation instructions in +@file{INSTALL.txt}. NOTE: If you downloaded a binary (.rpm or a W95/NT .zip file), you don't have to compile LilyPond. @@ -38,50 +39,47 @@ in the toplevel directory, as INSTALL.txt @section Documentation -The real documentation is the directory Documentation/ - -If you want to read the documentation online, these are options: +The documentation is available online at +@uref{http://www.cs.uu.nl/~hanwen/lilypond/index.html}. You can also +build it locally. This does require a working LilyPond binary. The +following formats are supported: @itemize @bullet -@item use HTML. Refer to INSTALL.txt for information +@item HTML. Refer to INSTALL.txt for information on how to make the HTML documentation. -@item use HTML. Point your browser to -@uref{http://www.cs.uu.nl/~hanwen/lilypond/index.html}. -@item use @file{.dvi}, for the tutorial and reference manual. Do - +@item @file{.dvi}, for the tutorial and reference manual. Do @example - make -C Documentation/user/ dvi -@end example -You need a working LilyPond binary to create the DVI and HTML sources. + make -C Documentation/user/ dvi -@item use ASCII. Do -using @example - make doc @end example +The printable documentation is left in @file{Documentation/user/out/}. + +@item paper. Create the .dvi documentation, and print it with dvips. @end itemize @section Comments -LilyPond is a long way from finished and polished. We do appreciate -criticism, comments, bugreports, patches, etc., but please, -@example +LilyPond is a long way from finished and polished, so we please send +your criticism, comments, bugreports, patches, etc., to the mailing +list. and @emph{not} to us personally. - Please send your e-mail to one of the MAILING LISTS - -@end example - -and @emph{not} to us personally. We have the following mailing lists: +We have the following mailing lists: @itemize @bullet @item @uref{http://mail.gnu.org/mailman/listinfo/info-gnu-music,info-gnu-music@@gnu.org} is a low-volume list for information on the GNU Music project. This list is moderated; ask @email{drl@@gnu.org, David R. Linn} or - @email{hanwen@@cs.uu.nl, Han-Wen} to send announcements for this list. + @email{hanwen@@cs.uu.nl, Han-Wen} to send announcements for this +list. +@item +@uref{http://mail.gnu.org/mailman/listinfo/gnu-music-discuss,gnu-music-discuss@@gnu.org} + For general discussions concerning LilyPond. + @item @uref{http://mail.gnu.org/mailman/listinfo/help-gnu-music,help-gnu-music@@gnu.org} For help with using LilyPond. @item @uref{http://mail.gnu.org/mailman/listinfo/bug-gnu-music,bug-gnu-music@@gnu.org} @@ -96,9 +94,6 @@ If you have received this file as part of a DOS/Window32 distribution source package, since it might contain more documentation @uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/} -If you decide to build LilyPond from source, please read the INSTALL.txt -document first, especially the Windows NT/95 section. - @section Caveats If you have installed a previous version, be sure to remove old font diff --git a/Documentation/topdocs/index.tely b/Documentation/topdocs/index.tely index 269f4b3f60..3b31902770 100644 --- a/Documentation/topdocs/index.tely +++ b/Documentation/topdocs/index.tely @@ -1,4 +1,4 @@ -\input texinfo @c -*-texinfo-*- +i\input texinfo @c -*-texinfo-*- @setfilename index.info @settitle LilyPond homepage @@ -10,12 +10,10 @@ [logo] @end html -@c @unnumberedsec LilyPond -- The GNU Project Music Typesetter - -@c something breaks on 3.12 f @unnumberedsec What is LilyPond? +@c also use keywords: music notation software LilyPond is a music typesetter. It produces beautiful sheet music using a high level description file as input. It excels at typesetting classical music, but you can also print pop-songs. With LilyPond we @@ -28,21 +26,19 @@ The input to LilyPond is plain text. So, you can use your favorite text editor to enter it, you can put it in mail or embed it in an article like this: -@quotation + @lilypond[fragment,verbatim] \relative c'' { \key c \minor; r8 c16 b c8 g as c16 b c8 d | g,4 } @end lilypond -@end quotation The output looks very good: the font and the layout algorithms were inspired by engraved music, so you can expect that same clear and elegant look from your LilyPond output. And if you don't like the looks, you can tweak almost everything. -The program also has limited MIDI functionality: you can write MIDI files with -lilypond, and we have a simple MIDI to lilypond conversion tool, -@file{midi2ly}. Conversion tools for PMX, MUP, ABC, Finale and Musedata are -also included. +The program also has limited MIDI functionality: you can write MIDI +files with lilypond. You can also import files in PMX, MUP, MIDI, ABC, +Finale and Musedata format. LilyPond is free software. It is licensed under GNU General Public License, so you can use, modify and redistribute the program with diff --git a/configure.in b/configure.in index 0e1e59b99c..f223e91291 100644 --- a/configure.in +++ b/configure.in @@ -17,17 +17,14 @@ AC_STEPMAKE_COMPILE AC_HAVE_HEADERS(assert.h sys/stat.h) AC_HEADER_STAT -if test "$optimise_b" = yes; then - DEFINES="$DEFINES -DSTRING_UTILS_INLINED" - AC_DEFINE(STRINGS_UTILS_INLINED) -fi +DEFINES="$DEFINES -DSTRING_UTILS_INLINED" +AC_DEFINE(STRINGS_UTILS_INLINED) AC_STEPMAKE_CXX AC_STEPMAKE_GXX AC_STEPMAKE_CXXTEMPLATE AC_STEPMAKE_LEXYACC AC_STEPMAKE_LIB -# AC_STEPMAKE_LIBTOOL AC_STEPMAKE_LOCALE AC_STEPMAKE_GETTEXT AC_STEPMAKE_MSGFMT diff --git a/flower/file-path.cc b/flower/file-path.cc index b078fbc3b6..b7ea0370d8 100644 --- a/flower/file-path.cc +++ b/flower/file-path.cc @@ -11,7 +11,7 @@ #endif #include "file-path.hh" -#include "flower-debug.hh" + #ifndef PATHSEP #define PATHSEP ':' @@ -106,7 +106,6 @@ File_path::parse_path (String p) String File_path::find (String nm) const { - DEBUG_OUT << "looking for" << nm << ": "; if (!nm.length_i () || (nm == "-") ) return nm; for (int i=0; i < size (); i++) @@ -119,7 +118,6 @@ File_path::find (String nm) const path += nm; - DEBUG_OUT << path << "? "; #if 0 /* @@ -144,12 +142,10 @@ File_path::find (String nm) const FILE *f = fopen (path.ch_C (), "r"); // ugh! if (f) { - DEBUG_OUT << "found\n"; fclose (f); return path; } } - DEBUG_OUT << '\n'; return ""; } diff --git a/flower/include/interval.hh b/flower/include/interval.hh index 69b14e891f..5a1d3c49af 100644 --- a/flower/include/interval.hh +++ b/flower/include/interval.hh @@ -78,7 +78,7 @@ struct Interval_t : public Drul_array { return ((1.0 - x) * Real (elem (LEFT)) + (x + 1.0) * Real (elem (RIGHT))) * 0.5; } String str () const; - void print () const; + bool elem_b (T r); void negate () { T r = -elem (LEFT); diff --git a/flower/include/interval.tcc b/flower/include/interval.tcc index ab7ab1410e..c78b476a91 100644 --- a/flower/include/interval.tcc +++ b/flower/include/interval.tcc @@ -14,15 +14,7 @@ #include #include "interval.hh" #include "string.hh" -#include "flower-debug.hh" -template -void -Interval_t::print () const -{ - if (flower_dstream) - *flower_dstream << str (); -} template int diff --git a/input/GNUmakefile b/input/GNUmakefile index b3ceba7c44..cdf61c3f95 100644 --- a/input/GNUmakefile +++ b/input/GNUmakefile @@ -2,7 +2,7 @@ depth = .. -SUBDIRS=bugs tricks test regression tutorial no-notation ascii-art +SUBDIRS=bugs test regression tutorial no-notation ascii-art examples=trip star-spangled-banner paddy scarlatti-test flexamples= diff --git a/input/les-nereides.ly b/input/les-nereides.ly index 2bae5fe900..638e98d6fd 100644 --- a/input/les-nereides.ly +++ b/input/les-nereides.ly @@ -441,7 +441,7 @@ lowerDynamics = \context Dynamics=lower \notes{ \consists "Output_property_engraver"; Generic_property_list = #generic-voice-properties \consists "Property_engraver"; - DynamicsMinimumVerticalExtent = #(cons -3 -3) + MinimumVerticalExtent = #(cons -3 -3) VerticalAlignment \override #'threshold = #'(9 . 9) startSustain = #"Ped." diff --git a/input/regression/dynamics-unbound-hairpin.ly b/input/regression/dynamics-unbound-hairpin.ly new file mode 100644 index 0000000000..f7b1e99515 --- /dev/null +++ b/input/regression/dynamics-unbound-hairpin.ly @@ -0,0 +1,11 @@ + +\header { +texidoc = "Crescendi may start off-notes. In that case, they should not collapse into flat lines."; +} + +\score { \notes { \context Voice { + < f''1 { s4 s4 \< \! s4 \> \! s4 } > +}} + +\paper { linewidth = -1. ;} +} diff --git a/input/regression/key-signature-scordatura.ly b/input/regression/key-signature-scordatura.ly new file mode 100644 index 0000000000..cdc0e96a21 --- /dev/null +++ b/input/regression/key-signature-scordatura.ly @@ -0,0 +1,15 @@ + +\header { texidoc = "Key signatures can be set per pitch +individually. This can be done bby setting @code{Staff.keySignature} +directly."; + +} +\score { \notes +\relative c' +\context Staff { + \property Staff.keySignature = #'(((1 . 2) . 1) ((0 . 3) . -1)) + f8 a c e + \property Staff.keySignature = #'(((1 . 2) . -1) ((0 . 4) . 2)) + e a, g a +} +} diff --git a/input/test/add-text-script.ly b/input/test/add-text-script.ly new file mode 100644 index 0000000000..43ef4c6845 --- /dev/null +++ b/input/test/add-text-script.ly @@ -0,0 +1,35 @@ +\header { +texidoc= "Using make-music, you can add +various stuff to notes. Here is an example +how to add an extra fingering. + +In general, first do a display of the music you want ot +create, then write a function that will build the structure for you."; +} + +#(define (make-script x) + (let* ( (m (ly-make-music "Text_script_req")) + ) + + (ly-set-mus-property m 'text-type 'finger) + (ly-set-mus-property m 'text x) + m + )) + +#(define (add-script m x) + (if (equal? (ly-music-name m) "Request_chord") + (ly-set-mus-property m 'elements + (cons (make-script x) (ly-get-mus-property m 'elements))) + + (let* ( (es (ly-get-mus-property m 'elements)) + (e (ly-get-mus-property m 'element)) ) + (map (lambda (y) (add-script y x)) es) + (if (music? e) + (add-script e x)) + ) + ) + m +) + +\score { \apply #(lambda (x) (add-script x "6") (display x) x ) \notes { c4-3 } } + diff --git a/input/test/beam-count.ly b/input/test/beam-count.ly new file mode 100644 index 0000000000..8258679872 --- /dev/null +++ b/input/test/beam-count.ly @@ -0,0 +1,21 @@ + + +fragment = \notes { + f'32 g a b b a g f + + \property Voice.autoBeamSettings + \set #'(end * * * *) = #(make-moment 1 4) + f32 g a b b a g f + + f32 g a + \property Voice.stemRightBeamCount = #1 b + \property Voice.stemLeftBeamCount = #1 b + a g f +} + +\paper { linewidth = -1.; } + +\score { + \notes\relative c \fragment + \paper { } +} diff --git a/input/test/beam-dir-function.ly b/input/test/beam-dir-function.ly new file mode 100644 index 0000000000..ef044f8e2f --- /dev/null +++ b/input/test/beam-dir-function.ly @@ -0,0 +1,41 @@ + +\header{ +texidoc=" +There are several ways to calculate the direction of a beam + +@table @samp +@item majority +number count of up or down notes +@item mean +mean centre distance of all notes +@item median +mean centre distance weighted per note +@end table + +We should see: + + up down down + + up up down +"; +} + +\score { + \notes \relative c'' { + % the default + %\property Voice.Beam \set #'dir-function = #beam-dir-majority + [d8 a] + \property Voice.Beam \set #'dir-function = #beam-dir-mean + [d a] + \property Voice.Beam \set #'dir-function = #beam-dir-median + [d a] + + \property Voice.Beam \set #'dir-function = #beam-dir-majority + \time 3/8; + [d8 a a] + \property Voice.Beam \set #'dir-function = #beam-dir-mean + [d a a] + \property Voice.Beam \set #'dir-function = #beam-dir-median + [d a a] + } +} diff --git a/input/test/beam-neutral-direction.ly b/input/test/beam-neutral-direction.ly new file mode 100644 index 0000000000..41187d8aa2 --- /dev/null +++ b/input/test/beam-neutral-direction.ly @@ -0,0 +1,14 @@ + + +fragment = \notes { + [b''8 b] + \property Voice.Beam \set #'default-neutral-direction = #-1 + [b b] +} + +\paper { linewidth = -1.; } + +\score { + \notes\relative c \fragment + \paper { } +} diff --git a/input/test/beam-position.ly b/input/test/beam-position.ly new file mode 100644 index 0000000000..19c4922353 --- /dev/null +++ b/input/test/beam-position.ly @@ -0,0 +1,14 @@ + + +fragment = \notes { + \property Voice.Beam \set #'staff-position = #2 + \property Voice.Beam \set #'height = #-2 + [c'8 c] +} + +\paper { linewidth = -1.; } + +\score { + \notes\relative c \fragment + \paper { } +} diff --git a/input/test/beam-rest.ly b/input/test/beam-rest.ly new file mode 100644 index 0000000000..bcdfe5b952 --- /dev/null +++ b/input/test/beam-rest.ly @@ -0,0 +1,18 @@ + +\header{ +texidoc=" +Beams over rests. +"; +} + +\score{ + \context Staff=one \notes\relative c''{ + r4 [r8 g a] + [bes8 r16 f g a] + [bes8 r16 \property Voice.stemLeftBeamCount = #1 f g a] + } + + \paper{ + linewidth =-1; + } +} diff --git a/input/test/beam-slope.ly b/input/test/beam-slope.ly index 95860f1477..a31582b76a 100644 --- a/input/test/beam-slope.ly +++ b/input/test/beam-slope.ly @@ -1,9 +1,14 @@ -\score { - \context Voice \notes\relative c { - [c''16 b] [a b] - - } + +fragment = \notes { + \property Voice.Beam \set #'direction = #1 + \property Voice.Beam \set #'height-hs = #0 + [a''8 e' d c] +} + +\paper { linewidth = -1.; } + +\score { + \notes\relative c \fragment \paper { } - \midi { } } diff --git a/input/test/boxed-molecule.ly b/input/test/boxed-molecule.ly new file mode 100644 index 0000000000..1dc8cb0fd3 --- /dev/null +++ b/input/test/boxed-molecule.ly @@ -0,0 +1,58 @@ +\header { + +texidoc = "overriding the molecule callback can also be used to draw a + box around arbitrary grobs. + + TODO: check whether the corners are really correct. + + "; +} +#(define (box-molecule xext yext) + (ly-make-molecule + (list 'filledbox (- (car xext)) (cdr xext) + (- (car yext)) (cdr yext)) + xext yext) +) + +#(define (widen-interval iv amount) + (cons (- (car iv) amount) + (+ (cdr iv) amount)) +) + +#(define (make-molecule-boxer callback) + (define (molecule-boxer grob) + (let* + ( + (mol (callback grob)) + (box-padding 0.1) + (x-ext (widen-interval (ly-get-molecule-extent mol 0) box-padding)) + (y-ext (widen-interval (ly-get-molecule-extent mol 1) box-padding)) + (rule-thick 0.1) + (x-rule (box-molecule (widen-interval x-ext rule-thick) + (cons 0 rule-thick))) + (y-rule (box-molecule (cons 0 rule-thick) y-ext)) + ) + + (set! mol (ly-combine-molecule-at-edge mol 0 1 y-rule (* 0.5 box-padding))) + (set! mol (ly-combine-molecule-at-edge mol 0 -1 y-rule (* 0.5 box-padding))) + (set! mol (ly-combine-molecule-at-edge mol 1 1 x-rule 0.0)) + (set! mol (ly-combine-molecule-at-edge mol 1 -1 x-rule 0.0)) + + mol + )) + molecule-boxer + ) + + + \score { \notes { + + \property Voice.TextScript \override #'molecule-callback = + #(make-molecule-boxer Text_item::brew_molecule) + + c'4^"foo" + +\property Voice.Stem \override #'molecule-callback = + #(make-molecule-boxer Stem::brew_molecule) + + c''8 + }} diff --git a/input/test/crescendo-text.ly b/input/test/crescendo-text.ly new file mode 100644 index 0000000000..fea7996def --- /dev/null +++ b/input/test/crescendo-text.ly @@ -0,0 +1,16 @@ + + +fragment = \notes { + \context Voice { + \property Voice.crescendoText = "cresc." + \property Voice.crescendoSpanner = #'dashed-line + a''2\mf\< a a \!a + } +} + +\paper { linewidth = -1.; } + +\score { + \notes\relative c \fragment + \paper { } +} diff --git a/input/test/drarn-slurs.ly b/input/test/drarn-slurs.ly new file mode 100644 index 0000000000..663856a909 --- /dev/null +++ b/input/test/drarn-slurs.ly @@ -0,0 +1,19 @@ + +\header{ +texidoc=" +Slurs can be forced to always attach to note heads. +"; +} + +fragment = \notes { + \property Voice.Slur \set #'direction = #1 + \property Voice.Slur \set #'attachment = #'(head . head) + g''16()g()g()g()d'()d()d()d +} + +\paper { linewidth = -1.; } + +\score { + \notes\relative c \fragment + \paper { } +} diff --git a/input/test/drums.ly b/input/test/drums.ly new file mode 100644 index 0000000000..ae4ac81487 --- /dev/null +++ b/input/test/drums.ly @@ -0,0 +1,59 @@ +% tests drum notation and midi-drums. +% see ly/drumpitch.ly for list of instruments and paper-kits. +% scm/midi.scm for list of midi-drumkits. + +\include "drumpitch.ly"; + +\version "1.3.142" + +drh = \notes { cymc4.^"crash" hhc16^"h.h." hh \repeat "unfold" 5 {hhc8 hho hhc8 hh16 hh} hhc4 r4 r2 } +drl = \notes {\repeat "unfold" 3 {bd4 sn8 bd bd4 } bd8 tommh tommh bd toml toml bd tomfh16 tomfh } +timb = \notes \repeat "unfold" 2 {timh4 ssh timl8 ssh r timh r4 ssh8 timl r4 cb8 cb} + +\score { \repeat "volta" 2 + < + \context TwoLineStaff=timbst \notes < + \property Staff.instrument="timbales" + \clef "percussion"; + \apply #(drums->paper 'timbales) \timb + > + \context Staff=drumst \notes < + \property Staff.instrument="drums" + \clef "percussion"; + \apply #(drums->paper 'drums) < + \context Voice=voa {\stemUp \drh } + \context Voice=vob {\stemDown \drl } + > + > + > + \paper { + \translator { + \StaffContext + \consists Instrument_name_engraver; + Script \override #'padding = #0.5 + } + \translator { + \StaffContext + \name TwoLineStaff; + \alias Staff; + \consists Instrument_name_engraver; + StaffSymbol \override #'line-count = #2; + BarLine \override #'bar-size = #2; + } + \translator { + \ScoreContext + \accepts TwoLineStaff; + } + } +} + +\score { \repeat "unfold" 2 + \context Staff \notes < + \property Staff.instrument="drums" + \timb + \drh + \drl + > + \midi{ \tempo 4=120; } +} + diff --git a/input/test/embedded-postscript.ly b/input/test/embedded-postscript.ly new file mode 100644 index 0000000000..557c9ba403 --- /dev/null +++ b/input/test/embedded-postscript.ly @@ -0,0 +1,18 @@ +\header { + texidoc = "By inserting the @TeX{} command \embeddedps, you can +insert postscript directly into the output. + +TODO: make molecule-callback to do this. + "; +} + +\score { + \notes \relative c'' { + a-#"\\embeddedps{3 4 moveto 5 3 rlineto stroke}" + -#"\\embeddedps{ [ 0 1 ] 0 setdash 3 5 moveto 5 -3 rlineto stroke}" + b-#"\\embeddedps{3 4 moveto 0 0 1 2 8 4 20 3.5 rcurveto stroke}" + s2 + a'1 + } + \paper { linewidth = 70 * \staffspace; } +} diff --git a/input/test/embedded-tex.ly b/input/test/embedded-tex.ly new file mode 100644 index 0000000000..8a6e0465b6 --- /dev/null +++ b/input/test/embedded-tex.ly @@ -0,0 +1,12 @@ + + +fragment = \notes { + a''^"3 $\\times$ \\`a deux" +} + +\paper { linewidth = -1.; } + +\score { + \notes\relative c \fragment + \paper { } +} diff --git a/input/test/fill-a4.ly b/input/test/fill-a4.ly index 504a4aa82c..1d949a5146 100644 --- a/input/test/fill-a4.ly +++ b/input/test/fill-a4.ly @@ -32,7 +32,7 @@ tagline="Ligly"; linewidth = 15.0\mm; \translator { \StaffContext - StaffMinimumVerticalExtent = #(cons 0 0) + MinimumVerticalExtent = #(cons 0 0) } } } diff --git a/input/test/follow-thread.ly b/input/test/follow-thread.ly new file mode 100644 index 0000000000..2771cb871b --- /dev/null +++ b/input/test/follow-thread.ly @@ -0,0 +1,30 @@ + +\header{ +texidoc=" +Theads can be traced automagically when they switch staffs by setting +property @code{followVoice}. +"; +} + +\version "1.3.139" +% followVoice: connect note heads with line when thread switches staff + +fragment = \notes { + \context PianoStaff < + \property PianoStaff.followVoice = ##t + \property Voice.VoiceFollower \set #'type = #'dashed-line + \context Staff \context Voice { + c'1 + \translator Staff=two + b2 a + } + \context Staff=two {\clef bass; \skip 1*2;} + > +} + +\paper { linewidth = -1.; } + +\score { + \notes\relative c \fragment + \paper { } +} diff --git a/input/test/improv.ly b/input/test/improv.ly new file mode 100644 index 0000000000..ff350187ec --- /dev/null +++ b/input/test/improv.ly @@ -0,0 +1,46 @@ + +improOn = \notes {\translator Voice = impro } +improOff = \notes {\translator SquashVoice = melo } + +global = \notes { s1*3 \bar "|."; } + +\score { + < + \context ChordNames \chords {e8:m7*7 a2.:m7 bes4:m7 b1:m7 e8:m } + \context Staff \notes < + \context SquashVoice = impro { \global } + \context Voice = melo \transpose c'' { + e8 e g a a16()bes()a8 g \improOn e8 + ~e2~e8 f4 fis8 + ~fis2 \improOff a16()bes a8 g e + } + > + > + \paper { + \translator { + \VoiceContext + \name SquashVoice; + \alias Voice; + \consists Pitch_squash_engraver; + \consists Local_key_engraver; + squashedPosition = 6; + NoteHead \override #'style = #'slash + Accidentals \override #'transparent = ##t + } + \translator { + \VoiceContext + \alias SquashVoice; + \consists Local_key_engraver; + } + \translator { + \ScoreContext + \accepts SquashVoice; + } + \translator { + \StaffContext + \remove Local_key_engraver; + \accepts SquashVoice; + } + linewidth = -1; + } +} diff --git a/input/test/metronome.ly b/input/test/metronome.ly new file mode 100644 index 0000000000..d712999f77 --- /dev/null +++ b/input/test/metronome.ly @@ -0,0 +1,30 @@ + + + +% Test scm markup text and kerning + +% Warning +% +% This is not a feature, it is a hack. If you change anything, +% it will probably break (that's because scm markup text is a +% bit broken and needs fixing). Chances are, it's already +% broken by the time you read this. Don't complain. +% +% FIXME: put in an item, and typeset by an engraver. + +#(define note '(rows (music "noteheads-2" ((kern . -0.1) "flags-stem")))) +#(define eight-note `(rows ,note ((kern . -0.1) (music ((raise . 3.5) "flags-u3"))))) +#(define dotted-eight-note `(rows ,eight-note (music "dots-dot"))) + +\score { + \notes\relative c'' { + a1^#`((rows (font-relative-size . -1)) ,dotted-eight-note " = 64") + } + \paper { + linewidth = -1.; + \translator{ + \ScoreContext + TextScript \override #'font-shape = #'upright + } + } +} diff --git a/input/test/mmrest-collision.ly b/input/test/mmrest-collision.ly new file mode 100644 index 0000000000..0fd96e72e8 --- /dev/null +++ b/input/test/mmrest-collision.ly @@ -0,0 +1,25 @@ + +\score { + \context Staff \notes < + \context Voice=i { + \property Voice.MultiMeasureRest \override #'staff-position = #3 + R1 + } + \context Voice=ii { + \property Voice.MultiMeasureRest \override #'staff-position = #-3 + R1 + } + > + \paper { + \translator { + \StaffContext + \remove Multi_measure_rest_engraver; + \remove Bar_engraver; + } + \translator { + \VoiceContext + \consists Multi_measure_rest_engraver; + \consists Bar_engraver; + } + } +} diff --git a/input/test/move-notehead.ly b/input/test/move-notehead.ly new file mode 100644 index 0000000000..87deb18689 --- /dev/null +++ b/input/test/move-notehead.ly @@ -0,0 +1,14 @@ + + +fragment = \notes { + \outputproperty #(make-type-checker 'note-head-interface) + #'extra-offset = #'(2 . 3) + c''2 c +} + +\paper { linewidth = -1.; } + +\score { + \notes\relative c \fragment + \paper { } +} diff --git a/input/test/move-specific-text.ly b/input/test/move-specific-text.ly new file mode 100644 index 0000000000..2fe4a71523 --- /dev/null +++ b/input/test/move-specific-text.ly @@ -0,0 +1,13 @@ + +#(define (make-text-checker text) + (lambda (grob) (equal? text (ly-get-grob-property grob 'text)))) + +\score { + \notes\relative c''' { + \property Voice.Stem \set #'direction = #1 + \outputproperty #(make-text-checker "m.d.") + #'extra-offset = #'(-3.5 . -4.5) + a^2^"m.d." + } + \paper { linewidth = -1.; } +} diff --git a/input/test/no-bar-lines.ly b/input/test/no-bar-lines.ly new file mode 100644 index 0000000000..1cd7f3cba5 --- /dev/null +++ b/input/test/no-bar-lines.ly @@ -0,0 +1,16 @@ + +\score { + \notes \relative c'' { + a b c d + d c b a + } + \paper { + linewidth = -1.; + \translator { + \StaffContext + whichBar = #"" + \remove "Time_signature_engraver"; + } + } +} + diff --git a/input/test/no-staff.ly b/input/test/no-staff.ly new file mode 100644 index 0000000000..5385aa24d1 --- /dev/null +++ b/input/test/no-staff.ly @@ -0,0 +1,14 @@ + +\score { + \notes { c4 c4 c8 c8 } + \paper { + linewidth = -1.; + \translator { + \StaffContext + \remove Staff_symbol_engraver; + \consists Pitch_squash_engraver; + \remove Clef_engraver; + } + } +} + diff --git a/input/test/ottava.ly b/input/test/ottava.ly new file mode 100644 index 0000000000..590bd730a8 --- /dev/null +++ b/input/test/ottava.ly @@ -0,0 +1,17 @@ + + +fragment = \notes { + a'''' b c a + \property Voice.TextSpanner \set #'type = #'dotted-line + \property Voice.TextSpanner \set #'edge-height = #'(0 . 1.5) + \property Voice.TextSpanner \set #'edge-text = #'("8va " . "") + \property Staff.centralCPosition = #-13 + a\spanrequest \start "text" b c a \spanrequest \stop "text" +} + +\paper { linewidth = -1.; } + +\score { + \notes\relative c \fragment + \paper { } +} diff --git a/input/test/part-combine.ly b/input/test/part-combine.ly new file mode 100644 index 0000000000..3e04e524b3 --- /dev/null +++ b/input/test/part-combine.ly @@ -0,0 +1,38 @@ + +\header{ +texidoc=" +In orchestral scores and hymns, voices are traditionally combined onto +one staff. LilyPond has a part combiner, that combines or separates two +voices according to actual rhythm and pitch. User-defined texts such as +``solo'' and ``@`a2'' are typeset automagically, as appropriate. +"; +} + +\score{ + \context Staff = flauti < + \time 4/4; + \context Voice=one \partcombine Voice + \context Thread=one \notes\relative c'' { + c4 d e f | b,4 d c d | r2 e4 f | c4 d e f | + c4 r e f | c4 r e f | c4 r a r | a a r a | + a2 \property Voice.soloADue = ##f a | + } + \context Thread=two \notes\relative c'' { + g4 b d f | r2 c4 d | a c c d | a4. b8 c4 d + c r e r | r2 s2 | a,4 r a r | a r r a | + a2 \property Voice.soloADue = ##f a | + } + > + \paper{ + linewidth = 80 * \staffspace; + \translator{ + \ThreadContext + \consists Rest_engraver; + } + \translator{ + \VoiceContext + \remove Rest_engraver; + } + } +} + diff --git a/input/test/partial-blank.ly b/input/test/partial-blank.ly new file mode 100644 index 0000000000..9b15bde29d --- /dev/null +++ b/input/test/partial-blank.ly @@ -0,0 +1,28 @@ + +%{ When entering half music (I.e. for students to complete by hand) + you need the spacing to correspond to the timing - all measures same length, etc. + This thing implements it by adding invisible staff with lots of fast notes. +%} + +\include "paper16.ly" + + +quickmeasure = \notes {[\repeat unfold 16 c''16]} +mel = \notes \relative c' {c16 d16 e8 a4 g2 e8 d c2. g'1 e4 d c2} + +\score { +\context PianoStaff \notes < + \context Staff = v < + \clef G; + \context Voice=melo {\mel} + \context Voice=invisible { + \property Voice.NoteHead \override #'transparent = ##t + \property Voice.Stem \override #'transparent = ##t + \property Voice.Beam \override #'transparent = ##t + \repeat unfold 4 \quickmeasure + } + > + \context Staff = empty \notes {\clef F; s1*4} +> +\paper {} +} diff --git a/input/test/reverse-music.ly b/input/test/reverse-music.ly new file mode 100644 index 0000000000..d93a8ec542 --- /dev/null +++ b/input/test/reverse-music.ly @@ -0,0 +1,31 @@ + +\header { +texidoc=" +Simple customised music apply. +"; +} + +music = \notes { c'4 d'4( e'4 f'4 } + +#(define (reverse-music music) + (let* ((elements (ly-get-mus-property music 'elements)) + (reversed (reverse elements)) + (span-dir (ly-get-mus-property music 'span-direction))) + + (ly-set-mus-property music 'elements reversed) + + (if (dir? span-dir) + (ly-set-mus-property music 'span-direction (- span-dir))) + + (map reverse-music reversed) + + music)) + +\score { + \context Voice { + \music + \apply #reverse-music \music + } + \paper { linewidth = -1.; } +} + diff --git a/input/test/slur-attachment-override.ly b/input/test/slur-attachment-override.ly new file mode 100644 index 0000000000..90f91188d1 --- /dev/null +++ b/input/test/slur-attachment-override.ly @@ -0,0 +1,22 @@ + +\header{ +texidoc=" +In some cases, you may want to set slur attachments by hand. +"; +} + + +fragment = \notes { + \property Voice.Stem \set #'direction = #1 + \property Voice.Slur \set #'direction = #1 + d'32( d'4 )d8.. + \property Voice.Slur \set #'attachment = #'(stem . stem) + d,32( d'4 )d8.. +} + +\paper { linewidth = -1.; } + +\score { + \notes\relative c \fragment + \paper { } +} diff --git a/input/test/slur-attachment.ly b/input/test/slur-attachment.ly new file mode 100644 index 0000000000..3b1ea943e2 --- /dev/null +++ b/input/test/slur-attachment.ly @@ -0,0 +1,18 @@ + + +fragment = \notes { + \property Voice.Slur \set #'direction = #1 + \property Voice.Stem \set #'length = #5.5 + g''8(g)g4 + g4(g8)g + \property Voice.Slur \set #'attachment = #'(stem . stem) + g8(g)g4 + g4(g8)g +} + +\paper { linewidth = -1.; } + +\score { + \notes\relative c \fragment + \paper { } +} diff --git a/input/test/slur-ugly.ly b/input/test/slur-ugly.ly new file mode 100644 index 0000000000..5e021dd199 --- /dev/null +++ b/input/test/slur-ugly.ly @@ -0,0 +1,36 @@ + +\header { +texidoc="You can get ugly slurs, if you want. +"; +} + +baseWalk = \notes \relative c { + d,8( a' d f a d f d a f d )a +} + +\score { + \notes \context PianoStaff < + \time 6/4; + \context Staff=up { s1 * 6/4 } + \context Staff=down < + \clef bass; + \autochange Staff \context Voice \baseWalk + > + > + \paper { + linewidth = -1.; + \translator { + \VoiceContext + Slur \override #'beautiful = #5.0 + Slur \override #'direction = #1 + Stem \override #'direction = #-1 + autoBeamSettings \override #'(end * * * *) + = #(make-moment 1 2) + } + \translator { + \PianoStaffContext + VerticalAlignment \override #'threshold = #'(5 . 5) + } + } +} + diff --git a/input/test/smart-transpose.ly b/input/test/smart-transpose.ly new file mode 100644 index 0000000000..05170116f2 --- /dev/null +++ b/input/test/smart-transpose.ly @@ -0,0 +1,83 @@ + +\header { +texidoc=" +@example + Here's a copy of my feature request : +@quotation + Your task, if you accept it is to implement a \smarttranspose + command> that would translate such oddities into more natural + notations. Double accidentals should be removed, as well as E-sharp + (-> F), bC (-> B), bF (-> E), B-sharp (-> C). +@end quotation + +You mean like this. (Sorry 'bout the nuked indentation.) +@end example +"; +} + +#(define (unhair-pitch p) + (let* ((o (pitch-octave p)) + (a (pitch-alteration p)) + (n (pitch-notename p))) + + (cond + ((and (> a 0) (or (eq? n 6) (eq? n 2))) + (set! a (- a 1)) (set! n (+ n 1))) + ((and (< a 0) (or (eq? n 0) (eq? n 3))) + (set! a (+ a 1)) (set! n (- n 1)))) + + (cond + ((eq? a 2) (set! a 0) (set! n (+ n 1))) + ((eq? a -2) (set! a 0) (set! n (- n 1)))) + + (if (< n 0) (begin (set! o (- o 1)) (set! n (+ n 7)))) + (if (> n 7) (begin (set! o (+ o 1)) (set! n (- n 7)))) + + (make-pitch o n a))) + +#(define (smart-transpose music pitch) + (let* ((es (ly-get-mus-property music 'elements)) + (e (ly-get-mus-property music 'element)) + (p (ly-get-mus-property music 'pitch)) + (body (ly-get-mus-property music 'body)) + (alts (ly-get-mus-property music 'alternatives))) + + (if (pair? es) + (ly-set-mus-property + music 'elements + (map (lambda (x) (smart-transpose x pitch)) es))) + + (if (music? alts) + (ly-set-mus-property + music 'alternatives + (smart-transpose alts pitch))) + + (if (music? body) + (ly-set-mus-property + music 'body + (smart-transpose body pitch))) + + (if (music? e) + (ly-set-mus-property + music 'element + (smart-transpose e pitch))) + + (if (pitch? p) + (begin + (set! p (unhair-pitch (Pitch::transpose p pitch))) + (ly-set-mus-property music 'pitch p))) + + music)) + + +music = \notes \relative c' { c4 d e f g a b c } + +\score { + \notes \context Staff { + \transpose ais' \music + \apply #(lambda (x) (smart-transpose x (make-pitch 0 5 1))) + \music + } + \paper { linewidth = -1.; } +} + diff --git a/input/test/staff-container.ly b/input/test/staff-container.ly new file mode 100644 index 0000000000..baa7cd2518 --- /dev/null +++ b/input/test/staff-container.ly @@ -0,0 +1,39 @@ + + +\header { + + texidoc = "By splitting the grouping (Axis_group_engraver) and +creation functionality into separate contexts, you can override +interesting things. You can also drop the \consistsend feature."; + +} + + +\score { + \notes < + \context StaffContainer = SA { \property StaffContainer.StaffSymbol \set + #'staff-space = #0.8 + \context Staff { c4 c4 } } + \context StaffContainer =SB { \context Staff { d f } } + > + +\paper { + \translator { + \ScoreContext + \accepts StaffContainer; + \denies Staff; + } + \translator { + \type Engraver_group_engraver; + \consists "Axis_group_engraver"; + \accepts "Staff"; + \name StaffContainer; + + } + \translator { + \StaffContext + \remove Axis_group_engraver; + } +} +} + diff --git a/input/test/two-key.ly b/input/test/two-key.ly new file mode 100644 index 0000000000..4b4f2039c7 --- /dev/null +++ b/input/test/two-key.ly @@ -0,0 +1,13 @@ +\header { + +texidoc = "If you specify two different key sigs at one point, a + warning is printed."; + +} + +\score { \notes +\context Voice < + { \key cis \major; cis4 \key bes \major; bes4 } + { \key cis \major; fis4 \key es \major; g4 } +> +} diff --git a/input/test/vertical-extent.ly b/input/test/vertical-extent.ly index d961cbfdf3..f6bcfa949a 100644 --- a/input/test/vertical-extent.ly +++ b/input/test/vertical-extent.ly @@ -1,14 +1,21 @@ +\header { texidoc = "vertical extents may be overriden by +VerticalExtent, VerticalExtent, VerticalExtent. These are +normal property values, and are written itno the grob when the +associated context finishes, so using it in \property works. + + "; } +\version "1.3.145"; \score { \notes < \context Staff = upper { - \property Staff.StaffVerticalExtent = #'(-15.0 . 0.0) + \property Staff.VerticalExtent = #'(-15.0 . 0.0) \clef alto; c1 \break c1 } \context Staff = lower { - \property Staff.StaffVerticalExtent = #'(-0.0 . 15.0) + \property Staff.VerticalExtent = #'(-0.0 . 15.0) \clef alto; g1 \break g1 } @@ -17,6 +24,6 @@ interscoreline = 13.0\mm; interscorelinefill = 0; \translator{\ScoreContext \remove "Bar_number_engraver";} - \translator{\StaffContext StaffMinimumVerticalExtent = #'(-2.0 . 2.0)} + \translator{\StaffContext MinimumVerticalExtent = #'(-2.0 . 2.0)} } } diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc index de404ca62f..1a68c4251f 100644 --- a/lily/axis-group-engraver.cc +++ b/lily/axis-group-engraver.cc @@ -63,7 +63,7 @@ void Axis_group_engraver::finalize () { String type = daddy_grav_l ()->type_str_ ; - SCM dims = get_property ((type + "VerticalExtent").ch_C ()); + SCM dims = get_property ("VerticalExtent"); if (gh_pair_p (dims) && gh_number_p (gh_car (dims)) && gh_number_p (gh_cdr (dims))) @@ -72,12 +72,12 @@ Axis_group_engraver::finalize () staffline_p_->set_grob_property ("extent-Y", dims); } - dims = get_property ((type + "MinimumVerticalExtent").ch_C ()); + dims = get_property ("MinimumVerticalExtent"); if (gh_pair_p (dims) && gh_number_p (gh_car (dims)) && gh_number_p (gh_cdr (dims))) staffline_p_->set_grob_property ("minimum-extent-Y", dims); - dims = get_property ((type + "ExtraVerticalExtent").ch_C ()); + dims = get_property ("ExtraVerticalExtent"); if (gh_pair_p (dims) && gh_number_p (gh_car (dims)) && gh_number_p (gh_cdr (dims))) staffline_p_->set_grob_property ("extra-extent-Y", dims); diff --git a/lily/bezier.cc b/lily/bezier.cc index d4a84ef800..edc53318fe 100644 --- a/lily/bezier.cc +++ b/lily/bezier.cc @@ -7,9 +7,9 @@ */ #include + #include "config.h" #include "warn.hh" - #include "libc-extension.hh" #include "bezier.hh" #include "polynomial.hh" diff --git a/lily/command-request.cc b/lily/command-request.cc index ea7e0a4a20..1b06d2f645 100644 --- a/lily/command-request.cc +++ b/lily/command-request.cc @@ -59,10 +59,37 @@ Key_change_req::transpose (Pitch p) set_mus_property ("pitch-alist", newlist); } -Break_req::Break_req () + +bool +alist_equal_p (SCM a, SCM b) { + for (SCM s = a; + gh_pair_p (s); s = gh_cdr (s)) + { + SCM key = gh_caar (s); + SCM val = gh_cdar (s); + SCM l = scm_assoc (key, b); + + if (l == SCM_BOOL_F + || !gh_equal_p ( gh_cdr (l), val)) + + return false; + } + return true; } +bool +Key_change_req::do_equal_b (Request const * m )const +{ + Key_change_req const * kc =dynamic_cast (m); + + if(!kc) + return false; + return alist_equal_p (get_mus_property ("pitch-alist"), + kc->get_mus_property ("pitch-alist")); +} + + bool Mark_req::do_equal_b (Request const * r) const diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 1bda7ea01f..23ae1bd020 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -174,7 +174,7 @@ Dynamic_engraver::process_music () script_p_->set_grob_property ("text", script_req_l_->get_mus_property ("text")); - Side_position_interface::set_direction (script_p_, LEFT); + Side_position_interface::set_direction (script_p_, DOWN); if (Direction d = script_req_l_->get_direction ()) Directional_element_interface::set (line_spanner_, d); @@ -373,10 +373,24 @@ Dynamic_engraver::typeset_all () */ - if (!finished_line_spanner_->get_bound (RIGHT) - && finished_line_spanner_->get_bound (LEFT)) - finished_line_spanner_->set_bound (RIGHT, finished_line_spanner_->get_bound (LEFT)); - + Grob * l = finished_line_spanner_->get_bound (LEFT ); + Grob * r = finished_line_spanner_->get_bound (RIGHT); + if (!r && l) + finished_line_spanner_->set_bound (RIGHT, l); + else if (!l && r) + finished_line_spanner_->set_bound (LEFT, r); + else if (!r && !l) + { + /* + This is a isolated dynamic apparently, and does not even have + any interesting support item. + */ + Grob * cc = unsmob_grob (get_property ("currentMusicalColumn")); + Item * ci = dynamic_cast(cc); + finished_line_spanner_->set_bound (RIGHT, ci); + finished_line_spanner_->set_bound (LEFT, ci); + } + typeset_grob (finished_line_spanner_); finished_line_spanner_ = 0; } diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index 2670690a3e..8c4cbeeb51 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -18,8 +18,6 @@ class Break_req : public Request { public: - - Break_req (); protected: VIRTUAL_COPY_CONS (Music); }; @@ -63,6 +61,7 @@ public: protected: VIRTUAL_COPY_CONS (Music); + bool do_equal_b (Request const * ) const; void transpose (Pitch d); }; diff --git a/lily/include/debug.hh b/lily/include/debug.hh index c592844006..956b06b54f 100644 --- a/lily/include/debug.hh +++ b/lily/include/debug.hh @@ -6,10 +6,9 @@ #define DEBUG_HH #include -#include "dstream.hh" + #include "real.hh" #include "lily-proto.hh" -#include "flower-debug.hh" #include "warn.hh" void progress_indication (String); diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh index 8b32647c4e..47c9bfdfe6 100644 --- a/lily/include/key-item.hh +++ b/lily/include/key-item.hh @@ -13,7 +13,7 @@ struct Key_item { - static int calculate_position (Grob*,SCM pair) ; + static void set_interface (Grob*); static bool has_interface (Grob*); DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index 7cfcee40b6..8dc62ea994 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -75,11 +75,6 @@ Key_engraver::create_key (bool def) Staff_symbol_referencer::set_interface (item_p_); Key_item::set_interface (item_p_); - SCM prop = get_property ("keyOctaviation"); - bool multi = to_boolean (prop); - - if (multi) - item_p_->set_grob_property ("multi-octave", gh_bool2scm (multi)); announce_grob (item_p_,keyreq_l_); } @@ -99,10 +94,15 @@ Key_engraver::try_music (Music * req_l) { if (Key_change_req *kc = dynamic_cast (req_l)) { - if (keyreq_l_) - warning (_ ("FIXME: key change merge")); + if (keyreq_l_ && !keyreq_l_->equal_b (kc)) + { + kc->origin ()->warning (_ ("Conflicting key signatures found.")); + keyreq_l_->origin ()->warning (_ ("This was the other key definition.")); + return false; + } keyreq_l_ = kc; read_req (keyreq_l_); + return true; } return false; diff --git a/lily/key-item.cc b/lily/key-item.cc index f1c8ec2232..c87f51ed7f 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -26,46 +26,48 @@ const int SHARP_TOP_PITCH=4; /* ais and bis typeset in lower octave */ /* FIXME: key-item should just get a list of (position, acc), and leave the thinking to other parties. - */ + + - TODO: put this in Scheme + + - lots of values trivially shared (key doesn't change very + often). Compute those once, and use that as cache for the rest. + +*/ int -Key_item::calculate_position (Grob *ki, SCM pair) +alteration_pos (SCM what, int alter, int c0p) { - int p = gh_scm2int (gh_car (pair)); - int a = gh_scm2int (gh_cdr (pair)); - int c0p = gh_scm2int (ki->get_grob_property ("c0-position")); - if (to_boolean (ki->get_grob_property ("multi-octave"))) - { - return p + c0p; - } - else { - // Find the c in the range -4 through 2 - int from_bottom_pos = c0p + 4; - from_bottom_pos = from_bottom_pos%7; - from_bottom_pos = (from_bottom_pos + 7)%7; // Precaution to get positive. - int c0 = from_bottom_pos - 4; + if (gh_pair_p (what)) + return gh_scm2int (gh_car (what)) * 7 + gh_scm2int (gh_cdr (what)) + c0p; + + int p = gh_scm2int (what); + + // Find the c in the range -4 through 2 + int from_bottom_pos = c0p + 4; + from_bottom_pos = from_bottom_pos%7; + from_bottom_pos = (from_bottom_pos + 7)%7; // Precaution to get positive. + int c0 = from_bottom_pos - 4; - if ((a<0 && ((p>FLAT_TOP_PITCH) || (p+c0>4)) && (p+c0>1)) - || - (a>0 && ((p>SHARP_TOP_PITCH) || (p+c0>5)) && (p+c0>2))) - { - p -= 7; /* Typeset below c_position */ - } - /* Provide for the four cases in which there's a glitch + if ((alter <0 && ((p>FLAT_TOP_PITCH) || (p+c0>4)) && (p+c0>1)) + || + (alter >0 && ((p>SHARP_TOP_PITCH) || (p+c0>5)) && (p+c0>2))) + { + p -= 7; /* Typeset below c_position */ + } + /* Provide for the four cases in which there's a glitch it's a hack, but probably not worth the effort of finding a nicer solution. --dl. */ - if (c0==2 && a>0 && p==3) - p -= 7; - if (c0==-3 && a>0 && p==-1) - p += 7; - if (c0==-4 && a<0 && p==-1) - p += 7; - if (c0==-2 && a<0 && p==-3) - p += 7; + if (c0==2 && alter >0 && p==3) + p -= 7; + if (c0==-3 && alter>0 && p==-1) + p += 7; + if (c0==-4 && alter<0 && p==-1) + p += 7; + if (c0==-2 && alter<0 && p==-3) + p += 7; - return p + c0; - } + return p + c0; } /* @@ -78,7 +80,6 @@ Key_item::brew_molecule (SCM smob) { Grob*me =unsmob_grob (smob); - Real inter = Staff_symbol_referencer::staff_space (me)/2.0; SCM newas = me->get_grob_property ("new-accidentals"); @@ -87,11 +88,15 @@ Key_item::brew_molecule (SCM smob) SCM lists are stacks, so we work from right to left, ending with the cancellation signature. */ + int c0p = gh_scm2int (me->get_grob_property ("c0-position")); for (SCM s = newas; gh_pair_p (s); s = gh_cdr (s)) { - int a = gh_scm2int (gh_cdar (s)); - Molecule m = Font_interface::get_default_font (me)->find_by_name ("accidentals-" + to_str (a)); - m.translate_axis (calculate_position (me, gh_car (s)) * inter, Y_AXIS); + SCM what = gh_caar (s); + int alter = gh_scm2int (gh_cdar (s)); + int pos = alteration_pos (what, alter, c0p); + + Molecule m = Font_interface::get_default_font (me)->find_by_name ("accidentals-" + to_str (alter)); + m.translate_axis (pos * inter, Y_AXIS); mol.add_at_edge (X_AXIS, LEFT, m, 0); } @@ -99,6 +104,7 @@ Key_item::brew_molecule (SCM smob) if (it->break_status_dir () != RIGHT) { SCM old = me->get_grob_property ("old-accidentals"); + /* Add half a space between cancellation and key sig. @@ -108,24 +114,25 @@ Key_item::brew_molecule (SCM smob) Interval y (0,0); mol.add_at_edge (X_AXIS, LEFT, Lookup::blank (Box (x,y)),0); + + Molecule natural; + if (gh_pair_p (old)) + natural=Font_interface::get_default_font (me)->find_by_name ("accidentals-0"); for (; gh_pair_p (old); old = gh_cdr (old)) { - SCM found = SCM_EOL; - - /* - find correspondences in pitches - */ - for (SCM s = newas; gh_pair_p (s); s = gh_cdr (s)) - if (gh_caar (s) == gh_caar (old)) - found = gh_car (s); - - if (found == SCM_EOL || gh_cdr (found) != gh_cdar (old)) + SCM found = scm_assoc (gh_caar (old), newas); + if (found == SCM_BOOL_F + || gh_cdr (found) != gh_cdar (old)) { - Molecule m =Font_interface::get_default_font (me)->find_by_name ("accidentals-0"); + SCM what = gh_caar (old); + int alter = 0; + int pos = alteration_pos (what, alter, c0p); + + Molecule m = natural; + m.translate_axis (pos* inter, Y_AXIS); - m.translate_axis (calculate_position (me, gh_car (old)) * inter, Y_AXIS); - mol.add_at_edge (X_AXIS, LEFT, m,0); + mol.add_at_edge (X_AXIS, LEFT, m, 0); } } } diff --git a/lily/lexer.ll b/lily/lexer.ll index 7deca514b0..d8646ab673 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -145,7 +145,7 @@ HYPHEN -- \"[^"]*\";? { /* got the include file name */ String s (YYText ()+1); s = s.left_str (s.index_last_i ('"')); - DEBUG_OUT << "#version `" << s << "'\n"; + yy_pop_state (); if (!valid_version_b (s)) return INVALID; @@ -187,7 +187,7 @@ HYPHEN -- \"[^"]*\";? { /* got the include file name */ String s (YYText ()+1); s = s.left_str (s.index_last_i ('"')); - DEBUG_OUT << "#include `" << s << "'\n"; + new_input (s,source_global_l); yy_pop_state (); } @@ -196,7 +196,7 @@ HYPHEN -- strip_trailing_white (s); if (s.length_i () && (s[s.length_i () - 1] == ';')) s = s.left_str (s.length_i () - 1); - DEBUG_OUT << "#include `\\" << s << "'\n"; + SCM sid = lookup_identifier (s); if (gh_string_p (sid)) { new_input (ly_scm2string (sid), source_global_l); @@ -290,7 +290,7 @@ HYPHEN -- *yylval.string += YYText (); } \" { - DEBUG_OUT << "quoted string: `" << *yylval.string << "'\n"; + yy_pop_state (); /* yylval is union. Must remember STRING before setting SCM*/ @@ -330,7 +330,7 @@ HYPHEN -- _ ("Brace found at end of lyric. Did you forget a space?")); yylval.scm = ly_str02scm (s.ch_C ()); - DEBUG_OUT << "lyric : `" << s << "'\n"; + return STRING; } . { @@ -369,7 +369,7 @@ HYPHEN -- } <> { - DEBUG_OUT << "<>"; + if (! close_input ()) { yyterminate (); // can't move this, since it actually rets a YY_NULL @@ -387,7 +387,7 @@ HYPHEN -- Real r; int cnv=sscanf (YYText (), "%lf", &r); assert (cnv == 1); - DEBUG_OUT << "REAL" << r<<'\n'; + yylval.real = r; return REAL; } @@ -398,12 +398,12 @@ HYPHEN -- } [{}] { - DEBUG_OUT << "parens\n"; + return YYText ()[0]; } [*:=] { char c = YYText ()[0]; - DEBUG_OUT << "misc char" < (i.elem_l_); - if (item && Bar::has_interface (item)) - { - if (mmrest_p_) - Multi_measure_rest::add_column (mmrest_p_,item); - if (lastrest_p_) - Multi_measure_rest::add_column (lastrest_p_,item); - } -} bool Multi_measure_rest_engraver::try_music (Music* req_l) @@ -125,7 +109,15 @@ Multi_measure_rest_engraver::process_music () = gh_scm2int (get_property ("currentBarNumber")); } - + if (gh_string_p (get_property ("whichBar"))) + { + Grob *cmc = unsmob_grob (get_property( "currentCommandColumn")); + Item *it = dynamic_cast (cmc); + if (mmrest_p_) + add_bound_item (mmrest_p_, it); + if (lastrest_p_) + add_bound_item (lastrest_p_,it); + } } void @@ -136,7 +128,7 @@ Multi_measure_rest_engraver::stop_translation_timestep () if (mmrest_p_ && (now_mom () >= start_moment_) && !mp - && (scm_ilength (mmrest_p_->get_grob_property ("columns")) >= 2)) + && mmrest_p_->get_bound (LEFT) && mmrest_p_->get_bound (RIGHT)) { typeset_grob (mmrest_p_); /* @@ -148,8 +140,7 @@ Multi_measure_rest_engraver::stop_translation_timestep () if (lastrest_p_) { /* sanity check */ - if (scm_ilength (lastrest_p_->get_grob_property ("columns")) >= 2 - && lastrest_p_->get_bound (LEFT) && lastrest_p_->get_bound (RIGHT) + if (lastrest_p_->get_bound (LEFT) && lastrest_p_->get_bound (RIGHT) && lastrest_p_->get_bound (LEFT) != lastrest_p_->get_bound (RIGHT)) typeset_grob (lastrest_p_); lastrest_p_ = 0; diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index 7fa6ff7d04..f6553c9cb5 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -46,7 +46,7 @@ My_lily_parser::parse_file (String init, String s) progress_indication (_ ("Parsing...")); - set_yydebug (flower_dstream &&!flower_dstream->silent_b ("Parser")); + set_yydebug (0); lexer_p_->new_input (init, source_l_); do_yyparse (); diff --git a/lily/slur-bezier-bow.cc b/lily/slur-bezier-bow.cc index d7395d2518..b5f0db22d7 100644 --- a/lily/slur-bezier-bow.cc +++ b/lily/slur-bezier-bow.cc @@ -163,9 +163,6 @@ Slur_bezier_bow::minimise_enclosed_area (Real beauty, for (int i=0; i < steps; i++) { Real area = enclosed_area_f (); - if (!i) - DEBUG_OUT << to_str ("Init area: %f\n", area); - if (area <= beautiful) break; @@ -186,8 +183,6 @@ Slur_bezier_bow::minimise_enclosed_area (Real beauty, curve_.control_[1][X_AXIS] -= da[0] * u * pct; curve_.control_[2][X_AXIS] -= da[1] * u * pct; } - - // Real area = enclosed_area_f (); } diff --git a/ly/engraver.ly b/ly/engraver.ly index 6536fe26bb..5a6c0eff0f 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -44,6 +44,10 @@ StaffContext=\translator { %} \consistsend "Axis_group_engraver"; + + MinimumVerticalExtent = ##f + ExtraVerticalExtent = ##f + VerticalExtent = ##f % explicitly set instrument, so we don't get % weird effects when doing instrument names for @@ -59,6 +63,10 @@ StaffContext=\translator { StaffContainerContext = \translator { \type Engraver_group_engraver; \consists "Axis_group_engraver"; + MinimumVerticalExtent = ##f + ExtraVerticalExtent = ##f + VerticalExtent = ##f + \accepts Staff; \name StaffContainer; } @@ -92,6 +100,9 @@ RhythmicStaffContext=\translator{ \consists "Output_property_engraver"; Generic_property_list = #generic-staff-properties + MinimumVerticalExtent = ##f + ExtraVerticalExtent = ##f + VerticalExtent = ##f \consists "Pitch_squash_engraver"; \consists "Separating_line_group_engraver"; @@ -276,8 +287,9 @@ StaffGroupContext = \translator { LyricsVoiceContext= \translator{ \type "Engraver_group_engraver"; \consistsend "Axis_group_engraver"; - LyricsVoiceMinimumVerticalExtent = #(cons -1.2 1.2) - + MinimumVerticalExtent = #(cons -1.2 1.2) + ExtraVerticalExtent = ##f + VerticalExtent = ##f \name LyricsVoice ; \consists "Separating_line_group_engraver"; \consists "Lyric_engraver"; @@ -291,6 +303,12 @@ NoteNamesContext = \translator { \type "Engraver_group_engraver"; \name NoteNames; \consistsend "Axis_group_engraver"; + + MinimumVerticalExtent = ##f + ExtraVerticalExtent = ##f + VerticalExtent = ##f + + \consists "Note_name_engraver"; \consists "Separating_line_group_engraver"; } @@ -302,6 +320,9 @@ LyricsContext = \translator { Generic_property_list = #generic-lyrics-properties \consists "Property_engraver"; \consistsend "Axis_group_engraver"; + MinimumVerticalExtent = ##f + ExtraVerticalExtent = ##f + VerticalExtent = ##f \accepts "LyricsVoice"; } @@ -319,6 +340,9 @@ ChordNamesContext = \translator { \consists "Chord_name_engraver"; \consists "Skip_req_swallow_translator"; \consistsend "Axis_group_engraver"; + MinimumVerticalExtent = ##f + ExtraVerticalExtent = ##f + VerticalExtent = ##f VerticalAxisGroup \override #'invisible-staff = ##t } diff --git a/scm/translator-property-description.scm b/scm/translator-property-description.scm index 4751d5ef7b..8f91636ac3 100644 --- a/scm/translator-property-description.scm +++ b/scm/translator-property-description.scm @@ -15,18 +15,30 @@ -(translator-property-description 'CONTEXTNAMEMinimumVerticalExtent number-pair? "minimum vertical extent, same format as CONTEXTNAMEVerticalExtent [fixme, naming]") -(translator-property-description 'CONTEXTNAMEVerticalExtent number-pair? "hard coded vertical extent. +(translator-property-description 'MinimumVerticalExtent number-pair? + "minimum vertical extent, same format as VerticalExtent") + +(translator-property-description 'VerticalExtent number-pair? + "hard coded vertical extent. The format is a pair of dimensions, for example, this sets the sizes of a staff to 10 (5+5) staffspaces high. @example -property Staff.StaffVerticalExtent = #(-5.0 . 5.0) +property Staff.VerticalExtent = #(-5.0 . 5.0) @end example - [fixme, naming]") -(translator-property-description 'CONTEXTNAMExtraVerticalExtent number-pair? "extra vertical extent, same format -CONTEXTNAMEMinimumVerticalExtent [fixme, naming]") +VerticalExtent, MinimumVerticalExtent and ExtraVerticalExtent are +predefined in all relevant contexts to @code{#f}, so they will not +inherit values. + +Note that these VerticalExtents can only operate on vertical groups, +and therefore only work in contexts which contain an +@code{Axis_group_engraver}. +") + +(translator-property-description 'ExtraVerticalExtent + number-pair? "extra vertical extent, same format as MinimumVerticalExtent") + (translator-property-description 'Generic_property_list list? "description of the conversion. Defines names and types for generic properties. These are properties @@ -190,14 +202,10 @@ remembered for the duration of a measure. Alist that defines in what order alterations should be printed. The format is (NAME . ALTER), where NAME is from 0 .. 6 and ALTER from -1, 1. ") -(translator-property-description 'keyOctaviation boolean? "") -(translator-property-description 'keySignature list? "The current key signature. This is an alist containing (NAME . ALTER) pairs, where NAME is from 0.. 6 and ALTER from -2,-1,0,1,2 ") +(translator-property-description 'keySignature list? "The current key signature. This is an alist containing (NAME . ALTER) or ((OCTAVE . NAME) . ALTER) pairs, where NAME is from 0.. 6 and ALTER from -2,-1,0,1,2 ") (translator-property-description 'localKeySignature list? "the key -signature at this point in the measure. The format is an alist with -entries of the form (NAME . ALTER) -or ((OCTAVE . NAME) . ALTER), -where NAME is from 0.. 6 and ALTER from -2,-1,0,1,2" +signature at this point in the measure. The format is the same as for keySignature. " ) (translator-property-description 'measureLength moment? "Length of one diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 583d7f5f9e..d35e379b41 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -525,10 +525,8 @@ if 1: -################ TODO: lots of other syntax change should be done here as well - - +# TODO: lots of other syntax change should be done here as well if 1: def conv (str): str = re.sub ('basicCollisionProperties', 'NoteCollision', str) @@ -623,7 +621,7 @@ if 1: conversions.append (((1,3,97), conv, 'ChordName -> ChordNames')) -## TODO: add lots of these +# TODO: add lots of these if 1: def conv (str): @@ -782,8 +780,21 @@ if 1: conversions.append (((1,3,144), conv, 'Chorda -> Corda')) -############################ - +if 1: + def conv (str): + str = re.sub ('([A-Za-z]+)MinimumVerticalExtent', 'MinimumV@rticalExtent', str) + str = re.sub ('([A-Za-z]+)ExtraVerticalExtent', 'ExtraV@rticalExtent', str) + str = re.sub ('([A-Za-z]+)VerticalExtent', 'VerticalExtent', str) + str = re.sub ('ExtraV@rticalExtent', 'ExtraVerticalExtent', str) + str = re.sub ('MinimumV@rticalExtent', 'MinimumVerticalExtent', str) + return str + + conversions.append (((1,3,145), conv, + 'ContextNameXxxxVerticalExtent -> XxxxVerticalExtent')) + +################################ +# END OF CONVERSIONS +################################ def get_conversions (from_version, to_version): def version_b (v, f = from_version, t = to_version): diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4 index b5684b86ad..7705707883 100644 --- a/stepmake/aclocal.m4 +++ b/stepmake/aclocal.m4 @@ -15,12 +15,11 @@ AC_DEFUN(AC_STEPMAKE_BIBTEX2HTML, [ AC_DEFUN(AC_STEPMAKE_COMPILE, [ # -O is necessary to get inlining - OPTIMIZE="" CFLAGS=${CFLAGS:-""} CXXFLAGS=${CXXFLAGS:-$CFLAGS} LDFLAGS=${LDFLAGS:-""} checking_b=yes - optimise_b=no + optimise_b=yes profile_b=no debug_b=yes @@ -32,19 +31,10 @@ AC_DEFUN(AC_STEPMAKE_COMPILE, [ [ --enable-debugging compile with debugging info. Default: on], [debug_b=$enableval]) - AC_ARG_ENABLE(optimise, - [ --enable-optimise use maximal speed optimisations. Default: off], - [optimise_b=$enableval]) - AC_ARG_ENABLE(profiling, [ --enable-profiling compile with gprof support. Default: off], [profile_b=$enableval]) - AC_ARG_ENABLE(mingw-prefix, - [ --enable-mingw-prefix=DIR - set the mingw32 directory (standalone windows32 exes)], - [MINGWPREFIX=$enableval], - [MINGWPREFIX=no]) if test "$checking_b" = no; then # ugh @@ -56,9 +46,6 @@ AC_DEFUN(AC_STEPMAKE_COMPILE, [ OPTIMIZE="-O2 -finline-functions" fi - if test "$optimise_b" = no; then - OPTIMIZE="" - fi if test $profile_b = yes; then EXTRA_LIBES="-pg" @@ -69,11 +56,6 @@ AC_DEFUN(AC_STEPMAKE_COMPILE, [ OPTIMIZE="$OPTIMIZE -g" fi - # however, C++ support in mingw32 v 0.1.4 is still flaky - if test x$MINGWPREFIX != xno; then - ICFLAGS="-I$MINGWPREFIX/include" - ILDFLAGS="-$MINGWPREFIX/lib" - fi AC_PROG_CC LD='$(CC)' @@ -434,16 +416,13 @@ AC_DEFUN(AC_STEPMAKE_KPATHSEA, [ [ --with-kpathsea use kpathsea lib. Default: on], [kpathsea_b=$enableval]) - if test $kpathsea_b = yes; then + if test "$kpathsea_b" = "yes"; then AC_HAVE_HEADERS(kpathsea/kpathsea.h) AC_CHECK_LIB(kpathsea, kpse_find_file) - # urg: kpse_find_tfm is a #define, how to check for this? - # AC_CHECK_LIB(kpathsea, kpse_find_tfm) - # AC_CHECK_FUNCS(kpse_find_file kpse_find_tfm,, AC_STEPMAKE_WARN(Cannot find kpathsea functions. You may have to create TFM files manually.)) - AC_CHECK_FUNCS(kpse_find_file,, AC_STEPMAKE_WARN(Cannot find kpathsea functions. You may have to create TFM files manually.) kpathsea_b=no) + AC_CHECK_FUNCS(kpse_find_file,, AC_ERROR(Cannot find kpathsea functions. Rerun with --without-kpathsea.) ) fi AC_MSG_CHECKING(whether to use kpathsea) - if test $kpathsea_b = yes; then + if test "$kpathsea_b" = yes; then AC_MSG_RESULT(yes) KPATHSEA=1 else -- 2.39.5