From ea1cd9ac0821fabc809e48f2b9390f26e6e90829 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 5 Mar 2003 20:07:31 +0000 Subject: [PATCH] * input/test/time-signature-double.ly: new file * input/regression/collision-head-chords.ly (texidoc): new file. * lily/type-swallow-translator.cc: add note swallow translator * input/test/time-signature-double.ly: new file. * lily/type-swallow-translator.cc: add Rest_swallow_translator * ly/engraver-init.ly (ChordNamesContext): add Rest_swallow_translator (FiguredBassContext): idem. --- ChangeLog | 13 ++++++ Documentation/user/lilypond.tely | 2 +- Documentation/user/refman.itely | 19 ++++++++ Documentation/user/tutorial.itely | 2 + input/regression/collision-2.ly | 12 ++--- input/regression/collision-head-chords.ly | 18 ++++++++ input/test/time-signature-double.ly | 55 +++++++++++++++++++++++ lily/type-swallow-translator.cc | 42 +++++++++++++++++ ly/engraver-init.ly | 5 ++- scm/bass-figure.scm | 2 +- 10 files changed, 162 insertions(+), 8 deletions(-) create mode 100644 input/regression/collision-head-chords.ly create mode 100644 input/test/time-signature-double.ly diff --git a/ChangeLog b/ChangeLog index f5c4468c3c..cfe95d134e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2003-03-05 Han-Wen Nienhuys + * input/test/time-signature-double.ly: new file + + * input/regression/collision-head-chords.ly (texidoc): new file. + + * lily/type-swallow-translator.cc: add note swallow translator + + * input/test/time-signature-double.ly: new file. + + * lily/type-swallow-translator.cc: add Rest_swallow_translator + + * ly/engraver-init.ly (ChordNamesContext): add Rest_swallow_translator + (FiguredBassContext): idem. + * VERSION (MY_PATCH_LEVEL): 1.7.14 released * input/mutopia/W.A.Mozart/*.ly (romanze): markup syntax updates. diff --git a/Documentation/user/lilypond.tely b/Documentation/user/lilypond.tely index 640204fcf9..b0b8ab3e91 100644 --- a/Documentation/user/lilypond.tely +++ b/Documentation/user/lilypond.tely @@ -76,7 +76,7 @@ Copyright 1999-2002 by the authors @chapter GNU LilyPond --- The music typesetter -This is the user manual for GNU LilyPond 1.6.0. +This is the user manual for GNU LilyPond 1.7.14. @cindex web site diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 6fa0bd454b..4c30a5982c 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -3071,6 +3071,9 @@ For entering quotes in Lyrics mode, use the following "\"God\"" is "`King'" @end example +You can use empty syllables, e.g. @code{_4} or @code{" "4} to enter +lyrics. This can confuse the LilyPond -- for example, this might put +(empty) lyrics under rests. To remedy this, use @code{\skip}. @menu @@ -3446,6 +3449,12 @@ add the note, then you can use @code{/+}@var{pitch}. \chords { c1 c/+g c/+f } @end lilypond +The chords mode is a mode similar to @code{\lyrics}, @code{\notes} +etc. Most of the commands continue to work, for example, @code{r} and +@code{\skip} can be used to insert spaces, and @code{\property} to +change various settings. + + @refbugs @@ -5286,6 +5295,16 @@ and once with exaggerated corrections. \paper { linewidth = -1. } } @end lilypond +@cindex SpacingSpanner, overriding properties + +The @internalsref{SpacingSpanner}, is score wide, so its properties +must be overriden from the @code{\paper} block, e.g. +@example +\paper @{ \translator @{ + \ScoreContext + SpacingSpanner \override #'spacing-increment = #3.0 +@} @} +@end example @refbugs diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index 24048a99bb..047f71dc60 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -1091,6 +1091,8 @@ The complete file is listed here: @node A melody with chords @section A melody with chords +[TODO: show how to do fixed 4 measures to the line] + In this section we show how to typeset a melody with chord accompaniment. This file is included as @file{input/tutorial/flowing.ly}. diff --git a/input/regression/collision-2.ly b/input/regression/collision-2.ly index 9a43378500..722f00b1b6 100644 --- a/input/regression/collision-2.ly +++ b/input/regression/collision-2.ly @@ -1,13 +1,15 @@ \version "1.7.6" +\header { +texidoc = "Collisions for single head notes. " +} \score { \notes - \context Staff \notes < - %% the f and g on 4th beat are exceptionally ugh. - \context Voice=i { \stemUp c4 d e f g2 g4 a | } - \context Voice=ii { \stemDown g4 f e g g2 g2 } + \context Staff \notes \transpose c c' < + { c4 d e f g2 g4 a | } \\ + { g4 f e g g2 g2 } > } -%% new-chords-done %% \ No newline at end of file +%% new-chords-done %% diff --git a/input/regression/collision-head-chords.ly b/input/regression/collision-head-chords.ly new file mode 100644 index 0000000000..e226524580 --- /dev/null +++ b/input/regression/collision-head-chords.ly @@ -0,0 +1,18 @@ +\version "1.7.14" +\header { +texidoc = "Note heads in collisions should be merged if +they have the same positions in the extreme note heads. +" + +} + + +\score { +\notes \relative c'' { +c4 + < { c4 d4 <>8 <> <> } \\ { c4 c <>8 <> <>8 } > +} +\paper {linewidth = -1.0 } +} + +%% new-chords-done %% diff --git a/input/test/time-signature-double.ly b/input/test/time-signature-double.ly new file mode 100644 index 0000000000..7d2cae58bc --- /dev/null +++ b/input/test/time-signature-double.ly @@ -0,0 +1,55 @@ + +\header { + + +texidoc= "Double time signatures are not supported +explicitly, but can be faked by overriding formatting routines. " + +} +\version "1.7.14" + + +#(define (brew-double-time-sig grob) + (define (frac-to-mol font frac) + (let* + ( + (d (fontify-text font (number->string (cdr frac)))) + (n (fontify-text font (number->string (car frac)))) + (c (ly:molecule-combine-at-edge d Y UP n 0.0)) + ) + (ly:molecule-align-to! c Y CENTER) + c + )) + + (let* + + ( + (chain (Font_interface::get_property_alist_chain grob)) + (font (ly:get-font grob chain)) + (f1 '(6 . 4)) + (musfont (ly:get-font grob (cons (list '(font-relative-size . 2) '(font-family . music)) chain))) + (plus (ly:molecule-translate-axis (ly:find-glyph-by-name musfont "scripts-stopped") 0.1 Y)) + (f2 '(3 . 2)) + (m1 (frac-to-mol font f1)) + (m2 (frac-to-mol font f2)) + ) + + + (ly:molecule-combine-at-edge + (ly:molecule-combine-at-edge m1 X RIGHT plus 0.2) + X RIGHT m2 0.2) + + ) +) + + +\score { \notes \relative c' + { + \property Staff.TimeSignature \override #'molecule-callback = #brew-double-time-sig + \time 3/2 + c2 c c + + } + + } + diff --git a/lily/type-swallow-translator.cc b/lily/type-swallow-translator.cc index 4258174622..54593f5457 100644 --- a/lily/type-swallow-translator.cc +++ b/lily/type-swallow-translator.cc @@ -19,6 +19,16 @@ public: }; +class Rest_swallow_translator : public virtual Translator +{ +protected: + virtual bool try_music (Music*) { return true; } + +public: + TRANSLATOR_DECLARATIONS(Rest_swallow_translator); +}; + + Skip_req_swallow_translator::Skip_req_swallow_translator(){} ENTER_DESCRIPTION(Skip_req_swallow_translator, @@ -28,4 +38,36 @@ ENTER_DESCRIPTION(Skip_req_swallow_translator, "", "", ""); + + +Rest_swallow_translator::Rest_swallow_translator(){} + +ENTER_DESCRIPTION(Rest_swallow_translator, + "Swallow rest", + "", + "rest-event", + "", + "", + + + ""); + +class Note_swallow_translator : public virtual Translator +{ +protected: + virtual bool try_music (Music*) { return true; } + +public: + TRANSLATOR_DECLARATIONS(Note_swallow_translator); +}; + +Note_swallow_translator::Note_swallow_translator(){} + +ENTER_DESCRIPTION(Note_swallow_translator, + "Swallow notes", + "", + "note-event", + "", + "", + ""); diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 00d06183d3..23e0b06a61 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -300,6 +300,7 @@ ChordNamesContext = \translator { \type "Engraver_group_engraver" \name ChordNames + \consists "Rest_swallow_translator" \consists "Output_property_engraver" \consists "Separating_line_group_engraver" \consists "New_chord_name_engraver" @@ -479,7 +480,9 @@ GraceContext = \translator { FiguredBassContext = \translator { \type "Engraver_group_engraver" \name FiguredBass - \consists "Figured_bass_engraver" + \consists "Figured_bass_engraver" + \consists "Rest_swallow_translator" + \consists "Note_swallow_translator" \consistsend "Axis_group_engraver" } diff --git a/scm/bass-figure.scm b/scm/bass-figure.scm index 90b293f5d0..2753dc5e11 100644 --- a/scm/bass-figure.scm +++ b/scm/bass-figure.scm @@ -6,7 +6,7 @@ "Brew a single column for a music figure" (let* ( (chain (Font_interface::get_property_alist_chain grob)) - (mf (ly:get-font grob (cons '((font-family . music)) + (mf (ly:get-font grob (cons '((font-family . music) (font-magnification . 0.8)) chain ))) (nf (ly:get-font grob -- 2.39.2