]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/melisma-engraver.cc (try_music): use melisma_busy()
authorhanwen <hanwen>
Wed, 31 Dec 2003 00:44:33 +0000 (00:44 +0000)
committerhanwen <hanwen>
Wed, 31 Dec 2003 00:44:33 +0000 (00:44 +0000)
* lily/lyric-engraver.cc (process_music): remove alignment kludge

* lily/lyric-combine-music-iterator.cc (melisma_busy): new function.

* lily/stanza-number-engraver.cc (acknowledge_grob): rewrite

* scm/define-grobs.scm (all-grob-descriptions): change
StanzaNumber description: make side support, i.s.o. breakable.
use Instrument_name_engraver for texts in the margin.

* scm/define-translator-properties.scm: remove
melismaEngraverBusy, stz property.

* lily/self-aligment-interface.cc (aligned_on_parent): new function.

* input/regression/lyric-phrasing-new.ly: new file.

* lily/new-phrasing-engraver.cc (process_acknowledged_grobs): new
engraver, redo lyric phrasing, but cleaner and simpler.  Lyrics on
melismata are now left-aligned.

78 files changed:
ChangeLog
Documentation/user/refman.itely
VERSION
flower/file-path.cc
flower/include/interval.hh
flower/include/interval.tcc
flower/include/string.hh
flower/string.cc
input/mutopia/F.Schubert/morgenlied.ly
input/regression/lyric-phrasing-new.ly [new file with mode: 0644]
input/regression/stanza-number.ly
lily/accidental-engraver.cc
lily/accidental-placement.cc
lily/accidental.cc
lily/align-interface.cc
lily/all-font-metrics.cc
lily/ambitus.cc
lily/arpeggio.cc
lily/auto-change-iterator.cc
lily/axis-group-interface.cc
lily/beam-engraver.cc
lily/beam.cc
lily/break-algorithm.cc
lily/break-align-interface.cc
lily/break-substitution.cc
lily/change-iterator.cc
lily/clef.cc
lily/custos.cc
lily/font-metric.cc
lily/gregorian-ligature.cc
lily/hairpin.cc
lily/hyphen-spanner.cc
lily/include/molecule.hh
lily/include/self-alignment-interface.hh
lily/include/translator-group.hh
lily/include/translator.hh
lily/input-file-results.cc
lily/key-signature-interface.cc
lily/lyric-combine-music-iterator.cc
lily/lyric-engraver.cc
lily/lyric-phrasing-engraver.cc
lily/main.cc
lily/measure-grouping-spanner.cc
lily/melisma-engraver.cc
lily/molecule.cc
lily/new-accidental-engraver.cc
lily/new-fingering-engraver.cc
lily/new-phrasing-engraver.cc [new file with mode: 0644]
lily/note-head-line-engraver.cc
lily/note-head.cc
lily/note-spacing.cc
lily/part-combine-music-iterator.cc
lily/rest-collision.cc
lily/rest.cc
lily/self-aligment-interface.cc
lily/separating-group-spanner.cc
lily/separation-item.cc
lily/side-position-interface.cc
lily/skyline.cc
lily/slur.cc
lily/span-bar.cc
lily/staff-spacing.cc
lily/stanza-number-engraver.cc
lily/stem.cc
lily/streams.cc
lily/sustain-pedal.cc
lily/system-start-delimiter.cc
lily/system.cc
lily/text-spanner.cc
lily/time-signature.cc
lily/translator-group.cc
lily/translator-scheme.cc
lily/translator.cc
lily/virtual-font-metric.cc
ly/engraver-init.ly
scm/define-grobs.scm
scm/define-translator-properties.scm
scripts/convert-ly.py

index 17a94eb20189990361d60bfceb769fd619203e4a..b6dfe37b36b1c840431b92094fbd42e32db6ab33 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2003-12-31  Han-Wen Nienhuys   <hanwen@cs.uu.nl>
+
+       * lily/melisma-engraver.cc (try_music): use melisma_busy()
+
+       * lily/lyric-engraver.cc (process_music): remove alignment kludge 
+
+       * lily/lyric-combine-music-iterator.cc (melisma_busy): new function.
+
+       * lily/stanza-number-engraver.cc (acknowledge_grob): rewrite
+
+       * scm/define-grobs.scm (all-grob-descriptions): change
+       StanzaNumber description: make side support, i.s.o. breakable.
+       use Instrument_name_engraver for texts in the margin.
+
+       * scm/define-translator-properties.scm: remove
+       melismaEngraverBusy, stz property.
+
+       * *.cc: naming: change empty_b () into is_empty ()
+
+       * lily/self-aligment-interface.cc (aligned_on_parent): new function.
+
+       * input/regression/lyric-phrasing-new.ly: new file.
+
+       * lily/new-phrasing-engraver.cc (process_acknowledged_grobs): new
+       engraver, redo lyric phrasing, but cleaner and simpler.  Lyrics on
+       melismata are now left-aligned.
+
 2003-12-30  Han-Wen Nienhuys   <hanwen@cs.uu.nl>
 
        * input/mutopia/F.Schubert/GNUmakefile: add morgenlied.ly
index 2a739ba89c083561cb78ddb8b1f93bab6e1b6002..7006f6860e9921b33f715b46528f2f5d894c2256 100644 (file)
@@ -3517,10 +3517,11 @@ The complete example is shown here:
 }
 @end lilypond
 
-Stanza numbers, or the names of the singers can be added by setting
-@code{LyricsVoice.Stanza} (for the first system) and
-@code{LyricsVoice.stz} for the following systems.  Notice how dots are
-surrounded with spaces in @code{\lyrics} mode:
+@cindex stanza number
+@cindex singer's names
+@cindex name of singer 
+
+Stanza numbers can be added by setting @code{LyricsVoice.stanza}, e.g.
 
 @example
     \property LyricsVoice . stanza = "Bert"
@@ -3528,6 +3529,14 @@ surrounded with spaces in @code{\lyrics} mode:
     \property LyricsVoice . stanza = "Ernie" 
 @end example
 
+Notice how dots are surrounded with spaces in @code{\lyrics} mode, to
+prevent @code{LyricsVoice.stanza} being interpreted as a single
+string.
+
+Names of the singers should be added using @code{LyricsVoice
+. instrument} and @code{LyricsVoice . instr}, analogous to instrument
+annotations for staves.
 To make empty spaces in lyrics, use @code{\skip}.
 
 
diff --git a/VERSION b/VERSION
index aa9226608c5a938d892d16f9459b43fba07b2474..9f1c3eb43e7c28b2ad92358cec1fc0de194dc18f 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,5 +2,5 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=1
 PATCH_LEVEL=4
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=hwn1
 
index 14babc23ec95945e8cb8b9f86704e0e1768ab21c..c59d218cd1f2dce2f4f071cb647005bea0527d7d 100644 (file)
@@ -75,12 +75,12 @@ String
 Path::to_string () const
 {
   String s;
-  if (!root.empty_b ())
+  if (!root.is_empty ())
     s = root + ::to_string (ROOTSEP);
-  if (!dir.empty_b ())
+  if (!dir.is_empty ())
     s += dir + ::to_string (DIRSEP);
   s += base;
-  if (!ext.empty_b ())
+  if (!ext.is_empty ())
     s += ::to_string (EXTSEP) + ext;
   return s;
 }
index 44a5d9ce7cdf7eeccd2aaa9e433493400426d0fd..df96ce3966e7edc4447ec087674f7a370563cb31 100644 (file)
@@ -25,7 +25,7 @@ struct Interval_t : public Drul_array<T> {
   static T infinity () ;
   static String T_to_string (T arg);
   T center () const {
-    assert (!empty_b ());
+    assert (!is_empty ());
     return (elem (LEFT) + elem (RIGHT)) / T (2);
   }
   void translate (T t)
@@ -57,7 +57,7 @@ struct Interval_t : public Drul_array<T> {
   /*
     TODO: strip hungarian suffix.
    */
-  bool empty_b () const { return elem (LEFT) > elem (RIGHT); }
+  bool is_empty () const { return elem (LEFT) > elem (RIGHT); }
   bool contains_b (Interval_t<T> const&) const;
   Interval_t () {
     set_empty ();
@@ -76,7 +76,7 @@ struct Interval_t : public Drul_array<T> {
     return *this;
   }
   Interval_t<T> &operator *= (T r) {
-    if (!empty_b ())
+    if (!is_empty ())
       {
        elem (LEFT) *= r;
        elem (RIGHT) *= r;
index ddd2e1763ba9ce87ec6d8f754c075f8200be37a9..7d316fce137bc530325e239ed3478a1fc570aa0c 100644 (file)
@@ -129,7 +129,7 @@ template<class T>
 String
 Interval_t<T>::to_string () const
 {
-  if (empty_b ())
+  if (is_empty ())
     return "[empty]";
   String s ("[");
  
index 5f9f53ca72a50986e439c0a75599b992a6f53007..bee1cf986ac95558336b8af935a93753b532bb47 100644 (file)
@@ -89,7 +89,7 @@ public:
   void operator += (char const* s) { strh_ += s; }
   void operator += (String s);
 
-  bool empty_b () const;
+  bool is_empty () const;
 
   void append (String);
   void prepend (String);
index e1216ec3a40c62fcb646e9276e363b29be2146b8..1b4a4ed85768cbb0810fe6f49cead6c8c1f0d828 100644 (file)
@@ -153,7 +153,7 @@ String::get_str0 ()
 }
 
 bool 
-String::empty_b () const
+String::is_empty () const
 {
   return !length ();
 }
index dc7eba773d178e88b2136cbefc6a685166c2d61a..c3d13e688217d8ef29e00db07316608e641c25e6 100644 (file)
@@ -14,8 +14,7 @@
     not be in the PD - but I am assuming there are no notable ones in
     this small piece.
 
-    The original compresses the entire music onto a single page, in 4
-systems.  "
+    The original compresses the entire music onto a single page, in 4 systems."
 
 }
 
@@ -35,7 +34,6 @@ systems.  "
 melody = \notes  \relative c'' \repeat volta 2 \context Voice = singer {
     \time 6/8
     \autoBeamOff
-    \property Voice.automaticMelismata = ##t
     s1*0^\markup { \bold \bigger\bigger { \hspace #-3.0 Lieblich, etwas geschwind } }
   R2.
   r4 r8 c4 g8 |
@@ -57,6 +55,8 @@ melody = \notes  \relative c'' \repeat volta 2 \context Voice = singer {
 
 
 firstVerse = \lyrics {
+    \property LyricsVoice . stanza = "1."
+    
     Sü -- ÃŸes Licht! Aus gol -- de -- nen  Pfor -- ten brichst du __ \break
     sie -- gend durch __ die Nacht. Schö -- ner Tag, du __ bist er -- wacht. __ Mit \break
     ge -- heim -- nis -- vol -- len Wor -- ten, in me -- lo -- di -- schen Ak -- kor -- den, grüß __ ich __ \break
@@ -64,6 +64,8 @@ firstVerse = \lyrics {
     }
 
 secondVerse = \lyrics {
+    \property LyricsVoice . stanza = "2."
+
     Ach, der Lie -- be sanf "" -- tes We -- hen schwellt mir
     das be -- weg -- te __ Herz, sanft, wie ein ge -- lieb -- ter Schmerz. __ Dürft ich
     nur auf gold -- nen Hö -- hen mich im Mor -- gen -- duft er -- ge -- hen! Sehn -- sucht
@@ -117,7 +119,7 @@ pianoLH = \notes \relative c'' \repeat volta 2 {
         \context LyricsVoice = "singer-2" \secondVerse
         >>
      \new PianoStaff <<
-        \property PianoStaff.instrument = #"2  "
+        \property PianoStaff.instrument = \markup { \bold \bigger "2.  " }
         \new Staff \pianoRH
         \new Staff \pianoLH
        >> 
@@ -136,6 +138,11 @@ pianoLH = \notes \relative c'' \repeat volta 2 {
        \translator {  \PianoStaffContext
                VerticalAlignment \override #'forced-distance = #10
                }
+       \translator {
+            \ScoreContext
+            \remove "Lyric_phrasing_engraver"
+            \consists "New_phrasing_engraver"
+        }
 
 }
 }
diff --git a/input/regression/lyric-phrasing-new.ly b/input/regression/lyric-phrasing-new.ly
new file mode 100644 (file)
index 0000000..af1e074
--- /dev/null
@@ -0,0 +1,41 @@
+\header {
+
+texidoc = "Lyric phrasing:
+
+  Normally, the lyric is centered on the note head. However, on
+  melismata, the text is left aligned on the left-side of the note head.
+
+"
+}
+
+
+\score{
+\context Staff  {
+ \addlyrics
+   \notes \relative c' \context Voice = "bla" {
+       \autoBeamOff
+       c4( c16 d c b)  c4
+       d16[ e f g]
+                                                
+   }
+   \lyrics \context LyricsVoice = "bla-1" {
+       al tijd
+       izzz
+   }
+ }
+
+\paper { raggedright = ##t
+
+        \translator {
+            \ScoreContext
+            \remove "Lyric_phrasing_engraver"
+            \consists "New_phrasing_engraver"
+        }
+        \translator {
+            \VoiceContext
+
+        }
+     }
+}
+
index 3810db1d7a494bb8b6815b91924c73b591ea9041..cba123eb4fa3ab2c3c2c9076a1bbb07ca12ef5da 100644 (file)
@@ -1,17 +1,18 @@
-\version "1.9.8"
+\version "2.1.4"
+
 \header {
-texidoc = "Stanza numbers may differ for the first and following systems."
+texidoc = "Stanza numbers are put left of their lyric."
 }
 
 \score {
 <<
+    \notes { r4 r4 c4  c4 }
     \context LyricsVoice
     \lyrics {
-       \property LyricsVoice . stanza = "first"
-       \property LyricsVoice . stz =  \markup { "32" \super "nd"  }
-       Foo1 Bar1
+       \skip 2
+       \property LyricsVoice . stanza = "1."
+       Foo8 Bar8
     }
-    \notes { c''1 \break c''1 }
 >>
 
 \paper { raggedright = ##t } 
index e7ee7654635d52345522c40991ec9ed317352697..19fb8b16e862ea61db39cb31defbf0899379c4e0 100644 (file)
@@ -117,7 +117,7 @@ calculates the number of accidentals on basis of the current local key sig
 
 */
 static int
-number_accidentals (SCM sig, Music * note, Pitch *pitch, SCM curbarnum, SCM lazyness, 
+number_accidentals (SCM sig, Music *, Pitch *pitch, SCM curbarnum, SCM lazyness, 
                    bool ignore_octave_b)
 {
   int n = pitch->get_notename ();
@@ -204,7 +204,7 @@ number_accidentals (Music * note, Pitch *pitch, Translator_group * origin,
       else if (gh_symbol_p (ly_car (accidentals)))
        {
          SCM context =ly_car (accidentals);
-         while (origin && !origin->is_alias_b (context))
+         while (origin && !origin->is_alias (context))
            origin = origin->daddy_trans_;
       
          if (!origin)
index 2784ce198e668e2ceb72cc7becff1be9519c6ea5..d8bd7aaeb84ba75434f9580b6ea41249d4c5c709 100644 (file)
@@ -119,7 +119,7 @@ Accidental_placement::get_relevant_accidental_extent (Grob *me,
       extent.unite (which->elem(i)->extent (item_col, X_AXIS));
     }
 
-  if (!extent.empty_b())
+  if (!extent.is_empty ())
     {
       Real p = gh_scm2double (me->get_grob_property ("left-padding"));
       extent[LEFT] -= p;
index 3daa6f26c28c0211e04aa42ddf854f9c6c079cd1..759b492dc0fcd98dcc18f80cf5368d8a3b4b5334 100644 (file)
@@ -209,7 +209,7 @@ Accidental_interface::brew_molecule (SCM smob)
       String font_char = get_fontcharname (style, alteration);
       Molecule acc (fm->find_by_name ("accidentals-" + font_char));
 
-      if (acc.empty_b())
+      if (acc.is_empty ())
        {
          me->warning (_f ("accidental `%s' not found", font_char));
        }
index 5f7306d2b1340ac8aee0099221be2a2c811ba20e..68ee8e506a0f3e37572500eb03e80646738ab606 100644 (file)
@@ -151,7 +151,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a)
   for (int i=0; i < all_grobs.size (); i++) 
     {
       Interval y = all_grobs[i]->extent (me, a);
-      if (!y.empty_b ())
+      if (!y.is_empty ())
        {
          Grob *e =dynamic_cast<Grob*> (all_grobs[i]);
 
index e6eddd883f42dcdd368974e49a0495e2f2bdda97..76336652255a0a7f6c30eeba1ea86967be1f507b 100644 (file)
@@ -53,17 +53,17 @@ All_font_metrics::find_afm (String name)
     {
       String path;
 
-      if (path.empty_b ())
+      if (path.is_empty ())
        path = search_path_.find (name  + ".afm");
 
-      if (path.empty_b ())
+      if (path.is_empty ())
        {
          String p = kpathsea_find_afm (name.to_str0 ());
          if (p.length ())
            path = p;
        }
 
-      if (path.empty_b ())
+      if (path.is_empty ())
        return 0;
       
       if (verbose_global_b)
@@ -127,16 +127,16 @@ All_font_metrics::find_tfm (String name)
     {
       String path;
       
-      if (path.empty_b ())
+      if (path.is_empty ())
        {
          String p = kpathsea_find_tfm (name.to_str0 ());
          if (p.length ())
            path = p;
        }
 
-      if (path.empty_b ())
+      if (path.is_empty ())
        path = search_path_.find (name  + ".tfm");
-      if (path.empty_b ())
+      if (path.is_empty ())
        return 0;
 
       if (verbose_global_b)
index 853b2830b828e8f85a7e7d2691f2ab7cd3b3fb97..48eaa617111352e8676b694ba9aca3b428005876 100644 (file)
@@ -143,7 +143,7 @@ Ambitus::brew_molecule (SCM smob)
     {
       note_head_style = String ("noteheads-2");
     }
-  if (Font_interface::get_default_font (me)->find_by_name (note_head_style).empty_b ())
+  if (Font_interface::get_default_font (me)->find_by_name (note_head_style).is_empty ())
     {
       String message = "Ambitus: no such note head: `" + note_head_style + "'";
       me->warning (_ (message.to_str0 ()));
index ed040e70c56cbfe192ac1e761a985b640153c91f..aa14910a2d7d831ad79ee6a9b61d0eb9bba5218f 100644 (file)
@@ -54,7 +54,7 @@ Arpeggio::brew_molecule (SCM smob)
                   - my_y);
     }
 
-  if (heads.empty_b ())
+  if (heads.is_empty ())
     {
       /*
        Dumb blonde error
index 51e2284b2fbb61673fcb1ee3eee0b8ce406eb784..4bcb65314ea7a9801bd9db9bd17047f30f41a450 100644 (file)
@@ -31,7 +31,7 @@ Auto_change_iterator::change_to (Music_iterator *it, SCM to_type_sym,
      
      If \translator Staff = bass, then look for Staff = *
    */
-  while (current && !current->is_alias_b (to_type_sym))
+  while (current && !current->is_alias (to_type_sym))
     {
       last = current;
       current = current->daddy_trans_;
index 674ac1d32677f08a72b64303988ea2f3baaf6d32..4d734640edeaf8c63b116158ab6d1f2a064e6c17 100644 (file)
@@ -45,7 +45,7 @@ Axis_group_interface::relative_group_extent (Axis a, Grob *common, SCM elts)
     {
       Grob * se = unsmob_grob (ly_car (s));
       Interval dims = se->extent (common, a);
-      if (!dims.empty_b ())
+      if (!dims.is_empty ())
        r.unite (dims);
     }
   return r;
index 6bd0be9e6303900a769f705a8d91ce9b5fc8ebe1..2ee7b317785f4012e3cf517e964cd0e61c844411 100644 (file)
@@ -112,7 +112,9 @@ Beam_engraver::try_music (Music *m)
        return false;
 
       if (d == START)
-       evs_drul_[d] = m;
+       {
+         evs_drul_[d] = m;
+       }
       else if (d==STOP)
        {
          now_stop_ev_ = m;
@@ -123,9 +125,13 @@ Beam_engraver::try_music (Music *m)
 }
 
 void
-Beam_engraver::set_melisma (bool m)
+Beam_engraver::set_melisma (bool ml)
 {
-  daddy_trans_->set_property ("beamMelismaBusy", m ? SCM_BOOL_T :SCM_BOOL_F);
+  SCM m = get_property ("automaticMelismata");
+  SCM b = get_property ("autoBeaming");
+  
+  if (to_boolean (m) && !to_boolean (b))
+    daddy_trans_->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
 }
 
 void
@@ -154,6 +160,7 @@ Beam_engraver::process_music ()
          return;
        }
 
+      set_melisma (true);
       prev_start_ev_ = evs_drul_[START];
       beam_ = new Spanner (get_property ("Beam"));
       SCM smp = get_property ("measurePosition");
@@ -194,12 +201,8 @@ Beam_engraver::start_translation_timestep ()
   
   if (beam_)
     {
-      SCM m = get_property ("automaticMelismata");
-      SCM b = get_property ("autoBeaming");
-      if (to_boolean (m) && !to_boolean (b))
-       {
-         set_melisma (true);
-       }
+      set_melisma (true);
+      
       subdivide_beams_ = to_boolean(get_property("subdivideBeams"));
       beat_length_ = *unsmob_moment (get_property ("beatLength"));
     }
@@ -218,12 +221,7 @@ Beam_engraver::stop_translation_timestep ()
       beam_ = 0;
       beam_info_ = 0;
       typeset_beam();
-
-      if (to_boolean (get_property ("automaticMelismata"))
-         && !to_boolean (get_property ("autoBeaming")))
-       {
          set_melisma (false);
-       }
     }
 }
 
index 65da185282aba7cf416a398a91f7349992016105..6f509ce91b910cc11e55bfaa60fb163680e74cdd 100644 (file)
@@ -266,7 +266,7 @@ Beam::connect_beams (Grob *me)
            }
          while (flip (&d) != LEFT);
 
-         if (!new_slice.empty_b())
+         if (!new_slice.is_empty ())
            last_int =  new_slice;
        }
       else
@@ -609,7 +609,7 @@ struct Int_set
 
        s.intersect (allowed_regions_[i]);
 
-       if (!s.empty_b ())
+       if (!s.is_empty ())
          {
            Interval before = allowed_regions_[i];
            Interval after = allowed_regions_[i];
@@ -617,13 +617,13 @@ struct Int_set
            before[RIGHT] = s[LEFT];
            after[LEFT] = s[RIGHT];
 
-           if (!before.empty_b() && before.length () > 0.0)
+           if (!before.is_empty () && before.length () > 0.0)
              {
                allowed_regions_.insert (before, i);
                i++;
              }
            allowed_regions_.del (i);
-           if (!after.empty_b () && after.length () > 0.0)
+           if (!after.is_empty () && after.length () > 0.0)
              {
                allowed_regions_.insert (after, i);
                i++;
@@ -669,7 +669,7 @@ Beam::consider_auto_knees (Grob* me)
        continue;
 
       Interval hps = Stem::head_positions (stem);
-      if(!hps.empty_b())
+      if(!hps.is_empty ())
        {
          hps[LEFT] += -1;
          hps[RIGHT] += 1; 
@@ -732,7 +732,7 @@ Beam::consider_auto_knees (Grob* me)
          stem->set_grob_property ("direction", scm_int2num (d));
          
          hps.intersect (max_gap);
-         assert (hps.empty_b () || hps.length () < 1e-6 );
+         assert (hps.is_empty () || hps.length () < 1e-6 );
        }
     }
 }
@@ -1003,7 +1003,7 @@ Beam::shift_region_to_valid (SCM grob)
       feasible_left_point.intersect (flp);
     }
       
-  if (feasible_left_point.empty_b())
+  if (feasible_left_point.is_empty ())
     {
       warning (_("Not sure that we can find a nice beam slope (no viable initial configuration found)."));
     }
@@ -1231,13 +1231,13 @@ Beam::calc_stem_y (Grob *me, Grob* s, Grob ** common,
   if (french)
     {
       Slice bm = where_are_the_whole_beams (beaming);
-      if (!bm.empty_b())
+      if (!bm.is_empty ())
        stem_y += beam_translation * bm[-my_dir];
     }
   else
     {
       Slice bm = Stem::beam_multiplicity(s);
-      if (!bm.empty_b())
+      if (!bm.is_empty ())
        stem_y +=bm[my_dir] * beam_translation;
     }
   
index c9b74c3f476627e756dc802c6cb3373420913112..cf0f0b04fc964581e674c5490a09e7112a443661 100644 (file)
@@ -72,7 +72,7 @@ Break_algorithm::generate_spacing_problem (Link_array<Grob> const &curline,
   /*
     sort out how interfacing this should work;
    */
-  if (line.empty_b ())
+  if (line.is_empty ())
     {
      sp->line_len_ = -1;
     }
index c18f8ff78e97fc80d55ac7064745099cbf07c9c1..3584e3d077cd625c2b6dafef9187102e919fa2b1 100644 (file)
@@ -82,12 +82,12 @@ Break_align_interface::do_alignment (Grob *me)
     {
       Interval y = elems[i]->extent (elems[i], X_AXIS);
       extents.push (y);
-      if (!y.empty_b())
+      if (!y.is_empty ())
        last_nonempty = i; 
     }
 
   int idx  = 0;
-  while (idx < extents.size  () && extents[idx].empty_b ())
+  while (idx < extents.size  () && extents[idx].is_empty ())
     idx++;
   
   Array<Real> offsets;
@@ -102,7 +102,7 @@ Break_align_interface::do_alignment (Grob *me)
     {
       int next_idx = idx+1;
       while (next_idx < elems.size() &&
-            extents[next_idx].empty_b()
+            extents[next_idx].is_empty ()
            )
        next_idx++;
       
index b97380ee7b561682346e343b4af081a350167b70..d9a766ff9f0a06cca985910b087f6fc171adfd8d 100644 (file)
@@ -282,7 +282,7 @@ struct Substitution_entry
     /*
       duh, don't support scores with more than 32000 systems.
     */
-    if (sr.empty_b())
+    if (sr.is_empty ())
       {
        /*
          overflow if we don't treat this specially.
index b8ccb356b1cf904fa1129be1b3055db7bde53c94..7d458029c9177ef4c059f4f96cfe2dbae5293054 100644 (file)
@@ -49,7 +49,7 @@ Change_iterator::process (Moment m)
      
      If \translator Staff = bass, then look for Staff = *
    */
-  while (current && !current->is_alias_b (to_type))
+  while (current && !current->is_alias (to_type))
     {
       last = current;
       current = current->daddy_trans_;
index 0b72e88a88da3622ae9b861b2b3570a3c09e7e19..41cf576c15ac9e1557fde91408cf1751188c0b3c 100644 (file)
@@ -59,7 +59,7 @@ Clef::brew_molecule (SCM smob)
   String glyph = String (ly_scm2string (glyph_scm));
   Font_metric *fm = Font_interface::get_default_font (me);
   Molecule out = fm->find_by_name (glyph);
-  if (out.empty_b())
+  if (out.is_empty ())
     {
       me->warning (_f ("clef `%s' not found", glyph.to_str0 ()));
     }
index ad8d408ea9dbf0b4ebb135cbcf1ba6ea0154837b..121357c476c63f973035422f5c986fdd74f4ff00 100644 (file)
@@ -87,7 +87,7 @@ Custos::brew_molecule (SCM smob)
 
   Molecule molecule
     = Font_interface::get_default_font (me)->find_by_name (font_char);
-  if (molecule.empty_b ())
+  if (molecule.is_empty ())
     {
       me->warning (_f ("custos `%s' not found", font_char));
       return SCM_EOL;
index 37fc1c80e29cb51609838d81d068ca1ab51550f8..40a02698240236665d3f61092927c7b3d6d6c62e 100644 (file)
@@ -68,7 +68,7 @@ Font_metric::text_dimension (String text) const
          break;
        }
     }
-  if (ydims.empty_b ())
+  if (ydims.is_empty ())
     ydims = Interval (0,0);
 
   return Box (Interval (0, w), ydims);
index 8e6f7194c7aa9bf097b6bf5d30df3f161c331928..f3043eeb84dac46e957927ad16965f4dbf8a2c3b 100644 (file)
@@ -13,7 +13,7 @@ void check_prefix (String name, int mask, int prefix_set, String *str)
 {
   if (prefix_set & mask)
     {
-      if (!str->empty_b ())
+      if (!str->is_empty ())
        *str += ", ";
       *str += name;
     }
index c757f4ce1e645facc3dc3761c6a85a6ca23f53c7..ab3dabeee300936800fa2895da734d2288293a36 100644 (file)
@@ -75,7 +75,7 @@ Hairpin::brew_molecule (SCM smob)
                make the padding a little smaller, here.
              */
              Interval e =b->extent (common, X_AXIS);
-             if (e.empty_b ())
+             if (e.is_empty ())
                e = Interval (0,0) + b->relative_coordinate (common, X_AXIS);
              
              x_points[d] = e.center () - d  * padding /3; // ugh.
@@ -83,7 +83,7 @@ Hairpin::brew_molecule (SCM smob)
          else
            {
              Interval e =b->extent (common, X_AXIS);
-             if (!e.empty_b ())
+             if (!e.is_empty ())
                x_points[d] = e[-d] - d*padding;
            }
        }
index e8227bbf812d049a2484bdc06b9e7e8ea12630a4..c3bea14259e20c0504ba45d6eb4af3f271ef47fd 100644 (file)
@@ -59,7 +59,7 @@ Hyphen_spanner::brew_molecule (SCM smob)
     {
       Interval iv = sp->get_bound (d)->extent (common, X_AXIS);
 
-      bounds[d] = iv.empty_b ()
+      bounds[d] = iv.is_empty ()
        ? sp->get_bound (d)->relative_coordinate (common, X_AXIS)
        : iv[-d];
     }
@@ -91,7 +91,7 @@ Hyphen_spanner::brew_molecule (SCM smob)
     we should probably do something more intelligent when bounds is
     empty, but at least this doesn't crash.
   */      
-  Real w  = bounds.empty_b () ? 0 : bounds.length ();
+  Real w  = bounds.is_empty () ? 0 : bounds.length ();
   
   /* for length, use a geometric mean of the available space and some minimum
    */
@@ -125,7 +125,7 @@ Hyphen_spanner::brew_molecule (SCM smob)
     }
   Box b (Interval (-l/2,l/2), Interval (h,h+th));
   Molecule mol (Lookup::filledbox (b));
-  Real ct = bounds.empty_b () ? 0 : bounds.center () ;
+  Real ct = bounds.is_empty () ? 0 : bounds.center () ;
   mol.translate_axis (ct -sp->relative_coordinate (common, X_AXIS), X_AXIS);
   return mol.smobbed_copy ();
 }
index eedacf62a9fd1c9f01de291b6f171b6b306059cb..17746ccafb143c4a19372a07419de98dfeae4898 100644 (file)
@@ -71,7 +71,7 @@ public:
      codify THIS into a Scheme expression.
    */
   SCM create_scheme () const;
-  bool empty_b () const;
+  bool is_empty () const;
 
 
   static SCM ly_get_molecule_extent (SCM mol, SCM axis);
index b725f811482251c12ff345e9748db5adca1e1f4e..f7a45bb933151a678ae498067fdfa407e46f515c 100644 (file)
@@ -17,6 +17,7 @@ struct Self_alignment_interface
   static bool has_interface (Grob*);
   DECLARE_SCHEME_CALLBACK (aligned_on_self, (SCM element, SCM axis));
   DECLARE_SCHEME_CALLBACK (centered_on_parent, (SCM element, SCM axis));
+  DECLARE_SCHEME_CALLBACK (aligned_on_parent, (SCM element, SCM axis));
   DECLARE_SCHEME_CALLBACK (centered_on_other_axis_parent, (SCM element, SCM axis));
 };
 #endif
index 87b9616339a6dd7b8799d09d82fad15068c066ac..5a1fc1f6eabc97114f8419531f8d78a6c6e1adc2 100644 (file)
@@ -59,7 +59,7 @@ public:
   Translator_group* get_ancestor (int l=1);
   int get_depth () const;
   bool is_bottom_translator_b () const;
-  bool removable_b () const;
+  bool is_removable () const;
   void terminate_translator (Translator*r);
   Translator *remove_translator (Translator*trans);
   void check_removal ();
@@ -82,4 +82,8 @@ public:
   virtual void each (Method_pointer);
 };
 
+
+bool melisma_busy (Translator* tr); // where to put this? --hwn
+
+
 #endif // TRANSLATOR_GROUP_HH
index 81b95bbdf76500f7f5f44b2e2f2c070dc9e35d65..ae0109329bff040b1ebaac8f92af733f75b1f975 100644 (file)
@@ -38,7 +38,7 @@ class Translator
 public:
   Music_output_def * output_def_;
   
-  bool is_alias_b (SCM) const;
+  bool is_alias (SCM) const;
   Translator (Translator const &);
 
   
index ef55dee50cdb0719066000af6ceafdda02b3757f..90bf8d4e2a717ff0e536da4ded7ca2e37ce4fc19 100644 (file)
@@ -88,7 +88,7 @@ write_dependency_file (String fn,
          out = "  ";
        }
       String dep = deps[i];
-      if (!dependency_prefix_global.empty_b ())
+      if (!dependency_prefix_global.is_empty ())
        {
          if (dep.index ('/') < 0)
            dep = dependency_prefix_global + dep;
@@ -154,14 +154,14 @@ Input_file_results::Input_file_results (String init, String in_file, String out_
 void
 do_one_file (String init, String in_file, String out_file) 
 {
-  if (init.length () && global_path.find (init).empty_b ())
+  if (init.length () && global_path.find (init).is_empty ())
     {
       warning (_f ("can't find file: `%s'", init));
       warning (_f ("(search path: `%s')", global_path.to_string ().to_str0 ()));
       return;
     }
 
-  if ((in_file != "-") && global_path.find (in_file).empty_b ())
+  if ((in_file != "-") && global_path.find (in_file).is_empty ())
     {
       warning (_f ("can't find file: `%s'", in_file));
       return;
index 76817e5e4bac4a896c4c3ddef839783678bb27fe..7c175e20a05c37904fea86de4ba924ed890dcb79 100644 (file)
@@ -134,7 +134,7 @@ Key_signature_interface::brew_molecule (SCM smob)
        Accidental_interface::get_fontcharname (style, alteration);
       Molecule acc (fm->find_by_name ("accidentals-" + font_char));
 
-      if (acc.empty_b())
+      if (acc.is_empty ())
        {
          me->warning (_f ("accidental `%s' not found", font_char));
        }
index 4715b76998932167d4e52fcf01443b9e0e53e020..138a4ddcf1c181734e182b0c3846e86e98535c82 100644 (file)
@@ -39,6 +39,20 @@ private:
 };
 
 
+bool
+melisma_busy (Translator* tr)
+{
+  SCM melisma_properties = tr->get_property ("melismaBusyProperties");
+  bool busy = false;
+
+  for (; gh_pair_p (melisma_properties);
+       melisma_properties = gh_cdr (melisma_properties))
+    busy = busy || to_boolean (tr->internal_get_property (gh_car (melisma_properties)));
+
+  return busy;
+}
+
+
 
 /*
   Ugh, why static?
index bbaa005cdffd9176f13adfc78d676a777c17e8f0..33ced391727d08548a77fa19ddf1473864f8b8ee 100644 (file)
@@ -63,16 +63,6 @@ Lyric_engraver::process_music ()
       text_=  new Item (get_property ("LyricText"));
       
       text_->set_grob_property ("text", req_->get_mus_property ("text"));
-
-      /*
-       We can't reach the notehead where we're centered from here. So
-       we kludge.
-
-       (UGH UGH, pulled amount of space out of thin air)
-      */
-      
-      text_->translate_axis (0.66, X_AXIS);
-      
       announce_grob (text_, req_->self_scm());
     }
 }
index fab2a8e607c9f4a5ab010b4cd02512b3e95658e4..b3275a57055da47abbae1cc9ecff9c9a7d635273 100644 (file)
@@ -204,7 +204,7 @@ Lyric_phrasing_engraver::acknowledge_grob (Grob_info i)
       record_notehead (voice_context_id, h);
 
       /* is it in a melisma ? */
-      if (to_boolean (i.origin_trans_->get_property ("melismaEngraverBusy")))
+      if (melisma_busy (i.origin_trans_))
        {
          record_melisma (voice_context_id);
        }
@@ -255,12 +255,12 @@ Lyric_phrasing_engraver::acknowledge_grob (Grob_info i)
 String 
 get_context_id (Translator_group * ancestor, SCM  type)
 {
-  while (ancestor != 0 && !ancestor->is_alias_b(type))
+  while (ancestor && !ancestor->is_alias(type))
     {
       ancestor = ancestor->daddy_trans_;
     }
 
-  if (ancestor != 0)
+  if (ancestor)
     {
       return ancestor->id_string_;
     }
@@ -362,5 +362,5 @@ ENTER_DESCRIPTION(Lyric_phrasing_engraver,
                  /* creats*/       "",
                  /* accepts */     "",
 /* acks  */      "lyric-syllable-interface note-head-interface lyric-extender-interface",
-                 /* reads */       "automaticPhrasing melismaEngraverBusy associatedVoice phrasingPunctuation",
+                 /* reads */       "automaticPhrasing associatedVoice phrasingPunctuation",
                  /* write */       "");
index 44e2acf6225a9a0d14e0acbd3d9ff6e07473d051..58d7553430158f16145b5c44df83acce45ea5fb0 100644 (file)
@@ -271,7 +271,7 @@ Path
 distill_inname (String str)
 {
   Path p = split_path (str);
-  if (str.empty_b () || str == "-")
+  if (str.is_empty () || str == "-")
     p.base = "-";
   else
     {
@@ -280,10 +280,10 @@ distill_inname (String str)
       for (int i = 0; extensions[i]; i++)
        {
          p.ext = orig_ext;
-         if (*extensions[i] && !p.ext.empty_b ())
+         if (*extensions[i] && !p.ext.is_empty ())
            p.ext += ".";
          p.ext += extensions[i];
-         if (!global_path.find (p.to_string ()).empty_b ())
+         if (!global_path.find (p.to_string ()).is_empty ())
              break;
        }
       /* Reshuffle extension */
@@ -356,11 +356,11 @@ main_prog (void *, int, char **)
       outpath.root = "";
       outpath.dir = "";
       
-      if (!output_name_global.empty_b ())
+      if (!output_name_global.is_empty ())
        outpath = split_path (output_name_global);
       
       String init;
-      if (!init_name_global.empty_b ())
+      if (!init_name_global.is_empty ())
        init = init_name_global;
       else
        init = "init.ly";
@@ -420,7 +420,7 @@ main (int argc, char **argv)
          {
            String s = oparser_p_static->optional_argument_str0_;
            Path p = split_path (s);
-           if (s != "-" && p.ext.empty_b ())
+           if (s != "-" && p.ext.is_empty ())
              p.ext = output_format_global;
 
            output_name_global = p.to_string ();
index b29f91a1d9c92534614a54f8e15615f035e2bd25..7c42896fe511ef9d462207bacf9a647840e3dcc9 100644 (file)
@@ -32,7 +32,7 @@ Measure_grouping::brew_molecule (SCM grob)
   Interval rext = me->get_bound (RIGHT)->extent (common, X_AXIS);
   
   
-  Real w =(rext.empty_b()
+  Real w =(rext.is_empty ()
           ? me->get_bound (RIGHT)->relative_coordinate (common, X_AXIS)
           : rext[RIGHT])
     - me->get_bound (LEFT)->relative_coordinate (common, X_AXIS);
index 72dfb94ac71ffa329137e212acc2c9563aa83122..d63150f7e31b684c96fa034ee8c38bb30c996135 100644 (file)
@@ -24,21 +24,12 @@ public:
 
 
 bool
-Melisma_engraver::try_music (Music *m
+Melisma_engraver::try_music (Music *) 
 {
-  SCM melisma_properties = get_property ("melismaBusyProperties");
-  bool busy = false;
-
-  for (; gh_pair_p (melisma_properties);
-       melisma_properties = gh_cdr (melisma_properties))
-
-    busy = busy || to_boolean (internal_get_property (gh_car (melisma_properties)));
-
   /*
-    for the phrasing engraver we also need this.
+    This can only be melisma-playing-event.
    */
-  daddy_trans_->set_property ("melismaEngraverBusy",gh_bool2scm (busy));
-  return busy;
+  return  melisma_busy (this);
 }
 
 Melisma_engraver::Melisma_engraver()
@@ -46,9 +37,9 @@ Melisma_engraver::Melisma_engraver()
 }
 
 ENTER_DESCRIPTION(Melisma_engraver,
-/* descr */       "",
+/* descr */       "This engraver collects melisma information about ties, beams, and user settings (@code{melismaBusy}, and signals it to the @code{\addlyrics} code.  ",
 /* creats*/       "",
 /* accepts */     "melisma-playing-event",
 /* acks  */      "",
 /* reads */       "melismaBusy melismaBusyProperties slurMelismaBusy tieMelismaBusy beamMelismaBusy",
-/* write */       "melismaEngraverBusy");
+/* write */       "");
index 6e60f05660529dd355815cca12899cc74696b644..bfbc525666c0bff128e1972ef5c701adb86ff08d 100644 (file)
@@ -64,7 +64,7 @@ Molecule::translate (Offset o)
   expr_ = scm_list_n (ly_symbol2scm ("translate-molecule"),
                   ly_offset2scm (o),
                   expr_, SCM_UNDEFINED);
-  if (!empty_b ())
+  if (!is_empty ())
     dim_.translate (o);
 }
   
@@ -107,7 +107,7 @@ Molecule::set_empty (bool e)
 void
 Molecule::align_to (Axis a, Real x)
 {
-  if (empty_b())
+  if (is_empty ())
     return ;
 
   Interval i (extent (a));
@@ -121,10 +121,10 @@ void
 Molecule::add_at_edge (Axis a, Direction d, Molecule const &m, Real padding,
                       Real minimum)
 {
-  Real my_extent= empty_b () ? 0.0 : dim_[a][d];
+  Real my_extent= is_empty () ? 0.0 : dim_[a][d];
   Interval i (m.extent (a));
   Real his_extent;
-  if (i.empty_b ())
+  if (i.is_empty ())
     {
       programming_error ("Molecule::add_at_edge: adding empty molecule.");
       his_extent = 0.0;
@@ -148,7 +148,7 @@ Molecule::add_at_edge (Axis a, Direction d, Molecule const &m, Real padding,
   while expr_ == '()
  */
 bool
-Molecule::empty_b () const
+Molecule::is_empty () const
 {
   return expr_ == SCM_EOL;
 }
index 4d2cad0b29b6714740b892ab9ff2f5504ad2ff16..5a12cf716a8236d3331a73da0460d764bef6c336 100644 (file)
@@ -272,7 +272,7 @@ number_accidentals (Music * note, Pitch *pitch, Translator_group * origin,
        {
          SCM context = ly_car (accidentals);
          
-         while (origin && !origin->is_alias_b (context))
+         while (origin && !origin->is_alias (context))
            origin = origin->daddy_trans_;
       
          if (!origin)
index a468aea0a17f8fb4e6bbdfcf44b7318b75083f0f..433fd96b21abec8059b2312524f50824b180b721 100644 (file)
@@ -102,7 +102,7 @@ extern Grob *make_script_from_event (SCM * descr, Translator_group*tg, Music * e
 void
 New_fingering_engraver::add_script (Grob * head,
                                    Music * event,
-                                   Music * head_event)
+                                   Music * )
 {
   Finger_tuple ft ;
 
@@ -113,7 +113,6 @@ New_fingering_engraver::add_script (Grob * head,
       
       articulations_.push (ft);
       announce_grob (g, event->self_scm ());
-  
  
       ft.script_->set_parent (head, X_AXIS);
     }
diff --git a/lily/new-phrasing-engraver.cc b/lily/new-phrasing-engraver.cc
new file mode 100644 (file)
index 0000000..234c430
--- /dev/null
@@ -0,0 +1,191 @@
+/*   
+  new-phrasing-engraver.cc --  implement New_phrasing_engraver
+
+source file of the GNU LilyPond music typesetter
+
+(c) 2003--2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ */
+
+#include "translator-group.hh"
+#include "engraver.hh"
+#include "note-head.hh"
+#include "grob.hh"
+
+struct Phrasing_association
+{
+  String name_;
+  Link_array<Grob> lyrics_;
+  Link_array<Grob> heads_;
+  bool melisma_;
+  bool last_melisma_;
+  
+  Phrasing_association()
+  {
+    melisma_ = false;
+    last_melisma_ = false;
+  }
+  
+  void clear () {
+    lyrics_.clear ();
+    heads_.clear ();
+  }
+    
+};
+
+class New_phrasing_engraver : public Engraver
+{
+public:
+  ~New_phrasing_engraver ();
+  TRANSLATOR_DECLARATIONS(New_phrasing_engraver);
+protected:
+  virtual void acknowledge_grob (Grob_info);
+  virtual void process_acknowledged_grobs ();
+  virtual void stop_translation_timestep ();
+
+  Link_array<Phrasing_association> assocs_;
+  void add_lyric_phrasing (Grob_info);
+  void add_voice_phrasing (Grob_info);
+};
+
+New_phrasing_engraver::New_phrasing_engraver()
+{
+  
+}
+
+void
+New_phrasing_engraver::acknowledge_grob (Grob_info i)
+{
+  Grob *h = i.grob_;
+
+  if (Note_head::has_interface (h))
+    {
+      add_voice_phrasing (i);
+    }
+  else if (h->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
+    {
+      add_lyric_phrasing (i);
+    }
+}
+
+void
+New_phrasing_engraver::add_voice_phrasing (Grob_info inf)
+{
+  Translator_group * tr = inf.origin_trans_->daddy_trans_;
+  while (tr && !tr->is_alias (ly_symbol2scm ("Voice")))
+    tr = tr->daddy_trans_;
+
+  if (!tr)
+    return;
+
+  /*
+    should use dict? 
+   */
+  Phrasing_association *a =0;
+  for (int i =0; !a && i < assocs_.size (); i++)
+    {
+      if (assocs_[i]->name_ == tr->id_string_)
+       a = assocs_[i];
+    }
+
+  if (!a)
+    {
+      a = new Phrasing_association ;
+      a->name_ = tr->id_string_;
+      assocs_.push (a);
+    }
+
+  a->heads_.push (inf.grob_);
+  a->melisma_ = melisma_busy (inf.origin_trans_);
+}
+
+void
+New_phrasing_engraver::add_lyric_phrasing (Grob_info inf)
+{
+  Translator_group * tr = inf.origin_trans_->daddy_trans_;
+  while (tr && !tr->is_alias (ly_symbol2scm ("LyricsVoice")))
+    tr = tr->daddy_trans_;
+
+  if (!tr)
+    return;
+
+  SCM voice = get_property ("associatedVoice");
+  String nm = tr->id_string_;
+  if (gh_string_p (voice))
+    nm = ly_scm2string (voice);
+  else
+    {
+      int idx = nm.index_last ('-');
+      if (idx >= 0)
+       nm = nm.left_string (idx);
+    }
+  
+  Phrasing_association * a=0;
+  for (int i=0 ; !a && i < assocs_.size (); i++)
+    {
+      if (assocs_[i]->name_ == nm)
+       a = assocs_[i];
+    }
+
+  if (!a)
+    {
+      a = new Phrasing_association ;
+      a->name_ = nm;
+      assocs_.push (a);
+    }
+
+  a->lyrics_.push (inf.grob_);
+}
+
+void
+New_phrasing_engraver::stop_translation_timestep ()
+{
+  for (int i = assocs_.size ();  i--; )
+    {
+      assocs_[i]->clear ();
+      assocs_[i]->last_melisma_ = assocs_[i]->melisma_;
+    }
+}
+
+void
+New_phrasing_engraver::process_acknowledged_grobs ()
+{
+  for (int i = 0; i < assocs_.size ();  i++)
+    {
+      Phrasing_association * a = assocs_[i];
+      if (!a->heads_.size()  || !a->lyrics_.size ())
+       continue;
+
+      Grob *h = a->heads_[0];  
+      Direction alignment = CENTER;
+      if (a->melisma_ && !a->last_melisma_)
+       alignment = LEFT;
+      
+      for (int j = 0; j < a->lyrics_.size (); j++)
+       {
+                 
+         Grob *l = a->lyrics_[j];
+         if (!l->get_parent (X_AXIS))
+           {
+             l->set_parent (h, X_AXIS);
+             if (alignment)
+               l->set_grob_property ("self-alignment-X", gh_int2scm (alignment));
+           }
+       }
+    }
+}
+
+New_phrasing_engraver::~New_phrasing_engraver ()
+{
+  for (int i =assocs_.size(); i--;)
+    delete assocs_[i];
+}
+
+ENTER_DESCRIPTION(New_phrasing_engraver,
+                 "This engraver combines note heads and lyrics for alignment. ",
+                 "",
+                 "",
+                 "lyric-syllable-interface note-head-interface lyric-extender-interface",
+                 "automaticPhrasing associatedVoice",
+                 "");
+
index 84e8af265201aec998793328b8b3c5b3f5ad8b06..12578a2b5cadde600a41bd4f9b18bf4fafb50d23 100644 (file)
@@ -60,10 +60,10 @@ Note_head_line_engraver::acknowledge_grob (Grob_info info)
       if (to_boolean (get_property ("followVoice")))
        {
          Translator_group  * tr = daddy_trans_;
-         while (tr && !tr->is_alias_b (ly_symbol2scm ( "Staff")))
+         while (tr && !tr->is_alias (ly_symbol2scm ( "Staff")))
            tr = tr->daddy_trans_ ;
 
-         if (tr && tr->is_alias_b (ly_symbol2scm ("Staff")) && tr != last_staff_)
+         if (tr && tr->is_alias (ly_symbol2scm ("Staff")) && tr != last_staff_)
            {
              if (last_head_)
                follow_ = true;
index 76eb2a69395e94fbac1a18a3a678d1e993ead025..bce006a9206302263ff7654f5140e00e0ba388d6 100644 (file)
@@ -124,7 +124,7 @@ internal_brew_molecule (Grob *me, bool with_ledgers)
 
   Font_metric * fm = Font_interface::get_default_font (me);
   Molecule out = fm->find_by_name (font_char);
-  if (out.empty_b())
+  if (out.is_empty ())
     {
       me->warning (_f ("note head `%s' not found", font_char.to_str0 ()));
     }
@@ -190,7 +190,7 @@ Note_head::head_extent (Grob *me, Axis a)
     {
       Molecule mol = internal_brew_molecule (me, false);
   
-      if (!mol.empty_b())
+      if (!mol.is_empty ())
        return mol.extent (a);
     }
   else
@@ -285,7 +285,7 @@ Note_head::stem_attachment_coordinate (Grob *me, Axis a)
          Box b = fm->get_indexed_char (k);
          Offset wxwy = fm->get_indexed_wxwy (k);
          Interval v = b[a];
-         if (!v.empty_b ())
+         if (!v.is_empty ())
            return 2 * (wxwy[a] - v.center()) / v.length ();
        }
     }
index de08af4efa24fd4d97f761159e1321bd4a3d4a8f..9964632f30a68067cf01a7ea356bded13a8f903e 100644 (file)
@@ -92,7 +92,7 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
            }
        }
 
-      if (extents[d].empty_b ())
+      if (extents[d].is_empty ())
        extents[d] = Interval (0,0);
     }
   while (flip (&d) != LEFT);
@@ -108,7 +108,7 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
     FIXED also includes the left part of the right object.
   */
   *fixed =
-    (left_head_wid.empty_b () ? increment :
+    (left_head_wid.is_empty () ? increment :
      /*
        Size of the head:
       */
@@ -122,7 +122,7 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
     /*
       What is sticking out of the right note:
      */
-    + (extents[RIGHT].empty_b() ?  0.0 : - extents[RIGHT][LEFT] / 2);
+    + (extents[RIGHT].is_empty () ?  0.0 : - extents[RIGHT][LEFT] / 2);
 
   /*
     We don't do complicated stuff: (base_space - increment) is the
@@ -327,7 +327,7 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
 
   Real correction = 0.0;
 
-  if (!bar_yextent.empty_b())
+  if (!bar_yextent.is_empty ())
     {
       stem_dirs[RIGHT] = - stem_dirs[LEFT];
       stem_posns[RIGHT] = bar_yextent;
@@ -350,7 +350,7 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
            {
              head_extent = head->extent (rcolumn, X_AXIS);
 
-             if (!head_extent.empty_b())
+             if (!head_extent.is_empty ())
                note_head_width = head_extent[RIGHT];
 
              if (st)
@@ -370,7 +370,7 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
        {
          intersect = stem_posns[LEFT];  
          intersect.intersect(stem_posns[RIGHT]);
-         correct_stem_dirs = correct_stem_dirs && !intersect.empty_b ();
+         correct_stem_dirs = correct_stem_dirs && !intersect.is_empty ();
 
          if (correct_stem_dirs)
            {
@@ -386,7 +386,7 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
                gh_scm2double (me->get_grob_property ("stem-spacing-correction"));
            }
          
-         if (!bar_yextent.empty_b())
+         if (!bar_yextent.is_empty ())
            {
              correction *= 0.5;
            }
@@ -416,7 +416,7 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
       
       Interval hp = head_posns[LEFT];
       hp.intersect  (head_posns[RIGHT]);
-      if (!hp.empty_b())
+      if (!hp.is_empty ())
        return ;
 
       Direction lowest =
index 0aa59eb11d84093bbeedb48db446e9761d2699c8..e9bdc0ec4278ae03953902aed02305824a660f9e 100644 (file)
@@ -108,7 +108,7 @@ Part_combine_music_iterator::change_to (Music_iterator *it, SCM to_type,
      
      If \translator Staff = bass, then look for Staff = *
    */
-  while (current && !current->is_alias_b (to_type))
+  while (current && !current->is_alias (to_type))
     {
       last = current;
       current = current->daddy_trans_;
@@ -355,7 +355,7 @@ s      Consider thread switching: threads "one", "two" and "both".
       thread level!
    */
  
-  if (suffix_.empty_b ())
+  if (suffix_.is_empty ())
     suffix_ = first_iter_->report_to ()
       ->daddy_trans_->id_string_.cut_string (3, INT_MAX);
 
index 57e6f9310af1744f3a61c98f2c8f0603611ade91..776d4baaa6727450440351f8777a343c92901883 100644 (file)
@@ -208,7 +208,7 @@ Rest_collision::do_shift (Grob *me)
       Grob * r = unsmob_grob (rcol->get_grob_property ("rest"));
       Interval restdim = r->extent (r, Y_AXIS);        // ??
 
-      if (restdim.empty_b ())
+      if (restdim.is_empty ())
        return SCM_UNSPECIFIED;
       
 
index 7e3c5ddac6e2bd5ae3131654ad0df95af5a53757..d2744d98c2b609ad425b2aea60947ae9e7764318 100644 (file)
@@ -134,7 +134,7 @@ Rest::brew_internal_molecule (SCM smob)
   Font_metric *fm = Font_interface::get_default_font (me);
   String font_char = glyph_name (me, balltype, style);
   Molecule out = fm->find_by_name (font_char);
-  if (out.empty_b())
+  if (out.is_empty ())
     {
       me->warning (_f ("rest `%s' not found, ", font_char.to_str0 ()));
     }
index ff47fb92f36d70f554bbbfce3bc0bc3edd0887ce..365409461f8f8ec7f21abd3b45ea825960096974 100644 (file)
@@ -13,10 +13,44 @@ Self_alignment_interface::centered_on_parent (SCM element_smob, SCM axis)
   Grob *him = me->get_parent (a);
   Interval he = him->extent (him,a);
   
-  return  gh_double2scm (he.empty_b () ? 0.0 : he.center ());
+  return  gh_double2scm (he.is_empty () ? 0.0 : he.center ());
 }
 
+MAKE_SCHEME_CALLBACK (Self_alignment_interface,aligned_on_parent,2);
+SCM
+Self_alignment_interface::aligned_on_parent (SCM element_smob, SCM axis)
+{
+  Grob *me = unsmob_grob (element_smob);
+  Axis a = (Axis) gh_scm2int (axis);
+  Grob *him = me->get_parent (a);
+  Interval he = him->extent (him,a);
+  
+  SCM sym= (a == X_AXIS) ? ly_symbol2scm ("self-alignment-X"): ly_symbol2scm ("self-alignment-Y");
+  SCM align_prop (me->internal_get_grob_property (sym));
+
+  if (!gh_number_p (align_prop))
+    return gh_int2scm (0);
+
+  Real x = 0.0;
 
+  Real align = gh_scm2double (align_prop);
+      
+  Interval ext (me->extent (me,a));
+  if (ext.is_empty ())
+    {
+      programming_error ("I'm empty. Can't align on self");
+      
+    }
+  else
+    x -= ext.linear_combination (align) ;
+
+  if (!he.is_empty ())
+    {
+      x += he.linear_combination (align);
+    }
+
+  return gh_double2scm (x);
+}
 
 /*
   Position centered on parent.
@@ -31,7 +65,7 @@ Self_alignment_interface::centered_on_other_axis_parent (SCM element_smob,
   Grob *him = me->get_parent (other_axis (a));
   Interval he = him->extent (him,a);
   
-  return  gh_double2scm (he.empty_b () ? 0.0 : he.center ());
+  return  gh_double2scm (he.is_empty () ? 0.0 : he.center ());
 }
 
 
@@ -48,20 +82,15 @@ Self_alignment_interface::aligned_on_self (SCM element_smob, SCM axis)
 {
   Grob *me = unsmob_grob (element_smob);
   Axis a = (Axis) gh_scm2int (axis);
-  static SCM  prop_syms[2];
 
-  if (!prop_syms[0])
-    {
-      prop_syms[X_AXIS] = ly_symbol2scm ("self-alignment-X");
-      prop_syms[Y_AXIS] = ly_symbol2scm ("self-alignment-Y");
-    }
+  SCM sym= (a == X_AXIS) ? ly_symbol2scm ("self-alignment-X"): ly_symbol2scm ("self-alignment-Y");
   
-  SCM align (me->internal_get_grob_property (prop_syms[a]));
+  SCM align (me->internal_get_grob_property (sym));
   if (gh_number_p (align))
     {
       Interval ext (me->extent (me,a));
 
-      if (ext.empty_b ())
+      if (ext.is_empty ())
        {
          programming_error ("I'm empty. Can't align on self");
          return gh_double2scm (0.0);
index 567371967a4e3d42eaffe5c89ac5bea46e5e82f7..cfe9409140b9bc092250b503cca411a8356a8082 100644 (file)
@@ -24,7 +24,7 @@ Separating_group_spanner::find_rods (Item * r, SCM next)
     most cases, the interesting L will just be the first entry of
     NEXT, making it linear in most of the cases.
   */
-  if (Separation_item::width (r).empty_b ())
+  if (Separation_item::width (r).is_empty ())
     return; 
   
   for(; gh_pair_p (next); next = ly_cdr (next))
@@ -36,7 +36,7 @@ Separating_group_spanner::find_rods (Item * r, SCM next)
        {
          Interval li (Separation_item::width (lb));
          Interval ri (Separation_item::conditional_width (r, lb));
-         if (!li.empty_b () && !ri.empty_b())
+         if (!li.is_empty () && !ri.is_empty ())
            {
              Rod rod;
 
@@ -50,7 +50,7 @@ Separating_group_spanner::find_rods (Item * r, SCM next)
 
       Interval li (Separation_item::width (l));
       Interval ri (Separation_item::conditional_width (r, l));
-      if (!li.empty_b () && !ri.empty_b())
+      if (!li.is_empty () && !ri.is_empty ())
        {
          Rod rod;
 
index 3ca590a50044f5ec628b694d09c43cbd38cb99f2..3a9b491789b69ef52899aec74d4e6b60b96a3821 100644 (file)
@@ -108,7 +108,7 @@ Separation_item::width (Grob *me)
        }
 
       Interval iv (il->extent (pc, X_AXIS));
-      if (!iv.empty_b ())
+      if (!iv.is_empty ())
        {
          w.unite (iv);
        }
index 592d53834f02176a937e67e28a57c2c6b2a6b6fa..40a8e0767fe89ac0adaca12342d806007a79771b 100644 (file)
@@ -95,7 +95,7 @@ Side_position_interface::general_side_position (Grob * me, Axis a, bool use_exte
          }
     }
 
-  if (dim.empty_b ())
+  if (dim.is_empty ())
     {
       dim = Interval (0,0);
     }
@@ -199,7 +199,7 @@ Side_position_interface::aligned_side (SCM element_smob, SCM axis)
 
   Interval iv =  me->extent (me, a);
 
-  if (!iv.empty_b ())
+  if (!iv.is_empty ())
     {
       if (!d)
        {
index 1cc6b6877e3405b7e57852303e91d2de1a2b24a6..45938efe0f1f1e6ab7e2a37e83a44e48b381bb8d 100644 (file)
@@ -51,7 +51,7 @@ insert_extent_into_skyline (Array<Skyline_entry> *line, Box b, Axis line_axis,
                            Direction d)
 {
   Interval extent = b[line_axis];
-  if (extent.empty_b())
+  if (extent.is_empty ())
     return;
   
   Real stick_out = b[other_axis (line_axis)][d];
@@ -69,19 +69,19 @@ insert_extent_into_skyline (Array<Skyline_entry> *line, Box b, Axis line_axis,
       
       Real my_height = line->elem(i).height_;
 
-      if (!w.empty_b () &&
+      if (!w.is_empty () &&
          w.length() > EPS
          && d* (my_height - stick_out) < 0)
        {
          Interval e1 (line->elem(i).width_[LEFT], extent[LEFT]);
          Interval e3 (extent[RIGHT], line->elem(i).width_[RIGHT]);
 
-         if (!e3.empty_b () && e3.length() > EPS)
+         if (!e3.is_empty () && e3.length() > EPS)
            line->insert (Skyline_entry (e3, my_height), i+1);
 
          line->elem_ref(i).height_ = stick_out;
          line->elem_ref(i).width_ = w;
-         if (!e1.empty_b () && e1.length() > EPS)
+         if (!e1.is_empty () && e1.length() > EPS)
            line->insert (Skyline_entry (e1, my_height), i );
        }
 
@@ -162,7 +162,7 @@ skyline_meshing_distance (Array<Skyline_entry> const &buildings,
       Interval w = buildings[i].width_;
       w.intersect(clouds[j].width_);
       
-      if (!w.empty_b())
+      if (!w.is_empty ())
        distance = distance >? (buildings[i].height_ - clouds[j].height_);
 
       if (i>0 && buildings[i].width_[LEFT] >=  clouds[j].width_[LEFT])
index 5a42fcb7da3aa590e44cb0224dd4a28387516f4b..713ec88cc39bb02ffb58da207e43f10426f4c314 100644 (file)
@@ -438,7 +438,7 @@ Slur::encompass_offset (Grob*me,
   o[X_AXIS] -= 0.5 * stem_dir * x_extent;
 
   if ((stem_dir == dir)
-      && !stem->extent (stem, Y_AXIS).empty_b ())
+      && !stem->extent (stem, Y_AXIS).is_empty ())
     {
       o[Y_AXIS] = stem->extent (common[Y_AXIS], Y_AXIS)[dir];
     }
index 5e8947b7e96fabbf0efbef2a1c83db0a89b3613b..fc2b4f0dc8e588f5038034b0a1a3252ae725618f 100644 (file)
@@ -79,15 +79,15 @@ Span_bar::brew_molecule (SCM smobbed_me)
       SCM smobbed_staff_bar = ly_car (elts);
       Grob *staff_bar = unsmob_grob (smobbed_staff_bar);
       Interval ext = staff_bar->extent (refp, Y_AXIS);
-      if (ext.empty_b ())
+      if (ext.is_empty ())
        continue; 
       
-      if (!prev_extent.empty_b ())
+      if (!prev_extent.is_empty ())
        {
          Interval l (prev_extent [UP],
                     ext[DOWN]);
 
-         if (l.empty_b ())
+         if (l.is_empty ())
            {
              /* There is overlap between the bar lines.  Do nothing. */
            }
@@ -152,7 +152,7 @@ Span_bar::center_on_spanned_callback (SCM element_smob, SCM axis)
   /* Bar_line::brew_molecule delivers a barline of y-extent (-h/2,h/2), so
      we have to translate ourselves to be in the center of the 
      interval that we span. */
-  if (i.empty_b ())
+  if (i.is_empty ())
     {
       me->suicide ();
       return gh_double2scm (0.0);
@@ -229,7 +229,7 @@ Span_bar::get_bar_size (SCM smob)
 {
   Grob* me =  unsmob_grob (smob);
   Interval iv (get_spanned_interval (me));
-  if (iv.empty_b ())
+  if (iv.is_empty ())
     {
       /* This happens if the bars are hara-kiried from under us. */
       me->suicide ();
index 62bdd7070dbe7cadb3cbf03ecd4d8ba1eab5f24b..f1deb19f64e5f949f5c210d0ae2456442ac7484d 100644 (file)
@@ -60,10 +60,10 @@ Staff_spacing::next_note_correction (Grob * me,
     Let's decrease the space a little if the problem is not located
     after a barline.
   */
-  if (bar_size.empty_b ())
+  if (bar_size.is_empty ())
     max_corr *= 0.75;
   
-  if (!bar_size.empty_b())
+  if (!bar_size.is_empty ())
     if (Grob *stem = Note_column::get_stem (g))
       {
        Direction d = Stem::get_direction (stem);
@@ -163,7 +163,7 @@ Staff_spacing::extremal_break_aligned_grob (Grob *separation_item, Direction d,
 
       Interval ext = break_item->extent (col, X_AXIS);
 
-      if (ext.empty_b ())
+      if (ext.is_empty ())
        continue;
       if (!last_grob
          || (last_grob && d * (ext[d]- (*last_ext)[d]) > 0) )
index d9887cfefd2686f17a5bbbd4066f78bab9c0c513..6d76b3804196580db9f1d415c56df305a884c9bb 100644 (file)
@@ -4,97 +4,83 @@
   source file of the GNU LilyPond music typesetter
   
   (c) 2000--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>, Glen Prideaux <glenprideaux@iname.com>
-  
-  Similar to (and derived from) Instrument_name_engraver.
- */
+
+*/
 
 #include "engraver.hh"
 #include "item.hh"
-#include "bar-line.hh"
+#include "side-position-interface.hh"
 
 class Stanza_number_engraver : public Engraver
 {
   Item *text_;
-  bool bar_b_;
 
-  void create_text (SCM s);
+  /*
+    This is naughty, since last_stanza_ may be GCd from under us.  But
+    since we don't look at the contents, we are/should be (knock on
+    wood) OK.
+   */
+  SCM last_stanza_;
 public:
   TRANSLATOR_DECLARATIONS(Stanza_number_engraver);
-
   virtual void process_music ();
   virtual void stop_translation_timestep ();
+  virtual void acknowledge_grob (Grob_info);
 };
 
 
+/*
+  TODO: should make engraver that collects all the stanzas on a higher
+  level, and then groups them to the side. Stanza numbers should be
+  all aligned.
+ */
 
 Stanza_number_engraver::Stanza_number_engraver ()
 {
   text_ = 0;
-  bar_b_ = false;
 }
 
 void
 Stanza_number_engraver::process_music ()
 {
-  if (gh_string_p (get_property ("whichBar")))
+  SCM stanza = get_property ("stanza");
+  
+  if (gh_string_p (stanza) && stanza != last_stanza_)
     {
-      SCM s = get_property ("stanza");
+      last_stanza_ = stanza;
       
-      if (now_mom () > Moment (0))
-       s = get_property ("stz");
-
-
-      // TODO
-      if (gh_string_p (s) || gh_pair_p (s))
-
-       /*
-         if (i.grob_->internal_has_interface (symbol ("lyric-syllable-interface")))
-
-         Tried catching lyric items to generate stanza numbers, but it
-         spoils lyric spacing.
-
-         Works, but requires bar_engraver in LyricsVoice context apart
-         from at beginning.  Is there any score element we can catch
-         that will do the trick?
-
-         What happens if we try anything at all EXCEPT a lyric? Is
-         there anything else?  Not sure what it's catching, but it
-         still mucks up lyrics.
-
-       */
-
-       create_text (s);
+      text_ = new Item (get_property ("StanzaNumber"));
+      text_->set_grob_property ("text", stanza);
+      announce_grob (text_, SCM_EOL);
     }
 }
 
+
 void
-Stanza_number_engraver::stop_translation_timestep ()
+Stanza_number_engraver::acknowledge_grob (Grob_info inf)
 {
-  if (text_)
+  if (text_
+      && inf.grob_->internal_has_interface (ly_symbol2scm ("lyric-text-interface")))
     {
-      typeset_grob (text_);
-      text_ = 0;
+      Side_position_interface::add_support (text_, inf.grob_);
     }
 }
 
 void
-Stanza_number_engraver::create_text (SCM txt)
+Stanza_number_engraver::stop_translation_timestep ()
 {
-  if (!text_)
+  if (text_)
     {
-      text_ = new Item (get_property ("StanzaNumber"));
-      text_->set_grob_property ("text", txt);
-      announce_grob (text_, SCM_EOL);
+      typeset_grob (text_);
+      text_ = 0;
     }
 }
 
 
-
-
 ENTER_DESCRIPTION(Stanza_number_engraver,
 /* descr */       "",
 /* creats*/       "StanzaNumber",
 /* accepts */     "",
-/* acks  */      "",
-/* reads */       "stz stanza",
+/* acks  */      "lyric-syllable-interface",
+/* reads */       "stanza",
 /* write */       "");
index 6b69ae40923f29494b72633d91ca8d600a5cee83..9899a99fcab60845d838bc817628977b18f93430 100644 (file)
@@ -259,7 +259,7 @@ Stem::get_default_dir (Grob*me)
 {
   int staff_center = 0;
   Interval hp = head_positions (me);
-  if (hp.empty_b())
+  if (hp.is_empty ())
     {
       return CENTER;
     }
@@ -356,7 +356,7 @@ Stem::get_default_stem_end_position (Grob*me)
       if (durlog >= 3)
        {
          Interval flag_ext = flag (me).extent (Y_AXIS) ;
-         if (!flag_ext.empty_b())
+         if (!flag_ext.is_empty ())
            minlen += 2 * flag_ext.length () / ss ;
 
          /*
@@ -646,7 +646,7 @@ Stem::flag (Grob*me)
     flag_style + to_string (dir) + staffline_offs + to_string (duration_log (me));
   Font_metric *fm = Font_interface::get_default_font (me);
   Molecule flag = fm->find_by_name ("flags-" + font_char);
-  if (flag.empty_b ())
+  if (flag.is_empty ())
     {
       me->warning (_f ("flag `%s' not found", font_char));
     }
@@ -655,11 +655,11 @@ Stem::flag (Grob*me)
   if (gh_string_p (stroke_style_scm))
     {
       String stroke_style = ly_scm2string (stroke_style_scm);
-      if (!stroke_style.empty_b ())
+      if (!stroke_style.is_empty ())
        {
          String font_char = to_string (dir) + stroke_style;
          Molecule stroke = fm->find_by_name ("flags-" + font_char);
-         if (stroke.empty_b ())
+         if (stroke.is_empty ())
            {
              me->warning (_f ("flag stroke `%s' not found", font_char));
            }
index ebc42cc15f20a84306c1f9e6aa12089b153e2421..022b3abbf997ec34bd68f197eca02319b8c4cc1b 100644 (file)
@@ -29,7 +29,7 @@ open_file_stream (String filename, int mode)
   else
     {
       Path p = split_path (filename);
-      if (!p.dir.empty_b ())
+      if (!p.dir.is_empty ())
         if (mkdir (p.dir.to_str0 (), 0777) == -1 && errno != EEXIST)
           error (_f ("can't create directory: `%s'", p.dir));
       os = new std::ofstream (filename.to_str0 (), mode);
index 4973d87870c0655c1e31b6855c3f873b97401ece..2a01f3455e9988c44189501319be1478cf91b6b1 100644 (file)
@@ -58,7 +58,7 @@ Sustain_pedal::brew_molecule (SCM smob)
       else
        idx += String (&text.to_bytes ()[i], 1);
       Molecule m = Font_interface::get_default_font (e)->find_by_name (idx);
-      if (!m.empty_b ())
+      if (!m.is_empty ())
        mol.add_at_edge (X_AXIS, RIGHT, m, 0, 0);
     }
     
index 1c68e112d4524fb116781a427a7322914217d317..35bb3aeeebfc5bcf3d3757d9a79a616573621a58 100644 (file)
@@ -87,7 +87,7 @@ System_start_delimiter::after_line_breaking (SCM smob)
        {
          Interval v = unsmob_grob (gh_car (s))->extent (common, Y_AXIS);
 
-         if (!v.empty_b ())
+         if (!v.is_empty ())
            count ++;
        }
   
@@ -118,7 +118,7 @@ System_start_delimiter::brew_molecule (SCM smob)
  (me->self_scm (), gh_int2scm (Y_AXIS)));
   Real l = ext.length () / staff_space;
   
-  if (ext.empty_b ()
+  if (ext.is_empty ()
       || (gh_number_p (c) && l <= gh_scm2double (c)))
     {
       me->suicide ();
@@ -165,7 +165,7 @@ System_start_delimiter::staff_brace (Grob*me, Real y)
     {
       int cmp = (lo + hi) / 2;
       b = fm->get_indexed_char (cmp);
-      if (b[Y_AXIS].empty_b () || b[Y_AXIS].length () > y)
+      if (b[Y_AXIS].is_empty () || b[Y_AXIS].length () > y)
        hi = cmp;
       else
        lo = cmp;
index 8aadfedb6d73b325d52a80a76ac30666b99e3903..4cf53c114a16577c16bfc05377330211598ad160 100644 (file)
@@ -379,7 +379,7 @@ System::post_processing (bool last_line)
     }
 
   Interval i (extent (this, Y_AXIS));
-  if (i.empty_b ())
+  if (i.is_empty ())
     programming_error ("Huh?  Empty System?");
   else
     translate_axis (- i[MAX], Y_AXIS);
index 6de80dd798dc0f3c358319abce192121d30a364d..b441bdf8c94aab95e37bccdd5fc31e67f1d715c3 100644 (file)
@@ -89,7 +89,7 @@ Text_spanner::brew_molecule (SCM smob)
          if (Text_item::markup_p (text)) 
            edge[d] = *unsmob_molecule (Text_item::interpret_markup (paper->self_scm (), properties, text));
          
-         if (!edge[d].empty_b ())
+         if (!edge[d].is_empty ())
            edge[d].align_to (Y_AXIS, CENTER);
        }
       while (flip (&d) != LEFT);
@@ -152,7 +152,7 @@ Text_spanner::brew_molecule (SCM smob)
       m.add_molecule (edge[d]);
       edge_line[d].translate_axis (span_points[d], X_AXIS);
       m.add_molecule (edge_line[d]);
-      if (!ext.empty_b ())
+      if (!ext.is_empty ())
        span_points[d] += -d *  ext[-d];
     }
   while (flip (&d) != LEFT);
index 7f50d89f744f496695fac022aad5a7e237b67629..4c96b217717c58da79a566495aba9180915fe8d5 100644 (file)
@@ -87,7 +87,7 @@ Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d)
   me->set_grob_property ("font-family", ly_symbol2scm ("music"));
   Molecule out = Font_interface::get_default_font (me)
     ->find_by_name ("timesig-" + char_name);
-  if (!out.empty_b ())
+  if (!out.is_empty ())
     return out;
 
   /* If there is no such symbol, we default to the numbered style.
index f34b0c2e76dedcc95ac5f430fc6675bfcc197697..e85ced8d6d905edc9adcd1396b8f0fae8dd201bb 100644 (file)
@@ -35,7 +35,7 @@ Translator_group::properties_dict () const
 Translator_group::~Translator_group ()
 {
   
-  //assert (removable_b ());
+  //assert (is_removable ());
 }
 
 
@@ -59,7 +59,7 @@ Translator_group::check_removal ()
       Translator_group *trg =  dynamic_cast<Translator_group*> (unsmob_translator (ly_car (p)));
 
       trg->check_removal ();
-      if (trg->removable_b ())
+      if (trg->is_removable ())
        terminate_translator (trg);
     }
 }
@@ -99,7 +99,7 @@ Translator_group::add_fresh_group_translator (Translator*t)
 
 
 bool
-Translator_group::removable_b () const
+Translator_group::is_removable () const
 {
   return trans_group_list_ == SCM_EOL && ! iterator_count_;
 }
@@ -107,7 +107,7 @@ Translator_group::removable_b () const
 Translator_group *
 Translator_group::find_existing_translator (SCM n, String id)
 {
-  if ((is_alias_b (n) && (id_string_ == id || id.empty_b ())) || n == ly_symbol2scm ("Current"))
+  if ((is_alias (n) && (id_string_ == id || id.is_empty ())) || n == ly_symbol2scm ("Current"))
     return this;
 
   Translator_group* r = 0;
index 9a7bf5c065fe67a04a2c614ae5d620fb92118c19..ac2d1d5d0aae0c1c44ae903d9ef9f5d8630ffb94 100644 (file)
@@ -113,7 +113,7 @@ LY_DEFINE(ly_translator_find,
   
   while (tr)
     {
-      if (tr->is_alias_b (name))
+      if (tr->is_alias (name))
        return tr->self_scm();
       tr =  tr->daddy_trans_ ;
     }
index 5d4af073f5ff32d27567f01e4ce1098486ae92bf..5c53e35449b59ab372bd2638121d676aa86097cc 100644 (file)
@@ -48,7 +48,7 @@ Translator::Translator (Translator const &s)
 }
 
 bool
-Translator::is_alias_b (SCM sym) const
+Translator::is_alias (SCM sym) const
 {
   Translator_def * td = unsmob_translator_def (definition_);
   bool b  = (sym == td->type_name_);
index 1bf489302c0486aa0a602a5cd8afa7d5872ca0fa..11b431c5aefaabaa1d06a732bde461d13b72c194 100644 (file)
@@ -54,7 +54,7 @@ Molecule
 Virtual_font_metric::find_by_name (String glyph) const
 {
   Molecule m;  
-  for (SCM s = font_list_; m.empty_b () && gh_pair_p (s); s = gh_cdr (s))
+  for (SCM s = font_list_; m.is_empty () && gh_pair_p (s); s = gh_cdr (s))
     {
       m = unsmob_metrics (gh_car (s))->find_by_name (glyph);
     }
@@ -121,7 +121,7 @@ Virtual_font_metric::name_to_index (String glyph) const
 {
   Molecule m;
   int total = 0; 
-  for (SCM s = font_list_; m.empty_b () && gh_pair_p (s); s = gh_cdr (s))
+  for (SCM s = font_list_; m.is_empty () && gh_pair_p (s); s = gh_cdr (s))
     {
       Font_metric *m =unsmob_metrics (gh_car (s));
       int k = m->name_to_index (glyph);
index 01f27a16d2ece462507686af6ac23d8bfa52dcd0..708fd03967375e1be8ad547a8a8970df792da711 100644 (file)
@@ -311,6 +311,7 @@ LyricsVoiceContext= \translator{
        \consists "Extender_engraver"
        \consists "Hyphen_engraver"
        \consists "Stanza_number_engraver"
+       \consists "Instrument_name_engraver"
        \consists "Skip_event_swallow_translator"
        phrasingPunctuation = #".,:!?\""
        SeparationItem \set #'padding = #0.5
index a132929ac94aa07dd31d58c1f21480c978328aca..875faf5b5a5f298de38ee09ecb33bdee6e7b7de2 100644 (file)
        ))
 
     (LyricText
-     . (
-       (molecule-callback . ,Text_item::brew_molecule)
-       (X-offset-callbacks . (,Self_alignment_interface::centered_on_parent
-                              ,Self_alignment_interface::aligned_on_self))
+     . ((molecule-callback . ,Text_item::brew_molecule)
+       (X-offset-callbacks . (,Self_alignment_interface::aligned_on_parent))
        (self-alignment-X . 0)
        (word-space . 0.6)
        (ignore-length-mismatch . #f)
        ))
 
     (StanzaNumber
-     . (
-       (breakable . #t)
-       (molecule-callback . ,Text_item::brew_molecule)         
-       (break-align-symbol . clef)
-       (break-visibility . ,begin-of-line-visible)
+     . ((molecule-callback . ,Text_item::brew_molecule)                
        (font-family . roman)
-       (meta . ((interfaces . (break-aligned-interface text-interface font-interface item-interface ))))               
+       (font-series . bold)
+       (padding . 1.5)
+       (X-offset-callbacks . (,Side_position_interface::aligned_side))
+       (direction . ,LEFT) 
+       (meta . ((interfaces . (text-interface font-interface item-interface ))))               
        ))
 
     (StaffSpacing
index 2fd1825b49097caa03b6da51704cb48062690119..b3abc1366dcae1d2971c323906180f5fca3393de 100644 (file)
@@ -319,7 +319,6 @@ top of those automatically detected. ")
 (translator-property-description 'melismaBusyProperties list?
                                 "List of  properties (symbols) to
 determine whether a melisma  is playing.")
-(translator-property-description 'melismaEngraverBusy boolean? "See melismaBusy. This is set automatically.")
 (translator-property-description 'metronomeMarkFormatter procedure?
                                 "How to produce a metronome markup.
 Called with 2 arguments,  event and context.")
@@ -407,7 +406,8 @@ squashing for Pitch_squash_engraver.")
 (translator-property-description 'stringOneTopmost boolean? "Whether the 1st string is printed on the
 top line of the tablature.")
 (translator-property-description 'stavesFound list? "list of all staff-symbols found.")
-(translator-property-description 'stanza markup? "Stanza `number' to print at start of a verse. Use in LyricsVoice context.")
+(translator-property-description 'stanza markup? "Stanza `number' to
+print before the start of a verse. Use in LyricsVoice context.")
 (translator-property-description 'stemLeftBeamCount integer? "
 Specify the number of beams to draw on the left side of the next note.
 Overrides automatic beaming.  The value is only used once, and then it
@@ -415,7 +415,6 @@ is erased.
 .")
 (translator-property-description 'stemRightBeamCount integer? "idem, for the right side.")
 (translator-property-description 'stringTunings list? "The tablature strings tuning. Must be a list of the different semitons pitch of each string (starting by the lower one).")
-(translator-property-description 'stz markup? "Abbreviated form for a stanza, see also Stanza property.")
 (translator-property-description 'subdivideBeams boolean? "If set, multiple beams will be subdivided at beat
 positions - by only drawing one beam over the beat.")
 (translator-property-description 'systemStartDelimiter symbol? "Which grob to make for the start of the system/staff?")
index b3b107fd1fb443628d156ef526d2663a80e0382e..bdcce0cb976efdc7009d560f9e176dd3bab6338c 100644 (file)
@@ -1620,6 +1620,12 @@ def conv (str):
 
 conversions.append (((2,1,2), conv, """ly:get-music-length -> ly:music-length"""))
 
+def conv (str):
+       str =re.sub (r"\.\s+stz=", ". instr ", str)
+       return str
+
+conversions.append (((2,1,2), conv, """ly:get-music-length -> ly:music-length"""))
+
 ################################
 #      END OF CONVERSIONS      
 ################################