From 1c73ec3c7960794484e1c6c335a2421ded1db87a Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 16 Jan 2004 19:09:31 +0000 Subject: [PATCH] * scm/paper.scm (set-staff-size): new function: set default staff-size. * scripts/convert-ly.py (conv): add conversion rule. * lily/music-output-def.cc (LY_DEFINE): ly_output_def_scope: new function. * scm/paper.scm: new file. (set-staff-size): new function (set-paper-size): new function * lily/parser.yy (music_output_def_body): restructure definition, so first Scheme statement in \paper also happens in new scope. * lily/system.cc (post_processing): move uniquify_list () to dumping molecule stage. * ly/engraver-init.ly (AncientRemoveEmptyStaffContext): set barCheckSynchronize to #f. Warning: this will mess up scores that use barchecks to shorten measures. * mf/feta-bolletjes.mf (overdone_heads): make note heads rounder at 20pt too. * Documentation/user/tutorial.itely (Printing lyrics): document \lyricsto * lily/my-lily-lexer.cc: \newaddlyrics -> \lyricsto * Documentation/user/refman.itely (Fermatas): document \lyricsto * lily/new-lyric-combine-music-iterator.cc (process): don't crash if Voice is not found. * VERSION: release 2.1.10 * lily/parser.yy (markup): MARKUP_HEAD_EMPTY * lily/system.cc (output_lines): revert uniquify_list() patch, strange side effects seen. --- ChangeLog | 39 +++++ Documentation/user/cheatsheet.itely | 4 +- Documentation/user/refman.itely | 153 +++++++++++++------ Documentation/user/tutorial.itely | 59 +++---- VERSION | 2 +- input/mutopia/F.Schubert/morgenlied.ly | 19 ++- input/mutopia/F.Schubert/standchen.ly | 4 +- input/regression/lyric-combine-new.ly | 7 +- input/regression/lyric-combine-polyphonic.ly | 8 +- input/regression/lyric-extender-broken.ly | 4 +- input/regression/lyric-phrasing-new.ly | 4 +- input/regression/lyric-phrasing.ly | 6 +- input/regression/lyrics-melisma-beam.ly | 4 +- input/template/melody-lyrics-chords.ly | 4 +- input/template/melody-lyrics.ly | 4 +- input/template/piano-lyrics.ly | 4 +- input/template/piano-melody-lyrics.ly | 2 +- input/template/satb.ly | 10 +- input/test/divisiones.ly | 4 +- lily/extender-engraver.cc | 27 +++- lily/grob.cc | 3 +- lily/ly-module.cc | 3 +- lily/music-output-def.cc | 30 ++++ lily/my-lily-lexer.cc | 2 +- lily/new-lyric-combine-music-iterator.cc | 2 + lily/parser.yy | 22 +-- lily/system.cc | 33 +++- ly/declarations-init.ly | 70 +++++++-- ly/engraver-init.ly | 2 +- ly/generic-paper-init.ly | 7 - ly/paper-as5-init.ly | 17 --- ly/paper-as5.ly | 3 - ly/paper-as9-init.ly | 15 -- ly/paper-as9.ly | 3 - ly/paper-init.ly | 16 -- ly/paper11-init.ly | 12 -- ly/paper11.ly | 3 - ly/paper13-init.ly | 13 -- ly/paper13.ly | 3 - ly/paper16-init.ly | 12 -- ly/paper16.ly | 3 - ly/paper19-init.ly | 14 -- ly/paper19.ly | 3 - ly/paper20-init.ly | 25 --- ly/paper20.ly | 3 - ly/paper23-init.ly | 12 -- ly/paper23.ly | 3 - ly/paper26-init.ly | 11 -- ly/paper26.ly | 3 - ly/params-init.ly | 47 ------ mf/feta-bolletjes.mf | 9 +- mf/parmesan19.mf | 16 -- scm/lily.scm | 2 + scm/output-lib.scm | 1 + scm/output-tex.scm | 3 +- scm/paper.scm | 70 +++++++++ scripts/convert-ly.py | 13 ++ 57 files changed, 467 insertions(+), 410 deletions(-) delete mode 100644 ly/paper-as5-init.ly delete mode 100644 ly/paper-as5.ly delete mode 100644 ly/paper-as9-init.ly delete mode 100644 ly/paper-as9.ly delete mode 100644 ly/paper-init.ly delete mode 100644 ly/paper11-init.ly delete mode 100644 ly/paper11.ly delete mode 100644 ly/paper13-init.ly delete mode 100644 ly/paper13.ly delete mode 100644 ly/paper16-init.ly delete mode 100644 ly/paper16.ly delete mode 100644 ly/paper19-init.ly delete mode 100644 ly/paper19.ly delete mode 100644 ly/paper20-init.ly delete mode 100644 ly/paper20.ly delete mode 100644 ly/paper23-init.ly delete mode 100644 ly/paper23.ly delete mode 100644 ly/paper26-init.ly delete mode 100644 ly/paper26.ly delete mode 100644 mf/parmesan19.mf create mode 100644 scm/paper.scm diff --git a/ChangeLog b/ChangeLog index 6f17115821..f84162eb71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,44 @@ 2004-01-16 Han-Wen Nienhuys + * ly/paper*.ly: remove files. + + * scm/paper.scm (set-staff-size): new function: set default + staff-size. + + * scripts/convert-ly.py (conv): add conversion rule. + + * lily/music-output-def.cc (LY_DEFINE): ly_output_def_scope: new + function. + + * scm/paper.scm: new file. + (set-staff-size): new function + (set-paper-size): new function + + * lily/parser.yy (music_output_def_body): restructure definition, + so first Scheme statement in \paper also happens in new scope. + + * lily/system.cc (post_processing): move uniquify_list () to + dumping molecule stage. + + * ly/engraver-init.ly (AncientRemoveEmptyStaffContext): set + barCheckSynchronize to #f. Warning: this will mess up scores that + use barchecks to shorten measures. + + * mf/feta-bolletjes.mf (overdone_heads): make note heads rounder + at 20pt too. + + * Documentation/user/tutorial.itely (Printing lyrics): document + \lyricsto + + * lily/my-lily-lexer.cc: \newaddlyrics -> \lyricsto + + * Documentation/user/refman.itely (Fermatas): document \lyricsto + + * lily/new-lyric-combine-music-iterator.cc (process): don't crash + if Voice is not found. + + * VERSION: release 2.1.10 + * input/{test,regression}/: remove old-relative * lily/lexer.ll: add empty markup signature. diff --git a/Documentation/user/cheatsheet.itely b/Documentation/user/cheatsheet.itely index 3128a11c68..e789f92a6d 100644 --- a/Documentation/user/cheatsheet.itely +++ b/Documentation/user/cheatsheet.itely @@ -233,8 +233,8 @@ a\> a a\! @tab lyric hyphen @tab @lilypond[fragment,relative 1] -\addlyrics \notes { g'4 g } - \context Lyrics \lyrics { twin -- kle } + \notes { g'4 g } + \lyricsto "" \new LyricsVoice \lyrics { twin -- kle } @end lilypond @item @code{\chords @{ c:dim f:maj7 @}} diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index b4a76cf3fa..61f9ac868b 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -3482,54 +3482,53 @@ The definition of lyrics mode is too complex. @node The Lyrics context @subsection The Lyrics context -Lyrics are printed by interpreting them in @internalsref{Lyrics} context: +Lyrics are printed by interpreting them in @internalsref{LyricsVoice} context: @example - \context Lyrics \lyrics @dots{} + \context LyricsVoice \lyrics @dots{} @end example @cindex automatic syllable durations -@cindex @code{\addlyrics} +@cindex @code{\lyricsto} @cindex lyrics and melodies This will place the lyrics according to the durations that were entered. The lyrics can also be aligned under a given melody automatically. In this case, it is no longer necessary to enter the correct duration for each syllable. This is achieved by combining the -melody and the lyrics with the @code{\addlyrics} expression: +melody and the lyrics with the @code{\lyricsto} expression: @example -\addlyrics - \notes @dots{} - \context Lyrics @dots{} +\lyricsto @var{name} \new LyricsVoice @dots{} @end example -@cindex staff order, with @code{\addlyrics} +This aligns the lyrics to the notes of the @internalsref{Voice} +context called @var{name}, which has to exist. Therefore, normally +the @code{Voice} is specified first, and then the lyrics are specified +with @code{\lyricsto}. -Normally, this will put the lyrics below the staff. For different or -more complex orderings, the best way is to setup the hierarchy of -staves and lyrics first, e.g. +For different or more complex orderings, the best way is to setup the +hierarchy of staves and lyrics first, e.g. @example \context ChoirStaff \notes << - \context Lyrics = sopr @{ s1 @} - \context Staff = soprStaff @{ s1 @} - \context Lyrics = tenor @{ s1 @} - \context Staff = tenorStaff @{ s1 @} + \context LyricsVoice = sopranoLyrics @{ s1 @} + \context Voice = soprano @{ @emph{music} @} + \context LyricsVoice = tenor @{ s1 @} + \context Voice = tenorLyrics @{ @emph{music} @} >> @end example and then combine the appropriate melodies and lyric lines: @example - \addlyrics - \context Staff = soprStaff @emph{the music} - \context Lyrics = sopr @emph{the lyrics} + \lyricsto "soprano" \new LyricsVoice @emph{the lyrics} @end example -putting both together, you would get -@example -\context ChoirStaff \notes << - \context Lyrics = @dots{} - \context Staff = @dots{} - \addlyrics @dots{} ->> -@end example +An example is in @inputfileref{input/template,satb.ly}. + +When multiple stanzas are put on the same melody, it can happen that +two stanzas have melismata in different locations. This can be +remedied by switching off melismata for one +@internalsref{LyricsVoice}. This is achieved by setting +the @code{ignoreMelismata} property to @code{#t}. An example is shown +in @inputfileref{input/regression,lyric-combine-new.ly}. + @cindex SATB @cindex choral score @@ -3541,19 +3540,18 @@ A complete example of a SATB score setup is in the file Internals: @internalsref{LyricCombineMusic}, @internalsref{Lyrics} -Examples: @inputfileref{input/template,satb.ly}. - +Examples: @inputfileref{input/template,satb.ly}, +@inputfileref{input/regression,lyric-combine-new.ly}. + @refbugs -@code{\addlyrics} is not automatic enough: melismata are not detected -automatically, and melismata are not stopped when they hit a rest. A -melisma on the last note in a melody is not printed. +@code{\lyricsto} is not automatic enough: melismata are not detected +automatically, and melismata are not stopped when they hit a rest. @node More stanzas @subsection More stanzas - @cindex phrasing, in lyrics @@ -3582,17 +3580,15 @@ that identity followed by a dash. In the preceding example, the The complete example is shown here: @lilypond[singleline,verbatim] \score { -\addlyrics - \notes \relative c'' \context Voice = duet { \time 3/4 + << \notes \relative c'' \context Voice = duet { \time 3/4 g2 e4 a2 f4 g2. } - \lyrics \context Lyrics << - \context LyricsVoice = "duet-1" { - \property LyricsVoice . stanza = "Bert" - Hi, my name is bert. } - \context LyricsVoice = "duet-2" { - \property LyricsVoice . stanza = "Ernie" + \lyrics << \lyricsto "duet" \new LyricsVoice { + \property LyricsVoice . stanza = "1" + Hi, my name is bert. } + \lyricsto "duet" \new LyricsVoice { + \property LyricsVoice . stanza = "2" Ooooo, ch\'e -- ri, je t'aime. } - >> + >> >> } @end lilypond @@ -7333,7 +7329,6 @@ entering the chant, as the following short excerpt demonstrates: @lilypond[raggedright,verbatim,noindent] \include "gregorian-init.ly" \score { - \addlyrics \context VaticanaVoice { \property Score.BarNumber \set #'transparent = ##t \notes { @@ -7342,7 +7337,7 @@ entering the chant, as the following short excerpt demonstrates: \[ c'( c' \flexa a \] \[ a \flexa \deminutum g) \] f \divisioMinima } } - \context Lyrics \lyrics { + \lyricsto "" \new LyricsVoice \lyrics { San- ctus, San- ctus, San- ctus } } @@ -8454,15 +8449,64 @@ There is no convenient mechanism to manually override spacing. @cindex staff size, setting @cindex @code{paper} file -The Feta font provides musical symbols at seven different sizes. -These fonts are 11 point, 13 point, 16 point, 20 point, 23 point, and -26 point. The point size of a font is the height of the corresponding -staff (excluding line thicknesses). +The Feta font provides musical symbols at eight seven different +sizes. Each font is tuned for a different staff size, which are listed +in the following table: + +@multitable @columnfractions .3 .3 .4 -Definitions for these sizes are the files @file{paperSZ.ly}, where +@item @b{name} +@tab @b{staff height (pt)} +@tab @b{staff height (mm)} +@tab @b{use} + +@item feta11 +@tab 11.22 +@tab 3.9 +@tab pocket scores + +@item feta13 +@tab 12.60pt +@tab 4.4mm +@tab + +@item feta14 +@tab 14.14pt +@tab 5.0mm +@tab + +@item feta16 +@tab 15.87pt +@tab 5.6mm +@tab + +@item feta18 +@tab 17.82pt +@tab 6.3mm +@tab song books + +@item feta20 +@tab 17.82pt +@tab 7.0mm +@tab standard parts + +@item feta23 +@tab 22.45 pt +@tab 7.9mm +@tab + +@item feta20 +@tab 25.2 pt +@tab 8.9mm +@tab +@c modern rental material ? + +@end multitable + +These standard sizes can be used by including the file @file{paperSZ.ly}, where @code{SZ} is one of 11, 13, 16, 20, 23 and 26. If you include any of these files, the variables @code{paperEleven}, -@code{paperThirteen}, @code{paperSixteen}, +@code{paperThirteen}, @code{paperSixteen}, @code{paperEightteen}, @code{paperTwenty}, @code{paperTwentythree}, and @code{paperTwentysix} are defined respectively. The default @code{\paper} block is also set. These files should be imported at toplevel, i.e. @@ -8471,11 +8515,22 @@ set. These files should be imported at toplevel, i.e. \score @{ ... @} @end example +Sizes can also be + + The default font size settings for each staff heights are generated from the 20pt style sheet. For more details, see the file @file{scm/font.scm}. + of starting from 11 point +(. These fonts are 11 point, 13 point, 16 point, 20 point, 23 point, +and 26 point. The point size of a font is the height of the +corresponding staff (excluding line thicknesses). + +Definitions for these sizes are the files + + @node Line breaking @subsection Line breaking diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index 2ac80bfe4f..f26a01e876 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -1063,9 +1063,9 @@ surrounding them with @code{\lyrics @{ @dots{} @}}, for example, Like notes, lyrics are also a form of music, but they must not be printed on a staff, which is the default way to print music. To print -them as lyrics, they must be marked with @code{ \new Lyrics}: +them as lyrics, they must be marked with @code{ \new LyricsVoice}: @example - \new Lyrics \lyrics @{ I want to break free @} + \new LyricsVoice \lyrics @{ I want to break free @} @end example The melody for this song is as follows: @@ -1076,25 +1076,25 @@ The melody for this song is as follows: @end lilypond The lyrics can be set to these notes, combining both with the -@code{\addlyrics} keyword: +@code{\lyricsto} keyword: @example - \addlyrics - \notes @{ @dots{} @} - \new Lyrics @dots{} + \lyricsto "@var{name}" \new LyricsVoice @dots{} @end example +where @var{name} identifies to which melody the lyrics should be +aligned. In this case, there is only one melody, so we can leave it +empty. The final result is @lilypond[verbatim,linewidth=6.0cm] \score { - \notes { - \addlyrics - \relative c' { + \notes << + \relative c' \new Voice { \partial 8 c8 \times 2/3 { f g g } \times 2/3 { g4( a2) } } - \new Lyrics \lyrics { I want to break free } - } + \lyricsto "" \new LyricsVoice \lyrics { I want to break free } + >> \paper{ } } @end lilypond @@ -1110,20 +1110,14 @@ line}. It is entered as two underscores, i.e. @end example @lilypond[] \score { - \notes { - \addlyrics - \relative c' { - \partial 8 + \notes << + \relative c' \new Voice { + \partial 8 c8 - \times 2/3 { f g g } \times 2/3 { g4( a2) } - - %% ugh, this is to deal with bugs in the extender implementation - \hideNotes - c32 - } - \new Lyrics \lyrics { I want to break free __ } - } - \paper{ linewidth = 9.0 \cm } + \times 2/3 { f g g } \times 2/3 { g4( a2) } } + \lyricsto "" \new LyricsVoice \lyrics { I want to break free __ } + >> + \paper{ } } @end lilypond @@ -1134,13 +1128,12 @@ resulting in a centered hyphen between two syllables: @end example @lilypond[singleline] \score { - \addlyrics \notes \relative f' { \time 2/4 + << \notes \relative f' { \time 2/4 f4 f c' c' } - \new Lyrics \lyrics { Twin -- kle twin -- kle - } -\paper { linewidth = 6.0 \cm } + \new Lyrics \lyrics { Twin -- kle twin -- kle } + >> + \paper { raggedright = ##t } } - @end lilypond More options, like putting multiple lines of lyrics below a melody are @@ -1195,9 +1188,8 @@ a lead sheet, for example, \score @{ << \context ChordNames \chords @{ @emph{chords} @} - \addlyrics - \notes @emph{the melody} - \context Lyrics \lyrics @{ @emph{the text} @} + \notes @emph{the melody} + \lyricsto "" \new LyricsVoice \lyrics @{ @emph{the text} @} >> \paper @{ @} @} @@ -1206,12 +1198,11 @@ a lead sheet, for example, \score { << \context ChordNames \chords { r8 c2:sus4 f } - \addlyrics \notes \relative c' { \partial 8 c8 \times 2/3 { f g g } \times 2/3 { g4( a2) } } - \context Lyrics \lyrics { I want to break free __ } + \new LyricsVoice \lyricsto "" \lyrics { I want to break free __ } >> \paper{ raggedright = ##t } } diff --git a/VERSION b/VERSION index f7a5644825..bcf807ce68 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=2 MINOR_VERSION=1 -PATCH_LEVEL=10 +PATCH_LEVEL=11 MY_PATCH_LEVEL= diff --git a/input/mutopia/F.Schubert/morgenlied.ly b/input/mutopia/F.Schubert/morgenlied.ly index e290e47090..640a709f89 100644 --- a/input/mutopia/F.Schubert/morgenlied.ly +++ b/input/mutopia/F.Schubert/morgenlied.ly @@ -26,14 +26,13 @@ } -\version "2.1.7" +\version "2.1.10" manuscriptBreak = { \break } + + + \paper { - staffheight = 6.0 \mm - - #(define fonts (scale-font-list (/ (* 6 mm) (* 20 pt)) )) - - \include "params-init.ly" + #(set-staff-size (* 6.0 1 )) linewidth = #(* mm 160) indent = 8\mm interscoreline = 2.\mm @@ -150,12 +149,12 @@ pianoLH = \notes \relative c'' \repeat volta 2 { \score { << \time 6/8 - \new Staff { + \new Staff << \context Staff \modernAccidentals - \melody } + \melody >> \new Lyrics << - \newaddlyrics "singer" \new LyricsVoice \firstVerse - \newaddlyrics "singer" \new LyricsVoice \secondVerse + \lyricsto "singer" \new LyricsVoice \firstVerse + \lyricsto "singer" \new LyricsVoice \secondVerse >> \new PianoStaff << \property PianoStaff.instrument = \markup { diff --git a/input/mutopia/F.Schubert/standchen.ly b/input/mutopia/F.Schubert/standchen.ly index 6d2b32b3fb..4532361861 100644 --- a/input/mutopia/F.Schubert/standchen.ly +++ b/input/mutopia/F.Schubert/standchen.ly @@ -42,7 +42,7 @@ instrument = "Piano" footer = "Mutopia-2001/04/27-xx" } -\version "2.1.7" +\version "2.1.10" dynamicUp = \property Voice.DynamicLineSpanner \override #'direction = #1 dynamicRevert = \property Voice.DynamicLineSpanner \revert #'direction @@ -382,7 +382,7 @@ global = \notes{ allLyrics = { % maybe should be bigger by default, in grob-description.scm ? - \newaddlyrics "leise" \new LyricsVoice { + \lyricsto "leise" \new LyricsVoice { \lyricVerseOne \lyricVerseTwo \lyricThrough diff --git a/input/regression/lyric-combine-new.ly b/input/regression/lyric-combine-new.ly index c1955edeff..fffacd9c7d 100644 --- a/input/regression/lyric-combine-new.ly +++ b/input/regression/lyric-combine-new.ly @@ -1,3 +1,4 @@ +\version "2.1.10" \header { texidoc = "With the newaddlyrics mechanism, individual lyric lines @@ -12,8 +13,8 @@ \autoBeamOff c2( d4) e8[ c b c] f4 } - \newaddlyrics "bla" \lyrics \new LyricsVoice { bla ab blob blob } - \newaddlyrics "bla" \lyrics \new LyricsVoice { + \lyricsto "bla" \lyrics \new LyricsVoice { bla ab blob blob } + \lyricsto "bla" \lyrics \new LyricsVoice { bla \property LyricsVoice . ignoreMelismata = ##t @@ -27,7 +28,7 @@ blob } - \new Lyrics << \newaddlyrics "bla" \lyrics \new LyricsVoice { nes ted lyrics voice with more words than no tes } >> + \new Lyrics << \lyricsto "bla" \lyrics \new LyricsVoice { nes ted lyrics voice with more words than no tes } >> >> } diff --git a/input/regression/lyric-combine-polyphonic.ly b/input/regression/lyric-combine-polyphonic.ly index e4d029bf7d..c495f9cc8a 100644 --- a/input/regression/lyric-combine-polyphonic.ly +++ b/input/regression/lyric-combine-polyphonic.ly @@ -1,8 +1,8 @@ -\version "2.1.7" +\version "2.1.10" \header { texidoc ="Polyphonic rhythms and rests don't disturb -@code{\newaddlyrics}." +@code{\lyricsto}." } @@ -21,10 +21,10 @@ texidoc ="Polyphonic rhythms and rests don't disturb \voiceTwo ees'8 r8 r8 r8 ees' r8 r8 r8 } - \newaddlyrics "two" \lyrics \new LyricsVoice { + \lyricsto "two" \lyrics \new LyricsVoice { Do na } - \lyrics \newaddlyrics "one" \new LyricsVoice + \lyrics \lyricsto "one" \new LyricsVoice { Do mi nus ex } diff --git a/input/regression/lyric-extender-broken.ly b/input/regression/lyric-extender-broken.ly index f4d769db57..392d5945fe 100644 --- a/input/regression/lyric-extender-broken.ly +++ b/input/regression/lyric-extender-broken.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.10" \header{ texidoc = @@ -19,7 +19,7 @@ Aaaaa __ aaaaaah << \context Voice = "foo" \sopran - \context LyricsVoice \newaddlyrics foo \text + \context LyricsVoice \lyricsto foo \text >> \paper { linewidth = 5.0\cm } diff --git a/input/regression/lyric-phrasing-new.ly b/input/regression/lyric-phrasing-new.ly index 83acf33dec..9863f2b25c 100644 --- a/input/regression/lyric-phrasing-new.ly +++ b/input/regression/lyric-phrasing-new.ly @@ -1,4 +1,4 @@ -\version "2.1.9" +\version "2.1.10" \header { texidoc = "Lyric phrasing: @@ -17,7 +17,7 @@ texidoc = "Lyric phrasing: d16[ e f g] } - \lyrics \newaddlyrics "bla" \context LyricsVoice { + \lyrics \lyricsto "bla" \context LyricsVoice { al tijd izzz } >> diff --git a/input/regression/lyric-phrasing.ly b/input/regression/lyric-phrasing.ly index 0cdeeab8b3..321f57b1a8 100644 --- a/input/regression/lyric-phrasing.ly +++ b/input/regression/lyric-phrasing.ly @@ -1,5 +1,5 @@ -\version "2.1.7" +\version "2.1.10" \header{ texidoc="Lyric phrasing @@ -30,11 +30,11 @@ a a a8 ( a) a4 } \context Lyrics << - \new LyricsVoice \newaddlyrics "v" \lyrics { + \new LyricsVoice \lyricsto "v" \lyrics { \property LyricsVoice . stanza = "1:" Start sentence melisma end. } - \new LyricsVoice \newaddlyrics "v" \lyrics { + \new LyricsVoice \lyricsto "v" \lyrics { \property LyricsVoice . stanza = "2:" x x x __ x. } diff --git a/input/regression/lyrics-melisma-beam.ly b/input/regression/lyrics-melisma-beam.ly index ac3665206d..5c0ecccb73 100644 --- a/input/regression/lyrics-melisma-beam.ly +++ b/input/regression/lyrics-melisma-beam.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.10" \header { texidoc = "Melismata are triggered by manual beams." @@ -12,7 +12,7 @@ \property Staff.autoBeaming = ##f c8 c8[ c8 c8] c8 } - \newaddlyrics "" \new LyricsVoice \lyrics { bla bla bla } + \lyricsto "" \new LyricsVoice \lyrics { bla bla bla } >> \paper { raggedright = ##t } } diff --git a/input/template/melody-lyrics-chords.ly b/input/template/melody-lyrics-chords.ly index d8f1ea7011..4da7f5c5d4 100644 --- a/input/template/melody-lyrics-chords.ly +++ b/input/template/melody-lyrics-chords.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.10" \header { texidoc = "Popsong format: chords, melody and lyrics." @@ -24,7 +24,7 @@ accompaniment = \chords { \autoBeamOff \melody } - \newaddlyrics "one" \new LyricsVoice \text + \lyricsto "one" \new LyricsVoice \text >> \paper { } \midi { } diff --git a/input/template/melody-lyrics.ly b/input/template/melody-lyrics.ly index 043ec88c61..12f5363e07 100644 --- a/input/template/melody-lyrics.ly +++ b/input/template/melody-lyrics.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.10" \header { texidoc = "Melody and lyrics." @@ -18,7 +18,7 @@ text = \lyrics { \property Staff.autoBeaming = ##f \melody } - \newaddlyrics "one" \new Lyrics \text + \lyricsto "one" \new Lyrics \text >> \paper { } \midi { } diff --git a/input/template/piano-lyrics.ly b/input/template/piano-lyrics.ly index b4e757ed8e..f84b9d4ad7 100644 --- a/input/template/piano-lyrics.ly +++ b/input/template/piano-lyrics.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.10" \header { texidoc ="Lyrics between two staffs." @@ -21,7 +21,7 @@ text = \lyrics { \context Staff = upper { \context Voice = singer \upper } - \newaddlyrics "singer" \new LyricsVoice \text + \lyricsto "singer" \new LyricsVoice \text \context Staff = lower << \clef bass \lower diff --git a/input/template/piano-melody-lyrics.ly b/input/template/piano-melody-lyrics.ly index d12b369614..bec4d77afd 100644 --- a/input/template/piano-melody-lyrics.ly +++ b/input/template/piano-melody-lyrics.ly @@ -27,7 +27,7 @@ lower = \notes\relative c { \autoBeamOff \melody } - \newaddlyrics mel \new LyricsVoice \text + \lyricsto mel \new LyricsVoice \text \context PianoStaff << \context Staff = upper \upper diff --git a/input/template/satb.ly b/input/template/satb.ly index beb970281c..10364e754e 100644 --- a/input/template/satb.ly +++ b/input/template/satb.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.10" \header { texidoc = " @@ -35,10 +35,10 @@ bassWords = \lyrics { ho4 ho ho ho } \context LyricsVoice = basses { s1 } - \context LyricsVoice = sopranos \newaddlyrics sopranos \sopWords - \context LyricsVoice = altos \newaddlyrics altos \altoWords - \context LyricsVoice = tenors \newaddlyrics tenors \tenorWords - \context LyricsVoice = basses \newaddlyrics basses \bassWords + \context LyricsVoice = sopranos \lyricsto sopranos \sopWords + \context LyricsVoice = altos \lyricsto altos \altoWords + \context LyricsVoice = tenors \lyricsto tenors \tenorWords + \context LyricsVoice = basses \lyricsto basses \bassWords >> \paper { diff --git a/input/test/divisiones.ly b/input/test/divisiones.ly index 1542d94130..3fe27a8b96 100644 --- a/input/test/divisiones.ly +++ b/input/test/divisiones.ly @@ -7,7 +7,7 @@ Choices are @code{divisioMinima}, @code{divisioMaior} @code{caesura}. " } -\version "2.1.7" +\version "2.1.10" \include "gregorian-init.ly" @@ -40,7 +40,7 @@ Choices are @code{divisioMinima}, @code{divisioMaior} \caesura g4( a) g e( f) e } - \newaddlyrics "" \new LyricsVoice \lyrics { + \lyricsto "" \new LyricsVoice \lyrics { Blah blub, blah blam. Blah blub, blah blam. Blah blub, blah blam. diff --git a/lily/extender-engraver.cc b/lily/extender-engraver.cc index 9279849bb2..407442c968 100644 --- a/lily/extender-engraver.cc +++ b/lily/extender-engraver.cc @@ -67,19 +67,42 @@ Extender_engraver::try_music (Music* r) return true; } +void +completize_extender (Spanner* sp) +{ + if (!sp->get_bound (RIGHT)) + { + SCM heads = sp->get_grob_property ("heads"); + if (gh_pair_p (heads)) + { + Item* it = dynamic_cast (unsmob_grob (gh_car (heads))); + if (it) + sp->set_bound (RIGHT, it); + } + } +} + + + void Extender_engraver::finalize () { if (extender_) { - extender_->warning (_ ("unterminated extender")); + completize_extender (extender_); + + if (!extender_->get_bound (RIGHT)) + extender_->warning (_ ("unterminated extender")); typeset_grob (extender_); extender_ = 0; } if (finished_extender_) { - finished_extender_->warning (_("unterminated extender")); + completize_extender (finished_extender_); + + if (!finished_extender_->get_bound (RIGHT)) + finished_extender_->warning (_("unterminated extender")); typeset_grob (finished_extender_); finished_extender_ =0; } diff --git a/lily/grob.cc b/lily/grob.cc index ffee9d7c3d..b11c5b6915 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -231,14 +231,13 @@ Grob::get_molecule () const if (!live()) { return 0; - } SCM mol = get_grob_property ("molecule"); if (unsmob_molecule (mol)) return unsmob_molecule (mol); - mol = get_uncached_molecule (); + mol = get_uncached_molecule (); if (live ()) { diff --git a/lily/ly-module.cc b/lily/ly-module.cc index 821e95ec85..ae8cedddf6 100644 --- a/lily/ly-module.cc +++ b/lily/ly-module.cc @@ -117,9 +117,10 @@ ly_module_lookup (SCM module, SCM sym) SCM_VALIDATE_MODULE (1, module); return scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F); +#undef FUNC_NAME } -SCM export_function ; +SCM export_function; void ly_export (SCM module, SCM namelist) diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc index dd07057161..ea96c452be 100644 --- a/lily/music-output-def.cc +++ b/lily/music-output-def.cc @@ -160,3 +160,33 @@ LY_DEFINE(ly_paper_lookup, else return SCM_EOL; } + +LY_DEFINE(ly_output_def_scope, + "ly:output-def-scope", + 1, 0,0, + (SCM def), + "Get the scope inside @var{def}." + ) +{ + Music_output_def *op = unsmob_music_output_def (def); + SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition"); + + return op->scope_; +} + + +LY_DEFINE(ly_output_def_clone, + "ly:output-def-clone", + 1, 0,0, + (SCM def), + "Clone @var{def}." + ) +{ + Music_output_def *op = unsmob_music_output_def (def); + SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition"); + + SCM s = op->clone ()->self_scm (); + scm_gc_unprotect_object (s); + return s; +} + diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index 61da4ba258..9608e94ea1 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -54,12 +54,12 @@ static Keyword_ent the_key_tab[]={ {"header", HEADER}, {"key", KEY}, {"lyrics", LYRICS}, + {"lyricsto", NEWADDLYRICS}, {"mark", MARK}, {"markup", MARKUP}, {"midi", MIDI}, {"name", NAME}, {"new", NEWCONTEXT}, - {"newaddlyrics", NEWADDLYRICS}, {"notes", NOTES}, {"octave", OCTAVE}, {"once", ONCE}, diff --git a/lily/new-lyric-combine-music-iterator.cc b/lily/new-lyric-combine-music-iterator.cc index 7e89576738..7fcc47401a 100644 --- a/lily/new-lyric-combine-music-iterator.cc +++ b/lily/new-lyric-combine-music-iterator.cc @@ -189,6 +189,8 @@ void New_lyric_combine_music_iterator::process (Moment ) { find_thread (); + if (!music_context_) + return ; if (!music_context_->daddy_trans_) { diff --git a/lily/parser.yy b/lily/parser.yy index 86a1dbf40b..fc807b3111 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -385,7 +385,7 @@ yylex (YYSTYPE *s, void * v) %type music_property_def context_change %type Music_list %type property_operation context_mod translator_mod optional_context_mod -%type music_output_def_body +%type music_output_def_body music_output_def_head %type shorthand_command_req %type post_event tagged_post_event %type command_req verbose_command_req @@ -670,8 +670,8 @@ output_def: } ; -music_output_def_body: - MIDI '{' { +music_output_def_head: + MIDI { Music_output_def *id = unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultmidi")); @@ -684,7 +684,7 @@ music_output_def_body: $$ = p; THIS->lexer_->add_scope (p->scope_); } - | PAPER '{' { + | PAPER { Music_output_def *id = unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultpaper")); Paper_def *p = 0; if (id) @@ -695,16 +695,17 @@ music_output_def_body: THIS->lexer_->add_scope (p->scope_); $$ = p; } - | PAPER '{' MUSIC_OUTPUT_DEF_IDENTIFIER { - Music_output_def * o = unsmob_music_output_def ($3); - $$ =o; + ; - THIS->lexer_->add_scope (o->scope_); + +music_output_def_body: + music_output_def_head '{' { + } - | MIDI '{' MUSIC_OUTPUT_DEF_IDENTIFIER { + | music_output_def_head '{' MUSIC_OUTPUT_DEF_IDENTIFIER { Music_output_def * o = unsmob_music_output_def ($3); $$ = o; - + THIS->lexer_->remove_scope (); THIS->lexer_->add_scope (o->scope_); } | music_output_def_body assignment { @@ -712,7 +713,6 @@ music_output_def_body: } | music_output_def_body translator_spec_block { $$->assign_translator ($2); - } | music_output_def_body tempo_event { /* diff --git a/lily/system.cc b/lily/system.cc index ff2f5a878e..29ce5de931 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -94,11 +94,14 @@ uniquify_list (SCM l) if (i && arr[i] == arr[i-1]) continue; - SCM_SETCAR(s, arr[i]); - s = SCM_CDR(s); + SCM_SETCAR(s, arr[i]); + + if (i < len - 1) + s = SCM_CDR(s); } SCM_SETCDR(s, SCM_EOL); + delete arr; return l; } @@ -175,16 +178,13 @@ System::output_lines () */ for (int i=0; i < broken_intos_.size (); i++) { - SCM al = broken_intos_[i]->get_grob_property ("all-elements"); - /* don't do this: strange side effects. */ + // SCM al = broken_intos_[i]->get_grob_property ("all-elements"); // al = uniquify_list (al); } - - if (verbose_global_b) progress_indication (_f ("Element count %d.", count + element_count ())); @@ -430,6 +430,11 @@ System::pre_processing () } } + + const int LAYER_COUNT= 3; + + + void System::post_processing (bool last_line) { @@ -458,11 +463,23 @@ System::post_processing (bool last_line) generate all molecules to trigger all font loads. (ugh. This is not very memory efficient.) */ + + SCM all = get_grob_property ("all-elements") ; + all = uniquify_list (all); + + /* + triger font loads first. + + This might seem inefficient, but Molecules are cached per grob + anyway. + */ this->get_molecule(); - for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s)) + for (SCM s = all; gh_pair_p (s); s = ly_cdr (s)) { - unsmob_grob (ly_car (s))->get_molecule (); + Grob * g = unsmob_grob (ly_car (s)); + g->get_molecule (); } + /* font defs; */ diff --git a/ly/declarations-init.ly b/ly/declarations-init.ly index 79ea3a6a44..48986498b9 100644 --- a/ly/declarations-init.ly +++ b/ly/declarations-init.ly @@ -43,19 +43,71 @@ melismaEnd = \property Staff.melismaBusy = ##f % Do units first; must be done before any units are specified. \paper { - unit = "mm" - mm = 1.0 - in = 25.4 - pt = #(/ in 72.27) - cm = #(* 10 mm) + unit = "mm" + mm = 1.0 + in = 25.4 + pt = #(/ in 72.27) + cm = #(* 10 mm) + + texsetting = "" + pssetting = "" + scmsetting = "(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\n"% UGH. + + + #(define font-defaults + '((font-family . music) + (font-shape . upright) + (baseline-skip . 2) + (word-space . 0.6) + (font-series . medium) + )) + + #(set-paper-size "a4") + \include "engraver-init.ly" } -papersize = "a4" -paperfile = \papersize + "-init.ly" -\include "generic-paper-init.ly" -\include "paper20-init.ly" +%{ + +; note: +; you can add fonts manually in the paper block by issuing + +#(set! fonts (append ...myfonts... fonts)) + +for the format of myfonts, see font.scm + +%} + + +paperEleven = \paper { + #(paper-set-staff-size (* 11.0 pt)) +} + +paperThirteen = \paper { + #(paper-set-staff-size (* 13.0 pt)) +} + +paperSixteen = \paper { + #(paper-set-staff-size (* 16.0 pt)) +} + +paperEightteen = \paper { + #(paper-set-staff-size (* 18.0 pt)) +} + +paperTwenty = \paper { + #(paper-set-staff-size (* 20.0 pt)) +} + +paperTwentythree = \paper { + #(paper-set-staff-size (* 23.0 pt)) +} + +paperTwentysix = \paper { + #(paper-set-staff-size (* 26.0 pt)) +} +\paper { \paperTwenty } \include "dynamic-scripts-init.ly" \include "spanners-init.ly" diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index c3802fb24f..19b561b567 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -499,7 +499,7 @@ AncientRemoveEmptyStaffContext = \translator { time-signature custos ) - barCheckSynchronize = ##t + barCheckSynchronize = ##f %% chord names: chordNameFunction = #ignatzek-chord-names diff --git a/ly/generic-paper-init.ly b/ly/generic-paper-init.ly index 73f9dd3445..8b13789179 100644 --- a/ly/generic-paper-init.ly +++ b/ly/generic-paper-init.ly @@ -1,8 +1 @@ -\version "1.9.8" -\paper { - texsetting = "" - pssetting = "" - scmsetting = "(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\n"% UGH. - -} diff --git a/ly/paper-as5-init.ly b/ly/paper-as5-init.ly deleted file mode 100644 index ded9cbdbb2..0000000000 --- a/ly/paper-as5-init.ly +++ /dev/null @@ -1,17 +0,0 @@ -% paper-as5-init.ly - -\version "1.9.8" - -paperAsFive = \paper { - staffheight = 5.\char - - #(define fonts (as-make-font-list 'as5)) - - \translator { \StaffContext barSize = #5 } - - % no beam-slope - %\translator { \VoiceContext beamHeight = #0 } - \include "params-as-init.ly" -} - -\paper { \paperAsFive } diff --git a/ly/paper-as5.ly b/ly/paper-as5.ly deleted file mode 100644 index 3138148a04..0000000000 --- a/ly/paper-as5.ly +++ /dev/null @@ -1,3 +0,0 @@ -\version "1.9.8" - -\include "paper-as5-init.ly" diff --git a/ly/paper-as9-init.ly b/ly/paper-as9-init.ly deleted file mode 100644 index cfa1c0ba6b..0000000000 --- a/ly/paper-as9-init.ly +++ /dev/null @@ -1,15 +0,0 @@ -% paper-as9-init.ly - -\version "1.9.8" - -paperAsNine = \paper { - staffheight = 9.\char - - %\translator { \StaffContext barSize = \staffheight } - - #(define fonts (as-make-font-list 'as9)) - - \include "params-as-init.ly" -} - -\paper { \paperAsNine } diff --git a/ly/paper-as9.ly b/ly/paper-as9.ly deleted file mode 100644 index 0792c201a5..0000000000 --- a/ly/paper-as9.ly +++ /dev/null @@ -1,3 +0,0 @@ -\version "1.9.8" - -\include "paper-as9-init.ly" diff --git a/ly/paper-init.ly b/ly/paper-init.ly deleted file mode 100644 index 473c1b4f4e..0000000000 --- a/ly/paper-init.ly +++ /dev/null @@ -1,16 +0,0 @@ -\version "1.9.8" -% paper-init.ly - -%% Why som complicated? /MB -%linewidth20 = \hsize - 2.5 * \staffheight -%textheight20 = \vsize - 5.0 * \staffheight -%linewidth = \staffheight/20.0 * \linewidth20 -%textheight = \staffheight/20.0 * \textheight20 - -linewidth = \hsize - 2.\cm -% Leave the textheight calculation to the geometry package. /MB -%textheight = \vsize - 4.\cm -raggedright = ##f -packed = ##f -indent = \linewidth / 14.0 - diff --git a/ly/paper11-init.ly b/ly/paper11-init.ly deleted file mode 100644 index 300ae89c50..0000000000 --- a/ly/paper11-init.ly +++ /dev/null @@ -1,12 +0,0 @@ -% paper11-init.ly - -\version "1.9.8" - -paperEleven = \paper { - staffheight = 11.0\pt - #(define fonts (scale-font-list (/ 11. 20.))) - - \include "params-init.ly" -} - -\paper { \paperEleven } diff --git a/ly/paper11.ly b/ly/paper11.ly deleted file mode 100644 index 3fc591e355..0000000000 --- a/ly/paper11.ly +++ /dev/null @@ -1,3 +0,0 @@ -\version "1.9.8" - -\include "paper11-init.ly" diff --git a/ly/paper13-init.ly b/ly/paper13-init.ly deleted file mode 100644 index 544161575f..0000000000 --- a/ly/paper13-init.ly +++ /dev/null @@ -1,13 +0,0 @@ -% paper13-init.ly - - -\version "1.9.8" - -paperThirteen = \paper { - staffheight = 13.0\pt - #(define fonts (scale-font-list (/ 13. 20.))) - - \include "params-init.ly" -} - -\paper { \paperThirteen } diff --git a/ly/paper13.ly b/ly/paper13.ly deleted file mode 100644 index 255a589b1c..0000000000 --- a/ly/paper13.ly +++ /dev/null @@ -1,3 +0,0 @@ -\version "1.9.8" - -\include "paper13-init.ly" diff --git a/ly/paper16-init.ly b/ly/paper16-init.ly deleted file mode 100644 index 054feec723..0000000000 --- a/ly/paper16-init.ly +++ /dev/null @@ -1,12 +0,0 @@ -% paper16-init.ly - - -\version "1.9.8" - -paperSixteen = \paper { - staffheight = 16.0\pt - #(define fonts (scale-font-list (/ 16. 20.))) - \include "params-init.ly" -} - -\paper { \paperSixteen } diff --git a/ly/paper16.ly b/ly/paper16.ly deleted file mode 100644 index 850da5666e..0000000000 --- a/ly/paper16.ly +++ /dev/null @@ -1,3 +0,0 @@ -\version "1.9.8" - -\include "paper16-init.ly" diff --git a/ly/paper19-init.ly b/ly/paper19-init.ly deleted file mode 100644 index 377a4bdbd5..0000000000 --- a/ly/paper19-init.ly +++ /dev/null @@ -1,14 +0,0 @@ -% paper19-init.ly - - -\version "1.9.8" - -paperNineteen = \paper { - staffheight = 18.0\pt - #(define fonts (scale-font-list (/ 18.0 20.0) )) - - \include "params-init.ly" -} - -\paper { \paperNineteen } - diff --git a/ly/paper19.ly b/ly/paper19.ly deleted file mode 100644 index a28ce0bdcf..0000000000 --- a/ly/paper19.ly +++ /dev/null @@ -1,3 +0,0 @@ -\version "1.9.8" - -\include "paper19-init.ly" diff --git a/ly/paper20-init.ly b/ly/paper20-init.ly deleted file mode 100644 index 616c2c404d..0000000000 --- a/ly/paper20-init.ly +++ /dev/null @@ -1,25 +0,0 @@ -% paper20-init.ly - - -\version "1.9.8" - -paperTwenty = \paper { - staffheight = 20.0\pt - #(define fonts (scale-font-list 1.0)) - - \include "params-init.ly" -} - -\paper { \paperTwenty } - - -%{ - -; note: -; you can add fonts manually in the paper block by issuing - -#(set! fonts (append ...myfonts... fonts)) - -for the format of myfonts, see font.scm - -%} diff --git a/ly/paper20.ly b/ly/paper20.ly deleted file mode 100644 index 5921dc9a3c..0000000000 --- a/ly/paper20.ly +++ /dev/null @@ -1,3 +0,0 @@ -\version "1.9.8" - -\include "paper20-init.ly" diff --git a/ly/paper23-init.ly b/ly/paper23-init.ly deleted file mode 100644 index e555314076..0000000000 --- a/ly/paper23-init.ly +++ /dev/null @@ -1,12 +0,0 @@ -% paper23-init.ly - - -\version "1.9.8" - -paperTwentythree = \paper { - staffheight = 23.0\pt - #(define fonts (scale-font-list (/ 23. 20.))) - \include "params-init.ly" -} - -\paper { \paperTwentythree } diff --git a/ly/paper23.ly b/ly/paper23.ly deleted file mode 100644 index 54b4f3dc29..0000000000 --- a/ly/paper23.ly +++ /dev/null @@ -1,3 +0,0 @@ -\version "1.9.8" - -\include "paper23-init.ly" diff --git a/ly/paper26-init.ly b/ly/paper26-init.ly deleted file mode 100644 index acf8499dcd..0000000000 --- a/ly/paper26-init.ly +++ /dev/null @@ -1,11 +0,0 @@ -% paper26-init.ly - -\version "1.9.8" - -paperTwentysix = \paper { - staffheight = 26.0\pt - #(define fonts (scale-font-list (/ 26. 20.))) - \include "params-init.ly" -} - -\paper { \paperTwentysix } diff --git a/ly/paper26.ly b/ly/paper26.ly deleted file mode 100644 index e713feefa9..0000000000 --- a/ly/paper26.ly +++ /dev/null @@ -1,3 +0,0 @@ -\version "1.9.8" - -\include "paper26-init.ly" diff --git a/ly/params-init.ly b/ly/params-init.ly index 3b87492108..d8dd41d556 100644 --- a/ly/params-init.ly +++ b/ly/params-init.ly @@ -1,49 +1,2 @@ \version "2.1.1" -% JUNKME. -%% deprecated -papersizename = \papersize - -% DO NOT change this without fixing -f ps output -papersize = \papersize - -% FIXME -% direct PostScript line height for single line staves -lineheight = 14 - -paperfile = \papersize + "-init.ly" - -% paperfile = "a4-init.ly" - -\include \paperfile -\include "paper-init.ly" - -staffspace = #(/ staffheight 4.0) -linethickness = 0.5 \pt -outputscale = #(/ staffheight 4.0) - -% don't do full 2x for ledger, otherwise no white is left. -ledgerlinethickness = #(+ linethickness (/ staffspace 10)) - -% 2/3 stafflinethickness in 20pt staffheight -% this parameter is independent of the output size. -blotdiameter = 0.35 \pt -interscoreline = 4. \mm - - - - -%% -%% TODO: baseline-skip, word-space should come from the font. -%% -#(define font-defaults - '((font-family . music) - (font-shape . upright) - (baseline-skip . 2) - (word-space . 0.6) - (font-series . medium) - )) - - - -\include "engraver-init.ly" diff --git a/mf/feta-bolletjes.mf b/mf/feta-bolletjes.mf index 6cdf6b9290..0822fbe9c9 100644 --- a/mf/feta-bolletjes.mf +++ b/mf/feta-bolletjes.mf @@ -179,12 +179,17 @@ fet_beginchar("Half notehead", "1", "halfhead") fet_endchar; fet_beginchar("Quart notehead", "2", "quarthead") - draw_outside_ellipse (1.54 - puff_up_factor / 2.0, 32, 0.707, 0); + draw_outside_ellipse (1.42 - puff_up_factor / 3.0, 32, 0.707, 0); black_notehead_width# := charwd; fet_endchar; %%%%%%%%%%%%%%%% +%% testing shapes. + +if 0 = 1 : + + fet_beginchar("Quart noteheadPQ", "2PQ", "quartheadPQ") draw_outside_ellipse (1.0 - puff_up_factor / 2.0, 32, 0.707, 0); fet_endchar; @@ -264,6 +269,8 @@ fet_beginchar("Quart noteheadCD", "2CG", "quartheadCD") draw_outside_ellipse (1.65 - puff_up_factor / 2.0, 40, 0.707, 0); fet_endchar; +fi + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/mf/parmesan19.mf b/mf/parmesan19.mf deleted file mode 100644 index 48e6549f7f..0000000000 --- a/mf/parmesan19.mf +++ /dev/null @@ -1,16 +0,0 @@ -% parmesan19.mf -% part of LilyPond's pretty-but-neat music font - -staffsize#:=19pt#; - -input feta-autometric; -fet_beginfont("parmesan", 19); - -test := 0; - -input parmesan-generic; - -fet_endfont("parmesan"); - -end. - diff --git a/scm/lily.scm b/scm/lily.scm index add6bfee8b..8f1529a9bc 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -378,6 +378,8 @@ L1 is copied, L2 not. "define-grob-properties.scm" "define-grobs.scm" "define-grob-interfaces.scm" + + "paper.scm" )) diff --git a/scm/output-lib.scm b/scm/output-lib.scm index 00d632a070..bbe6742cb4 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -248,3 +248,4 @@ centered, X==1 is at the right, X == -1 is at the left." (index-cell (cdr result) dir)) ) ) + diff --git a/scm/output-tex.scm b/scm/output-tex.scm index fb1fe1bb5c..87017e644e 100644 --- a/scm/output-tex.scm +++ b/scm/output-tex.scm @@ -281,7 +281,6 @@ (define (no-origin) "") (define-public (tex-output-expression expr port) - (display (eval expr this-module) port ) - ) + (display (eval expr this-module) port )) diff --git a/scm/paper.scm b/scm/paper.scm new file mode 100644 index 0000000000..b42e988c68 --- /dev/null +++ b/scm/paper.scm @@ -0,0 +1,70 @@ +; paper.scm - manipulate the paper block. +; +; (C) 2004 Han-Wen Nienhuys + +; the functions are fairly basic here. + + + +(define-public (paper-set-staff-size sz) + "Function to be called inside a \\paper{} block to set the staff size." + (let* + ((m (current-module)) + (ss (/ sz 4)) + (pt (eval 'pt m)) + (mm (eval 'mm m)) ) + + (module-define! m 'fonts (scale-font-list (/ sz (* 20 pt)))) + (module-define! m 'staffheight sz) + (module-define! m 'staff-space ss) + (module-define! m 'linethickness (* 0.5 pt)) + (module-define! m 'outputscale ss) + (module-define! m 'ledgerlinethickness (+ (* 0.5 pt) (/ ss 10))) + (module-define! m 'blotdiameter (* 0.35 pt)) + (module-define! m 'interscoreline (* 4 mm)) + )) + +(define-public (set-staff-size sz) + "Set the default staff size, where SZ is thought to be in PT." + (let* + ((old-mod (current-module)) + (pap (eval '$defaultpaper old-mod)) + (new-paper (ly:output-def-clone pap)) + (new-scope (ly:output-def-scope new-paper)) + ) + (set-current-module new-scope) + (paper-set-staff-size (* sz (eval 'pt new-scope))) + (set-current-module old-mod) + (module-define! old-mod '$defaultpaper new-paper) + )) + + +(define paper-alist + '(("a4" . (cons (* 210 mm) (* 297.9 mm))) + ("a3" . (cons (* 297.9 mm) (* 420 mm))) + ("legal" . (cons (* 8.5 in) (* 14.0 in))) + ("letter" . (cons (* 8.5 in) (* 11.0 in))) + ("tabloid" . (cons (* 11.0 in) (* 17.0 in)))) ) + +;; todo: take dimension arguments. + +(define-public (set-paper-size name) + (let* + ((entry (assoc name paper-alist)) + (m (current-module)) + (mm (eval 'mm m)) + ) + + (if (pair? entry) + (begin + (set! entry (eval (cdr entry) m)) + (module-define! m 'papersize name) + (module-define! m 'papersizename name) + (module-define! m 'hsize (car entry)) + (module-define! m 'vsize (cdr entry)) + (module-define! m 'linewidth (- (car entry) (* 20 mm))) + (module-define! m 'raggedright #f) + (module-define! m 'packed #f) + (module-define! m 'indent (/ (car entry) 4)) ) + (ly:warning (string-append "Unknown papersize: " name)) + ))) diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 91fd16942c..9b2f22f0e6 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -1652,6 +1652,19 @@ def conv (str): conversions.append (((2,1,7), conv, """\\translator Staff -> \\change Staff""")) +def conv (str): + str =re.sub (r"\\newaddlyrics", r"\\lyricsto", str) + return str + +conversions.append (((2,1,10), conv, """\\newaddlyrics -> \\lyricsto""")) + +def conv (str): + str = re.sub (r'\\include\s*"paper([0-9]+)(-init)?.ly"', + r"#(set-staff-size \1)", str) + return str + +conversions.append (((2,1,11), conv, """\\include "paper16.ly" -> #(set-staff-size 16) """)) + ################################ # END OF CONVERSIONS -- 2.39.2