]> git.donarmstrong.com Git - lilypond.git/commitdiff
(marked-up-headfoot): change tagline
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 7 Oct 2005 09:12:03 +0000 (09:12 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 7 Oct 2005 09:12:03 +0000 (09:12 +0000)
handling. tagline = ##f will blank the tagline as well.

ChangeLog
Documentation/topdocs/NEWS.tely
THANKS
input/regression/figured-bass-continuation.ly [new file with mode: 0644]
lily/lilypond-version.cc
lily/lyric-hyphen.cc
lily/new-figured-bass-engraver.cc
scm/define-context-properties.scm
scm/define-music-properties.scm
scm/titling.scm

index e8a659cbed391bf5ddd8b9729dd39e804f23ae54..9e278a1f27d85e8bdfb3ea601dd04b73909c692b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
+2005-10-07  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * scm/titling.scm (marked-up-headfoot): change tagline
+       handling. tagline = ##f will blank the tagline as well.
+
 2005-10-06  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * Documentation/topdocs/NEWS.tely: add entry for Figured bass.
+
+       * lily/new-figured-bass-engraver.cc (struct
+       New_figured_bass_engraver): add new_music_found_ member.
+
+       * lily/lilypond-version.cc (Lilypond_version): deal with
+       incorrectly formatted version strings. 
+
        * ly/engraver-init.ly (AncientRemoveEmptyStaffContext): switch on
        New_figured_bass_engraver by default.
 
index b91fed2ee0b48e3477a79f392bdccf1d992f2b2b..4d228c6d2138be416f61f02e72d5f7be3b3b38ad 100644 (file)
@@ -45,6 +45,20 @@ This document is also available in @uref{NEWS.pdf,PDF}.
 
 
 @itemize @bullet
+@item
+Support for figured bass has been rewritten. Now it supports continuation lines.
+
+@lilypond[raggedright,fragment]
+<<
+\relative { c4 c c c }
+\figures {
+  \set useBassFigureExtenders = ##t
+  <6+ 4 3> <6 4 3> <4 3+> 
+} >>
+@end lilypond
+
+This feature was sponsored by Trent Johnston.
+
 @item  
 Vertical alignments of staves can now be tuned easily for individual
 systems.
diff --git a/THANKS b/THANKS
index 763153aebe6f512a47c58d3d7b5cd3009b1a6749..9485bf54a53743e4de7eb8667db9143ba0361238 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -29,8 +29,10 @@ D. Josiah Boothby
 Kieren MacMillan
 Kris Shaffer
 Nancho Alvarez
+Nicolas Sceaux
 Steve Doonan
 Sven Axelsson
+Trent Johnston
 Trevor Bača
 Yoshinobu Ishizaki   
 Vicente Solsona Dellá
diff --git a/input/regression/figured-bass-continuation.ly b/input/regression/figured-bass-continuation.ly
new file mode 100644 (file)
index 0000000..ea4fa27
--- /dev/null
@@ -0,0 +1,24 @@
+\header {
+
+  texidoc = "Figured bass extender lines run between repeated bass
+figures. They are switched on with @code{useBassFigureExtenders}"
+
+}
+
+\version "2.7.12"
+\paper {
+  raggedright = ##t
+}
+
+<<
+  \relative \new Voice {
+    c8 c  b b  a a  b b  
+    c^"the same with extenders" c  b b  a a  b b  
+  
+  }
+ \figures {
+    <6+ 4 3>4 <6 4 3> <4 3+> r4
+    \set useBassFigureExtenders = ##t
+    <6+ 4 3> <6 4 3> <4 3+> r4
+  } 
+>>
index 80db99522595fec08e13bef902572dd7f2e30ef3..6479f0a91cfd70ce4d2cbcf83e2c75c91963871d 100644 (file)
@@ -6,6 +6,8 @@
   (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
+#include <ctype.h>
+
 #include "lilypond-input-version.hh"
 #include "string-convert.hh"
 #include "array.hh"
@@ -19,13 +21,21 @@ Lilypond_version::Lilypond_version (int major, int minor, int patch)
 
 Lilypond_version::Lilypond_version (String str)
 {
+  major_ = 0; 
+  minor_ = 0;
+  patch_ = 0;
+  
   Array<String> version;
   version = String_convert::split (str, '.');
 
-  major_ = version[0].to_int ();
-  minor_ = version[1].to_int ();
+  if (version.size () > 0 && isdigit (version[0][0]))
+    major_ = version[0].to_int ();
+  if (version.size () > 1 && isdigit (version[1][0]))
+    minor_ = version[1].to_int ();
+  
   patch_ = 0;
-  if (version.size () >= 3)
+  if (version.size () >= 3
+      && isdigit (version[2][0]))
     patch_ = version[2].to_int ();
 
   if (version.size () >= 4)
index 4bafc7e508c82353fabc5bd2663f220c4cb9698b..8e78407d88f84e148d624c98fd830f0d0e5846b6 100644 (file)
@@ -23,7 +23,8 @@ Hyphen_spanner::print (SCM smob)
                             me->get_bound (RIGHT));
 
   if (bounds[LEFT]->break_status_dir ()
-      && Paper_column::when_mom (bounds[LEFT]) == Paper_column::when_mom (bounds[RIGHT]->get_column ()))
+      && (Paper_column::when_mom (bounds[LEFT])
+         == Paper_column::when_mom (bounds[RIGHT]->get_column ())))
     return SCM_EOL;
 
   Grob *common = bounds[LEFT]->common_refpoint (bounds[RIGHT], X_AXIS);
index f3186193ecdef39cc3c03ab0954f705e5b92afee..868782811775af826c9ad061e336a3211bb1a87c 100644 (file)
@@ -28,19 +28,26 @@ struct Figure_group
   SCM number_;
   SCM alteration_;
   
-  bool is_continuation_;
   Item *figure_item_; 
   Music *current_music_;
   
   Figure_group ()
   {
-    is_continuation_ = false;
     continuation_line_ = 0;
     number_ = SCM_EOL;
     alteration_ = SCM_EOL;
     group_ = 0;
     current_music_ = 0;
   }
+  bool is_continuation () const
+  {
+    return
+      current_music_
+      && ly_is_equal (number_,
+                     current_music_->get_property ("figure"))
+      && ly_is_equal (alteration_,
+                     current_music_->get_property ("alteration"));
+  }
 };
 
 struct New_figured_bass_engraver : public Engraver
@@ -48,11 +55,14 @@ struct New_figured_bass_engraver : public Engraver
   TRANSLATOR_DECLARATIONS(New_figured_bass_engraver);
   void clear_spanners();
   void add_brackets ();
+  void create_grobs ();
 protected:
   Array<Figure_group> groups_;
   Spanner *alignment_;
   Link_array<Music> new_musics_;
   bool continuation_;
+  bool new_music_found_;
+  
   Moment stop_moment_;
   Music *rest_event_; 
   
@@ -94,6 +104,7 @@ New_figured_bass_engraver::New_figured_bass_engraver ()
   alignment_ = 0;
   continuation_ = false;
   rest_event_ = 0;
+  new_music_found_ = false;
 }
 
 void
@@ -107,7 +118,6 @@ New_figured_bass_engraver::start_translation_timestep ()
   for (int i = 0; i < groups_.size (); i++)
     {
       groups_[i].current_music_ = 0;
-      groups_[i].is_continuation_ = false;
     }
   continuation_ = false;
 }
@@ -115,35 +125,33 @@ New_figured_bass_engraver::start_translation_timestep ()
 bool
 New_figured_bass_engraver::try_music (Music *m)
 {
- if (m->is_mus_type ("rest-event"))
+  new_music_found_ = true;
+  if (m->is_mus_type ("rest-event"))
     {
       rest_event_ = m;
       return true;
     }
- else
-   {
-     SCM fig = m->get_property ("figure");
-     for (int i = 0; i < groups_.size (); i++)
-       {
-        if (!groups_[i].current_music_
-            && ly_is_equal (groups_[i].number_, fig))
-          {
-            groups_[i].current_music_ = m;
-            groups_[i].is_continuation_ =
-              ly_is_equal (groups_[i].alteration_,
-                           m->get_property ("alteration"));
+  else
+    {
+      stop_moment_ = now_mom () + m->get_length ();
+     
+      SCM fig = m->get_property ("figure");
+      for (int i = 0; i < groups_.size (); i++)
+       {
+         if (!groups_[i].current_music_
+             && ly_is_equal (groups_[i].number_, fig))
+           {
+             groups_[i].current_music_ = m;
             
-            continuation_ = true;
-            return true; 
-          }
-       }
+             continuation_ = true;
+             return true; 
+           }
+       }
 
-     new_musics_.push (m);
+      new_musics_.push (m);
 
-     stop_moment_ = now_mom () + m->get_length ();
-     
-     return true;
-   }
+      return true;
+    }
 }
 
 void
@@ -205,15 +213,31 @@ New_figured_bass_engraver::process_music ()
       clear_spanners ();
       return;
     }
+
+  if (!new_music_found_)
+    return ;
+  new_music_found_ = false;
+
+  /*
+    Don't need to sync alignments, if we're not using extenders. 
+   */
+  bool use_extenders = to_boolean (get_property ("useBassFigureExtenders"));
+  if (!use_extenders)
+    {
+      alignment_ = 0;
+      for (int i = 0; i < groups_.size (); i++)
+       {
+         groups_[i].group_ = 0;
+         groups_[i].continuation_line_ = 0;
+       }
+    }
   
-  Grob *muscol = dynamic_cast<Item*> (unsmob_grob (get_property ("currentMusicalColumn")));
   if (!continuation_)
     {
       clear_spanners ();
-      alignment_ = make_spanner ("BassFigureAlignment", SCM_EOL);
-      alignment_->set_bound (LEFT, muscol);
     }
 
+  
   int k = 0;
   for (int i = 0; i < new_musics_.size (); i++)
     {
@@ -234,20 +258,18 @@ New_figured_bass_engraver::process_music ()
 
   for (int i = 0; i < groups_.size (); i++)
     {
-      if (!groups_[i].is_continuation_)
+      if (!groups_[i].is_continuation ())
        {
          groups_[i].number_ = SCM_BOOL_F;
          groups_[i].alteration_ = SCM_BOOL_F;
        }
     }
 
-  SCM proc = get_property ("newFiguredBassFormatter");
-  alignment_->set_bound (RIGHT, muscol);
-
-  if (to_boolean (get_property ("useBassFigureExtenders")))
+  if (use_extenders)
+    
     for (int i = 0; i < groups_.size(); i++)
       {
-       if (groups_[i].is_continuation_)
+       if (groups_[i].is_continuation ())
          {
            if (!groups_[i].continuation_line_)
              {
@@ -269,16 +291,27 @@ New_figured_bass_engraver::process_music ()
        else
          groups_[i].continuation_line_ = 0;
       }
-  
+  create_grobs ();
+  add_brackets ();
+}
+
+void
+New_figured_bass_engraver::create_grobs () 
+{
+  Grob *muscol = dynamic_cast<Item*> (unsmob_grob (get_property ("currentMusicalColumn")));
+  if (!alignment_)
+    {
+      alignment_ = make_spanner ("BassFigureAlignment", SCM_EOL);
+      alignment_->set_bound (LEFT, muscol);
+    }
+  alignment_->set_bound (RIGHT, muscol);
+
+  SCM proc = get_property ("newFiguredBassFormatter");
   for (int i = 0; i < groups_.size(); i++)
     {
       Figure_group &group = groups_[i];
       
-      if (group.continuation_line_)
-       {
-         group.continuation_line_->set_bound (RIGHT, muscol);
-       }
-      else if (group.current_music_)
+      if (group.current_music_)
        {
          Item *item
            = make_item ("NewBassFigure",
@@ -312,13 +345,22 @@ New_figured_bass_engraver::process_music ()
          group.figure_item_ = item;
        }
 
-      groups_[i].group_->set_bound (RIGHT, muscol);
+      if (group.continuation_line_)
+       {
+         /*
+           UGH should connect to the bass staff, and get the note heads. 
+         */
+         group.figure_item_->set_property ("transparent", SCM_BOOL_T);
+         group.continuation_line_->set_bound (RIGHT, group.figure_item_);
+       }
+
+      
+      if (groups_[i].group_)
+       groups_[i].group_->set_bound (RIGHT, muscol);
     }
 
-  add_brackets ();
 }
 
-
 ADD_TRANSLATOR (New_figured_bass_engraver,
                /* doc */
 
index 2eaceda23c7cc634d35ae9bd0e3bed084b475668..c7da88a6495cd3da8a680af99be36cf2deb13724 100644 (file)
@@ -26,6 +26,7 @@
      ;; TODO FIXME
      (useBassFigureExtenders ,boolean? "")
      (figuredBassAlterationDirection ,ly:dir? "")
+     (newFiguredBassFormatter ,procedure? "")
      
      (aDueText ,string? "Text to print at a unisono passage.")
      (alignBelowContext ,string? "Where to insert newly created context in vertiical alignment.")
index a0b45d249156c6a0d1485555bca074de535cbf25..8bc0e995abe3e3026403bb87d48e24cf7fe5b9dc 100644 (file)
@@ -106,8 +106,7 @@ translation property")
                          "Change to what kind of state? Options are
 solo1, solo2 and unisono")
 
-     (figure ,markup? "a `figure' (which may be
-a string) for figured bass")
+     (figure ,integer? "a bass figure")
      (alteration ,number? "alteration for figured bass")
      (bracket-start ,boolean? "start a bracket
 here. TODO: use SpanEvents?")
index 428c07d5cdeb0e15688f17086ba3035c72c7187b..ab429c85f9739d362eed303e54dc1ec84888a7b5 100644 (file)
@@ -36,16 +36,11 @@ page:last?, page:page-number-string and page:page-number
                               (cdr entry)))
                            alist))
                     alists))
-              (tagline (ly:modules-lookup scopes 'tagline)) 
-              (default-tagline (ly:output-def-lookup layout 'tagline)) 
-
               (pgnum-alist
                (list
                 (cons 'header:tagline
-                      (cond
-                       ((markup? tagline) tagline)
-                       ((markup? default-tagline) default-tagline)
-                       (else "")))
+                      (ly:modules-lookup scopes 'tagline
+                                         (ly:output-def-lookup layout 'tagline)))
                 (cons 'page:last? last?)
                 (cons 'page:page-number-string
                       (number->string page-number))
@@ -54,7 +49,7 @@ page:last?, page:page-number-string and page:page-number
                       (list pgnum-alist)
                       prefixed-alists
                       (layout-extract-page-properties layout))))
-
+         (display prefixed-alists)
          (interpret-markup layout props potential-markup))
 
        empty-stencil))