From 2edcb9426a00a159847e0b4adb7c048c2d058b87 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 20 Feb 2001 20:12:50 +0100 Subject: [PATCH] patch::: 1.3.129.jcn3 --- Documentation/header.html.in | 2 +- Documentation/regression-test.tely | 2 +- Documentation/user/invoking.itexi | 15 ++- Documentation/user/lilypond.tely | 7 ++ Documentation/user/refman.itely | 167 +++++++++++++++++++++++++---- VERSION | 2 +- buildscripts/lilypond-profile.sh | 2 + debian/changelog | 23 ++++ debian/control | 5 +- debian/emacsen-startup | 6 +- input/bugs/dynamic-switch.ly | 4 +- input/bugs/forte.ly | 10 -- input/bugs/gr-instrument.ly | 42 ++++++++ input/bugs/lyrics-bar.ly | 39 ------- input/bugs/score-dynamics.ly | 17 ++- input/bugs/ss.ly | 14 +++ input/regression/dyn-line.ly | 27 ----- input/regression/dynamics-line.ly | 29 +++++ input/test/dynamics.ly | 10 -- input/test/lyrics-bar.ly | 37 +++++++ input/test/mark.ly | 1 + input/tricks/staff-container.ly | 36 +++++++ lily/a2-engraver.cc | 5 +- lily/align-interface.cc | 3 +- lily/bar.cc | 9 +- lily/dynamic-engraver.cc | 68 ++++++++---- lily/item.cc | 3 +- lily/mark-engraver.cc | 10 +- lily/note-head.cc | 3 +- lily/spanner.cc | 6 ++ lily/staff-symbol-referencer.cc | 4 +- ly/engraver.ly | 31 ++++-- ly/params.ly | 2 +- make/ly-rules.make | 2 +- scm/grob-description.scm | 2 + scm/interface-description.scm | 2 +- 36 files changed, 485 insertions(+), 162 deletions(-) create mode 100644 input/bugs/gr-instrument.ly create mode 100644 input/bugs/ss.ly create mode 100644 input/regression/dynamics-line.ly create mode 100644 input/test/lyrics-bar.ly create mode 100644 input/tricks/staff-container.ly diff --git a/Documentation/header.html.in b/Documentation/header.html.in index ce6b4db7fc..05a32d05ae 100644 --- a/Documentation/header.html.in +++ b/Documentation/header.html.in @@ -53,7 +53,7 @@ which substitutes some @AT_VARIABLES@ as well. Full FAQ
User manual
Regression Test
- To do
+ Documentation of internals

diff --git a/Documentation/regression-test.tely b/Documentation/regression-test.tely index 5e995df80b..fc18c140bd 100644 --- a/Documentation/regression-test.tely +++ b/Documentation/regression-test.tely @@ -51,7 +51,7 @@ and documenting bugfixes. @lilypondfile[printfilename]{staccato-pos.ly} -@lilypondfile[printfilename]{dyn-line.ly} +@lilypondfile[printfilename]{dynamics-line.ly} @lilypondfile[printfilename]{arpeggio.ly} diff --git a/Documentation/user/invoking.itexi b/Documentation/user/invoking.itexi index 55a3b80406..e5e8dd30e6 100644 --- a/Documentation/user/invoking.itexi +++ b/Documentation/user/invoking.itexi @@ -17,7 +17,20 @@ @item -f,--format= Output format for sheet music. Choices are tex (for @TeX{} output), ps (for PostScript) and scm (for a Scheme -dump) +dump). + +For processing both the @TeX{} and the PostScript output, you must +have appropriate environment variables set. For @TeX{}, you have to +set @var{MFINPUTS} and @var{TEXINPUTS} to point to the directory +containing LilyPond metafont and .tex files. For processing the +PostScript with Ghostscript, you have to set @var{GS_FONTPATH} to +point to the directory containing LilyPond @file{pfa} files. + +Scripts to do this are included in +@file{buildscripts/out/lilypond-profile} (for sh shells) and +@file{buildscripts/out/lilypond-login} (for C-shells), and should +normally be run as part of your login process. + @item -h,--help Show a summary of usage. diff --git a/Documentation/user/lilypond.tely b/Documentation/user/lilypond.tely index 78a8c0bb85..93660837fa 100644 --- a/Documentation/user/lilypond.tely +++ b/Documentation/user/lilypond.tely @@ -45,6 +45,13 @@ Copyright 1999 Han-Wen Nienhuys, Jan Nieuwenhuizen and Adrian Mariano @end ifinfo +@ifhtml + +This document is also available as a @uref{../lilypond.ps.gz,gzipped +postscript file}. + +@end ifhtml + @ifnottex @node Top @c FIXME: this should not be necessary... diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 54f4fa6707..917ab40816 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -13,10 +13,13 @@ fix all FIXMEs Rhythm staff (clef, x-notehead) - \partcombine: -> orchestral part-HOWTO. + markup text + postscript, scheme output? + (links to?) using/existance of ly2dvi, lilypond-book + @end ignore @@ -42,6 +45,7 @@ has been revised for LilyPond 1.3.125 * Lyrics:: * Chords:: * Writing parts:: +* Custodes:: * Page layout:: * Sound:: * Music entry:: @@ -99,7 +103,7 @@ design of the program. This manual is ordered in terms of user tasks. With each concept will be explained to which of the three parts it belongs. -LilyPond input can be classified into three types: +LilyPond input can be classified into three types: @itemize @bullet @item musical expressions: a musical expression is some combination of rest, notes, lyrics @@ -162,7 +166,7 @@ automatically generated documentation. -@c . {Repeat} +@c . {Repeats} @node Repeats @section Repeats @@ -275,10 +279,12 @@ the specified number of repeats. As you can see, LilyPond doesn't remember the timing information, nor -are slurs or ties repeated. We hope to fix this after 1.4. +are slurs or ties repeated, so you have to reset timing information +after a repeat, eg using bar-checks, @code{Score.measurePosition} or +@code{\partial}. We hope to fix this after 1.4. It is possible to nest @code{\repeat}, although it probably is only -meaningful for nested repeats. +meaningful for unfolded repeats. @node Manual repeat commands @subsection Manual repeat commands @@ -646,6 +652,9 @@ major key, e.g., @code{\minor} is defined as 3. The standard mode names @code{\ionian}, @code{\locrian}, @code{\aeolian}, @code{\mixolydian}, @code{\lydian}, @code{\phrygian}, and @code{\dorian} are also defined. +This command sets @code{Staff.keySignature}. + +@cindex @code{keySignature} @c . {Clef changes} @subsubsection Clef changes @@ -664,8 +673,48 @@ Short-cut for Supported clef-names include -[todo] +@itemize @bullet +@item treble, violin, G, G2: G clef on 2nd line +@item french: G clef on 1st line +@item soprano: C clef on 1st line +@item mezzosoprano: C clef on 2nd line +@item alto: C clef on 3rd line +@item tenor: C clef on 4th line +@item baritone: C clef on 5th line +@item varbaritone: F clef on 3rd line +@item bass, F: F clef on 4th line +@item subbass: F clef on 5th line +@item percussion: percussion clef +@end itemize +[todo: ancient clefs] + +Supported associated symbols (for Staff.clefGlyph) are: + +@itemize @bullet +@item clefs-C: modern style C clef +@item clefs-F: modern style F clef +@item clefs-G: modern style G clef +@item clefs-vaticana_do: Editio Vaticana style do clef +@item clefs-vaticana_fa: Editio Vaticana style fa clef +@item clefs-medicaea_do: Editio Medicaea style do clef +@item clefs-medicaea_fa: Editio Medicaea style fa clef +@item clefs-mensural1_c: modern style mensural C clef +@item clefs-mensural2_c: historic style small mensural C clef +@item clefs-mensural3_c: historic style big mensural C clef +@item clefs-mensural1_f: historic style traditional mensural F clef +@item clefs-mensural2_f: historic style new mensural F clef +@item clefs-mensural_g: historic style mensural G clef +@item clefs-hufnagel_do: historic style hufnagel do clef +@item clefs-hufnagel_fa: historic style hufnagel fa clef +@item clefs-hufnagel_do_fa: historic style hufnagel combined do/fa clef +@item clefs-percussion: modern style percussion clef +@end itemize + +@emph{Modern style} means "as is typeset in current editions". +@emph{Historic style} means "as was typeset or written in contemporary +historic editions". @emph{Editio XXX style} means "as is/was printed in +Editio XXX". @c . {Time signature} @node Time signature @@ -751,6 +800,7 @@ set different shift values. @menu * Beam:: * Slur :: +* Phrasing slur:: * Ornaments:: * Grace notes:: * Bar check:: @@ -873,11 +923,6 @@ FIXME @menu * Slur attachments:: -* Tie:: -* Tuplets:: -* Text spanner:: -* Ottava:: -* Span requests:: @end menu A slur connects chords and is used to indicate legato. Slurs avoid @@ -1005,6 +1050,14 @@ note in the phrasing slur. @c . {Tie} +@menu +* Tie:: +* Tuplets:: +* Text spanner:: +* Ottava:: +* Span requests:: +@end menu + @node Tie @subsubsection Tie @@ -2210,6 +2263,8 @@ bar numbering tranposing midi property. +instrument names + ] @c . {Rehearsal marks} @@ -2218,16 +2273,29 @@ tranposing midi property. @cindex Rehearsal marks @cindex mark @cindex @code{\mark} +@cindex @code{Mark_engraver} @example \mark @var{unsigned}; -@cindex @code{Mark_engraver} \mark @var{string}; + \mark ; @end example -Prints a mark over or under the staff. +With this command, you can print a rehearsal mark above the system. You +can provide a number, a string or a markup text as argument. If there is +no argument, the property @code{rehearsalMark} is used and automatically +incremented. -[TODO: automatic increments] +@lilypond[fragment,verbatim] +\relative c'' { + c1 \mark "A2"; + c1 \mark ; + c1 \mark ; + c1 \mark "12"; + c1 \mark #'(music "scripts-segno") ; + c1 +} +@end lilypond @node Transpose @subsection Transpose @@ -2290,6 +2358,65 @@ multimeasure rest. @cindex condensing rests +@c . {Custodes} +@node Custodes +@section Custodes +@cindex Custos +@cindex Custodes + +A @emph{custos} (plural: @emph{custodes}; latin word for "guard") is a +staff context symbol that appears at the end of a staff line. It +anticipates the pitch of the first note(s) of the following line and +thus helps the player or singer to manage line breaks during +performance, thus enhancing readability of a score. + +@quotation +@lilypond[verbatim] +\score { + \notes { c'1 d' e' d' \break c' d' e' d' } + \paper { + \translator { + \StaffContext + \consists Custos_engraver; + Custos \override #'style = #'mensural; + } + } +} +@end lilypond +@end quotation + +Custodes were frequently used in music notation until the 16th century. +There were different appearences for different notation styles. +Nowadays, they have survived only in special forms of musical notation +such as via the editio vaticana dating back to the beginning of the 20th +century. + +For typesetting custodes, just put a @code{Custos_engraver} into the +@code{StaffContext} when declaring the @code{\paper} block. In this +block, you can also globally control the appearance of the custos symbol +by setting the custos @code{style} property. Currently supported styles +are @code{vaticana}, @code{medicaea}, @code{hufnagel} and +@code{mensural}. + +@quotation +\paper @{ + \translator @{ + \StaffContext + \consists Custos_engraver; + Custos \override #'style = #'mensural; + @} +@} +@end quotation + +The property can also be set locally, for example in a @code{\notes} +block: + +@quotation +\notes @{ + \property Staff.Custos \override #'style = #'vaticana + c'1 d' e' d' \break c' d' e' d' +@} +@end quotation @c . {Page layout} @node Page layout @@ -3614,15 +3741,15 @@ you need to know exactly how the backend works. Example: @lilypond[fragment,verbatim] \relative c'' { c4 - \context Staff \outputproperty - #(make-type-checker 'note-head-interface) - #'extra-offset = #'(0.5 . 0.75) - } + \context Staff \outputproperty + #(make-type-checker 'note-head-interface) + #'extra-offset = #'(0.5 . 0.75) + } @end lilypond This selects all note heads occurring at current staff level, and sets -the @code{extra-offset} of those heads to @code{(0.5,0.75)}, shifting them -up and right. +the @code{extra-offset} of those heads to @code{(0.5,0.75)}, shifting +them up and right. Use of this feature is entirely on your own risk: if you use this, the result will depend very heavily on the implementation of the backend, diff --git a/VERSION b/VERSION index 40479530b4..50b9768c16 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=129 -MY_PATCH_LEVEL=jcn2 +MY_PATCH_LEVEL=jcn3 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/buildscripts/lilypond-profile.sh b/buildscripts/lilypond-profile.sh index f2083862de..7dbb5dd467 100755 --- a/buildscripts/lilypond-profile.sh +++ b/buildscripts/lilypond-profile.sh @@ -11,6 +11,8 @@ LILYPONDPREFIX="@datadir@" MFINPUTS="@datadir@/mf:"${MFINPUTS:=":"} TEXINPUTS="@datadir@/tex:@datadir@/ps:"${TEXINPUTS:=":"} + +## gs_lib ??? export LILYINCLUDE LILYPONDPREFIX MFINPUTS TEXINPUTS GS_LIB GS_FONTPATH diff --git a/debian/changelog b/debian/changelog index 6d558f8a7c..215774e68d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,26 @@ +lilypond1.3 (1.3.129-1) unstable; urgency=low + + * In memory of Werner Icking + (August 26, 1943 - February 8, 2001), + a dear friend, a kind educator, and a hard worker in sharing beautiful + typeset music to the world. (Maintainer of the GMD Music Archive, + http://www.gmd.de/Misc/Music/). + + * New upstream release. + * Upstream has changed from "lilypond-mode" to the "studly caps name" + "LilyPond-mode". Fixed /etc/emacs/site-start.d/50lilypond1.3.el + (debian/emacsen-startup). Thanks to Christophe Rhodes for the bug + report. Closes: Bug#83732. + * Added "Build-Conflicts: lilypond, lilypond1.3" to prevent old + lilypond font files from potentially interfering with the build on + other Debian ports autobuilders. + * Built with libguile-dev (1:1.4-9) or newer to ensure correct + linkage to libqthreads.so.9. Also updated the Build-Depends and + Depends fields accordingly. Thanks to guile1.4 package maintainer + Rob Browning for his notification and to Daniel Burrows for his bug + report. Closes: Bug#85896. + + -- Anthony Fok Sat, 10 Feb 2001 01:38:36 -0700 + lilypond1.3 (1.3.121-1) unstable; urgency=low * New upstream release. diff --git a/debian/control b/debian/control index 182166b1f1..d50d51b55f 100644 --- a/debian/control +++ b/debian/control @@ -1,5 +1,6 @@ Source: lilypond1.3 -Build-Depends: debhelper (>= 2.0.72), python-base (>= 1.5.2-4), libguile9-dev, tetex-bin, libkpathsea-dev, tetex-extra, flex, bison, texinfo (>= 4.0-1), bibtex2html, groff, gs, netpbm, pnmtopng, m4, gettext (>= 0.10.35-13) +Build-Depends: debhelper (>= 2.0.72), python-base (>= 1.5.2-4), libguile-dev (>= 1:1.4-9), tetex-bin, libkpathsea-dev, tetex-extra, flex, bison, texinfo (>= 4.0-1), bibtex2html, groff, gs, netpbm, pnmtopng, m4, gettext (>= 0.10.35-13) +Build-Conflicts: lilypond, lilypond1.3 Section: tex Priority: optional Maintainer: Anthony Fok @@ -9,7 +10,7 @@ Package: lilypond1.3 Architecture: any Replaces: lilypond Provides: lilypond -Depends: ${shlibs:Depends}, tetex-bin (>= 1.0.5-1), python-base (>= 1.5.2-4), guile +Depends: ${shlibs:Depends}, tetex-bin (>= 1.0.5-1), python-base (>= 1.5.2-4), guile1.4 Recommends: tetex-extra (>= 1.0-1) Conflicts: lilypond, musixtex-fonts Description: A program for printing sheet music. diff --git a/debian/emacsen-startup b/debian/emacsen-startup index 2a3812eeed..0ce6460c08 100644 --- a/debian/emacsen-startup +++ b/debian/emacsen-startup @@ -1,3 +1,3 @@ -(autoload 'lilypond-mode "lilypond-mode" nil t) -(setq auto-mode-alist (cons '("\\.ly$" . lilypond-mode) auto-mode-alist)) -(add-hook 'lilypond-mode-hook (lambda () (turn-on-font-lock))) +(autoload 'LilyPond-mode "lilypond-mode" nil t) +(setq auto-mode-alist (append '(("\\.ly$" . LilyPond-mode) auto-mode-alist))) +(add-hook 'LilyPond-mode-hook (lambda () (turn-on-font-lock))) diff --git a/input/bugs/dynamic-switch.ly b/input/bugs/dynamic-switch.ly index 0c2a69f763..543ffa9a40 100644 --- a/input/bugs/dynamic-switch.ly +++ b/input/bugs/dynamic-switch.ly @@ -1,7 +1,7 @@ \score{ \context Staff < - \context Voice=one\skip 1; - \context Voice=two\skip 1; + \context Voice=one \skip 1; + \context Voice=two \skip 1; \context Voice=one \partcombine Voice \context Thread=one \notes\relative c'' { c2 \clef bass; c2 diff --git a/input/bugs/forte.ly b/input/bugs/forte.ly index bed65d14d7..e69de29bb2 100644 --- a/input/bugs/forte.ly +++ b/input/bugs/forte.ly @@ -1,10 +0,0 @@ - -% y-pos of f is wrong - -\score { - \notes \relative c' \context Voice = viola { - - \stemDown g'8. b,16 - s1 s2. r4 - g } -} diff --git a/input/bugs/gr-instrument.ly b/input/bugs/gr-instrument.ly new file mode 100644 index 0000000000..1530f769a6 --- /dev/null +++ b/input/bugs/gr-instrument.ly @@ -0,0 +1,42 @@ +%{ +instrument names on grandstaffs. GR is centered on entire score +%} + +\version "1.3.129" +\include "paper20.ly" +\header{ + latexpackages = "amsmath"; +} + +\score{ + \notes < + \context Staff = sa {\property Staff.instrument = "A" g,2 c''''2} + \context Staff = sb {\property Staff.instrument = "B" g,2 c''''2} + \context GrandStaff=gs < + \property GrandStaff.instrument = "Gr" + \context Staff = ga {\property Staff.instrument = "" c''1 } + \context Staff = gb {\property Staff.instrument = "" c''1 } + > + \context Staff = sc {\property Staff.instrument = "foobar" +% "\small$\mathrm{\genfrac{}{}{0pt}{0}{C}{D}}$" + + } + \context Staff = sd {\property Staff.instrument = "E" c''1 } + + > + \paper{ + \translator { + \StaffContext + \consists "Instrument_name_engraver"; + } + \translator { + \GrandStaffContext + \consists "Instrument_name_engraver"; + } + + } +} + + + + diff --git a/input/bugs/lyrics-bar.ly b/input/bugs/lyrics-bar.ly index ec0309b322..e69de29bb2 100644 --- a/input/bugs/lyrics-bar.ly +++ b/input/bugs/lyrics-bar.ly @@ -1,39 +0,0 @@ -\header{ -texidoc=" -Adding a @code{Bar_engraver} to the LyricsVoice context makes sure that -lyrics don't collide with barlines. -"; -} - -\score { - \context StaffGroup < - \notes \context Staff { - b1 b1 \bar "|."; - } - \lyrics\context Lyrics < - \context LyricsVoiceWithBars { -% thisContextHasSpanBarEngraver1 added - ThisContextCertainlyHasSpanBarEngraverAddedButTheresSomethingFunny1. Here. - } - \context LyricsVoice { - this4 one has no SpanBarEngraverAddedToContext1 - } - > - \notes \context Staff = SB { b1 b1 } - > - \paper { - linewidth = -1.0\cm; - \translator { - \LyricsContext - \consists "Span_bar_engraver"; - \accepts "LyricsVoiceWithBars"; - } - \translator { - \LyricsVoiceContext - \name "LyricsVoiceWithBars"; - } - \translator { - \LyricsVoiceContext - } - } -} diff --git a/input/bugs/score-dynamics.ly b/input/bugs/score-dynamics.ly index 9389c525a9..cec828c53c 100644 --- a/input/bugs/score-dynamics.ly +++ b/input/bugs/score-dynamics.ly @@ -1,19 +1,32 @@ -% dynamics collide with staff +% dynamics should not collide with staff +% dynamics (of two voices) should not collide with eachother \header { texidoc="Template for part-combining orchestral scores"; } -End = { \skip 1*6; } +End = { \skip 1*8; } violoncello = \notes\relative c'' { c1\ff d e \break c1\ff d e \break + + \property Voice.crescendoText = #"cresc." + \property Voice.crescendoSpanner = #'dashed-line + g4\p\< r r r8 g(| + )c,4 r r r8 c| + [\!f8\sf(\>as f as][f g d)\!g]| } contrabasso = \notes\relative c'' { c1\pp d e c2\pp c d1 e + + \property Voice.crescendoText = #"cresc." + \property Voice.crescendoSpanner = #'dashed-line + g4\p\< r r r8 g(| + )c,4 r r r8 c| + [\!f8\sf(\>as f as][f g d)\!g]| } flautiStaff = \notes \context Staff = flauti < diff --git a/input/bugs/ss.ly b/input/bugs/ss.ly new file mode 100644 index 0000000000..f0585ae086 --- /dev/null +++ b/input/bugs/ss.ly @@ -0,0 +1,14 @@ +\version "1.3.129" +\include "paper16.ly" +\score{ + \notes \context Staff = pr { + \context Voice < a b c' e'> + } + \paper{ + \translator { + \StaffContext + StaffSymbol \override #'staff-space = #1.3 + } + } +} + diff --git a/input/regression/dyn-line.ly b/input/regression/dyn-line.ly index 31f5dc597b..e69de29bb2 100644 --- a/input/regression/dyn-line.ly +++ b/input/regression/dyn-line.ly @@ -1,27 +0,0 @@ -\header{ -texidoc=" -Dynamics appear below or above the staff. If multiple dynamics are -linked with (de)crescendi, they should be on the same line. -"; -} -\score{ -\notes\relative c''{ -a1\fff\> \!c,,\pp a'' a\p - - -% We need this to test if we get two Dynamic line spanners -a - -% because do_removal_processing () -% doesn't seem to post_process elements -d\f - -a - -} -\paper{ -} -\midi{ -\tempo 1 = 60; -} -} diff --git a/input/regression/dynamics-line.ly b/input/regression/dynamics-line.ly new file mode 100644 index 0000000000..70bdeb37b3 --- /dev/null +++ b/input/regression/dynamics-line.ly @@ -0,0 +1,29 @@ +\header{ +texidoc=" Dynamics appear below or above the staff. If multiple +dynamics are linked with (de)crescendi, they should be on the same +line. Isolated dynamics may be forced up or down. "; +} + +\version "1.3.122"; + +\score{ +\notes\relative c''{ +a1^\sfz +a1-\fff\> \!c,,-\pp a'' a-\p + +% We need this to test if we get two Dynamic line spanners +a + +% because do_removal_processing () +% doesn't seem to post_process elements +d\f + +a + +} +\paper{ +} +\midi{ +\tempo 1 = 60; +} +} diff --git a/input/test/dynamics.ly b/input/test/dynamics.ly index 05fca1aaca..e69de29bb2 100644 --- a/input/test/dynamics.ly +++ b/input/test/dynamics.ly @@ -1,10 +0,0 @@ -\score { - \context Voice \notes\relative c { - c''4 \p c \ff c^\ff - \property Voice.dynamicPadding = 10 - c \p \< \! c \ff\> c \!c-\p - - } - \paper { } - \midi { } -} diff --git a/input/test/lyrics-bar.ly b/input/test/lyrics-bar.ly new file mode 100644 index 0000000000..7be6f4c0ac --- /dev/null +++ b/input/test/lyrics-bar.ly @@ -0,0 +1,37 @@ +\header{ +texidoc=" +Adding a @code{Bar_engraver} to the LyricsVoice context makes sure that +lyrics don't collide with barlines. +"; +} + +\score { + \context StaffGroup < + \notes \context Staff { + b1 b1 \bar "|."; + } + \lyrics\context Lyrics < + \context LyricsVoiceWithBars { +% thisContextHasSpanBarEngraver1 added + ThisContextCertainlyHasSpanBarEngraverAddedButTheresSomethingFunny1. Here. + } + \context LyricsVoice { + this4 one has no SpanBarEngraverAddedToContext1 + } + > + \notes \context Staff = SB { b1 b1 } + > + \paper { + linewidth = -1.0\cm; + \translator { + \LyricsContext + \accepts "LyricsVoiceWithBars"; + } + \translator { + \LyricsVoiceContext + \consists "Bar_engraver"; + \name "LyricsVoiceWithBars"; + } + + } +} diff --git a/input/test/mark.ly b/input/test/mark.ly index 948f230197..538cdfbf9b 100644 --- a/input/test/mark.ly +++ b/input/test/mark.ly @@ -3,6 +3,7 @@ global = \notes { s1 | \mark "A"; s1 | \mark ; + s1 | \mark ; s1 | \mark "12"; s1 | \mark ; s1 | \mark "A2"; diff --git a/input/tricks/staff-container.ly b/input/tricks/staff-container.ly new file mode 100644 index 0000000000..fb67f54158 --- /dev/null +++ b/input/tricks/staff-container.ly @@ -0,0 +1,36 @@ + +\header { + + texidoc = "By splitting the grouping (Axis_group_engraver) and +creation functionality into separate contexts, you can override +interesting things. You can also drop the \consistsend feature."; + +} + + +\score { + \notes < + \context StaffContainer = SA { \property StaffContainer.StaffSymbol \set + #'staff-space = #0.8 + \context Staff { c4 c4 } } + \context StaffContainer =SB { \context Staff { d f } } + > + +\paper { + \translator { + \ScoreContext + \accepts StaffContainer; + \denies Staff; + } + \translator { + \type Engraver_group_engraver; + \consists "Axis_group_engraver"; + \accepts "Staff"; + \name StaffContainer; + + } + \translator { + \StaffContext + \remove Axis_group_engraver; + } +} diff --git a/lily/a2-engraver.cc b/lily/a2-engraver.cc index 5480059806..5df8930a30 100644 --- a/lily/a2-engraver.cc +++ b/lily/a2-engraver.cc @@ -134,8 +134,9 @@ A2_engraver::acknowledge_grob (Grob_info i) || Slur::has_interface (i.elem_l_) /* Usually, dynamics are removed by *_devnull_engravers for the - second voice. We don't want all dynamics for the first voice - to be placed above the staff. */ + second voice. On the one hand, we don't want all dynamics for + the first voice to be placed above the staff. On the other + hand, colliding of scripts may be worse */ #if 0 || i.elem_l_->has_interface (ly_symbol2scm ("dynamic-interface")) || i.elem_l_->has_interface (ly_symbol2scm ("text-interface")) diff --git a/lily/align-interface.cc b/lily/align-interface.cc index da303bd33e..d335966f7f 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -107,7 +107,7 @@ Align_interface::align_to_extents (Grob * me, Axis a) Link_array elems; Link_array all_grobs - = Pointer_group_interface__extract_elements ( me, (Grob*) 0, "elements"); + = Pointer_group_interface__extract_elements (me, (Grob*) 0, "elements"); for (int i=0; i < all_grobs.size(); i++) { Interval y = all_grobs[i]->extent(me, a); @@ -122,7 +122,6 @@ Align_interface::align_to_extents (Grob * me, Axis a) && gh_number_p (gh_cdr (min_dims))) { y.unite (ly_scm2interval (min_dims)); - } SCM extra_dims = e->remove_grob_property ("extra-space"); diff --git a/lily/bar.cc b/lily/bar.cc index b74122d072..0ee7890743 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -197,8 +197,15 @@ Bar::get_staff_bar_size (SCM smob) SCM size = me->get_grob_property ("bar-size"); if (gh_number_p (size)) return gh_double2scm (gh_scm2double(size)*ss); - else + else if (Staff_symbol_referencer::staff_symbol_l (me)) { + /* + If there is no staff-symbol, we get -1 from the next + calculation. That's a nonsense value, which would collapse the + barline so we return 0.0 in the next alternative. + */ return gh_double2scm ((Staff_symbol_referencer::line_count (me) -1) * ss); } + else + return gh_int2scm (0); } diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index ef3576f881..83b2def70a 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -65,8 +65,7 @@ protected: virtual void acknowledge_grob (Grob_info); virtual bool try_music (Music *req_l); virtual void stop_translation_timestep (); - - virtual void create_grobs (); + virtual void process_music (); virtual void start_translation_timestep (); }; @@ -129,7 +128,7 @@ Dynamic_engraver::try_music (Music * m) } void -Dynamic_engraver::create_grobs () +Dynamic_engraver::process_music () { if (accepted_spanreqs_drul_[START] || accepted_spanreqs_drul_[STOP] || script_req_l_) { @@ -187,8 +186,7 @@ Dynamic_engraver::create_grobs () /* finish side position alignment if the (de)cresc ends here, and there are no new dynamics. - - */ + */ if ( !cresc_p_) { @@ -203,12 +201,15 @@ Dynamic_engraver::create_grobs () cresc_p_->set_bound (RIGHT, script_p_ ? script_p_ : unsmob_grob (get_property ("currentMusicalColumn"))); + add_bound_item (line_spanner_, cresc_p_->get_bound (RIGHT)); + finished_cresc_p_ = cresc_p_; cresc_p_ = 0; current_cresc_req_ = 0; } } + if (accepted_spanreqs_drul_[START]) { if (current_cresc_req_) @@ -224,27 +225,27 @@ Dynamic_engraver::create_grobs () /* TODO: Use symbols. - */ + */ String start_type = ly_scm2string (accepted_spanreqs_drul_[START]->get_mus_property ("span-type")); /* ugh. Use push/pop? - */ + */ SCM s = get_property ((start_type + "Spanner").ch_C()); if (!gh_symbol_p (s) || s == ly_symbol2scm ("hairpin")) { cresc_p_ = new Spanner (get_property ("Hairpin")); cresc_p_->set_grob_property ("grow-direction", - gh_int2scm ((start_type == "crescendo") - ? BIGGER : SMALLER)); + gh_int2scm ((start_type == "crescendo") + ? BIGGER : SMALLER)); } /* This is a convenient (and legacy) interface to TextSpanners for use in (de)crescendi. Hmm. - */ + */ else { cresc_p_ = new Spanner (get_property ("TextSpanner")); @@ -256,7 +257,7 @@ Dynamic_engraver::create_grobs () if (gh_string_p (s)) { cresc_p_->set_grob_property ("edge-text", - gh_cons (s, ly_str02scm (""))); + gh_cons (s, ly_str02scm (""))); daddy_trans_l_->set_property (start_type + "Text", SCM_UNDEFINED); } @@ -267,18 +268,24 @@ Dynamic_engraver::create_grobs () : unsmob_grob (get_property ("currentMusicalColumn"))); Axis_group_interface::add_element (line_spanner_, cresc_p_); + + add_bound_item (line_spanner_, cresc_p_->get_bound (LEFT)); + announce_grob (cresc_p_, accepted_spanreqs_drul_[START]); } } - script_req_l_ = 0; - accepted_spanreqs_drul_[START] = 0; - accepted_spanreqs_drul_[STOP] = 0; } void Dynamic_engraver::stop_translation_timestep () { typeset_all (); + if (script_req_l_ && !current_cresc_req_) + { + finished_line_spanner_ = line_spanner_; + line_spanner_ =0; + typeset_all (); + } } void @@ -304,11 +311,16 @@ Dynamic_engraver::typeset_all () { if (finished_cresc_p_) { -#if 1 - finished_cresc_p_->set_bound (RIGHT, script_p_ - ? script_p_ - : unsmob_grob (get_property ("currentMusicalColumn"))); -#endif + if (!finished_cresc_p_->get_bound (RIGHT)) + { + finished_cresc_p_->set_bound (RIGHT, script_p_ + ? script_p_ + : unsmob_grob (get_property ("currentMusicalColumn"))); + + if (finished_line_spanner_) + add_bound_item (finished_line_spanner_, + finished_cresc_p_->get_bound (RIGHT)); + } typeset_grob (finished_cresc_p_); finished_cresc_p_ =0; } @@ -320,8 +332,24 @@ Dynamic_engraver::typeset_all () } if (finished_line_spanner_) { + /* + To make sure that this works + */ Side_position::add_staff_support (finished_line_spanner_); - extend_spanner_over_elements (finished_line_spanner_); + /* + We used to have + + extend_spanner_over_elements (finished_line_spanner_); + + but this is rather kludgy, since finished_line_spanner_ + typically has a staff-symbol field set , extending it over the + entire staff. + + */ + + if (!finished_line_spanner_->get_bound (RIGHT)) + finished_line_spanner_->set_bound (RIGHT, finished_line_spanner_->get_bound (LEFT)); + typeset_grob (finished_line_spanner_); finished_line_spanner_ = 0; } diff --git a/lily/item.cc b/lily/item.cc index 0d5c67b74e..f157b480a2 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -47,7 +47,8 @@ Item::breakable_b (Grob*me) Paper_column * Item::column_l () const { - return dynamic_cast (parent_l (X_AXIS))->column_l (); + Item *parent = dynamic_cast (parent_l (X_AXIS)); + return parent ? parent->column_l () : 0; } Line_of_score * diff --git a/lily/mark-engraver.cc b/lily/mark-engraver.cc index 42dcb87513..70136ac143 100644 --- a/lily/mark-engraver.cc +++ b/lily/mark-engraver.cc @@ -40,7 +40,7 @@ protected: virtual bool try_music (Music *req_l); virtual void start_translation_timestep (); virtual void initialize (); - virtual void create_grobs (); + virtual void process_music (); private: Mark_req * mark_req_l_; @@ -135,8 +135,14 @@ Mark_engraver::try_music (Music* r_l) return false; } + +/* + + TODO: make the increment function in Scheme. + +*/ void -Mark_engraver::create_grobs () +Mark_engraver::process_music () { if (mark_req_l_) { diff --git a/lily/note-head.cc b/lily/note-head.cc index 9af3c41f2a..bfd06f0807 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -5,6 +5,7 @@ (c) 1997--2000 Han-Wen Nienhuys */ +#include #include "misc.hh" #include "dots.hh" @@ -60,7 +61,7 @@ Note_head::brew_molecule (SCM smob) Real inter_f = Staff_symbol_referencer::staff_space (me)/2; int sz = Staff_symbol_referencer::line_count (me)-1; - int p = (int)Staff_symbol_referencer::position_f (me); + int p = (int) rint (Staff_symbol_referencer::position_f (me)); int streepjes_i = abs (p) < sz ? 0 : (abs(p) - sz) /2; diff --git a/lily/spanner.cc b/lily/spanner.cc index 54f6253131..d6a3565729 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -311,6 +311,9 @@ add_bound_item (Spanner* sp, Item*it) sp->set_bound (RIGHT, it); } +/* + Extends EXTREMAL_PAIR to include IT + */ static void extend_spanner_over_item (Item *it, SCM extremal_pair) { @@ -330,6 +333,9 @@ extend_spanner_over_item (Item *it, SCM extremal_pair) } } +/* + Extends EXTREMAL_PAIR to include every grob in VALUE + */ static void extend_spanner_over_elements (SCM value, SCM extremal_pair) { diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index 1341bf9a02..da1ae75483 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -11,7 +11,7 @@ #include "staff-symbol-referencer.hh" #include "staff-symbol.hh" #include "paper-def.hh" - + bool Staff_symbol_referencer::has_interface (Grob*e) { @@ -29,7 +29,7 @@ Staff_symbol_referencer::line_count (Grob*me) bool Staff_symbol_referencer::on_staffline (Grob*me) { - return on_staffline (me, (int) position_f (me)); + return on_staffline (me, (int) rint (position_f (me))); } bool diff --git a/ly/engraver.ly b/ly/engraver.ly index ae5d56fde4..ccfb55813e 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -1,6 +1,6 @@ +\version "1.3.122" -\version "1.3.110" - % +% % setup for Request->Element conversion. Guru-only % @@ -33,8 +33,6 @@ StaffContext=\translator { \consists "Local_key_engraver"; \consists "Piano_pedal_engraver"; - \consistsend "Axis_group_engraver"; - %{ The Instrument_name_engraver puts the name of the instrument (\property Staff.instrument; Staff.instr for subsequent lines) @@ -45,11 +43,20 @@ StaffContext=\translator { \consists "Instrument_name_engraver"; %} + \consistsend "Axis_group_engraver"; \accepts "Voice"; } + +StaffContainerContext = \translator { + \type Engraver_group_engraver; + \consists "Axis_group_engraver"; + \accepts Staff; + \name StaffContainer; +} + ChoirStaffContext = \translator { \type "Engraver_group_engraver"; \name ChoirStaff; @@ -101,7 +108,6 @@ VoiceContext = \translator { \consists "Output_property_engraver"; \consists "Arpeggio_engraver"; - \consists "Dynamic_engraver"; % must come before text_engraver. \consists "Text_spanner_engraver"; \consists "Property_engraver"; @@ -114,9 +120,13 @@ VoiceContext = \translator { \consists "Chord_tremolo_engraver"; \consists "Melisma_engraver"; + +%{ + Must come before text_engraver, but after note_column engraver. + +%} + \consists "Dynamic_engraver"; \consists "Text_engraver"; - \consists "A2_engraver"; - \consists "Voice_devnull_engraver"; \consists "Script_engraver"; \consists "Script_column_engraver"; @@ -126,6 +136,9 @@ VoiceContext = \translator { \consists "Tie_engraver"; \consists "Tuplet_engraver"; \consists "Grace_position_engraver"; + \consists "A2_engraver"; + \consists "Voice_devnull_engraver"; + \consists "Skip_req_swallow_translator"; \accepts Thread; % bug if you leave out this! \accepts Grace; @@ -339,8 +352,8 @@ ScoreContext = \translator { \consists "Bar_number_engraver"; \consists "Span_arpeggio_engraver"; - - \accepts "Staff"; + \accepts "Staff"; + \accepts "StaffContainer"; \accepts "StaffGroup"; \accepts "RhythmicStaff"; \accepts "Lyrics"; diff --git a/ly/params.ly b/ly/params.ly index 553e81041e..6ac3908098 100644 --- a/ly/params.ly +++ b/ly/params.ly @@ -26,7 +26,7 @@ outputscale = \staffheight / 4.0; \translator { \ThreadContext} \translator { \PianoStaffContext} \translator { \LyricsVoiceContext } - +\translator { \StaffContainerContext } diff --git a/make/ly-rules.make b/make/ly-rules.make index 9b997bf350..49a0f6dd12 100644 --- a/make/ly-rules.make +++ b/make/ly-rules.make @@ -9,7 +9,7 @@ $(outdir)/%.latex: %.doc chmod -w $@ # don't do ``cd $(outdir)'', and assume that $(outdir)/.. is the src dir. -# it is not, for --scrdir builds +# it is not, for --srcdir builds $(outdir)/%.texi: %.tely rm -f $@ LILYPONDPREFIX=$(LILYPONDPREFIX)/.. $(PYTHON) $(script-dir)/lilypond-book.py --outdir=$(outdir) -I $(pwd) -I $(input-dir)/tricks/ -I $(input-dir)/regression/ -I $(input-dir)/test/ --dependencies --format=texi $< diff --git a/scm/grob-description.scm b/scm/grob-description.scm index 59e9a54db2..b1ecfc0a2a 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -49,7 +49,9 @@ (direction . 1) (font-family . roman) (font-relative-size . -1) + (Y-offset-callbacks . (,Side_position::aligned_side)) (meta . ,(grob-description "BarNumber" + side-position-interface text-interface font-interface break-aligned-interface)) )) diff --git a/scm/interface-description.scm b/scm/interface-description.scm index f17a9f9e5a..7d5ee12eaa 100644 --- a/scm/interface-description.scm +++ b/scm/interface-description.scm @@ -69,7 +69,7 @@ #'thickness= weight of beams, in staffspace " - '( + '(auto-knee-gap staff-position height flag-width-function -- 2.39.2