From: Graham Percival Date: Mon, 15 Aug 2011 21:13:52 +0000 (+0100) Subject: Merge remote branch 'origin' into release/unstable X-Git-Tag: release/2.15.9-1~10 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=84e144718964f20c48ff8dccaea8de9741df07e4;hp=79c49ea956dccb12ff32e04f154798965477c5f2;p=lilypond.git Merge remote branch 'origin' into release/unstable --- diff --git a/Documentation/changes.tely b/Documentation/changes.tely index fcfd6ed68b..1c210579fa 100644 --- a/Documentation/changes.tely +++ b/Documentation/changes.tely @@ -61,6 +61,10 @@ which scares away people. @end ignore +@item +New command-line option @code{--loglevel=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/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/programming-work.itexi b/Documentation/contributor/programming-work.itexi index e64fa1673a..b90042d7a3 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:: @@ -712,6 +713,145 @@ 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 +@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 @code{--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. All other functions by default start their +output on a new line. + +@unnumberedsubsec All logging functions at a glance + +Currently, there are no particular message functions for the INFO loglevel, +so it is basically identical to PROGRESS. + + +@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)} @c WARN +@tab @code{Input::warning (msg)} @c WARN + +@item BASIC +@tab @code{successful (msg)} +@tab - + +@item PROGRESS +@tab @code{progress_indication (msg)}, @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 @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 (ly:progress msg args), (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 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/de/notation/vocal.itely b/Documentation/de/notation/vocal.itely index d0382e8e7d..71af9dd1eb 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/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/fr/notation/notation-appendices.itely b/Documentation/fr/notation/notation-appendices.itely index e6e8a4c7db..980ce5bc12 100644 --- a/Documentation/fr/notation/notation-appendices.itely +++ b/Documentation/fr/notation/notation-appendices.itely @@ -605,6 +605,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:: @@ -791,6 +792,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/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 0f17e67f85..187ddbca65 100644 --- a/Documentation/included/authors.itexi +++ b/Documentation/included/authors.itexi @@ -35,10 +35,19 @@ @itemize +@item Bertrand Bordage: +@email{bordage.bertrand@@gmail.com}, +Core developer, font designer + @item Trevor Daniels: @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}, @@ -148,7 +157,6 @@ Core developer, Schemer extraordinaire @c use commas not colons -Bertrand Bordage, Karin Hoethker, Jan Warchoł 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/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/learning/common-notation.itely b/Documentation/ja/learning/common-notation.itely index 085cf13722..8578359beb 100644 --- a/Documentation/ja/learning/common-notation.itely +++ b/Documentation/ja/learning/common-notation.itely @@ -1420,7 +1420,8 @@ aFivePaper = \paper @{ paperheight = 21.0 \cm @} @end example ファイルが処理されると、タイトルと作曲者は楽譜の上に譜刻されます。@c -タイトルについての更なる情報は、@ruser{Creating titles} を参照してください。 +タイトルについての更なる情報は、@ruser{タイトル、ヘッダ、フッタを作成する} +を参照してください。 @node 絶対音符名 diff --git a/Documentation/ja/notation.tely b/Documentation/ja/notation.tely index 7eb7596dee..4424aa0d41 100644 --- a/Documentation/ja/notation.tely +++ b/Documentation/ja/notation.tely @@ -49,7 +49,7 @@ Copyright @copyright{} 1999--2009 by 著作者一同 * 音楽記譜法:: ほとんどすべての楽譜作成で使用される記譜法 * Specialist notation:: 特別な目的でのみ使用される記譜法 * 入出力全般:: LilyPond 入力についての一般的な情報 -* Spacing issues:: 出力の表示 +* スペースの問題:: 出力の表示 * Changing defaults:: 出力の調整 付録 @@ -64,10 +64,7 @@ Copyright @copyright{} 1999--2009 by 著作者一同 @ignore @menu -* 音楽記譜法:: ほとんどすべての楽譜作成で使用される記譜法 * 専門的な記譜法:: 特別な目的でのみ使用される記譜法 -* 入出力全般:: LilyPond 入力についての一般的な情報 -* スペースの問題:: 出力の表示 * デフォルトを変更する:: 出力の調整 付録 diff --git a/Documentation/ja/notation/input.itely b/Documentation/ja/notation/input.itely index aa6f18f267..280b93b7de 100644 --- a/Documentation/ja/notation/input.itely +++ b/Documentation/ja/notation/input.itely @@ -545,15 +545,15 @@ foo = @{ c4 d e d @} 楽譜の中にはさらに多くの情報を含むものもあります。 @menu -* タイトル、ヘッダそれにフッタを作成する:: -* カスタム ヘッダ、フッタそれにタイトル:: +* タイトル、ヘッダ、フッタを作成する:: +* カスタム ヘッダ、フッタ、タイトル:: * ページ番号の参照:: * 目次:: @end menu -@node タイトル、ヘッダそれにフッタを作成する -@subsection タイトル、ヘッダそれにフッタを作成する +@node タイトル、ヘッダ、フッタを作成する +@subsection タイトル、ヘッダ、フッタを作成する @translationof Creating titles, headers, and footers @menu @@ -815,8 +815,8 @@ book のメイン タイトル ブロックのテキスト フィールドはす タグラインを削除するには、@code{tagline} に @code{##f} をセットします。 -@node カスタム ヘッダ、フッタそれにタイトル -@subsection カスタム ヘッダ、フッタそれにタイトル +@node カスタム ヘッダ、フッタ、タイトル +@subsection カスタム ヘッダ、フッタ、タイトル @translationof Custom headers footers and titles @c TODO: somewhere put a link to header spacing info diff --git a/Documentation/ja/notation/spacing.itely b/Documentation/ja/notation/spacing.itely new file mode 100644 index 0000000000..3c3c94f776 --- /dev/null +++ b/Documentation/ja/notation/spacing.itely @@ -0,0 +1,3640 @@ +@c -*- coding: utf-8; mode: texinfo; documentlanguage: ja -*- + +@ignore + Translation of GIT committish: 0af52987f3694217fa81c29bd4fdc0443d2fac49 + + When revising a translation, copy the HEAD committish of the + version that you are working on. For details, see the Contributors' + Guide, node Updating translation committishes.. +@end ignore + +@c \version "2.14.0" + + +@c Translators: Yoshiki Sawada +@c Translation status: post-GDP + + +@ignore +GDP TODO list + +Negative numbers are allowed: +> Are you sure? The following works well +> \paper{ +> first-page-number = -2 +> } +> and prints page number -1 on the second page, for example. + + +In 5.2.1 the @refbugs (line 495 in spacing.itely on master) it +states: + +"@code{layout-set-staff-size} does not change the distance between +the +staff lines." + +Could we add a sentence: +"Use instead the pair fontSize = #@var{N} + \override StaffSymbol #'staff-space = #(magstep +@var{N}) +inside the Staff context to change the size of the font and the +distance between +staff lines accordingly." + +Actually I found, that the @internalsref{StaffSymbol} at line 481 +sends to an incomplete +documentation. The property staff-space is not explained here. I +thought Y-extent might be of +help, but it is in turn explained by x-space which again is +missing from the list. Who has the +knowledge to fix this? + + +Clarify +http://code.google.com/p/lilypond/issues/detail?id=68 + +@end ignore + + +@node スペースの問題 +@chapter スペースの問題 +@translationof Spacing issues + +紙面全体のレイアウトは 3 つの要素によって決定されます: +ページ レイアウト、改行、そしてスペースです。@c +これらはすべて互いに影響を与え合います。@c +スペース入れ方を選択することは音楽システムを@c +どれくらいの密度で譜刻するかを決定します。@c +これは改行をどこに挿入するかに影響を与え、@c +それゆえ最終的には、@c +楽曲が占めるページ数を決定します + +大雑把に言って、@c +このプロセスには 4 つのステップがあります: +最初に、演奏時間に基づいて可変距離 (@q{スプリング}) が選択されます。@c +とり得る改行の組み合わせがすべて試され、@c +相対的に @q{悪い} 楽譜が算出されます。@c +それから、起こり得るシステムの高さが推定されます。 +最後に、@c +水平方向と垂直方向のスペースが混み合いすぎたり、@c +広がりすぎたりしないように、@c +改ページと改行の組み合わせが選択されます。 + +2 タイプのブロックがレイアウト設定を保持できます: +@code{\paper @{@dots{}@}} と @code{\layout @{@dots{}@}} です。@c +@code{\paper} ブロックは book のすべての score で共通の@c +ページ レイアウト設定を保持します +-- ページの高さやページ番号を表示するか等です。@c +@ref{ページ レイアウト} を参照してください。@c +@code{\layout} ブロックは score のレイアウトを保持します +-- システム数や譜グループ間の間隔等です。@c +@ref{ページ レイアウト} を参照してください。@c + +@menu +* ページ レイアウト:: +* 楽譜レイアウト:: +* 改行/改ページ:: +* 垂直方向のスペース:: +* 水平方向のスペース:: +* 音楽を少ないページに収める:: +@end menu + +@node ページ レイアウト +@section ページ レイアウト +@translationof Page layout + +このセクションでは @code{\paper} ブロックで使用するページ レイアウト +オプションについて説明します。 + +@menu +* \paper ブロック:: +* 紙面サイズと自動拡縮:: +* 固定された垂直方向の \paper スペース変数:: +* 可変な垂直方向の \paper スペース変数:: +* 水平方向の \paper スペース変数:: +* 他の \paper 変数:: +@end menu + + +@node \paper ブロック +@subsection @code{\paper} ブロック +@translationof The \paper block + +@code{\paper} ブロックは、@code{\book} ブロック内に配置することができますが、@c +@code{\score} ブロック内に配置することはできません。@c +@code{\paper} ブロックでの設定は book 全体に適用されます。@c +book が複数の score を含む場合も、すべての score に適用されます。@c +@code{\paper} ブロックで可能な設定には以下のものがあります: + +@itemize + +@item +@code{set-paper-size} Scheme 関数 + +@item +ページ レイアウトをカスタマイズするのに用いられる @code{\paper} 変数 + +@item +ヘッダ、フッタ、それにタイトルのレイアウトを@c +カスタマイズするのに用いられるマークアップ定義 + +@end itemize + +@code{set-paper-size} 関数は次のセクション +@ref{紙面サイズと自動拡縮} +で説明します。@c +ページ レイアウトを扱う @code{\paper} 変数は後のセクションで説明します。@c +ヘッダ、フッタ、それにタイトルを扱うマークアップ定義は +@ref{カスタム ヘッダ、フッタ、タイトル} で説明します。 + +たいていの @code{\paper} 変数は @code{\paper} ブロック内でのみ機能します。@c +@code{\layout} ブロック内でも機能するいくつかの @code{\paper} 変数を@c +@ref{\layout ブロック} でリスト アップしています。 + +ページの長さに関係する @code{\paper} 変数の単位は、@c +ユーザによって他の単位が指定されていなければ、@c +ミリメーターです。@c +例えば、以下の宣言は @code{top-margin} を @code{10mm} に設定します: + +@example +\paper @{ + top-margin = 10 +@} +@end example + +@code{top-margin} を @code{0.5} インチに設定するには、@c +単位接尾辞 @code{\in} を使用します: + +@example +\paper @{ + top-margin = 0.5\in +@} +@end example + +利用可能な単位接尾辞は @code{\mm}, @code{\cm}, @code{\in}, +それに @code{\pt} です。@c +これらの単位はミリメーターから変換するための値であり、@c +@file{ly/paper-defaults-init.ly} で定義されています。@c +技術的には必要はありませんが、明快さのために、@c +ミリメーターを用いる場合であっても @code{\mm} をコードに記述します。 + +Scheme を用いて @code{\paper} の値を定義することも可能です。@c +上の例と等価な Scheme は以下のようになります: + +@example +\paper @{ + #(define top-margin (* 0.5 in)) +@} +@end example + +@seealso +記譜法リファレンス: +@ref{紙面サイズと自動拡縮}, +@ref{カスタム ヘッダ、フッタ、タイトル}, +@ref{\layout ブロック} + +インストールされているファイル: +@file{ly/paper-defaults-init.ly} + + +@node 紙面サイズと自動拡縮 +@subsection 紙面サイズと自動拡縮 +@translationof Paper size and automatic scaling + +@cindex paper size (紙面サイズ) +@cindex page size (ページ サイズ) + +@funindex \paper + +@menu +* 紙面サイズを設定する:: +* 紙面サイズに応じた自動拡縮:: +@end menu + + +@node 紙面サイズを設定する +@unnumberedsubsubsec 紙面サイズを設定する +@translationof Setting paper size + +紙面サイズを変更するために 2 つの関数が利用可能です: +@code{set-default-paper-size} と @code{set-paper-size} です。 +@code{set-default-paper-size} は最上位スコープに配置する必要があり、@c +and @code{set-paper-size} は @code{\paper} ブロックの中に@c +配置する必要があります: + +@example +#(set-default-paper-size "a4") +@end example + +@example +\paper @{ + #(set-paper-size "a4") +@} +@end example + +@noindent +最上位スコープにおいて、@c +@code{set-default-paper-size} 関数はどこにあっても@c +最初の @code{\paper} ブロックより先に安全に呼び出されます。@c +@code{\paper} ブロック内において、@c +最も安全に @code{set-paper-size} を呼び出せる場所はブロックの先頭、@c +変数宣言の上です。@c +この理由は、@ref{紙面サイズに応じた自動拡縮} で説明しています。 + +@code{set-default-paper-size} はすべてのページのサイズをセットします。@c +一方、@code{set-paper-size} は、@c +その @code{\paper} ブロックが適用されたページのサイズのみをセットします。@c +例えば、@code{\paper} ブロックがファイルの先頭にある場合、@c +その紙面サイズはすべてのページに適用されます。@c +@code{\paper} ブロックが @code{\book} の中にある場合、@c +紙面サイズはその book にのみ適用されます。 + +@code{a4}, @code{letter}, @code{legal}, それに @code{11x17} +(タブロイド サイズとも呼ばれます) +などの一般的な紙面サイズを利用することができます。@c +さらに多くの紙面サイズがデフォルトでサポートされています。@c +詳細は @file{scm/paper.scm} を参照して、@c +@code{paper-alist} の定義を探してください。 + +@c TODO add a new appendix for paper sizes (auto-generated) -pm + +@warning{デフォルトの紙面サイズは @code{a4} です。} + +初期ファイル @file{scm/paper.scm} の中にある +@code{paper-alist} の定義を編集することにより、@c +紙面サイズを追加することができます。@c +しかしながら、追加した紙面サイズは、@c +その後のインストールにより上書きされてしまいます。 + +@cindex orientation (縦長の紙面) +@cindex landscape (横長の紙面) + +@code{set-default-paper-size} への引数として@c +シンボル @code{'landscape} を渡すと、@c +ページは 90°回転し、それに応じてより長い行幅となります。 + +@example +#(set-default-paper-size "a6" 'landscape) +@end example + +@seealso +記譜法リファレンス: +@ref{紙面サイズに応じた自動拡縮} + +インストールされているファイル: +@file{scm/paper.scm} + + +@node 紙面サイズに応じた自動拡縮 +@unnumberedsubsubsec 紙面サイズに応じた自動拡縮 +@translationof Automatic scaling to paper size + +Scheme 関数 +(@code{set-default-paper-size} または @code{set-paper-size}) +により紙面サイズが変更された場合、@c +いくつかの @code{\paper} 変数は自動的に新しいサイズに合わせて拡縮されます。@c +特定の変数の自動拡縮をスキップするには、@c +紙面サイズを設定した後にその変数を設定します。@c +@code{paper-height} 変数や @code{paper-width} 変数の変更では、@c +自動拡縮は起こらないということに注意してください。@c +しかしながら @code{paper-width} 変数の変更は他の値に影響を与えます +(これは拡縮とは別のことで、後で説明します)。 +@code{set-default-paper-size} 関数と @code{set-paper-size} 関数は@c +@ref{紙面サイズを設定する} で説明します。 + +自動拡縮によって影響を受ける垂直方向の長さは +@code{top-margin} と @code{bottom-margin} です +(@ref{固定された垂直方向の \paper スペース変数} を参照してください)。@c +自動拡縮によって影響を受ける水平方向の長さは +@code{right-margin}, @code{inner-margin}, @code{outer-margin}, +@code{binding-offset}, @code{indent}, それに @code{short-indent} です +(@ref{水平方向の \paper スペース変数} を参照してください)。 + +これらの長さに対するデフォルト値は +@code{top-margin-default}, @code{bottom-margin-default} 等の内部変数を@c +用いて @file{ly/paper-defaults-init.ly} で設定されています。@c +これらはデフォルトの紙面サイズ @code{a4} の場合の値です。@c +参考のために、@code{a4} 紙面での +@code{paper-height} は @code{297\mm} であり、@c +@code{paper-width} は @code{210\mm} です。 + +@seealso +記譜法リファレンス: +@ref{固定された垂直方向の \paper スペース変数}, +@ref{水平方向の \paper スペース変数} + +インストールされているファイル: +@file{ly/paper-defaults-init.ly}, +@file{scm/paper.scm} + + +@node 固定された垂直方向の \paper スペース変数 +@subsection 固定された垂直方向の @code{\paper} スペース変数 +@translationof Fixed vertical spacing \paper variables + +@warning{いくつかの @code{@bs{}paper} 変数は紙面サイズに応じて@c +自動的に拡縮され、結果として予期せぬ振る舞いを引き起こすことがあります。@c +@ref{紙面サイズに応じた自動拡縮} を参照してください。} + +(拡縮する前の) デフォルト値は +@file{ly/paper-defaults-init.ly} で定義されています。 + +@table @code +@item paper-height +@funindex paper-height + +ページの高さ -- デフォルトでは設定されていません。@c +これは垂直方向の長さの自動拡縮は影響を与えません。 + +@item top-margin +@funindex top-margin + +ページの上端と印刷可能エリアの上端との間のマージン。@c +紙面サイズが変更されると、それに応じてこの長さのデフォルト値も拡縮されます。 + +@item bottom-margin +@funindex bottom-margin + +印刷可能エリアの下端とページの下端との間のマージン。@c +紙面サイズが変更されると、それに応じてこの長さのデフォルト値も拡縮されます。 + +@item ragged-bottom +@funindex ragged-bottom + +真に設定されている場合、システムはページ下端まで広がりません。@c +これは最後のページには影響しません。@c +ページに 2, 3 しかシステムを持たない楽曲 -- オーケストラ譜等 -- では、@c +この変数を真に設定すべきです。 + +@item ragged-last-bottom +@funindex ragged-last-bottom + +偽に設定されている場合、最後のページでシステムはページ下端まで広がります。@c +2 ページ以上ある楽曲では、この変数を真に設定すべきです。@c +これは book パート +-- すなわち @code{\bookpart} ブロックによって作成された部分 -- +の最後のページにも影響を与えます。 + +@end table + +@seealso +記譜法リファレンス: +@ref{紙面サイズに応じた自動拡縮} + +インストールされているファイル: +@file{ly/paper-defaults-init.ly} + +コード断片集: +@rlsr{Spacing} + +@knownissues + +(@code{\header} ブロックによって作成された) +タイトルはシステムとして扱われます。@c +このため、@code{ragged-bottom} と @code{ragged-last-bottom} は@c +タイトルと score の最初のシステムとの間にスペースを追加します。 + + +@node 可変な垂直方向の \paper スペース変数 +@subsection 可変な垂直方向の @code{\paper} スペース変数 +@translationof Flexible vertical spacing \paper variables + +たいていの場合、ある要素間 +(マージン、タイトル、システム、score 等の間) +の垂直方向の間隔は、状況に応じて伸びたり縮んだりするよう、@c +可変であることが好まれます。@c +いくつかの @code{\paper} 変数 +(以下でリスト アップします) は、長さを微調整することができます。 + +このセクションで説明する @code{\paper} 変数は、@c +個々のシステム内にある譜のスペースを制御しないということに注意してください。@c +システム内のスペースは、@c +普通は @code{\score} ブロックや @code{\score} ブロックの中に配置される設定を@c +通じて、@c +グラフィカル オブジェクトのプロパティによって制御されます。@c +@ref{システム内部の可変な垂直方向のスペース} を参照してください。 + +@menu +* 可変な垂直方向スペース連想リストの構造:: +* 可変な垂直方向の \paper スペース変数のリスト:: +@end menu + + +@node 可変な垂直方向スペース連想リストの構造 +@unnumberedsubsubsec 可変な垂直方向スペース連想リストの構造 +@translationof Structure of flexible vertical spacing alists + +可変な垂直方向の @code{\paper} スペース変数は、@c +それぞれが 4 つの @emph{キー} を保持する連想配列 (association list) です: + +@itemize + +@item +@code{basic-distance} -- 2 つの要素の @emph{参照ポイント} 間の@c +垂直方向の間隔。単位は譜スペースです。@c +衝突が生じない場合は、伸縮されません。@c +(タイトルまたは最上位の) マークアップの参照ポイントは最も上の箇所です。@c +システムの参照ポイントは、@c +譜線を持たない (@code{Lyrics} コンテキスト等) であっても、@c +最も近くにある @code{StaffSymbol} の垂直方向の中心です。@c +@code{basic-distance} の値が @code{padding} や @code{minimum-distance} よりも@c +小さいと無意味になります。@c +なぜなら、間隔が @code{padding} や @code{minimum-distance} よりも@c +小さくなることはないからです。 +@code{minimum-distance} の値が @code{padding} よりも小さいと無意味になります。@c +なぜなら、間隔が @code{padding} よりも小さくなることはないからです。 + +@c TODO: explain skylines somewhere and xref to it from here. + +@item +@code{padding} -- 2 つの要素間の境界ボックス (または輪郭) の間に必要な、@c +垂直方向の最小の間隔。単位は譜スペースです。@c + +@item +@code{stretchability} -- 間隔の伸び率。@c +0 の場合、間隔は広がりません (衝突が生じない限りは)。@c +正の値の場合、ある間隔の @code{stretchability} 値は@c +他の間隔の @code{stretchability} との相対関係になります。@c +例えば、ある間隔の @code{stretchability} 値が@c +もう一つの間隔の @code{stretchability} の 2 倍である場合、@c +間隔の広がり方は 2 倍になります。@c +値は 0 以上の有限数でなければなりません。@c +@code{+inf.0} は @code{programming_error} を引き起こし、無視されます。@c +一方、@code{1.0e7} はほとんど無限の広がり方となります。@c +値が設定されなければ、デフォルト値が設定されます。@c +間隔の @emph{縮み} 率をユーザが直接設定することはできず、@c +(@code{basic-distance}@tie{}@minus{}@tie{}@code{minimum-distance}) +であることに注意してください。 + +@end itemize + +譜がページの下端まで広がらない設定の場合、間隔は以下の中の最大値となります: +largest of: + +@itemize + +@item +@code{basic-distance}, + +@item +@code{minimum-distance}, + +@item +@code{padding} + 衝突を回避するのに必要な最小の距離 + +@end itemize + +配列リストを変更する方法は、@ref{Modifying alists} で説明します。@c +以下の例は、連想配列を変更する 2 つの方法を提示しています。@c +最初の宣言はキー値を個別に変更していて、2 つ目は変数全体を再定義しています: + +@example +\paper @{ + system-system-spacing #'basic-distance = #8 + score-system-spacing = + #'((basic-distance . 12) + (minimum-distance . 6) + (padding . 1) + (stretchability . 12)) +@} +@end example + + +@node 可変な垂直方向の \paper スペース変数のリスト +@unnumberedsubsubsec 可変な垂直方向の @code{\paper} スペース変数のリスト +@translationof List of flexible vertical spacing \paper variables + +以下の変数の名前は @code{@var{upper}-@var{lower}-spacing} という形式で、@c +@code{@var{upper}} 要素と @code{@var{lower}} 要素との間隔です。@c +間隔の距離は 2 つの要素の参照ポイント間です +(上記の連想配列構造の説明を参照してください)。@c +変数名の中の @q{@code{markup}} は @emph{タイトル マークアップ} +(@code{bookTitleMarkup} や @code{scoreTitleMarkup}) と +@emph{最上位のマークアップ} (@ref{ファイル構造}) の両方を指します。@c +すべての間隔の距離の単位は譜スペースです。 + +デフォルト設定は @file{ly/paper-defaults-init.ly} で定義しています。 + +@c TODO: Where do headers/footers fit in? -mp + +@table @code +@item markup-system-spacing +@funindex markup-system-spacing + +(タイトルまたは最上位の) マークアップと、その後に続くシステムとの間隔。 + +@item score-markup-spacing +@funindex score-markup-spacing + +score の最後のシステムと、その後に続く (タイトルまたは最上位の) +マークアップとの間隔 + +@item score-system-spacing +@funindex score-system-spacing + +score の最後のシステムと、その後に score の最初のシステムとの間隔 +-- score と score の間に (タイトルまたは最上位の) マークアップが無い場合。 + +@item system-system-spacing +@funindex system-system-spacing + +同じ score の中にある 2 つのシステムの間隔。 + +@item markup-markup-spacing +@funindex markup-markup-spacing + +2 つの (タイトルまたは最上位の) マークアップの間隔。 + +@item last-bottom-spacing +@funindex last-bottom-spacing + +ページの最後のシステムまたは最上位のマークアップから、@c +印刷可能エリアの下端 (つまり、ボトム マージンの上端) までの距離。 + +@item top-system-spacing +@funindex top-system-spacing + +印刷可能エリアの上端 (つまり、トップ マージンの下端) から、@c +ページの最初のシステムまでの距離 +-- 間に (タイトルまたは最上位の) マークアップが無い場合。 + +@item top-markup-spacing +@funindex top-markup-spacing + +印刷可能エリアの上端 (つまり、トップ マージンの下端) から、@c +ページの最初の (タイトルまたは最上位の) までの距離 +-- 間にシステムが無い場合。 +@end table + +@seealso +記譜法リファレンス: +@ref{システム内部の可変な垂直方向のスペース} + +インストールされているファイル: +@file{ly/paper-defaults-init.ly} + +コード断片集: +@rlsr{Spacing} + + +@node 水平方向の \paper スペース変数 +@subsection 水平方向の @code{\paper} スペース変数 +@translationof Horizontal spacing \paper variables + +@warning{いくつかの @code{@bs{}paper} の間隔は紙面サイズに応じて自動的に@c +拡縮され、それにより予期せぬ結果となることがあります。@c +@ref{紙面サイズに応じた自動拡縮} を参照してください。} + +@menu +* 幅とマージンの \paper 変数:: +* 両面モードのための \paper 変数:: +* シフトとインデントのための \paper 変数:: +@end menu + + +@node 幅とマージンの \paper 変数 +@unnumberedsubsubsec 幅とマージンの @code{\paper} 変数 +@translationof \paper variables for widths and margins + +ここでリスト アップされていない (拡縮する前の) デフォルト値は、@c +@file{ly/paper-defaults-init.ly} で定義されています。 + +@table @code + +@item paper-width +@funindex paper-width + +ページの幅 - デフォルトでは、値は設定されていません。@c +@code{paper-width} は水平方向の自動拡縮に影響を与えませんが、@c +@code{line-width} 変数に影響を与えます。@c +@code{paper-width} と @code{line-width} の両方に値が設定された場合、@c +@code{left-margin} と @code{right-margin} が更新されます。@c +@code{check-consistency} も参照してください。 + +@item line-width +@funindex line-width + +この変数に値が設定されていない場合、@c +インデントされず、ページ右端まで広がるシステムの譜線の水平方向の長さは、@c +@code{(paper-width@tie{}@minus{}@tie{}left-margin@tie{}@minus{}@tie{}right-margin)} +です。@c +@code{left-margin} と @code{right-margin} に値が設定されていなければ、@c +マージンは自動的に更新されて、@c +システムはページの中央に配置されます。 +@code{check-consistency} も参照してください。@c +この変数は @code{\layout} ブロック内で設定される可能性もあります。 + +@item left-margin +@funindex left-margin + +ページの左端とインデントされていないシステムの譜線開始点との間のマージンです。@c +紙面サイズが変更された場合、それに応じてこの変数のデフォルト値も拡縮されます。@c +@code{left-margin} に値が設定されず、@c +@code{line-width} と @code{right-margin} の両方に値が設定された場合、@c +@code{left-margin} は +@code{(paper-width@tie{}@minus{}@tie{}line-width@tie{}@minus{}@tie{}right-margin)} +に設定されます。@c +@code{line-width} だけに値が設定された場合、@c +左右のマージンは +@code{((paper-width@tie{}@minus{}@tie{}line-width)@tie{}/@tie{}2)} +に設定され、@c +結果としてシステムはページの中央に配置されます。@c +@code{check-consistency} も参照してください。@c + +@item right-margin +@funindex right-margin + +ページの右端とページの右端まで広がる譜線終点との間のマージンです。@c +紙面サイズが変更された場合、それに応じてこの変数のデフォルト値も拡縮されます。@c +@code{right-margin} に値が設定されず、@c +@code{line-width} と @code{left-margin} の両方に値が設定された場合、@c +@code{right-margin} は +@code{(paper-width@tie{}@minus{}@tie{}line-width@tie{}@minus{}@tie{}left-margin)} +に設定されます。@c +@code{line-width} だけに値が設定された場合、@c +左右のマージンは +@code{((paper-width@tie{}@minus{}@tie{}line-width)@tie{}/@tie{}2)} +に設定され、@c +結果としてシステムはページの中央に配置されます。@c +@code{check-consistency} も参照してください。@c + +@item check-consistency +@funindex check-consistency + +真にセットされた場合、@code{left-margin}, @code{line-width}, +それに @code{right-margin} の和が @code{paper-width} にならなければ警告を@c +表示して、@c +@code{left-margin} と @code{right-margin} をデフォルト値に置き換え +(必要に応じて紙面サイズに合わせて拡宿し) ます。@c +偽にセットされた場合、不一致を無視して、@c +システムがページの左端からはみ出すことを許可します。 + +@item ragged-right +@funindex ragged-right + +真にセットされた場合、システムは譜線の幅いっぱいまで広がらず、@c +本来の長さで終了します。@c +デフォルトでは、1 つだけシステムを持つ score の場合は @code{#t}、@c +複数のシステムを持つ score の場合は @code{#f} です。@c +この変数は @code{\layout} ブロック内でセットされる可能性もあります。 + +@item ragged-last +@funindex ragged-last + +真にセットされた場合、score の最後のシステムは譜線の幅いっぱいまで広がらず、@c +本来の長さで終了します。@c +デフォルトでは @code{#f} です。@c +この変数は @code{\layout} ブロック内でセットされる可能性もあります。 + +@end table + +@seealso +記譜法リファレンス: +@ref{紙面サイズに応じた自動拡縮} + +インストールされているファイル: +@file{ly/paper-defaults-init.ly} + + +@node 両面モードのための \paper 変数 +@unnumberedsubsubsec 両面モードのための @code{\paper} 変数 +@translationof \paper variables for two-sided mode + +(拡縮される前の) デフォルト値は +@file{ly/paper-defaults-init.ly} で定義されています。 + +@table @code + +@item two-sided +@funindex two-sided + +@cindex gutter +@cindex binding gutter + +真にセットされた場合、@c +ページ番号が偶数か奇数かに応じて @code{inner-margin}, @code{outer-margin} +それに @code{binding-offset} を用いてマージンを決定します。@c +これは @code{left-margin} と @code{right-margin} を上書きします。 + +@item inner-margin +@funindex inner-margin + +book の一部であるページすべてが見開きページの内側に持つマージンです。@c +(左ページの場合は右側のマージン、右ページの場合は左側のマージンです。) +紙面サイズが変更された場合、それに応じてこの変数のデフォルト値も拡縮されます。@c +@code{two-sided} が真にセットされてい場合にのみ、機能します。 + +@item outer-margin +@funindex outer-margin + +book の一部であるページすべてが見開きページの外側に持つマージンです。@c +(左ページの場合は左側のマージン、右ページの場合は右側のマージンです。) +紙面サイズが変更された場合、それに応じてこの変数のデフォルト値も拡縮されます。@c +@code{two-sided} が真にセットされてい場合にのみ、機能します。 + +@item binding-offset +@funindex binding-offset + +製本により何かが隠れてしまわないように +@code{inner-margin} を増加させる量です。@c +紙面サイズが変更された場合、それに応じてこの変数のデフォルト値も拡縮されます。@c +@code{two-sided} が真にセットされてい場合にのみ、機能します。 + +@end table + +@seealso +記譜法リファレンス: +@ref{紙面サイズに応じた自動拡縮} + +インストールされているファイル: +@file{ly/paper-defaults-init.ly} + + +@node シフトとインデントのための \paper 変数 +@unnumberedsubsubsec シフトとインデントのための @code{\paper} 変数 +@translationof \paper variables for shifts and indents + +このにリスト アップされていない (拡縮される前の) デフォルト値は +@file{ly/paper-defaults-init.ly} で定義されています。 + +@table @code + +@item horizontal-shift +@funindex horizontal-shift + +@c This default value is buried in the middle of page.scm. -mp + +(タイトルとシステム セパレータを含む) すべてのシステムを@c +右にシフトさせる量です。@c +デフォルトでは @code{0.0\mm} です。 + +@item indent +@funindex indent + +score の最初のシステムに対するインデントのレベルです。@c +紙面サイズが変更された場合、それに応じてこの変数のデフォルト値も拡縮されます。@c +この変数は @code{\layout} ブロック内でセットされる可能性もあります。 + +@item short-indent +@funindex short-indent + +最初のシステムを除くすべてのシステムに対するインデントのレベルです。@c +紙面サイズが変更された場合、それに応じてこの変数のデフォルト値も拡縮されます。@c +この変数は @code{\layout} ブロック内でセットされる可能性もあります。 + +@end table + +@seealso +記譜法リファレンス: +@ref{紙面サイズに応じた自動拡縮} + +インストールされているファイル: +@file{ly/paper-defaults-init.ly} + +コード断片集: +@rlsr{Spacing} + + +@node 他の \paper 変数 +@subsection 他の @code{\paper} 変数 +@translationof Other \paper variables + +@menu +* 改行のための \paper 変数:: +* 改ページのための \paper 変数:: +* ページ番号のための \paper 変数:: +* その他の \paper 変数:: +@end menu + + +@node 改行のための \paper 変数 +@unnumberedsubsubsec 改行のための @code{\paper} 変数 +@translationof \paper variables for line breaking + +@c TODO: Mention that ly:optimal-breaking is on by default? -mp + +@table @code + +@item max-systems-per-page +@funindex max-systems-per-page + +1 ページに配置されるシステムの最大数です。@c +現在、これは @code{ly:optimal-breaking} アルゴリズムでのみサポートされます。@c +デフォルトでは、値は設定されていません。 + +@item min-systems-per-page +@funindex min-systems-per-page + +1 ページに配置されるシステムの最小数です。@c +この値が大きすぎると、システムがページからはみ出す可能性があります。@c +現在、これは @code{ly:optimal-breaking} アルゴリズムでのみサポートされます。@c +デフォルトでは、値は設定されていません。 + +@item systems-per-page +@funindex systems-per-page + +各ページに配置すべきシステム数です。@c +現在、これは @code{ly:optimal-breaking} アルゴリズムでのみサポートされます。@c +デフォルトでは、値は設定されていません。 + +@item system-count +@funindex system-count + +score で使用すべきシステム数です。@c +デフォルトでは、値は設定されていません。@c +この変数は @code{\layout} ブロック内でセットされる可能性もあります。 + +@end table + +@seealso +記譜法リファレンス: +@ref{改行} + + +@node 改ページのための \paper 変数 +@unnumberedsubsubsec 改ページのための @code{\paper} 変数 +@translationof \paper variables for page breaking + +ここでリスト アップされていないデフォルト値は +@file{ly/paper-defaults-init.ly} で定義されています。 + +@table @code + +@item blank-after-score-page-force +@funindex blank-after-score-page-force + +@c 未訳 +The penalty for having a blank page after the end of one score and +before the next. By default, this is smaller than +@code{blank-page-force}, so that we prefer blank pages after +scores to blank pages within a score. + +@item blank-last-page-force +@funindex blank-last-page-force + +@c 未訳 +The penalty for ending the score on an odd-numbered page. + +@item blank-page-force +@funindex blank-page-force + +@c 未訳 +The penalty for having a blank page in the middle of a +score. This is not used by @code{ly:optimal-breaking} since it will +never consider blank pages in the middle of a score. + +@item page-breaking +@funindex page-breaking + +@c 未訳 +The page-breaking algorithm to use. Choices are +@code{ly:minimal-breaking}, @code{ly:page-turn-breaking}, and +@code{ly:optimal-breaking}. + +@item page-breaking-system-system-spacing +@funindex page-breaking-system-system-spacing + +@c 未訳 +Tricks the page breaker into thinking that +@code{system-system-spacing} is set to something different than +it really is. For example, if +@code{page-breaking-system-system-spacing #'padding} is set to something +substantially larger than @code{system-system-spacing #'padding}, then the +page-breaker will put fewer systems on each page. Default: unset. + +@item page-count +@funindex page-count + +score で使用すべきページ数です。@c +デフォルトでは、値は設定されていません。 + +@end table + +@seealso +記譜法リファレンス: +@ref{改ページ}, +@ref{最適改ページ}, +@ref{最適ページめくり}, +@ref{最小改ページ} + +インストールされているファイル: +@file{ly/paper-defaults-init.ly} + + +@node ページ番号のための \paper 変数 +@unnumberedsubsubsec ページ番号のための @code{\paper} 変数 +@translationof \paper variables for page numbering + +ここでリスト アップされていないデフォルト値は +@file{ly/paper-defaults-init.ly} で定義されています。 + +@table @code + +@cindex page numbers, auto-numbering (ページ番号を自動付番する) +@item auto-first-page-number +@funindex auto-first-page-number + +@c 未訳 +The page breaking algorithm is affected by the first page number +being odd or even. If set to true, the page breaking algorithm +will decide whether to start with an odd or even number. This +will result in the first page number remaining as is or being +increased by one. Default: @code{#f}. + +@cindex page numbers, specify the first (最初のページ番号を指定する) +@item first-page-number +@funindex first-page-number + +最初のページのページ番号の値です。 + +@item print-first-page-number +@funindex print-first-page-number + +真にセットされた場合、最初のページにページ番号が譜刻されます。 + +@cindex page numbers, suppress (ページ番号を抑制する) +@item print-page-number +@funindex print-page-number + +偽にセットされた場合、ページ番号は譜刻されません。 + +@end table + +@seealso +インストールされているファイル: +@file{ly/paper-defaults-init.ly} + +@knownissues +奇数のページ番号は常に右側に配置されます。@c +楽譜をページ 1 から始めたいのであれば、@c +カバー ページの裏にブランク ページ配置して、@c +ページ 1 が右側にくるようにする必要があります。 + + +@node その他の \paper 変数 +@unnumberedsubsubsec その他の @code{\paper} 変数 +@translationof Miscellaneous \paper variables + +@table @code + +@item page-spacing-weight +@funindex page-spacing-weight + +(垂直方向の) ページ スペースと (水平方向の) 行スペースの重要度の関係です。@c +大きな値だと、ページ スペースがより重要になります。@c +デフォルトでは、@code{#10} です。 + +@item print-all-headers +@funindex print-all-headers + +真にセットされている場合、@c +出力の各 @code{\score} のすべてのヘッダを譜刻します。@c +通常、@code{piece} ヘッダ変数と @code{opus} ヘッダ変数だけが譜刻されます。@c +デフォルトでは、@code{#f} です。 + +@item system-separator-markup +@funindex system-separator-markup + +しばしばオーケストラ譜で使用される、@c +システム間に挿入されるマークアップ オブジェクトです。@c +デフォルトでは、設定されていません。@c +以下の例のように、@c +@file{ly/titling-init.ly} で定義されている @code{\slashSeparator} マークアップ@c +を使用すると適当です: + +@lilypond[quote,verbatim,noragged-right,line-width=30\mm] +#(set-default-paper-size "a8") + +\book { + \paper { + system-separator-markup = \slashSeparator + } + \header { + tagline = ##f + } + \score { + \relative c'' { c1 \break c1 \break c1 } + } +} +@end lilypond + +@end table + + +@seealso +インストールされているファイル: +@file{ly/titling-init.ly} + +コード断片集: +@rlsr{Spacing} + + +@knownissues + + +デフォルトのページ ヘッダは、@c +ページ番号と @code{\header} ブロックの @code{instrument} フィールドを@c +同一の行に配置します。 + + +@node 楽譜レイアウト +@section 楽譜レイアウト +@translationof Score layout + +このセクションでは、@code{\layout} ブロックで使用する@c +楽譜レイアウト オプションについて説明します。 + +@menu +* \layout ブロック:: +* 譜サイズを設定する:: +@end menu + + +@node \layout ブロック +@subsection @code{\layout} ブロック +@translationof The \layout block + +@funindex \layout + +@code{\paper} ブロックがドキュメント全体のページ フォーマットに関係する@c +設定を保持する一方で、@c +@code{\layout} ブロックは楽譜特有のレイアウトに関する設定を保持します。@c +楽譜レイアウト オプションを全体に設定するには、@c +設定を最上位の @code{\layout} ブロックに配置します。@c +個々の楽譜に対してレイアウト オプションを設定するには、@c +音楽表記の後の @code{\score} ブロック内の @code{\layout} ブロックの中に@c +設定を配置します。@c +@code{\layout} ブロックに配置される設定には以下のものがあります: + +@itemize +@item @code{layout-set-staff-size} Scheme 関数、 +@item @code{\context} ブロック内のコンテキスト変更、それに +@item 楽譜レイアウトに影響を与える @code{\paper} 変数 +@end itemize + +@code{layout-set-staff-size} 関数は次のセクション @ref{譜サイズを設定する} +で説明します。@c +コンテキスト変更は @ref{Modifying context plug-ins} と +@ref{Changing context default settings} で説明します。@c +@code{\layout} ブロック内で使用される @code{\paper} には以下のものがあります: + +@itemize + +@item +@code{line-width}, @code{ragged-right} それに @code{ragged-last} +(@ref{幅とマージンの \paper 変数} を参照してください) + +@item +@code{indent} と @code{short-indent} +(@ref{シフトとインデントのための \paper 変数} を参照してください) + +@item +@code{system-count} +(@ref{改行のための \paper 変数} を参照してください) + +@end itemize + +ここで、@code{\layout} ブロックの例を挙げます: + +@example +\layout @{ + indent = 2\cm + \context @{ + \StaffGroup + \override StaffGrouper #'staff-staff-spacing #'basic-distance = #8 + @} + \context @{ + \Voice + \override TextScript #'padding = #1 + \override Glissando #'thickness = #3 + @} +@} +@end example + + +@seealso +記譜法リファレンス: +@ref{Changing context default settings} + +コード断片集: +@rlsr{Spacing} + + +@node 譜サイズを設定する +@subsection 譜サイズを設定する +@translationof Setting the staff size + +@cindex font size, setting (フォント サイズを設定する) +@cindex staff size, setting (譜サイズを設定する) +@funindex layout file + +デフォルトの @strong{譜サイズ} は 20 ポイントに設定されています。@c +これを変更するには 2 つの方法があります: + +譜サイズをファイルの中にあるすべての楽譜 +(正確には @code{book} ブロックの中にあるすべての楽譜) +に設定するには、@c +@code{set-global-staff-size} を使用します。 + +@example +#(set-global-staff-size 14) +@end example + +@noindent +これはグローバルなデフォルトの譜サイズを高さが 14pt になるよう設定し、@c +それに応じてすべてのフォントを拡縮します。 + +それぞれの楽譜に個別に譜サイズを設定するには、@c +以下のようにします: +@example +\score@{ + @dots{} + \layout @{ + #(layout-set-staff-size 15) + @} +@} +@end example + +Feta フォントは 8 つのサイズの音楽シンボルを提供します。 +各フォントは譜サイズに合わせて調整されます: +小さなサイズになるにつれて、@c +相対的に太くなる譜線に対して釣り合いをとるために、@c +太くなります。@c +推奨されるフォント サイズを以下の表にリストアップします: + +@quotation +@multitable @columnfractions .15 .2 .22 .2 + +@item @b{フォント名} +@tab @b{譜の高さ (pt)} +@tab @b{譜の高さ (mm)} +@tab @b{用途} + +@item feta11 +@tab 11.22 +@tab 3.9 +@tab ポケット サイズの楽譜 + +@item feta13 +@tab 12.60 +@tab 4.4 +@tab + +@item feta14 +@tab 14.14 +@tab 5.0 +@tab + +@item feta16 +@tab 15.87 +@tab 5.6 +@tab + +@item feta18 +@tab 17.82 +@tab 6.3 +@tab 歌集 + +@item feta20 +@tab 20 +@tab 7.0 +@tab 標準パート譜 + +@item feta23 +@tab 22.45 +@tab 7.9 +@tab + +@item feta26 +@tab 25.2 +@tab 8.9 +@tab +@c modern レンタルの資料? + +@end multitable +@end quotation + +これらのフォントは任意のサイズで利用可能です。@c +コンテキスト プロパティ @code{fontSize} と@c +レイアウト プロパティ @code{staff-space} +(@rinternals{StaffSymbol} の中にあります) +を使用することで、@c +個々の譜に対してサイズを調整することができます。@c +個々の譜のサイズはグローバル サイズとの相対値です。 + + +@seealso +記譜法リファレンス: +@ref{記譜フォント サイズを選択する} + +コード断片集: +@rlsr{Spacing} + + +@knownissues + +@code{layout-set-staff-size} は譜線の間隔を変更しません。 + + +@node 改行/改ページ +@section 改行/改ページ +@translationof Breaks + +@menu +* 改行:: +* 改ページ:: +* 最適改ページ:: +* 最適ページめくり:: +* 最小改ページ:: +* 明示的な改行/改ページ:: +* 改行/改ページのために追加のボイスを使用する:: +@end menu + +@node 改行 +@subsection 改行 +@translationof Line breaking + +@cindex line breaks (改行) +@cindex breaking lines (改行する) + +通常、改行は自動的に決定されます。@c +改行は、行が混み合って見えたり散漫に見えたりしないように、@c +連続する行の密度が同じくらいになるように選択されます。 + +小節線が引かれる場所で手動で強制的に改行を入れるには、@c +@code{\break} コマンドを使用します: + +@lilypond[quote,ragged-right,relative=2,verbatim] +c4 c c c | \break +c4 c c c | +@end lilypond + +デフォルトでは、小節の途中での @code{\break} は無視され、@c +警告が表示されます。@c +小節の途中で強制的に改行を入れるには、@c +@w{@samp{\bar ""}} を用いて不可視の小節線を追加します: + +@lilypond[quote,ragged-right,relative=2,verbatim] +c4 c c +\bar "" \break +c | +c4 c c c | +@end lilypond + +連符が開始する小節と終了する小節が異なる場合などのように、@c +前の小節が音符の途中で終わっている場合、@c +前の小節の終わりに @code{\break} を配置しても無視されます。@c +そのような状況で、@code{\break} コマンドを機能させるには、@c +@code{Voisce} コンテキストから @code{Forbid_line_break_engraver} を@c +削除します。@c +音符の途中で強制的に改行を入れるには、@c +音楽と並列に改行コマンドを追加する必要があるということに注意してください: + +@lilypond[quote,ragged-right,verbatim] +\new Voice \with { + \remove Forbid_line_break_engraver +} \relative c'' { + << + { c2. \times 2/3 { c4 c c } c2. | } + { s1 | \break s1 | } + >> +} +@end lilypond + +同様に、通常は連桁が小節線を跨いでいる場合も、改行は禁止されます。@c +この振る舞いは、@code{\override Beam #'breakable = ##t} により、@c +変更することができます: + +@lilypond[quote,ragged-right,relative=2,verbatim] +\override Beam #'breakable = ##t +c2. c8[ c | \break +c8 c] c2. | +@end lilypond + +@code{\noBreak} コマンドは、コマンドが配置された小節線での改行を禁止します。 + +行スペースに影響を与える最も基本的な設定は @code{indent} と +@code{line-width} です。@c +これらは @code{\layout} ブロック内で設定されます。@c +これらは音楽の最初の行のインデントと行の長さを制御します。 + +@code{\layout} ブロック内で @code{ragged-right} が真にセットされた場合、@c +システムは、行全体に広がらずに、本来の長さで終了します。@c +これは短い楽譜の断片を記譜する場合や、@c +本来のスペースがどれくらい密になっているかチェックする場合に有用です。 + +@c TODO Check and add para on default for ragged-right + +オプション @code{ragged-last} は @code{ragged-right} と似ていますが、@c +楽曲の最後の行にだけ効果を持ちます。 + +@example +\layout @{ + indent = 0\mm + line-width = 150\mm + ragged-last = ##t +@} +@end example + + + +@cindex regular line breaks (規則的な改行) +@cindex four bar music (4 小節楽譜) + +規則的な間隔で改行を行うには、@c + +スキップで区切られた @code{\break} を用いて、@c +それを @code{\repeat} で繰り返します。@c +例えば、@c +以下の例は 28 小節 (4/4 拍子と仮定して) であり、@c +4 小節ごとに改行が入ります +(それ以外の場所で改行が入ることはありません): + +@example +<< + \repeat unfold 7 @{ + s1 \noBreak s1 \noBreak + s1 \noBreak s1 \break + @} + @{ @var{実際の音楽@dots{}} @} +>> +@end example + +@c TODO Check this +改行設定を自動的に @file{.ly} ファイルに保存することができます。@c +これにより、@c +2 回目のフォーマット実行時に垂直方向のスペースがページにフィットするよう@c +引き伸ばされます。@c +この機能は本当に新しく、複雑です。@c +詳細は @rlsr{Spacing} を参照してください。 + + +@predefined +@funindex \break +@code{\break}, +@funindex \noBreak +@code{\noBreak} +@endpredefined + +@seealso +記譜法リファレンス: +@ref{改行のための \paper 変数} + +コード断片集: +@rlsr{Spacing} + +内部リファレンス: +@rinternals{LineBreakEvent} + + +@node 改ページ +@subsection 改ページ +@translationof Page breaking + +デフォルトの改ページは、@c +@code{\pageBreak} や @code{\noPageBreak} を挿入することによって@c +上書きすることができます。@c +これらのコマンドは @code{\break} と @code{\noBreak} に似ています。 +これらのコマンドは小節線のところに挿入すべきであり、@c +改ページを強制/禁止します。@c +当然のことですが、@c +@code{\pageBreak} は強制的に改行も行います。 + +@code{\pageBreak} コマンドと @code{\noPageBreak} コマンドは@c +最上位レベルに挿入することができ、@c +score や最上位レベルのマークアップの間に挿入することができます。 + +@code{ragged-right} や @code{ragged-last} と類似で、@c +垂直方向のスペースに対して同じ効果を持つ設定があります: +@code{ragged-bottom} と @code{ragged-last-bottom} です。@c +これらの設定が @code{##t} にセットされている場合、@c +すべてのページあるいは最後のページのシステムは@c +ページの垂直方向全体には広がりません。@c +@ref{固定された垂直方向の \paper スペース変数} を参照してください。 + +改ページは @code{page-breaking} 関数によって算出されます。@c +LilyPond は改ページを算出するために 3 つのアルゴリズムを提供します: +@code{ly:optimal-breaking}, @code{ly:page-turn-breaking}, それに +@code{ly:minimal-breaking} です。@c +デフォルトは @code{ly:optimal-breaking} ですが、@c +@code{\paper} ブロックの中で変更することができます: + +@example +\paper @{ + page-breaking = #ly:page-turn-breaking +@} +@end example + +@funindex \bookpart + +1 つのブックが多くの楽譜とページを持つ場合、@c +改ページを処理するのに多くの処理時間とメモリが必要になり、@c +改ページの問題を解決することが困難になる可能性があります。@c +改ページ処理を簡単にするために、@c +@code{\bookpart} ブロックを用いてブックをいくつかのパートに分割します: +改ページはパートごとに別々に処理されます。@c +異なるブック パートには、@c +異なる改ページ関数を使用することもできます。 + +@example +\bookpart @{ + \header @{ + subtitle = "Preface" + @} + \paper @{ + %% ほとんどテキストしか保持していないパートでは + %% ly:minimal-breaking が適しています + page-breaking = #ly:minimal-breaking + @} + \markup @{ @dots{} @} + @dots{} +@} +\bookpart @{ + %% このパートは音楽を保持しているので、デフォルトの + %% ly:optimal-breaking を使用します + \header @{ + subtitle = "First movement" + @} + \score @{ @dots{} @} + @dots{} +@} +@end example + + +@predefined +@funindex \pageBreak +@code{\pageBreak}, +@funindex \noPageBreak +@code{\noPageBreak} +@endpredefined + + +@seealso +記譜法リファレンス: +@ref{改行のための \paper 変数} + +コード断片集: +@rlsr{Spacing} + + +@node 最適改ページ +@subsection 最適改ページ +@translationof Optimal page breaking + +@funindex ly:optimal-breaking + +@code{ly:optimal-breaking} 関数は、@c +LilyPond が改ページを決定するためのデフォルトの手法です。 +この関数は、@c +ページの (水平方向と垂直方向の両方の) 混み合いや広がりすぎを@c +最小にする改ページを見つけ出そうと試みます。@c +@code{ly:page-turn-breaking} とは異なり、@c +この関数はページめくりについて考慮しません。 + +@seealso +コード断片集: +@rlsr{Spacing} + + +@node 最適ページめくり +@subsection 最適ページめくり +@translationof Optimal page turning + +@funindex ly:page-turn-breaking + +しばしば、@c +2 枚目のページ (横書きの本を開いたときの右側のページ) の終わりに@c +休符を置くための改ページ構成が必要になります。@c +こうすることで、@c +演奏者は音符を見失うことなくページをめくることができます。@c +@code{ly:page-turn-breaking} 関数は@c +ページの混み合いや広がりすぎを最小にする改ページを見つけ出そうと試みますが、@c +ページめくりを特定の場所だけに置くための制約を受けます。 + +この改ページ関数を使うには、2 つのステップがあります。@c +最初に、@ref{改ページ} で説明されているように、@c +@code{\paper} ブロックの中でこの関数を有効にする必要があります。@c +次に、この関数に改ページを許可したい場所を教える必要があります。 + +2 番目のステップを達成するには、2 つの方法があります。@c +1 つ目の方法では、@c +入力ファイルの適当な場所に @code{\allowPageTurn} を挿入することによって、@c +潜在的なページめくりを手動で指定します。 + +この方法では手間がかかりすぎる場合は、@c +@code{Page_turn_engraver} を +@code{Staff} あるいは @code{Voice} コンテキストに追加します。@c +@code{Page_turn_engraver} はコンテキストをスキャンして@c +音符の無いセクションを探します +(休符を探すわけではなく、音符の無い部分を探すということに注意してください。@c +単一譜の多声で、ボイスの 1 つが休符を持つ場合に、@c +@code{Page_turn_engraver} に渡されないようにするためです。) +@code{Page_turn_engraver} は音符を持たない十分に長いセクションを見つけると、@c +@q{特殊な} 小節線 (2 重小節線など) がないかぎりは、@c +そのセクションの最後の小節線のところに @code{\allowPageTurn} を挿入します。 + +@funindex minimumPageTurnLength + +@code{Page_turn_engraver} は@c +コンテキスト プロパティ @code{minimumPageTurnLength} を読み込んで、@c +どれくらい音符が無いセクションが続いたらページめくりを考慮するかを決定します。@c +@code{minimumPageTurnLength} のデフォルト値は +@code{#(ly:make-moment 1 1)} です。@c +ページめくりを不可にしたいのならば、@c +@code{minimumPageTurnLength} に非常に大きな値をセットします。 + +@example +\new Staff \with @{ \consists "Page_turn_engraver" @} +@{ + a4 b c d | + R1 | % ここでページめくりが許可されます + a4 b c d | + \set Staff.minimumPageTurnLength = #(ly:make-moment 5 2) + R1 | % ここではページめくりは許可されません + a4 b r2 | + R1*2 | % ここでページめくりが許可されます + a1 +@} +@end example + +@funindex minimumRepeatLengthForPageTurn + +@code{Page_turn_engraver} は volta 繰り返しを検出します。@c +繰り返しの開始と終わりにページめくりを行うのに十分な時間がある場合にのみ、@c +その繰り返しの最中でのページめくりが許可されます。@c +繰り返しが非常に短い場合、@c +@code{Page_turn_engraver} はページめくりを不可にする可能性があります。@c +コンテキスト プロパティ @code{minimumRepeatLengthForPageTurn} に値を@c +設定した場合、@c +その値よりも長い演奏時間を持つ繰り返しに対してのみ、@c +@code{Page_turn_engraver} は繰り返しの最中でページめくりを許可します。 + +ページめくりコマンド @code{\pageTurn}, @code{\noPageTurn} +それに @code{\allowPageTurn} は、@c +最上位レベル、score や最上位のマークアップの間で使用される可能性もあります。 + + +@predefined +@funindex \pageTurn +@code{\pageTurn}, +@funindex \noPageTurn +@code{\noPageTurn}, +@funindex \allowPageTurn +@code{\allowPageTurn} +@endpredefined + + +@seealso +コード断片集: +@rlsr{Spacing} + + +@knownissues + +score の中に配置する @code{Page_turn_engraver} は 1 つだけにするべきです。@c +複数の @code{Page_turn_engraver} がある場合、@c +互いに干渉し合います。 + + +@node 最小改ページ +@subsection 最小改ページ +@translationof Minimal page breaking + +@funindex ly:minimal-breaking + +The @code{ly:minimal-breaking} 関数は最小限の改ページを算出します: +この関数は 1 ページに可能な限り多くのシステムを配置します。@c +そのため、多くのページを持つ楽譜 +-- そのような場合、他の改ページ関数では時間がかかりすぎたり、@c +メモリ使用量が多くなりすぎたりします -- +や、多くのテキストを持つ楽譜でこの関数を使用すると良いかもしれません。@c +この関数を有効にするには以下のようにします: + +@example +\paper @{ + page-breaking = #ly:minimal-breaking +@} +@end example + + +@seealso +コード断片集: +@rlsr{Spacing} + + +@node 明示的な改行/改ページ +@subsection 明示的な改行/改ページ +@translationof Explicit breaks + +LilyPond はしばしば明示的な @code{\break} や @code{\pageBreak} を@c +却下します。@c +この振る舞いを上書きするための 2 つのコマンドがあります: + +@example +\override NonMusicalPaperColumn #'line-break-permission = ##f +\override NonMusicalPaperColumn #'page-break-permission = ##f +@end example + +@code{line-break-permission} が偽に上書きされた場合、@c +LilyPond は明示的な改行である @code{\break} コマンドのところで改行を行い、@c +他の場所では改行を行いません。@c +@code{page-break-permission} が偽に上書きされた場合、@c +LilyPond は明示的な改ページである +@code{\pageBreak} コマンドのところで改ページを行い、@c +他の場所では改ページを行いません。 + +@lilypond[quote,verbatim] +\paper { + indent = #0 + ragged-right = ##t + ragged-bottom = ##t +} + +music = \relative c'' { c8 c c c } + +\score { + \new Staff { + \repeat unfold 2 { \music } \break + \repeat unfold 4 { \music } \break + \repeat unfold 6 { \music } \break + \repeat unfold 8 { \music } \pageBreak + \repeat unfold 8 { \music } \break + \repeat unfold 6 { \music } \break + \repeat unfold 4 { \music } \break + \repeat unfold 2 { \music } + } + \layout { + \context { + \Score + \override NonMusicalPaperColumn #'line-break-permission = ##f + \override NonMusicalPaperColumn #'page-break-permission = ##f + } + } +} +@end lilypond + + +@seealso +コード断片集: +@rlsr{Spacing} + + +@node 改行/改ページのために追加のボイスを使用する +@subsection 改行/改ページのために追加のボイスを使用する +@translationof Using an extra voice for breaks + +通常、改行/改ページ情報は音符入力部分に直接入力します。 + +@example +music = \relative c'' @{ c4 c c c @} + +\score @{ + \new Staff @{ + \repeat unfold 2 @{ \music @} \break + \repeat unfold 3 @{ \music @} + @} +@} +@end example + +この方法では @code{\break} と @code{\pageBreak} コマンドを入力しやすいですが、@c +音楽入力と@c +音楽をどのようにページにレイアウトするかを指定する情報とが混ざってしまいます。@c +改行/改ページ情報を保持するための追加のボイスを導入することによって、@c +音楽入力と改行/改ページ情報を 2 つ場所に分けることができます。@c +この追加のボイスはスキップ、@code{\break}、@code{\pageBreak}、それに、@c +その他の改行/改ページ情報だけを保持します。 + +@lilypond[quote,verbatim] +music = \relative c'' { c4 c c c } + +\score { + \new Staff << + \new Voice { + s1 * 2 \break + s1 * 3 \break + s1 * 6 \break + s1 * 5 \break + } + \new Voice { + \repeat unfold 2 { \music } + \repeat unfold 3 { \music } + \repeat unfold 6 { \music } + \repeat unfold 5 { \music } + } + >> +} +@end lilypond + +@ignore +This pattern becomes especially helpful when overriding +@code{line-break-system-details} and the other useful but long properties of +@code{NonMusicalPaperColumnGrob}, as explained in @ref{垂直方向のスペース}. +@end ignore + +以下の方法は、@ref{垂直方向のスペース} で説明されているように、@c +@code{NonMusicalPaperColumnGrob} の @code{line-break-system-details} と@c +他の有用だが長いプロパティを上書きするときに、非常に役に立ちます。 + +@lilypond[quote,verbatim] +music = \relative c'' { c4 c c c } + +\score { + \new Staff << + \new Voice { + \overrideProperty "Score.NonMusicalPaperColumn" + #'line-break-system-details #'((Y-offset . 0)) + s1 * 2 \break + + \overrideProperty "Score.NonMusicalPaperColumn" + #'line-break-system-details #'((Y-offset . 35)) + s1 * 3 \break + + \overrideProperty "Score.NonMusicalPaperColumn" + #'line-break-system-details #'((Y-offset . 70)) + s1 * 6 \break + + \overrideProperty "Score.NonMusicalPaperColumn" + #'line-break-system-details #'((Y-offset . 105)) + s1 * 5 \break + } + \new Voice { + \repeat unfold 2 { \music } + \repeat unfold 3 { \music } + \repeat unfold 6 { \music } + \repeat unfold 5 { \music } + } + >> +} +@end lilypond + + +@seealso +記譜法リファレンス: +@ref{垂直方向のスペース} + +コード断片集: +@rlsr{Spacing} + + +@node 垂直方向のスペース +@section 垂直方向のスペース +@translationof Vertical spacing + +@cindex vertical spacing (垂直方向のスペース) +@cindex spacing, vertical (垂直方向のスペース) + +垂直方向のスペースは 3 つの要素によって制御されます: +利用可能なスペースの量 (つまり、紙面サイズとマージン)、@c +システムの間隔、それにシステム内部での譜の間隔です。 + +@menu +* システム内部の可変な垂直方向のスペース:: +* 譜とシステムを明示的に配置する:: +* 垂直方向の衝突回避:: +@end menu + + +@node システム内部の可変な垂直方向のスペース +@subsection システム内部の可変な垂直方向のスペース +@translationof Flexible vertical spacing within systems + +@cindex distance between staves (譜の間隔) +@cindex staff distance (譜の間隔) +@cindex space between staves (譜の間のスペース) +@cindex space inside systems (システム内部のスペース) + +システム内部の可変な垂直方向のスペースを制御する 3 つの仕組みがあり、@c +以下のカテゴリに分けられます: + +@itemize + +@item +@emph{グループ化されていない譜}, + +@item +@emph{グループ化されている譜} +(@code{ChoirStaff} 等のような譜グループ内の譜) + +@item +@emph{譜ではない行} +(@code{Lyrics}, @code{ChordNames} 等) + +@end itemize + +@c TODO: Clarify this. This almost implies that non-staff lines +@c have NO effect on the spacing between staves. -mp + +システムの高さは 2 つのステップで決定されます。@c +最初に、すべての譜が利用可能なスペースの量に応じた間隔で配置されます。@c +次に、譜ではない行が譜の間に配置されます。 + +このセクションでは、@c +システム内部の譜と譜ではない行の垂直方向のスペースを制御する@c +仕組みだけを説明しているということに注意してください。@c +システム、score、マークアップ、それにマージン間の垂直方向のスペースは、@c +@code{\paper} 変数によって制御されます +-- @ref{可変な垂直方向の \paper スペース変数} で説明しています。 + +@menu +* システム内部のスペース プロパティ:: +* グループ化されていない譜のスペース:: +* グループ化されている譜のスペース:: +* 譜ではない行のスペース:: +@end menu + + +@node システム内部のスペース プロパティ +@unnumberedsubsubsec システム内部のスペース プロパティ +@translationof Within-system spacing properties + +@funindex staff-affinity +@funindex staffgroup-staff-spacing +@funindex staff-staff-spacing +@funindex nonstaff-unrelatedstaff-spacing +@funindex nonstaff-relatedstaff-spacing +@funindex nonstaff-nonstaff-spacing +@funindex default-staff-staff-spacing +@funindex minimum-Y-extent +@funindex extra-offset +@funindex self-alignment-X +@funindex X-offset +@funindex VerticalAxisGroup + +システム内部の垂直方向のスペースは、2 セットのグラフィカル オブジェクト +プロパティによって制御されます。@c +1 つ目は @code{VerticalAxisGroup} グラフィカル オブジェクト +-- これは、譜と譜ではない行によって作成されます -- +のプロパティ セットです。@c +2 つ目は @code{StaffGrouper} グラフィカル オブジェクト +-- これは、明示的に呼び出された場合に、譜グループによって作成されます -- +のプロパティ セットです。@c +これらのプロパティは、このセクションの終わりで説明します。 + +これらのプロパティの名前は (@code{staff-affinity} を除いて)、@c +@code{@var{item1}-@var{item2}-spacing} という形式に従います +-- ここで、@code{@var{item1}} と @code{@var{item2}} は、スペースを入れられる@c +要素です。@c +@code{@var{item2}} は必ずしも @code{@var{item1}} の下にある要素ではないという@c +ことに注意してください。@c +例えば、@code{staff-affinity} が @code{#UP} である場合、@c +@code{nonstaff-relatedstaff-spacing} は譜ではない行から@c +上向きにスペースをとります。 + +スペースは、2 つの要素の @emph{参照ポイント} 間の距離です。@c +譜の参照ポイントは、その譜の @code{StaffSymbol} +(すなわち、@code{line-count} が奇数の場合は中央の譜線で、@c +@code{line-count} が偶数の場合は中央のスペースです) +の垂直方向の中央です。@c +譜ではない行の参照ポイントは、以下の表のようになります: + +@multitable {Non-staff line} {Reference point} +@headitem 譜ではない行 @tab 参照ポイント +@item @code{ChordNames} @tab ベースライン +@item @code{NoteNames} @tab ベースライン +@item @code{Lyrics} @tab ベースライン +@item @code{Dynamics} @tab 垂直方向の中央 +@item @code{FiguredBass} @tab 最も上のポイント +@item @code{FretBoards} @tab トップ ライン +@end multitable + +以下の画像では、水平方向の線が参照ポイントの位置を示しています: + +@lilypond[quote,noragged-right,line-width=110\mm] +#(define zero-space '((padding . -inf.0) (basic-distance . 0))) + +alignToZero = \with { + \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing = #zero-space + \override VerticalAxisGroup #'nonstaff-nonstaff-spacing = #zero-space +} +lowerCaseChords = \with { + chordNameLowercaseMinor = ##t +} +staffAffinityDown = \with { + \override VerticalAxisGroup #'staff-affinity = #DOWN +} +labelContext = +#(define-music-function + (parser location context) + (string?) + #{ s1*0^\markup { \typewriter $context } #}) + +\layout { + \context { \Dynamics \alignToZero } + \context { \FiguredBass \alignToZero } + \context { \Lyrics \alignToZero } + \context { \NoteNames \alignToZero \staffAffinityDown } + \context { \ChordNames \alignToZero + \staffAffinityDown + \lowerCaseChords } + \context { \FretBoards \alignToZero \staffAffinityDown } + \context { \Score + \override BarLine #'stencil = ##f + \override DynamicText #'self-alignment-X = #-1 + \override FretBoard #'X-offset = #1.75 + \override InstrumentName #'minimum-Y-extent = #'(-2 . 2) + \override InstrumentName #'extra-offset = #'(0 . -0.5) + \override TextScript #'minimum-Y-extent = #'(-2 . 3) + \override TimeSignature #'stencil = ##f + } +} + +%% These contexts have reference points at the baseline: +%% ChordNames, NoteNames, and Lyrics +<< + \new ChordNames { \chords { g1:m } } + \new NoteNames { s1 | g1 | } + \new RhythmicStaff { + \set RhythmicStaff.instrumentName = #"baseline " + \textLengthOn + \labelContext "ChordNames " s1 | + \labelContext "NoteNames " s1 | + \labelContext "Lyrics" s1 | + } + \new Lyrics { \lyrics { \skip 1*2 | ghijk1 | } } +>> + +%% The reference point for Dynamics is its vertical center +<< + \new RhythmicStaff { + \set RhythmicStaff.instrumentName = #"vertical center " + \labelContext "Dynamics" s1*3 + } + \new Dynamics { s1\mp s\fp } +>> + +%% The reference point for FiguredBass is its highest point +<< + \new RhythmicStaff { + \set RhythmicStaff.instrumentName = #"highest point " + \labelContext "FiguredBass" s1 + } + \new FiguredBass { \figuremode { <6 5>1 } } +>> + +%% The reference point for FretBoards is the top line +\include "predefined-guitar-fretboards.ly" +<< + \new FretBoards { \chordmode { e1 } } + \new RhythmicStaff { + \set RhythmicStaff.instrumentName = #"top line " + \labelContext "FretBoards " s1 + } +>> +@end lilypond + +垂直方向のスペースのグラフィカル オブジェクト プロパティは +(@code{staff-affinity} を除いて)、@c +@ref{可変な垂直方向の \paper スペース変数} で説明した +@code{\paper} スペース変数と同じ連想配列構造を使用します。 +連想配列を変更する方法は、@ref{Modifying alists} で説明します。@c +グラフィカル オブジェクト プロパティの調節は、@c +@code{\score} ブロックか @code{\layout} ブロックの内部で、@c +@code{\override} を用いて行う必要があります。 + +以下の例は、連想配列を変更する 2 つの方法を示しています。@c +最初の宣言は 1 つのキー値を個別に更新して、@c +2 番目の宣言はプロパティ全体を再定義しています: + +@example +\new Staff \with @{ + \override VerticalAxisGroup #'default-staff-staff-spacing + #'basic-distance = #10 +@} @{ @dots{} @} + +\new Staff \with @{ + \override VerticalAxisGroup #'default-staff-staff-spacing = + #'((basic-distance . 10) + (minimum-distance . 9) + (padding . 1) + (stretchability . 10)) +@} @{ @dots{} @} +@end example + +スペース設定をグローバルに変更するには、@c +そのスペース設定を @code{\layout} ブロックの中に配置します: + +@example +\layout @{ + \context @{ + \Staff + \override VerticalAxisGroup #'default-staff-staff-spacing + #'basic-distance = #10 + @} +@} +@end example + +垂直方向スペースのグラフィカル オブジェクト プロパティの標準設定は +@rinternals{VerticalAxisGroup} と @rinternals{StaffGrouper} でリスト アップ@c +しています。@c +特定のタイプの譜ではない行のデフォルト設定は、@c +@rinternals{Contexts} の中にある関連するコンテキストの説明でリスト アップ@c +しています。 + + +@subsubheading @code{VerticalAxisGroup} グラフィカル オブジェクトのプロパティ + +通常、@code{VerticalAxisGroup} プロパティは、@c +@code{Staff} レベル (あるいはそれと同等のレベル) で、@c +@code{\override} を用いて調節します。 + +@table @code +@item staff-staff-spacing + +カレントの譜とそのすぐ下の譜の間隔 +-- その間に 1 つ以上の譜ではない行 (@code{Lyrics} 等) が配置されている場合で@c +あっても -- +を決定するために使用します。@c +システムの最下段の譜には適用されません。 + +@code{VerticalAxisGroup} の @code{staff-staff-spacing} は、@c +譜がグループの一部である場合は @code{StaffGrouper} の +@code{staff-staff-spacing} プロパティを適用し、@c +グループではない譜の場合はその譜の @code{default-staff-staff-spacing} +を適用する Scheme 関数です。@c +これにより、グループ化されている譜に異なる間隔を入れることが可能です。@c +グループ化されていることとは無関係に同一の間隔を入れるには、@c +上で示したプロパティ再定義を用いて、@c +この関数を可変スペースの連想配列で置き換えます。 + +@item default-staff-staff-spacing +グループ化されていない譜で使用される @code{staff-staff-spacing} を定義している@c +可変スペースの連想配列です。@c +@code{staff-staff-spacing} は @code{\override} を用いて@c +上書きされることがあります。 + +@item staff-affinity +カレントの譜ではない行にスペースを入れるために使用する譜の方向です。@c +選択肢は @code{UP}, @code{DOWN}, それに @code{CENTER} です。@c +@code{CENTER} の場合、衝突や他のスペース上の制約によって妨げられない限り、@c +譜ではない行は上下にある近くの譜から等距離になるよう配置されます。@c +隣接する譜ではない行の @code{staff-affinity} は、@c +方向が下から上へと増加しないようにする必要があります。@c +例えば、@code{DOWN} に設定された譜ではない行のすぐ後に +@code{UP} に設定された譜ではない行を置くべきではありません。@c +システムの最上段にある譜ではない行は @code{DOWN} であるべきで、@c +システムの最下段にある譜ではない行は @code{UP} であるべきです。@c +譜ではない行の @code{staff-affinity} を @code{#f} に設定すると、@c +その行は譜として扱われます。@c +譜に対して @code{UP}, @code{CENTER}, あるいは @code{DOWN} の +@code{staff-affinity} を設定すると、@c +その譜は譜ではない行として扱われます。@c + +@item nonstaff-relatedstaff-spacing +カレントの譜ではない行と @code{staff-affinity} の方向にある@c +最も近い譜との間隔です +-- 2 つの間に譜ではない行が無く、@c +@code{staff-affinity} が @code{UP} と @code{DOWN} のどちらかである場合です。@c +@code{staff-affinity} が @code{CENTER} である場合、@c +@code{nonstaff-relatedstaff-spacing} は最も近くにある @emph{上下両サイド} の@c +譜の間隔になります +-- たとえ、カレントの譜ではない行と上下どちらかの譜の間に、@c +他の譜ではない行があったとしてもです。@c +このことは、譜ではない行の配置は、上下にある譜と譜ではない行の両方に依存する@c +ということを意味します。@c +このスペースの @code{stretchability} に小さな値を設定すると、@c +そのとおりのスペースになりやすくなります。@c +このスペースの @code{stretchability} に大きな値を設定すると、@c +そのとおりのスペースになりにくくなります。@c + +@item nonstaff-nonstaff-spacing +カレントの譜ではない行と @code{staff-affinity} の方向にある@c +次の譜ではない行の間隔です +-- 2 つの間に譜が無く、@c +@code{staff-affinity} が @code{UP} と @code{DOWN} のどちらかである場合です。@c + +@item nonstaff-unrelatedstaff-spacing +カレントの譜ではない行と @code{staff-affinity} とは反対方向にある譜の間隔です +-- 2 つの間に他の譜ではない行が無く、@c +@code{staff-affinity} が @code{UP} と @code{DOWN} のどちらかである場合です。@c +これは、例えば、@c +@code{Lyrics} 行と @code{Lyrics} が属していない譜との間のパディングを@c +最小にする必要がある場合に使用される可能性があります。 +@end table + + +@subsubheading @code{StaffGrouper} グラフィカル オブジェクトのプロパティ + +通常、@code{StaffGrouper} プロパティは、@c +@code{StaffGroup} レベル (あるいはそれと同等のレベル) で、@c +@code{\override} を用いて調節します。 + +@table @code +@item staff-staff-spacing +カレントの譜グループ内部にある隣接する譜の間隔です。@c +個々の譜の @code{VerticalAxisGroup} グラフィカル オブジェクトの +@code{staff-staff-spacing} プロパティは、@c +譜毎のスペース設定で上書きされる可能性があります。 + +@item staffgroup-staff-spacing +カレントの譜グループの最後の譜と、同じシステム内にあるすぐ下の譜の間隔です +-- 2 つの譜の間に 1 つ以上の譜ではない行 (@code{Lyrics} 等) が存在する場合で@c +あってもです。@c +システムの最下段の譜には適用されません。@c +個々の譜の @code{VerticalAxisGroup} グラフィカル オブジェクトの +@code{staff-staff-spacing} プロパティは、@c +譜毎のスペース設定で上書きされる可能性があります。 +@end table + +@seealso +記譜法リファレンス: +@ref{可変な垂直方向の \paper スペース変数}, +@ref{Modifying alists} + +内部リファレンス: +@rinternals{Contexts}, +@rinternals{VerticalAxisGroup}, +@rinternals{StaffGrouper} + +Installed Files: +@file{ly/engraver-init.ly}, +@file{scm/define-grobs.scm} + + +@node グループ化されていない譜のスペース +@unnumberedsubsubsec グループ化されていない譜のスペース +@translationof Spacing of ungrouped staves + +@emph{譜} (@code{Staff}, @code{DrumStaff}, @code{TabStaff} 等) は、@c +1 つ以上のボイス コンテキストを保持することができ、@c +他の譜を保持することはできないコンテキストです。 + +以下のプロパティは、@emph{グループ化されていない} 譜のスペースに影響を与えます: + +@itemize +@item @code{VerticalAxisGroup} プロパティ: +@itemize +@item @code{default-staff-staff-spacing} +@item @code{staff-staff-spacing} +@end itemize +@end itemize + +これらのグラフィカル オブジェクト プロパティは、それぞれ上で説明しています。@c +@ref{システム内部のスペース プロパティ} を参照してください。 + +譜グループの一部である譜には、他にもプロパティがあります。@c +@ref{グループ化されている譜のスペース} を参照してください。 + +以下の例は、@code{default-staff-staff-spacing} プロパティがどのように@c +グループ化されていない譜のスペースに影響を与えるかを示しています。@c +@code{staff-staff-spacing} に同じ上書きを適用すると同じ効果を持ちますが、@c +譜がグループ化されている場合にも適用されます。 + +@c KEEP LY +@lilypond[verbatim,quote,staffsize=16] +\layout { + \context { + \Staff + \override VerticalAxisGroup #'default-staff-staff-spacing = + #'((basic-distance . 8) + (minimum-distance . 7) + (padding . 1)) + } +} + +<< + % 非常に低い位置にある音符は 'basic-distance が提供するよりも + % 大きなスペースを必要とするため、この譜と次の譜の間隔は 'padding + % によって決定されます。 + \new Staff { b,2 r | } + + % ここでは、'basic-distance が十分なスペースを提供していて、 + % ページ上にある他の要素のスペースを確保するためにスペースを + % ('minimum-distance の値に向かって) 縮める必要はありません。 + % そのため、この譜と次の譜の間隔は 'basic-distance によって + % 決定されます。 + \new Staff { \clef bass g2 r | } + + % 'padding に負の値を設定することにより、譜を重ねることができます。 + % 'basic-distance が取り得る最小の値は 0 です。 + \new Staff \with { + \override VerticalAxisGroup #'default-staff-staff-spacing = + #'((basic-distance . 3.5) + (padding . -10)) + } { \clef bass g2 r | } + \new Staff { \clef bass g2 r | } +>> +@end lilypond + +@seealso +インストールされているファイル: +@file{scm/define-grobs.scm} + +コード断片集: +@rlsr{Spacing} + +内部リファレンス: +@rinternals{VerticalAxisGroup} + + +@node グループ化されている譜のスペース +@unnumberedsubsubsec グループ化されている譜のスペース +@translationof Spacing of grouped staves + +オーケストラ譜や他の大きな楽譜では、@c +譜を譜ループ化することが一般的です。@c +通常、グループ間のスペースは、@c +同じグループの譜の間のスペースよりも大きくなります。 + +@emph{譜グループ} (@code{StaffGroup}, @code{ChoirStaff} 等) は、@c +同時進行する 1 つ以上の譜を保持することができるコンテキストです。 + +以下のプロパティは、譜グループの中にある譜のスペースに影響を与えます: + +@itemize +@item @code{VerticalAxisGroup} プロパティ: +@itemize +@item @code{staff-staff-spacing} +@end itemize +@item @code{StaffGrouper} プロパティ: +@itemize +@item @code{staff-staff-spacing} +@item @code{staffgroup-staff-spacing} +@end itemize +@end itemize + +これらのグラフィカル オブジェクト プロパティは、上で個々に説明しています。@c +@ref{システム内部のスペース プロパティ} を参照してください。 + +以下の例は、@code{StaffGrouper} グラフィカル オブジェクトのプロパティが@c +どのようにグループ化された譜のスペースに影響を与えるかを示しています: + +@lilypond[verbatim,quote,staffsize=16] +\layout { + \context { + \Score + \override StaffGrouper #'staff-staff-spacing #'padding = #0 + \override StaffGrouper #'staff-staff-spacing #'basic-distance = #1 + } +} + +<< + \new PianoStaff \with { + \override StaffGrouper #'staffgroup-staff-spacing #'basic-distance = #20 + } << + \new Staff { c'1 } + \new Staff { c'1 } + >> + + \new StaffGroup << + \new Staff { c'1 } + \new Staff { c'1 } + >> +>> +@end lilypond + +@seealso +インストールされているファイル: +@file{scm/define-grobs.scm} + +コード断片集: +@rlsr{Spacing} + +内部リファレンス: +@rinternals{VerticalAxisGroup}, +@rinternals{StaffGrouper} + + +@node 譜ではない行のスペース +@unnumberedsubsubsec 譜ではない行のスペース +@translationof Spacing of non-staff lines + +@emph{譜ではない行} (@code{Lyrics}, @code{ChordNames} 等) は、@c +それが保持するレイアウト オブジェクトが譜のように譜刻される +(すなわち、システム内部の水平線上での譜刻) コンテキストです。@c +具体的に言うと、@c +譜ではない行は @code{VerticalAxisGroup} レイアウト オブジェクトを@c +作成する譜ではないコンテキストです。 + +以下のプロパティが、譜ではない行のスペースに影響を与えいます: + +@itemize +@item @code{VerticalAxisGroup} プロパティ: +@itemize +@item @code{staff-affinity} +@item @code{nonstaff-relatedstaff-spacing} +@item @code{nonstaff-nonstaff-spacing} +@item @code{nonstaff-unrelatedstaff-spacing} +@end itemize +@end itemize + +これらのグラフィカル オブジェクト プロパティは、上で個々に説明しています。@c +@ref{システム内部のスペース プロパティ} を参照してください。 + +以下の例は、@code{nonstaff-nonstaff-spacing} プロパティが@c +どのように隣接する譜ではない行のスペースに影響を与えるかを示しています。@c +ここでは、@code{stretchability} キーに非常に大きな値を設定することにより、@c +通常よりも歌詞が広がりやすくしています: + +@lilypond[verbatim,quote,staffsize=16] +\layout { + \context { + \Lyrics + \override VerticalAxisGroup + #'nonstaff-nonstaff-spacing #'stretchability = #1000 + } +} + +\new StaffGroup +<< + \new Staff \with { + \override VerticalAxisGroup #'staff-staff-spacing = #'((basic-distance . 30)) + } { c'1 } + \new Lyrics \with { + \override VerticalAxisGroup #'staff-affinity = #UP + } \lyricmode { up } + \new Lyrics \with { + \override VerticalAxisGroup #'staff-affinity = #CENTER + } \lyricmode { center } + \new Lyrics \with { + \override VerticalAxisGroup #'staff-affinity = #DOWN + } \lyricmode { down } + \new Staff { c'1 } +>> +@end lilypond + + +@seealso +インストールされているファイル: +@file{ly/engraver-init.ly}, +@file{scm/define-grobs.scm} + +コード断片集: +@rlsr{Spacing} + +@c @lsr{spacing,page-spacing.ly}, +@c @lsr{spacing,alignment-vertical-spacing.ly} + +内部リファレンス: +@rinternals{Contexts}, +@rinternals{VerticalAxisGroup} + + +@node 譜とシステムを明示的に配置する +@subsection 譜とシステムを明示的に配置する +@translationof Explicit staff and system positioning + +上で説明した可変な垂直方向のスペースの仕組みを理解する方法の 1 つに、@c +譜とシステムの間の垂直方向のパティングの大きさを制御する設定を@c +コレクションすることがあります。 + +@code{NonMusicalPaperColumn #'line-break-system-details} を用いて、@c +垂直方向のスペースに別の方法でアプローチすることができます。@c +可変な垂直方向のスペースの仕組みが垂直方向のパディングを指定するのに対して、@c +@code{NonMusicalPaperColumn #'line-break-system-details} は@c +ページ上の垂直方向の位置を指定することができます。 + +@code{NonMusicalPaperColumn #'line-break-system-details} は +3 つ設定からなる連想配列を受け取ります: + +@itemize +@item @code{X-offset} +@item @code{Y-offset} +@item @code{alignment-distances} +@end itemize + +以下の @code{NonMusicalPaperColumn} に対する上書きを含む、@c +グラフィカル オブジェクトの上書きは、@c +入力ファイルの中の 3 つの場所に配置することができます: + +@itemize +@item 音符入力の途中に直接配置する +@item @code{\context} ブロックの中に配置する +@item @code{\with} ブロックの中に配置する +@end itemize + +@code{NonMusicalPaperColumn} を上書きする場合、@c +通常は @code{\context} ブロックや @code{\with} ブロックの中で@c +@code{\override} コマンドを使用します。@c +一方、音符入力の途中で @code{NonMusicalPaperColumn} を上書きする場合、@c +特殊なコマンド @code{\overrideProperty} を使用します。@c +ここで、@c +特殊なコマンド @code{\overrideProperty} で +@code{NonMusicalPaperColumn} を上書きする例をいくつか挙げます: + +@example +\overrideProperty NonMusicalPaperColumn + #'line-break-system-details #'((X-offset . 20)) + +\overrideProperty NonMusicalPaperColumn + #'line-break-system-details #'((Y-offset . 40)) + +\overrideProperty NonMusicalPaperColumn + #'line-break-system-details #'((X-offset . 20) + (Y-offset . 40)) + +\overrideProperty NonMusicalPaperColumn + #'line-break-system-details #'((alignment-distances . (15))) + +\overrideProperty NonMusicalPaperColumn + #'line-break-system-details #'((X-offset . 20) + (Y-offset . 40) + (alignment-distances . (15))) +@end example + +これらの異なる設定がそれぞれどのように機能するのかを理解するために、@c +まったく上書きを含まない例を見ることから始めます。 + +@c \book { } is required in these examples to ensure the spacing +@c overrides can be seen between systems. -np + +@lilypond[verbatim,quote,staffsize=16] +\header { tagline = ##f } +\paper { left-margin = 0\mm } +\book { + \score { + << + \new Staff << + \new Voice { + s1*5 \break + s1*5 \break + s1*5 \break + } + \new Voice { \repeat unfold 15 { c'4 c' c' c' } } + >> + \new Staff { + \repeat unfold 15 { d'4 d' d' d' } + } + >> + } +} +@end lilypond + +この楽譜は改行/改ページ情報を専用のボイスに孤立させています。@c +この改行/改ページ用のボイスを作成するテクニックは、@c +例がより複雑になっていくときに、@c +レイアウトと音楽入力を分離することを助けてくれます。@c +@ref{改行/改ページのために追加のボイスを使用する} を参照してください。 + +明示的な @code{\breaks} は一様に音楽を 1 行あたり 5 小節に分割しています。@c +垂直方向のスペースは LilyPond のデフォルトです。@c +@code{NonMusicalPaperColumn} グラフィカル オブジェクトの +@code{line-break-system-details} 属性の中にある +@code{Y-offset} を設定することで、@c +各システムの垂直方向の開始位置を設定することができます: + +@lilypond[verbatim,quote,staffsize=16] +\header { tagline = ##f } +\paper { left-margin = 0\mm } +\book { + \score { + << + \new Staff << + \new Voice { + \overrideProperty #"Score.NonMusicalPaperColumn" + #'line-break-system-details #'((Y-offset . 0)) + s1*5 \break + \overrideProperty #"Score.NonMusicalPaperColumn" + #'line-break-system-details #'((Y-offset . 40)) + s1*5 \break + \overrideProperty #"Score.NonMusicalPaperColumn" + #'line-break-system-details #'((Y-offset . 80)) + s1*5 \break + } + \new Voice { \repeat unfold 15 { c'4 c' c' c' } } + >> + \new Staff { + \repeat unfold 15 { d'4 d' d' d' } + } + >> + } +} +@end lilypond + +@code{line-break-system-details} は@c +潜在的に多くの値を持つ連想リストをとりますが、@c +ここでは値を 1 つだけしかセットしていないということに注意してください。@c +また、ここでは @code{Y-offset} プロパティは、@c +各システムがページに描画される垂直方向の位置を@c +決定しているということにも注意してください。 + +これまでに各システムの垂直方向の開始位置を明示的に設定しましたが、@c +各システム内部の各譜の垂直方向の開始位置を手動で設定することも可能です。@c +@code{line-break-system-details} のサブプロパティ @code{alignment-offsets} を@c +用います。 + +@lilypond[verbatim,quote,staffsize=16] +\header { tagline = ##f } +\paper { left-margin = 0\mm } +\book { + \score { + << + \new Staff << + \new Voice { + \overrideProperty #"Score.NonMusicalPaperColumn" + #'line-break-system-details #'((Y-offset . 20) + (alignment-distances . (15))) + s1*5 \break + \overrideProperty #"Score.NonMusicalPaperColumn" + #'line-break-system-details #'((Y-offset . 60) + (alignment-distances . (15))) + s1*5 \break + \overrideProperty #"Score.NonMusicalPaperColumn" + #'line-break-system-details #'((Y-offset . 100) + (alignment-distances . (15))) + s1*5 \break + } + \new Voice { \repeat unfold 15 { c'4 c' c' c' } } + >> + \new Staff { + \repeat unfold 15 { d'4 d' d' d' } + } + >> + } +} +@end lilypond + +ここでは @code{NonMusicalPaperColumn} グラフィカル オブジェクトの@c +@code{line-break-system-details} 属性に 2 つの値を代入しているということに@c +注意してください。@c +@code{line-break-system-details} 属性の連想配列はもっと多くのスペース パラメータ +(例えば、@code{Y-offset} ペアに相当する @code{X-offset} ペア) +を受け付けますが、@c +システムと譜の垂直方向の開始地点を制御するのに必要な設定は、@c +@code{Y-offset} ペアと @code{alignment-offsets} ペアだけです。 +最後に、@c +@code{alignment-offsets} は譜の垂直方向の位置を指定するのであり、@c +譜グループの位置を指定するわけではないということに注意してください。 + +@lilypond[verbatim,quote,staffsize=16] +\header { tagline = ##f } +\paper { left-margin = 0\mm } +\book { + \score { + << + \new Staff << + \new Voice { + \overrideProperty #"Score.NonMusicalPaperColumn" + #'line-break-system-details #'((Y-offset . 0) + (alignment-distances . (30 10))) + s1*5 \break + \overrideProperty #"Score.NonMusicalPaperColumn" + #'line-break-system-details #'((Y-offset . 60) + (alignment-distances . (10 10))) + s1*5 \break + \overrideProperty #"Score.NonMusicalPaperColumn" + #'line-break-system-details #'((Y-offset . 100) + (alignment-distances . (10 30))) + s1*5 \break + } + \new Voice { \repeat unfold 15 { c'4 c' c' c' } } + >> + \new StaffGroup << + \new Staff { \repeat unfold 15 { d'4 d' d' d' } } + \new Staff { \repeat unfold 15 { e'4 e' e' e' } } + >> + >> + } +} +@end lilypond + +考慮すべき点がいくつかあります: + +@itemize +@item @code{alignment-offsets} を使用する場合、@c +歌詞と他の譜ではない行は譜としてカウントされません。 + +@item @code{X-offset}, @code{Y-offset} それに @code{alignment-offsets} に@c +渡される数の単位は、@c +譜線間隔の乗数と解釈されます。@c +正の値は譜と歌詞を下または右に移動させ、@c +負の値は譜と歌詞を上または左に移動させます。 + +@item ここで扱った @code{NonMusicalPaperColumn #'line-break-system-details} +設定は譜とシステムを任意の場所に配置することを可能にするため、@c +紙面領域やマージン領域を犯したり、@c +他の譜やシステムの上に譜刻する可能性さえあります。@c +これらの設定に適切な値を渡すことで、そのようなことは避けられます。 +@end itemize + + +@seealso +コード断片集: +@rlsr{Spacing} + + +@node 垂直方向の衝突回避 +@subsection 垂直方向の衝突回避 +@translationof Vertical collision avoidance + +@funindex outside-staff-priority +@funindex outside-staff-padding +@funindex outside-staff-horizontal-padding + +直観的に、音楽記譜には譜に属するオブジェクトと、@c +譜の外側に配置されるべきオブジェクトがあります。@c +譜の外側に属するオブジェクトには、リハーサル記号、テキスト、@c +それに強弱記号などがあります +(これからは、それらを譜外部オブジェクトと呼びます)。@c +LilyPond が譜外部オブジェクトの垂直方向の配置を決定するとき、@c +譜外部オブジェクトをできる限り譜の近くに、@c +しかしながら、他のオブジェクトと衝突しない程度の近さに配置します。 + +LilyPond は @code{outside-staff-priority} プロパティを用いて@c +あるグラフィカル オブジェクトが譜外部オブジェクトかどうかを決定します: +@code{outside-staff-priority} が数であれば、@c +そのグラフィカル オブジェクトは譜外部オブジェクトです。@c +さらに、@code{outside-staff-priority} は LilyPond に、@c +そのグラフィカル オブジェクトを配置する順番を教えてくれます。 + +まず最初にに、LilyPond は譜外部オブジェクトには属さないオブジェクトを@c +すべて配置します。@c +次に、譜外部オブジェクトを @code{outside-staff-priority} に従って +(昇順に) ソートします。@c +LilyPond は譜外部オブジェクトを、既に配置済みのオブジェクトと衝突しないよう、@c +一つずつ配置していきます。@c +つまり、2 つの譜外部オブジェクトが同じスペースをめぐって競合する場合、@c +より小さな @code{outside-staff-priority} を持つオブジェクトが@c +譜の近くに配置されます。 + +@c KEEP LY +@lilypond[quote,ragged-right,relative=2,verbatim] +c4_"Text"\pp +r2. +\once \override TextScript #'outside-staff-priority = #1 +c4_"Text"\pp % ここでは、テキストが譜の近くに配置されます +r2. +% outside-staff-priority に数ではない値を設定することにより、 +% 自動衝突回避を無効にします +\once \override TextScript #'outside-staff-priority = ##f +\once \override DynamicLineSpanner #'outside-staff-priority = ##f +c4_"Text"\pp % ここでは、2 つのオブジェクトが衝突します +@end lilypond + +ある譜外部オブジェクトとその前に配置されたグラフィカル オブジェクトとの間に@c +ある垂直方向のパディングは、@c +@code{outside-staff-padding} で制御することができます。 + +@c KEEP LY +@lilypond[quote,ragged-right,relative=2,verbatim] +\once \override TextScript #'outside-staff-padding = #0 +a'^"このテキストは音符のすぐ近くに配置されます。" +\once \override TextScript #'outside-staff-padding = #3 +c^"このテキストは前のテキストから離れた位置に配置されます" +c^"この手キスとは前にテキストの近くに配置されます" +@end lilypond + + +デフォルトでは、譜外部オブジェクトの配置は、@c +配置済みのグラフィカル オブジェクトとの水平方向の衝突回避だけを考慮します。@c +このことは、@c +オブジェクト同士が水平方向に非常に近く配置される状況を招く可能性があります。@c +譜の垂直方向の間隔を設定した場合も、@c +譜外部オブジェクトが挟み込まれる可能性があります。@c +@code{outside-staff-horizontal-padding} を設定すると、@c +オブジェクトは垂直方向にずれるため、@c +そのような状況は起こらなくなります。 + +@c KEEP LY +@lilypond[quote,ragged-right,relative=2,verbatim] +% マークアップは後に続く音符に近寄りすぎています +c4^"Text" +c4 +c''2 +% outside-staff-horizontal-padding を設定することで修正します +R1 +\once \override TextScript #'outside-staff-horizontal-padding = #1 +c,,4^"Text" +c4 +c''2 +@end lilypond + + +@seealso +コード断片集: +@rlsr{Spacing} + + +@node 水平方向のスペース +@section 水平方向のスペース +@translationof Horizontal spacing + +@cindex horizontal spacing (水平方向のスペース) +@cindex spacing, horizontal (水平方向のスペース) + +@menu +* 水平方向のスペースの概要:: +* 新しいスペース領域:: +* 水平方向のスペースを変更する:: +* 行の長さ:: +* プロポーショナル ノーテーション:: +@end menu + + +@node 水平方向のスペースの概要 +@subsection 水平方向のスペースの概要 +@translationof Horizontal spacing overview + +スペース エンジンは異なる演奏時間を異なる長さの可変距離 (@q{スプリング}) に@c +翻訳します。@c +長い演奏時間はより多くのスペースをとり、@c +短い演奏時間はより少ないスペースをとります。@c +最短の演奏時間は固定量のスペース +(これは @rinternals{SpacingSpanner} オブジェクトの中にある +@code{shortest-duration-space} によって制御されます) +をとります。@c +演奏時間が長くなるほど、より多くのスペースをとります: +演奏時間が倍になると、固定量のスペース +(これは @code{spacing-increment} によって制御されます) +がその音符に付け加えられます。 + +例えば、以下の楽曲には多くの 2 分音符、4 分音符、@c +それに 8 分音符が含まれています。 +8 分音符の後には符頭幅 (NHW) 1 つ分が挿入されます。@c +4 分音符の後には 2 NHW が挿入され、2 分音符の後には 3 NHW が挿入されます。 + +@lilypond[quote,verbatim,relative=1] +c2 c4. c8 c4. c8 c4. c8 c8 +c8 c4 c4 c4 +@end lilypond + +通常、@code{spacing-increment} は 1.2 譜スペースに設定されています。@c +これは符頭の幅とだいたい同じです。@c +さらに、@code{shortest-duration-space} は 2.0 に設定されています。@c +つまり、最短の音符は 2.4 譜スペース (@code{spacing-increment} の 2 倍) の@c +水平方向のスペースをとります。@c +このスペースはシンボルの左端からカウントされます。@c +そのため、最短の音符の後には一般に 1 NHW のスペースが挿入されます。 + +上記の手順に正確に従った場合、@c +8 分音符や 16 分音符を含む楽譜に 32 分音符を 1 つ付け加えると、@c +楽譜全体が大きく引き伸ばされます。@c +最短の音符はもはや 16 分音符ではなく、32 分音符であり、@c +それぞれの 16 分音符に 1 NHW が付け加えられます。@c +このことを防ぐため、スペースをとるための最短の演奏時間を、@c +その楽譜の中にある最短の音符ではなく、最も頻繁に出現する音符とします。 + + +最も共通する最短演奏時間は以下のように決定されます: +各小節において、最短の演奏時間が決定されます。@c +スペースの基本として、最も共通する最短演奏時間が選択されます。@c +条件として、この最短演奏時間は常に 8 分音符以上の長さになります。@c +@code{lilypond} を @code{--verbose} オプションを付けて実行すると、@c +最短演奏時間が表示されます。 + +この演奏時間はカスタマイズすることもできます。@c +@rinternals{SpacingSpanner} の中にある @code{common-shortest-duration} を@c +設定した場合、@c +スペースのための基本演奏時間が設定されれます。@c +この基本演奏時間の最大値 (通常、8 分音符) は、@c +@code{base-shortest-duration} によって設定されます。 + +@funindex common-shortest-duration +@funindex base-shortest-duration +@funindex stem-spacing-correction +@funindex spacing + +共通の最短音符よりも短い音符の後には、@c +その音符の演奏時間と共通の最短音符の演奏時間の比を反映した@c +スペースが付けられます。@c +そのため、@c +上記の例に 16 分音符を数個付け加えた場合、@c +16 分音符の後には NHW の半分の幅のスペースが付けられます: + +@lilypond[quote,verbatim,relative=2] +c2 c4. c8 c4. c16[ c] c4. c8 c8 c8 c4 c4 c4 +@end lilypond + + +@emph{Essay on automated music engraving} において、@c +符幹の向きはスペースに影響を与えるということを説明しました +(@ressay{Optical spacing} を参照してください)。@c +これは、@rinternals{NoteSpacing} オブジェクトの中にある +@code{stem-spacing-correction} プロパティによって制御されます。@c +このオブジェクトは @rinternals{Voice} コンテキストごとに生成されます。@c +@code{StaffSpacing} オブジェクト +(@rinternals{Staff} コンテキストの中で生成されます) +は、符幹/小節線のスペースを制御するために、同様のプロパティを保持します。@c +以下の例は、それらプロパティによる修正の様子を示しています。 +前半はデフォルト設定による修正であり、@c +後半は修正を誇張しています: + +@lilypond[quote,ragged-right] +{ + c'4 e''4 e'4 b'4 | + b'4 e''4 b'4 e''4 | + \override Staff.NoteSpacing #'stem-spacing-correction = #1.5 + \override Staff.StaffSpacing #'stem-spacing-correction = #1.5 + c'4 e''4 e'4 b'4 | + b'4 e''4 b'4 e''4 | +} +@end lilypond + +プロポーショナル ノーテーション (proportional notation) がサポートされます。@c +@ref{プロポーショナル ノーテーション} を参照してください。 + + +@seealso +コード断片集: +@rlsr{Spacing} + +内部リファレンス: +@rinternals{SpacingSpanner}, +@rinternals{NoteSpacing}, +@rinternals{StaffSpacing}, +@rinternals{NonMusicalPaperColumn} + + +@knownissues + +スペースを手動で上書きするための、手軽な仕組みはありません。@c +余分なスペースを楽譜に挿入するために、以下の手段があります +-- 必要に応じて、パディングの値を調整しています。 +@example + \override Score.NonMusicalPaperColumn #'padding = #10 +@end example + +スペースを減らすための手段はありません。 + + +@node 新しいスペース領域 +@subsection 新しいスペース領域 +@translationof New spacing area + +@code{newSpacingSection} を用いることで、@c +異なるスペース パラメータを持つ新しいセクションを開始することができます。@c +これは、音符の長さに関して異なる概念を持つセクションがある場合に、有用です。@c + +以下の例では、@c +拍子記号が新たしいセクションを導入しています。@c +その結果、16 分音符の間隔が広くなっています。 + +@lilypond[relative=1,verbatim,quote] +\time 2/4 +c4 c8 c +c8 c c4 c16[ c c8] c4 +\newSpacingSection +\time 4/16 +c16[ c c8] +@end lilypond + +@code{\newSpacingSection} コマンドは新たに +@code{SpacingSpanner} オブジェクトを作成します。@c +そのため、その場所で新たに @code{\override} が使用される可能性があります。 + + +@seealso +コード断片集: +@rlsr{Spacing} + +内部リファレンス: +@rinternals{SpacingSpanner} + + +@node 水平方向のスペースを変更する +@subsection 水平方向のスペースを変更する +@translationof Changing horizontal spacing + +水平方向のスペースを、@code{base-shortest-duration} で@c +変更することができます。@c +ここで、同じ音楽を比較します。@c +1 つではこのプロパティを変更せず、もう 1 つでは変更します。@c +@code{ly:make-moment} の値が大きくなると、@c +楽譜は小さくなります。@c +@code{ly:make-moment} は演奏時間を構成するため、@c +@code{1 4} は @code{1 16} よりも長い演奏時間である@c +ということに注意してください。 + +@lilypond[verbatim,line-width=12\cm] +\score { + \relative c'' { + g4 e e2 | f4 d d2 | c4 d e f | g4 g g2 | + g4 e e2 | f4 d d2 | c4 e g g | c,1 | + d4 d d d | d4 e f2 | e4 e e e | e4 f g2 | + g4 e e2 | f4 d d2 | c4 e g g | c,1 | + } +} +@end lilypond + +@lilypond[verbatim,line-width=12\cm] +\score { + \relative c'' { + g4 e e2 | f4 d d2 | c4 d e f | g4 g g2 | + g4 e e2 | f4 d d2 | c4 e g g | c,1 | + d4 d d d | d4 e f2 | e4 e e e | e4 f g2 | + g4 e e2 | f4 d d2 | c4 e g g | c,1 | + } + \layout { + \context { + \Score + \override SpacingSpanner + #'base-shortest-duration = #(ly:make-moment 1 16) + } + } +} +@end lilypond + + +@snippets + +デフォルトでは、連符のスペースは演奏時間とは関係の無い要素 +(臨時記号、音部記号の変化など) +に依存します。@c +そのような記号を無視して、同じ演奏時間に等しいスペースを割り当てるには、@c +@code{Score.SpacingSpanner #'uniform-stretching} を使用します。@c +このプロパティは、楽譜の先頭でのみ、変更することができます。 + +@lilypond[quote,ragged-right,verbatim] +\score { + << + \new Staff { + \times 4/5 { + c8 c8 c8 c8 c8 + } + c8 c8 c8 c8 + } + \new Staff { + c8 c8 c8 c8 + \times 4/5 { + c8 c8 c8 c8 c8 + } + } + >> + \layout { + \context { + \Score + \override SpacingSpanner #'uniform-stretching = ##t + } + } +} +@end lilypond + +@code{strict-note-spacing} がセットされている場合、@c +音部記号、小節線、それに装飾小音符を考慮せずに、@c +音符にスペースが割り当てられます。 + +@lilypond[quote,ragged-right,relative=2,verbatim] +\override Score.SpacingSpanner #'strict-note-spacing = ##t +\new Staff { c8[ c \clef alto c \grace { c16[ c] } c8 c c] c32[ c32] } +@end lilypond + + +@seealso +コード断片集: +@rlsr{Spacing} + + +@node 行の長さ +@subsection 行の長さ +@translationof Line length + +@cindex page breaks (改ページ) +@cindex breaking pages (改ページ) + +@funindex indent +@funindex line-width +@funindex ragged-right +@funindex ragged-last + +@c Although line-width can be set in \layout, it should be set in paper +@c block, to get page layout right. +@c Setting indent in \paper block makes not much sense, but it works. + +@c Bit verbose and vague, use examples? +スペースに影響を与える最も基本的な設定は、@c +@code{indent} と @code{line-width} です。@c +これらは @code{\layout} ブロックの中で設定されます。@c +これらの設定は、楽譜の最初の行のインデントと、行の長さを制御します。 + +@code{\layout} ブロックの中で @code{ragged-right} が真にセットされている場合、@c +システムは行全体を埋めるように水平方向に引き伸ばされず、@c +本来の長さで終了します。@c +これは、小さな楽譜の場合や、@c +本来のスペースがどれくらいの密度なのかをチェックする場合に有用です。@c +通常のデフォルト設定は偽ですが、@c +1 つしかシステムを持たない楽譜の場合のデフォルト値は真です。 + +@cindex page layout (ページ レイアウト) +@cindex vertical spacing (垂直方向のスペース) + +@code{ragged-last} オプションは @code{ragged-right} に似ていますが、@c +楽曲の最後の行だけに影響を与えます。@c +最後の行には、何の制限も加えられません。@c +この結果は、文章の段落をフォーマットする場合と同じです。@c +文章の段落において、@c +最後の行は単純にそのままの長さにフォーマットされます。 + +@c Note that for text there are several options for the last line. +@c While Knuth TeX uses natural length, lead typesetters use the same +@c stretch as the previous line. eTeX uses \lastlinefit to +@c interpolate between both these solutions. + +@example +\layout @{ + indent = #0 + line-width = #150 + ragged-last = ##t +@} +@end example + + +@seealso +コード断片集: +@rlsr{Spacing} + + +@node プロポーショナル ノーテーション +@subsection プロポーショナル ノーテーション +@translationof Proportional notation + +Lilypond はプロポーショナル ノーテーションをサポートします。@c +この記譜法では、各音符は演奏時間に相当する水平方向のスペースをとります。@c +このタイプの水平スペースは、方眼紙上の水平方向スペースと同等です。@c +20 世紀後半、21 世紀前半の楽譜の中には、@c +複雑なリズムをわかりやすく示すため、@c +あるいは、時間軸や他の図の配置を容易にするために、@c +プロポーショナル ノーテーションを使っているものがあります。 + +LilyPond はプロポーショナル ノーテーション用に 5 つの設定をサポートします。@c +それらの設定は一緒に使われることもありますし、単独で使われることもあります: + +@itemize +@item @code{proportionalNotationDuration} +@item @code{uniform-stretching} +@item @code{strict-note-spacing} +@item @code{\remove Separating_line_group_engraver} +@item @code{\override PaperColumn #'used = ##t} +@end itemize + +以下の例では、@c +これら 5 つのプロポーショナル ノーテーション用の設定を見ていき、@c +それらがどのように相互に作用するかを調べます。 + +以下のような 1 小節の例から始めます。@c +これは、@code{ragged-right} が ON であり、@c +クラシック音楽でのスペースを使用します。 + +@lilypond[quote,verbatim,ragged-right] +\score { + << + \new RhythmicStaff { + c'2 + c'16 c'16 c'16 c'16 + \times 4/5 { + c'16 c'16 c'16 c'16 c'16 + } + } + >> +} +@end lilypond + +小節の始まりに配置された 2 分音符がその小節で占める水平方向のスペースは、@c +半分よりもずっと少ないということに注意してください。@c +そのため、@c +小節の後半に配置された 16 分音符と、16 分音符からなる 5 連符 +(すなわち、20 分音符) がその小節で占める水平方向のスペースは、@c +半分よりもずっと多くなっています。 + +クラシック音楽の譜刻では、このスペースのとり方が望ましいかもしれません。@c +なぜなら、2 分音符から水平方向のスペースを借りてきて、@c +小節全体としてスペースを維持することができるからです。 + +他方で、時間軸や他の図を楽譜の上または下に挿入しようとした場合、@c +プロポーショナル ノーテーションが必要になります。@c +@code{proportionalNotationDuration} 設定でプロポーショナル ノーテーションを@c +有効にします。 + +@lilypond[quote,verbatim,ragged-right] +\score { + << + \new RhythmicStaff { + c'2 + c'16 c'16 c'16 c'16 + \times 4/5 { + c'16 c'16 c'16 c'16 c'16 + } + } + >> + \layout { + \context { + \Score + proportionalNotationDuration = #(ly:make-moment 1 20) + } + } +} +@end lilypond + +今度は、@c +小節の前半に配置された 2 分音符と、後半に配置された短い音符の集まりが@c +占める水平方向のスペースは等しくなりました。@c +これで、この例の上または下に、時間軸や他の図を配置することが可能になりました。 + +@code{proportionalNotationDuration} 設定は、@c +@code{Score} の中にあるコンテキスト設定です。@c +入力ファイルの中でコンテキスト設定が出現するのは、@c +3 つの場所のどれかだということを思い出してください +-- @code{\with} ブロックの中、@code{\context} ブロックの中、あるいは、@c +@code{\set} コマンドを前に置いた形で音楽エントリの中に直接配置します。@c +他のすべてのコンテキスト設定と同様に、@c +ユーザはこれら 3 つの場所のどれか 1 つを選択して、@c +そこで @code{proportionalNotationDuration} をセットすることができます。 + +@code{proportionalNotationDuration} 設定は引数を 1 つとります。@c +これはすべての音楽要素へのスペースに関係する参照演奏時間です。@c +LilyPond Scheme 関数 @code{make-moment} は 2 つの引数をとります +-- 全音符の分数を表す分子と分母です。@c +それゆえ、@code{#(ly:make-moment 1 20)} という呼び出しは、@c +20 分音符の参照演奏時間となります。@c +@code{#(ly:make-moment 1 16)}, @code{#(ly:make-moment 1 8)}, それに +@code{#(ly:make-moment 3 97)} という値はすべてとり得る値です。 + +では、どのように @code{proportionalNotationDuration} に渡す@c +適切な参照演奏時間を決めるのでしょうか?@c +通常、その楽曲の最速 (あるいは最小) の演奏時間に近い演奏時間から始めて、@c +トライ&エラーで決めます。@c +小さな参照演奏時間にすると疎な楽譜となり、@c +大きな参照演奏時間にすると密な楽譜になります。 + +@lilypond[quote,verbatim,ragged-right] +\score { + << + \new RhythmicStaff { + c'2 + c'16 c'16 c'16 c'16 + \times 4/5 { + c'16 c'16 c'16 c'16 c'16 + } + } + >> + \layout { + \context { + \Score + proportionalNotationDuration = #(ly:make-moment 1 8) + } + } +} + +\score { + << + \new RhythmicStaff { + c'2 + c'16 c'16 c'16 c'16 + \times 4/5 { + c'16 c'16 c'16 c'16 c'16 + } + } + >> + \layout { + \context { + \Score + proportionalNotationDuration = #(ly:make-moment 1 16) + } + } +} + +\score { + << + \new RhythmicStaff { + c'2 + c'16 c'16 c'16 c'16 + \times 4/5 { + c'16 c'16 c'16 c'16 c'16 + } + } + >> + \layout { + \context { + \Score + proportionalNotationDuration = #(ly:make-moment 1 32) + } + } +} +@end lilypond + +8 分音符以上などのようなあまりにも大きな演奏時間にすると、@c +楽譜が密になりすぎて、符頭の衝突が発生する可能性があるということに@c +注意してください。@c +さらに、一般にプロポーショナル ノーテーションはクラシック音楽のスペースよりも@c +多くの水平方向スペースをとるということに注意してください。@c +プロポーショナル ノーテーションは、多くの水平方向スペースを使うことで、@c +明快なリズムを提供します。 + +次に、重複する連符に最適なスペースを割り当てる方法を検証します。 + +まず、クラシック音楽のスペースで、異なるタイプの連符を付け加えたときに、@c +何が起こるかを見ていきます。 + +@lilypond[quote,verbatim,ragged-right] +\score { + << + \new RhythmicStaff { + c'2 + c'16 c'16 c'16 c'16 + \times 4/5 { + c'16 c'16 c'16 c'16 c'16 + } + } + \new RhythmicStaff { + \times 8/9 { + c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 + } + } + >> +} +@end lilypond + +このスペースのとり方は良くありません。@c +なぜなら、下の譜の音符の間隔が一様ではないからです。@c +クラシック音楽の譜刻には複雑な連符はほとんど含まれないため、@c +クラシック音楽の譜刻規則はこのような結果を生み出す可能性があります。@c +@code{proportionalNotationDuration} を設定することにより、@c +この状況はかなり修正されます。 + +@lilypond[quote,verbatim,ragged-right] +\score { + << + \new RhythmicStaff { + c'2 + c'16 c'16 c'16 c'16 + \times 4/5 { + c'16 c'16 c'16 c'16 c'16 + } + } + \new RhythmicStaff { + \times 8/9 { + c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 + } + } + >> + \layout { + \context { + \Score + proportionalNotationDuration = #(ly:make-moment 1 20) + } + } +} +@end lilypond + +しかしながら、注意深く見ると、@c +9 連符の後半の音符の間隔が、@c +前半の音符の間隔よりもわずかに広くなっています。@c +間隔を一様にするため、@c +@code{SpacingSpanner} のプロパティである +@code{uniform-stretching} を ON にします。 + +@lilypond[quote,verbatim,ragged-right] +\score { + << + \new RhythmicStaff { + c'2 + c'16 c'16 c'16 c'16 + \times 4/5 { + c'16 c'16 c'16 c'16 c'16 + } + } + \new RhythmicStaff { + \times 8/9 { + c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 + } + } + >> + \layout { + \context { + \Score + proportionalNotationDuration = #(ly:make-moment 1 20) + \override SpacingSpanner #'uniform-stretching = ##t + } + } +} +@end lilypond + +今度は、適切にスペースが割り当てられました。@c +リズムは視覚的に明快になり、必要があれば時間軸や図を挿入することができます。 + +LilyPond のプロポーショナル ノーテーション パッケージは、@c +すべてのプロポーショナルな楽譜は @code{SpacingSpanner} の +@code{'uniform-stretching} 属性が @code{##t} に設定されているものと@c +見なします。@c +@code{SpacingSpanner} の @code{'uniform-stretching} 属性が @code{##t} +に設定されずに、@c +@code{proportionalNotationDuration} が設定されると、@c +例えば、スキップ (空白音符) の水平方向のスペースが適切に割り当てられません。 + +@code{SpacingSpanner} は @code{Score} コンテキストの中にある@c +抽象的なグラフィカル オブジェクトです。@c +@code{proportionalNotationDuration} の設定と一緒に、@c +@code{SpacingSpanner} をオーバライドする場所は、@c +入力ファイルの 3 つの場所のいずれかになります +-- @code{Score \with} ブロックの中、@code{Score \context} ブロックの中、@c +あるいは音符入力の場所に直接配置するかです。 + +デフォルトでは、@code{Score} ごとに @code{SpacingSpanner} が 1 つあります。@c +つまり、デフォルトでは、@code{uniform-stretching} は楽譜全体で ON であるか、@c +OFF であるかのどちらかであるということです。@c +しかしながら、この振る舞いをオーバライドして、@c +楽譜内の異なる場所で異なるスペース機能を設定することができます。@c +これを実現するには、コマンド @code{\newSpacingSection} を用います。@c +更なる情報は、@ref{新しいスペース領域} を参照してください。 + +次に、@code{Separating_line_group_engraver} の効果を検証し、@c +なぜプロポーショナルな楽譜は頻繁に@c +このエングラーバを削除するのかを見ていきます。@c +以下の例は、各システムの最初の音符の直前に小さな @qq{前置きの} スペースが@c +あることを示しています。@c + +@lilypond[quote,verbatim,ragged-right] +\paper { + indent = #0 +} + +\new Staff { + c'1 + \break + c'1 +} +@end lilypond + + +この前置きのスペースの量は、前にあるのが拍子記号、調号、あるいは音部記号の@c +いずれであっても、同じです。@c +@code{Separating_line_group_engraver} はこのスペースに責任を負います。@c +@code{Separating_line_group_engraver} を削除すると、@c +このスペースはゼロになります。 + +@lilypond[quote,verbatim,ragged-right] +\paper { + indent = #0 +} + +\new Staff \with { + \remove Separating_line_group_engraver +} { + c'1 + \break + c'1 +} +@end lilypond + +拍子記号、調号、音部記号、それに臨時記号のような非音楽要素は、@c +プロポーショナル ノーテーションでは問題になります。@c +これらはすべて演奏時間を持ちません。@c +しかしながら、これらはすべて水平方向のスペースを消費します。@c +この問題に対して、プロポーショナルな楽譜はいくつかの異なるアプローチをとります。 + +調号のスペースの問題は、調号を持たないことで回避できるかもしれません。@c +これは有効な選択肢です。@c +なぜなら、たいていのプロポーショナルな楽譜は現代音楽だからです。@c +拍子記号についても同じことが言えるかもしれません。@c +時間軸や他の図を持つ楽譜であれば特にそうです。@c +しかしながら、そのような楽譜は例外的なものであり、@c +たいていのプロポーショナルな楽譜は少なくともいくつかの拍子記号を持ちます。@c +さらに、音部記号と臨時記号はより必須のものです。 + +それでは、プロポーショナルなコンテキストにおける非音楽要素のスペースに対して@c +どのような解決法が存在するのでしょうか?@c +とり得る選択肢の 1 つに、@code{SpacingSpanner} の @code{strict-note-spacing} +プロパティがあります。@c +以下の 2 つの楽譜を比べてください: + +@lilypond[quote,verbatim,ragged-right] +\new Staff { + \set Score.proportionalNotationDuration = #(ly:make-moment 1 16) + c''8 + c''8 + c''8 + \clef alto + d'8 + d'2 +} + +\new Staff { + \set Score.proportionalNotationDuration = #(ly:make-moment 1 16) + \override Score.SpacingSpanner #'strict-note-spacing = ##t + c''8 + c''8 + c''8 + \clef alto + d'8 + d'2 +} +@end lilypond + +どちらの楽譜もプロポーショナルです。@c +しかしながら、最初の楽譜は音部変更があるため広がりすぎています。@c +2 番目の楽譜は、@code{strict-note-spacing} を ON にしているため、@c +プロポーショナルな間隔を維持しています。@c +@code{strict-note-spacing} を ON にすると、@c +拍子記号、調号、音部記号、それに臨時記号の幅は、@c +スペース アルゴリズムの中で何の役割も果たさなくなります。 + +この設定に加えて、他にもプロポーショナルな楽譜で頻出する設定があります。@c +以下のような設定です: + +@itemize +@item @code{\override SpacingSpanner #'strict-grace-spacing = ##t} +@item @code{tupletFullLength = ##t} +@item @code{\override Beam #'breakable = ##t} +@item @code{\override Glissando #'breakable = ##t} +@item @code{\override TextSpanner #'breakable = ##t} +@item @code{\remove Forbid_line_break_engraver in the Voice context} +@end itemize + +これらの設定は、装飾小音符のスペースを厳密にし、@c +連譜の囲みをリズム的な開始点、終了点まで拡張し、@c +(連桁のような) 広がりを持つ要素が、@c +システムやページが改まるときに中断されることを許可します。@c +これらの設定について、本書の関連パートを参照してください。 + + +@seealso +記譜法リファレンス: +@ref{新しいスペース領域} + +コード断片集: +@rlsr{Spacing} + + +@node 音楽を少ないページに収める +@section 音楽を少ないページに収める +@translationof Fitting music onto fewer pages + +ときどき、譜の 1 つ、2 つが 2 番目 (あるいは、3 番目、4 番目 ...) +のページに配置されてしまうことがあります。@c +これは腹立たしいことです +-- 特に、前のページに十分なスペースがあるように見える場合は。 + +レイアウトの問題を解決しようとしている時、@c +@code{annotate-spacing} は何にも代え難いツールです。@c +このコマンドはさまざまなレイアウト スペース変数の値を表示します。@c +詳細は以下のセクション @ref{スペースを表示する} を参照してください。 + +@menu +* スペースを表示する:: +* スペースを変更する:: +@end menu + + +@node スペースを表示する +@subsection スペースを表示する +@translationof Displaying spacing + +@funindex annotate-spacing +@cindex spacing, display of layout (レイアウト スペースの表示) + +ページ フォーマットのために変更される可能性がある、@c +垂直方向のレイアウト変数の値を表示させるには、@c +@code{\paper} ブロックの中で @code{annotate-spacing} をセットします: + +@c need to have \book{} otherwise we get the separate systems. -hwn +@lilypond[verbatim,quote] +#(set-default-paper-size "a6" 'landscape) +\book { + \score { { c4 } } + \paper { annotate-spacing = ##t } +} +@end lilypond + + +@noindent +すべてのレイアウト値は、@c +@code{\paper} ブロックや @code{\layout} ブロックの中で@c +指定された単位とは無関係に、譜スペースで表示されます。@c +上の例では、@code{paper-height} の値は 59.75 @code{譜スペース} であり、@c +@code{staff-size} は 20 ポイント (デフォルト値) です。@c +以下のことに注意してください: + +@multitable {1 staff-space} {staff-size)/4 * (25.4/72.27) mm} + +@item 1 ポイント +@tab = (25.4/72.27) mm + +@item 1 譜スペース +@tab = (@code{staff-size})/4 ポイント +@item +@tab = (@code{staff-size})/4 * (25.4/72.27) mm + +@end multitable + +@noindent +この場合、1 譜スペースは約 1.757mm です。@c +それゆえ、59.75 譜スペースである @code{paper-height} は 105mm であり、@c +横置きの @code{A6} 紙の高さと同じです。@c +ペア (@var{a},@var{b}) は間隔を表します。@c +@var{a} は間隔の下端を、@var{b} は上端を表します。 + + +@seealso +記譜法リファレンス: +@ref{譜サイズを設定する} + +コード断片集: +@rlsr{Spacing} + + +@c ここから L3349 +@node スペースを変更する +@subsection スペースを変更する +@translationof Changing spacing + +@code{annotate-spacing} の出力は、@c +垂直方向のレイアウト変数の値を詳細に取得します。@c +マージンや他のレイアウト変数を変更することについての詳細は、@c +@ref{ページ レイアウト} を参照してください。 + +マージン以外にも、スペースを節約するための選択肢がいくつかあります: + +@itemize +@item + +(1 ページにできるだけ多くのシステムを収めるために) +スペースがある限り、システムを可能な限り近寄せる。@c +それにより、ページの下部に空きスペースが無くなります。 + +@example +\paper @{ + system-system-spacing = #'((basic-distance . 0.1) (padding . 0)) + ragged-last-bottom = ##f + ragged-bottom = ##f +@} +@end example + +@item +システム数を設定する。@c +これは 2 つの意味でスペースを節約します。@c +システム数を設定することで、たとえそれがデフォルト値であっても、@c +各ページにより多くのシステムを収めることができる場合があります。@c +なぜなら、見積もりのステップが迂回され、より正確な適合が得られるからです。@c +さらに、システム数を減らすことで、より多くのページを節約できる場合があります。@c +例えば、デフォルトのレイアウトが 11 システムである場合、@c +以下の指定により、レイアウトは強制的に 10 システムに収められます。 + +@example +\paper @{ + system-count = #10 +@} +@end example + +@item +オブジェクトがシステムの垂直方向のサイズを増加させるのを避ける +(あるいは減らす)。@c +例えば、volta リピート (または、差し替えの繰り返し) は@c +余分なスペースを必要とします。@c +これらの繰り返しが 2 つのシステムに広がっている場合、@c +1 システムが volta リピートを持ち、もう 1 システムが volta リピートを持たない@c +場合よりも多くのスペースをとります。@c +別の例では、@c +システムから突き出ている強弱記号を譜に近づけることで、@c +スペースを節約することができます: + +@lilypond[verbatim,quote,relative=1] +e4 c g\f c +e4 c g-\tweak #'X-offset #-2.7 -\tweak #'Y-offset #2.5 \f c +@end lilypond + +@item +@code{SpacingSpanner} 経由で水平方向のスペースを変更する。@c +詳細は、@ref{水平方向のスペースを変更する} を参照してください。@c +以下の例は、デフォルトをスペースを示しています: + +@lilypond[verbatim,quote] +\score { + \relative c'' { + g4 e e2 | + f4 d d2 | + c4 d e f | + g4 g g2 | + g4 e e2 | + } +} +@end lilypond + +@noindent +次の例では、@code{common-shortest-duration} の値を +@code{1/4} から @code{1/2} に変更しています。@c +この例では、4 分音符が最も共通で、最短の演奏時間です。@c +そのため、@code{common-shortest-duration} を長くすることで +@q{詰め込む} 効果を得られます: + +@lilypond[verbatim,quote] +\score { + \relative c'' { + g4 e e2 | + f4 d d2 | + c4 d e f | + g4 g g2 | + g4 e e2 | + } + \layout { + \context { + \Score + \override SpacingSpanner + #'common-shortest-duration = #(ly:make-moment 1 2) + } + } +} +@end lilypond + +@noindent +@code{common-shortest-duration} プロパティを動的に変更することはできません。@c +そのため、このプロパティは常に @code{\context} ブロックの中に配置して、@c +楽譜全体に適用されるようにする必要があります。 + +@end itemize + + +@seealso +記譜法リファレンス: +@ref{ページ レイアウト}, +@ref{水平方向のスペースを変更する} + +コード断片集: +@rlsr{Spacing} 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/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/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/staff.itely b/Documentation/notation/staff.itely index b4e471f7b0..2ac1294258 100644 --- a/Documentation/notation/staff.itely +++ b/Documentation/notation/staff.itely @@ -1173,9 +1173,9 @@ Installed Files: @knownissues Only the contents of the first @code{Voice} occurring in an -@code{\addQuote} command will be considered for quotation, so the music -expression must not contain @code{\new} and @code{\context Voice} -statements which would switch to a different Voice. Quoting grace notes +@code{\addQuote} command will be considered for quotation, so if the music +expression contains @code{\new} or @code{\context Voice} +statements, their contents will not be quoted. Quoting grace notes is unsupported and may cause LilyPond to crash whereas quoting nested triplets may result in poor notation. diff --git a/Documentation/notation/vocal.itely b/Documentation/notation/vocal.itely index b8f13106e3..f6ab639d91 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 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/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/running.itely b/Documentation/usage/running.itely index f379853963..5f226c3ed8 100644 --- a/Documentation/usage/running.itely +++ b/Documentation/usage/running.itely @@ -335,6 +335,32 @@ 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 (default) +All progress messages, warnings and errors. + +@item DEBUG +All possible messages, including verbose debug output. +@end table + + @cindex folder, directing output to @cindex output filename, setting @@ -455,6 +481,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 @code{--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 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/warn.hh b/flower/include/warn.hh index 3c2a6dc0a9..31ca381cb4 100644 --- a/flower/include/warn.hh +++ b/flower/include/warn.hh @@ -22,12 +22,45 @@ #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 +// Currently, there is no separation between progress and other info messages: +#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) +// Currently, there is no separation between progress and other info messages: +#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/warn.cc b/flower/warn.cc index 1c2f4ed134..43eab1add7 100644 --- a/flower/warn.cc +++ b/flower/warn.cc @@ -26,64 +26,167 @@ 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 PROGRESS); for now, PROGRESS=INFO for a + all relevant output, so be on the safe side and use INFO as default, just + in case some output is generated with 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 (PROGRESS)", + 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/collision-dots-move.ly b/input/regression/collision-dots-move.ly index d04b0f7c9b..71fbdabb60 100644 --- a/input/regression/collision-dots-move.ly +++ b/input/regression/collision-dots-move.ly @@ -9,7 +9,17 @@ collision resolution moves the dots to the right." \layout { ragged-right = ##t } \relative c { - \key d \minor \clef bass - << 4 \\ { g'8. bes16} >> + \override Staff.NoteCollision #'prefer-dotted-right = ##t + s1*0^"prefer-dotted-right = #t" + << 4 \\ { c8. d16 } >> + << 4 \\ { d8. d16 } >> + << 4 \\ { f'8. d16 } >> + << 4 \\ { g'8. d16 } >> + \override Staff.NoteCollision #'prefer-dotted-right = ##f + s1*0^"prefer-dotted-right = #f" + << 4 \\ { c8. d16 } >> + << 4 \\ { d8. d16 } >> + << 4 \\ { f'8. d16 } >> + << 4 \\ { g'8. d16 } >> } 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/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/quote-during-subvoice.ly b/input/regression/quote-during-subvoice.ly new file mode 100644 index 0000000000..6b39f07a27 --- /dev/null +++ b/input/regression/quote-during-subvoice.ly @@ -0,0 +1,68 @@ +\version "2.15.9" + +\header { + texidoc = "@code{\\quoteDuring} and @code{\\cueDuring} shall properly quote +voices that create a sub-voice. The sub-voice will not be quoted, though. +Exceptions are sections of parallel music @code{<< @{...@} \\ @{...@} >>}, +which will be quoted. +" +} + +% Simple case, normal sub-voice +quoteMe = \relative c' { + c4 c + \new Voice { + c4 c + } +} +\addQuote "quoteMe" \quoteMe +% Also works if wrapped with \new Voice +\addQuote "quoteMeA" \new Voice \quoteMe + +% Also works with voice directly inside relative +quoteMeI = \relative c' \new Voice { + c4 c4 +} +\addQuote "quoteMeI" \quoteMeI + +% Quoting music with some parallel sections (identical rhythm) +quoteMeII = \relative c' { + c4 c + << { d4 e4 } \\ { c4 b4 } >> + c4 +} +\addQuote "quoteMeII" \quoteMeII + +% Quoting music with some parallel sections (different rhythm) +quoteMeIII = \relative c' { + c4 c + << { d4 e4 } \\ { c4. b8 } >> + c4 +} +\addQuote "quoteMeIII" \quoteMeIII + + + + +<< + \new Staff \relative c'' { + c4 \cueDuring #"quoteMe" #DOWN { r4 } + c4 \cueDuring #"quoteMe" #DOWN { r4 } % <- no cue note due to sub-voice + } + \new Staff \relative c'' { + c4 \cueDuring #"quoteMeA" #DOWN { r4 } + c4 \cueDuring #"quoteMeA" #DOWN { r4 } % <- no cue note due to sub-voice + } + \new Staff \relative c'' { + c4 \cueDuring #"quoteMeI" #DOWN { r4 } + c4 + } + \new Staff \relative c'' { + c4 \cueDuring #"quoteMeII" #DOWN { r4 } + c4 \cueDuring #"quoteMeII" #DOWN { r4 } % <- quoted parallel notes + } + \new Staff \relative c'' { + c4 \cueDuring #"quoteMeIII" #DOWN { r4 } + c4 \cueDuring #"quoteMeIII" #DOWN { r4 } % <- quoted parallel notes + } +>> diff --git a/input/regression/staff-change-autobeam.ly b/input/regression/staff-change-autobeam.ly new file mode 100644 index 0000000000..57442f5296 --- /dev/null +++ b/input/regression/staff-change-autobeam.ly @@ -0,0 +1,14 @@ +\header { + texidoc = "Staves stay alive long enough to complete an automatic beam." +} + +\version "2.15.9" + +<< + { + g'2 g'8 g' + \change Staff = "down" + b' b' + } + \context Staff = "down" s1 +>> 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/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 8d8a4b6c56..76a3023e10 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -21,6 +21,7 @@ #include "beaming-pattern.hh" #include "beam.hh" #include "context.hh" +#include "context-handle.hh" #include "duration.hh" #include "engraver.hh" #include "item.hh" @@ -80,7 +81,10 @@ private: Moment extend_mom_; Moment beam_start_moment_; Moment beam_start_location_; - Context *beam_start_context_; + /* + Handle on the starting staff keeps it alive until beam is comlete + */ + Context_handle beam_start_context_; // We act as if beam were created, and start a grouping anyway. Beaming_pattern *grouping_; @@ -219,7 +223,7 @@ Auto_beam_engraver::create_beam () Beam::add_stem (beam, (*stems_)[i]); Grob_info i = make_grob_info (beam, (*stems_)[0]->self_scm ()); - i.rerouting_daddy_context_ = beam_start_context_; + i.rerouting_daddy_context_ = beam_start_context_.get_context (); announce_grob (i); return beam; @@ -239,7 +243,7 @@ Auto_beam_engraver::begin_beam () beaming_options_.from_context (context ()); beam_settings_ = updated_grob_properties (context (), ly_symbol2scm ("Beam")); - beam_start_context_ = context ()->get_parent_context (); + beam_start_context_.set_context (context ()->get_parent_context ()); beam_start_moment_ = now_mom (); beam_start_location_ = robust_scm2moment (get_property ("measurePosition"), Moment (0)); @@ -272,7 +276,7 @@ Auto_beam_engraver::end_beam () if (finished_beam_) { Grob_info i = make_grob_info (finished_beam_, SCM_EOL); - i.rerouting_daddy_context_ = beam_start_context_; + i.rerouting_daddy_context_ = beam_start_context_.get_context (); announce_end_grob (i); finished_grouping_ = grouping_; @@ -284,6 +288,7 @@ Auto_beam_engraver::end_beam () beam_settings_ = SCM_EOL; } + beam_start_context_.set_context (NULL); shortest_mom_ = Moment (Rational (1, 4)); } 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-handle.cc b/lily/context-handle.cc index 0ee1778661..639b2292a5 100644 --- a/lily/context-handle.cc +++ b/lily/context-handle.cc @@ -48,13 +48,13 @@ void Context_handle::up (Context *t) { outlet_ = t; - t->iterator_count_++; + t->client_count_++; } void Context_handle::down () { - outlet_->iterator_count_--; + outlet_->client_count_--; outlet_ = 0; } @@ -76,7 +76,7 @@ Context_handle::set_context (Context *trans) } Context * -Context_handle::get_outlet () const +Context_handle::get_context () const { return outlet_; @@ -85,5 +85,5 @@ Context_handle::get_outlet () const int Context_handle::get_count () const { - return outlet_->iterator_count_; + return outlet_->client_count_; } diff --git a/lily/context.cc b/lily/context.cc index 3454ab1f17..83b8ae17dd 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -35,7 +35,7 @@ bool Context::is_removable () const { - return context_list_ == SCM_EOL && ! iterator_count_ + return context_list_ == SCM_EOL && ! client_count_ && !dynamic_cast (daddy_context_); } @@ -82,7 +82,7 @@ Context::Context () { daddy_context_ = 0; aliases_ = SCM_EOL; - iterator_count_ = 0; + client_count_ = 0; implementation_ = 0; properties_scm_ = SCM_EOL; accepts_list_ = SCM_EOL; diff --git a/lily/dispatcher.cc b/lily/dispatcher.cc index a6cee709ce..0e3ad8998e 100644 --- a/lily/dispatcher.cc +++ b/lily/dispatcher.cc @@ -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/general-scheme.cc b/lily/general-scheme.cc index fa838e3189..a630fd90f5 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,82 +99,6 @@ 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), @@ -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)) 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..41a445d5bf 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -573,11 +573,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 +613,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/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/context-handle.hh b/lily/include/context-handle.hh index aa5850afc8..f88298a026 100644 --- a/lily/include/context-handle.hh +++ b/lily/include/context-handle.hh @@ -31,7 +31,7 @@ public: void set_context (Context *); void operator = (Context_handle const &); Context_handle (Context_handle const &); - Context *get_outlet () const; + Context *get_context () const; int get_count () const; private: diff --git a/lily/include/context.hh b/lily/include/context.hh index 9cf21cbce4..b946ebdc07 100644 --- a/lily/include/context.hh +++ b/lily/include/context.hh @@ -39,7 +39,8 @@ class Context private: friend class Context_handle; - int iterator_count_; + /* how many Context_handles point to this Context */ + int client_count_; /* Used internally by create_context */ Stream_event *infant_event_; 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/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/lexer.ll b/lily/lexer.ll index 83a7940b69..7cda144e26 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -192,8 +192,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")); } { 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/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..33eb30af68 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 (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/music-iterator.cc b/lily/music-iterator.cc index c1603c8709..52f280c58e 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -50,7 +50,7 @@ Music_iterator::~Music_iterator () Context * Music_iterator::get_outlet () const { - return handle_.get_outlet (); + return handle_.get_context (); } void diff --git a/lily/note-collision.cc b/lily/note-collision.cc index ef591c2b6d..b7060092e1 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -100,33 +100,33 @@ check_meshing_chords (Grob *me, merge_possible = false; /* - this case (distant half collide), - - | - x | - | x - | - - the noteheads may be closer than this case (close half collide) - - | - | - x - x - | - | - - */ + * this case (distant half collide), + * + * | + * x | + * | x + * | + * + * the noteheads may be closer than this case (close half collide) + * + * | + * | + * x + * x + * | + * | + * + */ /* TODO: filter out the 'o's in this configuration, since they're no - part in the collision. - - | - x|o - x|o - x - - */ + * part in the collision. + * + * | + * x|o + * x|o + * x + * + */ bool close_half_collide = false; bool distant_half_collide = false; @@ -163,29 +163,45 @@ check_meshing_chords (Grob *me, full_collide = full_collide || (close_half_collide && distant_half_collide); - Real shift_amount = 1; - - bool touch = (ups[0] >= dps.back ()); - /* As a special case, if the topmost part of the downstem chord is a second, - the top note of which is the same pitch as the lowest upstem note, they - shouldn't count as touching. + /* If the only collision is in the extreme noteheads, + then their stems can line up and the chords just 'touch'. + A half collision with the next note along the chord prevents touching. */ - if (dps.back () == ups[0] && dps.size () > 1 && dps[dps.size () - 2] == ups[0] - 1) - touch = false; - - if (touch) - shift_amount *= -1; - - /* For full collisions, the right hand head may obscure dots, so - make sure the dotted heads go to the right. */ + bool touch = false; + if (ups[0] >= dps.back () + && (dps.size () < 2 || ups[0] >= dps[dps.size () - 2] + 2) + && (ups.size () < 2 || ups[1] >= dps.back () + 2)) + touch = true; + + /* Determine which chord goes on the left, and which goes right. + Up-stem usually goes on the right, but if chords just 'touch' we can put + both stems on a common vertical line. In the presense of collisions, + right hand heads may obscure dots, so dotted heads to go the right. + */ + Real shift_amount = 1; bool stem_to_stem = false; - if (full_collide) + if ((full_collide + || ((close_half_collide || distant_half_collide) + && to_boolean (me->get_property ("prefer-dotted-right")))) + && Rhythmic_head::dot_count (head_up) < Rhythmic_head::dot_count (head_down)) { - if (Rhythmic_head::dot_count (head_up) > Rhythmic_head::dot_count (head_down)) - shift_amount = 1; - else if (Rhythmic_head::dot_count (head_up) < Rhythmic_head::dot_count (head_down)) + shift_amount = -1; + if (!touch || full_collide) + // remember to leave clearance between stems stem_to_stem = true; } + else if (touch) + { + // Up-stem note on a line has a raised dot, so no risk of collision + Grob *staff = Staff_symbol_referencer::get_staff_symbol (me); + if ((full_collide + || (!Staff_symbol_referencer::on_line (staff, ups[0]) + && to_boolean (me->get_property ("prefer-dotted-right")))) + && Rhythmic_head::dot_count (head_up) > Rhythmic_head::dot_count (head_down)) + touch = false; + else + shift_amount = -1; + } /* The solfa is a triangle, which is inverted depending on stem direction. In case of a collision, one of them should be removed, @@ -197,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); @@ -260,13 +275,15 @@ check_meshing_chords (Grob *me, /* TODO: these numbers are magic; should devise a set of grob props to tune this behavior. */ else if (stem_to_stem) - shift_amount = -abs (shift_amount) * 0.65; - else if (close_half_collide && !touch) + shift_amount *= 0.65; + else if (touch) + shift_amount *= 0.5; + else if (close_half_collide) shift_amount *= 0.52; - else if (distant_half_collide && !touch) - shift_amount *= 0.4; - else if (distant_half_collide || close_half_collide || full_collide) + else if (full_collide) shift_amount *= 0.5; + else if (distant_half_collide) + shift_amount *= 0.4; /* we're meshing. */ else if (Rhythmic_head::dot_count (head_up) || Rhythmic_head::dot_count (head_down)) @@ -289,62 +306,32 @@ check_meshing_chords (Grob *me, shift_amount *= 0.75; } - /* - * Fix issue #44: - * - * Dots from left note head collide with right note head. Only occurs - * with a close half collide, if the left note head is between - * lines and the right note head is on a line, and if right note head - * hasn't got any dots. + /* If the dotted notes ended up on the left, and there are collisions, + tell the Dot_Columnn to avoid the notes on the right. */ - if (close_half_collide - && Rhythmic_head::dot_count (head_up) - && !Rhythmic_head::dot_count (head_down)) + if (full_collide || close_half_collide || distant_half_collide) { - Grob *staff = Staff_symbol_referencer::get_staff_symbol (me); - if (!Staff_symbol_referencer::on_line (staff, ups[0])) + if (shift_amount < -1e-6 + && Rhythmic_head::dot_count (head_up) + && !Rhythmic_head::dot_count (head_down)) { - /* - TODO: consider junking the else body. - */ - if (to_boolean (me->get_property ("prefer-dotted-right"))) - shift_amount = 0.5; - else - { - Grob *d = unsmob_grob (head_up->get_object ("dot")); - Grob *parent = d->get_parent (X_AXIS); - if (Dot_column::has_interface (parent)) - Side_position_interface::add_support (parent, head_down); - } + Grob *d = unsmob_grob (head_up->get_object ("dot")); + Grob *parent = d->get_parent (X_AXIS); + if (Dot_column::has_interface (parent)) + Side_position_interface::add_support (parent, head_down); } - } - - /* For full or close half collisions, the right hand head may - obscure dots. Move dots to the right. */ - if (abs (shift_amount) > 1e-6 - && Rhythmic_head::dot_count (head_down) > Rhythmic_head::dot_count (head_up) - && (full_collide || close_half_collide)) - { - Grob *d = unsmob_grob (head_down->get_object ("dot")); - Grob *parent = d->get_parent (X_AXIS); - - /* - FIXME: - - | - x . o - | - - - the . is put right of o which is erroneous o force-shifted - far to the right. - */ - if (Dot_column::has_interface (parent)) + else if (Rhythmic_head::dot_count (head_down) + && !Rhythmic_head::dot_count (head_up)) { - Grob *stem = unsmob_grob (head_up->get_object ("stem")); - extract_grob_set (stem, "note-heads", heads); - for (vsize i = 0; i < heads.size (); i++) - Side_position_interface::add_support (parent, heads[i]); + Grob *d = unsmob_grob (head_down->get_object ("dot")); + Grob *parent = d->get_parent (X_AXIS); + if (Dot_column::has_interface (parent)) + { + Grob *stem = unsmob_grob (head_up->get_object ("stem")); + extract_grob_set (stem, "note-heads", heads); + for (vsize i = 0; i < heads.size (); i++) + Side_position_interface::add_support (parent, heads[i]); + } } } 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 5bd85b05b3..4521abc15e 100644 --- a/lily/part-combine-iterator.cc +++ b/lily/part-combine-iterator.cc @@ -116,7 +116,7 @@ Part_combine_iterator::do_quit () // Add listeners to all contexts except Devnull. for (int i = 0; i < NUM_OUTLETS; i++) { - Context *c = handles_[i].get_outlet (); + Context *c = handles_[i].get_context (); if (c->is_alias (ly_symbol2scm ("Voice"))) c->event_source ()->remove_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event")); handles_[i].set_context (0); @@ -200,7 +200,7 @@ Part_combine_iterator::substitute_both (Outlet_type to1, { for (int j = 0; j < NUM_OUTLETS; j++) if (j != tos[i]) - mis[i]->substitute_outlet (handles_[j].get_outlet (), handles_[tos[i]].get_outlet ()); + mis[i]->substitute_outlet (handles_[j].get_context (), handles_[tos[i]].get_context ()); } for (int j = 0; j < NUM_OUTLETS; j++) @@ -221,7 +221,7 @@ Part_combine_iterator::kill_mmrest (int in) mmrest_event_->unprotect (); } - handles_[in].get_outlet ()->event_source ()->broadcast (mmrest_event_); + handles_[in].get_context ()->event_source ()->broadcast (mmrest_event_); } void @@ -363,10 +363,10 @@ Part_combine_iterator::construct_children () } SCM lst = get_music ()->get_property ("elements"); - Context *one = handles_[CONTEXT_ONE].get_outlet (); + Context *one = handles_[CONTEXT_ONE].get_context (); set_context (one); first_iter_ = unsmob_iterator (get_iterator (unsmob_music (scm_car (lst)))); - Context *two = handles_[CONTEXT_TWO].get_outlet (); + Context *two = handles_[CONTEXT_TWO].get_context (); set_context (two); second_iter_ = unsmob_iterator (get_iterator (unsmob_music (scm_cadr (lst)))); 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/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/quote-iterator.cc b/lily/quote-iterator.cc index b13d5e1cd5..c8bcee378b 100644 --- a/lily/quote-iterator.cc +++ b/lily/quote-iterator.cc @@ -269,7 +269,7 @@ Quote_iterator::process (Moment m) transpose_mutable (ev->get_property_alist (true), diff); transposed_musics_ = scm_cons (ev->unprotect (), transposed_musics_); } - quote_outlet_.get_outlet ()->event_source ()->broadcast (ev); + quote_outlet_.get_context ()->event_source ()->broadcast (ev); } } 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/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/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/stencil-scheme.cc b/lily/stencil-scheme.cc index 958bcc44c8..1f33cd7aec 100644 --- a/lily/stencil-scheme.cc +++ b/lily/stencil-scheme.cc @@ -94,15 +94,12 @@ 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, 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; 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.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/tuplet-iterator.cc b/lily/tuplet-iterator.cc index 5f3548e490..f3c3c82856 100644 --- a/lily/tuplet-iterator.cc +++ b/lily/tuplet-iterator.cc @@ -104,8 +104,8 @@ Tuplet_iterator::process (Moment m) && m.main_part_ == next_split_mom_) { descend_to_bottom_context (); - if (tuplet_handler_.get_outlet ()) - create_event (STOP)->send_to_context (tuplet_handler_.get_outlet ()); + if (tuplet_handler_.get_context ()) + create_event (STOP)->send_to_context (tuplet_handler_.get_context ()); if (m.main_part_ < music_get_length ().main_part_) { 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/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-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-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/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/define-context-properties.scm b/scm/define-context-properties.scm index dab5211f14..f59a862f15 100644 --- a/scm/define-context-properties.scm +++ b/scm/define-context-properties.scm @@ -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 diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 38bf9623dc..95658c16a6 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -926,6 +926,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 +939,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 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/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..c2b4fa7f2b 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -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.") @@ -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). @@ -288,13 +286,14 @@ 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 diff --git a/scm/music-functions.scm b/scm/music-functions.scm index c313600199..defe293619 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:warning (_ "cannot find quoted music: `~S'") quoted-name))) + (ly:music-warning music (ly:format (_ "cannot find quoted music: `~S'") quoted-name)))) music)) diff --git a/scm/part-combiner.scm b/scm/part-combiner.scm index 0e72ebe2a0..c492701c91 100644 --- a/scm/part-combiner.scm +++ b/scm/part-combiner.scm @@ -571,10 +571,27 @@ the mark when there are no spanners active. (define-public (add-quotable parser name mus) (let* ((tab (eval 'musicQuotes (current-module))) - (context-list (recording-group-emulate (context-spec-music mus 'Voice) - (ly:parser-lookup parser 'partCombineListener)))) - (if (pair? context-list) - (hash-set! tab name - ;; cdr : skip name string - (list->vector (reverse! (cdar context-list) - '())))))) + (voicename (get-next-unique-voice-name)) + ;; recording-group-emulate returns an assoc list (reversed!), so + ;; hand it a proper unique context name and extract that key: + (ctx-spec (context-spec-music mus 'Voice voicename)) + (listener (ly:parser-lookup parser 'partCombineListener)) + (context-list (reverse (recording-group-emulate ctx-spec listener))) + (raw-voice (assoc voicename context-list)) + (quote-contents (if (pair? raw-voice) (cdr raw-voice) '()))) + + ;; If the context-specced quoted music does not contain anything, try to + ;; use the first child, i.e. the next in context-list after voicename + ;; That's the case e.g. for \addQuote "x" \relative c \new Voice {...} + (if (null? quote-contents) + (let find-non-empty ((current-tail (member raw-voice context-list))) + ;; if voice has contents, use them, otherwise check next ctx + (cond ((null? current-tail) #f) + ((and (pair? (car current-tail)) + (pair? (cdar current-tail))) + (set! quote-contents (cdar current-tail))) + (else (find-non-empty (cdr current-tail)))))) + + (if (not (null? quote-contents)) + (hash-set! tab name (list->vector (reverse! quote-contents '()))) + (ly:music-warning mus (ly:format (_ "quoted music `~a' is empty") name))))) 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)