From: Francisco Vila Date: Sat, 27 Aug 2011 09:29:23 +0000 (+0200) Subject: Merge branch 'master' into lilypond/translation X-Git-Tag: release/2.15.9-1~5^2~8 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a066a93ee74edebb9d238a1bac93c3bc7e8e6e4a;hp=b3b16f007ed56ccac625596866d2ff8c081b4a5b;p=lilypond.git Merge branch 'master' into lilypond/translation --- diff --git a/Documentation/changes.tely b/Documentation/changes.tely index fcfd6ed68b..f5e4f151d2 100644 --- a/Documentation/changes.tely +++ b/Documentation/changes.tely @@ -61,6 +61,10 @@ which scares away people. @end ignore +@item +New command-line option @option{--loglevel=@var{level}} to control how much output +LilyPond creates. Possible values are ERROR, WARN, BASIC_PROGRESS, PROGRESS, DEBUG. + @item @code{\set \once} now correctly resets the property value to the previous value. @lilypond[fragment,quote,relative=2] diff --git a/Documentation/contributor/administration.itexi b/Documentation/contributor/administration.itexi index 5c1abe6c80..36ead431e1 100644 --- a/Documentation/contributor/administration.itexi +++ b/Documentation/contributor/administration.itexi @@ -20,7 +20,7 @@ don't fit anywhere else. The Contributor's Guide as a whole is still a work in progress, but some chapters are much more complete than others. Chapters which are @qq{almost finished} should not have major changes -without a discussion on @code{-devel}; in other chapters, a +without a discussion on @w{@code{-devel}}; in other chapters, a disorganized @qq{wiki-style dump} of information is encouraged. Do not change (other than spelling mistakes) without discussion: @@ -110,9 +110,9 @@ Currently: Francisco @item Frog Meister: is responsible for code patches from (relatively) inexperienced contributors. Keeps track of patches, does initial -reviewing of those patches, sends them to @code{-devel} when +reviewing of those patches, sends them to @w{@code{-devel}} when they've had some initial review on the Frog list, pesters the -@code{-devel} community into actually reviewing said patches, and +@w{@code{-devel}} community into actually reviewing said patches, and finally pushes the patches once they're accepted. This person is @emph{not} responsible for training new programmers, because that would be far too much work -- he job is @qq{only} to guide diff --git a/Documentation/contributor/build-notes.itexi b/Documentation/contributor/build-notes.itexi index 16726b1bc2..b84bdbef60 100644 --- a/Documentation/contributor/build-notes.itexi +++ b/Documentation/contributor/build-notes.itexi @@ -347,7 +347,7 @@ install-WWW: @end smallexample I don't currently understand the @code{ifeq}, since @code{$(out)} -is empty at this point, but the line starting @code{-$(INSTALL)} +is empty at this point, but the line starting @w{@code{-$(INSTALL)}} translates to: @example diff --git a/Documentation/contributor/doc-translation-list.itexi b/Documentation/contributor/doc-translation-list.itexi index 3bb958d134..30b101da95 100644 --- a/Documentation/contributor/doc-translation-list.itexi +++ b/Documentation/contributor/doc-translation-list.itexi @@ -35,19 +35,19 @@ procedures}. 7492 total -2- Tutorial -1203 web/manuals.itexi +1214 web/manuals.itexi 124 learning.tely 2535 learning/tutorial.itely -4184 learning/common-notation.itely -8046 total +4187 learning/common-notation.itely +8060 total -3- Fundamental Concepts, starting of Usage and Community 11139 learning/fundamental.itely -- Fundamental concepts 135 usage.tely -3622 usage/running.itely +3681 usage/running.itely 1189 usage/updating.itely -1755 web/community.itexi -17840 total +1888 web/community.itexi +18032 total -4- Rest of Learning manual and Suggestions on writing LilyPond files 15393 learning/tweaks.itely -- Tweaking output @@ -61,9 +61,9 @@ procedures}. 4502 notation/pitches.itely 6048 notation/rhythms.itely 1726 notation/expressive.itely -945 notation/repeats.itely +944 notation/repeats.itely 2216 notation/simultaneous.itely -2345 notation/staff.itely +2341 notation/staff.itely 931 notation/editorial.itely 2716 notation/text.itely 81 notation/specialist.itely -- Specialist notation @@ -75,19 +75,19 @@ procedures}. 66 notation/strings.itely 242 notation/bagpipes.itely 4752 notation/ancient.itely -7671 notation/input.itely -- Input syntax +7686 notation/input.itely -- Input syntax 2164 notation/non-music.itely -- Non-musical notation 11087 notation/spacing.itely -- Spacing issues -12248 notation/changing-defaults.itely -- Changing defaults +12258 notation/changing-defaults.itely -- Changing defaults 5187 notation/programming-interface.itely -- Interfaces for programmers -1989 notation/notation-appendices.itely -- Notation manual tables +2017 notation/notation-appendices.itely -- Notation manual tables 252 notation/cheatsheet.itely -- Cheat sheet -76610 total +76658 total -6- Rest of Application Usage -3952 usage/lilypond-book.itely -- LilyPond-book +3978 usage/lilypond-book.itely -- LilyPond-book 1122 usage/converters.itely -- Converting from other formats -5074 total +5100 total -7- Appendices whose translation is optional 326 essay/literature.itely diff --git a/Documentation/contributor/doc-work.itexi b/Documentation/contributor/doc-work.itexi index 5d90b8430f..5d7ef16324 100644 --- a/Documentation/contributor/doc-work.itexi +++ b/Documentation/contributor/doc-work.itexi @@ -255,6 +255,13 @@ but instead: @@subsection @@code@{Foo@} Bar @end example +@item +With the exception of @code{@@} commands, the section name must +match the node name exactly. + +@item +No commas may be used in the node names. + @item If a heading is desired without creating a @code{@@node}, please use the following: @@ -496,8 +503,6 @@ easier/faster processing), use this header: \paper @{ indent = 0\mm line-width = 160\mm - 2.0 * 0.4\in - ragged-right = ##t - force-assignment = #"" line-width = #(- line-width (* mm 3.000000)) @} diff --git a/Documentation/contributor/lsr-work.itexi b/Documentation/contributor/lsr-work.itexi index 647c8afc0a..1ba8730640 100644 --- a/Documentation/contributor/lsr-work.itexi +++ b/Documentation/contributor/lsr-work.itexi @@ -260,7 +260,7 @@ To update LSR, perform the following steps: @item Download the latest snippet tarball, extract it, and run @code{convert-ly} on all files using the command-line option -@code{--to=VERSION} to ensure snippets are updated to the +@option{--to=@var{version}} to ensure snippets are updated to the correct stable version. @item diff --git a/Documentation/contributor/programming-work.itexi b/Documentation/contributor/programming-work.itexi index e64fa1673a..aa243e0e0c 100644 --- a/Documentation/contributor/programming-work.itexi +++ b/Documentation/contributor/programming-work.itexi @@ -8,6 +8,7 @@ * Programming without compiling:: * Finding functions:: * Code style:: +* Warnings Errors Progress and Debug Output:: * Debugging LilyPond:: * Tracing object relationships:: * Adding or modifying features:: @@ -218,7 +219,7 @@ grep -i functionName subdirectory/* This command will search all the contents of the directory subdirectory/ and display every line in any of the files that contains -functionName. The @code{-i} option makes @command{grep} ignore +functionName. The @option{-i} option makes @command{grep} ignore case -- this can be very useful if you are not yet familiar with our capitalization conventions. @@ -712,6 +713,167 @@ Do not run make po/po-update with GNU gettext < 0.10.35 @end itemize +@node Warnings Errors Progress and Debug Output +@section Warnings, Errors, Progress and Debug Output + +@unnumberedsubsec Available log levels + +LilyPond has several loglevels, which specify how verbose the output on +the console should be: +@itemize +@item NONE: No output at all, even on failure +@item ERROR: Only error messages +@item WARN: Only error messages and warnings +@item BASIC_PROGRESS: Warnings, errors and basic progress (success, etc.) +@item PROGRESS: Warnings, errors and full progress messages +@item INFO: Warnings, errors, progress and more detailed information (default) +@item DEBUG: All messages, including vull debug messages (very verbose!) +@end itemize + +The loglevel can either be set with the environment variable +@code{LILYPOND_LOGLEVEL} or on the command line with the @option{--loglevel=...} +option. + +@unnumberedsubsec Functions for debug and log output + +LilyPond has two different types of error and log functions: +@itemize + +@item +If a warning or error is caused by an identified position in the input file, +e.g. by a grob or by a music expression, the functions of the @code{Input} +class provide logging functionality that prints the position of the message +in addition to the message. + +@item +If a message can not be associated with a particular position in an input file, +e.g. the output file cannot be written, then the functions in the +@code{flower/include/warn.hh} file will provide logging functionality that +only prints out the message, but no location. + +@end itemize + +There are also Scheme functions to access all of these logging functions from +scheme. In addition, the Grob class contains some convenience wrappers for +even easier access to these functions. + +The message and debug functions in @code{warn.hh} also have an optional +argument @code{newline}, which specifies whether the message should always +start on a new line or continue a previous message. +By default, @code{progress_indication} does NOT start on a new line, but rather +continue the previous output. They also do not have a particular input +position associated, so there are no progress functions in the Input class. +All other functions by default start their output on a new line. + +The error functions come in three different flavors: fatal error messages, +programming error messages and normal error messages. Errors written +by the @code{error ()} function will cause LilyPond to exit immediately, +errors by @code{Input::error ()} will continue the compilation, but +return a non-zero return value of the lilypond call (i.e. indicate an +unsuccessful program execution). All other errors will be printed on the +console, but not exit LilyPond or indicate an unsuccessful return code. +Their only differences to a warnings are the displayed text and that +they will be shown with loglevel @code{ERROR}. + +If the Scheme option @code{warning-as-error} is set, any warning will be +treated as if @code{Input::error} was called. + + +@unnumberedsubsec All logging functions at a glance + +@multitable @columnfractions 0.16 0.42 0.42 +@headitem +@tab C++, no location +@tab C++ from input location + +@item ERROR +@tab @code{error ()}, @code{programming_error (msg)}, @code{non_fatal_error (msg)} +@tab @code{Input::error (msg)}, @code{Input::programming_error (msg)} + +@item WARN +@tab @code{warning (msg)} +@tab @code{Input::warning (msg)} + +@item BASIC +@tab @code{successful (msg)} +@tab - + +@item PROGRESS +@tab @code{progress_indication (msg)} +@tab - + +@item INFO +@tab @code{message (msg)} +@tab @code{Input::message (msg)} + +@item DEBUG +@tab @code{debug_output (msg)} +@tab @code{Input::debug_output (msg)} + +@item @tab @tab + +@headitem +@tab C++ from a Grob +@tab Scheme, music expression + +@item ERROR +@tab @code{Grob::programming_error (msg)} +@tab - + +@item WARN +@tab @code{Grob::warning (msg)} +@tab @code{(ly:music-warning music msg)} + +@item BASIC +@tab - +@tab - + +@item PROGRESS +@tab - +@tab - + +@item INFO +@tab - +@tab @code{(ly:music-message music msg)} + +@item DEBUG +@tab - +@tab - + +@item @tab @tab + +@headitem +@tab Scheme, no location +@tab Scheme, input location + +@item ERROR +@tab - +@tab @code{(ly:error msg args)}, @code{(ly:programming-error msg args)} + +@item WARN +@tab @code{(ly:warning msg args)} +@tab @code{(ly:input-warning input msg args)} + +@item BASIC +@tab @code{(ly:success msg args)} +@tab - + +@item PROGRESS +@tab @code{(ly:progress msg args)} +@tab - + +@item INFO +@tab @code{(ly:message msg args)} +@tab @code{(ly:input-message input msg args)} + +@item DEBUG +@tab @code{(ly:debug msg args)} +@tab - + +@end multitable + + + @node Debugging LilyPond @section Debugging LilyPond @@ -1041,7 +1203,7 @@ number of different platforms: In order for the Graphviz tool to work, config.make must be modified. It is probably a good idea to first save a copy of config.make under a different name. Then, edit config.make by removing every occurrence -of @code{-DNDEBUG}. +of @option{-DNDEBUG}. @item Rebuilding LilyPond @@ -1089,7 +1251,7 @@ dot -Tpdf graphviz.log > graphviz.pdf The pdf file can then be viewed with any pdf viewer. -When compiled without @code{-DNDEBUG}, lilypond may run slower +When compiled without @option{-DNDEBUG}, lilypond may run slower than normal. The original configuration can be restored by either renaming the saved copy of @code{config.make} or rerunning @code{configure}. Then rebuild lilypond with diff --git a/Documentation/contributor/source-code.itexi b/Documentation/contributor/source-code.itexi index fee5e36717..d0136b56e5 100644 --- a/Documentation/contributor/source-code.itexi +++ b/Documentation/contributor/source-code.itexi @@ -196,7 +196,7 @@ should configure some basic settings with the global and repository-specific options. To configure settings that affect all repositories, use the -@command{--global} command line option. For example, the first +@option{--global} command line option. For example, the first two options that you should always set are your @var{name} and @var{email}, since Git needs these to keep track of commit authors: @@ -247,7 +247,7 @@ by the above commands would look like this: @end example Using the @command{git@tie{}config} command @emph{without} the -@command{--global} option configures repository-specific settings, +@option{--global} option configures repository-specific settings, which are stored in the file @file{.git/config}. This file is created when a repository is initialized (using @command{git@tie{}init}), and by default contains these lines: @@ -522,7 +522,7 @@ git pull # recommended for translators @end example If you're tracking the remote @code{master} branch, you should add -the @code{-r} option (short for @code{--rebase}) to keep commits +the @option{-r} option (short for @option{--rebase}) to keep commits on your local branch current: @example @@ -530,7 +530,7 @@ git pull -r # use with caution when translating @end example If you don't edit translated documentation and don't want to type -@code{-r} every time, configure the master branch to rebase by +@option{-r} every time, configure the master branch to rebase by default with this command: @example @@ -629,7 +629,7 @@ git branch -d @var{name} @end example Git will ask you for confirmation if it sees that data would be -lost by deleting the branch. Use @code{-D} instead of @code{-d} +lost by deleting the branch. Use @option{-D} instead of @option{-d} to bypass this. Note that you cannot delete a branch if it is currently checked out. @@ -801,7 +801,7 @@ git commit -a @end example @noindent -The @code{-a} is short for @code{--all} which includes modified +The @option{-a} is short for @option{--all} which includes modified and deleted files, but only those newly created files that have previously been added. @@ -873,7 +873,7 @@ We prefer it if you follow the instructions in alternate method here. You should always run @command{git@tie{}pull@tie{}-r} (translators -should leave off the @code{-r}) before doing this to ensure that +should leave off the @option{-r}) before doing this to ensure that your patches are as current as possible. Once you have made one or more commits in your local repository, @@ -1422,15 +1422,15 @@ Contributor of} on your @qq{My Group Membership} page. @item -Generate an SSH @q{dsa} key pair. Enter the following at the +Generate an SSH @q{rsa} key pair. Enter the following at the command prompt: @example -ssh-keygen -t dsa +ssh-keygen -t rsa @end example When prompted for a location to save the key, press to -accept the default location (@file{~/.ssh/id_dsa}). +accept the default location (@file{~/.ssh/id_rsa}). Next you are asked to enter an optional passphrase. On most systems, if you use a passphrase, you will likely be prompted for @@ -1442,7 +1442,7 @@ though you may find it tedious to keep re-entering it. You can change/enable/disable your passphrase at any time with: @example -ssh-keygen -f ~/.ssh/id_dsa -p +ssh-keygen -f ~/.ssh/id_rsa -p @end example Note that the GNOME desktop has a feature which stores your @@ -1457,14 +1457,14 @@ gconftool-2 --set -t bool \ @end example After setting up your passphrase, your private key is saved as -@file{~/.ssh/id_dsa} and your public key is saved as -@file{~/.ssh/id_dsa.pub}. +@file{~/.ssh/id_rsa} and your public key is saved as +@file{~/.ssh/id_rsa.pub}. @item -Register your public SSH @q{dsa} key with Savannah. From the +Register your public SSH @q{rsa} key with Savannah. From the @qq{My Account Configuration} page, click on @qq{Edit SSH Keys}, -then paste the contents of your @file{~/.ssh/id_dsa.pub} file into +then paste the contents of your @file{~/.ssh/id_rsa.pub} file into one of the @qq{Authorized keys} text fields, and click @qq{Update}. @@ -1485,7 +1485,7 @@ git config remote.origin.url \ @end example @noindent -where @var{user} is your username on Savannah. +replacing @var{user} with your Savannah username. @item @@ -1566,9 +1566,17 @@ git config push.default matching @noindent Then @code{git@tie{}push} should work as before. For more details, consult the @code{git@tie{}push} man page. -@end enumerate +@item +Repeat the steps from generating an RSA key through to testing +your commit access, for each machine from which you will be +making commits, or you may simply copy the files from your +local @file{~/.ssh} folder to the same folder on the other +machine. + +@end enumerate + @subsubheading Technical details @itemize diff --git a/Documentation/cs/macros.itexi b/Documentation/cs/macros.itexi index 38d2dac975..1b9654b7e4 100755 --- a/Documentation/cs/macros.itexi +++ b/Documentation/cs/macros.itexi @@ -717,7 +717,7 @@ Pro LilyPond ve verzi @version{} @end html @iftex -@image{ly-examples/\IMAGE-FILE\-small,,,\IMAGE-FILE\,png} +@image{ly-examples/\IMAGE-FILE\,6in,,\IMAGE-FILE\,png} @end iftex @ifinfo @image{lilypond/ly-examples/\IMAGE-FILE\,,,\IMAGE-FILE\,png} diff --git a/Documentation/cs/translations.itexi b/Documentation/cs/translations.itexi index 572897f373..9f16579f88 100644 --- a/Documentation/cs/translations.itexi +++ b/Documentation/cs/translations.itexi @@ -16,7 +16,7 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{Naposledy obnoveno Wed Jul 13 10:59:12 UTC 2011 +@emph{Naposledy obnoveno Sat Aug 13 14:15:49 UTC 2011 } @multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @@ -111,7 +111,7 @@ ano @item 2 Běžný notový zápis @* -4184 +4187 @tab Pavel Fric @tab @tab @@ -339,7 +339,7 @@ ano @item Příručky @* -1203 +1214 @tab Pavel Fric @tab @tab @@ -366,7 +366,7 @@ ano @item Společenství @* -1755 +1888 @tab  Pavel Fric @tab @tab @@ -383,7 +383,7 @@ ano @ifhtml @html -částečně +částečně @end html @end ifhtml @ifnothtml diff --git a/Documentation/css/lilypond-manuals.css b/Documentation/css/lilypond-manuals.css index b5e7a0cf93..995c2173c6 100644 --- a/Documentation/css/lilypond-manuals.css +++ b/Documentation/css/lilypond-manuals.css @@ -408,9 +408,10 @@ table.menu { /***********************************************************/ @media print { - /* Hide the sidebar: */ - body { padding-left: 0; } - #tocframe { display: none; } + /* Hide the sidebar and make the main contents take up the full width */ + div#main { position: static; overflow: visible; left: 0; } + div#tocframe { display: none; } + /* Also don't show the navigation toolbars between all sections */ .nav_table { display: none; } } diff --git a/Documentation/de/macros.itexi b/Documentation/de/macros.itexi index 446e8e9b3d..6f97997c18 100644 --- a/Documentation/de/macros.itexi +++ b/Documentation/de/macros.itexi @@ -749,7 +749,7 @@ Für LilyPond Version @version{} @end html @iftex -@image{ly-examples/\IMAGE-FILE\-small,,,\IMAGE-FILE\,png} +@image{ly-examples/\IMAGE-FILE\,6in,,\IMAGE-FILE\,png} @end iftex @ifinfo @image{lilypond/ly-examples/\IMAGE-FILE\,,,\IMAGE-FILE\,png} diff --git a/Documentation/de/notation/vocal.itely b/Documentation/de/notation/vocal.itely index d0d027e638..de89ba6848 100644 --- a/Documentation/de/notation/vocal.itely +++ b/Documentation/de/notation/vocal.itely @@ -625,19 +625,15 @@ Um mehr als eine Silbe zu einer Note zuzuordnen, können die Silben mit geraden Anführungszeichen (@code{"}) umgeben werden oder ein Unterstrich (@code{_}) benutzt werden, um ein Leerzeichen zwischen Silben zu setzen. Mit der Tilde (@code{~}) kann ein Bindebogen -gesetzt werden. Dies erfordert, dass eine Schriftart vorhanden ist, -die das entsprechende Symbol (U+203F) beinhaltet. Frei erhältliche -Schriftarten, die den Bindebogen enthalten, sind @qq{FreeSerif} (ein -Times-Klon), @qq{DejaVuSans} (aber nicht DejaVuSerif) oder -TeXGyreSchole (ein Century Schoolbook-Klon). +gesetzt werden. @lilypond[quote,ragged-right,verbatim] { \time 3/4 \relative c' { c2 e4 g2 e4 } - \addlyrics { gran- de_a- mi- go } - \addlyrics { pu- "ro y ho-" nes- to } - \addlyrics { pu- ro~y~ho- nes- to } + \addlyrics { gran -- de_a -- mi -- go } + \addlyrics { pu -- "ro y ho" -- nes -- to } + \addlyrics { pu -- ro~y~ho -- nes -- to } } @end lilypond diff --git a/Documentation/de/translations.itexi b/Documentation/de/translations.itexi index 949346eb6d..d19c478201 100644 --- a/Documentation/de/translations.itexi +++ b/Documentation/de/translations.itexi @@ -16,7 +16,7 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{Zuletzt aktualisiert am Wed Jul 13 10:59:12 UTC 2011 +@emph{Zuletzt aktualisiert am Sat Aug 13 14:15:49 UTC 2011 } @multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @@ -231,28 +231,28 @@ ja @item 2 Schnittstellen für Programmierer @* -3568 +3899 @tab Till Paala @tab @tab @ifhtml @html -ja +teilweise (98 %) @end html @end ifhtml @ifnothtml -ja +teilweise (98 %) @end ifnothtml @tab @ifhtml @html -ja +teilweise @end html @end ifhtml @ifnothtml -ja +teilweise @end ifnothtml @tab vor-GDP @end multitable @@ -353,7 +353,7 @@ ja @item 2 Übliche Notation @* -4184 +4187 @tab Till Paala @tab @tab @@ -637,7 +637,7 @@ ja @item 1.4 Wiederholungszeichen @* -945 +944 @tab Till Paala @tab @tab @@ -654,11 +654,11 @@ ja @ifhtml @html -ja +teilweise @end html @end ifhtml @ifnothtml -ja +teilweise @end ifnothtml @tab vor-GDP @item @@ -691,7 +691,7 @@ teilweise @item 1.6 Notation auf Systemen @* -2345 +2341 @tab Till Paala @tab @tab @@ -708,7 +708,7 @@ ja @ifhtml @html -teilweise +teilweise @end html @end ifhtml @ifnothtml @@ -826,7 +826,7 @@ ja @item 2.2 Tasteninstrumente und andere Instrumente mit mehreren Systemen @* -864 +862 @tab  Till Paala @tab @tab @@ -1069,7 +1069,7 @@ ja @item 3 Allgemeine Eingabe und Ausgabe @* -7671 +7686 @tab Till Paala @tab @tab @@ -1086,7 +1086,7 @@ teilweise (90 %) @ifhtml @html -teilweise +teilweise @end html @end ifhtml @ifnothtml @@ -1123,7 +1123,7 @@ ja @item 5 Standardeinstellungen verändern @* -12248 +12258 @tab Till Paala @tab @tab @@ -1150,7 +1150,7 @@ ja @item A Notationsübersicht @* -1989 +2017 @tab Till Paala @tab @tab @@ -1270,7 +1270,7 @@ ja @item 1 @command{lilypond} starten @* -3622 +3681 @tab Reinhold Kainhofer @* Till Paala @@ -1326,7 +1326,7 @@ ja @item 3 @command{lilypond-book} aufrufen @* -3952 +3978 @tab Reinhold Kainhofer @tab Till Paala @tab @@ -1353,7 +1353,7 @@ ja @item 4 Externe Programme @* -2170 +2180 @tab Till Paala @* Reinhold Kainhofer @@ -1372,11 +1372,11 @@ ja @ifhtml @html -ja +teilweise @end html @end ifhtml @ifnothtml -ja +teilweise @end ifnothtml @tab vor-GDP @item @@ -1529,7 +1529,7 @@ teilweise @item Handbücher @* -1203 +1214 @tab Till Paala @tab @tab @@ -1556,7 +1556,7 @@ ja @item Gemeinschaft @* -1755 +1888 @tab  Till Paala @tab @tab @@ -1573,11 +1573,11 @@ ja @ifhtml @html -ja +teilweise @end html @end ifhtml @ifnothtml -ja +teilweise @end ifnothtml @tab vor-GDP @end multitable diff --git a/Documentation/es/macros.itexi b/Documentation/es/macros.itexi index 1cb27ebb9d..163f64d0a4 100644 --- a/Documentation/es/macros.itexi +++ b/Documentation/es/macros.itexi @@ -756,7 +756,7 @@ Para la versión de LilyPond @version{} @end html @iftex -@image{ly-examples/\IMAGE-FILE\-small,,,\IMAGE-FILE\,png} +@image{ly-examples/\IMAGE-FILE\,6in,,\IMAGE-FILE\,png} @end iftex @ifinfo @image{lilypond/ly-examples/\IMAGE-FILE\,,,\IMAGE-FILE\,png} diff --git a/Documentation/es/notation/vocal.itely b/Documentation/es/notation/vocal.itely index ce3416cae3..f6d352c94e 100644 --- a/Documentation/es/notation/vocal.itely +++ b/Documentation/es/notation/vocal.itely @@ -640,20 +640,15 @@ Para asignar más de una sílaba a una única nota con espacios entre las sílabas, podemos encerrar la frase entre comillas o utilizar un carácter de guión bajo @code{_}. De forma alternativa, podemos usar el símbolo de tilde curva (@code{~}) para obtener una ligadura de -texto. La ligadura de texto está implementada con el carácter Unicode -U+203F, por tanto debemos asegurarnos de usar una fuente tipográfica -para este glifo que realmente lo contenga. Algunas de las fuentes -tipográficas disponibles libremente con una ligadura de letra son, por -ejemplo, `FreeSerif' (un clon de Times), `DejaVuSans' (pero no -`DejaVuSerif') o `TeXGyreSchola' (un clon de Century Schoolbook). +texto. @lilypond[quote,ragged-right,verbatim] { \time 3/4 \relative c' { c2 e4 g2 e4 } - \addlyrics { gran- de_a- mi- go } - \addlyrics { pu- "ro y ho-" nes- to } - \addlyrics { pu- ro~y~ho- nes- to } + \addlyrics { gran -- de_a -- mi -- go } + \addlyrics { pu -- "ro y ho" -- nes -- to } + \addlyrics { pu -- ro~y~ho -- nes -- to } } @end lilypond diff --git a/Documentation/es/translations.itexi b/Documentation/es/translations.itexi index 7aaf073be0..5145e7ed69 100644 --- a/Documentation/es/translations.itexi +++ b/Documentation/es/translations.itexi @@ -16,7 +16,7 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{Actualizado en Wed Jul 13 10:59:12 UTC 2011 +@emph{Actualizado en Sat Aug 13 14:15:49 UTC 2011 } @multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @@ -30,7 +30,7 @@ Registro de cambios de LilyPond @item Títulos de sección @* -1779 +193 @tab Francisco Vila @tab @tab @@ -47,11 +47,11 @@ sí @ifhtml @html -sí +parcialmente @end html @end ifhtml @ifnothtml -sí +parcialmente @end ifnothtml @tab pre-GDP @item @@ -297,28 +297,28 @@ sí @item 1 Interfaces para programadores @* -3568 +3899 @tab Francisco Vila @tab @tab @ifhtml @html -sí +parcialmente (98 %) @end html @end ifhtml @ifnothtml -sí +parcialmente (98 %) @end ifnothtml @tab @ifhtml @html -sí +parcialmente @end html @end ifhtml @ifnothtml -sí +parcialmente @end ifnothtml @tab pre-GDP @end multitable @@ -417,7 +417,7 @@ sí @item 2 Notación corriente @* -4184 +4187 @tab Francisco Vila @tab @tab @@ -699,7 +699,7 @@ sí @item 1.4 Repeticiones @* -945 +944 @tab Francisco Vila @tab @tab @@ -753,7 +753,7 @@ sí @item 1.6 Notación de los pentagramas @* -2345 +2341 @tab Francisco Vila @tab @tab @@ -888,7 +888,7 @@ sí @item 2.2 Teclados y otros instrumentos de varios pentagramas @* -864 +862 @tab Francisco Vila @tab @tab @@ -1131,7 +1131,7 @@ sí @item 3 Entrada y salida generales @* -7671 +7686 @tab Francisco Vila @tab @tab @@ -1165,11 +1165,11 @@ sí @ifhtml @html -parcialmente (96 %) +sí @end html @end ifhtml @ifnothtml -parcialmente (96 %) +sí @end ifnothtml @tab @ifhtml @@ -1185,7 +1185,7 @@ sí @item 5 Cambiar los valores por omisión @* -12248 +12258 @tab Francisco Vila @tab @tab @@ -1212,7 +1212,7 @@ sí @item A Tablas del manual sobre notación @* -1989 +2017 @tab Francisco Vila @tab @tab @@ -1332,7 +1332,7 @@ sí @item 1 Ejecutar LilyPond @* -3622 +3681 @tab Francisco Vila @tab @tab @@ -1386,7 +1386,7 @@ sí @item 3 Ejecución de @command{lilypond-book} @* -3952 +3978 @tab Francisco Vila @tab @tab @@ -1413,7 +1413,7 @@ sí @item 4 Programas externos @* -2170 +2180 @tab Francisco Vila @tab @tab @@ -1430,11 +1430,11 @@ sí @ifhtml @html -sí +parcialmente @end html @end ifhtml @ifnothtml -sí +parcialmente @end ifnothtml @tab pre-GDP @item @@ -1587,7 +1587,7 @@ sí @item Manuales @* -1203 +1214 @tab Francisco Vila @tab @tab @@ -1614,7 +1614,7 @@ sí @item Comunidad @* -1755 +1888 @tab Francisco Vila @tab @tab @@ -1631,11 +1631,11 @@ sí @ifhtml @html -sí +parcialmente @end html @end ifhtml @ifnothtml -sí +parcialmente @end ifnothtml @tab pre-GDP @end multitable diff --git a/Documentation/extending/scheme-tutorial.itely b/Documentation/extending/scheme-tutorial.itely index 7b38a76ef9..0e60868215 100644 --- a/Documentation/extending/scheme-tutorial.itely +++ b/Documentation/extending/scheme-tutorial.itely @@ -148,7 +148,7 @@ and False is @code{#f}. @item Numbers Numbers are entered in the standard fashion, -@code{1} is the (integer) number one, while @code{-1.5} is a +@code{1} is the (integer) number one, while @w{@code{-1.5}} is a floating point number (a non-integer number). @item Strings @@ -609,7 +609,7 @@ guile> (cond ((< a b) "a is less than b") @subsection LilyPond Scheme syntax The Guile interpreter is part of LilyPond, which means that -Scheme can be included in LilyPond input files. The hash mark @code{#} +Scheme can be included in LilyPond input files. The hash mark@tie{}@code{#} is used to tell the LilyPond parser that the next value is a Scheme value. @@ -640,7 +640,7 @@ as follows: @end example For the rest of this section, we will assume that the data is entered -in a music file, so we add @code{#}s at the beginning of each Scheme +in a music file, so we add@tie{}@code{#}s at the beginning of each Scheme expression. All of the top-level Scheme expressions in a LilyPond input file can @@ -780,7 +780,7 @@ define some Scheme code in a macro (to be called later), use @knownissues Mixing Scheme and LilyPond variables is not possible with the -@code{--safe} option. +@option{--safe} option. @node Object properties diff --git a/Documentation/fr/macros.itexi b/Documentation/fr/macros.itexi index cf72b0e0fd..e7408d1e6d 100644 --- a/Documentation/fr/macros.itexi +++ b/Documentation/fr/macros.itexi @@ -780,7 +780,7 @@ Pour LilyPond version @version{} @end html @iftex -@image{examples/\IMAGE-FILE\-small,,,\IMAGE-FILE\,png} +@image{ly-examples/\IMAGE-FILE\,6in,,\IMAGE-FILE\,png} @end iftex @ifinfo @image{lilypond/examples/\IMAGE-FILE\,,,\IMAGE-FILE\,png} diff --git a/Documentation/fr/notation/notation-appendices.itely b/Documentation/fr/notation/notation-appendices.itely index e8ee427fa5..7fa677c743 100644 --- a/Documentation/fr/notation/notation-appendices.itely +++ b/Documentation/fr/notation/notation-appendices.itely @@ -622,6 +622,7 @@ informations, reportez-vous au chapitre @ref{Mise en forme du texte}. * Glyphes d'extrémité d'accolade:: * Glyphes de pédale:: * Glyphes d'accordéon:: +* Glyphes de liaison:: * Glyphes de style vaticana:: * Glyphes de style medicaea:: * Glyphes de style Hufnagel:: @@ -808,6 +809,16 @@ informations, reportez-vous au chapitre @ref{Mise en forme du texte}. @end lilypond +@node Glyphes de liaison +@unnumberedsubsec Tie glyphs + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #ties +@end lilypond + + @node Glyphes de style vaticana @unnumberedsubsec Glyphes de style vaticana @translationof Vaticana glyphs diff --git a/Documentation/fr/notation/vocal.itely b/Documentation/fr/notation/vocal.itely index d6f08b51ea..5460e4a500 100644 --- a/Documentation/fr/notation/vocal.itely +++ b/Documentation/fr/notation/vocal.itely @@ -611,21 +611,15 @@ Référence des propriétés internes : Pour attribuer plus d'une syllabe à une même note, vous pouvez soit les mettre entre guillemets, soit utiliser le caractère souligné (@code{_}) pour obtenir une espace, ou bien encore utiliser un tilde -(@code{~}) pour obtenir une liaison entre les syllabes. Cette -liaison adaptée aux paroles correspond au caractère Unicode -@code{U+203F}, et n'apparaîtra dans la partition que si le système -dispose d'une police installée qui contient ce symbole. Un certain -nombre de fontes librement disponibles en disposent, comme FreeSerif -(un clone de Times), `DejaVuSans' (mais pas DejaVuSerif) ou -TeXGyreSchola (un clone de Century Schoolbook). +(@code{~}) pour obtenir une liaison entre les syllabes. @lilypond[quote,ragged-right,verbatim] { \time 3/4 \relative c' { c2 e4 g2 e4 } - \addlyrics { gran- de_a- mi- go } - \addlyrics { pu- "ro y ho-" nes- to } - \addlyrics { pu- ro~y~ho- nes- to } + \addlyrics { gran -- de_a -- mi -- go } + \addlyrics { pu -- "ro y ho" -- nes -- to } + \addlyrics { pu -- ro~y~ho -- nes -- to } } @end lilypond diff --git a/Documentation/fr/translations.itexi b/Documentation/fr/translations.itexi index cf4c555944..f96e419bb4 100644 --- a/Documentation/fr/translations.itexi +++ b/Documentation/fr/translations.itexi @@ -16,7 +16,7 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{Dernière mise à jour Wed Jul 13 10:59:12 UTC 2011 +@emph{Dernière mise à jour Sat Aug 13 14:15:49 UTC 2011 } @multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @@ -249,7 +249,7 @@ oui @item 2 Bases de notation musicale @* -4184 +4187 @tab Nicolas Grandclaude @* Ludovic Sardain @@ -565,7 +565,7 @@ oui @item 1.4 Répétitions et reprises @* -945 +944 @tab Valentin Villenave @* Jean-Charles Malahieude @@ -586,7 +586,7 @@ oui @ifhtml @html -partiellement +partiellement @end html @end ifhtml @ifnothtml @@ -629,7 +629,7 @@ partiellement @item 1.6 Notation sur la portée @* -2345 +2341 @tab Valentin Villenave @* Jean-Charles Malahieude @@ -648,7 +648,7 @@ oui @ifhtml @html -partiellement +partiellement @end html @end ifhtml @ifnothtml @@ -774,7 +774,7 @@ oui @item 2.2 Instruments utilisant des portées multiples @* -864 +862 @tab Valentin Villenave @* Jean-Charles Malahieude @@ -1008,7 +1008,7 @@ partiellement @item 3 Généralités en matière d'entrée et sortie @* -7671 +7686 @tab Jean-Charles Malahieude @* Valentin Villenave @@ -1027,7 +1027,7 @@ partiellement (83 %) @ifhtml @html -partiellement +partiellement @end html @end ifhtml @ifnothtml @@ -1066,7 +1066,7 @@ oui @item 5 Modification des réglages prédéfinis @* -12248 +12258 @tab Valentin Villenave @* Jean-Charles Malahieude @@ -1095,7 +1095,7 @@ oui @item A Tables du manuel de notation @* -1989 +2017 @tab Frédéric Chiasson @* Jean-Charles Malahieude @@ -1104,11 +1104,11 @@ Jean-Charles Malahieude @ifhtml @html -partiellement (85 %) +partiellement (84 %) @end html @end ifhtml @ifnothtml -partiellement (85 %) +partiellement (84 %) @end ifnothtml @tab @ifhtml @@ -1221,7 +1221,7 @@ oui @item 1 Exécution de @command{lilypond} @* -3622 +3681 @tab Jean-Charles Malahieude @tab @tab @@ -1238,11 +1238,11 @@ oui @ifhtml @html -oui +partiellement @end html @end ifhtml @ifnothtml -oui +partiellement @end ifnothtml @tab pré-GDP @item @@ -1275,7 +1275,7 @@ oui @item 3 Association musique-texte avec @command{lilypond-book} @* -3952 +3978 @tab Jean-Charles Malahieude @tab @tab @@ -1302,7 +1302,7 @@ N/A @item 4 Programmes externes @* -2170 +2180 @tab Jean-Charles Malahieude @tab @tab @@ -1319,11 +1319,11 @@ oui @ifhtml @html -oui +partiellement @end html @end ifhtml @ifnothtml -oui +partiellement @end ifnothtml @tab pré-GDP @item @@ -1490,7 +1490,7 @@ partiellement @item Manuels @* -1203 +1214 @tab John Mandereau @tab Jean-Charles Malahieude @tab @@ -1517,7 +1517,7 @@ partiellement @item Communauté @* -1755 +1888 @tab Jean-Charles Malahieude @* John Mandereau @@ -1536,11 +1536,11 @@ oui @ifhtml @html -oui +partiellement @end html @end ifhtml @ifnothtml -oui +partiellement @end ifnothtml @tab pré-GDP @end multitable diff --git a/Documentation/hu/macros.itexi b/Documentation/hu/macros.itexi index 7c747c4a31..f57c34f67e 100644 --- a/Documentation/hu/macros.itexi +++ b/Documentation/hu/macros.itexi @@ -707,7 +707,7 @@ A LilyPond @version{} verziójához @end html @iftex -@image{examples/\IMAGE-FILE\-small,,,\IMAGE-FILE\,png} +@image{ly-examples/\IMAGE-FILE\,6in,,\IMAGE-FILE\,png} @end iftex @ifinfo @image{lilypond/examples/\IMAGE-FILE\,,,\IMAGE-FILE\,png} diff --git a/Documentation/hu/translations.itexi b/Documentation/hu/translations.itexi index cd7184c110..6a3b425133 100644 --- a/Documentation/hu/translations.itexi +++ b/Documentation/hu/translations.itexi @@ -16,7 +16,7 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{Last updated Wed Jul 13 10:59:12 UTC 2011 +@emph{Last updated Sat Aug 13 14:15:49 UTC 2011 } @multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @@ -111,7 +111,7 @@ partially @item 2 Elemi kottaírás @* -4184 +4187 @tab Harmath Dénes @tab @tab @@ -285,7 +285,7 @@ partially @item 1 A @command{lilypond} használata @* -3622 +3681 @tab Team-hu @tab @tab @@ -339,7 +339,7 @@ partially @item 3 A @command{lilypond-book} használata @* -3952 +3978 @tab Team-hu @tab @tab @@ -356,11 +356,11 @@ yes @ifhtml @html -yes +partially @end html @end ifhtml @ifnothtml -yes +partially @end ifnothtml @tab pre-GDP @end multitable @@ -486,7 +486,7 @@ partially @item Dokumentáció @* -1203 +1214 @tab Harmath Dénes @tab @tab @@ -513,7 +513,7 @@ partially @item Közösség @* -1755 +1888 @tab Harmath Dénes @tab @tab @@ -530,11 +530,11 @@ yes @ifhtml @html -yes +partially @end html @end ifhtml @ifnothtml -yes +partially @end ifnothtml @tab pre-GDP @end multitable diff --git a/Documentation/included/authors.itexi b/Documentation/included/authors.itexi index 540ecb3bd3..e1dc730d6d 100644 --- a/Documentation/included/authors.itexi +++ b/Documentation/included/authors.itexi @@ -43,6 +43,11 @@ Core developer, font designer @email{t.daniels@@treda.co.uk}, Assistant documentation editor +@item Phil Holmes: +@email{mail@@philholmes.net} +@uref{http://www.philholmes.net} +Build unentangler, Bug squad member + @item Reinhold Kainhofer: @email{reinhold@@kainhofer.com}, @uref{http://reinhold.kainhofer.com}, @@ -104,6 +109,9 @@ Translation Meister @item Valentin Villenave: LSR editor and Bug squad member +@item Jan Warchoł: +happy nitpicker + @end itemize @end macro @@ -152,8 +160,7 @@ Core developer, Schemer extraordinaire @c use commas not colons -Karin Hoethker, -Jan Warchoł +Karin Hoethker @c no comma for last entry diff --git a/Documentation/included/compile.itexi b/Documentation/included/compile.itexi index 8f9a237608..b7d6acdc79 100644 --- a/Documentation/included/compile.itexi +++ b/Documentation/included/compile.itexi @@ -396,7 +396,7 @@ directory. Here are the relevant lines taken from the output of By default, `@command{make@tie{}install}' will install all the files in @file{/usr/local/bin}, @file{/usr/local/lib} etc. You can specify an installation prefix other than @file{/usr/local} -using `@code{--prefix}', for instance `@code{--prefix=$HOME}'. +using `@option{--prefix}', for instance `@option{--prefix=$HOME}'. @end quotation A typical installation prefix is @file{$HOME/usr}: @@ -483,9 +483,9 @@ that case, running @samp{make} without the @option{-j} is advised. If you want to build multiple versions of LilyPond with different configuration settings, you can use the -@code{--enable-config=@var{CONF}} option of @command{configure}. -You should use @code{make@tie{}conf=@var{CONF}} to generate the -output in @file{out-@var{CONF}}. For example, suppose you want to +@option{--enable-config=@var{conf}} option of @command{configure}. +You should use @code{make@tie{}conf=@var{conf}} to generate the +output in @file{out-@var{conf}}. For example, suppose you want to build with and without profiling, then use the following for the normal build @@ -576,6 +576,7 @@ re-install. See @ref{Configuring target directories}. @menu * Documentation editor's edit/compile cycle:: * Building documentation:: +* Building a single document:: * Saving time with CPU_COUNT:: * AJAX search:: * Installing documentation:: @@ -696,6 +697,21 @@ However, this will rebuild all of the manuals indiscriminately---it is more efficient to @command{touch} only the affected files. +@node Building a single document +@unnumberedsubsubsec Building a single document +It's possible to build a single document. For example, to rebuild +only @file{contributor.pdf}, do the following: + +@example +cd build/ +cd Documentation/ +touch ../../Documentation/contributor.texi +make out=www out-www/contributor.pdf +@end example + +If you are only working on a single document, test-building it in +this way can give substantial time savings - recreating +@file{contributor.pdf}, for example, takes a matter of seconds. @node Saving time with CPU_COUNT @unnumberedsubsubsec Saving time with @code{CPU_COUNT} diff --git a/Documentation/included/font-table.ly b/Documentation/included/font-table.ly index 35b835cdd9..398286ac4e 100644 --- a/Documentation/included/font-table.ly +++ b/Documentation/included/font-table.ly @@ -76,6 +76,7 @@ (define brackettips (get-group glyph-list "^brackettips\\.")) (define pedal (get-group glyph-list "^pedal\\.")) (define accordion (get-group glyph-list "^accordion\\.")) + (define ties (get-group glyph-list "^ties\\.")) ;; remove all remaining groups from the glyph-list (for-each @@ -95,7 +96,8 @@ arrowheads brackettips pedal - accordion)) + accordion + ties)) ;;;;;;;;; diff --git a/Documentation/included/note-head-style.ly b/Documentation/included/note-head-style.ly index 471b79d9ee..c649068ec6 100644 --- a/Documentation/included/note-head-style.ly +++ b/Documentation/included/note-head-style.ly @@ -1,29 +1,35 @@ \version "2.14.0" -\header{ + +\header { texidoc=" -Note head shapes may be set from several choices. -The stem endings should be adjusted according to the note head. +Note head shapes may be set from several choices. +The stem endings should be adjusted according to the note head. If you want different note head styles on one stem, you must create a special context. Harmonic notes have a different shape and different -dimensions. +dimensions. " } \layout { indent = 0.0 ragged-right = ##t + + \context { + \Score + \remove "Bar_number_engraver" + } } pattern = << \new Voice { - \override Stem #'direction = #UP - e'4 e'2. e'1 e'\breve*1/2 e'\longa*1/4 + \override Stem #'direction = #UP + e'4 e'2. e'1 e'\breve*1/2 e'\longa*1/4 \bar "||" } \new Voice { - \override Stem #'direction = #DOWN - a4 a2. a1 a\breve*1/2 a\longa*1/4 + \override Stem #'direction = #DOWN + a4 a2. a1 a\breve*1/2 a\longa*1/4 \bar "||" } >> @@ -99,6 +105,3 @@ pattern = << s1*0^\markup { "slash" } \pattern } - - - diff --git a/Documentation/included/percussion-chart.ly b/Documentation/included/percussion-chart.ly index 666ccd1a26..1bdea5dba4 100644 --- a/Documentation/included/percussion-chart.ly +++ b/Documentation/included/percussion-chart.ly @@ -1,12 +1,9 @@ \version "2.14.0" -% yes, I know this is a mess. But I'm not going to fuss with -% it one day before I leave. -gp - % this chart is used in the manual too. \header { - texidoc ="@cindex Percussion notes + texidoc ="@cindex Percussion notes This chart shows all percussion and drum notes." } @@ -14,56 +11,126 @@ This chart shows all percussion and drum notes." myBreak = { \bar " " \break } \score { - \new DrumStaff \with { - \remove "Time_signature_engraver" -} \context DrumVoice { + \new DrumStaff \with { + \remove "Time_signature_engraver" + } \context DrumVoice { %% this stuff set up nice || bar lines to divide percussion notes %% into related fields, but it should be placed in the actual %% music, not as a separate voice. -gp %{ -barlines = { -\repeat "unfold" 4 {s 1 \bar" " } s 1 \bar "||" -\repeat "unfold" 2 { s 1 \bar" " s 1 \bar" " s 1 \bar "||" } -\repeat "unfold" 4 {s 1 \bar" " } s 1 \bar "||" -\repeat "unfold" 7 {s 1 \bar" " } s 1 \bar "||" -s 1 \bar" " s 1 \bar "||" -\repeat "unfold" 2 { \repeat "unfold" 5 {s 1 \bar" " } s 1 \bar "||" } -\repeat "unfold" 2 { s 1 \bar" " s 1 \bar "||" } -\repeat "unfold" 2 {s 1 \bar" " } s 1 \bar "||" -\repeat "unfold" 4 {s 1 \bar" " } s 1 \bar "||" -s 1 \bar" " s 1 \bar "||" -\repeat "unfold" 3 {s 1 \bar" " } s 1 \bar "||" -\repeat "unfold" 2 {s 1 \bar" " } s 1 \bar "||" -\repeat "unfold" 3 {\repeat "unfold" 4 {s 1 \bar" " } s 1 \bar "||" } -} + barlines = { + \repeat "unfold" 4 {s 1 \bar" " } s 1 \bar "||" + \repeat "unfold" 2 { s 1 \bar" " s 1 \bar" " s 1 \bar "||" } + \repeat "unfold" 4 {s 1 \bar" " } s 1 \bar "||" + \repeat "unfold" 7 {s 1 \bar" " } s 1 \bar "||" + s 1 \bar" " s 1 \bar "||" + \repeat "unfold" 2 { \repeat "unfold" 5 {s 1 \bar" " } s 1 \bar "||" } + \repeat "unfold" 2 { s 1 \bar" " s 1 \bar "||" } + \repeat "unfold" 2 {s 1 \bar" " } s 1 \bar "||" + \repeat "unfold" 4 {s 1 \bar" " } s 1 \bar "||" + s 1 \bar" " s 1 \bar "||" + \repeat "unfold" 3 {s 1 \bar" " } s 1 \bar "||" + \repeat "unfold" 2 {s 1 \bar" " } s 1 \bar "||" + \repeat "unfold" 3 {\repeat "unfold" 4 {s 1 \bar" " } s 1 \bar "||" } + } %} -\drummode { -\textLengthOn -\cadenzaOn -bda1 ^"acousticbassdrum: bda" bd ^"bassdrum: bd" sn ^"snare: sn" sne ^"electricsnare: sne" sna ^"acousticsnare: sna" \myBreak -tomfl ^"lowfloortom: tomfl" tomfh ^"highfloortom: tomfh" toml ^"lowtom: toml" tomh ^"hightom: tomh" -tomml ^"lowmidtom: tomml" tommh ^"himidtom: tommh" \myBreak -hhc ^"closedhihat: hhc" hh ^"hihat: hh" hhp ^"pedalhihat: hhp" hho ^"openhihat: hho" hhho ^"halfopenhihat: hhho" \myBreak -cymca ^"crashcymbala: cymca" cymc ^"crashcymbal: cymc" cymra ^"ridecymbala: cymra" cymr ^"ridecymbal: cymr" \myBreak cymch ^"chinesecymbal: cymch" cyms ^"splashcymbal: cyms" -cymcb ^"crashcymbalb: cymcb" cymrb ^"ridecymbalb: cymrb" -rb ^"ridebell: rb" cb ^"cowbell: cb" \myBreak -bohm ^"mutehibongo: bohm" boh ^"hibongo: boh" boho ^"openhibongo: boho" bolm ^"mutelobongo: bolm" bol ^"lobongo: bol" bolo ^"openlobongo: bolo"\myBreak -cghm ^"mutehiconga: cghm" cglm ^"muteloconga: cglm" cgho ^"openhiconga: cgho" cgh ^"hiconga: cgh" cglo ^"openloconga: cglo" cgl ^"loconga: cgl" \myBreak -timh ^"hitimbale: timh" timl ^"lotimbale: timl" -agh ^"hiagogo: agh" agl ^"loagogo: agl" \myBreak -ssh ^"hisidestick: ssh" ss ^"sidestick: ss" ssl ^"losidestick: ssl" \myBreak -guis ^"shortguiro: guis" guil ^"longguiro: guil" gui ^"guiro: gui" cab ^"cabasa: cab" mar ^"maracas: mar" \myBreak -whs ^"shortwhistle: whs" whl ^"longwhistle: whl" \myBreak -hc ^"handclap: hc" tamb ^"tambourine: tamb" vibs ^"vibraslap: vibs" tt ^"tamtam: tt" \myBreak -cl ^"claves: cl" wbh ^"hiwoodblock: wbh" wbl ^"lowoodblock: wbl" \myBreak -cuim ^"mutecuica: cuim" cuio ^"opencuica: cuio" -trim ^"mutetriangle: trim" tri ^"triangle: tri" trio ^"opentriangle: trio" \myBreak -ua ^"oneup: ua" ub ^"twoup: ub" uc ^"threeup: uc" ud ^"fourup: ud" ue ^"fiveup: ue" \myBreak -da ^"onedown: da" db ^"twodown: db" dc ^"threedown: dc" dd ^"fourdown: dd" de ^"fivedown: de" \myBreak -} -} + \drummode { + \cadenzaOn + + bda1^\markup { \center-align "acousticbassdrum: bda" } + bd _\markup { \center-align "bassdrum: bd" } + sn ^\markup { \center-align "snare: sn" } + sne _\markup { \center-align "electricsnare: sne" } + sna ^\markup { \center-align "acousticsnare: sna" } \myBreak + + tomfl^\markup { \center-align "lowfloortom: tomfl" } + tomfh_\markup { \center-align "highfloortom: tomfh" } + toml ^\markup { \center-align "lowtom: toml" } + tomh _\markup { \center-align "hightom: tomh" } + tomml^\markup { \center-align "lowmidtom: tomml" } + tommh_\markup { \center-align "himidtom: tommh" } \myBreak + + hhc ^\markup { \center-align "closedhihat: hhc" } + hh _\markup { \center-align "hihat: hh" } + hhp ^\markup { \center-align "pedalhihat: hhp" } + hho _\markup { \center-align "openhihat: hho" } + hhho^\markup { \center-align "halfopenhihat: hhho" } \myBreak + + cymca^\markup { \center-align "crashcymbala: cymca" } + cymc _\markup { \center-align "crashcymbal: cymc" } + cymra^\markup { \center-align "ridecymbala: cymra" } + cymr _\markup { \center-align "ridecymbal: cymr" } \myBreak + + cymch^\markup { \center-align "chinesecymbal: cymch" } + cyms _\markup { \center-align "splashcymbal: cyms" } + cymcb^\markup { \center-align "crashcymbalb: cymcb" } + cymrb_\markup { \center-align "ridecymbalb: cymrb" } + rb ^\markup { \center-align "ridebell: rb" } + cb _\markup { \center-align "cowbell: cb" } \myBreak + + bohm^\markup { \center-align "mutehibongo: bohm" } + boh _\markup { \center-align "hibongo: boh" } + boho^\markup { \center-align "openhibongo: boho" } + bolm_\markup { \center-align "mutelobongo: bolm" } + bol ^\markup { \center-align "lobongo: bol" } + bolo_\markup { \center-align "openlobongo: bolo" } \myBreak + + cghm^\markup { \center-align "mutehiconga: cghm" } + cglm_\markup { \center-align "muteloconga: cglm" } + cgho^\markup { \center-align "openhiconga: cgho" } + cgh _\markup { \center-align "hiconga: cgh" } + cglo^\markup { \center-align "openloconga: cglo" } + cgl _\markup { \center-align "loconga: cgl" } \myBreak + + timh^\markup { \center-align "hitimbale: timh" } + timl_\markup { \center-align "lotimbale: timl" } + agh ^\markup { \center-align "hiagogo: agh" } + agl _\markup { \center-align "loagogo: agl" } \myBreak + + ssh^\markup { \center-align "hisidestick: ssh" } + ss _\markup { \center-align "sidestick: ss" } + ssl^\markup { \center-align "losidestick: ssl" } \myBreak + + guis^\markup { \center-align "shortguiro: guis" } + guil_\markup { \center-align "longguiro: guil" } + gui ^\markup { \center-align "guiro: gui" } + cab _\markup { \center-align "cabasa: cab" } + mar ^\markup { \center-align "maracas: mar" } \myBreak + + whs^\markup { \center-align "shortwhistle: whs" } + whl_\markup { \center-align "longwhistle: whl" } \myBreak + + hc ^\markup { \center-align "handclap: hc" } + tamb_\markup { \center-align "tambourine: tamb" } + vibs^\markup { \center-align "vibraslap: vibs" } + tt _\markup { \center-align "tamtam: tt" } \myBreak + + cl ^\markup { \center-align "claves: cl" } + wbh_\markup { \center-align "hiwoodblock: wbh" } + wbl^\markup { \center-align "lowoodblock: wbl" } \myBreak + + cuim^\markup { \center-align "mutecuica: cuim" } + cuio_\markup { \center-align "opencuica: cuio" } + trim^\markup { \center-align "mutetriangle: trim" } + tri _\markup { \center-align "triangle: tri" } + trio^\markup { \center-align "opentriangle: trio" } \myBreak + + ua^\markup { \center-align "oneup: ua" } + ub_\markup { \center-align "twoup: ub" } + uc^\markup { \center-align "threeup: uc" } + ud_\markup { \center-align "fourup: ud" } + ue^\markup { \center-align "fiveup: ue" } \myBreak + + da^\markup { \center-align "onedown: da" } + db_\markup { \center-align "twodown: db" } + dc^\markup { \center-align "threedown: dc" } + dd_\markup { \center-align "fourdown: dd" } + de^\markup { \center-align "fivedown: de" } \myBreak + } + } + \layout { \context { \Score @@ -71,4 +138,3 @@ da ^"onedown: da" db ^"twodown: db" dc ^"threedown: dc" dd ^"fourdown: dd" d } } } - diff --git a/Documentation/included/simple.ly b/Documentation/included/simple.ly index a2390859cc..790559a8f0 100644 --- a/Documentation/included/simple.ly +++ b/Documentation/included/simple.ly @@ -3,5 +3,6 @@ c d e f g a b c } -%% Optional helper for automatic updating by convert-ly. May be omitted. +%% Optional helper for automatic updating by convert-ly. +%% May be omitted. \version "2.14.0" diff --git a/Documentation/it/macros.itexi b/Documentation/it/macros.itexi index f37afbcafd..d7f08a6450 100644 --- a/Documentation/it/macros.itexi +++ b/Documentation/it/macros.itexi @@ -757,7 +757,7 @@ Per la versione di LilyPond @version{} @end html @iftex -@image{ly-examples/\IMAGE-FILE\-small,,,\IMAGE-FILE\,png} +@image{ly-examples/\IMAGE-FILE\,6in,,\IMAGE-FILE\,png} @end iftex @ifinfo @image{lilypond/ly-examples/\IMAGE-FILE\,,,\IMAGE-FILE\,png} diff --git a/Documentation/it/translations.itexi b/Documentation/it/translations.itexi index fb605fd226..e02977e754 100644 --- a/Documentation/it/translations.itexi +++ b/Documentation/it/translations.itexi @@ -16,7 +16,7 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{Last updated Wed Jul 13 10:59:12 UTC 2011 +@emph{Last updated Sat Aug 13 14:15:49 UTC 2011 } @multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @@ -111,7 +111,7 @@ yes @item 2 Notazione comunemente utilizzata @* -4184 +4187 @tab Federico Bruni @tab Luca Rossetto Casel @tab @@ -258,7 +258,7 @@ yes @item 1 Eseguire @command{lilypond} @* -3622 +3681 @tab Federico Bruni @tab Luca Rossetto Casel @tab @@ -312,7 +312,7 @@ yes @item 3 Eseguire @command{lilypond-book} @* -3952 +3978 @tab Federico Bruni @tab Luca Rossetto Casel @tab @@ -339,7 +339,7 @@ yes @item 4 Programmi esterni @* -2170 +2180 @tab Federico Bruni @tab Luca Rossetto Casel @tab @@ -356,11 +356,11 @@ yes @ifhtml @html -yes +partially @end html @end ifhtml @ifnothtml -yes +partially @end ifnothtml @tab pre-GDP @item @@ -513,7 +513,7 @@ partially @item Manuali @* -1203 +1214 @tab Federico Bruni @tab Luca Rossetto Casel @tab @@ -540,7 +540,7 @@ partially @item Comunità @* -1755 +1888 @tab Federico Bruni @tab Luca Rossetto Casel @tab @@ -557,7 +557,7 @@ yes @ifhtml @html -partially +partially @end html @end ifhtml @ifnothtml diff --git a/Documentation/ja/macros.itexi b/Documentation/ja/macros.itexi index ca205399f7..0b7b0fe09b 100644 --- a/Documentation/ja/macros.itexi +++ b/Documentation/ja/macros.itexi @@ -737,7 +737,7 @@ LilyPond バージョン @version{} 用 @end html @iftex -@image{ly-examples/\IMAGE-FILE\-small,,,\IMAGE-FILE\,png} +@image{ly-examples/\IMAGE-FILE\,6in,,\IMAGE-FILE\,png} @end iftex @ifinfo @image{lilypond/ly-examples/\IMAGE-FILE\,,,\IMAGE-FILE\,png} diff --git a/Documentation/ja/translations.itexi b/Documentation/ja/translations.itexi index 1b3486611f..ff9088f5ff 100644 --- a/Documentation/ja/translations.itexi +++ b/Documentation/ja/translations.itexi @@ -16,7 +16,7 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{最終更新日 Wed Jul 13 10:59:12 UTC 2011 +@emph{最終更新日 Sat Aug 13 14:15:49 UTC 2011 } @multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @@ -111,7 +111,7 @@ LilyPond --- \TITLE\ @item 2 一般的な記譜法 @* -4184 +4187 @tab Yoshiki Sawada @tab @tab @@ -393,7 +393,7 @@ partially @item 1.4 繰り返し @* -945 +944 @tab Yoshiki Sawada @tab @tab @@ -410,7 +410,7 @@ partially @ifhtml @html -partially +partially @end html @end ifhtml @ifnothtml @@ -447,7 +447,7 @@ partially @item 1.6 譜の記譜法 @* -2345 +2341 @tab Yoshiki Sawada @tab @tab @@ -464,7 +464,7 @@ partially @ifhtml @html -partially +partially @end html @end ifhtml @ifnothtml @@ -517,6 +517,60 @@ partially @tab @ifhtml +@html +はい +@end html +@end ifhtml +@ifnothtml +はい +@end ifnothtml +@tab post-GDP +@item +2 入出力全般 +@* +7686 +@tab Yoshiki Sawada +@tab +@tab +@ifhtml + +@html +はい +@end html +@end ifhtml +@ifnothtml +はい +@end ifnothtml +@tab +@ifhtml + +@html +はい +@end html +@end ifhtml +@ifnothtml +はい +@end ifnothtml +@tab post-GDP +@item +3 スペースの問題 +@* +11087 +@tab Yoshiki Sawada +@tab +@tab +@ifhtml + +@html +はい +@end html +@end ifhtml +@ifnothtml +はい +@end ifnothtml +@tab +@ifhtml + @html はい @end html @@ -594,7 +648,7 @@ LilyPond --- \TITLE\ @item 1 @command{lilypond} を実行する @* -3622 +3681 @tab Yoshiki Sawada @tab @tab @@ -611,11 +665,11 @@ LilyPond --- \TITLE\ @ifhtml @html -はい +partially @end html @end ifhtml @ifnothtml -はい +partially @end ifnothtml @tab post-GDP @item @@ -648,7 +702,7 @@ LilyPond --- \TITLE\ @item 3 @command{lilypond-book}: Integrating text and music @* -3952 +3978 @tab Yoshiki Sawada @tab @tab @@ -675,7 +729,7 @@ partially @item 4 外部プログラム @* -2170 +2180 @tab Yoshiki Sawada @tab @tab @@ -692,11 +746,11 @@ partially @ifhtml @html -はい +partially @end html @end ifhtml @ifnothtml -はい +partially @end ifnothtml @tab post-GDP @item @@ -855,7 +909,7 @@ partially @item マニュアル @* -1203 +1214 @tab Yoshiki Sawada @tab @tab @@ -882,7 +936,7 @@ partially @item コミュニティ @* -1755 +1888 @tab Yoshiki Sawada @tab @tab @@ -899,11 +953,11 @@ partially @ifhtml @html -はい +partially @end html @end ifhtml @ifnothtml -はい +partially @end ifnothtml @tab pre-GDP @end multitable diff --git a/Documentation/learning/common-notation.itely b/Documentation/learning/common-notation.itely index 55b6d984bc..7404445215 100644 --- a/Documentation/learning/common-notation.itely +++ b/Documentation/learning/common-notation.itely @@ -197,7 +197,7 @@ aes4 c b c If the above seems confusing, consider this: if you were playing a piano, which key would you hit? If you would press a black key, -then you @emph{must} add @code{-is} or @code{-es} to the note +then you @emph{must} add @w{@code{-is}} or @w{@code{-es}} to the note name! Adding all alterations explicitly might require a little more diff --git a/Documentation/learning/tweaks.itely b/Documentation/learning/tweaks.itely index 40f46cf675..9f1c5dd0b5 100644 --- a/Documentation/learning/tweaks.itely +++ b/Documentation/learning/tweaks.itely @@ -219,7 +219,7 @@ we shall use just a few simple properties and values which are easily understood. For now, don't worry about the @code{#'}, which must precede the -layout property, and the @code{#}, which must precede the value. +layout property, and the@tie{}@code{#}, which must precede the value. These must always be present in exactly this form. This is the most common command used in tweaking, and most of the rest of this chapter will be directed to presenting examples of how it is @@ -584,7 +584,7 @@ at first, so we can be sure the command is working. We get: @end example Don't forget the @code{#'} preceding the -property name and a @code{#} preceding the new value! +property name and a@tie{}@code{#} preceding the new value! The final question is, @q{Where should this command be placed?} While you are unsure and learning, the best @@ -923,7 +923,7 @@ to the front of these values when they are entered in the @tab A valid direction constant or its numerical equivalent (decimal values between -1 and 1 are allowed) @tab @code{LEFT}, @code{CENTER}, @code{UP}, - @code{1}, @code{-1} + @code{1}, @w{@code{-1}} @item Integer @tab A positive whole number @tab @code{3}, @code{1} @@ -942,7 +942,7 @@ make-moment function @code{(ly:make-moment 3 8)} @item Number @tab Any positive or negative decimal value - @tab @code{3.5}, @code{-2.45} + @tab @code{3.5}, @w{@code{-2.45}} @item Pair (of numbers) @tab Two numbers separated by a @q{space . space} and enclosed in brackets preceded by an apostrophe @@ -1090,7 +1090,7 @@ our example we want all bar lines to be suppressed, so the value we need is @code{'#(#f #f #f)}. Let's try that, remembering to include the @code{Staff} context. Note also that in writing this value we have @code{#'#} before the opening bracket. The @code{'#} is required -as part of the value to introduce a vector, and the first @code{#} is +as part of the value to introduce a vector, and the first@tie{}@code{#} is required, as always, to precede the value itself in the @code{\override} command. @@ -1718,7 +1718,7 @@ a4 g c a | @end lilypond Here we use the constants @code{DOWN} and @code{UP}. -These have the values @code{-1} and @code{+1} respectively, and +These have the values @w{@code{-1}} and @code{+1} respectively, and these numerical values may be used instead. The value @code{0} may also be used in some cases. It is simply treated as meaning @code{UP} for stems, but for some objects it means @q{center}. @@ -1901,8 +1901,8 @@ Here are a few examples: @noindent If the fingering seems a little crowded the @code{font-size} could be reduced. The default value can be seen from the -@code{Fingering} object in the IR to be @code{-5}, so let's -try @code{-7}: +@code{Fingering} object in the IR to be @w{@code{-5}}, so let's +try @w{@code{-7}}: @lilypond[quote,fragment,ragged-right,verbatim,relative=1] \override Fingering #'font-size = #-7 @@ -2422,11 +2422,11 @@ reference point. It may be used with all objects which support the @code{self-alignment-interface}. In general these are objects that contain text. The values are @code{LEFT}, @code{RIGHT} or @code{CENTER}. Alternatively, a numerical value between -@code{-1} and @code{+1} may be specified, where @code{-1} is +@w{@code{-1}} and @code{+1} may be specified, where @w{@code{-1}} is left-aligned, @code{+1} is right-aligned, and numbers in between move the text progressively from left-aligned to right-aligned. Numerical values greater than @code{1} may be specified to move -the text even further to the left, or less than @code{-1} to +the text even further to the left, or less than @w{@code{-1}} to move the text even further to the right. A change of @code{1} in the value corresponds to a movement of half the text's length. @@ -2709,7 +2709,7 @@ The best solution here is to move the multimeasure rest down, since the rest is in voice two. The default in @code{\voiceTwo} (i.e. in the second voice of a @code{<<@{...@} \\ @{...@}>>} construct) is that @code{staff-position} is set to -4 for MultiMeasureRest, so we need to -move it, say, four half-staff spaces down to @code{-8}. +move it, say, four half-staff spaces down to @w{@code{-8}}. @cindex MultiMeasureRest, example of overriding @cindex staff-position property, example diff --git a/Documentation/lilypond-texi2html.init b/Documentation/lilypond-texi2html.init index 6814aafed7..3585a9e8ed 100644 --- a/Documentation/lilypond-texi2html.init +++ b/Documentation/lilypond-texi2html.init @@ -55,6 +55,8 @@ ### makeinfo_like_foot_line_and_ref ### makeinfo_like_foot_lines ### makeinfo_like_paragraph +### -) In tables, don't wrap

around the contents. Implemented in +### makeinfo_like_paragraph ### ### ### Useful helper functions: @@ -2070,6 +2072,13 @@ sub makeinfo_like_paragraph ($$$$$$$$$$$$$) return $text if (($format eq 'itemize' or $format eq 'enumerate') and ($$paragraph_number == 1)); } + # The cells of a table should not be wrapped in a

tag, so just return the text + if (defined($command_stack_at_begin->[0]) and $command_stack_at_begin->[0] eq 'multitable') + { + return $text; + } + + # Adjust all footnotes so that they look like good old makeinfo my $open = ' @end html @iftex -@image{ly-examples/\IMAGE-FILE\-small,,,\IMAGE-FILE\,png} +@image{ly-examples/\IMAGE-FILE\,6in,,\IMAGE-FILE\,png} @end iftex @ifinfo @image{lilypond/ly-examples/\IMAGE-FILE\,,,\IMAGE-FILE\,png} diff --git a/Documentation/nl/macros.itexi b/Documentation/nl/macros.itexi index 75288f4cd6..da7ef9c801 100644 --- a/Documentation/nl/macros.itexi +++ b/Documentation/nl/macros.itexi @@ -764,7 +764,7 @@ Voor LilyPond versie @version{} @end html @iftex -@image{ly-examples/\IMAGE-FILE\-small,,,\IMAGE-FILE\,png} +@image{ly-examples/\IMAGE-FILE\,6in,,\IMAGE-FILE\,png} @end iftex @ifinfo @image{lilypond/ly-examples/\IMAGE-FILE\,,,\IMAGE-FILE\,png} diff --git a/Documentation/nl/translations.itexi b/Documentation/nl/translations.itexi index 8665e73f7f..04789de9cf 100644 --- a/Documentation/nl/translations.itexi +++ b/Documentation/nl/translations.itexi @@ -16,7 +16,7 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{Meest recente update Wed Jul 13 10:59:12 UTC 2011 +@emph{Meest recente update Sat Aug 13 14:15:49 UTC 2011 } @multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @@ -111,7 +111,7 @@ ja @item 2 Algemene muzieknotatie @* -4184 +4187 @tab Jan Nieuwenhuizen @tab @tab @@ -285,7 +285,7 @@ ja @item Handleidingen @* -1203 +1214 @tab Jan Nieuwenhuizen @tab Tineke de Munnik @tab diff --git a/Documentation/notation/ancient.itely b/Documentation/notation/ancient.itely index bb7404d327..fe835fd077 100644 --- a/Documentation/notation/ancient.itely +++ b/Documentation/notation/ancient.itely @@ -2607,7 +2607,7 @@ notation of the original. To avoid that syllables of different width (such as @qq{-ri} and @qq{-rum}) spread the syllable note groups unevenly apart, the -@code{#'X-extent} property of the @code{LyricText} object may be +@code{'X-extent} property of the @code{LyricText} object may be set to a fixed value. Another, more cumbersome way would be to add the syllables as @code{\markup} elements. If further adjustments are necessary, this can be easily done with diff --git a/Documentation/notation/changing-defaults.itely b/Documentation/notation/changing-defaults.itely index 756e32680b..0cd9812606 100644 --- a/Documentation/notation/changing-defaults.itely +++ b/Documentation/notation/changing-defaults.itely @@ -36,9 +36,10 @@ and is also included with the LilyPond documentation package. Internally, LilyPond uses Scheme (a LISP dialect) to provide infrastructure. Overriding layout decisions in effect accesses the program internals, which requires Scheme input. Scheme elements are -introduced in a @file{.ly} file with the hash mark -@code{#}.@footnote{@rextend{Scheme tutorial}, contains a short tutorial -on entering numbers, lists, strings, and symbols in Scheme.} +introduced in a @file{.ly} file with the hash +mark@tie{}@code{#}.@footnote{@rextend{Scheme tutorial}, contains a +short tutorial on entering numbers, lists, strings, and symbols in +Scheme.} @menu @@ -1043,7 +1044,7 @@ This fragment points to two parts of the program reference: a page on @code{FingeringEvent} and one on @code{Fingering}. The page on @code{FingeringEvent} describes the properties of the music -expression for the input @code{-2}. The page contains many links +expression for the input @w{@code{-2}}. The page contains many links forward. For example, it says @quotation @@ -1488,7 +1489,7 @@ command, which has the following syntax: @end example @var{value} is a Scheme object, which is why it must be preceded by -the @code{#} character. +the @code{#}@tie{}character. Contexts properties are usually named in @code{studlyCaps}. They mostly control the translation from @@ -1765,7 +1766,7 @@ properties. To tweak those, use commands in the form @cindex internal documentation For many properties, regardless of the data type of the property, setting the -property to false ( @code{##f} ) will result in turning it off, causing +property to false (@code{#f}) will result in turning it off, causing LilyPond to ignore that property entirely. This is particularly useful for turning off grob properties which may otherwise be causing problems. @@ -2242,8 +2243,8 @@ but a direction indicator is @strong{always} required before @item @code{\markup} commands @item @code{\tag} commands @item string markups, e.g. -"string" -@item fingering instructions, e.g. @code{-1} -@item articulation shortcuts, e.g. @code{-.}, @code{->}, @code{--} +@item fingering instructions, e.g. @w{@code{-1}} +@item articulation shortcuts, e.g. @w{@code{-.}}, @w{@code{->}}, @w{@code{--}} @end itemize Direction indicators affect only the next note: @@ -2261,9 +2262,9 @@ The position or direction of many layout objects is controlled by the @code{direction} property. The value of the @code{direction} property may be -set to @code{1}, meaning @qq{up} or @qq{above}, or to @code{-1}, +set to @code{1}, meaning @qq{up} or @qq{above}, or to @w{@code{-1}}, meaning @qq{down} or @qq{below}. The symbols @code{UP} and -@code{DOWN} may be used instead of @code{1} and @code{-1} +@code{DOWN} may be used instead of @code{1} and @w{@code{-1}} respectively. The default direction may be specified by setting @code{direction} to @code{0} or @code{CENTER}. Alternatively, in many cases predefined commands @@ -2279,7 +2280,7 @@ See @rlearning{Within-staff objects}. In a few cases, arpeggio being the only common example, the value of the @code{direction} property specifies whether the object is to be placed to the right or left of the parent object. In -this case @code{-1} or @code{LEFT} means @qq{to the left} and +this case @w{@code{-1}} or @code{LEFT} means @qq{to the left} and @code{1} or @code{RIGHT} means @qq{to the right}. @code{0} or @code{CENTER} means @qq{use the default} direction, as before. @@ -2636,7 +2637,7 @@ it is hardcoded to 0. @item attach-dir This determines where the line starts and ends in the X-direction, -relative to the bound object. So, a value of @code{-1} (or +relative to the bound object. So, a value of @w{@code{-1}} (or @code{LEFT}) makes the line start/end at the left side of the note head it is attached to. @@ -2681,7 +2682,7 @@ c4^\startTextSpan c c c \stopTextSpan @end lilypond Note that negative values move the text @emph{up}, contrary to the -effect that might be expected, as a value of @code{-1} or +effect that might be expected, as a value of @w{@code{-1}} or @code{DOWN} means align the @emph{bottom} edge of the text with the spanner line. A value of @code{1} or @code{UP} aligns the top edge of the text with the spanner line. @@ -2824,7 +2825,7 @@ In the example above the white clef, with a default @code{layer} value of @code{1}, is drawn after the staff lines (default @code{layer} value @code{0}), so overwriting them. To change this, the @code{Clef} object must be given in a lower value of -@code{layer}, say @code{-1}, so that it is drawn earlier: +@code{layer}, say @w{@code{-1}}, so that it is drawn earlier: @lilypond[quote,verbatim,relative=2] \override Staff.Clef #'color = #white @@ -3103,7 +3104,7 @@ e2 \glissando f e2 \glissando f @end lilypond -The value for @code{Y} is set to @code{-2} for the right end +The value for @code{Y} is set to @w{@code{-2}} for the right end point. The left side may be similarly adjusted by specifying @code{left} instead of @code{right}. @@ -3338,12 +3339,12 @@ the @code{self-alignment-X} property, provided the object's real value, in units of half the total X extent of the object. Negative values move the object to the right, positive to the left. A value of @code{0} centers the object on the -reference point of its parent, a value of @code{-1} aligns the +reference point of its parent, a value of @w{@code{-1}} aligns the left edge of the object on the reference point of its parent, and a value of @code{1} aligns the right edge of the object on the reference point of its parent. The symbols @code{LEFT}, -@code{CENTER} and @code{RIGHT} may be used instead of the values -@code{-1, 0, 1} respectively. +@code{CENTER}, and @code{RIGHT} may be used instead of the values +@w{@code{-1}}, @code{0}, and @code{1}, respectively. Normally the @code{\override} command would be used to modify the value of @code{self-alignment-X}, but the @code{\tweak} command @@ -3372,13 +3373,13 @@ value of @code{Y-offset} is just one variable taken into account. This may make adjusting the value of some objects tricky. The units are just half the vertical extent of the object, which is usually quite small, so quite large numbers may be required. -A value of @code{-1} aligns the lower edge of the object with +A value of @w{@code{-1}} aligns the lower edge of the object with the reference point of the parent object, a value of @code{0} aligns the center of the object with the reference point of the parent, and a value of @code{1} aligns the top edge of the object with the reference point of the parent. The symbols @code{DOWN}, -@code{CENTER}, @code{UP} may be substituted for @code{-1, 0, 1} -respectively. +@code{CENTER}, and @code{UP} may be substituted for @w{@code{-1}}, +@code{0}, and @code{1}, respectively. @emph{Self-aligning objects in both directions} diff --git a/Documentation/notation/editorial.itely b/Documentation/notation/editorial.itely index a003f946f1..19d632027a 100644 --- a/Documentation/notation/editorial.itely +++ b/Documentation/notation/editorial.itely @@ -387,9 +387,9 @@ An X11 color is not necessarily exactly the same shade as a similarly named normal color. Not all X11 colors are distinguishable in a web browser, i.e., -a web browser might not display a difference between @code{'LimeGreen} -and @code{'ForestGreen}. For web use normal colors are recommended -(i.e., @code{#blue}, @code{#green}, @code{#red}). +a web browser might not display a difference between @code{LimeGreen} +and @code{ForestGreen}. For web use normal colors are recommended +(i.e., @code{blue}, @code{green}, @code{red}). Notes in a chord cannot be colored with @code{\override}; use diff --git a/Documentation/notation/input.itely b/Documentation/notation/input.itely index 169ac357c7..d6d586062a 100644 --- a/Documentation/notation/input.itely +++ b/Documentation/notation/input.itely @@ -493,7 +493,7 @@ circumstances to avoid errors: @item After every command or variable, i.e. every item that begins with a @code{\} sign. @item After every item that is to be interpreted as a Scheme -expression, i.e. every item that begins with a @code{#} sign. +expression, i.e. every item that begins with a @code{#}@tie{}sign. @item To separate all elements of a Scheme expression. @item In @code{lyricmode} to separate all the terms in both @code{\override} and @code{\set} commands. In particular, spaces @@ -1258,7 +1258,7 @@ been brought into the main file, so the file names they specify must all be relative to the directory containing the main file, not the directory containing the included file. However, this behavior can be changed by passing the option -@code{-drelative-includes} option at the command line +@option{-drelative-includes} option at the command line (or by adding @code{#(ly:set-option 'relative-includes #t)} at the top of the main input file). With @code{relative-includes} set, the path for each @code{\include} command will be taken @@ -1742,7 +1742,7 @@ More clip regions can be defined by adding more pairs of rhythmic-locations to the list. In order to use this feature, LilyPond must be invoked with -@code{-dclip-systems}. The clips are output as EPS files, and are +@option{-dclip-systems}. The clips are output as EPS files, and are converted to PDF and PNG if these formats are switched on as well. For more information on output formats, see @rprogram{Invoking lilypond}. diff --git a/Documentation/notation/notation-appendices.itely b/Documentation/notation/notation-appendices.itely index ded7f6e624..53c75c0351 100644 --- a/Documentation/notation/notation-appendices.itely +++ b/Documentation/notation/notation-appendices.itely @@ -627,6 +627,7 @@ see @ref{Formatting text}. * Bracket-tip glyphs:: * Pedal glyphs:: * Accordion glyphs:: +* Tie glyphs:: * Vaticana glyphs:: * Medicaea glyphs:: * Hufnagel glyphs:: @@ -797,6 +798,16 @@ see @ref{Formatting text}. @end lilypond +@node Tie glyphs +@unnumberedsubsec Tie glyphs + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #ties +@end lilypond + + @node Vaticana glyphs @unnumberedsubsec Vaticana glyphs diff --git a/Documentation/notation/rhythms.itely b/Documentation/notation/rhythms.itely index 697c08a626..7bb3319689 100644 --- a/Documentation/notation/rhythms.itely +++ b/Documentation/notation/rhythms.itely @@ -1377,7 +1377,7 @@ For example, @code{\partial 8*3} becomes: The property @code{measurePosition} contains a rational number indicating how much of the measure has passed at this point. Note that this is set to a negative number by the @code{\partial} command: -i.e., @code{\partial 4} is internally translated to @code{-4}, meaning +i.e., @code{\partial 4} is internally translated to @w{@code{-4}}, meaning @qq{there is a quarter note left in the measure.} @seealso @@ -2039,7 +2039,7 @@ c16 c c | of beaming-rules. At this time the only available value of rule-type is -@code{#'end} for beam ending. +@code{'end} for beam ending. Beaming-rules is a scheme alist (or list of pairs) that indicates the beam type and the grouping to be applied to beams containing notes with diff --git a/Documentation/notation/spacing.itely b/Documentation/notation/spacing.itely index b07668b4f6..37557fcb2d 100644 --- a/Documentation/notation/spacing.itely +++ b/Documentation/notation/spacing.itely @@ -944,7 +944,7 @@ of the cover page so that page 1 is on the right hand side. The relative importance of page (vertical) spacing and line (horizontal) spacing. High values will make page spacing more -important. Default: @code{#10}. +important. Default: @code{10}. @item print-all-headers @funindex print-all-headers @@ -1345,7 +1345,7 @@ inserted at top-level, between scores and top-level markups. There are also analogous settings to @code{ragged-right} and @code{ragged-last} which have the same effect on vertical spacing: @code{ragged-bottom} and @code{ragged-last-bottom}. If set to -@code{##t} the systems on all pages or just the last page +@code{#t} the systems on all pages or just the last page respectively will not be justified vertically. See @ref{Fixed vertical spacing \paper variables}. @@ -1463,7 +1463,7 @@ the section. The @code{Page_turn_engraver} reads the context property @code{minimumPageTurnLength} to determine how long a note-free section must be before a page turn is considered. The default value for -@code{minimumPageTurnLength} is @code{#(ly:make-moment 1 1)}. If you want +@code{minimumPageTurnLength} is @code{(ly:make-moment 1 1)}. If you want to disable page turns, you can set it to something very large. @example @@ -1776,7 +1776,7 @@ follow the format @code{@var{item1}-@var{item2}-spacing}, where spaced. Note that @code{@var{item2}} is not necessarily below @code{@var{item1}}; for example, @code{nonstaff-relatedstaff-spacing} will measure upwards from the -non-staff line if @code{staff-affinity} is @code{#UP}. +non-staff line if @code{staff-affinity} is @code{UP}. Each distance is measured between the @emph{reference points} of the two items. The reference point for a staff is the vertical @@ -2633,7 +2633,7 @@ measure, the shortest duration is determined. The most common shortest duration is taken as the basis for the spacing, with the stipulation that this shortest duration should always be equal to or shorter than an 8th note. The shortest duration is printed when you run -@code{lilypond} with the @code{--verbose} option. +@code{lilypond} with the @option{--verbose} option. These durations may also be customized. If you set the @code{common-shortest-duration} in @rinternals{SpacingSpanner}, then @@ -2975,10 +2975,10 @@ The @code{proportionalNotationDuration} setting takes a single argument, which is the reference duration against that all music will be spaced. The LilyPond Scheme function @code{make-moment} takes two arguments -- a numerator and denominator which together express some fraction of -a whole note. The call @code{#(ly:make-moment 1 20)} therefore produces +a whole note. The call @code{(ly:make-moment 1 20)} therefore produces a reference duration of a twentieth note. Values such as -@code{#(ly:make-moment 1 16)}, @code{#(ly:make-moment 1 8)}, and -@code{#(ly:make-moment 3 97)} are all possible as well. +@code{(ly:make-moment 1 16)}, @code{(ly:make-moment 1 8)}, and +@code{(ly:make-moment 3 97)} are all possible as well. How do we select the right reference duration to pass to @code{proportionalNotationDuration}? Usually by a process of trial diff --git a/Documentation/notation/staff.itely b/Documentation/notation/staff.itely index 2ac1294258..4c626feb90 100644 --- a/Documentation/notation/staff.itely +++ b/Documentation/notation/staff.itely @@ -1296,14 +1296,15 @@ oboeNotes = \relative c'' { It is possible to adjust which aspects of the music are quoted with @code{\cueDuring} by setting the @code{quotedCueEventTypes} -property. Its default value is @code{#'(note-event rest-event +property. Its default value is @code{'(note-event rest-event tie-event beam-event tuplet-span-event)}, which means that only notes, rests, ties, beams and tuplets are quoted, but not articulations, dynamic marks, markup etc. -In this example, the @code{Voice} context must be -explicitly declared, or else the entire music expression would -belong to the @code{CueVoice} context. +@warning{When a @code{Voice} starts with @code{\cueDuring}, as in the +following example, the @code{Voice} context must be explicitly declared, +or else the entire music expression would belong to the @code{CueVoice} +context.} @lilypond[verbatim,quote] oboeNotes = \relative c'' { diff --git a/Documentation/notation/text.itely b/Documentation/notation/text.itely index d9ee4c52e5..28c5b3f5ef 100644 --- a/Documentation/notation/text.itely +++ b/Documentation/notation/text.itely @@ -441,7 +441,7 @@ c A @code{\markup} block may also contain quoted text strings. Such strings are treated as minimal text expressions, and therefore any -markup command or special character (such as @code{\} and @code{#}) +markup command or special character (such as @code{\} and@tie{}@code{#}) will be printed verbatim without affecting the formatting of the text. Double quotation marks themselves may be printed by preceding them with backslashes. diff --git a/Documentation/notation/vocal.itely b/Documentation/notation/vocal.itely index b8f13106e3..1a01f09a1d 100644 --- a/Documentation/notation/vocal.itely +++ b/Documentation/notation/vocal.itely @@ -609,21 +609,15 @@ Internals Reference: In order to assign more than one syllable to a single note with spaces between the syllables, you can surround the phrase with quotes or use a @code{_} character. Alternatively, you can use -code the tilde symbol (@code{~}) to get a lyric tie. The lyric -tie is implemented with the Unicode character U+203F, so be -sure to use a font for this glyph which actually contains it. -Freely available fonts with a lyric tie are, for example, -`FreeSerif' (a Times clone), `DejaVuSans' (but not -`DejaVuSerif'), or `TeXGyreSchola' (a Century Schoolbook -clone). +the tilde symbol (@code{~}) to get a lyric tie. @lilypond[quote,ragged-right,verbatim] { \time 3/4 \relative c' { c2 e4 g2 e4 } - \addlyrics { gran- de_a- mi- go } - \addlyrics { pu- "ro y ho-" nes- to } - \addlyrics { pu- ro~y~ho- nes- to } + \addlyrics { gran -- de_a -- mi -- go } + \addlyrics { pu -- "ro y ho" -- nes -- to } + \addlyrics { pu -- ro~y~ho -- nes -- to } } @end lilypond @@ -650,7 +644,7 @@ left-aligned with the first note of the melisma. When a melisma occurs on a syllable other that the last one in a word, that syllable is usually joined to the following one with a hyphenated line. This is indicated by placing a double hyphen, -@code{--}, immediately after the syllable. +@w{@code{--}}, immediately after the syllable. Alternatively, when a melisma occurs on the last or only syllable in a word an extender line is usually drawn from the end of the syllable @@ -2557,7 +2551,7 @@ If a transposing instrument is being quoted the instrument part should specify its key so the conversion of its cue notes will be done automatically. The example below shows this transposition for a B-flat clarinet. The notes in this example are low on the staff so -@code{#DOWN} is specified in @code{\cueDuring} (so the stems are +@code{DOWN} is specified in @code{\cueDuring} (so the stems are down) and the instrument name is positioned below the staff. Note also that the piano right-hand voice is explicitly declared. This is because the cue notes in this example begin at the start of the diff --git a/Documentation/pictures/architecture-diagram.png b/Documentation/pictures/architecture-diagram.png index aea43157f4..f46f2db8c4 100644 Binary files a/Documentation/pictures/architecture-diagram.png and b/Documentation/pictures/architecture-diagram.png differ diff --git a/Documentation/po/fr.po b/Documentation/po/fr.po index 917528951e..162af1f555 100644 --- a/Documentation/po/fr.po +++ b/Documentation/po/fr.po @@ -5388,6 +5388,11 @@ msgstr "Glyphes de pédale" msgid "Accordion glyphs" msgstr "Glyphes d'accordéon" +#. @node in Documentation/notation/notation-appendices.itely +#. @unnumberedsubsec in Documentation/notation/notation-appendices.itely +msgid "Tie glyphs" +msgstr "Glyphes de liaison" + #. @node in Documentation/notation/notation-appendices.itely #. @unnumberedsubsec in Documentation/notation/notation-appendices.itely msgid "Vaticana glyphs" diff --git a/Documentation/snippets/adding-a-figured-bass-above-or-below-the-notes.ly b/Documentation/snippets/adding-a-figured-bass-above-or-below-the-notes.ly index c814dec1d4..2e4f38445b 100644 --- a/Documentation/snippets/adding-a-figured-bass-above-or-below-the-notes.ly +++ b/Documentation/snippets/adding-a-figured-bass-above-or-below-the-notes.ly @@ -15,9 +15,9 @@ Al escribir un bajo cifrado, podemos situar las cifras encima o debajo de las notas del bajo, mediante la definición de la propiedad @code{BassFigureAlignmentPositioning #'direction} (exclusivamente -dentro de un contexto @code{Staff}). Se puede elegir entre @code{#UP} -(o @code{#1}, arriba), @code{#CENTER} (o @code{#0}, centrado) y -@code{#DOWN} (o @code{#-1}, abajo). +dentro de un contexto @code{Staff}). Se puede elegir entre @code{UP} +(o @code{1}, arriba), @code{CENTER} (o @code{0}, centrado) y +@code{DOWN} (o @w{@code{-1}}, abajo). Esta propiedad se puede cambiar tantas veces como queramos. Utilice @code{\\once \\override} si no quiere que la sobreescritura se aplique @@ -33,9 +33,9 @@ a toda la partitura. texidoc = " When writing a figured bass, you can place the figures above or below the bass notes, by defining the @code{BassFigureAlignmentPositioning -#'direction} property (exclusively in a @code{Staff} context). Choices -are @code{#UP} (or @code{#1}), @code{#CENTER} (or @code{#0}) and -@code{#DOWN} (or @code{#-1}). +#'direction} property (exclusively in a @code{Staff} context). Choices +are @code{UP} (or @code{1}), @code{CENTER} (or @code{0}) and +@code{DOWN} (or @w{@code{-1}}). This property can be changed as many times as you wish. Use @code{\\once \\override} if you don't want the override to apply to the diff --git a/Documentation/snippets/adding-indicators-to-staves-which-get-split-after-a-break.ly b/Documentation/snippets/adding-indicators-to-staves-which-get-split-after-a-break.ly index 8557a8a611..8267f547c3 100644 --- a/Documentation/snippets/adding-indicators-to-staves-which-get-split-after-a-break.ly +++ b/Documentation/snippets/adding-indicators-to-staves-which-get-split-after-a-break.ly @@ -49,7 +49,7 @@ splitStaffBarLine = { (ly:bar-line::print grob) X RIGHT (grob-interpret-markup grob splitStaffBarLineMarkup) - 0 0)) + 0)) \break } diff --git a/Documentation/snippets/adding-orchestral-cues-to-a-vocal-score.ly b/Documentation/snippets/adding-orchestral-cues-to-a-vocal-score.ly index e1c2d865f4..6645f1e2ae 100644 --- a/Documentation/snippets/adding-orchestral-cues-to-a-vocal-score.ly +++ b/Documentation/snippets/adding-orchestral-cues-to-a-vocal-score.ly @@ -16,8 +16,8 @@ notas guía orquestales a la reducción de piano en una partitura vocal. La función musical @code{\\cueWhile} toma cuatro argumentos: la música de la que se toma la cita, como viene definida por @code{\\addQuote}, -el nombre que insertar antes de las notas guía, y después @code{#UP} o -@code{#DOWN} para especificar @code{\\voiceOne} con el nombre encima +el nombre que insertar antes de las notas guía, y después @code{UP} o +@code{DOWN} para especificar @code{\\voiceOne} con el nombre encima del pentagrama o bien @code{\\voiceTwo} con el nombre debajo del pentagrama, y finalmente la música de piano con la que las notas guía deben aparecer en paralelo. El nombre del instrumento citado se @@ -41,7 +41,7 @@ zu einem Klavierauszug hinzufügen kann. Die musikalische Funktion @code{\\cueWhile} braucht vier Argumente: Die Noten, von denen die Stichnoten formatiert werden sollen, definiert durch @code{\\addQuote}, die Bezeichnung, die mit den Noten angegeben werden soll, dann entweder -@code{#UP} (hoch) oder @code{#DOWN} (runter) zur Angabe von entweder +@code{UP} (hoch) oder @code{DOWN} (runter) zur Angabe von entweder @code{\\voiceOne} mit der Bezeichnung über dem System oder @code{\\voiceTwo} mit der Bezeichnung unter dem System, und schließlich die Klaviermusik, die parallel zu den Stichnoten gespielt werden soll. Die Bezeichnung des @@ -60,7 +60,7 @@ multiplie, vous pourriez avoir intérêt à créer votre propre fonction pour gérer ces repères. La fonction musicale @code{\\cueWhile} prend quatre arguments@tie{}: la musique d'où provient la citation, telle que définie par @code{\\addQuote}, le nom qui sera mentionné en regard de -cette citation, son positionnement -- @code{#UP} ou @code{#DOWN} selon +cette citation, son positionnement -- @code{UP} ou @code{DOWN} selon qu'il sera attribué à @code{\\voiceOne} et placé au-dessus ou @code{\\voiceTwo} et placé en dessous -- et enfin la musique du piano qui interviendra en parallèle. Le nom de l'instrument en question @@ -77,7 +77,7 @@ This shows one approach to simplify adding many orchestral cues to the piano reduction in a vocal score. The music function @code{\\cueWhile} takes four arguments: the music from which the cue is to be taken, as defined by @code{\\addQuote}, the name to be inserted before the cue -notes, then either @code{#UP} or @code{#DOWN} to specify either +notes, then either @code{UP} or @code{DOWN} to specify either @code{\\voiceOne} with the name above the staff or @code{\\voiceTwo} with the name below the staff, and finally the piano music in parallel with which the cue notes are to appear. The name of the cued diff --git a/Documentation/snippets/changing-a-single-notes-size-in-a-chord.ly b/Documentation/snippets/changing-a-single-notes-size-in-a-chord.ly index ccda4003e3..5e968b7ee8 100644 --- a/Documentation/snippets/changing-a-single-notes-size-in-a-chord.ly +++ b/Documentation/snippets/changing-a-single-notes-size-in-a-chord.ly @@ -16,8 +16,8 @@ Se pueden modificar notas individuales de un acorde con la instrucción Dentro de un acorde (entre ángulos simples @code{< >}), antes de la nota que queremos alterar, situamos la instrucción @code{\\tweak} -seguida por @code{#'font-size} y definimos el tamaño adecuado como -@code{#-2} (una cabeza pequeña). +seguida por @code{'font-size} y definimos el tamaño adecuado como +@w{@code{-2}} (una cabeza pequeña). " doctitlees = "Modificar el tamaño de una nota suelta de un acorde" @@ -30,7 +30,7 @@ property. Inside the chord (within the brackets @code{< >}), before the note to be altered, place the @code{\\tweak} command, followed by -@code{#'font-size} and define the proper size like @code{#-2} (a tiny +@code{'font-size} and define the proper size like @w{@code{-2}} (a tiny note head). @@ -40,6 +40,7 @@ note head). } % begin verbatim \relative c' { - <\tweak #'font-size #+2 c e g c \tweak #'font-size #-2 e>1^\markup { A tiny e }_\markup { A big c } + <\tweak #'font-size #+2 c e g c \tweak #'font-size #-2 e>1 + ^\markup { A tiny e }_\markup { A big c } } diff --git a/Documentation/snippets/changing-the-staff-size.ly b/Documentation/snippets/changing-the-staff-size.ly index 4ec923b18b..f7c4d3dd78 100644 --- a/Documentation/snippets/changing-the-staff-size.ly +++ b/Documentation/snippets/changing-the-staff-size.ly @@ -11,7 +11,7 @@ texidoc = " Though the simplest way to resize staves is to use -@code{#(set-global-staff-size xx)}, an individual staff's size can be +@code{#(set-global-staff-size @var{xx})}, an individual staff's size can be changed by scaling the properties @code{'staff-space} and @code{fontSize}. diff --git a/Documentation/snippets/clip-systems.ly b/Documentation/snippets/clip-systems.ly index 35134c6dc5..28e5180bd6 100644 --- a/Documentation/snippets/clip-systems.ly +++ b/Documentation/snippets/clip-systems.ly @@ -14,7 +14,7 @@ Este código muestra cómo recortar (extraer) fragmentos a partir de una partitura completa. Este archivo tiene que procesarse de forma separada con la opción -@code{-dclip-systems}; la página de fragmentos de código podría no +@option{-dclip-systems}; la página de fragmentos de código podría no mostrar el resultado adecuadamente. La salida consiste en archivos con los nombres @@ -40,7 +40,7 @@ varios archivos EPS. texidoc = " This code shows how to clip (extract) snippets from a full score. -This file needs to be run separately with @code{-dclip-systems}; the +This file needs to be run separately with @option{-dclip-systems}; the snippets page may not adequately show the results. The result will be files named diff --git a/Documentation/snippets/controlling-tuplet-bracket-visibility.ly b/Documentation/snippets/controlling-tuplet-bracket-visibility.ly index d8a0ff2418..aa13409c28 100644 --- a/Documentation/snippets/controlling-tuplet-bracket-visibility.ly +++ b/Documentation/snippets/controlling-tuplet-bracket-visibility.ly @@ -17,7 +17,7 @@ grupo de valoración especial es imprimir el corchete a no ser que haya una barra de la misma longitud que el grupo especial. Para controlar la visibilidad de los corchetes de grupo, establezca la propiedad @code{'bracket-visibility} a @code{#t} (imprimir el corchete siempre), -@code{#f} (no imprimirlo nunca) o @code{#'if-no-beam} (imprimir el +@code{#f} (no imprimirlo nunca) o @code{'if-no-beam} (imprimir el corchete solamente si no hay barra). " @@ -33,7 +33,7 @@ ligature. LilyPond permet, au travers de la propriété @code{'bracket-visibility}, de contôler précisément leur affichage@tie{}: déterminée à @code{#t}, ils seront toujours imprimés@tie{}; @code{#f} permet de ne jamais les imprimer, et -@code{#'if-no-beam} les imprimera en l'absence de ligature. +@code{'if-no-beam} les imprimera en l'absence de ligature. " doctitlefr = "Contrôle de l'impression des crochets de nolet" @@ -44,7 +44,7 @@ The default behavior of tuplet-bracket visibility is to print a bracket unless there is a beam of the same length as the tuplet. To control the visibility of tuplet brackets, set the property @code{'bracket-visibility} to either @code{#t} (always print a -bracket), @code{#f} (never print a bracket) or @code{#'if-no-beam} +bracket), @code{#f} (never print a bracket) or @code{'if-no-beam} (only print a bracket if there is no beam). " diff --git a/Documentation/snippets/dynamics-custom-text-spanner-postfix.ly b/Documentation/snippets/dynamics-custom-text-spanner-postfix.ly index fc4b01f2fb..6ce32b861e 100644 --- a/Documentation/snippets/dynamics-custom-text-spanner-postfix.ly +++ b/Documentation/snippets/dynamics-custom-text-spanner-postfix.ly @@ -37,7 +37,7 @@ zugewiesen. texidocfr = " Il s'agit de fonctions postfix pour personnaliser l'extension des crescendos textuels. L'extension devrait débuter sur la première notte -de la mesure. Il faut utiliser @code{-\mycresc} -- comme une +de la mesure. Il faut utiliser @w{@code{-\mycresc}} -- comme une articulation -- sous peine que le départ de l'extension n'apparaisse qu'à la note suivante. " diff --git a/Documentation/snippets/lyrics-alignment.ly b/Documentation/snippets/lyrics-alignment.ly index bc2e4fb3a9..723ff567b2 100644 --- a/Documentation/snippets/lyrics-alignment.ly +++ b/Documentation/snippets/lyrics-alignment.ly @@ -13,9 +13,9 @@ texidoces = " La alineación horizontal de la letra se puede ajustar sobreescribiendo la propiedad @code{self-alignment-X} del objeto @code{LyricText}. -@code{#-1} es izquierda, @code{#0} es centrado y @code{#1} es derecha; -sin embargo, puede usar también @code{#LEFT}, @code{#CENTER} y -@code{#RIGHT}. +@w{@code{-1}} es izquierda, @code{0} es centrado y @code{1} es derecha; +sin embargo, puede usar también @code{LEFT}, @code{CENTER} y +@code{RIGHT}. " doctitlees = "Alineación de la letra" @@ -25,9 +25,9 @@ sin embargo, puede usar también @code{#LEFT}, @code{#CENTER} y texidocde = " Die horizontale Ausrichtung von Gesangstext kann eingestellt werden, indem man die @code{self-alignment-X}-Eigenschaft des @code{LyricText}-Objekts -verändert. @code{#-1} bedeutet links, @code{#0} bedeutet mittig und @code{#1} -bedeutet rechts, man kann aber genauso gut auch @code{#LEFT}, @code{#CENTER} -und @code{#RIGHT} benutzen. +verändert. @w{@code{-1}} bedeutet links, @code{0} bedeutet mittig und @code{1} +bedeutet rechts, man kann aber genauso gut auch @code{LEFT}, @code{CENTER} +und @code{RIGHT} benutzen. " doctitlede = "Ausrichtung von Gesangstext" @@ -37,9 +37,9 @@ und @code{#RIGHT} benutzen. texidocfr = " L'alignement horizontal des paroles peut se gérer à l'aide de la propriété @code{self-alignment-X} de l'objet @code{LyricText}. -Les valeurs @code{#-1} ou @code{#LEFT} produiront un alignement par la -gauche, les valeurs @code{#0} ou @code{#CENTER} un alignement centré, et -les valeurs @code{#1} ou @code{#RIGHT} un alignement par la droite. +Les valeurs @w{@code{-1}} ou @code{LEFT} produiront un alignement par la +gauche, les valeurs @code{0} ou @code{CENTER} un alignement centré, et +les valeurs @code{1} ou @code{RIGHT} un alignement par la droite. " doctitlefr = "Alignement des syllabes" @@ -48,8 +48,8 @@ les valeurs @code{#1} ou @code{#RIGHT} un alignement par la droite. texidoc = " Horizontal alignment for lyrics cam be set by overriding the @code{self-alignment-X} property of the @code{LyricText} object. -@code{#-1} is left, @code{#0} is center and @code{#1} is right; -however, you can use @code{#LEFT}, @code{#CENTER} and @code{#RIGHT} as +@w{@code{-1}} is left, @code{0} is center and @code{1} is right; +however, you can use @code{LEFT}, @code{CENTER} and @code{RIGHT} as well. " diff --git a/Documentation/snippets/marking-notes-of-spoken-parts-with-a-cross-on-the-stem.ly b/Documentation/snippets/marking-notes-of-spoken-parts-with-a-cross-on-the-stem.ly index 18b52b36a6..de62cfc023 100644 --- a/Documentation/snippets/marking-notes-of-spoken-parts-with-a-cross-on-the-stem.ly +++ b/Documentation/snippets/marking-notes-of-spoken-parts-with-a-cross-on-the-stem.ly @@ -32,7 +32,7 @@ speakOn = { (grob-interpret-markup grob (markup #:center-align #:fontsize -4 #:musicglyph "noteheads.s2cross")) - -2.3 0)))) + -2.3)))) } speakOff = { diff --git a/Documentation/snippets/modifying-default-values-for-articulation-shorthand-notation.ly b/Documentation/snippets/modifying-default-values-for-articulation-shorthand-notation.ly index c7bffb1d2f..8c5e12f72f 100644 --- a/Documentation/snippets/modifying-default-values-for-articulation-shorthand-notation.ly +++ b/Documentation/snippets/modifying-default-values-for-articulation-shorthand-notation.ly @@ -17,7 +17,7 @@ Las abreviaturas se encuentran definidas dentro del archivo @code{dashLarger}, @code{dashDot} y @code{dashUnderscore} reciben valores predeterminados. Se pueden modificar estos valores predeterminados para las abreviaturas. Por ejemplo, para asociar -la abreviatura @code{-+} (@code{dashPlus}) con el símbolo del +la abreviatura @w{@code{-+}} (@code{dashPlus}) con el símbolo del semitrino en lugar del símbolo predeterminado +, asigne el valor @code{trill} a la variable @code{dashPlus}: @@ -32,7 +32,7 @@ den Variablen @code{dashHat}, @code{dashPlus}, @code{dashDash}, @code{dashBar}, @code{dashLarger}, @code{dashDot} und @code{dashUnderscore} Standardwerte zugewiesen werden. Diese Standardwerte können verändert werden. Um zum Beispiel die Abkürzung -@code{-+} (@code{dashPlus}) mit dem Triller anstatt mit dem +-Symbol zu +@w{@code{-+}} (@code{dashPlus}) mit dem Triller anstatt mit dem +-Symbol zu assoziieren, muss der Wert @code{trill} der Variable @code{dashPlus} zugewiesen werden: @@ -46,7 +46,7 @@ Les raccourcis sont répertoriés dans le fichier @code{dashHat}, @code{dashPlus}, @code{dashDash}, @code{dashBar}, @code{dashLarger}, @code{dashDot}, et @code{dashUnderscore} ainsi que leur valeur par défaut. Ces valeurs peuvent être modifiées selon vos -besoins. Il suffit par exemple, pour affecter au raccourci @code{-+} +besoins. Il suffit par exemple, pour affecter au raccourci @w{@code{-+}} (@code{dashPlus}) le symbole du trille en lieu et place du @code{+} (caractère plus), d'assigner la valeur @code{trill} à la variable @code{dashPlus} : @@ -61,7 +61,7 @@ variables @code{dashHat}, @code{dashPlus}, @code{dashDash}, @code{dashBar}, @code{dashLarger}, @code{dashDot}, and @code{dashUnderscore} are assigned default values. The default values for the shorthands can be modified. For example, to associate the -@code{-+} (@code{dashPlus}) shorthand with the trill symbol instead of +@w{@code{-+}} (@code{dashPlus}) shorthand with the trill symbol instead of the default + symbol, assign the value @code{trill} to the variable @code{dashPlus}: diff --git a/Documentation/snippets/new/clip-systems.ly b/Documentation/snippets/new/clip-systems.ly index ebf8cdea9b..3f412325dd 100644 --- a/Documentation/snippets/new/clip-systems.ly +++ b/Documentation/snippets/new/clip-systems.ly @@ -6,7 +6,7 @@ texidoc = " This code shows how to clip (extract) snippets from a full score. -This file needs to be run separately with @code{-dclip-systems}; the +This file needs to be run separately with @option{-dclip-systems}; the snippets page may not adequately show the results. The result will be files named diff --git a/Documentation/snippets/preventing-extra-naturals-from-being-automatically-added.ly b/Documentation/snippets/preventing-extra-naturals-from-being-automatically-added.ly index 7d4fae9f67..4ca35369d6 100644 --- a/Documentation/snippets/preventing-extra-naturals-from-being-automatically-added.ly +++ b/Documentation/snippets/preventing-extra-naturals-from-being-automatically-added.ly @@ -17,7 +17,7 @@ Según las reglas estándar de composición tipográfica, se imprime un becuadro antes de un sostenido o un bemol cuando se tiene que cancelar una alteración anterior en la misma nota. Para modificar este comportamiento, establezca el -valor de la propiedad @code{extraNatural} a @code{##f} (falso) +valor de la propiedad @code{extraNatural} a @code{#f} (falso) dentro del contexto de @code{Staff}. " @@ -39,7 +39,7 @@ soll. Um dieses Verhalten zu ändern, muss die Eigenschaft En accord avec les règles standards de l'écriture musicale, on grave un bécarre avant un dièse ou un bémol si on a besoin d'annuler une altération précédente. Pour modifier ce comportement, assignez la propriété -@code{extraNatural} du contexte @code{Staff} à la valeur @code{##f} (faux). +@code{extraNatural} du contexte @code{Staff} à la valeur @code{#f} (faux). " doctitlefr = "Suppression des bécarres superflus" @@ -48,7 +48,7 @@ altération précédente. Pour modifier ce comportement, assignez la propriét In accordance with standard typesetting rules, a natural sign is printed before a sharp or flat if a previous accidental on the same note needs to be canceled. To change this behavior, set the -@code{extraNatural} property to @code{f} in the @code{Staff} context. +@code{extraNatural} property to @code{#f} in the @code{Staff} context. diff --git a/Documentation/snippets/volta-text-markup-using-repeatcommands.ly b/Documentation/snippets/volta-text-markup-using-repeatcommands.ly index b739b7b4c0..71363b15b9 100644 --- a/Documentation/snippets/volta-text-markup-using-repeatcommands.ly +++ b/Documentation/snippets/volta-text-markup-using-repeatcommands.ly @@ -17,7 +17,7 @@ volta text needs more advanced formatting with @code{\\markup}. Since @code{repeatCommands} takes a list, the simplest method of including markup is to use an identifier for the text and embed it in -the command list using the Scheme syntax @code{#(list (list 'volta +the command list using the Scheme syntax @code{(list (list 'volta textIdentifier))}. Start- and end-repeat commands can be added as separate list elements: diff --git a/Documentation/translations.itexi b/Documentation/translations.itexi index c75c55580e..368607b51a 100644 --- a/Documentation/translations.itexi +++ b/Documentation/translations.itexi @@ -16,7 +16,7 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{Last updated Wed Jul 13 10:59:12 UTC 2011 +@emph{Last updated Sat Aug 13 14:15:49 UTC 2011 } @multitable @columnfractions 0.5 0.5 @@ -26,7 +26,7 @@ LilyPond Changes @item Section titles @* -(1779) +(193) @tab Francisco Vila @* @@ -44,11 +44,11 @@ translated @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @item LilyPond --- \TITLE\ @@ -720,29 +720,29 @@ up to date @item 2 Interfaces for programmers @* -(3568) +(3899) @tab Till Paala @* @ifhtml @html -translated +partially translated (98 %) @end html @end ifhtml @ifnothtml -translated +partially translated (98 %) @end ifnothtml @* @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @tab Francisco Vila @* @@ -750,22 +750,22 @@ up to date @ifhtml @html -translated +partially translated (98 %) @end html @end ifhtml @ifnothtml -translated +partially translated (98 %) @end ifnothtml @* @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @item A GNU Free Documentation License @@ -1591,7 +1591,7 @@ up to date @item 2 Common notation @* -(4184) +(4187) @tab Pavel Fric @* @@ -3539,7 +3539,7 @@ up to date @item 1.4 Repeats @* -(945) +(944) @tab Till Paala @* @@ -3557,11 +3557,11 @@ translated @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @tab Francisco Vila @* @@ -3636,7 +3636,7 @@ translated @ifhtml @html -partially up to date +partially up to date @end html @end ifhtml @ifnothtml @@ -3659,7 +3659,7 @@ translated @ifhtml @html -partially up to date +partially up to date @end html @end ifhtml @ifnothtml @@ -3799,7 +3799,7 @@ partially up to date @item 1.6 Staff notation @* -(2345) +(2341) @tab Till Paala @* @@ -3817,7 +3817,7 @@ translated @ifhtml @html -partially up to date +partially up to date @end html @end ifhtml @ifnothtml @@ -3885,7 +3885,7 @@ translated @ifhtml @html -partially up to date +partially up to date @end html @end ifhtml @ifnothtml @@ -3908,7 +3908,7 @@ translated @ifhtml @html -partially up to date +partially up to date @end html @end ifhtml @ifnothtml @@ -4367,7 +4367,7 @@ up to date @item 2.2 Keyboard and other multi-staff instruments @* -(864) +(862) @tab  Till Paala @* @@ -5436,7 +5436,7 @@ up to date @item 3 General input and output @* -(7671) +(7686) @tab Till Paala @* @@ -5454,7 +5454,7 @@ partially translated (90 %) @ifhtml @html -partially up to date +partially up to date @end html @end ifhtml @ifnothtml @@ -5502,7 +5502,7 @@ partially translated (83 %) @ifhtml @html -partially up to date +partially up to date @end html @end ifhtml @ifnothtml @@ -5514,11 +5514,11 @@ partially up to date @ifhtml @html -not translated +translated @end html @end ifhtml @ifnothtml -not translated +translated @end ifnothtml @* @@ -5564,11 +5564,11 @@ up to date @ifhtml @html -partially translated (96 %) +translated @end html @end ifhtml @ifnothtml -partially translated (96 %) +translated @end ifnothtml @* @@ -5612,11 +5612,11 @@ up to date @ifhtml @html -not translated +translated @end html @end ifhtml @ifnothtml -not translated +translated @end ifnothtml @* @@ -5632,7 +5632,7 @@ up to date @item 5 Changing defaults @* -(12248) +(12258) @tab Till Paala @* @@ -5750,7 +5750,7 @@ up to date @item A Notation manual tables @* -(1989) +(2017) @tab Till Paala @* @@ -5805,11 +5805,11 @@ Jean-Charles Malahieude @ifhtml @html -partially translated (85 %) +partially translated (84 %) @end html @end ifhtml @ifnothtml -partially translated (85 %) +partially translated (84 %) @end ifnothtml @* @@ -6403,7 +6403,7 @@ up to date @item 1 Running @command{lilypond} @* -(3622) +(3681) @tab Reinhold Kainhofer @* Till Paala @@ -6509,11 +6509,11 @@ translated @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @tab Team-hu @* @@ -6598,11 +6598,11 @@ translated @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @item 2 Updating files with @command{convert-ly} @@ -6789,7 +6789,7 @@ up to date @item 3 Running @command{lilypond-book} @* -(3952) +(3978) @tab Reinhold Kainhofer @* @@ -6916,11 +6916,11 @@ translated @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @tab Federico Bruni @* @@ -6991,7 +6991,7 @@ partially up to date @item 4 External programs @* -(2170) +(2180) @tab Till Paala @* Reinhold Kainhofer @@ -7011,11 +7011,11 @@ translated @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @tab Francisco Vila @* @@ -7034,11 +7034,11 @@ translated @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @tab Jean-Charles Malahieude @* @@ -7057,11 +7057,11 @@ translated @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @tab Team-hu @* @@ -7123,11 +7123,11 @@ translated @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @tab Yoshiki Sawada @* @@ -7146,11 +7146,11 @@ translated @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @item 5 Suggestions for writing files @@ -8597,7 +8597,7 @@ partially up to date @item Manuals @* -(1203) +(1214) @tab Pavel Fric @* @@ -9139,7 +9139,7 @@ up to date @item Community @* -(1755) +(1888) @tab  Pavel Fric @* @@ -9157,7 +9157,7 @@ translated @ifhtml @html -partially up to date +partially up to date @end html @end ifhtml @ifnothtml @@ -9180,11 +9180,11 @@ translated @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @tab Francisco Vila @* @@ -9203,11 +9203,11 @@ translated @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @tab Jean-Charles Malahieude @* @@ -9248,11 +9248,11 @@ translated @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @tab Harmath Dénes @* @@ -9271,11 +9271,11 @@ translated @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @tab Federico Bruni @* @@ -9314,7 +9314,7 @@ translated @ifhtml @html -partially up to date +partially up to date @end html @end ifhtml @ifnothtml @@ -9337,11 +9337,11 @@ translated @ifhtml @html -up to date +partially up to date @end html @end ifhtml @ifnothtml -up to date +partially up to date @end ifnothtml @tab Jan Nieuwenhuizen @* diff --git a/Documentation/usage/external.itely b/Documentation/usage/external.itely index 375031c98f..f3a3b09481 100644 --- a/Documentation/usage/external.itely +++ b/Documentation/usage/external.itely @@ -239,7 +239,7 @@ for pitches, durations are only written when necessary. It is possible to record a MIDI file using a digital keyboard, and then convert it to @file{.ly}. However, human players are not rhythmically exact enough to make a MIDI to LY conversion trivial. -When invoked with quantizing (@code{-s} and @code{-d} options) +When invoked with quantizing (@option{-s} and @option{-d} options) @command{midi2ly} tries to compensate for these timing errors, but is not very good at this. It is therefore not recommended to use @command{midi2ly} for human-generated midi files. diff --git a/Documentation/usage/lilypond-book.itely b/Documentation/usage/lilypond-book.itely index d1018be507..31590d91dd 100644 --- a/Documentation/usage/lilypond-book.itely +++ b/Documentation/usage/lilypond-book.itely @@ -128,7 +128,7 @@ xpdf lilybook Running @command{lilypond-book} and @command{latex} creates a lot of temporary files, which would clutter up the working directory. To -remedy this, use the @code{--output=@var{dir}} option. It will create +remedy this, use the @option{--output=@var{dir}} option. It will create the files in a separate subdirectory @file{dir}. Finally the result of the @LaTeX{} example shown above.@footnote{This @@ -200,27 +200,44 @@ See @emph{The Not So Short Introduction to @LaTeX{}}} for an overview on how to use @LaTeX{}. -Music is entered using +@code{lilypond-book} provides the following commands and environments to include +music in @LaTeX{} files: + +@itemize + +@item +the @code{\lilypond@{...@}} command, where you can directly enter short +lilypond code + +@item +the @code{\begin@{lilypond@}...\end@{lilypond@}} environment, where you +can directly enter longer lilypond code + +@item +the @code{\lilypondfile@{...@}} command to insert a lilypond file + +@item +the @code{\musicxmlfile@{...@}} command to insert a MusicXML file, which +will be processed by @code{musicxml2ly} and @code{lilypond}. + +@end itemize + +In the input file, music is specified with any of the following commands: @example \begin@{lilypond@}[options,go,here] YOUR LILYPOND CODE \end@{lilypond@} -@end example -@noindent -or +\lilypond[options,go,here]@{ YOUR LILYPOND CODE @} -@example \lilypondfile[options,go,here]@{@var{filename}@} + +\musicxmlfile[options,go,here]@{@var{filename}@} @end example -@noindent -or -@example -\lilypond[options,go,here]@{ YOUR LILYPOND CODE @} -@end example +@noindent Additionally, @code{\lilypondversion} displays the current version of lilypond. @@ -397,26 +414,40 @@ Texinfo is the standard format for documentation of the GNU project. An example of a Texinfo document is this manual. The HTML, PDF, and Info versions of the manual are made from the Texinfo document. -In the input file, music is specified with +@code{lilypond-book} provides the following commands and environments to include +music into Texinfo files: + +@itemize + +@item +the @code{@@lilypond@{...@}} command, where you can directly enter short +lilypond code + +@item +the @code{@@lilypond...@@end lilypond} environment, where you can directly +enter longer lilypond code + +@item +the @code{@@lilypondfile@{...@}} command to insert a lilypond file + +@item +the @code{@@musicxmlfile@{...@}} command to insert a MusicXML file, which +will be processed by @code{musicxml2ly} and @code{lilypond}. + +@end itemize + +In the input file, music is specified with any of the following commands @example @@lilypond[options,go,here] YOUR LILYPOND CODE @@end lilypond -@end example - -@noindent -or -@example @@lilypond[options,go,here]@{ YOUR LILYPOND CODE @} -@end example - -@noindent -or -@example @@lilypondfile[options,go,here]@{@var{filename}@} + +@@musicxmlfile[options,go,here]@{@var{filename}@} @end example Additionally, @code{@@lilypondversion} displays the current version @@ -461,8 +492,51 @@ in-line image. It always gets a paragraph of its own. @node HTML @subsection HTML -Music is entered using +@code{lilypond-book} provides the following commands and environments to include +music in HTML files: + +@itemize + +@item +the @code{} command, where you can directly enter short lilypond code + +@item +the @code{...} environment, where you can directly enter longer +lilypond code + +@item +the @code{...} command to insert a lilypond file + +@item +the @code{...} command to insert a MusicXML file, which +will be processed by @code{musicxml2ly} and @code{lilypond}. + +@end itemize + +In the input file, music is specified with any of the following commands: + +\begin@{lilypond@}[options,go,here] + YOUR LILYPOND CODE +\end@{lilypond@} + +\lilypond[options,go,here]@{ YOUR LILYPOND CODE @} + +\lilypondfile[options,go,here]@{@var{filename}@} + +\musicxmlfile[options,go,here]@{@var{filename}@} +@example + + YOUR LILYPOND CODE + + + +@var{filename} + +@var{filename} +@end example + +For example, you can write @example \key c \minor c4 es g2 @@ -490,6 +564,9 @@ To include separate files, say @var{filename} @end example +@code{} uses the same syntax as @code{}, but simply +references a MusicXML file rather than a LilyPond file. + For a list of options to use with the @code{lilypond} or @code{lilypondfile} tags, see @ref{Music fragment options}. @@ -845,7 +922,7 @@ will be included in the @file{.ps} and @file{.pdf} files. Running @command{dvips} may produce some warnings about fonts; these are harmless and may be ignored. If you are running @command{latex} in -twocolumn mode, remember to add @code{-t landscape} to the +twocolumn mode, remember to add @option{-t landscape} to the @command{dvips} options. @subsubheading Texinfo @@ -902,7 +979,7 @@ Add @var{dir} to the include path. @command{lilypond-book} also looks for already compiled snippets in the include path, and does not write them back to the output directory, so in some cases it is necessary to invoke further processing commands such as @command{makeinfo} or -@command{latex} with the same @code{-I @var{dir}} options. +@command{latex} with the same @option{-I @var{dir}} options. @item -o @var{dir} @itemx --output=@var{dir} @@ -927,7 +1004,7 @@ Do not fail if no PNG images are found for EPS files. It is used for LilyPond Info documentation without images. @itemx --lily-output-dir=@var{dir} -Write lily-XXX files to directory @var{dir}, link into @code{--output} +Write lily-XXX files to directory @var{dir}, link into @option{--output} directory. Use this option to save building time for documents in different directories which share a lot of identical snippets. @@ -953,8 +1030,8 @@ line to the right by the same amount. @item -P @var{command} @itemx --process=@var{command} Process LilyPond snippets using @var{command}. The default command is -@code{lilypond}. @code{lilypond-book} will not @code{--filter} and -@code{--process} at the same time. +@code{lilypond}. @code{lilypond-book} will not @option{--filter} and +@option{--process} at the same time. @item --pdf Create PDF files for use with PDF@LaTeX{}. @@ -966,8 +1043,8 @@ all output to log files in the same directory as the source files. @itemx --use-source-file-names Write snippet output files with the same base name as their source file. This option works only for snippets included with @code{lilypondfile} -and only if directories implied by @code{--output-dir} and -@code{--lily-output-dir} options are different. +and only if directories implied by @option{--output-dir} and +@option{--lily-output-dir} options are different. @item -V @itemx --verbose @@ -1017,7 +1094,7 @@ selects the output format based on the input filename's extension. If you use the same filename extension for the input file than the extension @command{lilypond-book} uses for the output file, and if the input file is in the same directory as @command{lilypond-book} working -directory, you must use @code{--output} option to make +directory, you must use @option{--output} option to make @command{lilypond-book} running, otherwise it will exit with an error message like @qq{Output would overwrite input file}. diff --git a/Documentation/usage/running.itely b/Documentation/usage/running.itely index f379853963..147bc84c67 100644 --- a/Documentation/usage/running.itely +++ b/Documentation/usage/running.itely @@ -135,7 +135,7 @@ The following options are supported: @item -e,--evaluate=@var{expr} Evaluate the Scheme @var{expr} before parsing any @file{.ly} files. -Multiple @code{-e} options may be given, they will be evaluated +Multiple @option{-e} options may be given, they will be evaluated sequentially. The expression will be evaluated in the @code{guile-user} module, so @@ -186,7 +186,7 @@ Here are a few interesting options. @table @samp @item help -Running @code{lilypond -dhelp} will print all of the @code{-d} options +Running @code{lilypond -dhelp} will print all of the @option{-d} options available. @cindex paper-size, command line @@ -207,8 +207,8 @@ Note that the string must be enclosed in escaped quotes ( @code{\"} ). Do not trust the @code{.ly} input. When LilyPond formatting is available through a web server, either the -@code{--safe} or the @code{--jail} option @b{MUST} be passed. The -@code{--safe} option will prevent inline Scheme code from wreaking +@option{--safe} or the @option{--jail} option @b{MUST} be passed. The +@option{--safe} option will prevent inline Scheme code from wreaking havoc, for example @quotation @@ -220,7 +220,7 @@ havoc, for example @end verbatim @end quotation -The @code{-dsafe} option works by evaluating in-line Scheme +The @option{-dsafe} option works by evaluating in-line Scheme expressions in a special safe module. This safe module is derived from GUILE @file{safe-r5rs} module, but adds a number of functions of the LilyPond API. These functions are listed in @file{scm/safe-lily.scm}. @@ -231,14 +231,14 @@ disables the use of backslashes in @TeX{} strings. In safe mode, it is not possible to import LilyPond variables into Scheme. -@code{-dsafe} does @emph{not} detect resource overuse. It is still possible to +@option{-dsafe} does @emph{not} detect resource overuse. It is still possible to make the program hang indefinitely, for example by feeding cyclic data structures into the backend. Therefore, if using LilyPond on a publicly accessible webserver, the process should be limited in both CPU and memory usage. The safe mode will prevent many useful LilyPond snippets from being -compiled. The @code{--jail} is a more secure alternative, but +compiled. The @option{--jail} is a more secure alternative, but requires more work to set up. @cindex output format, setting @@ -286,7 +286,7 @@ This mode is used by default by @command{lilypond-book}. for a dump of the raw, internal Scheme-based drawing commands. @item null - do not output a printed score; has the same effect as @code{-dno-print-pages}. + do not output a printed score; has the same effect as @option{-dno-print-pages}. @end table Example: @code{lilypond -dbackend=svg @var{filename}.ly} @@ -305,13 +305,13 @@ Runs silently and redirect all output to a log file. Note to Windows users: By default @code{lilypond.exe} outputs all progress information to the command window, @code{lilypond-windows.exe} does not and returns a prompt, with no progress information, immediately -at the command line. The @code{-dgui} option can be used in this case +at the command line. The @option{-dgui} option can be used in this case to redirect output to a log file. @item print-pages -Generate the full pages, the default. @code{-dno-print-pages} is -useful in combination with @code{-dpreview}. +Generate the full pages, the default. @option{-dno-print-pages} is +useful in combination with @option{-dpreview}. @end table @@ -335,6 +335,35 @@ found the search will continue in subsequent directories. @item -i,--init=@var{file} Set init file to @var{file} (default: @file{init.ly}). +@cindex loglevel +@cindex output verbosity, setting + +@item -l,--loglevel=@var{LEVEL} +Set the verbosity of the console output to @var{LEVEL}. Possible values are: +@table @code +@item NONE +No output at all, not even error messages. + +@item ERROR +Only error messages, no warnings or progress messages. + +@item WARN +Warnings and error messages, no progress. + +@item BASIC_PROGRESS +Basic progress messages (success), warnings and errors. + +@item PROGRESS +All progress messages, warnings and errors. + +@item INFO (default) +Progress messages, warnings, errors and further execution information. + +@item DEBUG +All possible messages, including verbose debug output. +@end table + + @cindex folder, directing output to @cindex output filename, setting @@ -354,7 +383,7 @@ Generate PostScript. @item --png Generate pictures of each page, in PNG format. This implies -@code{--ps}. The resolution in DPI of the image may be set with +@option{--ps}. The resolution in DPI of the image may be set with @example -dresolution=110 @end example @@ -362,24 +391,24 @@ Generate pictures of each page, in PNG format. This implies @cindex Portable Document Format (PDF) output @item --pdf -Generate PDF. This implies @code{--ps}. +Generate PDF. This implies @option{--ps}. @item -j,--jail=@var{user},@var{group},@var{jail},@var{dir} Run @command{lilypond} in a chroot jail. -The @code{--jail} option provides a more flexible alternative to -@code{--safe} when LilyPond formatting is available through a web +The @option{--jail} option provides a more flexible alternative to +@option{--safe} when LilyPond formatting is available through a web server or whenever LilyPond executes externally provided sources. -The @code{--jail} option works by changing the root of @command{lilypond} to +The @option{--jail} option works by changing the root of @command{lilypond} to @var{jail} just before starting the actual compilation process. The user and group are then changed to match those provided, and the current directory is changed to @var{dir}. This setup guarantees that it is not possible (at least in theory) to escape from the jail. Note that for -@code{--jail} to work @command{lilypond} must be run as root, which is usually +@option{--jail} to work @command{lilypond} must be run as root, which is usually accomplished in a safe way using @command{sudo}. Setting up a jail is a slightly delicate matter, as we must be sure that @@ -455,6 +484,10 @@ subdirectories called @file{ly/}, @file{ps/}, @file{tex/}, etc. @item LANG This selects the language for the warning messages. +@item LILYPOND_LOGLEVEL +The default loglevel. If LilyPond is called without an explicit loglevel (i.e. +no @option{--loglevel} command line option), this value is used. + @item LILYPOND_GC_YIELD A variable, as a percentage, that tunes memory management behavior. A higher values means the program uses more memory, a @@ -612,8 +645,8 @@ happens rarely. The most usual cause is misinstalled fonts. @cindex call trace @cindex Scheme error Errors that occur while executing Scheme code are caught by the Scheme -interpreter. If running with the verbose option (@code{-V} or -@code{--verbose}) then a call trace of the offending +interpreter. If running with the verbose option (@option{-V} or +@option{--verbose}) then a call trace of the offending function call is printed. @item Programming error diff --git a/Documentation/usage/updating.itely b/Documentation/usage/updating.itely index 755c530632..8bb8cef926 100644 --- a/Documentation/usage/updating.itely +++ b/Documentation/usage/updating.itely @@ -132,7 +132,7 @@ in-place. @item -f,--from=@var{from-patchlevel} Set the version to convert from. If this is not set, @command{convert-ly} will guess this, on the basis of @code{\version} strings in the file. -E.g. @code{--from=2.10.25} +E.g. @option{--from=2.10.25} @item -n,--no-version Normally, @command{convert-ly} adds a @code{\version} indicator @@ -143,7 +143,7 @@ Show all known conversions and exit. @item --to=@var{to-patchlevel} Set the goal version of the conversion. It defaults to the latest -available version. E.g. @code{--to=2.12.2} +available version. E.g. @option{--to=2.12.2} @item -h, --help Print usage help. diff --git a/Documentation/web/introduction.itexi b/Documentation/web/introduction.itexi index 63c3c61aa1..2f14efa1e1 100644 --- a/Documentation/web/introduction.itexi +++ b/Documentation/web/introduction.itexi @@ -920,8 +920,8 @@ entered with backslashes. @imageFloat{text-input-1-annotate,png,center} @imageFloat{text-input-1-output,png,center} -Alterations are made with different names: add @code{-is} for -sharp, and @code{-es} for flat (these are Dutch note names, other +Alterations are made with different names: add @w{@code{-is}} for +sharp, and @w{@code{-es}} for flat (these are Dutch note names, other languages are available). LilyPond figures out where to put accidentals. diff --git a/Documentation/web/news.itexi b/Documentation/web/news.itexi index 0dfa491ff5..0f0f5568e1 100644 --- a/Documentation/web/news.itexi +++ b/Documentation/web/news.itexi @@ -4075,7 +4075,7 @@ in the @subsubheading February 2, 2004 LilyPond 2.1.17 is out. It adds texts (solo, a due) for the part combiner. It also reinstates the -@code{--safe} option which prevents havoc by Scheme exploits. More +@option{--safe} option which prevents havoc by Scheme exploits. More information in the @ref{Changes}. @newsEnd diff --git a/Documentation/zh/macros.itexi b/Documentation/zh/macros.itexi index 02b3bf4316..78f4191933 100644 --- a/Documentation/zh/macros.itexi +++ b/Documentation/zh/macros.itexi @@ -742,7 +742,7 @@ LilyPond 版本 @version{} @end html @iftex -@image{ly-examples/\IMAGE-FILE\-small,,,\IMAGE-FILE\,png} +@image{ly-examples/\IMAGE-FILE\,6in,,\IMAGE-FILE\,png} @end iftex @ifinfo @image{lilypond/ly-examples/\IMAGE-FILE\,,,\IMAGE-FILE\,png} diff --git a/Documentation/zh/translations.itexi b/Documentation/zh/translations.itexi index c6cfac725e..d12b177866 100644 --- a/Documentation/zh/translations.itexi +++ b/Documentation/zh/translations.itexi @@ -16,7 +16,7 @@ td { border: 1px solid black; text-align: center; } @end html @end ifhtml -@emph{最近更新 Wed Jul 13 10:59:12 UTC 2011 +@emph{最近更新 Sat Aug 13 14:15:49 UTC 2011 } @multitable @columnfractions 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 0.166666666667 @@ -129,7 +129,7 @@ LilyPond --- \TITLE\ @item 手册 @* -1203 +1214 @tab Ben Luo @tab @tab @@ -156,7 +156,7 @@ LilyPond --- \TITLE\ @item 社区 @* -1755 +1888 @tab @tab @tab diff --git a/flower/file-name.cc b/flower/file-name.cc index 14812a034c..27ce6df6f8 100644 --- a/flower/file-name.cc +++ b/flower/file-name.cc @@ -97,9 +97,8 @@ string get_working_directory () { char cwd[PATH_MAX]; - getcwd (cwd, PATH_MAX); - - return string (cwd); + // getcwd returns NULL upon a failure, contents of cwd would be undefined! + return string (getcwd (cwd, PATH_MAX)); } /* Join components to full file_name. */ diff --git a/flower/include/polynomial.hh b/flower/include/polynomial.hh index f575be35fd..c58cb93500 100644 --- a/flower/include/polynomial.hh +++ b/flower/include/polynomial.hh @@ -44,6 +44,7 @@ struct Polynomial Real lc () const; void print () const; Real eval (Real) const; + Real minmax (Real, Real, bool) const; void print_sols (vector) const; void check_sols (vector) const; void check_sol (Real x) const; diff --git a/flower/include/warn.hh b/flower/include/warn.hh index 3c2a6dc0a9..7d381f1f08 100644 --- a/flower/include/warn.hh +++ b/flower/include/warn.hh @@ -22,12 +22,43 @@ #include "std-string.hh" -void error (string s); -void message (string s); -void non_fatal_error (string); -void programming_error (string s); -void progress_indication (string s); -void warning (string s); -void successful (string s); +/* Log-level bitmasks */ +#define LOG_NONE 0 +#define LOG_ERROR 1<<0 +#define LOG_WARN 1<<1 +#define LOG_BASIC 1<<2 // undocumented basic_progress, i.e. input file name and success +#define LOG_PROGRESS 1<<3 +#define LOG_INFO 1<<4 +#define LOG_DEBUG 1<<8 + +/* Log-level definitions (or'ed bitmasks) */ +#define LOGLEVEL_NONE (LOG_NONE) +#define LOGLEVEL_ERROR (LOG_ERROR) +#define LOGLEVEL_WARN (LOGLEVEL_ERROR | LOG_WARN) +#define LOGLEVEL_BASIC (LOGLEVEL_WARN | LOG_BASIC) +#define LOGLEVEL_PROGRESS (LOGLEVEL_BASIC | LOG_PROGRESS) +#define LOGLEVEL_INFO (LOGLEVEL_PROGRESS | LOG_INFO) +#define LOGLEVEL_DEBUG (LOGLEVEL_INFO | LOG_DEBUG) + +extern int loglevel; + +/* output messages, in decreasing order of importance */ +void error (string s, string location = ""); // Fatal error, exits lilypond! +void programming_error (string s, string location = ""); +void non_fatal_error (string, string location = ""); +void warning (string s, string location = ""); +void successful (string s, string location = ""); +/* progress_indication does by default *NOT* start on a new line */ +void progress_indication (string s, bool newline = false, string location = ""); +void message (string s, bool newline = true, string location = ""); +void debug_output (string s, bool newline = true, string location = ""); + +/* Helper functions that always print out the message. Callers should ensure + that the loglevel is obeyed */ +void print_message (int level, string location, string s, bool newline = true); + +bool is_loglevel (int level); +void set_loglevel (int level); +void set_loglevel (string level); #endif /* WARN_HH */ diff --git a/flower/polynomial.cc b/flower/polynomial.cc index 2cd0eaf2e0..05faf42097 100644 --- a/flower/polynomial.cc +++ b/flower/polynomial.cc @@ -61,6 +61,32 @@ Polynomial::multiply (const Polynomial &p1, const Polynomial &p2) return dest; } +Real +Polynomial::minmax (Real l, Real r, bool ret_max) const +{ + vector sols; + if (l > r) + { + programming_error ("left bound greater than right bound for polynomial minmax. flipping bounds."); + l = l + r; + r = l - r; + l = l - r; + } + + sols.push_back (eval (l)); + sols.push_back (eval (r)); + + Polynomial deriv (*this); + deriv.differentiate (); + vector maxmins = deriv.solve (); + for (vsize i = 0; i < maxmins.size (); i++) + if (maxmins[i] >= l && maxmins[i] <= r) + sols.push_back (eval (maxmins[i])); + vector_sort (sols, less ()); + + return ret_max ? sols.back () : sols[0]; +} + void Polynomial::differentiate () { diff --git a/flower/warn.cc b/flower/warn.cc index 1c2f4ed134..870420380e 100644 --- a/flower/warn.cc +++ b/flower/warn.cc @@ -26,64 +26,165 @@ using namespace std; -/* Is progress indication at NEWLINE? */ -static bool progress_newline = true; +/** We have several different loglevels, each with its own message function(s): + ERROR: error, non_fatal_error, programming_error + WARN: warning + BASIC_PROGRESS: success/... + PROGRESS: progress_indication + INFO: message + DEBUG: debug + All these functions check whether the corresponding loglevel bit is set + and print the message only if that's the case +*/ + +/* Define the loglevel (default is INFO) */ +int loglevel = LOGLEVEL_INFO; + +bool +is_loglevel (int level) +{ + // Check the bitmask containing the loglevel + return (loglevel & level); +} + +void +set_loglevel (int level) +{ + loglevel = level; + debug_output (_f ("Log level set to %d\n", loglevel)); +} + +void +set_loglevel (string level) +{ + /* Convert the loglevel string to lower-case, so we allow + both upper- and lower-case loglevels */ + std::transform (level.begin (), level.end (), level.begin (), ::tolower); + + /* Compare just the first few characters, so the loglevels + can be abbreviated */ + if (level.compare (0, 5, "debug") == 0) // debug + set_loglevel (LOGLEVEL_DEBUG); + else if (level.compare (0, 4, "info") == 0) // info + set_loglevel (LOGLEVEL_INFO); + else if (level.compare (0, 4, "prog") == 0) // progress + set_loglevel (LOGLEVEL_PROGRESS); + else if (level.compare (0, 5, "basic") == 0) // basic progress + set_loglevel (LOGLEVEL_BASIC); + else if (level.compare (0, 4, "warn") == 0) // warning + set_loglevel (LOGLEVEL_WARN); + else if (level.compare (0, 3, "err") == 0) // error + set_loglevel (LOGLEVEL_ERROR); + else if (level.compare (0, 4, "none") == 0) // none + set_loglevel (LOGLEVEL_NONE); + else + { + int l; + if (sscanf (level.c_str (), "%d", &l)) + set_loglevel (l); + else + { + non_fatal_error (_f ("unknown log level `%s', using default (INFO)", + level)); + set_loglevel (LOGLEVEL_INFO); + } + } +} + + +/** + * Helper functions: print_message_part (no newline prepended) + * print_message (always starts on a new line) + */ + +/* Is output message at NEWLINE? */ +static bool message_newline = true; -/* Display user information that is not a full message. */ +/* Display user information as a full message. + if newline is true, start the message on a new line. +*/ void -progress_indication (string s) +print_message (int level, string location, string s, bool newline) { + /* Only print the message if the current loglevel allows it: */ + if (!is_loglevel (level)) + return; + if (newline && !message_newline) + fputc ('\n', stderr); + /* Test if all silly progress_indication ("\n") can be dropped now. */ if (s == "\n") return; + if (!location.empty ()) + s = location + ": " + s; fputs (s.c_str (), stderr); fflush (stderr); if (s.length ()) - progress_newline = s[s.length () - 1] == '\n'; + message_newline = s[s.length () - 1] == '\n'; } -/* Display a single user message. Always starts on a new line. */ + +/** The actual output functions to be called in lilypond code. + * Sorted in descending order of importance (errors, warnings, progress, info, + * debug). Each prints a message on a separate line. + */ + +/* Display a fatal error message. Also exits lilypond. */ void -message (string s) +error (string s, string location) { - if (!progress_newline) - fputc ('\n', stderr); - progress_indication (s); + print_message (LOG_ERROR, location, _f ("fatal error: %s", s) + "\n"); + exit (1); } -/* Display a success message. Always starts on a new line. */ +/* Display a severe programming error message, but don't exit. */ void -successful (string s) +programming_error (string s, string location) { - message (_f ("success: %s", s.c_str ()) + "\n"); + print_message (LOG_ERROR, location, _f ("programming error: %s", s) + "\n"); + print_message (LOG_ERROR, location, _ ("continuing, cross fingers") + "\n"); } -/* Display a warning message. Always starts on a new line. */ +/* Display a non-fatal error message, don't exit. */ void -warning (string s) +non_fatal_error (string s, string location) { - message (_f ("warning: %s", s.c_str ()) + "\n"); + print_message (LOG_ERROR, location, _f ("error: %s", s) + "\n"); } +/* Display a warning message. */ void -non_fatal_error (string s) +warning (string s, string location) { - message (_f ("error: %s", s.c_str ()) + "\n"); + print_message (LOG_WARN, location, _f ("warning: %s", s) + "\n"); } -/* Display an error message. Always starts on a new line. */ +/* Display a success message. */ void -error (string s) +successful (string s, string location) { - non_fatal_error (s); - exit (1); + print_message (LOG_BASIC, location, _f ("success: %s", s) + "\n", true); +} + +/* Display information about the progress. */ +void +progress_indication (string s, bool newline, string location) +{ + print_message (LOG_PROGRESS, location, s, newline); } +/* Display a single info message. */ void -programming_error (string s) +message (string s, bool newline, string location) { - message (_f ("programming error: %s", s) + "\n"); - message (_ ("continuing, cross fingers") + "\n"); + // Use the progress loglevel for all normal messages (including progress msg) + print_message (LOG_INFO, location, s, newline); } +/* Display a debug information, not necessarily on a new line. */ +void +debug_output (string s, bool newline, string location) +{ + print_message (LOG_DEBUG, location, s, newline); +} diff --git a/input/regression/beam-knee-symmetry.ly b/input/regression/beam-knee-symmetry.ly index 737f64ac84..646c5a6e85 100644 --- a/input/regression/beam-knee-symmetry.ly +++ b/input/regression/beam-knee-symmetry.ly @@ -3,7 +3,7 @@ \header { texidoc = "Point-symmetric beams should receive the same - quanting. There is no up/down bias in the quanting code." +quanting. There is no up/@/down bias in the quanting code." } \layout{ diff --git a/input/regression/beam-rest-extreme.ly b/input/regression/beam-rest-extreme.ly new file mode 100644 index 0000000000..770bd78939 --- /dev/null +++ b/input/regression/beam-rest-extreme.ly @@ -0,0 +1,14 @@ +\version "2.15.9" + +\header { + texidoc = "Beamed rests are given a pure height approximation +that gets their spacing correct in the majority of circumstances. +" +} + +\relative c'' { + 16[ r ] + 16[ r ] + 16[ r ] + 16[ r ] +} diff --git a/input/regression/break-alignment-anchor-alignment.ly b/input/regression/break-alignment-anchor-alignment.ly index 27ef71291d..d5dad0f0d0 100644 --- a/input/regression/break-alignment-anchor-alignment.ly +++ b/input/regression/break-alignment-anchor-alignment.ly @@ -1,8 +1,8 @@ \version "2.14.0" \header { - texidoc = "The default callback for break-align-anchor in clefs and time/key -signatures reads the break-align-anchor-aligment property to align + texidoc = "The default callback for break-align-anchor in clefs and time/@/key +signatures reads the @code{break-align-anchor-aligment} property to align the anchor to the extent of the break-aligned grob." } diff --git a/input/regression/breathing-sign-ancient.ly b/input/regression/breathing-sign-ancient.ly index af5f207b4f..3ec2c79cc0 100644 --- a/input/regression/breathing-sign-ancient.ly +++ b/input/regression/breathing-sign-ancient.ly @@ -3,10 +3,9 @@ \header{ texidoc=" Gregorian chant notation sometimes also uses commas and ticks, but in -smaller font size (we call it 'virgula' and 'caesura'). However, the -most common breathing signs are divisio minima/maior/maxima and +smaller font size (we call it `virgula' and `caesura'). However, the +most common breathing signs are divisio minima/@/maior/@/maxima and finalis, the latter three looking similar to bar glyphs. - " } \include "gregorian.ly" diff --git a/input/regression/clip-systems.ly b/input/regression/clip-systems.ly index 3533514972..f38f163886 100644 --- a/input/regression/clip-systems.ly +++ b/input/regression/clip-systems.ly @@ -9,7 +9,7 @@ Notes: @item Regions can span multiple systems. In this case, multiple EPS files are generated. @end itemize -This file needs to be run separately with @code{-dclip-systems}; the +This file needs to be run separately with @option{-dclip-systems}; the collated-files.html of the regression test does not adequately show the results. diff --git a/input/regression/completion-heads-factor.ly b/input/regression/completion-heads-factor.ly index a36da3accd..2f10a44c91 100644 --- a/input/regression/completion-heads-factor.ly +++ b/input/regression/completion-heads-factor.ly @@ -9,8 +9,6 @@ notes with a duration factor still keep their requested appearance. " } -#(set-paper-size "a6") - \layout { ragged-right= ##t } diff --git a/input/regression/completion-rest.ly b/input/regression/completion-rest.ly index 63aa5b37e0..034c3053c2 100644 --- a/input/regression/completion-rest.ly +++ b/input/regression/completion-rest.ly @@ -9,8 +9,6 @@ rests with a duration factor still keep their requested appearance. " } -#(set-paper-size "a6") - \layout { ragged-right= ##t } diff --git a/input/regression/cue-clef-begin-of-score.ly b/input/regression/cue-clef-begin-of-score.ly index 012130c2b0..b0e18781bd 100644 --- a/input/regression/cue-clef-begin-of-score.ly +++ b/input/regression/cue-clef-begin-of-score.ly @@ -2,7 +2,7 @@ \header { texidoc = "Clefs for cue notes at the start of a score should print the -standard clef plus a small cue clef after the time/key signature." +standard clef plus a small cue clef after the time/@/key signature." } vI = \relative c'' { \clef "treble" \repeat unfold 40 g4 } diff --git a/input/regression/cue-clef-new-line.ly b/input/regression/cue-clef-new-line.ly index bfe5e504d2..2f64b74159 100644 --- a/input/regression/cue-clef-new-line.ly +++ b/input/regression/cue-clef-new-line.ly @@ -7,7 +7,7 @@ Similarly, an end clef for cue notes ending at a line break should only be printed at the end of the line. Cue notes going over a line break should print the standard clef on the new -line plus an additional cue clef after the time/key signature." +line plus an additional cue clef after the time/@/key signature." } vI = \relative c'' { \clef "treble" \repeat unfold 40 g4 } diff --git a/input/regression/figured-bass-ignore-rest.ly b/input/regression/figured-bass-ignore-rest.ly index 7ee4d4c8f0..a43f610565 100644 --- a/input/regression/figured-bass-ignore-rest.ly +++ b/input/regression/figured-bass-ignore-rest.ly @@ -4,7 +4,7 @@ texidoc = "When figures appear inside a voice, @code{ignoreFiguredBassRest} causes all figures on rests to be discarded and all spanners ended. - If set to @code{##f}, figures on rests are printed. + If set to @code{#f}, figures on rests are printed. " } diff --git a/input/regression/finger-chords-order.ly b/input/regression/finger-chords-order.ly index 8d54a8a9cf..16b6120b24 100644 --- a/input/regression/finger-chords-order.ly +++ b/input/regression/finger-chords-order.ly @@ -3,7 +3,7 @@ \header { texidoc = "Ordering of the fingerings depends on vertical ordering of the notes, and -is independent of up/down direction." +is independent of up/@/down direction." } diff --git a/input/regression/font-bogus-ligature.ly b/input/regression/font-bogus-ligature.ly index 37e83eb2d8..7d3053875a 100644 --- a/input/regression/font-bogus-ligature.ly +++ b/input/regression/font-bogus-ligature.ly @@ -1,6 +1,6 @@ \header { - texidoc = "TM and No should not be changed into trademark/number symbols. + texidoc = "TM and No should not be changed into trademark/@/number symbols. This may happen with incorrect font versions. " } diff --git a/input/regression/fret-diagrams-size.ly b/input/regression/fret-diagrams-size.ly index e492b5d85a..cb33f552e3 100644 --- a/input/regression/fret-diagrams-size.ly +++ b/input/regression/fret-diagrams-size.ly @@ -3,7 +3,7 @@ \header { texidoc=" Fret diagrams can be scaled using the @code{size} property. -The position and size of first fret label, mute/open signs, fingers, +The position and size of first fret label, mute/@/open signs, fingers, relative to the diagram grid, shall be the same in all cases. " diff --git a/input/regression/glissando-accidental.ly b/input/regression/glissando-accidental.ly new file mode 100644 index 0000000000..1e15196b5d --- /dev/null +++ b/input/regression/glissando-accidental.ly @@ -0,0 +1,9 @@ +\header { + texidoc = "Glissandi stop before hitting accidentals." + +} +\version "2.15.9" + +\relative c'' { + a1\glissando cis +} diff --git a/input/regression/grace-sync.ly b/input/regression/grace-sync.ly index 99cfc7e5ea..a88d9ee017 100644 --- a/input/regression/grace-sync.ly +++ b/input/regression/grace-sync.ly @@ -1,6 +1,6 @@ \version "2.14.0" \header { - texidoc = "Grace notes in different voices/staves are synchronized." + texidoc = "Grace notes in different voices/@/staves are synchronized." } \layout { ragged-right = ##t} diff --git a/input/regression/lilypond-book/GNUmakefile b/input/regression/lilypond-book/GNUmakefile index a1e5bdc3b7..6081f7fe36 100644 --- a/input/regression/lilypond-book/GNUmakefile +++ b/input/regression/lilypond-book/GNUmakefile @@ -8,3 +8,11 @@ COLLATED_FILES = $(OUT_FILES) include $(depth)/make/stepmake.make TITLE=lilypond-book Test Suite + +EXTRA_DIST_FILES = include.mxl +EXTRA_DIST_FILES += $(call src-wildcard,*.ly) +EXTRA_DIST_FILES += $(call src-wildcard,*.ily) +EXTRA_DIST_FILES += $(call src-wildcard,*.tely) +EXTRA_DIST_FILES += $(call src-wildcard,*.itely) + + diff --git a/input/regression/lilypond-book/html-musicxml-file-compressed.htmly b/input/regression/lilypond-book/html-musicxml-file-compressed.htmly new file mode 100644 index 0000000000..a839edd60e --- /dev/null +++ b/input/regression/lilypond-book/html-musicxml-file-compressed.htmly @@ -0,0 +1,6 @@ + + +Including a compressed MusicXML file: +include.mxl + + diff --git a/input/regression/lilypond-book/html-musicxml-file-options.htmly b/input/regression/lilypond-book/html-musicxml-file-options.htmly new file mode 100644 index 0000000000..6e05bbe3c8 --- /dev/null +++ b/input/regression/lilypond-book/html-musicxml-file-options.htmly @@ -0,0 +1,6 @@ + + +Including a MusicXML file: +include.xml + + diff --git a/input/regression/lilypond-book/html-musicxml-file.htmly b/input/regression/lilypond-book/html-musicxml-file.htmly new file mode 100644 index 0000000000..6f8d7e3657 --- /dev/null +++ b/input/regression/lilypond-book/html-musicxml-file.htmly @@ -0,0 +1,6 @@ + + +Including a MusicXML file: +include.xml + + diff --git a/input/regression/lilypond-book/include.mxl b/input/regression/lilypond-book/include.mxl new file mode 100644 index 0000000000..d709094487 Binary files /dev/null and b/input/regression/lilypond-book/include.mxl differ diff --git a/input/regression/lilypond-book/include.xml b/input/regression/lilypond-book/include.xml new file mode 100644 index 0000000000..839e14599e --- /dev/null +++ b/input/regression/lilypond-book/include.xml @@ -0,0 +1,55 @@ + + + + + + One simple chord + consisting of two notes. + + + + + MusicXML Part + + + + + + 960 + + + G + 2 + + + + + B + 4 + + 960 + 1 + quarter + + + + + G + 4 + + 960 + 1 + quarter + + + + 960 + 1 + quarter + + + + diff --git a/input/regression/lilypond-book/tex-musicxml-file-options.lytex b/input/regression/lilypond-book/tex-musicxml-file-options.lytex new file mode 100644 index 0000000000..154ed6646a --- /dev/null +++ b/input/regression/lilypond-book/tex-musicxml-file-options.lytex @@ -0,0 +1,5 @@ +\documentclass{article} +\begin{document} +Including MusicMXL file: +\musicxmlfile[language=deutsch,absolute,no-beaming]{include.xml} +\end{document} diff --git a/input/regression/lilypond-book/tex-musicxml-file.lytex b/input/regression/lilypond-book/tex-musicxml-file.lytex new file mode 100644 index 0000000000..2995b35cb3 --- /dev/null +++ b/input/regression/lilypond-book/tex-musicxml-file.lytex @@ -0,0 +1,5 @@ +\documentclass{article} +\begin{document} +Including MusicMXL file: +\musicxmlfile{include.xml} +\end{document} diff --git a/input/regression/lilypond-book/texinfo-musicxml-file-options.tely b/input/regression/lilypond-book/texinfo-musicxml-file-options.tely new file mode 100644 index 0000000000..85454531fb --- /dev/null +++ b/input/regression/lilypond-book/texinfo-musicxml-file-options.tely @@ -0,0 +1,12 @@ +\input texinfo @c -*- coding: utf-8; mode: texinfo; -*- +@setfilename texinfo-musicxml-file.info +@settitle MusicXML inside texinfo + +@node Top +@top MusicMXL in texinfo + +MusicXML included in texinfo +@musicxmlfile[language=deutsch,absolute,no-beaming]{include.xml} + + +@bye diff --git a/input/regression/lilypond-book/texinfo-musicxml-file.tely b/input/regression/lilypond-book/texinfo-musicxml-file.tely new file mode 100644 index 0000000000..8ff23841f2 --- /dev/null +++ b/input/regression/lilypond-book/texinfo-musicxml-file.tely @@ -0,0 +1,12 @@ +\input texinfo @c -*- coding: utf-8; mode: texinfo; -*- +@setfilename texinfo-musicxml-file.info +@settitle MusicXML inside texinfo + +@node Top +@top MusicMXL in texinfo + +MusicXML included in texinfo +@musicxmlfile{include.xml} + + +@bye diff --git a/input/regression/loglevels.ly b/input/regression/loglevels.ly new file mode 100644 index 0000000000..880c6375e0 --- /dev/null +++ b/input/regression/loglevels.ly @@ -0,0 +1,41 @@ +\version "2.15.9" + +#(ly:set-option 'warning-as-error #f) + +\header{ + texidoc=" +Test the different loglevels of lilypond. Run this file with --loglevel=NONE, +ERROR, WARNING, PROGRESS, DEBUG to see the different loglevels. The errors +are commented out. Comment them in to check the output manually. +" +} + +%%%% message functions of the Input class: +#(display "\nMessage functions of the Input class:\n") + +messageTest = #(define-music-function (parser location) () + (ly:input-message location "Test ly:input-message" ) + (make-music 'Music)) + +{ +% #(display "-) Testing message\n") + \messageTest % message +% #(display "-) Testing warning\n") + c4( c( c) % warning +% #(display "-) Testing error\n") +% sr % error +} + +%%%% message functions in the warn.hh file: +#(display "Message functions in the warn.hh file:\n") + +% #(display "-) Testing debug\n") +#(ly:debug "Test debug\n") +% #(display "-) Testing progress\n") +#(ly:progress "Test progress\n") +% #(display "-) Testing message\n") +#(ly:message "Test message\n") +% #(display "-) Testing warning\n") +#(ly:warning "Test warning\n") +% #(display "-) Testing error\n") +% #(ly:error "Test error\n") diff --git a/input/regression/lyric-combine.ly b/input/regression/lyric-combine.ly index 0b5bf4db9c..1c213476f1 100644 --- a/input/regression/lyric-combine.ly +++ b/input/regression/lyric-combine.ly @@ -8,7 +8,7 @@ lyrics will be discarded. Lyrics will not be set over rests. You can have melismata either by setting a property melismaBusy, or by setting automaticMelismas (which will set melismas during slurs and ties). If you want a different order than first Music, then Lyrics, you must -precook a chord of staves/lyrics and label those. Of course, the +precook a chord of staves/@/lyrics and label those. Of course, the lyrics ignore any other rhythms in the piece." } diff --git a/input/regression/metronome-text.ly b/input/regression/metronome-text.ly index f5f826a673..37c321213b 100644 --- a/input/regression/metronome-text.ly +++ b/input/regression/metronome-text.ly @@ -2,8 +2,8 @@ \header{ texidoc=" -The tempo command supports text markup and/or duration=count. Using -@code{Score.tempoHideNote}, one can hide the duration=count in the tempo mark. +The tempo command supports text markup and/@/or `duration=count'. Using +@code{Score.tempoHideNote}, one can hide the `duration=count' in the tempo mark. " } diff --git a/input/regression/midi/key-option.ly b/input/regression/midi/key-option.ly index 47b96b4cc7..27fa7f193b 100644 --- a/input/regression/midi/key-option.ly +++ b/input/regression/midi/key-option.ly @@ -19,7 +19,7 @@ % included from ./out-www/option-key.header \header { -texidoc="midi2ly @code{--key} works, this is F major" +texidoc="@code{midi2ly}'s option @option{--key} works, this is F major." options="--key=-1" } % end diff --git a/input/regression/midi/quantize-duration-2.ly b/input/regression/midi/quantize-duration-2.ly index 26f7d65a7c..868ca44c18 100644 --- a/input/regression/midi/quantize-duration-2.ly +++ b/input/regression/midi/quantize-duration-2.ly @@ -18,7 +18,7 @@ } \header { -texidoc="midi2ly @code{--duration-quant} preserves first note length (16)" +texidoc="@code{midi2ly}'s option @option{--duration-quant} preserves first note length (16)." options="--duration-quant=16" } diff --git a/input/regression/midi/quantize-duration.ly b/input/regression/midi/quantize-duration.ly index f0d6bed9ae..6c9570f4a8 100644 --- a/input/regression/midi/quantize-duration.ly +++ b/input/regression/midi/quantize-duration.ly @@ -19,7 +19,7 @@ % included from ./out-www/voice-2.header \header { -texidoc="midi2ly @code{--duration-quant} quantizes durations of notes" +texidoc="@code{midi2ly}'s option @option{--duration-quant} quantizes durations of notes." options="--duration-quant=4" } % end diff --git a/input/regression/midi/quantize-start.ly b/input/regression/midi/quantize-start.ly index 2e5497f11e..ffa1176946 100644 --- a/input/regression/midi/quantize-start.ly +++ b/input/regression/midi/quantize-start.ly @@ -19,7 +19,7 @@ % included from ./out-www/voice-2.header \header { -texidoc="midi2ly @code{--start-quant} quantizes start of notes" +texidoc="@code{midi2ly}'s option @option{--start-quant} quantizes start of notes." options="--start-quant=4" } % end diff --git a/input/regression/musicxml/GNUmakefile b/input/regression/musicxml/GNUmakefile index b343d88b6f..65e73ea867 100644 --- a/input/regression/musicxml/GNUmakefile +++ b/input/regression/musicxml/GNUmakefile @@ -3,21 +3,22 @@ depth = ../../.. STEPMAKE_TEMPLATES=documentation texinfo tex LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc musicxml -EXTRA_DIST_FILES = LICENSE +EXTRA_DIST_FILES = LICENSE book-musicxml-testsuite.py TEXI2HTML_FLAGS += --nomenu -# Urgh, how can I do two replacements at once without messing up the order of the list? -TMP = $(sort $(MUSICXML_FILES) $(MUSICMXL_FILES) $(TEXINFO_SOURCES) ) -TMP1 = ${TMP:%.xml=$(outdir)/%.ly} -COLLATED_FILES = ${TMP1:%.mxl=$(outdir)/%.ly} +COLLATED_FILES = $(sort $(MUSICXML_FILES) $(MUSICMXL_FILES) $(TEXINFO_SOURCES) ) include $(depth)/make/stepmake.make TITLE=Unofficial MusicXML test suite +AUTHOR=Reinhold Kainhofer TEST_SUITE_VERSION=0.1 +LILYPOND_BOOK_FLAGS += --load-custom-package=$(src-dir)/book-musicxml-testsuite.py +# This breaks since *.tex and *.texi still contains ac/lily-xxxxxx references! +#LILYPOND_BOOK_FLAGS += --use-source-file-names ifeq ($(out),www) local-WWW-2: zip diff --git a/input/regression/musicxml/book-musicxml-testsuite.py b/input/regression/musicxml/book-musicxml-testsuite.py new file mode 100644 index 0000000000..a292db5489 --- /dev/null +++ b/input/regression/musicxml/book-musicxml-testsuite.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- + +import book_base as BookBase +import book_texinfo as BookTexinfo +import book_snippets as BookSnippet +import lilylib as ly + +MusicXMLOutputImage = r'''@noindent +@ifinfo +@image{%(info_image_path)s,,,%(alt)s,%(ext)s} +@end ifinfo +@html +

+ + %(alt)s + +

+@end html +''' + +MusicXMLOutput = r''' +@iftex +@include %(base)s-systems.texi +@end iftex +''' + +MusicXMLPrintFilename = r''' +@html + +@end html +@file{%(filename)s} +@html + +@end html +''' + + + + +class BookMusicXML (BookTexinfo.BookTexinfoOutputFormat): + def __init__ (self): + BookTexinfo.BookTexinfoOutputFormat.__init__ (self) + self.format = "MusicXMLTest" + self.output[BookBase.OUTPUTIMAGE] = MusicXMLOutputImage + self.output[BookBase.OUTPUT] = MusicXMLOutput + self.output[BookBase.PRINTFILENAME] = MusicXMLPrintFilename + def snippet_class (self, type): + if type == "musicxml_file": + return MusicXMLTestSuiteSnippet + else: + return BookSnippet.snippet_type_to_class.get (type, BookSnippet.Snippet) + def snippet_output (self, basename, snippet): + return BookTexinfo.BookTexinfoOutputFormat.snippet_output (self, basename, snippet) + + +class MusicXMLTestSuiteSnippet (BookSnippet.MusicXMLFileSnippet): + def __init__ (self, type, match, formatter, line_number, global_options): + BookSnippet.MusicXMLFileSnippet.__init__ (self, type, match, formatter, line_number, global_options) + +## TODO: Customize output with renderings from other MusicXML-supporting +# applications. Also add some link to the intermediate .ly file + + +BookBase.register_format (BookMusicXML ()); diff --git a/input/regression/optimal-page-breaking-hstretch.ly b/input/regression/optimal-page-breaking-hstretch.ly index b96107c098..2623a6d3ec 100644 --- a/input/regression/optimal-page-breaking-hstretch.ly +++ b/input/regression/optimal-page-breaking-hstretch.ly @@ -7,9 +7,9 @@ \header{ texidoc="The optimal page breaker will make trade-offs between horizontal and vertical stretching so that the overall spacing -will be more acceptable. The page-spacing-weight parameter -controls the relative importance of vertical/horizontal spacing. -Because ragged-last-bottom is on, there is no penalty for odd +will be more acceptable. The @code{page-spacing-weight} parameter +controls the relative importance of vertical/@/horizontal spacing. +Because @code{ragged-last-bottom} is on, there is no penalty for odd vertical spacing on the final page. As a result, only the first page should be horizontally stretched. " diff --git a/input/regression/part-combine.ly b/input/regression/part-combine.ly index bdb2697001..5647b774f4 100644 --- a/input/regression/part-combine.ly +++ b/input/regression/part-combine.ly @@ -3,7 +3,7 @@ texidoc ="The new part combiner stays apart from: @itemize @bullet @item different durations, -@item different articulations (taking into account only slur/beam/tie), and +@item different articulations (taking into account only slur/@/beam/@/tie), and @item wide pitch ranges. @end itemize " diff --git a/input/regression/rest-collision-beam-note.ly b/input/regression/rest-collision-beam-note.ly index 433510d78c..646bd6fd17 100644 --- a/input/regression/rest-collision-beam-note.ly +++ b/input/regression/rest-collision-beam-note.ly @@ -1,7 +1,7 @@ \header { - texidoc = "Beam/rest collision resolution and normal rest/note + texidoc = "Beam/rest collision resolution and normal rest/@/note collisions can be combined." } diff --git a/input/regression/rest-pitch.ly b/input/regression/rest-pitch.ly index 93a9531558..e1abe1c24a 100644 --- a/input/regression/rest-pitch.ly +++ b/input/regression/rest-pitch.ly @@ -1,9 +1,9 @@ \version "2.14.0" \header { - texidoc = "Rests can have pitches--these will be affected by -transposition and relativization. If a rest has a pitch, rest/rest and -beam/rest collision resolving will leave it alone." + texidoc = "Rests can have pitches -- these will be affected by +transposition and relativization. If a rest has a pitch, rest/@/rest and +beam/@/rest collision resolving will leave it alone." } diff --git a/input/regression/skyline-debug.ly b/input/regression/skyline-debug.ly index 6746e2ae05..59e8b7a2c9 100644 --- a/input/regression/skyline-debug.ly +++ b/input/regression/skyline-debug.ly @@ -1,5 +1,5 @@ \header { - texidoc = "@code{-ddebug-skyline} draws the outline of the skyline used." + texidoc = "@option{-ddebug-skyline} draws the outline of the skyline used." } \version "2.14.0" diff --git a/input/regression/slur-avoid.ly b/input/regression/slur-avoid.ly new file mode 100644 index 0000000000..372b8c8fc7 --- /dev/null +++ b/input/regression/slur-avoid.ly @@ -0,0 +1,11 @@ + +\version "2.15.9" + +\header { + texidoc = "Slurs handle avoid objects better. +" +} + +{ + a'8 ( b''4 \fermata ) +} diff --git a/input/regression/slur-scoring.ly b/input/regression/slur-scoring.ly index e2810eea9b..2f78cf06c6 100644 --- a/input/regression/slur-scoring.ly +++ b/input/regression/slur-scoring.ly @@ -7,7 +7,7 @@ one big file, since changing one score parameter for one situation may affect several other situations. - Tunable parameters are in @file{scm/slur.scm}. + Tunable parameters are in @file{scm/@/slur.scm}. " } diff --git a/input/regression/spacing-bar-accidental.ly b/input/regression/spacing-bar-accidental.ly index b3087d4ddd..75db12af26 100644 --- a/input/regression/spacing-bar-accidental.ly +++ b/input/regression/spacing-bar-accidental.ly @@ -1,7 +1,7 @@ \header { texidoc = "An accidental following a bar gets space so - the left edge of the acc is at 0.3 - 0.6 staff space of the bar line" + the left edge of the acc is at 0.3 staff space from the bar line" } diff --git a/input/regression/span-bar-partial.ly b/input/regression/span-bar-partial.ly index 4d206bfa76..20f85ac9f8 100644 --- a/input/regression/span-bar-partial.ly +++ b/input/regression/span-bar-partial.ly @@ -1,6 +1,6 @@ \version "2.14.0" \header { - texidoc = "Span bars can be turned on/off on a staff-by-staff basis." + texidoc = "Span bars can be turned on/@/off on a staff-by-staff basis." } \layout { diff --git a/input/regression/spanner-alignment.ly b/input/regression/spanner-alignment.ly new file mode 100755 index 0000000000..6d5e22e40e --- /dev/null +++ b/input/regression/spanner-alignment.ly @@ -0,0 +1,33 @@ +\version "2.15.8" + +\header { + texidoc = "Spanners align to musical grobs in paper columns, +ignoring things like pedal marks. + +" +} + +\score { + << + \new PianoStaff << + \new Staff = "up" { + \clef treble + \repeat unfold 32 c'4 + } + \new Dynamics = "dynamics" { + \repeat unfold 2 { + s1\cresc s1\f s1\dim s1\p + } + } + \new Staff = "down" { + \clef bass + \repeat unfold 32 c4 + } + \new Dynamics= "pedal" { + \repeat unfold 2 { + s1\sustainOn s1\sustainOff + } + } + >> + >> +} diff --git a/input/regression/string-number-around-slur.ly b/input/regression/string-number-around-slur.ly index 0e48e0f878..62ca07e9c4 100644 --- a/input/regression/string-number-around-slur.ly +++ b/input/regression/string-number-around-slur.ly @@ -7,6 +7,6 @@ is a collision." \relative c'' { \textLengthOn - 4-"inside"( d' -"inside" g + 4-"outside"( d' -"inside" g 1-"outside") } diff --git a/input/regression/tablature-full-notation.ly b/input/regression/tablature-full-notation.ly index 8e31540b88..0b7e0646fd 100644 --- a/input/regression/tablature-full-notation.ly +++ b/input/regression/tablature-full-notation.ly @@ -13,9 +13,8 @@ tabstuff = { f4\f g a^\fermata | R2.*3 | c8\<\( c16 c ~ c2\! | - c'2.\) | \mark \default - R2. | + c'2.\) | \ottava #1 r4 d'4 r8 e | \ottava #0 diff --git a/input/regression/tie-chord.ly b/input/regression/tie-chord.ly index f4e973dc69..1bea075b30 100644 --- a/input/regression/tie-chord.ly +++ b/input/regression/tie-chord.ly @@ -1,15 +1,13 @@ \header { - texidoc = "In chords, ties keep closer to the note head vertically, -but never collide with heads or stems. Seconds are formatted up/down; +but never collide with heads or stems. Seconds are formatted up/@/down; the rest of the ties are positioned according to their vertical position. -The code does not handle all cases. Sometimes ties will printed on top -of or very close to each other. This happens in the last chords of -each system. " - +The code does not handle all cases. Sometimes ties will printed on top +of or very close to each other. This happens in the last chords of +each system." } diff --git a/input/regression/tie-semi-single.ly b/input/regression/tie-semi-single.ly index f666db35e8..178fef6a6e 100644 --- a/input/regression/tie-semi-single.ly +++ b/input/regression/tie-semi-single.ly @@ -4,7 +4,7 @@ texidoc = "Like normal ties, single semities (LaissezVibrerTie or RepeatTie) get their direction from the stem direction, and may be -tweaked with @code{#'direction}." +tweaked with @code{'direction}." } diff --git a/input/regression/tie-single-manual.ly b/input/regression/tie-single-manual.ly index 5859b488a6..1d9357655d 100644 --- a/input/regression/tie-single-manual.ly +++ b/input/regression/tie-single-manual.ly @@ -1,7 +1,7 @@ \header { texidoc = "Individual ties may be formatted manually by -specifying their @code{direction} and/or @code{staff-position}." +specifying their @code{direction} and/@/or @code{staff-position}." } diff --git a/input/regression/tuplet-bracket-visibility.ly b/input/regression/tuplet-bracket-visibility.ly index 94827649b6..ec6e6bdb12 100644 --- a/input/regression/tuplet-bracket-visibility.ly +++ b/input/regression/tuplet-bracket-visibility.ly @@ -14,7 +14,7 @@ unless there is a beam of the same length as the tuplet. Overriding @code{#f} (never print a bracket) @item -@code{#'if-no-beam} (only print a bracket if there is no beam) +@code{'if-no-beam} (only print a bracket if there is no beam) @end itemize " diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index d42811c0a7..25064f61b4 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -86,8 +86,7 @@ All_font_metrics::find_pango_font (PangoFontDescription const *description, SCM val; if (!pango_dict_->try_retrieve (key, &val)) { - if (be_verbose_global) - progress_indication ("\n[" + string (pango_fn)); + debug_output ("[" + string (pango_fn), true); // start on a new line Pango_font *pf = new Pango_font (pango_ft2_fontmap_, description, @@ -98,8 +97,7 @@ All_font_metrics::find_pango_font (PangoFontDescription const *description, pango_dict_->set (key, val); pf->unprotect (); - if (be_verbose_global) - progress_indication ("]"); + debug_output ("]", false); pf->description_ = scm_cons (SCM_BOOL_F, scm_from_double (1.0)); @@ -124,13 +122,11 @@ All_font_metrics::find_otf (string name) if (file_name.empty ()) return 0; - if (be_verbose_global) - progress_indication ("\n[" + file_name); + debug_output ("[" + file_name, true); // start on a new line val = Open_type_font::make_otf (file_name); - if (be_verbose_global) - progress_indication ("]"); + debug_output ("]", false); unsmob_metrics (val)->file_name_ = file_name; SCM name_string = ly_string2scm (name); diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index 143534edab..ac778b0536 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -74,6 +74,13 @@ Axis_group_interface::has_axis (Grob *me, Axis a) Interval Axis_group_interface::relative_group_extent (vector const &elts, Grob *common, Axis a) +{ + return relative_maybe_bound_group_extent (elts, common, a, false); +} + +Interval +Axis_group_interface::relative_maybe_bound_group_extent (vector const &elts, + Grob *common, Axis a, bool bound) { Interval r; for (vsize i = 0; i < elts.size (); i++) @@ -81,7 +88,9 @@ Axis_group_interface::relative_group_extent (vector const &elts, Grob *se = elts[i]; if (!to_boolean (se->get_property ("cross-staff"))) { - Interval dims = se->extent (common, a); + Interval dims = (bound && has_interface (se) + ? generic_bound_extent (se, common, a) + : se->extent (common, a)); if (!dims.is_empty ()) r.unite (dims); } @@ -89,6 +98,32 @@ Axis_group_interface::relative_group_extent (vector const &elts, return r; } +Interval +Axis_group_interface::generic_bound_extent (Grob *me, Grob *common, Axis a) +{ + /* trigger the callback to do skyline-spacing on the children */ + if (a == Y_AXIS) + (void) me->get_property ("vertical-skylines"); + + extract_grob_set (me, "elements", elts); + vector new_elts; + + SCM interfaces = me->get_property ("bound-alignment-interfaces"); + + for (vsize i = 0; i < elts.size (); i++) + for (SCM l = interfaces; scm_is_pair (l); l = scm_cdr (l)) + if (elts[i]->internal_has_interface (scm_car (l))) + new_elts.push_back (elts[i]); + + if (!new_elts.size ()) + return robust_relative_extent (me, common, a); + + if (!common) + common = common_refpoint_of_array (new_elts, me, a); + + return relative_maybe_bound_group_extent (new_elts, common, a, true); +} + Interval Axis_group_interface::sum_partial_pure_heights (Grob *me, int start, int end) { @@ -719,7 +754,7 @@ Axis_group_interface::skyline_spacing (Grob *me, vector elements) vector current_elts; current_elts.push_back (elements[i]); while (i + 1 < elements.size () - && scm_eq_p (elements[i + 1]->get_property ("outside-staff-priority"), priority)) + && scm_is_eq (elements[i + 1]->get_property ("outside-staff-priority"), priority)) { if (!to_boolean (elements[i + 1]->get_property ("cross-staff"))) current_elts.push_back (elements[i + 1]); @@ -808,6 +843,7 @@ ADD_INTERFACE (Axis_group_interface, /* properties */ "adjacent-pure-heights " "axes " + "bound-alignment-interfaces " "default-staff-staff-spacing " "elements " "max-stretch " diff --git a/lily/beam.cc b/lily/beam.cc index 2d973246cf..4acf18c143 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -54,6 +54,7 @@ #include "pointer-group-interface.hh" #include "rhythmic-head.hh" #include "spanner.hh" +#include "staff-symbol.hh" #include "staff-symbol-referencer.hh" #include "stem.hh" #include "warn.hh" @@ -1731,6 +1732,77 @@ Beam::rest_collision_callback (SCM smob, SCM prev_offset) return scm_from_double (offset + staff_space * shift); } +MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Beam, pure_rest_collision_callback, 4, 1, ""); +SCM +Beam::pure_rest_collision_callback (SCM smob, + SCM, /* prev_offset */ + SCM, /* start */ + SCM /* end */) +{ + Real amount = 0.0; + + Grob *me = unsmob_grob (smob); + Grob *stem = unsmob_grob (me->get_object ("stem")); + if (!stem) + return scm_from_double (amount); + Grob *beam = unsmob_grob (stem->get_object ("beam")); + if (!beam + || !Beam::normal_stem_count (beam)) + return scm_from_double (amount); + + Real ss = Staff_symbol_referencer::staff_space (me); + + /* + This gives the extrema of rest positions. + In general, beams are never typeset more than one staff space away + from the staff in either direction. + */ + Grob *staff = Staff_symbol_referencer::get_staff_symbol (me); + Interval rest_max_pos = staff ? Staff_symbol::line_span (staff) : Interval (0.0, 0.0); + rest_max_pos.widen (1); + rest_max_pos *= ss / 2; + + extract_grob_set (beam, "stems", stems); + vector my_stems; + + for (vsize i = 0; i < stems.size (); i++) + if (Stem::head_count (stems[i]) || stems[i] == stem) + my_stems.push_back (stems[i]); + + vsize idx = -1; + + for (vsize i = 0; i < my_stems.size (); i++) + if (my_stems[i] == stem) + { + idx = i; + break; + } + Grob *left; + Grob *right; + + if (idx == (vsize)-1 || my_stems.size () == 1) + return scm_from_double (amount); + else if (idx == 0) + left = right = my_stems[1]; + else if (idx == my_stems.size () - 1) + left = right = my_stems[idx - 1]; + else + { + left = my_stems[idx - 1]; + right = my_stems[idx + 1]; + } + Direction beamdir = get_grob_direction (beam); + /* + Take the position between the two bounding head_positions, + then bound it by the minimum and maximum positions outside the staff. + 4.0 = 2.0 to get out of staff space * 2.0 for the average + */ + amount = min (max ((Stem::head_positions (left)[beamdir] + Stem::head_positions (right)[beamdir]) / 4.0, rest_max_pos[DOWN]), rest_max_pos[UP]); + + return scm_from_double (amount); +} + + bool Beam::is_knee (Grob *me) { diff --git a/lily/bezier.cc b/lily/bezier.cc index f230d1057d..ce84ce8da8 100644 --- a/lily/bezier.cc +++ b/lily/bezier.cc @@ -81,6 +81,17 @@ Bezier::get_other_coordinate (Axis a, Real x) const return curve_coordinate (ts[0], other); } +vector +Bezier::get_other_coordinates (Axis a, Real x) const +{ + Axis other = other_axis (a); + vector ts = solve_point (a, x); + vector sols; + for (vsize i = 0; i < ts.size (); i++) + sols.push_back (curve_coordinate (ts[i], other)); + return sols; +} + Real Bezier::curve_coordinate (Real t, Axis a) const { @@ -202,6 +213,51 @@ Bezier::solve_point (Axis ax, Real coordinate) const return filter_solutions (sol); } +Real +Bezier::minmax (Axis ax, Real l, Real r, Direction d) const +{ + return minmax (ax, l, r, d, 0, 0); +} + +Real +Bezier::minmax (Axis axis, Real l, Real r, Direction d, vsize left_index, vsize right_index) const +{ + Axis other = other_axis (axis); + Interval lr (l, r); + Drul_array > sol; + Direction dir = LEFT; + do + { + Polynomial p (polynomial (axis)); + p.coefs_[0] -= lr[dir]; + + sol[dir] = filter_solutions (p.solve ()); + } + while (flip (&dir) != LEFT); + + if (!sol[LEFT].size () || !sol[RIGHT].size ()) + { + programming_error ("no solution found for Bezier intersection"); + return 0.0; + } + + Polynomial p (polynomial (other)); + + Drul_array indices(left_index, right_index); + do + { + vector_sort (sol[dir], less ()); + if (!Interval (0, sol[LEFT].size () - 1).contains (indices[dir])) + { + programming_error ("requested bezier solution outside range of solutions. defaulting to lowest solution."); + indices[dir] = 0; + } + } + while (flip (&dir) != LEFT); + + return p.minmax (sol[LEFT][indices[LEFT]], sol[RIGHT][indices[RIGHT]], d != LEFT); +} + /** Compute the bounding box dimensions in direction of A. */ diff --git a/lily/break-alignment-interface.cc b/lily/break-alignment-interface.cc index a471a7ba9f..619d8eaab2 100644 --- a/lily/break-alignment-interface.cc +++ b/lily/break-alignment-interface.cc @@ -103,13 +103,10 @@ Break_alignment_interface::calc_positioning_done (SCM smob) vector elems = ordered_elements (me); vector extents; - int last_nonempty = -1; for (vsize i = 0; i < elems.size (); i++) { Interval y = elems[i]->extent (elems[i], X_AXIS); extents.push_back (y); - if (!y.is_empty ()) - last_nonempty = i; } vsize idx = 0; diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index 85da75c961..f1f89093ea 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -70,16 +70,9 @@ SCM Breathing_sign::divisio_maior (SCM smob) { Grob *me = unsmob_grob (smob); - Real staff_space = Staff_symbol_referencer::staff_space (me); - Real staff_size; Real thickness = Staff_symbol_referencer::line_thickness (me); thickness *= robust_scm2double (me->get_property ("thickness"), 1.0); - if (Staff_symbol_referencer::get_staff_symbol (me)) - staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space; - else - staff_size = 0.0; - Real blotdiameter = me->layout ()->get_dimension (ly_symbol2scm ("blot-diameter")); /* diff --git a/lily/chord-tremolo-iterator.cc b/lily/chord-tremolo-iterator.cc index 1658e55782..effa751425 100644 --- a/lily/chord-tremolo-iterator.cc +++ b/lily/chord-tremolo-iterator.cc @@ -34,7 +34,6 @@ Chord_tremolo_iterator::get_music_list () const { Music *mus = get_music (); Input *origin = mus->origin (); - Moment l = mus->get_length (); Music *body = Repeated_music::body (mus); bool body_is_sequential = body->is_mus_type ("sequential-music"); diff --git a/lily/context-def.cc b/lily/context-def.cc index 5dd1684a83..e5f33c75c7 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -174,8 +174,7 @@ Context_def::get_accepted (SCM user_mod) const SCM def = get_default_child (user_mod); if (scm_is_symbol (def)) { - if (scm_memq (def, acc)) - acc = scm_delete_x (def, acc); + acc = scm_delete_x (def, acc); acc = scm_cons (def, acc); } diff --git a/lily/dispatcher.cc b/lily/dispatcher.cc index a6cee709ce..6a11654e23 100644 --- a/lily/dispatcher.cc +++ b/lily/dispatcher.cc @@ -77,7 +77,7 @@ Dispatcher::dispatch (SCM sev) { Stream_event *ev = unsmob_stream_event (sev); SCM class_symbol = ev->get_property ("class"); - if (!scm_symbol_p (class_symbol)) + if (!scm_is_symbol (class_symbol)) { warning (_ ("Event class should be a symbol")); return; @@ -89,7 +89,9 @@ Dispatcher::dispatch (SCM sev) ev->origin ()->warning (_f ("Unknown event class %s", ly_symbol2string (class_symbol).c_str ())); return; } +#if 0 bool sent = false; +#endif int num_classes = scm_ilength (class_list); /* @@ -148,7 +150,9 @@ Dispatcher::dispatch (SCM sev) Listener *l = unsmob_listener (scm_cdar (lists[0].list)); l->listen (ev->self_scm ()); +#if 0 sent = true; +#endif } // go to the next listener; bubble-sort the class list. SCM next = scm_cdr (lists[0].list); @@ -161,10 +165,11 @@ Dispatcher::dispatch (SCM sev) lists[i].list = next; } - /* TODO: Uncomment. +#if 0 + /* TODO: Uncomment. */ if (!sent) warning (_f ("Junking event: %s", ly_symbol2string (class_symbol).c_str ())); - */ +#endif } void diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 0107e7f436..06f16cf8a8 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -167,9 +167,6 @@ Dynamic_engraver::process_music () Axis_group_interface::add_element (line_spanner_, script_); } - Stream_event *stop_ev = accepted_spanevents_drul_ [STOP] - ? accepted_spanevents_drul_[STOP] : script_ev_; - if (accepted_spanevents_drul_[STOP] || script_ev_) { /* @@ -193,10 +190,7 @@ Dynamic_engraver::process_music () current_cresc_ev_ = 0; } else if (accepted_spanevents_drul_[STOP]) - { - accepted_spanevents_drul_[STOP]->origin ()->warning (_ ("cannot find start of (de)crescendo")); - stop_ev = 0; - } + accepted_spanevents_drul_[STOP]->origin ()->warning (_ ("cannot find start of (de)crescendo")); } if (accepted_spanevents_drul_[START]) diff --git a/lily/font-config-scheme.cc b/lily/font-config-scheme.cc index 993e52568e..d5ecb4b39a 100644 --- a/lily/font-config-scheme.cc +++ b/lily/font-config-scheme.cc @@ -149,8 +149,8 @@ LY_DEFINE (ly_font_config_add_directory, "ly:font-config-add-directory", 1, 0, 0 if (!FcConfigAppFontAddDir (0, (const FcChar8 *)d.c_str ())) error (_f ("failed adding font directory: %s", d.c_str ())); - else if (be_verbose_global) - message (_f ("adding font directory: %s", d.c_str ())); + else + debug_output (_f ("Adding font directory: %s", d.c_str ())); return SCM_UNSPECIFIED; } @@ -165,8 +165,8 @@ LY_DEFINE (ly_font_config_add_font, "ly:font-config-add-font", 1, 0, 0, if (!FcConfigAppFontAddFile (0, (const FcChar8 *)f.c_str ())) error (_f ("failed adding font file: %s", f.c_str ())); - else if (be_verbose_global) - message (_f ("adding font file: %s", f.c_str ())); + else + debug_output (_f ("Adding font file: %s", f.c_str ())); return SCM_UNSPECIFIED; } diff --git a/lily/font-config.cc b/lily/font-config.cc index 63cb66fc35..8ad36fbbab 100644 --- a/lily/font-config.cc +++ b/lily/font-config.cc @@ -35,8 +35,7 @@ FcConfig *font_config_global = 0; void init_fontconfig () { - if (be_verbose_global) - message (_ ("Initializing FontConfig...")); + debug_output (_ ("Initializing FontConfig...")); /* TODO: Find a way for Fontconfig to update its cache, if needed. */ font_config_global = FcInitLoadConfig (); @@ -52,18 +51,16 @@ init_fontconfig () string dir = dirs[i]; if (!FcConfigAppFontAddDir (font_config_global, (FcChar8 *)dir.c_str ())) error (_f ("failed adding font directory: %s", dir.c_str ())); - else if (be_verbose_global) - message (_f ("adding font directory: %s", dir.c_str ())); + else + debug_output (_f ("Adding font directory: %s", dir.c_str ())); } - if (be_verbose_global) - message (_ ("Building font database...")); + debug_output (_ ("Building font database...")); FcConfigBuildFonts (font_config_global); FcConfigSetCurrent (font_config_global); - if (be_verbose_global) - message ("\n"); + debug_output ("\n"); } diff --git a/lily/font-select.cc b/lily/font-select.cc index 3de5a2a454..217ce61959 100644 --- a/lily/font-select.cc +++ b/lily/font-select.cc @@ -123,7 +123,7 @@ select_encoded_font (Output_def *layout, SCM chain) return select_pango_font (layout, chain); else #endif - if (scm_instance_p (name)) + if (scm_is_true (scm_instance_p (name))) { SCM base_size = scm_slot_ref (name, ly_symbol2scm ("default-size")); SCM vec = scm_slot_ref (name, ly_symbol2scm ("size-vector")); diff --git a/lily/general-scheme.cc b/lily/general-scheme.cc index fa838e3189..af2bcd73b4 100644 --- a/lily/general-scheme.cc +++ b/lily/general-scheme.cc @@ -40,6 +40,9 @@ using namespace std; #include "version.hh" #include "warn.hh" +/* Declaration of log function(s) */ +SCM ly_progress (SCM, SCM); + LY_DEFINE (ly_start_environment, "ly:start-environment", 0, 0, 0, (), "Return the environment (a list of strings) that was in" @@ -96,87 +99,11 @@ LY_DEFINE (ly_gulp_file, "ly:gulp-file", return scm_from_locale_stringn (contents.c_str (), contents.length ()); } -LY_DEFINE (ly_error, "ly:error", - 1, 0, 1, (SCM str, SCM rest), - "A Scheme callable function to issue the error @var{str}." - " The error is formatted with @code{format} and @var{rest}.") -{ - LY_ASSERT_TYPE (scm_is_string, str, 1); - str = scm_simple_format (SCM_BOOL_F, str, rest); - error (ly_scm2string (str)); - return SCM_UNSPECIFIED; -} - -LY_DEFINE (ly_message, "ly:message", - 1, 0, 1, (SCM str, SCM rest), - "A Scheme callable function to issue the message @var{str}." - " The message is formatted with @code{format} and @var{rest}.") -{ - LY_ASSERT_TYPE (scm_is_string, str, 1); - str = scm_simple_format (SCM_BOOL_F, str, rest); - message (ly_scm2string (str)); - return SCM_UNSPECIFIED; -} - -LY_DEFINE (ly_progress, "ly:progress", - 1, 0, 1, (SCM str, SCM rest), - "A Scheme callable function to print progress @var{str}." - " The message is formatted with @code{format} and @var{rest}.") -{ - LY_ASSERT_TYPE (scm_is_string, str, 1); - str = scm_simple_format (SCM_BOOL_F, str, rest); - progress_indication (ly_scm2string (str)); - return SCM_UNSPECIFIED; -} - -LY_DEFINE (ly_programming_error, "ly:programming-error", - 1, 0, 1, (SCM str, SCM rest), - "A Scheme callable function to issue the internal warning" - " @var{str}. The message is formatted with @code{format}" - " and @var{rest}.") -{ - LY_ASSERT_TYPE (scm_is_string, str, 1); - str = scm_simple_format (SCM_BOOL_F, str, rest); - - if (get_program_option ("warning-as-error")) - error (ly_scm2string (str)); - else - programming_error (ly_scm2string (str)); - - return SCM_UNSPECIFIED; -} - -LY_DEFINE (ly_success, "ly:success", - 1, 0, 1, (SCM str, SCM rest), - "A Scheme callable function to issue a success message @var{str}." - " The message is formatted with @code{format} and @var{rest}.") -{ - LY_ASSERT_TYPE (scm_is_string, str, 1); - str = scm_simple_format (SCM_BOOL_F, str, rest); - successful (ly_scm2string (str)); - return SCM_UNSPECIFIED; - -} -LY_DEFINE (ly_warning, "ly:warning", - 1, 0, 1, (SCM str, SCM rest), - "A Scheme callable function to issue the warning @var{str}." - " The message is formatted with @code{format} and @var{rest}.") -{ - LY_ASSERT_TYPE (scm_is_string, str, 1); - str = scm_simple_format (SCM_BOOL_F, str, rest); - - if (get_program_option ("warning-as-error")) - error (ly_scm2string (str)); - else - warning (ly_scm2string (str)); - - return SCM_UNSPECIFIED; -} LY_DEFINE (ly_dir_p, "ly:dir?", 1, 0, 0, (SCM s), - "Is @var{s} a direction? Valid directions are @code{-1}," - " @code{0}, or@tie{}@code{1}, where @code{-1} represents" + "Is @var{s} a direction? Valid directions are @w{@code{-1}}," + " @code{0}, or@tie{}@code{1}, where @w{@code{-1}} represents" " left or down, @code{1}@tie{}represents right or up, and @code{0}" " represents a neutral direction.") { @@ -260,7 +187,7 @@ LY_DEFINE (ly_string_percent_encode, "ly:string-percent-encode", 1, 0, 0, (SCM str), "Encode all characters in string @var{str} with hexadecimal" " percent escape sequences, with the following exceptions:" - " characters @code{-}, @code{.}, @code{/}, and @code{_}; and" + " characters @w{@code{-},} @code{.}, @code{/}, and @code{_}; and" " characters in ranges @code{0-9}, @code{A-Z}, and @code{a-z}.") { LY_ASSERT_TYPE (scm_is_string, str, 1); @@ -452,13 +379,16 @@ LY_DEFINE (ly_stderr_redirect, "ly:stderr-redirect", LY_ASSERT_TYPE (scm_is_string, file_name, 1); string m = "w"; + string f = ly_scm2string (file_name); FILE *stderrfile; - if (mode != SCM_UNDEFINED && scm_string_p (mode)) + if (scm_is_string (mode)) m = ly_scm2string (mode); /* dup2 and (fileno (current-error-port)) do not work with mingw'c gcc -mwindows. */ fflush (stderr); - stderrfile = freopen (ly_scm2string (file_name).c_str (), m.c_str (), stderr); + stderrfile = freopen (f.c_str (), m.c_str (), stderr); + if (!stderrfile) + error (_f ("failed redirecting stderr to `%s'", f.c_str ())); return SCM_UNSPECIFIED; } @@ -714,15 +644,11 @@ LY_DEFINE (ly_spawn, "ly:spawn", char *standard_output = 0; char *standard_error = 0; - int exit_status = be_verbose_global - ? ly_run_command (argv, &standard_output, &standard_error) - : ly_run_command (argv, 0, 0); + // Always get the pointer to the stdout/stderr messages + int exit_status = ly_run_command (argv, &standard_output, &standard_error); - if (be_verbose_global) - { - fprintf (stderr, "\n%s", standard_output); - fprintf (stderr, "%s", standard_error); - } + // Print out stdout and stderr only in debug mode + debug_output (string ("\n") + standard_output + standard_error, true); for (int i = 0; i < n; i++) free (argv[i]); diff --git a/lily/glissando-engraver.cc b/lily/glissando-engraver.cc index 38270f446f..0248c8fe78 100644 --- a/lily/glissando-engraver.cc +++ b/lily/glissando-engraver.cc @@ -121,7 +121,7 @@ Glissando_engraver::acknowledge_note_column (Grob_info info) continue; int n1 = robust_scm2int (scm_car (candidate), -1); int n2 = robust_scm2int (scm_cdr (candidate), -1); - if (n1 < 0 || n2 < 0 || n1 >= note_heads.size ()) + if ((n1 < 0) || (n2 < 0) || (size_t(n1) >= note_heads.size ())) continue; note_column_1.push_back (vsize (n1)); note_column_2.push_back (vsize (n2)); diff --git a/lily/global-context-scheme.cc b/lily/global-context-scheme.cc index 2b02da2b2a..eeda645210 100644 --- a/lily/global-context-scheme.cc +++ b/lily/global-context-scheme.cc @@ -123,8 +123,7 @@ LY_DEFINE (ly_interpret_music_expression, "ly:interpret-music-expression", send_stream_event (g, "Finish", 0, 0); - if (be_verbose_global) - message (_f ("elapsed time: %.2f seconds", timer.read ())); + debug_output (_f ("elapsed time: %.2f seconds", timer.read ())); return ctx; } diff --git a/lily/grob.cc b/lily/grob.cc index 993b18a31b..d8aeedd5ad 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -88,13 +88,16 @@ Grob::Grob (Grob const &s) self_scm_ = SCM_EOL; immutable_property_alist_ = s.immutable_property_alist_; - mutable_property_alist_ = ly_deep_copy (s.mutable_property_alist_); + mutable_property_alist_ = SCM_EOL; interfaces_ = s.interfaces_; object_alist_ = SCM_EOL; layout_ = 0; smobify_self (); + + mutable_property_alist_ = ly_deep_copy (s.mutable_property_alist_); + } Grob::~Grob () @@ -573,11 +576,24 @@ Grob::fixup_refpoint () MESSAGES ****************************************************************/ void -Grob::warning (string s) const +Grob::programming_error (string s) const { - if (get_program_option ("warning-as-error")) - error (s); + SCM cause = self_scm (); + while (Grob *g = unsmob_grob (cause)) + cause = g->get_property ("cause"); + + /* ES TODO: cause can't be Music*/ + if (Music *m = unsmob_music (cause)) + m->origin ()->programming_error (s); + else if (Stream_event *ev = unsmob_stream_event (cause)) + ev->origin ()->programming_error (s); + else + ::programming_error (s); +} +void +Grob::warning (string s) const +{ SCM cause = self_scm (); while (Grob *g = unsmob_grob (cause)) cause = g->get_property ("cause"); @@ -600,27 +616,6 @@ Grob::name () const return scm_is_symbol (nm) ? ly_symbol2string (nm) : this->class_name (); } -void -Grob::programming_error (string s) const -{ - if (get_program_option ("warning-as-error")) - error (s); - - SCM cause = self_scm (); - while (Grob *g = unsmob_grob (cause)) - cause = g->get_property ("cause"); - - s = _f ("programming error: %s", s); - - /* ES TODO: cause can't be Music*/ - if (Music *m = unsmob_music (cause)) - m->origin ()->message (s); - else if (Stream_event *ev = unsmob_stream_event (cause)) - ev->origin ()->message (s); - else - ::message (s); -} - ADD_INTERFACE (Grob, "A grob represents a piece of music notation.\n" "\n" diff --git a/lily/guile-init.cc b/lily/guile-init.cc index df2f192538..e737dcf706 100644 --- a/lily/guile-init.cc +++ b/lily/guile-init.cc @@ -43,12 +43,12 @@ ly_init_ly_module (void *) for (vsize i = scm_init_funcs_->size (); i--;) (scm_init_funcs_->at (i)) (); - if (be_verbose_global) + if (is_loglevel (LOG_DEBUG)) { - progress_indication ("["); + debug_output ("[", true); scm_display (scm_c_eval_string ("(%search-load-path \"lily.scm\")"), scm_current_error_port ()); - progress_indication ("]\n"); + debug_output ("]\n", false); } scm_primitive_load_path (scm_from_locale_string ("lily.scm")); diff --git a/lily/hairpin.cc b/lily/hairpin.cc index 3962b5e14d..9f5bb1a7e4 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -19,6 +19,7 @@ #include "hairpin.hh" +#include "axis-group-interface.hh" #include "dimensions.hh" #include "international.hh" #include "line-interface.hh" @@ -121,7 +122,7 @@ Hairpin::print (SCM smob) else { bool neighbor_found = false; - Spanner *adjacent; + Spanner *adjacent = NULL; extract_grob_set (me, "adjacent-spanners", neighbors); for (vsize i = 0; i < neighbors.size (); i++) { @@ -140,7 +141,9 @@ Hairpin::print (SCM smob) } } - Interval e = robust_relative_extent (b, common, X_AXIS); + Interval e = (Axis_group_interface::has_interface (b) + ? Axis_group_interface::generic_bound_extent (b, common, X_AXIS) + : robust_relative_extent (b, common, X_AXIS)); if (neighbor_found) { if (Hairpin::has_interface (adjacent)) diff --git a/lily/includable-lexer.cc b/lily/includable-lexer.cc index 6fb6e2054c..15d52a3ae9 100644 --- a/lily/includable-lexer.cc +++ b/lily/includable-lexer.cc @@ -81,13 +81,8 @@ Includable_lexer::new_input (string name, Sources *sources) if (yy_current_buffer) state_stack_.push_back (yy_current_buffer); - if (be_verbose_global) - { - string spaces = ""; - for (size_t i = 0; i < state_stack_.size (); i++) - spaces += " "; - progress_indication (string ("\n") + spaces + string ("[") + file->name_string ()); - } + debug_output (string (state_stack_.size (), ' ') // indentation! + + string ("[") + file->name_string ()); include_stack_.push_back (file); @@ -109,13 +104,8 @@ Includable_lexer::new_input (string name, string data, Sources *sources) if (yy_current_buffer) state_stack_.push_back (yy_current_buffer); - if (be_verbose_global) - { - string spaces = ""; - for (size_t i = 0; i < state_stack_.size (); i++) - spaces += " "; - progress_indication (string ("\n") + spaces + string ("[") + name); - } + debug_output (string (state_stack_.size (), ' ') // indentation! + + string ("[") + name); include_stack_.push_back (file); yy_switch_to_buffer (yy_create_buffer (file->get_istream (), YY_BUF_SIZE)); @@ -135,8 +125,7 @@ Includable_lexer::close_input () { include_stack_.pop_back (); char_count_stack_.pop_back (); - if (be_verbose_global) - progress_indication ("]"); + debug_output ("]", false); yy_delete_buffer (yy_current_buffer); #if HAVE_FLEXLEXER_YY_CURRENT_BUFFER yy_current_buffer = 0; diff --git a/lily/include/axis-group-interface.hh b/lily/include/axis-group-interface.hh index 6eb52c4df2..93d70ee54c 100644 --- a/lily/include/axis-group-interface.hh +++ b/lily/include/axis-group-interface.hh @@ -28,6 +28,7 @@ struct Axis_group_interface { static SCM generic_group_extent (Grob *me, Axis a); + static Interval generic_bound_extent (Grob *me, Grob *common, Axis a); static Interval pure_group_height (Grob *me, int start, int end); DECLARE_SCHEME_CALLBACK (width, (SCM smob)); DECLARE_SCHEME_CALLBACK (calc_x_common, (SCM smob)); @@ -46,6 +47,8 @@ struct Axis_group_interface DECLARE_SCHEME_CALLBACK (calc_pure_y_common, (SCM)); static Interval relative_group_extent (vector const &list, Grob *common, Axis); + static Interval relative_maybe_bound_group_extent (vector const &list, + Grob *common, Axis, bool); static Interval relative_pure_height (Grob *me, int start, int end); static Interval combine_pure_heights (Grob *me, SCM, int, int); static Interval sum_partial_pure_heights (Grob *me, int, int); diff --git a/lily/include/beam.hh b/lily/include/beam.hh index d89c35d6b2..f99fbf8028 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -71,6 +71,7 @@ public: static Interval no_visible_stem_positions (Grob *me, Interval default_value); DECLARE_SCHEME_CALLBACK (rest_collision_callback, (SCM element, SCM prev_off)); + DECLARE_SCHEME_CALLBACK (pure_rest_collision_callback, (SCM element, SCM prev_off, SCM, SCM)); DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (calc_beaming, (SCM)); DECLARE_SCHEME_CALLBACK (calc_stem_shorten, (SCM)); diff --git a/lily/include/bezier.hh b/lily/include/bezier.hh index a144e4a755..839c8ddc8f 100644 --- a/lily/include/bezier.hh +++ b/lily/include/bezier.hh @@ -39,7 +39,10 @@ public: Bezier extract (Real, Real) const; Real get_other_coordinate (Axis a, Real x) const; + vector get_other_coordinates (Axis a, Real x) const; vector solve_point (Axis, Real coordinate) const; + Real minmax (Axis, Real, Real, Direction) const; + Real minmax (Axis, Real, Real, Direction, vsize, vsize) const; vector solve_derivative (Offset) const; Interval extent (Axis) const; Interval control_point_extent (Axis) const; diff --git a/lily/include/input.hh b/lily/include/input.hh index af9dcff3e6..91c15df329 100644 --- a/lily/include/input.hh +++ b/lily/include/input.hh @@ -36,11 +36,12 @@ public: char const *end () const; void set (Source_file *, char const *, char const *); - void warning (string) const; + void error (string) const; void programming_error (string) const; void non_fatal_error (string) const; - void error (string) const; + void warning (string) const; void message (string) const; + void debug_output (string) const; void set_spot (Input const &); void step_forward (); void set_location (Input const &, Input const &); @@ -60,6 +61,8 @@ public: Input (Input const &i); Input (); +protected: + void print_message (int level, string s) const; }; #include "smobs.hh" diff --git a/lily/include/main.hh b/lily/include/main.hh index 8644a3ee17..7c21437b80 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -42,7 +42,6 @@ extern vector start_environment_global; extern string output_backend_global; extern string output_name_global; extern bool be_safe_global; -extern bool be_verbose_global; extern bool do_internal_type_checking_global; extern bool point_and_click_global; extern string lilypond_datadir; diff --git a/lily/include/staff-spacing.hh b/lily/include/staff-spacing.hh index 935bcf5b83..b404e35d5e 100644 --- a/lily/include/staff-spacing.hh +++ b/lily/include/staff-spacing.hh @@ -31,7 +31,7 @@ class Staff_spacing public: DECLARE_GROB_INTERFACE (); - static Spring get_spacing (Grob *, Grob *right_col); + static Spring get_spacing (Grob *, Grob *, Real); static Interval bar_y_positions (Grob *); }; diff --git a/lily/input-scheme.cc b/lily/input-scheme.cc index 1325c8e151..19131271d3 100644 --- a/lily/input-scheme.cc +++ b/lily/input-scheme.cc @@ -29,6 +29,24 @@ LY_DEFINE (ly_input_location_p, "ly:input-location?", 1, 0, 0, return unsmob_input (x) ? SCM_BOOL_T : SCM_BOOL_F; } +LY_DEFINE (ly_input_warning, "ly:input-warning", 2, 0, 1, (SCM sip, SCM msg, SCM rest), + "Print @var{msg} as a GNU compliant warning message, pointing" + " to the location in @var{sip}. @var{msg} is interpreted" + " similar to @code{format}'s argument, using @var{rest}.") +{ + Input *ip = unsmob_input (sip); + + LY_ASSERT_TYPE (unsmob_input, sip, 1); + LY_ASSERT_TYPE (scm_is_string, msg, 2); + + msg = scm_simple_format (SCM_BOOL_F, msg, rest); + + string m = ly_scm2string (msg); + ip->warning (m); + + return SCM_UNSPECIFIED; +} + LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 1, (SCM sip, SCM msg, SCM rest), "Print @var{msg} as a GNU compliant error message, pointing" " to the location in @var{sip}. @var{msg} is interpreted" diff --git a/lily/input.cc b/lily/input.cc index 6cc8a182a5..292e06a449 100644 --- a/lily/input.cc +++ b/lily/input.cc @@ -79,47 +79,61 @@ Input::set_location (Input const &i_start, Input const &i_end) [file:line:column:][warning:]message */ void -Input::message (string s) const +Input::print_message (int level, string s) const { + string location; if (source_file_) - s = location_string () + ": " + s + "\n" - + source_file_->quote_input (start_) + "\n"; - ::message (s); + ::print_message (level, location_string (), + s + "\n" + source_file_->quote_input (start_) + "\n"); + else + ::print_message (level, "", s); +} + +void +Input::error (string s) const +{ + print_message (LOG_ERROR, _f ("error: %s", s)); + // UGH, fix naming or usage (use non_fatal_error in most places, instead) + // exit (1); } void Input::programming_error (string s) const { if (get_program_option ("warning-as-error")) - ::error (s); + error (s); else { - message (_f ("programming error: %s", s.c_str ())); - message (_ ("continuing, cross fingers") + "\n"); + print_message (LOG_ERROR, _f ("programming error: %s", s)); + print_message (LOG_ERROR, _ ("continuing, cross fingers") + "\n"); } } +void +Input::non_fatal_error (string s) const +{ + print_message (LOG_ERROR, _f ("error: %s", s)); +} + void Input::warning (string s) const { if (get_program_option ("warning-as-error")) - ::error (s); + error (s); else - message (_f ("warning: %s", s)); + print_message (LOG_WARN, _f ("warning: %s", s)); } void -Input::error (string s) const +Input::message (string s) const { - message (_f ("error: %s", s)); - // UGH, fix naming or usage - // exit (1); + print_message (LOG_INFO, s); } void -Input::non_fatal_error (string s) const +Input::debug_output (string s) const { - message (_f ("error: %s", s)); + print_message (LOG_DEBUG, s); } string diff --git a/lily/item-scheme.cc b/lily/item-scheme.cc index bd612efdee..11604bb33a 100644 --- a/lily/item-scheme.cc +++ b/lily/item-scheme.cc @@ -31,7 +31,7 @@ LY_DEFINE (ly_item_p, "ly:item?", LY_DEFINE (ly_item_break_dir, "ly:item-break-dir", 1, 0, 0, (SCM it), - "The break status direction of item @var{it}. @code{-1} means" + "The break status direction of item @var{it}. @w{@code{-1}} means" " end of line, @code{0}@tie{}unbroken, and" " @code{1}@tie{}beginning of line.") { diff --git a/lily/item.cc b/lily/item.cc index 4e9818192a..bf67f3c6dd 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -270,7 +270,7 @@ ADD_INTERFACE (Item, "Whether these versions are visible and take up space is" " determined by the outcome of the @code{break-visibility}" " grob property, which is a function taking a direction" - " (@code{-1}, @code{0} or@tie{}@code{1}) as an argument. It" + " (@w{@code{-1}}, @code{0} or@tie{}@code{1}) as an argument. It" " returns a cons of booleans, signifying whether this grob" " should be transparent and have no extent.\n" "\n" diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index 4dec628213..804467fcf6 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -86,7 +86,6 @@ Key_engraver::create_key (bool is_default) && !scm_is_eq (last, key)) { SCM restore = SCM_EOL; - SCM *tail = &restore; for (SCM s = last; scm_is_pair (s); s = scm_cdr (s)) { SCM new_alter_pair = scm_assoc (scm_caar (s), key); @@ -95,8 +94,7 @@ Key_engraver::create_key (bool is_default) || ((ly_scm2rational (scm_cdr (new_alter_pair)) - old_alter) * old_alter < Rational (0))) { - *tail = scm_cons (scm_car (s), *tail); - tail = SCM_CDRLOC (*tail); + restore = scm_cons (scm_car (s), restore); } } @@ -106,7 +104,7 @@ Key_engraver::create_key (bool is_default) key_event_ ? key_event_->self_scm () : SCM_EOL); - cancellation_->set_property ("alteration-alist", scm_reverse (restore)); + cancellation_->set_property ("alteration-alist", restore); cancellation_->set_property ("c0-position", get_property ("middleCPosition")); } diff --git a/lily/lexer.ll b/lily/lexer.ll index 83a7940b69..5743f44964 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -135,7 +135,6 @@ PUNCT [?!:'`] ACCENT \\[`'"^] NATIONAL [\001-\006\021-\027\031\036] TEX {AA}|-|{PUNCT}|{ACCENT}|{NATIONAL} -WORD {A}{AN}* DASHED_WORD {A}({AN}|-)* DASHED_KEY_WORD \\{DASHED_WORD} @@ -148,7 +147,6 @@ E_UNSIGNED \\{N}+ FRACTION {N}+\/{N}+ INT -?{UNSIGNED} REAL ({INT}\.{N}*)|(-?\.{N}+) -KEYWORD \\{WORD} WHITE [ \n\t\f\r] HORIZONTALWHITE [ \t] BLACK [^ \n\t\f\r] @@ -165,7 +163,7 @@ BOM_UTF8 \357\273\277 <*>\r { - // windows-suck-suck-suck + // swallow and ignore carriage returns } {ANY_CHAR} { @@ -192,8 +190,7 @@ BOM_UTF8 \357\273\277 LexerError (_ ("stray UTF-8 BOM encountered").c_str ()); exit (1); } - if (be_verbose_global) - message (_ ("Skipping UTF-8 BOM")); + debug_output (_ ("Skipping UTF-8 BOM")); } { @@ -264,15 +261,15 @@ BOM_UTF8 \357\273\277 this->here_input ().get_source_file ()->set_line (here_input ().start (), i); } -. { +{ANY_CHAR} { LexerError (_ ("quoted string expected after \\version").c_str ()); yy_pop_state (); } -. { +{ANY_CHAR} { LexerError (_ ("quoted string expected after \\sourcefilename").c_str ()); yy_pop_state (); } -. { +{ANY_CHAR} { LexerError (_ ("integer expected after \\sourcefileline").c_str ()); yy_pop_state (); } @@ -285,12 +282,6 @@ BOM_UTF8 \357\273\277 "%"+"}" { yy_pop_state (); } - <> { - LexerError (_ ("EOF found inside a comment").c_str ()); - 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 - } } @@ -314,7 +305,7 @@ BOM_UTF8 \357\273\277 new_input (s, sources_); yy_pop_state (); } -\\{BLACK}*{WHITE} { /* got the include identifier */ +\\{BLACK}*{WHITE}? { /* got the include identifier */ string s = YYText () + 1; strip_trailing_white (s); if (s.length () && (s[s.length () - 1] == ';')) @@ -333,7 +324,7 @@ BOM_UTF8 \357\273\277 scm_display (sid, err); } } -\"[^"]* { // backup rule +\"[^"]* { // backup rule error (_ ("end quote missing")); exit (1); } @@ -420,11 +411,15 @@ BOM_UTF8 \357\273\277 yylval.scm = scan_fraction (YYText ()); return FRACTION; } - {DIGIT} { yylval.i = String_convert::dec2int (string (YYText ())); return DIGIT; } + {UNSIGNED}/\/[^0-9] { // backup rule + yylval.i = String_convert::dec2int (string (YYText ())); + return UNSIGNED; + } + {UNSIGNED}/\/ | // backup rule {UNSIGNED} { yylval.i = String_convert::dec2int (string (YYText ())); return UNSIGNED; @@ -465,6 +460,11 @@ BOM_UTF8 \357\273\277 yylval.scm = scan_fraction (YYText ()); return FRACTION; } + {UNSIGNED}/\/[^0-9] { // backup rule + yylval.i = String_convert::dec2int (string (YYText ())); + return UNSIGNED; + } + {UNSIGNED}/\/ | // backup rule {UNSIGNED} { yylval.i = String_convert::dec2int (string (YYText ())); return UNSIGNED; @@ -505,6 +505,11 @@ BOM_UTF8 \357\273\277 yylval.scm = scan_fraction (YYText ()); return FRACTION; } + {UNSIGNED}/\/[^0-9] { // backup rule + yylval.i = String_convert::dec2int (string (YYText ())); + return UNSIGNED; + } + {UNSIGNED}/\/ | // backup rule {UNSIGNED} { yylval.i = String_convert::dec2int (string (YYText ())); return UNSIGNED; @@ -606,7 +611,14 @@ BOM_UTF8 \357\273\277 } <*><> { - if (is_main_input_) + if (YY_START == longcomment) + { + LexerError (_ ("EOF found inside a comment").c_str ()); + 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 + } + else if (is_main_input_) { /* 2 = init.ly + current file. > because we're before closing, but is_main_input_ should @@ -631,12 +643,7 @@ BOM_UTF8 \357\273\277 } } -{WORD} { - return scan_bare_word (YYText ()); -} -{KEYWORD} { - return scan_escaped_word (YYText () + 1); -} +-{UNSIGNED} | // backup rule {REAL} { Real r; int cnv = sscanf (YYText (), "%lf", &r); @@ -646,6 +653,10 @@ BOM_UTF8 \357\273\277 yylval.scm = scm_from_double (r); return REAL; } +-\. { // backup rule + yylval.scm = scm_from_double (0.0); + return REAL; +} {UNSIGNED} { yylval.i = String_convert::dec2int (string (YYText ())); diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 4d6f6a79c6..ff3f7064bf 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -92,14 +92,12 @@ gulp_file_to_string (string fn, bool must_exist, int size) return s; } - if (be_verbose_global) - progress_indication ("[" + s); + debug_output ("[" + s, true); vector chars = gulp_file (s, size); string result (&chars[0], chars.size ()); - if (be_verbose_global) - progress_indication ("]\n"); + debug_output ("]\n", false); return result; } diff --git a/lily/lily-parser-scheme.cc b/lily/lily-parser-scheme.cc index ceefa6b038..1107af9995 100644 --- a/lily/lily-parser-scheme.cc +++ b/lily/lily-parser-scheme.cc @@ -70,19 +70,18 @@ LY_DEFINE (ly_parse_file, "ly:parse-file", else { File_name out (output_name); - if (is_dir (out.dir_part ())) - { - dir = out.dir_part (); - out_file_name = out.file_part (); - } + dir = out.dir_part (); + out_file_name = out.file_part (); } if (dir != "" && dir != "." && dir != get_working_directory ()) { global_path.prepend (get_working_directory ()); - message (_f ("Changing working directory to: `%s'", - dir.c_str ())); - chdir (dir.c_str ()); + message (_f ("Changing working directory to: `%s'", dir)); + // If we can't change to the output dir (not existing, wrong + // permissions), exit lilypond + if (chdir (dir.c_str ()) != 0) + error (_f ("unable to change directory to: `%s'", dir)); } else out_file_name = File_name (output_name); diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc index b2877211f1..8cdc16b94f 100644 --- a/lily/line-spanner.cc +++ b/lily/line-spanner.cc @@ -24,7 +24,9 @@ #include "item.hh" #include "lily-proto.hh" #include "line-interface.hh" +#include "note-column.hh" #include "output-def.hh" +#include "paper-column.hh" #include "pointer-group-interface.hh" #include "spanner.hh" #include "staff-symbol-referencer.hh" @@ -108,9 +110,16 @@ Line_spanner::calc_bound_info (SCM smob, Direction dir) ? columns[0] : columns.back (); } + Real x_coord = (Paper_column::has_interface (bound_grob) + ? Axis_group_interface::generic_bound_extent (bound_grob, commonx, X_AXIS) + : robust_relative_extent (bound_grob, commonx, X_AXIS)).linear_combination (attach); + + Grob *acc = Note_column::accidentals (bound_grob->get_parent (X_AXIS)); + if (acc && to_boolean (ly_assoc_get (ly_symbol2scm ("end-on-accidental"), details, SCM_BOOL_F))) + x_coord = robust_relative_extent (acc, commonx, X_AXIS).linear_combination (attach); + details = scm_acons (ly_symbol2scm ("X"), - scm_from_double (robust_relative_extent (bound_grob, commonx, X_AXIS) - .linear_combination (attach)), + scm_from_double (x_coord), details); } diff --git a/lily/lyric-combine-music-iterator.cc b/lily/lyric-combine-music-iterator.cc index a6de96f5d3..3b2ee8548d 100644 --- a/lily/lyric-combine-music-iterator.cc +++ b/lily/lyric-combine-music-iterator.cc @@ -221,7 +221,7 @@ Lyric_combine_music_iterator::construct_children () IMPLEMENT_LISTENER (Lyric_combine_music_iterator, check_new_context) void -Lyric_combine_music_iterator::check_new_context (SCM sev) +Lyric_combine_music_iterator::check_new_context (SCM /*sev*/) { if (!ok ()) return; diff --git a/lily/main.cc b/lily/main.cc index d0d21601ec..5b5ea18d08 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -77,9 +77,6 @@ bool be_safe_global = false; /* Provide URI links to the original file */ bool point_and_click_global = true; -/* Verbose progress indication? */ -bool be_verbose_global = false; - /* Scheme code to execute before parsing, after .scm init. This is where -e arguments are appended to. */ string init_scheme_code_global; @@ -169,10 +166,16 @@ static Long_option_init options_static[] "and cd into DIR") }, #endif + { + _i ("LOGLEVEL"), "loglevel", 'l', _i ("print log messages according to" + " LOGLEVEL. Possible values are:\n" + "NONE, ERROR, WARNING, BASIC, PROGRESS, INFO (default) and DEBUG.") + }, {_i ("FILE"), "output", 'o', _i ("write output to FILE (suffix will be added)")}, {0, "relocate", 0, _i ("relocate using directory of lilypond program")}, + {0, "silent", 's', _i ("no progress, only error messages (equivalent to loglevel=ERROR)")}, {0, "version", 'v', _i ("show version number and exit")}, - {0, "verbose", 'V', _i ("be verbose")}, + {0, "verbose", 'V', _i ("be verbose (equivalent to loglevel=DEBUG)")}, {0, "warranty", 'w', _i ("show warranty and copyright")}, {0, 0, 0, 0} }; @@ -404,7 +407,7 @@ main_with_guile (void *, int, char **) prepend_load_path (lilypond_datadir); prepend_load_path (lilypond_datadir + "/scm"); - if (be_verbose_global) + if (is_loglevel (LOG_DEBUG)) dir_info (stderr); init_scheme_variables_global = "(list " + init_scheme_variables_global + ")"; @@ -556,7 +559,13 @@ parse_argv (int argc, char **argv) show_help = true; break; case 'V': - be_verbose_global = true; + set_loglevel (LOGLEVEL_DEBUG); + break; + case 's': + set_loglevel (LOGLEVEL_ERROR); + break; + case 'l': + set_loglevel (option_parser->optional_argument_str0_); break; default: programming_error (to_string ("unhandled short option: %c", @@ -572,7 +581,7 @@ parse_argv (int argc, char **argv) if (show_help) { ly_usage (); - if (be_verbose_global) + if (is_loglevel (LOG_DEBUG)) dir_info (stdout); exit (0); } @@ -610,11 +619,13 @@ main (int argc, char **argv, char **envp) start_environment_global.push_back (*p); if (getenv ("LILYPOND_VERBOSE")) - be_verbose_global = true; + set_loglevel (LOGLEVEL_DEBUG); + if (getenv ("LILYPOND_LOGLEVEL")) + set_loglevel (getenv ("LILYPOND_LOGLEVEL")); setup_localisation (); parse_argv (argc, argv); - if (isatty (STDIN_FILENO)) + if (isatty (STDIN_FILENO) && (is_loglevel (LOG_BASIC))) identify (stderr); setup_paths (argv[0]); diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 72a509cffa..d6142b1890 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -111,11 +111,6 @@ Multi_measure_rest::print (SCM smob) Stencil mol; mol.add_stencil (symbol_stencil (me, space)); - int measure_count = 0; - SCM m (me->get_property ("measure-count")); - if (scm_is_number (m)) - measure_count = scm_to_int (m); - mol.translate_axis (x_off, X_AXIS); return mol.smobbed_copy (); } diff --git a/lily/new-fingering-engraver.cc b/lily/new-fingering-engraver.cc index 6444a06bff..efb898bd54 100644 --- a/lily/new-fingering-engraver.cc +++ b/lily/new-fingering-engraver.cc @@ -259,7 +259,7 @@ New_fingering_engraver::position_scripts (SCM orientations, Grob *f = ft.script_; f->set_parent (ft.head_, X_AXIS); f->set_parent (ft.head_, Y_AXIS); - f->set_property ("avoid-slur", SCM_BOOL_F); + f->set_property ("avoid-slur", ly_symbol2scm ("inside")); if (hordir == LEFT && unsmob_grob (ft.head_->get_object ("accidental-grob"))) Side_position_interface::add_support (f, diff --git a/lily/note-collision.cc b/lily/note-collision.cc index 24c9ce92a4..a9b8cbe441 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -186,7 +186,7 @@ check_meshing_chords (Grob *me, && Rhythmic_head::dot_count (head_up) < Rhythmic_head::dot_count (head_down)) { shift_amount = -1; - if (!touch || full_collide) + if (!touch) // remember to leave clearance between stems stem_to_stem = true; } @@ -213,7 +213,6 @@ check_meshing_chords (Grob *me, && (up_style == ly_symbol2scm ("fa") || up_style == ly_symbol2scm ("faThin")) && (down_style == ly_symbol2scm ("fa") || down_style == ly_symbol2scm ("faThin"))) { - Interval uphead_size = head_up->extent (head_up, Y_AXIS); Offset att = Offset (0.0, -1.0); head_up->set_property ("stem-attachment", ly_offset2scm (att)); head_up->set_property ("transparent", SCM_BOOL_T); diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index 8153af9635..9a71c00a59 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -304,7 +304,6 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, if (beams_drul[LEFT] && beams_drul[LEFT] == beams_drul[RIGHT]) { correction = knee_correction (me, stems_drul[RIGHT], increment); - *fixed += correction; } else { @@ -322,6 +321,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, && !acc_right) correction = same_direction_correction (me, head_posns); + *fixed += correction; *space += correction; /* there used to be a correction for bar_xextent () here, but diff --git a/lily/paper-score.cc b/lily/paper-score.cc index c9c3160260..7041ea61ae 100644 --- a/lily/paper-score.cc +++ b/lily/paper-score.cc @@ -131,10 +131,9 @@ Paper_score::calc_breaking () void Paper_score::process () { - if (be_verbose_global) - message (_f ("Element count %d (spanners %d) ", - system_->element_count (), - system_->spanner_count ())); + debug_output (_f ("Element count %d (spanners %d) ", + system_->element_count (), + system_->spanner_count ())); message (_ ("Preprocessing graphical objects...")); diff --git a/lily/part-combine-iterator.cc b/lily/part-combine-iterator.cc index 4521abc15e..4583d221f6 100644 --- a/lily/part-combine-iterator.cc +++ b/lily/part-combine-iterator.cc @@ -89,7 +89,7 @@ private: Status last_playing_; /* - TODO: this is getting of hand... + TODO: this is getting off hand... */ Context_handle handles_[NUM_OUTLETS]; @@ -135,6 +135,7 @@ Part_combine_iterator::Part_combine_iterator () split_list_ = SCM_EOL; state_ = APART; playing_state_ = APART; + last_playing_ = APART; busy_ = false; notice_busy_ = false; @@ -241,8 +242,7 @@ Part_combine_iterator::unisono (bool silent) Outlet_type c1 = (last_playing_ == SOLO2) ? CONTEXT_NULL : CONTEXT_SHARED; Outlet_type c2 = (last_playing_ == SOLO2) ? CONTEXT_SHARED : CONTEXT_NULL; substitute_both (c1, c2); - kill_mmrest ((last_playing_ == SOLO2) - ? CONTEXT_ONE : CONTEXT_TWO); + kill_mmrest ((last_playing_ == SOLO2) ? CONTEXT_ONE : CONTEXT_TWO); kill_mmrest (CONTEXT_SHARED); if (playing_state_ != UNISONO diff --git a/lily/pdf-scheme.cc b/lily/pdf-scheme.cc index ecfe5c4f01..13e8389ece 100644 --- a/lily/pdf-scheme.cc +++ b/lily/pdf-scheme.cc @@ -58,11 +58,11 @@ LY_DEFINE (ly_encode_string_for_pdf, "ly:encode-string-for-pdf", * though), we have to prepend it manually. */ if (g_without_BOM) // conversion to UTF-16be might have failed (shouldn't!) { - g = new char[bytes_written + 3]; + g = (char*)malloc ( sizeof(char) * (bytes_written + 3)); char const *BOM = "\xFE\xFF"; strcpy (g, BOM); memcpy (&g[2], g_without_BOM, bytes_written + 1); // Copy string + \0 - free (g_without_BOM); + g_free (g_without_BOM); bytes_written += 2; } } diff --git a/lily/performance.cc b/lily/performance.cc index 1bc547a5a8..017b75619c 100644 --- a/lily/performance.cc +++ b/lily/performance.cc @@ -51,17 +51,14 @@ Performance::output (Midi_stream &midi_stream) const int tracks_ = audio_staffs_.size (); midi_stream.write (Midi_header (1, tracks_, 384)); - if (be_verbose_global) - progress_indication (_ ("Track...") + " "); + debug_output (_ ("Track...") + " ", false); for (vsize i = 0; i < audio_staffs_.size (); i++) { Audio_staff *s = audio_staffs_[i]; - if (be_verbose_global) - progress_indication ("[" + to_string (i)); + debug_output ("[" + to_string (i), true); s->output (midi_stream, i, ports_); - if (be_verbose_global) - progress_indication ("]"); + debug_output ("]", false); } } diff --git a/lily/pfb-scheme.cc b/lily/pfb-scheme.cc index 34d159cf04..f8a6c1278f 100644 --- a/lily/pfb-scheme.cc +++ b/lily/pfb-scheme.cc @@ -15,8 +15,7 @@ LY_DEFINE (ly_pfb_2_pfa, "ly:pfb->pfa", string file_name = ly_scm2string (pfb_file_name); - if (be_verbose_global) - progress_indication ("\n[" + file_name); + debug_output ("[" + file_name); // start message on a new line vector pfb_string = gulp_file (file_name, 0); char *pfa = pfb2pfa ((Byte *) &pfb_string[0], pfb_string.size ()); @@ -24,8 +23,7 @@ LY_DEFINE (ly_pfb_2_pfa, "ly:pfb->pfa", SCM pfa_scm = scm_from_locale_string (pfa); free (pfa); - if (be_verbose_global) - progress_indication ("]"); + debug_output ("]", false); return pfa_scm; } @@ -38,8 +36,7 @@ LY_DEFINE (ly_otf_2_cff, "ly:otf->cff", LY_ASSERT_TYPE (scm_is_string, otf_file_name, 1); string file_name = ly_scm2string (otf_file_name); - if (be_verbose_global) - progress_indication ("\n[" + file_name); + debug_output ("[" + file_name); // start message on a new line FT_Face face = open_ft_face (file_name, 0 /* index */); string table = get_otf_table (face, "CFF "); @@ -47,8 +44,7 @@ LY_DEFINE (ly_otf_2_cff, "ly:otf->cff", SCM asscm = scm_from_locale_stringn ((char *) table.data (), table.length ()); - if (be_verbose_global) - progress_indication ("]"); + debug_output ("]", false); return asscm; } diff --git a/lily/phrasing-slur-engraver.cc b/lily/phrasing-slur-engraver.cc index 4805960042..8882a64285 100644 --- a/lily/phrasing-slur-engraver.cc +++ b/lily/phrasing-slur-engraver.cc @@ -51,6 +51,7 @@ class Phrasing_slur_engraver : public Engraver vector stop_events_; vector slurs_; vector end_slurs_; + vector objects_to_acknowledge_; protected: DECLARE_TRANSLATOR_LISTENER (phrasing_slur); @@ -103,7 +104,7 @@ Phrasing_slur_engraver::acknowledge_note_column (Grob_info info) void Phrasing_slur_engraver::acknowledge_extra_object (Grob_info info) { - Slur::auxiliary_acknowledge_extra_object (info, slurs_, end_slurs_); + objects_to_acknowledge_.push_back (info); } void @@ -209,9 +210,13 @@ Phrasing_slur_engraver::process_music () void Phrasing_slur_engraver::stop_translation_timestep () { + for (vsize i = 0; i < objects_to_acknowledge_.size (); i++) + Slur::auxiliary_acknowledge_extra_object (objects_to_acknowledge_[i], slurs_, end_slurs_); + end_slurs_.clear (); start_events_.clear (); stop_events_.clear (); + objects_to_acknowledge_.clear (); } ADD_ACKNOWLEDGER (Phrasing_slur_engraver, accidental); diff --git a/lily/program-option-scheme.cc b/lily/program-option-scheme.cc index 976d51062c..1071d14d7d 100644 --- a/lily/program-option-scheme.cc +++ b/lily/program-option-scheme.cc @@ -247,10 +247,10 @@ LY_DEFINE (ly_command_line_code, "ly:command-line-code", 0, 0, 0, (), return ly_string2scm (init_scheme_code_global); } -LY_DEFINE (ly_command_line_verbose_p, "ly:command-line-verbose?", 0, 0, 0, (), - "Was @code{be_verbose_global} set?") +LY_DEFINE (ly_verbose_output_p, "ly:verbose-output?", 0, 0, 0, (), + "Was verbose output requested, i.e. loglevel at least @code{DEBUG}?") { - return scm_from_bool (be_verbose_global); + return scm_from_bool (is_loglevel (LOG_DEBUG)); } LY_DEFINE (ly_all_options, "ly:all-options", diff --git a/lily/relocate.cc b/lily/relocate.cc index 964e02941d..a4e75d2ae5 100644 --- a/lily/relocate.cc +++ b/lily/relocate.cc @@ -49,9 +49,8 @@ sane_putenv (char const *key, string value, bool overwrite) string combine = string (key) + "=" + value; char *s = strdup (combine.c_str ()); - if (be_verbose_global) - progress_indication (_f ("Setting %s to %s", key, value.c_str ()) - + "\n"); + debug_output (_f ("Setting %s to %s", key, value.c_str ()) + + "\n"); int retval = putenv (s); /* @@ -69,7 +68,8 @@ set_env_file (char const *key, string value, bool overwrite = false) { if (is_file (value)) return sane_putenv (key, value, overwrite); - else if (be_verbose_global) + else if (is_loglevel (LOG_DEBUG)) + // this warning should only be printed in debug mode! warning (_f ("no such file: %s for %s", value, key)); return -1; } @@ -79,7 +79,8 @@ set_env_dir (char const *key, string value) { if (is_dir (value)) return sane_putenv (key, value, false); - else if (be_verbose_global) + else if (is_loglevel (LOG_DEBUG)) + // this warning should only be printed in debug mode! warning (_f ("no such directory: %s for %s", value, key)); return -1; } @@ -89,15 +90,15 @@ prepend_env_path (char const *key, string value) { if (is_dir (value)) { - if (be_verbose_global) - progress_indication (_f ("%s=%s (prepend)\n", key, value.c_str ())); + debug_output (_f ("%s=%s (prepend)\n", key, value.c_str ()), false); if (char const *cur = getenv (key)) value += to_string (PATHSEP) + cur; return sane_putenv (key, value.c_str (), true); } - else if (be_verbose_global) + else if (is_loglevel (LOG_DEBUG)) + // this warning should only be printed in debug mode warning (_f ("no such directory: %s for %s", value, key)); return -1; } @@ -130,10 +131,9 @@ prefix_relocation (string prefix) prepend_env_path ("PATH", bindir); - if (be_verbose_global) - warning (_f ("Relocation: compile datadir=%s, new datadir=%s", - old_lilypond_datadir.c_str (), - lilypond_datadir.c_str ())); + debug_output (_f ("Relocation: compile datadir=%s, new datadir=%s", + old_lilypond_datadir.c_str (), + lilypond_datadir.c_str ())); } /* @@ -143,8 +143,7 @@ prefix_relocation (string prefix) static void framework_relocation (string prefix) { - if (be_verbose_global) - warning (_f ("Relocation: framework_prefix=%s", prefix)); + debug_output (_f ("Relocation: framework_prefix=%s", prefix)); sane_putenv ("INSTALLER_PREFIX", prefix, true); @@ -184,15 +183,13 @@ setup_paths (char const *argv0_ptr) if (argv0_filename.is_absolute ()) { argv0_abs = argv0_filename.to_string (); - if (be_verbose_global) - warning (_f ("Relocation: is absolute: argv0=%s", argv0_ptr)); + debug_output (_f ("Relocation: is absolute: argv0=%s\n", argv0_ptr)); } else if (argv0_filename.dir_.length ()) { argv0_abs = get_working_directory () + "/" + string (argv0_filename.to_string ()); - if (be_verbose_global) - warning (_f ("Relocation: from cwd: argv0=%s", argv0_ptr)); + debug_output (_f ("Relocation: from cwd: argv0=%s\n", argv0_ptr)); } else { @@ -208,9 +205,8 @@ setup_paths (char const *argv0_ptr) argv0_abs = path.find (argv0_filename.to_string (), ext); #endif /* __MINGW32__ */ - if (be_verbose_global) - warning (_f ("Relocation: from PATH=%s\nargv0=%s", - path.to_string ().c_str (), argv0_ptr)); + debug_output (_f ("Relocation: from PATH=%s\nargv0=%s", + path.to_string ().c_str (), argv0_ptr), true); if (argv0_abs.empty ()) programming_error ("cannot find absolute argv0"); @@ -361,10 +357,7 @@ read_line (FILE *f) void read_relocation_file (string filename) { - if (be_verbose_global) - progress_indication (_f ("Relocation file: %s", filename.c_str ()) - + "\n"); - + debug_output (_f ("Relocation file: %s", filename.c_str ()) + "\n"); char const *cname = filename.c_str (); FILE *f = fopen (cname, "r"); if (!f) diff --git a/lily/rest.cc b/lily/rest.cc index 97deba3f8f..0115e5176f 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -52,7 +52,8 @@ Rest::y_offset_callback (SCM smob) amount += ss / 2; if (!position_override) - amount += 2 * ss * get_grob_direction (me);; + amount += 2 * ss * get_grob_direction (me); + return scm_from_double (amount); } diff --git a/lily/rhythmic-column-engraver.cc b/lily/rhythmic-column-engraver.cc index d02a985cf2..985b7b08a7 100644 --- a/lily/rhythmic-column-engraver.cc +++ b/lily/rhythmic-column-engraver.cc @@ -56,7 +56,6 @@ class Rhythmic_column_engraver : public Engraver vector rheads_; Grob *stem_; Grob *note_column_; - Grob *dotcol_; Grob *arpeggio_; TRANSLATOR_DECLARATIONS (Rhythmic_column_engraver); @@ -102,7 +101,10 @@ Rhythmic_column_engraver::process_acknowledged () } if (arpeggio_) - note_column_->set_object ("arpeggio", arpeggio_->self_scm ()); + { + Pointer_group_interface::add_grob (note_column_, ly_symbol2scm ("elements"), arpeggio_); + note_column_->set_object ("arpeggio", arpeggio_->self_scm ()); + } } } diff --git a/lily/separation-item.cc b/lily/separation-item.cc index fc22dd50f2..ac14f7cf85 100644 --- a/lily/separation-item.cc +++ b/lily/separation-item.cc @@ -113,19 +113,7 @@ Separation_item::boxes (Grob *me, Grob *left) if (left) elts = Accidental_placement::get_relevant_accidentals (read_only_elts, left); else - { - elts = read_only_elts; - - /* This is a special-case for NoteColumn: we want to include arpeggio in its - skyline (so spacing takes it into account) but we don't want to include it - in the NoteColumn's extent because some spanners (eg. Hairpin) bound themselves - on the NoteColumn and we don't want them to include arpeggios in their bounds. - */ - if (Grob *a = Note_column::arpeggio (me)) - { - elts.push_back (a); - } - } + elts = read_only_elts; Grob *ycommon = common_refpoint_of_array (elts, me, Y_AXIS); diff --git a/lily/sequential-iterator.cc b/lily/sequential-iterator.cc index 2f0dd51876..5ba7a59ddf 100644 --- a/lily/sequential-iterator.cc +++ b/lily/sequential-iterator.cc @@ -55,7 +55,7 @@ Sequential_iterator::get_music_list () const { Music *m = get_music (); SCM proc = m->get_property ("elements-callback"); - if (scm_procedure_p (proc)) + if (ly_is_procedure (proc)) return scm_call_1 (proc, m->self_scm ()); else return SCM_EOL; diff --git a/lily/skyline.cc b/lily/skyline.cc index b5288e2526..b6ea6b791b 100644 --- a/lily/skyline.cc +++ b/lily/skyline.cc @@ -392,7 +392,7 @@ Skyline::Skyline (Direction sky) added to it. */ -Skyline::Skyline (Skyline const &src, Real horizon_padding, Axis a) +Skyline::Skyline (Skyline const &src, Real horizon_padding, Axis /*a*/) { /* We extract boxes from the skyline, then build a new skyline from @@ -406,6 +406,7 @@ Skyline::Skyline (Skyline const &src, Real horizon_padding, Axis a) list boxes; // establish a baseline box + // FIXME: This has hardcoded logic, assuming a == X_AXIS! boxes.push_back (Box (Interval (-infinity_f, infinity_f), Interval (0, 0))); list::const_iterator end = src.buildings_.end (); diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index 98f0bbf336..bd1a90a07b 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -51,6 +51,7 @@ class Slur_engraver : public Engraver vector stop_events_; vector slurs_; vector end_slurs_; + vector objects_to_acknowledge_; void set_melisma (bool); @@ -110,7 +111,7 @@ Slur_engraver::acknowledge_note_column (Grob_info info) void Slur_engraver::acknowledge_extra_object (Grob_info info) { - Slur::auxiliary_acknowledge_extra_object (info, slurs_, end_slurs_); + objects_to_acknowledge_.push_back (info); } void @@ -242,6 +243,11 @@ Slur_engraver::stop_translation_timestep () s->set_bound (RIGHT, unsmob_grob (get_property ("currentMusicalColumn"))); announce_end_grob (s, SCM_EOL); } + + for (vsize i = 0; i < objects_to_acknowledge_.size (); i++) + Slur::auxiliary_acknowledge_extra_object (objects_to_acknowledge_[i], slurs_, end_slurs_); + + objects_to_acknowledge_.clear (); end_slurs_.clear (); start_events_.clear (); stop_events_.clear (); diff --git a/lily/slur.cc b/lily/slur.cc index 32149e8412..964a4d091b 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -279,42 +279,47 @@ Slur::outside_slur_callback (SCM grob, SCM offset_scm) 0.0); yext.widen (slur_padding); - const Real EPS = 1e-3; - Interval bezext (curve.control_[0][X_AXIS], curve.control_[3][X_AXIS]); - bool consider[] = {false, false, false}; - Real ys[] = {0, 0, 0}; + Interval exts[] = {xext, yext}; bool do_shift = false; - - for (int d = LEFT, k = 0; d <= RIGHT; d++, k++) + Real EPS = 1.0e-5; + if (avoid == ly_symbol2scm ("outside")) { - Real x = xext.linear_combination ((Direction) d); - consider[k] = bezext.contains (x); - - if (consider[k]) + Direction d = LEFT; + do { - ys[k] - = (fabs (bezext[LEFT] - x) < EPS) - ? curve.control_[0][Y_AXIS] - : ((fabs (bezext[RIGHT] - x) < EPS) - ? curve.control_[3][Y_AXIS] - : curve.get_other_coordinate (X_AXIS, x)); - - /* Request shift if slur is contained script's Y, or if - script is inside slur and avoid == outside. */ - if (yext.contains (ys[k]) - || (dir * ys[k] > dir * yext[-dir] && avoid == ly_symbol2scm ("outside"))) - do_shift = true; + Real x = minmax (-d, xext[d], curve.control_[d == LEFT ? 0 : 3][X_AXIS] + -d * EPS); + Real y = curve.get_other_coordinate (X_AXIS, x); + do_shift = y == minmax (dir, yext[-dir], y); + if (do_shift) + break; } + while (flip (&d) != LEFT); } - - Real avoidance_offset = 0.0; - if (do_shift) + else { - for (int d = LEFT, k = 0; d <= RIGHT; d++, k++) - if (consider[k]) - avoidance_offset = dir * (max (dir * avoidance_offset, - dir * (ys[k] - yext[-dir] + dir * slur_padding))); + for (int a = X_AXIS; a < NO_AXES; a++) + { + Direction d = LEFT; + do + { + vector coords = curve.get_other_coordinates (Axis (a), exts[a][d]); + for (vsize i = 0; i < coords.size (); i++) + { + do_shift = exts[(a + 1) % NO_AXES].contains (coords[i]); + if (do_shift) + break; + } + if (do_shift) + break; + } + while (flip (&d) != LEFT); + if (do_shift) + break; + } } + + Real avoidance_offset = do_shift ? curve.minmax (X_AXIS, max (xext[LEFT], curve.control_[0][X_AXIS] + EPS), min (xext[RIGHT], curve.control_[3][X_AXIS] - EPS), dir) - yext[-dir] : 0.0; + return scm_from_double (offset + avoidance_offset); } diff --git a/lily/source-file.cc b/lily/source-file.cc index b42fb7a5b3..041c046d2b 100644 --- a/lily/source-file.cc +++ b/lily/source-file.cc @@ -261,7 +261,11 @@ Source_file::get_counts (char const *pos_str0, int *column, int *byte_offset) const { + // Initialize arguments to defaults, needed if pos_str0 is not in source *line_number = 0; + *line_char = 0; + *column = 0; + *byte_offset = 0; if (!contains (pos_str0)) return; @@ -276,10 +280,6 @@ Source_file::get_counts (char const *pos_str0, string line_begin (line_start, left); char const *line_chars = line_begin.c_str (); - *line_char = 0; - *column = 0; - *byte_offset = 0; - while (left > 0) { size_t thislen = utf8_char_len (*line_chars); diff --git a/lily/spacing-determine-loose-columns.cc b/lily/spacing-determine-loose-columns.cc index 79551ecac3..99d9e596af 100644 --- a/lily/spacing-determine-loose-columns.cc +++ b/lily/spacing-determine-loose-columns.cc @@ -163,7 +163,7 @@ Spacing_spanner::set_distances_for_loose_col (Grob *me, Grob *c, } else if (Staff_spacing::has_interface (sp)) { - Spring spring = Staff_spacing::get_spacing (sp, rc); + Spring spring = Staff_spacing::get_spacing (sp, rc, 0.0); dists[d] = max (dists[d], spring.min_distance ()); } diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc index c9049f3398..b2d25f0713 100644 --- a/lily/spacing-engraver.cc +++ b/lily/spacing-engraver.cc @@ -219,7 +219,6 @@ Spacing_engraver::stop_translation_timestep () Stream_event *ev = playing_durations_[i].info_.event_cause (); if (ev) { - Moment now = now_mom (); Moment m = get_event_length (ev); shortest_playing = min (shortest_playing, m); } diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 75dc166925..b09384f7df 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -495,6 +495,12 @@ Spacing_spanner::breakable_column_spacing (Grob *me, Item *l, Item *r, vector springs; Spring spring; + Real full_measure_space = 0.0; + if (Paper_column::is_musical (r) + && l->break_status_dir () == CENTER + && fills_measure (me, l, r)) + full_measure_space = robust_scm2double (l->get_property ("full-measure-extra-space"), 1.0); + Moment dt = Paper_column::when_mom (r) - Paper_column::when_mom (l); if (dt == Moment (0, 0)) @@ -514,7 +520,8 @@ Spacing_spanner::breakable_column_spacing (Grob *me, Item *l, Item *r, */ assert (spacing_grob->get_column () == l); - springs.push_back (Staff_spacing::get_spacing (spacing_grob, r)); + springs.push_back (Staff_spacing::get_spacing (spacing_grob, r, + full_measure_space)); } } @@ -533,15 +540,6 @@ Spacing_spanner::breakable_column_spacing (Grob *me, Item *l, Item *r, spring *= 0.8; } - if (Paper_column::is_musical (r) - && l->break_status_dir () == CENTER - && fills_measure (me, l, r)) - { - Real full_measure_extra_space = robust_scm2double (l->get_property ("full-measure-extra-space"), 1.0); - spring.set_distance (spring.distance () + full_measure_extra_space); - spring.set_default_compress_strength (); - } - if (options->stretch_uniformly_ && l->break_status_dir () != RIGHT) { spring.set_min_distance (0.0); diff --git a/lily/spanner-scheme.cc b/lily/spanner-scheme.cc index 65c1c261cd..f1a206b69a 100644 --- a/lily/spanner-scheme.cc +++ b/lily/spanner-scheme.cc @@ -23,7 +23,7 @@ LY_DEFINE (ly_spanner_bound, "ly:spanner-bound", 2, 0, 0, (SCM spanner, SCM dir), - "Get one of the bounds of @var{spanner}. @var{dir} is @code{-1}" + "Get one of the bounds of @var{spanner}. @var{dir} is @w{@code{-1}}" " for left, and @code{1} for right.") { LY_ASSERT_TYPE (unsmob_spanner, spanner, 1); diff --git a/lily/staff-spacing.cc b/lily/staff-spacing.cc index 2a216bdc6e..7c4ece4643 100644 --- a/lily/staff-spacing.cc +++ b/lily/staff-spacing.cc @@ -124,7 +124,7 @@ Staff_spacing::next_notes_correction (Grob *me, We arrange things so that the fixed distance will be attained when the line is compressed with a force of 1.0 */ Spring -Staff_spacing::get_spacing (Grob *me, Grob *right_col) +Staff_spacing::get_spacing (Grob *me, Grob *right_col, Real situational_space) { Item *me_item = dynamic_cast (me); Grob *left_col = me_item->get_column (); @@ -151,7 +151,7 @@ Staff_spacing::get_spacing (Grob *me, Grob *right_col) } SCM alist = last_grob->get_property ("space-alist"); - if (!scm_list_p (alist)) + if (!ly_is_list (alist)) return Spring (); SCM space_def = scm_sloppy_assq (ly_symbol2scm ("first-note"), alist); @@ -195,18 +195,26 @@ Staff_spacing::get_spacing (Grob *me, Grob *right_col) ideal = fixed; } + Real stretchability = ideal - fixed; + + /* 'situational_space' passed by the caller + could include full-measure-extra-space */ + ideal += situational_space; + Real optical_correction = next_notes_correction (me, last_grob); + fixed += optical_correction; + ideal += optical_correction; + Real min_dist = Paper_column::minimum_distance (left_col, right_col); /* ensure that the "fixed" distance will leave a gap of at least 0.3 ss. */ Real min_dist_correction = max (0.0, 0.3 + min_dist - fixed); - Real correction = max (optical_correction, min_dist_correction); - - fixed += correction; - ideal += correction; + fixed += min_dist_correction; + ideal = max (ideal, fixed); Spring ret (ideal, min_dist); - ret.set_inverse_stretch_strength (max (0.0, ideal - fixed)); + ret.set_inverse_stretch_strength (max (0.0, stretchability)); + ret.set_inverse_compress_strength (max (0.0, ideal - fixed)); return ret; } diff --git a/lily/stencil-scheme.cc b/lily/stencil-scheme.cc index 958bcc44c8..629c76c98b 100644 --- a/lily/stencil-scheme.cc +++ b/lily/stencil-scheme.cc @@ -92,17 +92,14 @@ LY_DEFINE (ly_stencil_empty_p, "ly:stencil-empty?", } LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge", - 4, 2, 0, (SCM first, SCM axis, SCM direction, + 4, 1, 0, (SCM first, SCM axis, SCM direction, SCM second, - SCM padding, - SCM minimum), + SCM padding), "Construct a stencil by putting @var{second} next to @var{first}." " @var{axis} can be 0 (x-axis) or@tie{}1 (y-axis)." " @var{direction} can be -1 (left or down) or@tie{}1 (right or" - " up). The stencils are juxtaposed with @var{padding} as extra" - " space. If this puts the reference points closer than" - " @var{minimum}, they are moved by the latter amount." - " @var{first} and @var{second} may also be @code{'()} or" + " up). The stencils are juxtaposed with @var{padding} as extra" + " space. @var{first} and @var{second} may also be @code{'()} or" " @code{#f}.") { Stencil *s1 = unsmob_stencil (first); @@ -122,12 +119,6 @@ LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge", LY_ASSERT_TYPE (scm_is_number, padding, 5); p = scm_to_double (padding); } - Real m = 0.0; - if (minimum != SCM_UNDEFINED) - { - LY_ASSERT_TYPE (scm_is_number, minimum, 6); - m = scm_to_double (minimum); - } if (s1) result = *s1; @@ -210,7 +201,7 @@ LY_DEFINE (ly_make_stencil, "ly:make-stencil", LY_DEFINE (ly_stencil_aligned_to, "ly:stencil-aligned-to", 3, 0, 0, (SCM stil, SCM axis, SCM dir), "Align @var{stil} using its own extents. @var{dir} is a number." - " @code{-1} and @code{1} are left and right, respectively." + " @w{@code{-1}} and @code{1} are left and right, respectively." " Other values are interpolated (so @code{0} means the center).") { LY_ASSERT_SMOB (Stencil, stil, 1); diff --git a/lily/system.cc b/lily/system.cc index 8a071cce90..5d3c0e3347 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -197,8 +197,7 @@ System::do_break_substitution_and_fixup_refpoints () } } - if (be_verbose_global) - message (_f ("Element count %d", count + element_count ()) + "\n"); + debug_output (_f ("Element count %d", count + element_count ()) + "\n"); } SCM @@ -216,16 +215,14 @@ System::get_paper_systems () SCM lines = scm_c_make_vector (broken_intos_.size (), SCM_EOL); for (vsize i = 0; i < broken_intos_.size (); i++) { - if (be_verbose_global) - progress_indication ("["); + debug_output ("[", false); System *system = dynamic_cast (broken_intos_[i]); scm_vector_set_x (lines, scm_from_int (i), system->get_paper_system ()); - if (be_verbose_global) - progress_indication (to_string (i) + "]"); + debug_output (to_string (i) + "]", false); } return lines; } @@ -398,8 +395,7 @@ System::pre_processing () for (vsize i = 0; i < all_elements_->size (); i++) all_elements_->grob (i)->discretionary_processing (); - if (be_verbose_global) - message (_f ("Grob count %d", element_count ())); + debug_output (_f ("Grob count %d", element_count ())); /* order is significant: broken grobs are added to the end of the diff --git a/lily/tie-performer.cc b/lily/tie-performer.cc index c53ddeac7b..85a0b07d74 100644 --- a/lily/tie-performer.cc +++ b/lily/tie-performer.cc @@ -110,8 +110,7 @@ Tie_performer::acknowledge_audio_element (Audio_element_info inf) // (*it).moment_ already stores the end of the tied note! Moment skip = now_mom () - (*it).end_moment_; an->tie_to (th, skip); - // this invalidates the iterator, we are leaving the loop anyway - heads_to_tie_.erase (it); + it = heads_to_tie_.erase (it); } } } diff --git a/lily/tie.cc b/lily/tie.cc index b52f84db0f..078d4fc5dd 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -189,7 +189,6 @@ Tie::get_default_control_points (Grob *me_grob) Tie_formatting_problem problem; problem.from_tie (me); - Tie_specification spec = problem.get_tie_specification (0); if (!me->is_live ()) return SCM_EOL; diff --git a/lily/ttf.cc b/lily/ttf.cc index 932f7a6c95..18f1dcd0b6 100644 --- a/lily/ttf.cc +++ b/lily/ttf.cc @@ -515,8 +515,7 @@ LY_DEFINE (ly_ttf_ps_name, "ly:ttf-ps-name", } string file_name = ly_scm2string (ttf_file_name); - if (be_verbose_global) - progress_indication ("\n[" + file_name); + debug_output ("\n[" + file_name, false); FT_Face face; @@ -538,8 +537,7 @@ LY_DEFINE (ly_ttf_ps_name, "ly:ttf-ps-name", SCM ps_name = scm_from_locale_string (ps_name_str0 ? ps_name_str0 : ""); FT_Done_Face (face); - if (be_verbose_global) - progress_indication ("]"); + debug_output ("]", false); return ps_name; } @@ -567,8 +565,7 @@ LY_DEFINE (ly_ttf_2_pfa, "ly:ttf->pfa", } string file_name = ly_scm2string (ttf_file_name); - if (be_verbose_global) - progress_indication ("\n[" + file_name); + debug_output ("[" + file_name); // Debug message should start on a new line Memory_out_stream stream; @@ -576,8 +573,7 @@ LY_DEFINE (ly_ttf_2_pfa, "ly:ttf->pfa", SCM asscm = scm_from_locale_stringn (stream.get_string (), stream.get_length ()); - if (be_verbose_global) - progress_indication ("]"); + debug_output ("]", false); return asscm; } diff --git a/lily/warn-scheme.cc b/lily/warn-scheme.cc new file mode 100644 index 0000000000..1587d7f5ab --- /dev/null +++ b/lily/warn-scheme.cc @@ -0,0 +1,138 @@ +/* + This file is part of LilyPond, the GNU music typesetter. + + Copyright (C) 1998--2011 Jan Nieuwenhuizen + Han-Wen Nienhuys + + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . +*/ + +#include "config.hh" + +#include "lily-guile.hh" +#include "program-option.hh" +#include "version.hh" +#include "warn.hh" + +/* + Error / warning / progress / debug message output functions +*/ + +LY_DEFINE (ly_error, "ly:error", + 1, 0, 1, (SCM str, SCM rest), + "A Scheme callable function to issue the error @var{str}." + " The error is formatted with @code{format} and @var{rest}.") +{ + LY_ASSERT_TYPE (scm_is_string, str, 1); + str = scm_simple_format (SCM_BOOL_F, str, rest); + error (ly_scm2string (str)); + return SCM_UNSPECIFIED; +} + +LY_DEFINE (ly_programming_error, "ly:programming-error", + 1, 0, 1, (SCM str, SCM rest), + "A Scheme callable function to issue the internal warning" + " @var{str}. The message is formatted with @code{format}" + " and @var{rest}.") +{ + LY_ASSERT_TYPE (scm_is_string, str, 1); + str = scm_simple_format (SCM_BOOL_F, str, rest); + + if (get_program_option ("warning-as-error")) + error (ly_scm2string (str)); + else + programming_error (ly_scm2string (str)); + + return SCM_UNSPECIFIED; +} + +LY_DEFINE (ly_warning, "ly:warning", + 1, 0, 1, (SCM str, SCM rest), + "A Scheme callable function to issue the warning @var{str}." + " The message is formatted with @code{format} and @var{rest}.") +{ + LY_ASSERT_TYPE (scm_is_string, str, 1); + str = scm_simple_format (SCM_BOOL_F, str, rest); + + if (get_program_option ("warning-as-error")) + error (ly_scm2string (str)); + else + warning (ly_scm2string (str)); + + return SCM_UNSPECIFIED; +} + +LY_DEFINE (ly_progress, "ly:progress", + 1, 0, 1, (SCM str, SCM rest), + "A Scheme callable function to print progress @var{str}." + " The message is formatted with @code{format} and @var{rest}.") +{ + LY_ASSERT_TYPE (scm_is_string, str, 1); + str = scm_simple_format (SCM_BOOL_F, str, rest); + // Calls to ly:progress should in general not start a new line + progress_indication (ly_scm2string (str), false); + return SCM_UNSPECIFIED; +} + +LY_DEFINE (ly_success, "ly:success", + 1, 0, 1, (SCM str, SCM rest), + "A Scheme callable function to issue a success message @var{str}." + " The message is formatted with @code{format} and @var{rest}.") +{ + LY_ASSERT_TYPE (scm_is_string, str, 1); + str = scm_simple_format (SCM_BOOL_F, str, rest); + successful (ly_scm2string (str)); + return SCM_UNSPECIFIED; +} + +LY_DEFINE (ly_message, "ly:message", + 1, 0, 1, (SCM str, SCM rest), + "A Scheme callable function to issue the message @var{str}." + " The message is formatted with @code{format} and @var{rest}.") +{ + LY_ASSERT_TYPE (scm_is_string, str, 1); + str = scm_simple_format (SCM_BOOL_F, str, rest); + message (ly_scm2string (str)); + return SCM_UNSPECIFIED; +} + +LY_DEFINE (ly_debug, "ly:debug", + 1, 0, 1, (SCM str, SCM rest), + "A Scheme callable function to issue a debug message @var{str}." + " The message is formatted with @code{format} and @var{rest}.") +{ + // TODO: Add the newline flag! + LY_ASSERT_TYPE (scm_is_string, str, 1); + str = scm_simple_format (SCM_BOOL_F, str, rest); + debug_output (ly_scm2string (str)); + return SCM_UNSPECIFIED; +} + +LY_DEFINE (ly_warning_located, "ly:warning-located", + 2, 0, 1, (SCM location, SCM str, SCM rest), + "A Scheme callable function to issue the warning @var{str} at" + " the specified location in an input file." + " The message is formatted with @code{format} and @var{rest}.") +{ + LY_ASSERT_TYPE (scm_is_string, location, 1); + LY_ASSERT_TYPE (scm_is_string, str, 2); + str = scm_simple_format (SCM_BOOL_F, str, rest); + + if (get_program_option ("warning-as-error")) + error (ly_scm2string (str), ly_scm2string (location)); + else + warning (ly_scm2string (str), ly_scm2string (location)); + + return SCM_UNSPECIFIED; +} diff --git a/ly/arabic.ly b/ly/arabic.ly index 3ff4029fd6..1f6792c9ce 100644 --- a/ly/arabic.ly +++ b/ly/arabic.ly @@ -25,7 +25,7 @@ dwn = { (ly:stencil-combine-at-edge (ly:accidental-interface::print grob) Y UP (grob-interpret-markup grob (markup #:line - (#:fontsize -1 (#:musicglyph "flags.ugrace")))) -1.3 0)) + (#:fontsize -1 (#:musicglyph "flags.ugrace")))) -1.3)) } % diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index 2278f85a26..e6b8a97f58 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -172,7 +172,7 @@ barNumberCheck = (lambda (c) (let ((cbn (ly:context-property c 'currentBarNumber))) (if (and (number? cbn) (not (= cbn n))) - (ly:input-message location + (ly:input-warning location "Barcheck failed got ~a expect ~a" cbn n)))))) @@ -433,7 +433,7 @@ instrumentSwitch = (instrument-def (if handle (cdr handle) '()))) (if (not handle) - (ly:input-message location "No such instrument: ~a" name)) + (ly:input-warning location "No such instrument: ~a" name)) (context-spec-music (make-music 'SimultaneousMusic 'elements @@ -501,7 +501,7 @@ languageRestore = (begin (set! pitchnames previous-pitchnames) (ly:parser-set-note-names parser pitchnames)) - (ly:warning (_ "No other language was defined previously. Ignoring."))) + (ly:input-warning location (_ "No other language was defined previously. Ignoring."))) (make-music 'Music 'void #t)) @@ -725,7 +725,7 @@ Example: (let ((moment-reference (ly:music-length (car seqs)))) (for-each (lambda (seq moment) (if (not (equal? moment moment-reference)) - (ly:music-message seq + (ly:music-warning seq "Bars in parallel music don't have the same length"))) seqs (map-in-order ly:music-length seqs)))) voices) @@ -808,7 +808,7 @@ print @var{secondary-note} as a stemless note head in parentheses.") (for-each (lambda (m) (ly:music-set-property! m 'pitch trill-pitch)) trill-events) (begin - (ly:warning (_ "Second argument of \\pitchedTrill should be single note: ")) + (ly:input-warning location (_ "Second argument of \\pitchedTrill should be single note: ")) (display sec-note-events))) (if (eq? forced #t) @@ -891,7 +891,7 @@ scaleDurations = shiftDurations = #(define-music-function (parser location dur dots arg) (integer? integer? ly:music?) - (_i "Scale @var{arg} up by a factor of @var{2^dur*(2-(1/2)^dots)}.") + (_i "Scale @var{arg} up by a factor of 2^@var{dur}*(2-(1/2)^@var{dots}).") (music-map (lambda (x) @@ -973,7 +973,7 @@ tweak = (if (equal? (object-property sym 'backend-type?) #f) (begin - (ly:warning (_ "cannot find property type-check for ~a") sym) + (ly:input-warning location (_ "cannot find property type-check for ~a") sym) (ly:warning (_ "doing assignment anyway")))) (set! (ly:music-property arg 'tweaks) diff --git a/ly/predefined-fretboards-init.ly b/ly/predefined-fretboards-init.ly index 996470a161..2474405617 100644 --- a/ly/predefined-fretboards-init.ly +++ b/ly/predefined-fretboards-init.ly @@ -33,7 +33,7 @@ addChordShape = #(define-music-function (parser location key-symbol tuning shape-definition) (symbol? pair? string-or-pair?) (_i "Add chord shape @var{shape-definition} to the @var{chord-shape-table} -hash with the key @var{(cons key-symbol tuning)}.") +hash with the key @code{(cons @var{key-symbol} @var{tuning})}.") (hash-set! chord-shape-table (cons key-symbol tuning) shape-definition) diff --git a/mf/feta-clefs.mf b/mf/feta-clefs.mf index 4522395cf6..ea36090681 100644 --- a/mf/feta-clefs.mf +++ b/mf/feta-clefs.mf @@ -317,6 +317,11 @@ def draw_gclef (expr reduction) = reduced_ss# = staff_space# * reduction; define_pixels (reduced_ss); + % G clef has now a smaller upper loop than it used to have. + % Too small loop in reduced clef (G_change) interacts badly + % with stafflines, so we make reduced clef's loop a bit bigger. + reduced_loop_correction := min (max (0.94, (0.6 + 0.46 * reduction)), 1); + thinness = 0.095 staff_space + 0.75 linethickness; downstroke_dir = unitvector (14, -75); downstroke_angle = angle downstroke_dir; @@ -328,12 +333,12 @@ def draw_gclef (expr reduction) = breapth_factor = 21/14; inner_thick_end = 45; inner_start_angle = downstroke_angle - 43; - thickness = .32 reduced_ss + 1.1 linethickness; + thickness = .33 reduced_ss + 1.1 linethickness; thinnib = thinness; set_char_box (0, 1.71 * breapth_factor * reduced_ss#, - 2.6 * reduced_ss#, 5 * reduced_ss#); + 2.55 * reduced_ss#, 4.8 * reduced_ss# / reduced_loop_correction); center := (breapth_factor * reduced_ss, 0); @@ -356,32 +361,32 @@ def draw_gclef (expr reduction) = y5r = .37 reduced_ss + ypart center; penpos5 (thickness, upward_swoosh_angle); - z6 = center + whatever * downstroke_dir; - y6 = ypart center + 2 reduced_ss; + z6 = center + whatever * downstroke_dir + (-0.02, 0) * reduced_ss; + y6 = ypart center + 1.95 reduced_ss / reduced_loop_correction; % penpos6 is computed later - z7l - z6 = whatever * (z5 - z6) ; - y7l = 3.5 reduced_ss; + z7l - z6 = whatever * (z5 - z6); + y7l = 3.38 reduced_ss / reduced_loop_correction; penpos7 (thickness, upward_swoosh_angle); - x9 = .7 [x10, x7r]; - top y9l = 5 reduced_ss; + x9 = .75 [x10, x7r]; + top y9l = 4.78 reduced_ss / reduced_loop_correction; penpos9 (1.45 thickness, -70); - x11 - x13r = 1.5 reduced_ss + 0.5 thinnib; - y11 = ypart center - 47/28 reduced_ss; - y12 = ypart center - 71/28 reduced_ss; + x11 - x13r = 1.44 * reduced_ss + 0.5 thinnib; + y11 = ypart center - 45/28 reduced_ss; + y12 = ypart center - 69/28 reduced_ss; y13 = .48 [y12, y4r]; x12r = xpart (.45 [z13r, z11] + .75 reduced_ss * downstroke_dir); % z10 = center + whatever * dir (downstroke_angle - 1.5); - x10 = x6 - 2 thinnib; - y10 = ypart center + 3.5 reduced_ss; + x10 = x6 - 1.85 thinnib * reduction / reduced_loop_correction; + y10 = ypart center + 3.32 reduced_ss / reduced_loop_correction; y10l - y10r = 1.0 thickness; z10r - z10l = .7 thinnib * dir (downstroke_angle + 90) + whatever * downstroke_dir; z10 = .5 [z10l, z10r]; - z11 = center + whatever * downstroke_dir + (-0.05 reduced_ss, 0); + z11 = center + whatever * downstroke_dir + (0.03 reduced_ss, 0); penpos11 (thinnib, start_angle + 90); penpos12 (thinnib, bot_angle + 90); @@ -403,7 +408,7 @@ def draw_gclef (expr reduction) = z10' = point 0.3 of pat; penpos10' (1.3 thinnib, angle (direction 0.3 of pat) + 50); - z11' = point 1.5 of pat; + z11' = point 1.5 of pat + (0.033, -0.5) * reduced_ss; penpos11' (thinnib, angle (direction 1.5 of pat) + 90); z21l = z20l; diff --git a/mf/feta-generic.mf b/mf/feta-generic.mf index 6c00aa5784..3ba7949ba6 100644 --- a/mf/feta-generic.mf +++ b/mf/feta-generic.mf @@ -45,6 +45,7 @@ if test = 0: input feta-pedals; input feta-brackettips; input feta-accordion; + input feta-ties; else: input feta-test-generic.mf; fi diff --git a/mf/feta-scripts.mf b/mf/feta-scripts.mf index d04ed18b7b..e252d335e5 100644 --- a/mf/feta-scripts.mf +++ b/mf/feta-scripts.mf @@ -620,6 +620,44 @@ fet_beginchar ("halfopen (unstopped)", "halfopen"); fet_endchar; +fet_beginchar ("halfopen vertical", "halfopenvertical"); + save thin, height, width, thick, factor, slash; + + factor := 3/2; + height# = 5/4 width#; + height# = staff_space#; + thin = 0.6 linethickness + 0.06 staff_space; + slash# = 1.05 linethickness#; + + set_char_box (width# / 2, width# / 2, + height# / 2, height# / 2); + + define_pixels (width, height, slash); + + 2 thick + 0.6 (height - 2 thin) = width; + + penpos1 (thick, 0); + penpos2 (thin, 90); + penpos3 (thick, 180); + penpos4 (thin, 270); + z1r = (w, 0); + z2r = (0, h); + z3r = (-w, 0); + z4r = (0, -h); + + penlabels (1, 2, 3, 4); + + penstroke z1e{up} + .. z2e{left} + .. z3e{down} + .. z4e{right} + .. cycle; + + draw_brush ((0, -h * factor), slash, + (0, h * factor), slash); +fet_endchar; + + fet_beginchar ("plus (stopped)", "stopped"); save hthick, vthick, size, outer_hsize, outer_vsize; diff --git a/mf/feta-test-generic.mf b/mf/feta-test-generic.mf index 71f7ce842f..a910b52c5a 100644 --- a/mf/feta-test-generic.mf +++ b/mf/feta-test-generic.mf @@ -14,3 +14,4 @@ input feta-accidentals; %input feta-timesignatures; %input feta-pedals; %input feta-accordion; +%input feta-ties; diff --git a/mf/feta-ties.mf b/mf/feta-ties.mf new file mode 100644 index 0000000000..4378d576d8 --- /dev/null +++ b/mf/feta-ties.mf @@ -0,0 +1,46 @@ +% Feta (not the Font-En-Tja) music font -- small ties +% This file is part of LilyPond, the GNU music typesetter. +% +% Copyright (C) 2011 Bertrand Bordage +% +% LilyPond is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% LilyPond is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with LilyPond. If not, see . + +fet_begingroup ("ties"); + +fet_beginchar ("lyric tie", "lyric"); + save padding; + + padding := .4 staff_space; + + set_char_box (0, 0, + .7 staff_space#, 0); + + z1 = (-staff_space, -padding); + z2 = (0, -d); + z3 = (staff_space, -padding); + + penpos1 (1.2 linethickness, 50); + penpos2 (2 linethickness, 90); + penpos3 (1.2 linethickness, 130); + + fill z2l + .. simple_serif (z3l, z3r, 90) + .. z2r + .. simple_serif (z1r, z1l, 90) + .. cycle; + + penlabels (1, 2, 3); +fet_endchar; + +fet_endgroup ("ties"); diff --git a/python/book_base.py b/python/book_base.py index b73f37336e..b43b9e00d4 100644 --- a/python/book_base.py +++ b/python/book_base.py @@ -172,7 +172,8 @@ class BookOutputFormat: rep = snippet.get_replacements () if PRINTFILENAME in snippet.option_dict: rep['base'] = basename - rep['filename'] = os.path.basename (snippet.substring ('filename')) + rep['filename'] = os.path.basename (snippet.filename) + rep['ext'] = snippet.ext str = self.output[PRINTFILENAME] % rep return str diff --git a/python/book_docbook.py b/python/book_docbook.py index 5ae766bbaf..ef009935d6 100644 --- a/python/book_docbook.py +++ b/python/book_docbook.py @@ -79,7 +79,7 @@ Docbook_output = { PRINTFILENAME: r''' - + %(filename)s diff --git a/python/book_html.py b/python/book_html.py index cf56dd5f49..ac70b743a0 100644 --- a/python/book_html.py +++ b/python/book_html.py @@ -40,6 +40,13 @@ HTML_snippet_res = { 'multiline_comment': r'''(?smx)(?P\s*(?!@c\s+)(?P)\s)''', + 'musicxml_file': + r'''(?mx) + (?P + .*?)\s*> + \s*(?P.*?)\s* + )''', + 'verb': r'''(?x)(?P(?P
.*?
))''', @@ -62,7 +69,7 @@ HTML_output = {

''', BEFORE: r'''

- ''', + ''', OUTPUT: r''' %(alt)s''', - PRINTFILENAME: '

%(filename)s

', + PRINTFILENAME: '

%(filename)s

', QUOTE: r'''
%(str)s @@ -118,6 +125,8 @@ class BookHTMLOutputFormat (BookBase.BookOutputFormat): str = '' rep = snippet.get_replacements (); rep['base'] = basename + rep['filename'] = os.path.basename (snippet.filename) + rep['ext'] = snippet.ext str += self.output_print_filename (basename, snippet) if VERBATIM in snippet.option_dict: rep['verb'] = BookBase.verbatim_html (snippet.verb_ly ()) diff --git a/python/book_latex.py b/python/book_latex.py index 677e88a1f7..8097443f7f 100644 --- a/python/book_latex.py +++ b/python/book_latex.py @@ -68,6 +68,17 @@ Latex_snippet_res = { (?P\S+?) })''', + 'musicxml_file': + r'''(?smx) + ^[^%\n]*? + (?P + \\musicxmlfile\s*( + \[ + \s*(?P.*?)\s* + \])?\s*\{ + (?P\S+?) + })''', + 'singleline_comment': r'''(?mx) ^.*? diff --git a/python/book_snippets.py b/python/book_snippets.py index b7c3ddf0d6..47b6834716 100644 --- a/python/book_snippets.py +++ b/python/book_snippets.py @@ -38,14 +38,12 @@ EXAMPLEINDENT = 'exampleindent' FILENAME = 'filename' FILTER = 'filter' FRAGMENT = 'fragment' -LANG = 'lang' ## TODO: This is handled nowhere! LAYOUT = 'layout' LILYQUOTE = 'lilyquote' LINE_WIDTH = 'line-width' NOFRAGMENT = 'nofragment' NOGETTEXT = 'nogettext' NOINDENT = 'noindent' -NOQUOTE = 'noquote' INDENT = 'indent' NORAGGED_RIGHT = 'noragged-right' NOTES = 'body' @@ -68,7 +66,6 @@ VERSION = 'lilypondversion' # NOTIME and NOGETTEXT have no opposite so they aren't part of this # dictionary. -# NOQUOTE is used internally only. no_options = { NOFRAGMENT: FRAGMENT, NOINDENT: INDENT, @@ -92,7 +89,6 @@ simple_options = [ PRINTFILENAME, DOCTITLE, TEXIDOC, - LANG, VERBATIM, FILENAME, ALT, @@ -145,23 +141,6 @@ snippet_options = { -FRAGMENT_LY = r''' -%(notes_string)s -{ - - -%% **************************************************************** -%% ly snippet contents follows: -%% **************************************************************** -%(code)s - - -%% **************************************************************** -%% end ly snippet -%% **************************************************************** -} -''' - def classic_lilypond_book_compatibility (key, value): if key == 'singleline' and value == None: return (RAGGED_RIGHT, None) @@ -196,7 +175,6 @@ PREAMBLE_LY = '''%%%% Generated by %(program_name)s \paper { %(paper_string)s - force-assignment = #"" line-width = #(- line-width (* mm %(padding_mm)f)) } @@ -222,10 +200,23 @@ FULL_LY = ''' %% **************************************************************** ''' +FRAGMENT_LY = r''' +%(notes_string)s +{ +%% **************************************************************** +%% ly snippet contents follows: +%% **************************************************************** +%(code)s +%% **************************************************************** +%% end ly snippet +%% **************************************************************** +} +''' + @@ -460,10 +451,6 @@ left-margin-default right-margin-default)" return self.option_list def compose_ly (self, code): - if FRAGMENT in self.option_dict: - body = FRAGMENT_LY - else: - body = FULL_LY # Defaults. relative = 1 @@ -574,6 +561,10 @@ left-margin-default right-margin-default)" d = globals().copy() d.update (locals()) d.update (self.global_options.information) + if FRAGMENT in self.option_dict: + body = FRAGMENT_LY + else: + body = FULL_LY return (PREAMBLE_LY + body) % d def get_checksum (self): @@ -659,6 +650,11 @@ printing diff against existing file." % filename) os.makedirs (dst_path) os.link (src, dst) + def additional_files_to_consider (self, base, full): + return [] + def additional_files_required (self, base, full): + return [] + def all_output_files (self, output_dir, output_dir_files): """Return all files generated in lily_output_dir, a set. @@ -722,6 +718,8 @@ printing diff against existing file." % filename) if 'ddump-signature' in self.global_options.process_cmd: consider_file (systemfile + '.signature') + map (consider_file, self.additional_files_to_consider (base, full)) + map (require_file, self.additional_files_required (base, full)) return (result, missing) @@ -733,7 +731,7 @@ printing diff against existing file." % filename) """Pass input through cmd, and return the result.""" if self.global_options.verbose: - progress (_ ("Opening filter `%s'\n") % cmd) + progress (_ ("Running through filter `%s'\n") % cmd) # TODO: Use Popen once we resolve the problem with msvcrt in Windows: (stdin, stdout, stderr) = os.popen3 (cmd) @@ -746,16 +744,16 @@ printing diff against existing file." % filename) status = 0 output = stdout.read () status = stdout.close () - error = stderr.read () + err = stderr.read () if not status: status = 0 signal = 0x0f & status - if status or (not output and error): + if status or (not output and err): exit_status = status >> 8 ly.error (_ ("`%s' failed (%d)") % (cmd, exit_status)) ly.error (_ ("The error log is as follows:")) - ly.stderr_write (error) + ly.stderr_write (err) ly.stderr_write (stderr.read ()) exit (status) @@ -808,7 +806,9 @@ re_end_verbatim = re.compile (r'\s+%.*?end verbatim.*$', re.M) class LilypondFileSnippet (LilypondSnippet): def __init__ (self, type, match, formatter, line_number, global_options): LilypondSnippet.__init__ (self, type, match, formatter, line_number, global_options) - self.contents = file (BookBase.find_file (self.substring ('filename'), global_options.include_path)).read () + self.filename = self.substring ('filename') + self.ext = os.path.splitext (os.path.basename (self.filename))[1] + self.contents = file (BookBase.find_file (self.filename, global_options.include_path)).read () def get_snippet_code (self): return self.contents; @@ -824,18 +824,113 @@ class LilypondFileSnippet (LilypondSnippet): return s def ly (self): - name = self.substring ('filename') + name = self.filename return ('\\sourcefilename \"%s\"\n\\sourcefileline 0\n%s' % (name, self.contents)) def final_basename (self): if self.global_options.use_source_file_names: - base = os.path.splitext (os.path.basename (self.substring ('filename')))[0] + base = os.path.splitext (os.path.basename (self.filename))[0] return base else: return self.basename () +class MusicXMLFileSnippet (LilypondFileSnippet): + def __init__ (self, type, match, formatter, line_number, global_options): + LilypondFileSnippet.__init__ (self, type, match, formatter, line_number, global_options) + self.compressed = False + self.converted_ly = None + self.musicxml_options_dict = { + 'verbose': '--verbose', + 'lxml': '--lxml', + 'compressed': '--compressed', + 'relative': '--relative', + 'absolute': '--absolute', + 'no-articulation-directions': '--no-articulation-directions', + 'no-rest-positions': '--no-rest-positions', + 'no-page-layout': '--no-page-layout', + 'no-beaming': '--no-beaming', + 'language': '--language', + } + + def snippet_options (self): + return self.musicxml_options_dict.keys () + + def convert_from_musicxml (self): + name = self.filename + xml2ly_option_list = [] + for (key, value) in self.option_dict.items (): + cmd_key = self.musicxml_options_dict.get (key, None) + if cmd_key == None: + continue + if value == None: + xml2ly_option_list.append (cmd_key) + else: + xml2ly_option_list.append (cmd_key + '=' + value) + if ('.mxl' in name) and ('--compressed' not in xml2ly_option_list): + xml2ly_option_list.append ('--compressed') + self.compressed = True + opts = " ".join (xml2ly_option_list) + progress (_ ("Converting MusicXML file `%s'...\n") % self.filename) + + ly_code = self.filter_pipe (self.contents, 'musicxml2ly %s --out=- - ' % opts) + return ly_code + + def ly (self): + if self.converted_ly == None: + self.converted_ly = self.convert_from_musicxml () + name = self.filename + return ('\\sourcefilename \"%s\"\n\\sourcefileline 0\n%s' + % (name, self.converted_ly)) + + def additional_files_required (self, base, full): + result = []; + if self.compressed: + result.append (base + '.mxl') + else: + result.append (base + '.xml') + return result + + def write_ly (self): + base = self.basename () + path = os.path.join (self.global_options.lily_output_dir, base) + directory = os.path.split(path)[0] + if not os.path.isdir (directory): + os.makedirs (directory) + + # First write the XML to a file (so we can link it!) + if self.compressed: + xmlfilename = path + '.mxl' + else: + xmlfilename = path + '.xml' + if os.path.exists (xmlfilename): + diff_against_existing = self.filter_pipe (self.contents, 'diff -u %s - ' % xmlfilename) + if diff_against_existing: + warning (_ ("%s: duplicate filename but different contents of orginal file,\n\ +printing diff against existing file.") % xmlfilename) + ly.stderr_write (diff_against_existing) + else: + out = file (xmlfilename, 'w') + out.write (self.contents) + out.close () + + # also write the converted lilypond + filename = path + '.ly' + if os.path.exists (filename): + diff_against_existing = self.filter_pipe (self.full_ly (), 'diff -u %s -' % filename) + if diff_against_existing: + warning (_ ("%s: duplicate filename but different contents of converted lilypond file,\n\ +printing diff against existing file.") % filename) + ly.stderr_write (diff_against_existing) + else: + out = file (filename, 'w') + out.write (self.full_ly ()) + out.close () + file (path + '.txt', 'w').write ('image of music') + + + class LilyPondVersionString (Snippet): """A string that does not require extra memory.""" def __init__ (self, type, match, formatter, line_number, global_options): @@ -851,4 +946,5 @@ snippet_type_to_class = { 'lilypond': LilypondSnippet, 'include': IncludeSnippet, 'lilypondversion': LilyPondVersionString, + 'musicxml_file': MusicXMLFileSnippet, } diff --git a/python/book_texinfo.py b/python/book_texinfo.py index 03f723754a..6bda07a3f8 100644 --- a/python/book_texinfo.py +++ b/python/book_texinfo.py @@ -58,6 +58,15 @@ TexInfo_snippet_res = { .*? @end\s+ignore))\s''', + 'musicxml_file': r'''(?mx) + ^(?P + @musicxmlfile\s*( + \[ + \s*(?P.*?)\s* + \])?\s*{ + (?P\S+) + })''', + 'singleline_comment': r'''(?mx) ^.* (?P @@ -103,7 +112,7 @@ TexInfo_output = { @end ifinfo @html

- + + @end html @file{%(filename)s} @html @@ -125,10 +134,6 @@ TexInfo_output = { QUOTE: r'''@quotation %(str)s@end quotation -''', - - NOQUOTE: r'''@format -%(str)s@end format ''', VERBATIM: r'''@exampleindent 0 diff --git a/python/convertrules.py b/python/convertrules.py index fc35924b66..b1e3fefd45 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -3013,6 +3013,12 @@ def conv (str): str = re.sub (r'\\(cresc|dim|endcresc|enddim)\b', r'\\deprecated\1', str) return str +@rule ((2, 13, 27), + ("interval-translate -> coord-translate")) +def conv (str): + str = re.sub ('interval-translate', 'coord-translate', str) + return str + @rule ((2, 13, 29), _ ("Eliminate beamSettings, beatLength, \\setBeatGrouping, \\overrideBeamSettings and \\revertBeamSettings.\n\ \"accordion.accEtcbase\" -> \"accordion.etcbass\"")) @@ -3207,14 +3213,6 @@ def conv(str): def conv (str): return str -@rule ((2, 15, 2), - _ ("Change in internal property for MultiMeasureRest")) -def conv (str): - if re.search (r'use-breve-rest',str): - stderr_write (NOT_SMART % _("use-breve-rest. This internal property has been replaced by round-to-longer-rest and usable-duration-logs.\n")) - stderr_write (UPDATE_MANUALLY) - return str - @rule ((2, 15, 7), _ ("Handling of non-automatic footnotes.")) def conv(str): @@ -3224,6 +3222,16 @@ def conv(str): stderr_write (UPDATE_MANUALLY) return str +@rule ((2, 15, 9), + _ ("Change in internal property for MultiMeasureRest")) +def conv (str): + if re.search (r'use-breve-rest',str): + stderr_write ("\n") + stderr_write (NOT_SMART % "use-breve-rest.\n") + stderr_write (_ ("This internal property has been replaced by round-up-to-longer-rest, round-up-exceptions and usable-duration-logs.\n")) + stderr_write (UPDATE_MANUALLY) + return str + # Guidelines to write rules (please keep this at the end of this file) # diff --git a/scm/backend-library.scm b/scm/backend-library.scm index 93cd2c02d8..b58d8aca89 100644 --- a/scm/backend-library.scm +++ b/scm/backend-library.scm @@ -24,10 +24,7 @@ (ice-9 optargs)) (define-public (ly:system command) - (if (ly:get-option 'verbose) - (begin - (ly:message (_ "Invoking `~a'...") (string-join command))) - (ly:progress "\n")) + (ly:debug (_ "Invoking `~a'...") (string-join command)) (let ((status (apply ly:spawn command))) (if (> status 0) (begin diff --git a/scm/chord-generic-names.scm b/scm/chord-generic-names.scm index a30036d1af..83adcb0e48 100644 --- a/scm/chord-generic-names.scm +++ b/scm/chord-generic-names.scm @@ -53,7 +53,7 @@ FIXME: func, options/context have changed See @file{double-plus-new-chord-name.scm} for the signature of @var{style}. @var{pitches}, @var{bass}, and @var{inversion} are lily pitches. -@var{options} is an alist-alist (see @file{input/test/dpncnt.ly})." +@var{options} is an alist-alist (see @file{input/@/test/@/dpncnt.ly})." (define (step-nr pitch) (let* ((pitch-nr (+ (* 7 (ly:pitch-octave pitch)) diff --git a/scm/chord-name.scm b/scm/chord-name.scm index 79b018992a..e3447eba27 100644 --- a/scm/chord-name.scm +++ b/scm/chord-name.scm @@ -107,7 +107,7 @@ (list-ref '("eses" "es" "" "is" "isis") (+ 2 (cdr n-a))))))))) (define-public ((chord-name->italian-markup re-with-eacute) pitch lowercase?) - "Return pitch markup for @var{pitch}, using italian/french note names. + "Return pitch markup for @var{pitch}, using Italian/@/French note names. If @var{re-with-eacute} is set to @code{#t}, french `ré' is returned for pitch@tie{}D instead of `re'." diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index dab5211f14..e9acd96907 100644 --- a/scm/define-context-properties.scm +++ b/scm/define-context-properties.scm @@ -98,7 +98,7 @@ printed. @code{(#t . #f)} does not make sense. @end table") (autoBeamCheck ,procedure? "A procedure taking three -arguments, @var{context}, @var{dir} [start/stop (-1 or 1)], and +arguments, @var{context}, @var{dir} [start/@/stop (-1 or 1)], and @var{test} [shortest note in the beam]. A non-@code{#f} return value starts or stops the auto beam.") (autoBeaming ,boolean? "If set to true then beams are generated @@ -239,7 +239,7 @@ for a bass figure.") (figuredBassPlusDirection ,ly:dir? "Where to put plus signs relative to the main figure.") (fingeringOrientations ,list? "A list of symbols, containing -@samp{left}, @samp{right}, @samp{up} and/or @samp{down}. This list +@samp{left}, @samp{right}, @samp{up} and/@/or @samp{down}. This list determines where fingerings are put relative to the chord being fingered.") (firstClef ,boolean? "If true, create a new clef when starting a @@ -247,7 +247,7 @@ staff.") (followVoice ,boolean? "If set, note heads are tracked across staff switches by a thin line.") (fontSize ,number? "The relative size of all grobs in a context.") - (forbidBreak ,boolean? "If set to @code{##t}, prevent a line break + (forbidBreak ,boolean? "If set to @code{#t}, prevent a line break at this point.") (forceClef ,boolean? "Show clef symbol, even if it has not changed. Only active for the first clef after the property is set, not @@ -322,7 +322,7 @@ containing @code{(@var{step} . @var{alter})} or @code{((@var{octave} . alterations, use symbols, e.g. @code{keySignature = #`((6 . ,FLAT))}.") - (lyricMelismaAlignment ,ly:dir? "Alignment to use for a melisma syllable.") + (lyricMelismaAlignment ,number? "Alignment to use for a melisma syllable.") (majorSevenSymbol ,markup? "How should the major 7th be formatted @@ -339,7 +339,7 @@ we had. This can be set manually to create incomplete measures.") (melismaBusyProperties ,list? "A list of properties (symbols) to determine whether a melisma is playing. Setting this property will influence how lyrics are aligned to notes. For example, if set to -@code{#'(melismaBusy beamMelismaBusy)}, only manual melismata and +@code{'(melismaBusy beamMelismaBusy)}, only manual melismata and manual beams are considered. Possible values include @code{melismaBusy}, @code{slurMelismaBusy}, @code{tieMelismaBusy}, and @code{beamMelismaBusy}.") @@ -477,7 +477,7 @@ subdivided at @code{baseMoment} positions by only drawing one beam over the beat (suggestAccidentals ,boolean? "If set, accidentals are typeset as cautionary suggestions over the note.") (systemStartDelimiter ,symbol? "Which grob to make for the start -of the system/staff? Set to @code{SystemStartBrace}, +of the system/@/staff? Set to @code{SystemStartBrace}, @code{SystemStartBracket} or @code{SystemStartBar}.") (systemStartDelimiterHierarchy ,pair? "A nested list, indicating the nesting of a start delimiters.") @@ -496,7 +496,7 @@ minute.") follow each other directly. This can be used for writing out arpeggios.") (timeSignatureFraction ,number-pair? "A pair of numbers, -signifying the time signature. For example, @code{#'(4 . 4)} is a +signifying the time signature. For example, @code{'(4 . 4)} is a 4/4 time signature.") (timeSignatureSettings ,cheap-list? "A nested alist of settings for time signatures. Contains elements for various time signatures. The @@ -570,7 +570,7 @@ are described in @rinternals{bar-line-interface}.") barcheck fail?") (beamMelismaBusy ,boolean? "Signal if a beam is present.") (busyGrobs ,list? "A queue of @code{(@var{end-moment} . -@var{GROB})} cons cells. This is for internal (C++) use only. This +@var{grob})} cons cells. This is for internal (C++) use only. This property contains the grobs which are still busy (e.g. note heads, spanners, etc.).") @@ -624,7 +624,7 @@ is not set") (scriptDefinitions ,list? "The description of scripts. This is used by the @code{Script_engraver} for typesetting note-superscripts -and subscripts. See @file{scm/script.scm} for more information.") +and subscripts. See @file{scm/@/script.scm} for more information.") (slurMelismaBusy ,boolean? "Signal if a slur is present.") (stavesFound ,grob-list? "A list of all staff-symbols found.") diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index 1b318deaf2..a45f1053d1 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -38,7 +38,7 @@ included in this script's support.") (after-line-breaking ,boolean? "Dummy property, used to trigger callback for @code{after-line-breaking}.") - (align-dir ,ly:dir? "Which side to align? @code{-1}: left side, + (align-dir ,ly:dir? "Which side to align? @w{@code{-1}}: left side, @code{0}: around center of width, @code{1}: right side.") (allow-loose-spacing ,boolean? "If set, column can be detached from main spacing.") @@ -164,12 +164,12 @@ stick out of its bounds?") ;; (c0-position ,integer? "An integer indicating the position of middle@tie{}C.") - (circled-tip ,boolean? "Put a circle at start/end of -hairpins (al/del niente).") + (circled-tip ,boolean? "Put a circle at start/@/end of +hairpins (al/@/del niente).") (clip-edges ,boolean? "Allow outward pointing beamlets at the edges of beams?") (collapse-height ,ly:dimension? "Minimum height of system start -delimiter. If equal or smaller, the bracket/brace/line is removed.") +delimiter. If equal or smaller, the bracket/@/brace/@/line is removed.") (collision-interfaces ,list? "A list of interfaces for which automatic beam-collision resolution is run.") (collision-voice-only ,boolean? "Does automatic beam collsion apply @@ -213,13 +213,13 @@ looking at the top of the Internals Reference page for each interface having a @code{details} property.") (digit-names ,vector? "Names for string finger digits.") (direction ,ly:dir? "If @code{side-axis} is @code{0} (or -@code{#X}), then this property determines whether the object is placed -@code{#LEFT}, @code{#CENTER} or @code{#RIGHT} with respect to the +@code{X}), then this property determines whether the object is placed +@code{LEFT}, @code{CENTER} or @code{RIGHT} with respect to the other object. Otherwise, it determines whether the object is placed -@code{#UP}, @code{#CENTER} or @code{#DOWN}. Numerical values may also -be used: @code{#UP}=@code{1}, @code{#DOWN}=@code{-1}, -@code{#LEFT}=@code{-1}, @code{#RIGHT}=@code{1}, -@code{#CENTER}=@code{0}.") +@code{UP}, @code{CENTER} or @code{DOWN}. Numerical values may also +be used: @code{UP}=@code{1}, @code{DOWN}=@w{@code{-1}}, +@code{LEFT}=@w{@code{-1}}, @code{RIGHT}=@code{1}, +@code{CENTER}=@code{0}.") (dot-count ,integer? "The number of dots.") (dot-negative-kern ,number? "The space to remove between a dot and a slash in percent repeat glyphs. Larger values bring the two @@ -300,7 +300,7 @@ include @code{medium}, @code{bold}, @code{bold-narrow}, etc.") include @code{upright}, @code{italic}, @code{caps}.") (font-size ,number? "The font size, compared to the @q{normal}@tie{}size. @code{0}@tie{}is style-sheet's normal size, -@code{-1} is smaller, @code{+1} is bigger. Each step of@tie{}1 is +@w{@code{-1}} is smaller, @code{+1} is bigger. Each step of@tie{}1 is approximately 12% larger; 6@tie{}steps are exactly a factor@tie{}2 larger. Fractional values are allowed.") (footnote-text ,markup? "A footnote for the grob.") @@ -356,8 +356,8 @@ the center of the fret in direction parallel to strings. Default@tie{}0. @item @code{label-dir} -- Side to which the fret label is attached. -@code{-1}, @code{#LEFT}, or @code{#DOWN} for left or down; @code{1}, -@code{#RIGHT}, or @code{#UP} for right or up. Default @code{#RIGHT}. +@w{@code{-1}}, @code{LEFT}, or @code{DOWN} for left or down; @code{1}, +@code{RIGHT}, or @code{UP} for right or up. Default @code{RIGHT}. @item @code{mute-string} -- Character string to be used to indicate muted string. Default @code{\"x\"}. @@ -434,8 +434,8 @@ be included in harp-pedal-details include the following: @itemize @bullet @item -@code{box-offset} -- Vertical shift of the center of flat/sharp pedal -boxes above/below the horizontal line. Default value@tie{}0.8. +@code{box-offset} -- Vertical shift of the center of flat/@/sharp pedal +boxes above/@/below the horizontal line. Default value@tie{}0.8. @item @code{box-width} -- Width of each pedal box. Default value@tie{}0.4. @item @@ -698,7 +698,7 @@ attachments of spanners to edges.") (right-padding ,ly:dimension? "Space to insert on the right side of an object (e.g., between note and its accidentals).") (rotation ,list? "Number of degrees to rotate this object, and -what point to rotate around. For example, @code{#'(45 0 0)} rotates +what point to rotate around. For example, @code{'(45 0 0)} rotates by 45 degrees around the center of this object.") (round-up-to-longer-rest ,boolean? "Displays the longer multi-measure rest when the length of a measure is between two values of @@ -716,7 +716,7 @@ stem distance.") (script-priority ,number? "A sorting key that determines in what order a script is within a stack of scripts.") (self-alignment-X ,number? "Specify alignment of an object. The -value @code{-1} means left aligned, @code{0}@tie{}centered, and +value @w{@code{-1}} means left aligned, @code{0}@tie{}centered, and @code{1}@tie{}right-aligned in X@tie{}direction. Other numerical values may also be specified.") (self-alignment-Y ,number? "Like @code{self-alignment-X} but for @@ -732,9 +732,9 @@ space for the shortest duration. This is expressed in shortest note playing here.") (shortest-starter-duration ,ly:moment? "The duration of the shortest note that starts here.") - (side-axis ,number? "If the value is @code{#X} (or + (side-axis ,number? "If the value is @code{X} (or equivalently@tie{}@code{0}), the object is placed horizontally next to -the other object. If the value is @code{#Y} or@tie{}@code{1}, it is +the other object. If the value is @code{Y} or@tie{}@code{1}, it is placed vertically.") (side-relative-direction ,ly:dir? "Multiply direction of @code{direction-source} with this to get the direction of this @@ -779,7 +779,8 @@ bounds (i.e., clefs, key signatures and time signatures) using the following override: @example -\\override MultiMeasureRest #'spacing-pair = #'(staff-bar . staff-bar) +\\override MultiMeasureRest + #'spacing-pair = #'(staff-bar . staff-bar) @end example") (spanner-id ,string? "An identifier to distinguish concurrent spanners.") (springs-and-rods ,boolean? "Dummy variable for triggering @@ -889,7 +890,7 @@ should use @code{LEFT}.") @var{dir})} pairs, indicating the desired tie configuration, where @var{position} is the offset from the center of the staff in staff space and @var{dir} indicates the direction of the tie -(@code{1}=>up, @code{-1}=>down, @code{0}=>center). A non-pair entry +(@code{1}=>up, @w{@code{-1}}=>down, @code{0}=>center). A non-pair entry in the list causes the corresponding tie to be formatted automatically.") (to-barline ,boolean? "If true, the spanner will stop at the bar @@ -994,8 +995,10 @@ function is to protect objects from being garbage collected.") (bars ,ly:grob-array? "An array of bar line pointers.") (beam ,ly:grob? "A pointer to the beam, if applicable.") + (bound-alignment-interfaces ,list "Interfaces to be used +for positioning elements that align with a column.") (bounded-by-me ,ly:grob-array? "An array of spanners that have this -column as start/begin point. Only columns that have grobs or act as +column as start/@/begin point. Only columns that have grobs or act as bounds are spaced.") (bracket ,ly:grob? "The bracket for a number.") @@ -1065,10 +1068,11 @@ objects.") (spanner-broken ,boolean? "Indicates whether spanner alignment should be broken after the current spanner.") (spanner-placement ,ly:dir? "The place of an annotation on a spanner. -LEFT is for the first spanner, and RIGHT is for the last. CENTER will -place it on the broken spanner that falls closest to the center of the length -of the entire spanner, although this behavior is unpredictable in situations -with lots of rhythmic diversity. For predictable results, use LEFT and RIGHT.") +@code{LEFT} is for the first spanner, and @code{RIGHT} is for the last. +@code{CENTER} will place it on the broken spanner that falls closest to the +center of the length of the entire spanner, although this behavior is +unpredictable in situations with lots of rhythmic diversity. For predictable +results, use @code{LEFT} and @code{RIGHT}.") (staff-grouper ,ly:grob? "The staff grouper we belong to.") (staff-symbol ,ly:grob? "The staff symbol grob that we are in.") (stem ,ly:grob? "A pointer to a @code{Stem} object.") @@ -1165,7 +1169,7 @@ an additional stem on the right side?") (cavum ,boolean? "Is this neume outlined?") (context-info ,integer? "Within a ligature, the final glyph or shape of -a head may be affected by the left and/or right neighbour head. +a head may be affected by the left and/@/or right neighbour head. @code{context-info} holds for each head such information about the left and right neighbour, encoded as a bit mask.") diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index ff792baedb..3055af219b 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -527,7 +527,7 @@ (key-signature . (minimum-space . 3.5)) (time-signature . (minimum-space . 4.2)) (first-note . (minimum-fixed-space . 5.0)) - (next-note . (extra-space . 0.5)) + (next-note . (extra-space . 1.0)) (right-edge . (extra-space . 0.5)))) (stencil . ,ly:clef::print) (Y-offset . ,ly:staff-symbol-referencer::callback) @@ -593,7 +593,7 @@ (time-signature . (minimum-space . 4.2)) (custos . (minimum-space . 0.0)) (first-note . (minimum-fixed-space . 3.0)) - (next-note . (extra-space . 0.5)) + (next-note . (extra-space . 1.0)) (right-edge . (extra-space . 0.5)))) (stencil . ,ly:clef::print) (Y-offset . ,ly:staff-symbol-referencer::callback) @@ -620,7 +620,7 @@ (key-signature . (minimum-space . 3.5)) (time-signature . (minimum-space . 4.2)) (first-note . (minimum-fixed-space . 5.0)) - (next-note . (extra-space . 0.5)) + (next-note . (extra-space . 1.0)) (right-edge . (extra-space . 0.5)))) (stencil . ,ly:clef::print) (Y-offset . ,ly:staff-symbol-referencer::callback) @@ -919,6 +919,7 @@ (fret-diagram-details . ((finger-code . below-string))) (stencil . ,fret-board::calc-stencil) (extra-spacing-height . (0.2 . -0.2)) + (extra-spacing-width . (-0.5 . 0.5)) (meta . ((class . Item) (interfaces . (chord-name-interface font-interface @@ -929,11 +930,12 @@ (Glissando . ( (after-line-breaking . ,ly:spanner::kill-zero-spanned-time) - (bound-details . ((right . ((attach-dir . ,CENTER) - (padding . 1.5) + (bound-details . ((right . ((attach-dir . ,LEFT) + (end-on-accidental . #t) + (padding . 0.5) )) - (left . ((attach-dir . ,CENTER) - (padding . 1.5) + (left . ((attach-dir . ,RIGHT) + (padding . 0.5) )) )) (gap . 0.5) @@ -1071,7 +1073,7 @@ (key-signature . (extra-space . 0.5)) (cue-clef . (extra-space . 0.5)) (right-edge . (extra-space . 0.5)) - (first-note . (fixed-space . 2.5)))) + (first-note . (semi-fixed-space . 2.5)))) (stencil . ,ly:key-signature-interface::print) (extra-spacing-width . (0.0 . 0.5)) (Y-offset . ,ly:staff-symbol-referencer::callback) @@ -1095,7 +1097,7 @@ (staff-bar . (extra-space . 1.1)) (cue-clef . (extra-space . 0.5)) (right-edge . (extra-space . 0.5)) - (first-note . (fixed-space . 2.5)))) + (first-note . (semi-fixed-space . 2.5)))) (stencil . ,ly:key-signature-interface::print) (extra-spacing-width . (0.0 . 0.5)) (Y-offset . ,ly:staff-symbol-referencer::callback) @@ -1414,6 +1416,7 @@ (NoteColumn . ( (axes . (,X ,Y)) + (bound-alignment-interfaces . (rhythmic-head-interface stem-interface)) (horizontal-skylines . ,ly:separation-item::calc-skylines) (skyline-vertical-padding . 0.15) (X-extent . ,ly:axis-group-interface::width) @@ -1518,6 +1521,7 @@ (allow-loose-spacing . #t) (axes . (,X)) (before-line-breaking . ,ly:paper-column::before-line-breaking) + (bound-alignment-interfaces . (note-column-interface)) (horizontal-skylines . ,ly:separation-item::calc-skylines) (keep-inside-line . #t) ;; (stencil . ,ly:paper-column::print) @@ -1712,6 +1716,7 @@ (side-axis . ,Y) ;; padding set in script definitions. + (slur-padding . 0.2) (staff-padding . 0.25) (stencil . ,ly:script-interface::print) @@ -2239,7 +2244,7 @@ (non-musical . #t) (space-alist . ( (cue-clef . (extra-space . 1.5)) - (first-note . (fixed-space . 2.0)) + (first-note . (semi-fixed-space . 2.0)) (right-edge . (extra-space . 0.5)) (staff-bar . (minimum-space . 2.0)))) (stencil . ,ly:time-signature::print) @@ -2613,6 +2618,7 @@ (,ly:accidental-interface::height . ,ly:accidental-interface::pure-height) (,ly:axis-group-interface::calc-staff-staff-spacing . ,ly:axis-group-interface::calc-pure-staff-staff-spacing) (,ly:axis-group-interface::height . ,ly:axis-group-interface::pure-height) + (,ly:beam::rest-collision-callback . ,ly:beam::pure-rest-collision-callback) (,ly:grob::stencil-height . ,pure-stencil-height) (,ly:hara-kiri-group-spanner::y-extent . ,ly:hara-kiri-group-spanner::pure-height) (,ly:rest-collision::force-shift-callback-rest . ,pure-chain-offset-callback) diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 38bf9623dc..cdfaf1f9f8 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -60,7 +60,7 @@ ;;; functions that take a markup as their last argument. ;;; ;;; args-signature -;;; the arguments signature, i.e. a list of type predicates which +;;; the arguments signature, i.e., a list of type predicates which ;;; are used to type check the arguments, and also to define the general ;;; argument types (markup, markup-list, scheme) that the command is ;;; expecting. @@ -69,19 +69,19 @@ ;;; ;;; category ;;; for documentation purpose, builtin markup commands are grouped by -;;; category. This can be any symbol. When documentation is generated, +;;; category. This can be any symbol. When documentation is generated, ;;; the symbol is converted to a capitalized string, where hyphens are ;;; replaced by spaces. ;;; ;;; property-bindings ;;; this is used both for documentation generation, and to ease -;;; programming the command itself. It is list of +;;; programming the command itself. It is list of ;;; (property-name default-value) ;;; or (property-name) -;;; elements. Each property is looked-up in the `props' argument, and +;;; elements. Each property is looked-up in the `props' argument, and ;;; the symbol naming the property is bound to its value. ;;; When the property is not found in `props', then the symbol is bound -;;; to the given default value. When no default value is given, #f is +;;; to the given default value. When no default value is given, #f is ;;; used instead. ;;; Thus, using the following property bindings: ;;; ((thickness 0.1) @@ -92,15 +92,15 @@ ;;; ..body..) ;;; When a command `B' internally calls an other command `A', it may ;;; desirable to see in `B' documentation all the properties and -;;; default values used by `A'. In that case, add `A-markup' to the -;;; property-bindings of B. (This is used when generating +;;; default values used by `A'. In that case, add `A-markup' to the +;;; property-bindings of B. (This is used when generating ;;; documentation, but won't create bindings.) ;;; ;;; documentation-string ;;; the command documentation string (used to generate manuals) ;;; ;;; body -;;; the command body. The function is supposed to return a stencil. +;;; the command body. The function is supposed to return a stencil. ;;; ;;; Each markup command definition shall have a documentation string ;;; with description, syntax and example. @@ -270,8 +270,8 @@ the PDF backend. " @cindex referencing page numbers in text -Add a link to the page @var{page-number} around @var{arg}. This only works in -the PDF backend. +Add a link to the page @var{page-number} around @var{arg}. This only works +in the PDF backend. @lilypond[verbatim,quote] \\markup { @@ -292,12 +292,14 @@ the PDF backend. " @cindex referencing page labels in text -Add a link to the page holding label @var{label} around @var{arg}. This +Add a link to the page holding label @var{label} around @var{arg}. This only works in the PDF backend. @lilypond[verbatim,quote] \\markup { - \\with-link #\"label\" { \\italic { This links to the page containing the label... } } + \\with-link #\"label\" { + \\italic { This links to the page containing the label... } + } } @end lilypond" (let* ((arg-stencil (interpret-markup layout props arg)) @@ -860,13 +862,15 @@ Inline an image of music. indent = 0.0\\cm \\context { \\Score - \\override RehearsalMark #'break-align-symbols = - #'(time-signature key-signature) - \\override RehearsalMark #'self-alignment-X = #LEFT + \\override RehearsalMark + #'break-align-symbols = #'(time-signature key-signature) + \\override RehearsalMark + #'self-alignment-X = #LEFT } \\context { \\Staff - \\override TimeSignature #'break-align-anchor-alignment = #LEFT + \\override TimeSignature + #'break-align-anchor-alignment = #LEFT } } } @@ -926,6 +930,7 @@ the use of @code{\\simple} is unnecessary. (define-markup-command (tied-lyric layout props str) (string?) #:category music + #:properties ((word-space)) " @cindex simple text strings with tie characters @@ -938,19 +943,18 @@ Like simple-markup, but use tie characters for @q{~} tilde symbols. @end lilypond" (if (string-contains str "~") (let* - ((parts (string-split str #\~)) - (tie-str (ly:wide-char->utf-8 #x203f)) + ((half-space (/ word-space 2)) + (parts (string-split str #\~)) + (tie-str (markup #:hspace half-space + #:musicglyph "ties.lyric" + #:hspace half-space)) (joined (list-join parts tie-str)) (join-stencil (interpret-markup layout props tie-str)) ) (interpret-markup layout - (prepend-alist-chain - 'word-space - (/ (interval-length (ly:stencil-extent join-stencil X)) -3.5) - props) - (make-line-markup joined))) - ;(map (lambda (s) (interpret-markup layout props s)) parts)) + props + (make-concat-markup joined))) (interpret-markup layout props str))) (define-public empty-markup @@ -1335,9 +1339,10 @@ the line width, where @var{X} is the number of staff spaces. \\header { title = \"My title\" myText = \"Lorem ipsum dolor sit amet, consectetur adipisicing - elit, sed do eiusmod tempor incididunt ut labore et dolore magna - aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco - laboris nisi ut aliquip ex ea commodo consequat.\" + elit, sed do eiusmod tempor incididunt ut labore et dolore + magna aliqua. Ut enim ad minim veniam, quis nostrud + exercitation ullamco laboris nisi ut aliquip ex ea commodo + consequat.\" } \\paper { @@ -1678,7 +1683,7 @@ Align @var{arg} in @var{axis} direction to the @var{dir} side. " @cindex setting horizontal text alignment -Set horizontal alignment. If @var{dir} is @code{-1}, then it is +Set horizontal alignment. If @var{dir} is @w{@code{-1}}, then it is left-aligned, while @code{+1} is right. Values in between interpolate alignment accordingly. @@ -2515,13 +2520,13 @@ normal text font, no matter what font was used earlier. @lilypond[verbatim,quote] \\markup { \\huge \\bold \\sans \\caps { - Some text with font overrides + huge bold sans caps \\hspace #2 \\normal-text { - Default text, same font-size + huge normal } \\hspace #2 - More text as before + as before } } @end lilypond" @@ -3500,7 +3505,7 @@ a column containing several lines of text. " @cindex referencing page numbers in text -Reference to a page number. @var{label} is the label set on the referenced +Reference to a page number. @var{label} is the label set on the referenced page (using the @code{\\label} command), @var{gauge} a markup used to estimate the maximum width of the page number, and @var{default} the value to display when @var{label} is not found." @@ -3611,8 +3616,10 @@ Patterns are aligned to the @var{dir} markup. \\fill-with-pattern #1.5 #CENTER - left right \\null \"left-aligned :\" - \\override #'(line-width . 50) \\fill-with-pattern #2 #LEFT : left first - \\override #'(line-width . 50) \\fill-with-pattern #2 #LEFT : left second + \\override #'(line-width . 50) + \\fill-with-pattern #2 #LEFT : left first + \\override #'(line-width . 50) + \\fill-with-pattern #2 #LEFT : left second } @end lilypond" (let* ((pattern-x-extent (ly:stencil-extent (interpret-markup layout props pattern) X)) diff --git a/scm/define-music-types.scm b/scm/define-music-types.scm index 8a3676b2a1..4085957e03 100644 --- a/scm/define-music-types.scm +++ b/scm/define-music-types.scm @@ -55,7 +55,7 @@ context, and 3.@tie{}the context where @var{func} is called.") (ArpeggioEvent . ((description . "Make an arpeggio on this note. -Syntax: @var{note}@code{-\\arpeggio}") +Syntax: @w{@var{note}@code{-\\arpeggio}}") (types . (general-music arpeggio-event event)) )) @@ -67,7 +67,7 @@ Syntax: @var{note}@code{-\\arpeggio}") Syntax: @var{note}@code{x}@code{y}, where @code{x} is a direction (@code{^} for up or @code{_} for down), or LilyPond's choice (no direction specified), and where @code{y} is an articulation -(such as @code{-.}, @code{->}, @code{\\tenuto}, @code{\\downbow}). +(such as @w{@code{-.}}, @w{@code{->}}, @code{\\tenuto}, @code{\\downbow}). See the Notation Reference for details.") (types . (general-music event articulation-event script-event)) )) @@ -111,7 +111,7 @@ Syntax for manual control: @code{c8-[ c c-] c8}") )) (BendAfterEvent - . ((description . "A drop/fall/doit jazz articulation.") + . ((description . "A drop/@/fall/@/doit jazz articulation.") (types . (general-music bend-after-event event)))) (BreathingEvent @@ -609,7 +609,7 @@ octavation.") (TieEvent . ((description . "A tie. -Syntax: @var{note}@code{-~}") +Syntax: @w{@var{note}@code{-~}}") (types . (general-music tie-event event)) )) diff --git a/scm/define-note-names.scm b/scm/define-note-names.scm index 1c8fef1df9..2d85a97ed3 100644 --- a/scm/define-note-names.scm +++ b/scm/define-note-names.scm @@ -965,8 +965,7 @@ '()))) (if (pair? alist) (begin - (if (ly:get-option 'verbose) - (ly:message (_ "Using `~a' note names...") str)) + (ly:debug (_ "Using `~a' note names...") str) (set! pitchnames alist) (ly:parser-set-note-names parser alist)) (ly:warning (_ "Could not find language `~a'. Ignoring.") str)))) diff --git a/scm/define-stencil-commands.scm b/scm/define-stencil-commands.scm index 7b27d5201b..d377342843 100644 --- a/scm/define-stencil-commands.scm +++ b/scm/define-stencil-commands.scm @@ -64,7 +64,7 @@ defined in the output modules (@file{output-*.scm})." (define-public (ly:all-output-backend-commands) "Return the list of extra output backend commands that -are used internally in @file{lily/stencil-interpret.cc}." +are used internally in @file{lily/@/stencil-interpret.cc}." '(color combine-stencil delay-stencil-evaluation diff --git a/scm/display-woodwind-diagrams.scm b/scm/display-woodwind-diagrams.scm index a2b037e294..642e37a34f 100644 --- a/scm/display-woodwind-diagrams.scm +++ b/scm/display-woodwind-diagrams.scm @@ -1872,7 +1872,8 @@ "Make a woodwind-instrument diagram. For example, say @example -\\markup \\woodwind-diagram #'oboe #'((lh . (d ees)) (cc . (five3qT1q)) (rh . (gis))) +\\markup \\woodwind-diagram + #'oboe #'((lh . (d ees)) (cc . (five3qT1q)) (rh . (gis))) @end example @noindent diff --git a/scm/font.scm b/scm/font.scm index db07a6d998..73287b6635 100644 --- a/scm/font.scm +++ b/scm/font.scm @@ -167,7 +167,7 @@ Arguments: @var{design-size-alist} is a list of @code{(rounded . designsize)}. @code{rounded} is a suffix for font filenames, while @code{designsize} should be the actual design size. The latter is used for text fonts -loaded through pango/fontconfig. +loaded through pango/@/fontconfig. @item @var{factor} is a size factor relative to the default size that is being diff --git a/scm/fret-diagrams.scm b/scm/fret-diagrams.scm index acc095a567..9247a115f7 100644 --- a/scm/fret-diagrams.scm +++ b/scm/fret-diagrams.scm @@ -1116,13 +1116,13 @@ If there are multiple fret indicators desired on a string, they should be separated by spaces. @item -Fingerings are given by following the fret number with a @code{-}, +Fingerings are given by following the fret number with a @w{@code{-},} followed by the finger indicator, e.g. @samp{3-2} for playing the third fret with the second finger. @item Where a barre indicator is desired, follow the fret (or fingering) symbol -with @code{-(} to start a barre and @code{-)} to end the barre. +with @w{@code{-(}} to start a barre and @w{@code{-)}} to end the barre. @end itemize" ;; TODO -- change syntax to fret\string-finger diff --git a/scm/lily-library.scm b/scm/lily-library.scm index ede65ff5e2..5b990e7604 100644 --- a/scm/lily-library.scm +++ b/scm/lily-library.scm @@ -852,17 +852,12 @@ print a warning and set an optional @var{default}." scaling)) (define-public (version-not-seen-message input-file-name) - (ly:message - "~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))))) + (ly:warning-located + (ly:format "~a:0" input-file-name) + (_ "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 - "~a:0: ~a ~a" - input-file-name - (_ "warning:") + (ly:warning-located + (ly:format "~a:0" input-file-name) (_ "old relative compatibility not used"))) diff --git a/scm/lily.scm b/scm/lily.scm index e8fb65d4f4..55d989e2d2 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -36,7 +36,7 @@ (debug-enable 'debug) (begin (debug-enable 'backtrace) - (debug-enable 'show-file-name))) + (debug-set! show-file-name #t))) (define-public PLATFORM (string->symbol @@ -121,8 +121,8 @@ jobs.") "If string FOO is given as argument, redirect output to log file `FOO.log'.") (midi-extension ,(if (eq? PLATFORM 'windows) - "mid" - "midi") + "mid" + "midi") "Set the default file extension for MIDI output file to given string.") (music-strings-to-paths #f @@ -179,8 +179,8 @@ second. Dump results to `FILE.stacks' and `FILE.graph'.") (trace-scheme-coverage #f "Record coverage of Scheme files in `FILE.cov'.") - (verbose ,(ly:command-line-verbose?) -"Value of the --verbose flag (read-only).") + (verbose ,(ly:verbose-output?) +"Verbose output, i.e. loglevel at least DEBUG (read-only).") (warning-as-error #f "Change all warning and programming_error messages into errors.") @@ -190,12 +190,12 @@ messages into errors.") ;; initialization depend on these options. (for-each (lambda (x) - (ly:add-option (car x) (cadr x) (caddr x))) - scheme-options-definitions) + (ly:add-option (car x) (cadr x) (caddr x))) + scheme-options-definitions) (for-each (lambda (x) - (ly:set-option (car x) (cdr x))) - (eval-string (ly:command-line-options))) + (ly:set-option (car x) (cdr x))) + (eval-string (ly:command-line-options))) (debug-set! stack 0) @@ -205,17 +205,17 @@ messages into errors.") ;;(set-debug-cell-accesses! 1000) (use-modules (ice-9 regex) - (ice-9 safe) - (ice-9 format) - (ice-9 rdelim) - (ice-9 optargs) - (oop goops) - (srfi srfi-1) - (srfi srfi-13) - (srfi srfi-14) - (scm clip-region) - (scm memory-trace) - (scm coverage)) + (ice-9 safe) + (ice-9 format) + (ice-9 rdelim) + (ice-9 optargs) + (oop goops) + (srfi srfi-1) + (srfi srfi-13) + (srfi srfi-14) + (scm clip-region) + (scm memory-trace) + (scm coverage)) (define-public _ gettext) ;;; There are new modules defined in Guile V2.0 which we need to use. @@ -226,12 +226,10 @@ messages into errors.") (cond ((guile-v2) - (if (ly:get-option 'verbose) - (ly:message (_ "Using (ice-9 curried-definitions) module\n"))) + (ly:debug (_ "Using (ice-9 curried-definitions) module\n")) (use-modules (ice-9 curried-definitions))) (else - (if (ly:get-option 'verbose) - (ly:message (_ "Guile 1.8\n"))))) + (ly:debug (_ "Guile 1.8\n")))) ;; TODO add in modules for V1.8.7 deprecated in V2.0 and integrated ;; into Guile base code, like (ice-9 syncase). @@ -266,9 +264,10 @@ messages into errors.") ;;; Debugging evaluator is slower. This should have a more sensible ;;; default. + (if (or (ly:get-option 'verbose) - (ly:get-option 'trace-memory-frequency) - (ly:get-option 'trace-scheme-coverage)) + (ly:get-option 'trace-memory-frequency) + (ly:get-option 'trace-scheme-coverage)) (begin (ly:set-option 'protected-scheme-parsing #f) (debug-enable 'backtrace) @@ -288,26 +287,27 @@ messages into errors.") (define-public (ly:load x) (let* ((file-name (%search-load-path x))) - (if (ly:get-option 'verbose) - (ly:progress "[~A" file-name)) + (ly:debug "[~A" file-name) (if (not file-name) - (ly:error (_ "cannot find: ~A") x)) + (ly:error (_ "cannot find: ~A") x)) (primitive-load-path file-name) ;; to support Guile V2 autocompile + ;; TODO: Any chance to use ly:debug here? Need to extend it to prevent + ;; a newline in this case (if (ly:get-option 'verbose) - (ly:progress "]\n")))) + (ly:progress "]\n")))) (define-public DOS (let ((platform (string-tokenize - (vector-ref (uname) 0) char-set:letter+digit))) + (vector-ref (uname) 0) char-set:letter+digit))) (if (null? (cdr platform)) #f - (member (string-downcase (cadr platform)) '("95" "98" "me"))))) + (member (string-downcase (cadr platform)) '("95" "98" "me"))))) (define (slashify x) (if (string-index x #\\) x (string-regexp-substitute - "//*" "/" - (string-regexp-substitute "\\\\" "/" x)))) + "//*" "/" + (string-regexp-substitute "\\\\" "/" x)))) (define-public (ly-getcwd) (if (eq? PLATFORM 'windows) @@ -317,12 +317,12 @@ messages into errors.") (define-public (is-absolute? file-name) (let ((file-name-length (string-length file-name))) (if (= file-name-length 0) - #f - (or (eq? (string-ref file-name 0) #\/) - (and (eq? PLATFORM 'windows) - (> file-name-length 2) - (eq? (string-ref file-name 1) #\:) - (eq? (string-ref file-name 2) #\/)))))) + #f + (or (eq? (string-ref file-name 0) #\/) + (and (eq? PLATFORM 'windows) + (> file-name-length 2) + (eq? (string-ref file-name 1) #\:) + (eq? (string-ref file-name 2) #\/)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; If necessary, emulate Guile V2 module_export_all! for Guile V1.8.n @@ -331,13 +331,13 @@ messages into errors.") (define (module-export-all! mod) (define (fresh-interface!) (let ((iface (make-module))) - (set-module-name! iface (module-name mod)) - ;; for guile 2: (set-module-version! iface (module-version mod)) - (set-module-kind! iface 'interface) - (set-module-public-interface! mod iface) - iface)) + (set-module-name! iface (module-name mod)) + ;; for guile 2: (set-module-version! iface (module-version mod)) + (set-module-kind! iface 'interface) + (set-module-public-interface! mod iface) + iface)) (let ((iface (or (module-public-interface mod) - (fresh-interface!)))) + (fresh-interface!)))) (set-module-obarray! iface (module-obarray mod)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -347,19 +347,19 @@ Print a message at LOCATION if any predicate failed." (define (recursion-helper signature arguments count) (define (helper pred? arg count) (if (not (pred? arg)) - (begin - (ly:input-message - location - (format - #f (_ "wrong type for argument ~a. Expecting ~a, found ~s") - count (type-name pred?) arg)) - #f) - #t)) + (begin + (ly:input-message + location + (format + #f (_ "wrong type for argument ~a. Expecting ~a, found ~s") + count (type-name pred?) arg)) + #f) + #t)) (if (null? signature) - #t - (and (helper (car signature) (car arguments) count) - (recursion-helper (cdr signature) (cdr arguments) (1+ count))))) + #t + (and (helper (car signature) (car arguments) count) + (recursion-helper (cdr signature) (cdr arguments) (1+ count))))) (recursion-helper signature arguments 1)) @@ -388,9 +388,9 @@ LilyPond safe mode. The syntax is the same as `define*-public'." (define-safe-public (lilypond-version) (string-join (map (lambda (x) (if (symbol? x) - (symbol->string x) - (number->string x))) - (ly:version)) + (symbol->string x) + (number->string x))) + (ly:version)) ".")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -401,36 +401,43 @@ LilyPond safe mode. The syntax is the same as `define*-public'." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; other files. -(define init-scheme-files +;; +;; List of Scheme files to be loaded into the (lily) module. +;; +;; - Library definitions, need to be at the head of the list +(define init-scheme-files-lib '("lily-library.scm" - "file-cache.scm" + "output-lib.scm")) +;; - Files containing definitions used later by other files later in load +(define init-scheme-files-used + '("markup-macros.scm")) +;; - Main body of files to be loaded +(define init-scheme-files-body + '("file-cache.scm" "define-event-classes.scm" "define-music-callbacks.scm" "define-music-types.scm" "define-note-names.scm" - "output-lib.scm" "c++.scm" - "chord-ignatzek-names.scm" "chord-entry.scm" - "chord-generic-names.scm" "stencil.scm" + "define-markup-commands.scm" "markup.scm" "modal-transforms.scm" + "chord-generic-names.scm" + "chord-ignatzek-names.scm" "music-functions.scm" "part-combiner.scm" "autochange.scm" "define-music-properties.scm" "time-signature-settings.scm" "auto-beam.scm" + "chord-name.scm" "bezier-tools.scm" "parser-ly-from-scheme.scm" "ly-syntax-constructors.scm" "define-context-properties.scm" - ;; guile 1.9 wants markups defined before referenced - "define-markup-commands.scm" - - "chord-name.scm" "translation-functions.scm" "script.scm" "midi.scm" @@ -455,10 +462,19 @@ LilyPond safe mode. The syntax is the same as `define*-public'." "paper.scm" "backend-library.scm" - "x11-color.scm" - - ;; must be after everything has been defined - "safe-lily.scm")) + "x11-color.scm")) +;; - Files to be loaded last +(define init-scheme-files-tail +;; - must be after everything has been defined + '("safe-lily.scm")) +;; +;; Now construct the load list +;; +(define init-scheme-files + (append init-scheme-files-lib + init-scheme-files-used + init-scheme-files-body + init-scheme-files-tail)) (for-each ly:load init-scheme-files) @@ -582,22 +598,22 @@ LilyPond safe mode. The syntax is the same as `define*-public'." (define (profile-measurements) (let* ((t (times)) - (stats (gc-stats))) + (stats (gc-stats))) (list (- (+ (tms:cutime t) - (tms:utime t)) - (assoc-get 'gc-time-taken stats)) - (assoc-get 'total-cells-allocated stats 0)))) + (tms:utime t)) + (assoc-get 'gc-time-taken stats)) + (assoc-get 'total-cells-allocated stats 0)))) (define (dump-profile base last this) (let* ((outname (format #f "~a.profile" (dir-basename base ".ly"))) - (diff (map (lambda (y) (apply - y)) (zip this last)))) + (diff (map (lambda (y) (apply - y)) (zip this last)))) (ly:progress "\nWriting timing to ~a..." outname) (format (open-file outname "w") - "time: ~a\ncells: ~a\n" - (if (ly:get-option 'dump-cpu-profile) - (car diff) - 0) - (cadr diff)))) + "time: ~a\ncells: ~a\n" + (if (ly:get-option 'dump-cpu-profile) + (car diff) + 0) + (cadr diff)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; debug memory leaks @@ -610,61 +626,61 @@ LilyPond safe mode. The syntax is the same as `define*-public'." (define-public (dump-live-object-stats outfile) (for-each (lambda (x) - (format outfile "~a: ~a\n" (car x) (cdr x))) - (sort (gc-live-object-stats) - (lambda (x y) - (stringalist (ly:protects)) - (lambda (a b) - (< (object-address (car a)) - (object-address (car b)))))) - (out-file-name (string-append - "gcstat-" (number->string gc-protect-stat-count) - ".scm")) - (outfile (open-file out-file-name "w"))) + (lambda (a b) + (< (object-address (car a)) + (object-address (car b)))))) + (out-file-name (string-append + "gcstat-" (number->string gc-protect-stat-count) + ".scm")) + (outfile (open-file out-file-name "w"))) (set! gc-dumping #t) (format #t "Dumping GC statistics ~a...\n" out-file-name) (for-each (lambda (y) - (let ((x (car y)) - (c (cdr y))) - (format outfile "~a (~a) = ~a\n" (object-address x) c x))) - (filter - (lambda (x) - (not (symbol? (car x)))) - protects)) + (let ((x (car y)) + (c (cdr y))) + (format outfile "~a (~a) = ~a\n" (object-address x) c x))) + (filter + (lambda (x) + (not (symbol? (car x)))) + protects)) (format outfile "\nprotected symbols: ~a\n" - (apply + (map (lambda (obj-count) - (if (symbol? (car obj-count)) - (cdr obj-count) - 0)) - protects))) + (apply + (map (lambda (obj-count) + (if (symbol? (car obj-count)) + (cdr obj-count) + 0)) + protects))) ;; (display (ly:smob-protects)) (newline outfile) (if (defined? 'gc-live-object-stats) - (let* ((stats #f)) - (display "Live object statistics: GC'ing\n") - (ly:reset-all-fonts) - (gc) - (gc) - (display "Asserting dead objects\n") - (ly:set-option 'debug-gc-assert-parsed-dead #t) - (gc) - (ly:set-option 'debug-gc-assert-parsed-dead #f) - (set! stats (gc-live-object-stats)) - (display "Dumping live object statistics.\n") - (dump-live-object-stats outfile))) + (let* ((stats #f)) + (display "Live object statistics: GC'ing\n") + (ly:reset-all-fonts) + (gc) + (gc) + (display "Asserting dead objects\n") + (ly:set-option 'debug-gc-assert-parsed-dead #t) + (gc) + (ly:set-option 'debug-gc-assert-parsed-dead #f) + (set! stats (gc-live-object-stats)) + (display "Dumping live object statistics.\n") + (dump-live-object-stats outfile))) (newline outfile) (let* ((stats (gc-stats))) (for-each (lambda (sym) - (format outfile "~a ~a ~a\n" - gc-protect-stat-count - sym - (assoc-get sym stats "?"))) - '(protected-objects bytes-malloced cell-heap-size))) + (format outfile "~a ~a ~a\n" + gc-protect-stat-count + sym + (assoc-get sym stats "?"))) + '(protected-objects bytes-malloced cell-heap-size))) (set! gc-dumping #f) (close-port outfile))) @@ -672,23 +688,23 @@ LilyPond safe mode. The syntax is the same as `define*-public'." "Read `/proc/self' to check up on memory use." (define (gulp-file name) (let* ((file (open-input-file name)) - (text (read-delimited "" file))) + (text (read-delimited "" file))) (close file) text)) (let* ((stat (gulp-file "/proc/self/status")) - (lines (string-split stat #\newline)) - (interesting (filter identity - (map - (lambda (l) - (string-match "^VmData:[ \t]*([0-9]*) kB" l)) - lines))) - (mem (string->number (match:substring (car interesting) 1)))) + (lines (string-split stat #\newline)) + (interesting (filter identity + (map + (lambda (l) + (string-match "^VmData:[ \t]*([0-9]*) kB" l)) + lines))) + (mem (string->number (match:substring (car interesting) 1)))) (format #t "VMDATA: ~a\n" mem) (display (gc-stats)) (if (> mem 100000) - (begin (dump-gc-protects) - (raise 1))))) + (begin (dump-gc-protects) + (raise 1))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -697,11 +713,11 @@ LilyPond safe mode. The syntax is the same as `define*-public'." PIDs or the number of the process." (define (helper count acc) (if (> count 0) - (let* ((pid (primitive-fork))) - (if (= pid 0) - (1- count) - (helper (1- count) (cons pid acc)))) - acc)) + (let* ((pid (primitive-fork))) + (if (= pid 0) + (1- count) + (helper (1- count) (cons pid acc)))) + acc)) (helper count '())) @@ -711,9 +727,9 @@ PIDs or the number of the process." "Exit function for lilypond" (if (not silently) (case status - ((0) (ly:success (_ "Compilation successfully completed"))) - ((1) (ly:warning (_ "Compilation completed with warnings or errors"))) - (else (ly:message "")))) + ((0) (ly:success (_ "Compilation successfully completed"))) + ((1) (ly:warning (_ "Compilation completed with warnings or errors"))) + (else (ly:message "")))) (exit status)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -723,141 +739,141 @@ PIDs or the number of the process." (eval-string (ly:command-line-code)) (if (ly:get-option 'help) (begin (ly:option-usage) - (ly:exit 0 #t))) + (ly:exit 0 #t))) (if (ly:get-option 'show-available-fonts) (begin (ly:font-config-display-fonts) - (ly:exit 0 #t))) + (ly:exit 0 #t))) (if (ly:get-option 'gui) (gui-main files)) (if (null? files) (begin (ly:usage) - (ly:exit 2 #t))) + (ly:exit 2 #t))) (if (ly:get-option 'read-file-list) (set! files - (filter (lambda (s) - (> (string-length s) 0)) - (apply append - (map (lambda (f) - (string-split (ly:gulp-file f) #\nl)) - files))))) + (filter (lambda (s) + (> (string-length s) 0)) + (apply append + (map (lambda (f) + (string-split (ly:gulp-file f) #\nl)) + files))))) (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)) - (split-todo (split-list files count)) - (joblist (multi-fork count)) - (errors '())) - (if (not (string-or-symbol? (ly:get-option 'log-file))) - (ly:set-option 'log-file "lilypond-multi-run")) - (if (number? joblist) - (begin (ly:set-option - 'log-file (format #f "~a-~a" - (ly:get-option 'log-file) joblist)) - (set! files (vector-ref split-todo joblist))) - (begin (ly:progress "\nForking into jobs: ~a\n" joblist) - (for-each - (lambda (pid) - (let* ((stat (cdr (waitpid pid)))) - (if (not (= stat 0)) - (set! errors - (acons (list-element-index joblist pid) - stat errors))))) - joblist) - (for-each - (lambda (x) - (let* ((job (car x)) - (state (cdr x)) - (logfile (format #f "~a-~a.log" - (ly:get-option 'log-file) job)) - (log (ly:gulp-file logfile)) - (len (string-length log)) - (tail (substring log (max 0 (- len 1024))))) - (if (status:term-sig state) - (ly:message - "\n\n~a\n" - (format #f (_ "job ~a terminated with signal: ~a") - job (status:term-sig state))) - (ly:message - (_ "logfile ~a (exit ~a):\n~a") - logfile (status:exit-val state) tail)))) - errors) - (if (pair? errors) - (ly:error "Children ~a exited with errors." - (map car errors))) - ;; must overwrite individual entries - (if (ly:get-option 'dump-profile) - (dump-profile "lily-run-total" - '(0 0) (profile-measurements))) - (if (null? errors) - (ly:exit 0 #f) - (ly:exit 1 #f)))))) + (split-todo (split-list files count)) + (joblist (multi-fork count)) + (errors '())) + (if (not (string-or-symbol? (ly:get-option 'log-file))) + (ly:set-option 'log-file "lilypond-multi-run")) + (if (number? joblist) + (begin (ly:set-option + 'log-file (format #f "~a-~a" + (ly:get-option 'log-file) joblist)) + (set! files (vector-ref split-todo joblist))) + (begin (ly:progress "\nForking into jobs: ~a\n" joblist) + (for-each + (lambda (pid) + (let* ((stat (cdr (waitpid pid)))) + (if (not (= stat 0)) + (set! errors + (acons (list-element-index joblist pid) + stat errors))))) + joblist) + (for-each + (lambda (x) + (let* ((job (car x)) + (state (cdr x)) + (logfile (format #f "~a-~a.log" + (ly:get-option 'log-file) job)) + (log (ly:gulp-file logfile)) + (len (string-length log)) + (tail (substring log (max 0 (- len 1024))))) + (if (status:term-sig state) + (ly:message + "\n\n~a\n" + (format #f (_ "job ~a terminated with signal: ~a") + job (status:term-sig state))) + (ly:message + (_ "logfile ~a (exit ~a):\n~a") + logfile (status:exit-val state) tail)))) + errors) + (if (pair? errors) + (ly:error "Children ~a exited with errors." + (map car errors))) + ;; must overwrite individual entries + (if (ly:get-option 'dump-profile) + (dump-profile "lily-run-total" + '(0 0) (profile-measurements))) + (if (null? errors) + (ly:exit 0 #f) + (ly:exit 1 #f)))))) (if (string-or-symbol? (ly:get-option 'log-file)) (ly:stderr-redirect (format #f "~a.log" (ly:get-option 'log-file)) "w")) (let ((failed (lilypond-all files))) (if (ly:get-option 'trace-scheme-coverage) - (begin - (coverage:show-all (lambda (f) - (string-contains f "lilypond"))))) + (begin + (coverage:show-all (lambda (f) + (string-contains f "lilypond"))))) (if (pair? failed) - (begin (ly:error (_ "failed files: ~S") (string-join failed)) - (ly:exit 1 #f)) - (begin - (ly:exit 0 #f))))) + (begin (ly:error (_ "failed files: ~S") (string-join failed)) + (ly:exit 1 #f)) + (begin + (ly:exit 0 #f))))) (define-public (lilypond-all files) (let* ((failed '()) - (separate-logs (ly:get-option 'separate-log-files)) - (ping-log - (if separate-logs - (open-file (if (string-or-symbol? (ly:get-option 'log-file)) - (format #f "~a.log" (ly:get-option 'log-file)) - "/dev/stderr") "a") #f)) - (do-measurements (ly:get-option 'dump-profile)) - (handler (lambda (key failed-file) - (set! failed (append (list failed-file) failed))))) + (separate-logs (ly:get-option 'separate-log-files)) + (ping-log + (if separate-logs + (open-file (if (string-or-symbol? (ly:get-option 'log-file)) + (format #f "~a.log" (ly:get-option 'log-file)) + "/dev/stderr") "a") #f)) + (do-measurements (ly:get-option 'dump-profile)) + (handler (lambda (key failed-file) + (set! failed (append (list failed-file) failed))))) (gc) (for-each (lambda (x) (let* ((start-measurements (if do-measurements - (profile-measurements) - #f)) - (base (dir-basename x ".ly")) - (all-settings (ly:all-options))) - (if separate-logs - (ly:stderr-redirect (format #f "~a.log" base) "w")) - (if ping-log - (format ping-log "Processing ~a\n" base)) - (if (ly:get-option 'trace-memory-frequency) - (mtrace:start-trace (ly:get-option 'trace-memory-frequency))) - (lilypond-file handler x) - (if start-measurements - (dump-profile x start-measurements (profile-measurements))) - (if (ly:get-option 'trace-memory-frequency) - (begin (mtrace:stop-trace) - (mtrace:dump-results base))) - (for-each (lambda (s) - (ly:set-option (car s) (cdr s))) - all-settings) - (ly:set-option 'debug-gc-assert-parsed-dead #t) - (gc) - (ly:set-option 'debug-gc-assert-parsed-dead #f) - (if (ly:get-option 'debug-gc) - (dump-gc-protects) + (profile-measurements) + #f)) + (base (dir-basename x ".ly")) + (all-settings (ly:all-options))) + (if separate-logs + (ly:stderr-redirect (format #f "~a.log" base) "w")) + (if ping-log + (format ping-log "Processing ~a\n" base)) + (if (ly:get-option 'trace-memory-frequency) + (mtrace:start-trace (ly:get-option 'trace-memory-frequency))) + (lilypond-file handler x) + (if start-measurements + (dump-profile x start-measurements (profile-measurements))) + (if (ly:get-option 'trace-memory-frequency) + (begin (mtrace:stop-trace) + (mtrace:dump-results base))) + (for-each (lambda (s) + (ly:set-option (car s) (cdr s))) + all-settings) + (ly:set-option 'debug-gc-assert-parsed-dead #t) + (gc) + (ly:set-option 'debug-gc-assert-parsed-dead #f) + (if (ly:get-option 'debug-gc) + (dump-gc-protects) (ly:reset-all-fonts)))) files) ;; Ensure a notice re failed files is written to aggregate logfile. (if ping-log - (format ping-log "Failed files: ~a\n" failed)) + (format ping-log "Failed files: ~a\n" failed)) (if (ly:get-option 'dump-profile) - (dump-profile "lily-run-total" '(0 0) (profile-measurements))) + (dump-profile "lily-run-total" '(0 0) (profile-measurements))) failed)) (define (lilypond-file handler file-name) (catch 'ly-file-failed - (lambda () (ly:parse-file file-name)) - (lambda (x . args) (handler x file-name)))) + (lambda () (ly:parse-file file-name)) + (lambda (x . args) (handler x file-name)))) (use-modules (scm editor)) @@ -866,27 +882,27 @@ PIDs or the number of the process." (gui-no-files-handler)) (if (not (string? (ly:get-option 'log-file))) (let* ((base (dir-basename (car files) ".ly")) - (log-name (string-append base ".log"))) - (if (not (ly:get-option 'gui)) - (ly:message (_ "Redirecting output to ~a...") log-name)) - (ly:stderr-redirect log-name "w") - (ly:message "# -*-compilation-*-")) + (log-name (string-append base ".log"))) + (if (not (ly:get-option 'gui)) + (ly:message (_ "Redirecting output to ~a...") log-name)) + (ly:stderr-redirect log-name "w") + (ly:message "# -*-compilation-*-")) (let ((failed (lilypond-all files))) - (if (pair? failed) - (begin - ;; ugh - (ly:stderr-redirect "foo" "r") - (system (get-editor-command log-name 0 0 0)) - (ly:error (_ "failed files: ~S") (string-join failed)) - ;; not reached? - (exit 1)) - (ly:exit 0 #f))))) + (if (pair? failed) + (begin + ;; ugh + (ly:stderr-redirect "foo" "r") + (system (get-editor-command log-name 0 0 0)) + (ly:error (_ "failed files: ~S") (string-join failed)) + ;; not reached? + (exit 1)) + (ly:exit 0 #f))))) (define (gui-no-files-handler) (let* ((ly (string-append (ly:effective-prefix) "/ly/")) - ;; FIXME: soft-code, localize - (welcome-ly (string-append ly "Welcome_to_LilyPond.ly")) - (cmd (get-editor-command welcome-ly 0 0 0))) + ;; FIXME: soft-code, localize + (welcome-ly (string-append ly "Welcome_to_LilyPond.ly")) + (cmd (get-editor-command welcome-ly 0 0 0))) (ly:message (_ "Invoking `~a'...\n") cmd) (system cmd) (ly:exit 1 #f))) diff --git a/scm/markup-macros.scm b/scm/markup-macros.scm new file mode 100644 index 0000000000..cccfaccfcb --- /dev/null +++ b/scm/markup-macros.scm @@ -0,0 +1,479 @@ +;;;; This file is part of LilyPond, the GNU music typesetter. +;;;; +;;;; Copyright (C) 2003--2010 Han-Wen Nienhuys +;;;; +;;;; LilyPond is free software: you can redistribute it and/or modify +;;;; it under the terms of the GNU General Public License as published by +;;;; the Free Software Foundation, either version 3 of the License, or +;;;; (at your option) any later version. +;;;; +;;;; LilyPond is distributed in the hope that it will be useful, +;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;;; GNU General Public License for more details. +;;;; +;;;; You should have received a copy of the GNU General Public License +;;;; along with LilyPond. If not, see . + +" +Internally markup is stored as lists, whose head is a function. + + (FUNCTION ARG1 ARG2 ... ) + +When the markup is formatted, then FUNCTION is called as follows + + (FUNCTION GROB PROPS ARG1 ARG2 ... ) + +GROB is the current grob, PROPS is a list of alists, and ARG1.. are +the rest of the arguments. + +The function should return a stencil (i.e. a formatted, ready to +print object). + + +To add a markup command, use the define-markup-command utility. + + (define-markup-command (mycommand layout prop arg1 ...) (arg1-type? ...) + \"my command usage and description\" + ...function body...) + +The command is now available in markup mode, e.g. + + \\markup { .... \\MYCOMMAND #1 argument ... } + +" ; " + +;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; markup definer utilities + +;; For documentation purposes +;; category -> markup functions +(define-public markup-functions-by-category (make-hash-table 150)) +;; markup function -> used properties +(define-public markup-functions-properties (make-weak-key-hash-table 151)) +;; List of markup list functions +(define-public markup-list-functions (make-weak-key-hash-table 151)) + +(use-modules (ice-9 optargs)) + +(defmacro*-public define-markup-command + (command-and-args signature + #:key (category '()) (properties '()) + #:rest body) + " +* Define a COMMAND-markup function after command-and-args and body, +register COMMAND-markup and its signature, + +* add COMMAND-markup to markup-functions-by-category, + +* sets COMMAND-markup markup-signature object property, + +* define a make-COMMAND-markup function. + +Syntax: + (define-markup-command (COMMAND layout props . arguments) + argument-types + [ #:properties properties ] + \"documentation string\" + ...command body...) + +where: + `argument-types' is a list of type predicates for arguments + `properties' a list of (property default-value) lists + +The specified properties are available as let-bound variables in the +command body, using the respective `default-value' as fallback in case +`property' is not found in `props'. `props' itself is left unchanged: +if you want defaults specified in that manner passed down into other +markup functions, you need to adjust `props' yourself. + +The autogenerated documentation makes use of some optional +specifications that are otherwise ignored: + +After `argument-types', you may also specify + [ #:category category ] +where: + `category' is either a symbol or a symbol list specifying the + category for this markup command in the docs. + +As an element of the `properties' list, you may directly use a +COMMANDx-markup symbol instead of a `(prop value)' list to indicate +that this markup command is called by the newly defined command, +adding its properties to the documented properties of the new +command. There is no protection against circular definitions. +" + (let* ((command (car command-and-args)) + (args (cdr command-and-args)) + (command-name (string->symbol (format #f "~a-markup" command))) + (make-markup-name (string->symbol (format #f "make-~a-markup" command)))) + (while (and (pair? body) (keyword? (car body))) + (set! body (cddr body))) + `(begin + ;; define the COMMAND-markup function + ,(let* ((documentation (if (string? (car body)) + (list (car body)) + '())) + (real-body (if (or (null? documentation) + (null? (cdr body))) + body (cdr body)))) + `(define-public (,command-name ,@args) + ,@documentation + (let ,(map (lambda (prop-spec) + (let ((prop (car prop-spec)) + (default-value (if (null? (cdr prop-spec)) + #f + (cadr prop-spec))) + (props (cadr args))) + `(,prop (chain-assoc-get ',prop ,props ,default-value)))) + (filter pair? properties)) + ,@real-body))) + (set! (markup-command-signature ,command-name) (list ,@signature)) + ;; Register the new function, for markup documentation + ,@(map (lambda (category) + `(hashq-set! + (or (hashq-ref markup-functions-by-category ',category) + (let ((hash (make-weak-key-hash-table 151))) + (hashq-set! markup-functions-by-category ',category + hash) + hash)) + ,command-name #t)) + (if (list? category) category (list category))) + ;; Used properties, for markup documentation + (hashq-set! markup-functions-properties + ,command-name + (list ,@(map (lambda (prop-spec) + (cond ((symbol? prop-spec) + prop-spec) + ((not (null? (cdr prop-spec))) + `(list ',(car prop-spec) ,(cadr prop-spec))) + (else + `(list ',(car prop-spec))))) + (if (pair? args) + properties + (list))))) + ;; define the make-COMMAND-markup function + (define-public (,make-markup-name . args) + (let ((sig (list ,@signature))) + (make-markup ,command-name ,(symbol->string make-markup-name) sig args)))))) + +(defmacro*-public define-markup-list-command + (command-and-args signature #:key (properties '()) #:rest body) + "Same as `define-markup-command', but defines a command that, when +interpreted, returns a list of stencils instead of a single one" + (let* ((command (car command-and-args)) + (args (cdr command-and-args)) + (command-name (string->symbol (format #f "~a-markup-list" command))) + (make-markup-name (string->symbol (format #f "make-~a-markup-list" command)))) + (while (and (pair? body) (keyword? (car body))) + (set! body (cddr body))) + `(begin + ;; define the COMMAND-markup-list function + ,(let* ((documentation (if (string? (car body)) + (list (car body)) + '())) + (real-body (if (or (null? documentation) + (null? (cdr body))) + body (cdr body)))) + `(define-public (,command-name ,@args) + ,@documentation + (let ,(map (lambda (prop-spec) + (let ((prop (car prop-spec)) + (default-value (if (null? (cdr prop-spec)) + #f + (cadr prop-spec))) + (props (cadr args))) + `(,prop (chain-assoc-get ',prop ,props ,default-value)))) + (filter pair? properties)) + ,@real-body))) + (set! (markup-command-signature ,command-name) (list ,@signature)) + ;; add the command to markup-list-function-list, for markup documentation + (hashq-set! markup-list-functions ,command-name #t) + ;; Used properties, for markup documentation + (hashq-set! markup-functions-properties + ,command-name + (list ,@(map (lambda (prop-spec) + (cond ((symbol? prop-spec) + prop-spec) + ((not (null? (cdr prop-spec))) + `(list ',(car prop-spec) ,(cadr prop-spec))) + (else + `(list ',(car prop-spec))))) + (if (pair? args) + properties + (list))))) + ;; it's a markup-list command: + (set-object-property! ,command-name 'markup-list-command #t) + ;; define the make-COMMAND-markup-list function + (define-public (,make-markup-name . args) + (let ((sig (list ,@signature))) + (list (make-markup ,command-name + ,(symbol->string make-markup-name) sig args))))))) + +;;;;;;;;;;;;;;; +;;; Utilities for storing and accessing markup commands signature +;;; Examples: +;;; +;;; (set! (markup-command-signature raise-markup) (list number? markup?)) +;;; ==> (# #) +;;; +;;; (markup-command-signature raise-markup) +;;; ==> (# #) +;;; + +(define-public (markup-command-signature-ref markup-command) + "Return markup-command's signature (the 'markup-signature object property)" + (object-property markup-command 'markup-signature)) + +(define-public (markup-command-signature-set! markup-command signature) + "Set markup-command's signature (as object property)" + (set-object-property! markup-command 'markup-signature signature) + signature) + +(define-public markup-command-signature + (make-procedure-with-setter markup-command-signature-ref + markup-command-signature-set!)) + +;;;;;;;;;;;;;;;;;;;;;; +;;; markup type predicates + +(define (markup-function? x) + (and (markup-command-signature x) + (not (object-property x 'markup-list-command)))) + +(define (markup-list-function? x) + (and (markup-command-signature x) + (object-property x 'markup-list-command))) + +(define-public (markup-command-list? x) + "Determine if `x' is a markup command list, ie. a list composed of +a markup list function and its arguments." + (and (pair? x) (markup-list-function? (car x)))) + +(define-public (markup-list? arg) + "Return a true value if `x' is a list of markups or markup command lists." + (define (markup-list-inner? lst) + (or (null? lst) + (and (or (markup? (car lst)) (markup-command-list? (car lst))) + (markup-list-inner? (cdr lst))))) + (not (not (and (list? arg) (markup-list-inner? arg))))) + +(define (markup-argument-list? signature arguments) + "Typecheck argument list." + (if (and (pair? signature) (pair? arguments)) + (and ((car signature) (car arguments)) + (markup-argument-list? (cdr signature) (cdr arguments))) + (and (null? signature) (null? arguments)))) + + +(define (markup-argument-list-error signature arguments number) + "return (ARG-NR TYPE-EXPECTED ARG-FOUND) if an error is detected, or +#f is no error found. +" + (if (and (pair? signature) (pair? arguments)) + (if (not ((car signature) (car arguments))) + (list number (type-name (car signature)) (car arguments)) + (markup-argument-list-error (cdr signature) (cdr arguments) (+ 1 number))) + #f)) + +;; +;; full recursive typecheck. +;; +(define (markup-typecheck? arg) + (or (string? arg) + (and (pair? arg) + (markup-function? (car arg)) + (markup-argument-list? (markup-command-signature (car arg)) + (cdr arg))))) + +;; +;; +;; +;; +(define (markup-thrower-typecheck arg) + "typecheck, and throw an error when something amiss. + +Uncovered - cheap-markup? is used." + + (cond ((string? arg) #t) + ((not (pair? arg)) + (throw 'markup-format "Not a pair" arg)) + ((not (markup-function? (car arg))) + (throw 'markup-format "Not a markup function " (car arg))) + ((not (markup-argument-list? (markup-command-signature (car arg)) + (cdr arg))) + (throw 'markup-format "Arguments failed typecheck for " arg))) + #t) + +;; +;; good enough if you only use make-XXX-markup functions. +;; +(define (cheap-markup? x) + (or (string? x) + (and (pair? x) + (markup-function? (car x))))) + +;; +;; replace by markup-thrower-typecheck for more detailed diagnostics. +;; +(define-public markup? cheap-markup?) + +(define-public (make-markup markup-function make-name signature args) + " Construct a markup object from MARKUP-FUNCTION and ARGS. Typecheck +against SIGNATURE, reporting MAKE-NAME as the user-invoked function. +" + (let* ((arglen (length args)) + (siglen (length signature)) + (error-msg (if (and (> siglen 0) (> arglen 0)) + (markup-argument-list-error signature args 1) + #f))) + (if (or (not (= arglen siglen)) (< siglen 0) (< arglen 0)) + (ly:error (string-append make-name ": " + (_ "Wrong number of arguments. Expect: ~A, found ~A: ~S")) + siglen arglen args)) + (if error-msg + (ly:error + (string-append + make-name ": " + (_ "Invalid argument in position ~A. Expect: ~A, found: ~S.")) + (car error-msg) (cadr error-msg)(caddr error-msg)) + (cons markup-function args)))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; markup constructors +;;; lilypond-like syntax for markup construction in scheme. + +(use-modules (ice-9 receive)) + +(defmacro*-public markup* (#:rest body) + "Same as `markup', for use in a \\notes block." + `(ly:export (markup ,@body))) + + +(define (compile-all-markup-expressions expr) + "Return a list of canonical markups expressions, e.g.: + (#:COMMAND1 arg11 arg12 #:COMMAND2 arg21 arg22 arg23) + ===> + ((make-COMMAND1-markup arg11 arg12) + (make-COMMAND2-markup arg21 arg22 arg23) ...)" + (do ((rest expr rest) + (markps '() markps)) + ((null? rest) (reverse markps)) + (receive (m r) (compile-markup-expression rest) + (set! markps (cons m markps)) + (set! rest r)))) + +(define (keyword->make-markup key) + "Transform a keyword, e.g. #:COMMAND, in a make-COMMAND-markup symbol." + (string->symbol (string-append "make-" (symbol->string (keyword->symbol key)) "-markup"))) + +(define (compile-markup-expression expr) + "Return two values: the first complete canonical markup expression + found in `expr', e.g. (make-COMMAND-markup arg1 arg2 ...), + and the rest expression." + (cond ((and (pair? expr) + (keyword? (car expr))) + ;; expr === (#:COMMAND arg1 ...) + (let ((command (symbol->string (keyword->symbol (car expr))))) + (if (not (pair? (lookup-markup-command command))) + (ly:error (_ "Not a markup command: ~A") command)) + (let* ((sig (markup-command-signature + (car (lookup-markup-command command)))) + (sig-len (length sig))) + (do ((i 0 (1+ i)) + (args '() args) + (rest (cdr expr) rest)) + ((>= i sig-len) + (values (cons (keyword->make-markup (car expr)) (reverse args)) rest)) + (cond ((eqv? (list-ref sig i) markup-list?) + ;; (car rest) is a markup list + (set! args (cons `(list ,@(compile-all-markup-expressions (car rest))) args)) + (set! rest (cdr rest))) + (else + ;; pick up one arg in `rest' + (receive (a r) (compile-markup-arg rest) + (set! args (cons a args)) + (set! rest r)))))))) + ((and (pair? expr) + (pair? (car expr)) + (keyword? (caar expr))) + ;; expr === ((#:COMMAND arg1 ...) ...) + (receive (m r) (compile-markup-expression (car expr)) + (values m (cdr expr)))) + ((and (pair? expr) + (string? (car expr))) ;; expr === ("string" ...) + (values `(make-simple-markup ,(car expr)) (cdr expr))) + (else + ;; expr === (symbol ...) or ((funcall ...) ...) + (values (car expr) + (cdr expr))))) + +(define (compile-all-markup-args expr) + "Transform `expr' into markup arguments" + (do ((rest expr rest) + (args '() args)) + ((null? rest) (reverse args)) + (receive (a r) (compile-markup-arg rest) + (set! args (cons a args)) + (set! rest r)))) + +(define (compile-markup-arg expr) + "Return two values: the desired markup argument, and the rest arguments" + (cond ((null? expr) + ;; no more args + (values '() '())) + ((keyword? (car expr)) + ;; expr === (#:COMMAND ...) + ;; ==> build and return the whole markup expression + (compile-markup-expression expr)) + ((and (pair? (car expr)) + (keyword? (caar expr))) + ;; expr === ((#:COMMAND ...) ...) + ;; ==> build and return the whole markup expression(s) + ;; found in (car expr) + (receive (markup-expr rest-expr) (compile-markup-expression (car expr)) + (if (null? rest-expr) + (values markup-expr (cdr expr)) + (values `(list ,markup-expr ,@(compile-all-markup-args rest-expr)) + (cdr expr))))) + ((and (pair? (car expr)) + (pair? (caar expr))) + ;; expr === (((foo ...) ...) ...) + (values (cons 'list (compile-all-markup-args (car expr))) (cdr expr))) + (else (values (car expr) (cdr expr))))) + +(define (lookup-markup-command-aux symbol) + (let ((proc (catch 'misc-error + (lambda () + (module-ref (current-module) symbol)) + (lambda (key . args) #f)))) + (and (procedure? proc) proc))) + +(define-public (lookup-markup-command code) + (let ((proc (lookup-markup-command-aux + (string->symbol (format #f "~a-markup" code))))) + (and proc (markup-function? proc) + (cons proc (markup-command-signature proc))))) + +(define-public (lookup-markup-list-command code) + (let ((proc (lookup-markup-command-aux + (string->symbol (format #f "~a-markup-list" code))))) + (and proc (markup-list-function? proc) + (cons proc (markup-command-signature proc))))) + +;;;;;;;;;;;;;;;;;;;;;; +;;; used in parser.yy to map a list of markup commands on markup arguments +(define-public (map-markup-command-list commands markups) + "`markups' being a list of markups, eg (markup1 markup2 markup3), +and `commands' a list of commands with their scheme arguments, in reverse order, +eg: ((italic) (raise 4) (bold)), maps the commands on each markup argument, eg: + ((bold (raise 4 (italic markup1))) + (bold (raise 4 (italic markup2))) + (bold (raise 4 (italic markup3)))) +" + (map-in-order (lambda (arg) + (let ((result arg)) + (for-each (lambda (cmd) + (set! result (append cmd (list result)))) + commands) + result)) + markups)) diff --git a/scm/markup.scm b/scm/markup.scm index 3cf774d4a8..47ebe5d2bc 100644 --- a/scm/markup.scm +++ b/scm/markup.scm @@ -15,227 +15,6 @@ ;;;; You should have received a copy of the GNU General Public License ;;;; along with LilyPond. If not, see . -" -Internally markup is stored as lists, whose head is a function. - - (FUNCTION ARG1 ARG2 ... ) - -When the markup is formatted, then FUNCTION is called as follows - - (FUNCTION GROB PROPS ARG1 ARG2 ... ) - -GROB is the current grob, PROPS is a list of alists, and ARG1.. are -the rest of the arguments. - -The function should return a stencil (i.e. a formatted, ready to -print object). - - -To add a markup command, use the define-markup-command utility. - - (define-markup-command (mycommand layout prop arg1 ...) (arg1-type? ...) - \"my command usage and description\" - ...function body...) - -The command is now available in markup mode, e.g. - - \\markup { .... \\MYCOMMAND #1 argument ... } - -" ; " - -;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; markup definer utilities - -;; For documentation purposes -;; category -> markup functions -(define-public markup-functions-by-category (make-hash-table 150)) -;; markup function -> used properties -(define-public markup-functions-properties (make-weak-key-hash-table 151)) -;; List of markup list functions -(define-public markup-list-functions (make-weak-key-hash-table 151)) - -(use-modules (ice-9 optargs)) - -(defmacro*-public define-markup-command - (command-and-args signature - #:key (category '()) (properties '()) - #:rest body) - " -* Define a COMMAND-markup function after command-and-args and body, -register COMMAND-markup and its signature, - -* add COMMAND-markup to markup-functions-by-category, - -* sets COMMAND-markup markup-signature object property, - -* define a make-COMMAND-markup function. - -Syntax: - (define-markup-command (COMMAND layout props . arguments) - argument-types - [ #:properties properties ] - \"documentation string\" - ...command body...) - -where: - `argument-types' is a list of type predicates for arguments - `properties' a list of (property default-value) lists - -The specified properties are available as let-bound variables in the -command body, using the respective `default-value' as fallback in case -`property' is not found in `props'. `props' itself is left unchanged: -if you want defaults specified in that manner passed down into other -markup functions, you need to adjust `props' yourself. - -The autogenerated documentation makes use of some optional -specifications that are otherwise ignored: - -After `argument-types', you may also specify - [ #:category category ] -where: - `category' is either a symbol or a symbol list specifying the - category for this markup command in the docs. - -As an element of the `properties' list, you may directly use a -COMMANDx-markup symbol instead of a `(prop value)' list to indicate -that this markup command is called by the newly defined command, -adding its properties to the documented properties of the new -command. There is no protection against circular definitions. -" - (let* ((command (car command-and-args)) - (args (cdr command-and-args)) - (command-name (string->symbol (format #f "~a-markup" command))) - (make-markup-name (string->symbol (format #f "make-~a-markup" command)))) - (while (and (pair? body) (keyword? (car body))) - (set! body (cddr body))) - `(begin - ;; define the COMMAND-markup function - ,(let* ((documentation (if (string? (car body)) - (list (car body)) - '())) - (real-body (if (or (null? documentation) - (null? (cdr body))) - body (cdr body)))) - `(define-public (,command-name ,@args) - ,@documentation - (let ,(map (lambda (prop-spec) - (let ((prop (car prop-spec)) - (default-value (if (null? (cdr prop-spec)) - #f - (cadr prop-spec))) - (props (cadr args))) - `(,prop (chain-assoc-get ',prop ,props ,default-value)))) - (filter pair? properties)) - ,@real-body))) - (set! (markup-command-signature ,command-name) (list ,@signature)) - ;; Register the new function, for markup documentation - ,@(map (lambda (category) - `(hashq-set! - (or (hashq-ref markup-functions-by-category ',category) - (let ((hash (make-weak-key-hash-table 151))) - (hashq-set! markup-functions-by-category ',category - hash) - hash)) - ,command-name #t)) - (if (list? category) category (list category))) - ;; Used properties, for markup documentation - (hashq-set! markup-functions-properties - ,command-name - (list ,@(map (lambda (prop-spec) - (cond ((symbol? prop-spec) - prop-spec) - ((not (null? (cdr prop-spec))) - `(list ',(car prop-spec) ,(cadr prop-spec))) - (else - `(list ',(car prop-spec))))) - (if (pair? args) - properties - (list))))) - ;; define the make-COMMAND-markup function - (define-public (,make-markup-name . args) - (let ((sig (list ,@signature))) - (make-markup ,command-name ,(symbol->string make-markup-name) sig args)))))) - -(defmacro*-public define-markup-list-command - (command-and-args signature #:key (properties '()) #:rest body) - "Same as `define-markup-command', but defines a command that, when -interpreted, returns a list of stencils instead of a single one" - (let* ((command (car command-and-args)) - (args (cdr command-and-args)) - (command-name (string->symbol (format #f "~a-markup-list" command))) - (make-markup-name (string->symbol (format #f "make-~a-markup-list" command)))) - (while (and (pair? body) (keyword? (car body))) - (set! body (cddr body))) - `(begin - ;; define the COMMAND-markup-list function - ,(let* ((documentation (if (string? (car body)) - (list (car body)) - '())) - (real-body (if (or (null? documentation) - (null? (cdr body))) - body (cdr body)))) - `(define-public (,command-name ,@args) - ,@documentation - (let ,(map (lambda (prop-spec) - (let ((prop (car prop-spec)) - (default-value (if (null? (cdr prop-spec)) - #f - (cadr prop-spec))) - (props (cadr args))) - `(,prop (chain-assoc-get ',prop ,props ,default-value)))) - (filter pair? properties)) - ,@real-body))) - (set! (markup-command-signature ,command-name) (list ,@signature)) - ;; add the command to markup-list-function-list, for markup documentation - (hashq-set! markup-list-functions ,command-name #t) - ;; Used properties, for markup documentation - (hashq-set! markup-functions-properties - ,command-name - (list ,@(map (lambda (prop-spec) - (cond ((symbol? prop-spec) - prop-spec) - ((not (null? (cdr prop-spec))) - `(list ',(car prop-spec) ,(cadr prop-spec))) - (else - `(list ',(car prop-spec))))) - (if (pair? args) - properties - (list))))) - ;; it's a markup-list command: - (set-object-property! ,command-name 'markup-list-command #t) - ;; define the make-COMMAND-markup-list function - (define-public (,make-markup-name . args) - (let ((sig (list ,@signature))) - (list (make-markup ,command-name - ,(symbol->string make-markup-name) sig args))))))) - -(define-public (make-markup markup-function make-name signature args) - "Construct a markup object from @var{markup-function} and @var{args}. -Typecheck against @var{signature}, reporting @var{make-name} as the -user-invoked function." - (let* ((arglen (length args)) - (siglen (length signature)) - (error-msg (if (and (> siglen 0) (> arglen 0)) - (markup-argument-list-error signature args 1) - #f))) - (if (or (not (= arglen siglen)) (< siglen 0) (< arglen 0)) - (ly:error (string-append make-name ": " - (_ "Wrong number of arguments. Expect: ~A, found ~A: ~S")) - siglen arglen args)) - (if error-msg - (ly:error - (string-append - make-name ": " - (_ "Invalid argument in position ~A. Expect: ~A, found: ~S.")) - (car error-msg) (cadr error-msg)(caddr error-msg)) - (cons markup-function args)))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; markup constructors -;;; lilypond-like syntax for markup construction in scheme. - -(use-modules (ice-9 receive)) - (defmacro*-public markup (#:rest body) "The `markup' macro provides a lilypond-like syntax for building markups. @@ -258,252 +37,6 @@ Use `markup*' in a \\notemode context." (car (compile-all-markup-expressions `(#:line ,body)))) -(defmacro*-public markup* (#:rest body) - "Same as `markup', for use in a \\notes block." - `(ly:export (markup ,@body))) - - -(define (compile-all-markup-expressions expr) - "Return a list of canonical markups expressions, e.g.: - (#:COMMAND1 arg11 arg12 #:COMMAND2 arg21 arg22 arg23) - ===> - ((make-COMMAND1-markup arg11 arg12) - (make-COMMAND2-markup arg21 arg22 arg23) ...)" - (do ((rest expr rest) - (markps '() markps)) - ((null? rest) (reverse markps)) - (receive (m r) (compile-markup-expression rest) - (set! markps (cons m markps)) - (set! rest r)))) - -(define (keyword->make-markup key) - "Transform a keyword, e.g. #:COMMAND, in a make-COMMAND-markup symbol." - (string->symbol (string-append "make-" (symbol->string (keyword->symbol key)) "-markup"))) - -(define (compile-markup-expression expr) - "Return two values: the first complete canonical markup expression - found in `expr', e.g. (make-COMMAND-markup arg1 arg2 ...), - and the rest expression." - (cond ((and (pair? expr) - (keyword? (car expr))) - ;; expr === (#:COMMAND arg1 ...) - (let ((command (symbol->string (keyword->symbol (car expr))))) - (if (not (pair? (lookup-markup-command command))) - (ly:error (_ "Not a markup command: ~A") command)) - (let* ((sig (markup-command-signature - (car (lookup-markup-command command)))) - (sig-len (length sig))) - (do ((i 0 (1+ i)) - (args '() args) - (rest (cdr expr) rest)) - ((>= i sig-len) - (values (cons (keyword->make-markup (car expr)) (reverse args)) rest)) - (cond ((eqv? (list-ref sig i) markup-list?) - ;; (car rest) is a markup list - (set! args (cons `(list ,@(compile-all-markup-expressions (car rest))) args)) - (set! rest (cdr rest))) - (else - ;; pick up one arg in `rest' - (receive (a r) (compile-markup-arg rest) - (set! args (cons a args)) - (set! rest r)))))))) - ((and (pair? expr) - (pair? (car expr)) - (keyword? (caar expr))) - ;; expr === ((#:COMMAND arg1 ...) ...) - (receive (m r) (compile-markup-expression (car expr)) - (values m (cdr expr)))) - ((and (pair? expr) - (string? (car expr))) ;; expr === ("string" ...) - (values `(make-simple-markup ,(car expr)) (cdr expr))) - (else - ;; expr === (symbol ...) or ((funcall ...) ...) - (values (car expr) - (cdr expr))))) - -(define (compile-all-markup-args expr) - "Transform `expr' into markup arguments" - (do ((rest expr rest) - (args '() args)) - ((null? rest) (reverse args)) - (receive (a r) (compile-markup-arg rest) - (set! args (cons a args)) - (set! rest r)))) - -(define (compile-markup-arg expr) - "Return two values: the desired markup argument, and the rest arguments" - (cond ((null? expr) - ;; no more args - (values '() '())) - ((keyword? (car expr)) - ;; expr === (#:COMMAND ...) - ;; ==> build and return the whole markup expression - (compile-markup-expression expr)) - ((and (pair? (car expr)) - (keyword? (caar expr))) - ;; expr === ((#:COMMAND ...) ...) - ;; ==> build and return the whole markup expression(s) - ;; found in (car expr) - (receive (markup-expr rest-expr) (compile-markup-expression (car expr)) - (if (null? rest-expr) - (values markup-expr (cdr expr)) - (values `(list ,markup-expr ,@(compile-all-markup-args rest-expr)) - (cdr expr))))) - ((and (pair? (car expr)) - (pair? (caar expr))) - ;; expr === (((foo ...) ...) ...) - (values (cons 'list (compile-all-markup-args (car expr))) (cdr expr))) - (else (values (car expr) (cdr expr))))) - -;;;;;;;;;;;;;;; -;;; Utilities for storing and accessing markup commands signature -;;; Examples: -;;; -;;; (set! (markup-command-signature raise-markup) (list number? markup?)) -;;; ==> (# #) -;;; -;;; (markup-command-signature raise-markup) -;;; ==> (# #) -;;; - -(define-public (markup-command-signature-ref markup-command) - "Return @var{markup-command}'s signature (the @code{'markup-signature} -object property)." - (object-property markup-command 'markup-signature)) - -(define-public (markup-command-signature-set! markup-command signature) - "Set @var{markup-command}'s signature (as object property)." - (set-object-property! markup-command 'markup-signature signature) - signature) - -(define-public markup-command-signature - (make-procedure-with-setter markup-command-signature-ref - markup-command-signature-set!)) - -(define (lookup-markup-command-aux symbol) - (let ((proc (catch 'misc-error - (lambda () - (module-ref (current-module) symbol)) - (lambda (key . args) #f)))) - (and (procedure? proc) proc))) - -(define-public (lookup-markup-command code) - (let ((proc (lookup-markup-command-aux - (string->symbol (format #f "~a-markup" code))))) - (and proc (markup-function? proc) - (cons proc (markup-command-signature proc))))) - -(define-public (lookup-markup-list-command code) - (let ((proc (lookup-markup-command-aux - (string->symbol (format #f "~a-markup-list" code))))) - (and proc (markup-list-function? proc) - (cons proc (markup-command-signature proc))))) - -;;;;;;;;;;;;;;;;;;;;;; -;;; used in parser.yy to map a list of markup commands on markup arguments -(define-public (map-markup-command-list commands markups) - "@var{markups} being a list of markups, for example -@code{(markup1 markup2 markup3)}, and @var{commands} a list of commands with -their scheme arguments, in reverse order, for example -@code{((italic) (raise 4) (bold))}, map the commands on each markup argument, -for example -@example -((bold (raise 4 (italic markup1))) - (bold (raise 4 (italic markup2))) - (bold (raise 4 (italic markup3)))) -@end example" - (map-in-order (lambda (arg) - (let ((result arg)) - (for-each (lambda (cmd) - (set! result (append cmd (list result)))) - commands) - result)) - markups)) - -;;;;;;;;;;;;;;;;;;;;;; -;;; markup type predicates - -(define (markup-function? x) - (and (markup-command-signature x) - (not (object-property x 'markup-list-command)))) - -(define (markup-list-function? x) - (and (markup-command-signature x) - (object-property x 'markup-list-command))) - -(define-public (markup-command-list? x) - "Determine whether @var{x} is a markup command list, i.e. a list -composed of a markup list function and its arguments." - (and (pair? x) (markup-list-function? (car x)))) - -(define-public (markup-list? arg) - "Return @code{#t} if @var{x} is a list of markups or markup command lists." - (define (markup-list-inner? lst) - (or (null? lst) - (and (or (markup? (car lst)) (markup-command-list? (car lst))) - (markup-list-inner? (cdr lst))))) - (not (not (and (list? arg) (markup-list-inner? arg))))) - -(define (markup-argument-list? signature arguments) - "Typecheck argument list." - (if (and (pair? signature) (pair? arguments)) - (and ((car signature) (car arguments)) - (markup-argument-list? (cdr signature) (cdr arguments))) - (and (null? signature) (null? arguments)))) - - -(define (markup-argument-list-error signature arguments number) - "return (ARG-NR TYPE-EXPECTED ARG-FOUND) if an error is detected, or -#f is no error found. -" - (if (and (pair? signature) (pair? arguments)) - (if (not ((car signature) (car arguments))) - (list number (type-name (car signature)) (car arguments)) - (markup-argument-list-error (cdr signature) (cdr arguments) (+ 1 number))) - #f)) - -;; -;; full recursive typecheck. -;; -(define (markup-typecheck? arg) - (or (string? arg) - (and (pair? arg) - (markup-function? (car arg)) - (markup-argument-list? (markup-command-signature (car arg)) - (cdr arg))))) - -;; -;; -;; -;; -(define (markup-thrower-typecheck arg) - "typecheck, and throw an error when something amiss. - -Uncovered - cheap-markup? is used." - - (cond ((string? arg) #t) - ((not (pair? arg)) - (throw 'markup-format "Not a pair" arg)) - ((not (markup-function? (car arg))) - (throw 'markup-format "Not a markup function " (car arg))) - ((not (markup-argument-list? (markup-command-signature (car arg)) - (cdr arg))) - (throw 'markup-format "Arguments failed typecheck for " arg))) - #t) - -;; -;; good enough if you only use make-XXX-markup functions. -;; -(define (cheap-markup? x) - (or (string? x) - (and (pair? x) - (markup-function? (car x))))) - -;; -;; replace by markup-thrower-typecheck for more detailed diagnostics. -;; -(define-public markup? cheap-markup?) - ;; utility (define (markup-join markups sep) @@ -518,12 +51,12 @@ Uncovered - cheap-markup? is used." (define-public (interpret-markup-list layout props markup-list) (let ((stencils (list))) (for-each (lambda (m) - (set! stencils - (if (markup-command-list? m) - (append! (reverse! (apply (car m) layout props (cdr m))) - stencils) - (cons (interpret-markup layout props m) stencils)))) - markup-list) + (set! stencils + (if (markup-command-list? m) + (append! (reverse! (apply (car m) layout props (cdr m))) + stencils) + (cons (interpret-markup layout props m) stencils)))) + markup-list) (reverse! stencils))) (define-public (prepend-alist-chain key val chain) @@ -532,15 +65,15 @@ Uncovered - cheap-markup? is used." (define-public (stack-stencil-line space stencils) "DOCME" (if (and (pair? stencils) - (ly:stencil? (car stencils))) + (ly:stencil? (car stencils))) (if (and (pair? (cdr stencils)) - (ly:stencil? (cadr stencils))) + (ly:stencil? (cadr stencils))) (let* ((tail (stack-stencil-line space (cdr stencils))) (head (car stencils)) (xoff (+ space (interval-length (ly:stencil-extent head X))))) (ly:stencil-add head - (ly:stencil-translate-axis tail xoff X))) + (ly:stencil-translate-axis tail xoff X))) (car stencils)) (ly:make-stencil '() '(0 . 0) '(0 . 0)))) @@ -550,57 +83,57 @@ Uncovered - cheap-markup? is used." (define-public (markup->string m) ;; markup commands with one markup argument, formatting ignored (define markups-first-argument '(list - bold-markup box-markup caps-markup dynamic-markup finger-markup - fontCaps-markup huge-markup italic-markup large-markup larger-markup - medium-markup normal-size-sub-markup normal-size-super-markup - normal-text-markup normalsize-markup number-markup roman-markup - sans-markup simple-markup small-markup smallCaps-markup smaller-markup - sub-markup super-markup teeny-markup text-markup tiny-markup - typewriter-markup underline-markup upright-markup bracket-markup - circle-markup hbracket-markup parenthesize-markup rounded-box-markup - - center-align-markup center-column-markup column-markup dir-column-markup - fill-line-markup justify-markup justify-string-markup left-align-markup - left-column-markup line-markup right-align-markup right-column-markup - vcenter-markup wordwrap-markup wordwrap-string-markup )) + bold-markup box-markup caps-markup dynamic-markup finger-markup + fontCaps-markup huge-markup italic-markup large-markup larger-markup + medium-markup normal-size-sub-markup normal-size-super-markup + normal-text-markup normalsize-markup number-markup roman-markup + sans-markup simple-markup small-markup smallCaps-markup smaller-markup + sub-markup super-markup teeny-markup text-markup tiny-markup + typewriter-markup underline-markup upright-markup bracket-markup + circle-markup hbracket-markup parenthesize-markup rounded-box-markup + + center-align-markup center-column-markup column-markup dir-column-markup + fill-line-markup justify-markup justify-string-markup left-align-markup + left-column-markup line-markup right-align-markup right-column-markup + vcenter-markup wordwrap-markup wordwrap-string-markup )) ;; markup commands with markup as second argument, first argument ;; specifies some formatting and is ignored (define markups-second-argument '(list - abs-fontsize-markup fontsize-markup magnify-markup lower-markup - pad-around-markup pad-markup-markup pad-x-markup raise-markup - halign-markup hcenter-in-markup rotate-markup translate-markup - translate-scaled-markup with-url-markup scale-markup )) + abs-fontsize-markup fontsize-markup magnify-markup lower-markup + pad-around-markup pad-markup-markup pad-x-markup raise-markup + halign-markup hcenter-in-markup rotate-markup translate-markup + translate-scaled-markup with-url-markup scale-markup )) ;; helper functions to handle string cons like string lists (define (markup-cons->string-cons c) (if (not (pair? c)) (markup->string c) - (cons (markup->string (car c)) (markup-cons->string-cons (cdr c))))) + (cons (markup->string (car c)) (markup-cons->string-cons (cdr c))))) (define (string-cons-join c) (if (not (pair? c)) c (string-join (list (car c) (string-cons-join (cdr c))) ""))) (cond - ((string? m) m) - ((null? m) "") + ((string? m) m) + ((null? m) "") - ;; handle \concat (string-join without spaces) - ((and (pair? m) (equal? (car m) concat-markup)) - (string-cons-join (markup-cons->string-cons (cadr m))) ) + ;; handle \concat (string-join without spaces) + ((and (pair? m) (equal? (car m) concat-markup)) + (string-cons-join (markup-cons->string-cons (cadr m))) ) - ;; markup functions with the markup as first arg - ((member (car m) (primitive-eval markups-first-argument)) - (markup->string (cadr m))) + ;; markup functions with the markup as first arg + ((member (car m) (primitive-eval markups-first-argument)) + (markup->string (cadr m))) - ;; markup functions with markup as second arg - ((member (car m) (primitive-eval markups-second-argument)) - (markup->string (cddr m))) + ;; markup functions with markup as second arg + ((member (car m) (primitive-eval markups-second-argument)) + (markup->string (cddr m))) - ;; ignore all other markup functions - ((markup-function? (car m)) "") + ;; ignore all other markup functions + ((markup-function? (car m)) "") - ;; handle markup lists - ((list? m) - (string-join (map markup->string m) " ")) + ;; handle markup lists + ((list? m) + (string-join (map markup->string m) " ")) - (else "ERROR, unable to extract string from markup"))) + (else "ERROR, unable to extract string from markup"))) diff --git a/scm/music-functions.scm b/scm/music-functions.scm index 3394ed1b3b..8cdd53955f 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -650,21 +650,6 @@ NUMBER is 0-base, i.e., Voice=1 (upstems) has number 0. (set! (ly:grob-property grob symbol) val)))) -;; -(define-public (smart-bar-check n) - "Make a bar check that checks for a specific bar number." - (let ((m (make-music 'ApplyContext))) - (define (checker tr) - (let* ((bn (ly:context-property tr 'currentBarNumber))) - (or (= bn n) - (ly:error - ;; FIXME: uncomprehensable message - (_ "Bar check failed. Expect to be at ~a, instead at ~a") - n bn)))) - (set! (ly:music-property m 'procedure) checker) - m)) - - (define-public (skip->rest mus) "Replace @var{mus} by @code{RestEvent} of the same duration if it is a @code{SkipEvent}. Useful for extracting parts from crowded scores." @@ -692,12 +677,17 @@ NUMBER is 0-base, i.e., Voice=1 (upstems) has number 0. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; warn for bare chords at start. - (define-public (ly:music-message music msg) (let ((ip (ly:music-property music 'origin))) (if (ly:input-location? ip) - (ly:input-message ip msg) - (ly:warning msg)))) + (ly:input-message ip msg) + (ly:message msg)))) + +(define-public (ly:music-warning music msg) + (let ((ip (ly:music-property music 'origin))) + (if (ly:input-location? ip) + (ly:input-warning ip msg) + (ly:warning msg)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -842,7 +832,7 @@ Syntax: (set! (ly:music-property music 'quoted-events) quoted-vector) (set! (ly:music-property music 'iterator-ctor) ly:quote-iterator::constructor)) - (ly:music-message music (ly:format (_ "cannot find quoted music: `~S'") quoted-name)))) + (ly:music-warning music (ly:format (_ "cannot find quoted music: `~S'") quoted-name)))) music)) @@ -1114,7 +1104,7 @@ active pitch in any octave. @var{laziness} states over how many bars an accidental should be remembered. @code{0}@tie{}is the default -- accidental lasts over 0@tie{}bar lines, that is, to the end of current measure. A positive integer means that the -accidental lasts over that many bar lines. @code{-1} is `forget +accidental lasts over that many bar lines. @w{@code{-1}} is `forget immediately', that is, only look at key signature. @code{#t} is `forever'." (check-pitch-against-signature context pitch barnum laziness octaveness)) diff --git a/scm/part-combiner.scm b/scm/part-combiner.scm index 8c779a91ee..c492701c91 100644 --- a/scm/part-combiner.scm +++ b/scm/part-combiner.scm @@ -594,4 +594,4 @@ the mark when there are no spanners active. (if (not (null? quote-contents)) (hash-set! tab name (list->vector (reverse! quote-contents '()))) - (ly:music-message mus (ly:format (_ "quoted music `~a' is empty") name))))) + (ly:music-warning mus (ly:format (_ "quoted music `~a' is empty") name))))) diff --git a/scm/ps-to-png.scm b/scm/ps-to-png.scm index 80bb58abcc..caffb9aeda 100644 --- a/scm/ps-to-png.scm +++ b/scm/ps-to-png.scm @@ -84,7 +84,7 @@ (my-system be-verbose #t (format #f - "pngtopnm ~a | pnmscale -reduce ~a 2>/dev/null | pnmtopng -compression 9 2>/dev/null > ~a" + "pngtopnm \"~a\" | pnmscale -reduce ~a 2>/dev/null | pnmtopng -compression 9 2>/dev/null > \"~a\"" old factor file)) (delete-file old))) diff --git a/scm/script.scm b/scm/script.scm index 417df4cbee..4d6dc05a8e 100644 --- a/scm/script.scm +++ b/scm/script.scm @@ -175,7 +175,6 @@ . ( (script-stencil . (feta . ("uportato" . "dportato"))) (avoid-slur . around) - (slur-padding . 0.3) (padding . 0.45) (side-relative-direction . ,DOWN))) ("prall" @@ -300,7 +299,6 @@ (avoid-slur . around) (padding . 0.50) (direction . ,UP) - (slur-padding . 0.2) (staff-padding . 0.5))) ("trill" . ( diff --git a/scripts/abc2ly.py b/scripts/abc2ly.py index 8adc6e4ac5..ac99b292b5 100644 --- a/scripts/abc2ly.py +++ b/scripts/abc2ly.py @@ -1332,6 +1332,7 @@ def parse_file (fn): orig_ln = ln + ln = junk_space (ln, state) ln = try_parse_header_line (ln, state) # Try nibbling characters off until the line doesn't change. diff --git a/scripts/build/extract_texi_filenames.py b/scripts/build/extract_texi_filenames.py index 7dd41eeade..a3577ae830 100644 --- a/scripts/build/extract_texi_filenames.py +++ b/scripts/build/extract_texi_filenames.py @@ -131,8 +131,8 @@ def expand_includes (m, filename): return extract_sections (filepath)[1] if not (include_name in known_missing_files): # Not found - print 'No such file: ' + include_name - print 'Search path: ' + ':'.join (include_path) + print 'Warning: No such file: ' + include_name + \ + ' (search path: ' + ':'.join (include_path)+')' return '' lang_re = re.compile (r'^@documentlanguage (.+)', re.M) diff --git a/scripts/build/lys-to-tely.py b/scripts/build/lys-to-tely.py index c4e387547b..4b2e232053 100644 --- a/scripts/build/lys-to-tely.py +++ b/scripts/build/lys-to-tely.py @@ -92,7 +92,7 @@ for opt in options: texi_file_re = re.compile ('.*\.i?te(ly|xi)$') html_file_re = re.compile ('.*\.i?htm(l)?$') -xml_file_re = re.compile ('.*\.i?xml$') +xml_file_re = re.compile ('.*\.i?(xm|mx)l$') tex_file_re = re.compile ('.*\.i?(la)?tex$') pdf_file_re = re.compile ('.*\.i?pdf$') @@ -101,7 +101,7 @@ def name2line (n): # We have a texi include file, simply include it: s = r"@include %s" % os.path.basename (n) elif (html_file_re.match (n) or pdf_file_re.match (n) or - xml_file_re.match (n) or tex_file_re.match (n)): + tex_file_re.match (n)): s = r""" @ifhtml @html @@ -110,7 +110,19 @@ def name2line (n): @end html @end ifhtml """ % (os.path.basename (n), os.path.basename (n)) - return s + + elif (xml_file_re.match (n)): + # Assume it's a MusicXML file -> convert, create image etc. + s = r""" +@ifhtml +@html + +@end html +@end ifhtml + +@musicxmlfile[%s]{%s} +""" % (os.path.basename (n), fragment_options, n) + else: # Assume it's a lilypond file -> create image etc. s = r""" diff --git a/scripts/build/output-distance.py b/scripts/build/output-distance.py index 537363b63a..59499d16ac 100644 --- a/scripts/build/output-distance.py +++ b/scripts/build/output-distance.py @@ -314,7 +314,9 @@ class SystemLink: self.geometric_distance ()) def scheme_float (s) : - return float(s) if 'nan' not in s else float(s.split('.')[0]) + if 'nan' not in s : + return float(s) + return float(s.split('.')[0]) def read_signature_file (name): print 'reading', name diff --git a/scripts/midi2ly.py b/scripts/midi2ly.py index 1923d3b880..1a21c66515 100644 --- a/scripts/midi2ly.py +++ b/scripts/midi2ly.py @@ -975,7 +975,7 @@ def convert_midi (in_file, out_file): s = tag s += r''' -\version "2.13.53" +\version "2.14.0" ''' s += r''' diff --git a/tex/texinfo.tex b/tex/texinfo.tex index 91408263bc..caab907e0e 100644 --- a/tex/texinfo.tex +++ b/tex/texinfo.tex @@ -6051,6 +6051,12 @@ end \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing = t% + % + % If this cartouche directly follows a sectioning command, we need the + % \parskip glue (backspaced over by default) or the cartouche can + % collide with the section heading. + \ifnum\lastpenalty>10000 \vskip\parskip \fi + % \vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop