]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.9.jcn3: herhaling
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 1 Dec 1998 21:59:30 +0000 (22:59 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 1 Dec 1998 21:59:30 +0000 (22:59 +0100)
pl 9.jcn3
- property: unfoldRepeats; unfolding still broken
- volta spanner y-collision
- bf: volta number,dot placement
- bf's: init/table16,20
- small additions to init/lily.scm to enable some testing
- junked extra repeat braces

18 files changed:
NEWS
VERSION
init/lily.scm
init/table16.ly
init/table20.ly
input/test/repeat.ly
input/test/star.ly
input/test/unfold.ly [new file with mode: 0644]
lily/include/repeated-music-iterator.hh
lily/include/repeated-music.hh
lily/include/volta-spanner.hh
lily/lookup.cc
lily/parser.yy
lily/repeat-engraver.cc
lily/repeated-music-iterator.cc
lily/repeated-music.cc
lily/volta-spanner.cc
ps/lily.ps

diff --git a/NEWS b/NEWS
index 0da4d944416af46bad464a31821e1e5c7fb2b2d0..e732d25ea0eaded9f1354fd0e27a3300996f159e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,11 @@
+pl 9.jcn3
+       - property: unfoldRepeats; unfolding still broken
+       - volta spanner y-collision
+       - bf: volta number,dot placement
+       - bf's: init/table16,20
+       - small additions to init/lily.scm to enable some testing
+       - junked extra repeat braces
+
 pl 9.jcn2
        - bf/redo: slur.cc, encompass-info: setting of encompass array.  
        - switched tuplet-engaver off (core dumps)
diff --git a/VERSION b/VERSION
index 0b426ed3f58c33bb8a19177a6f678772729338ca..998430bb87b44f25d7e55d2c75a959b0bd0dd31e 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=9
-MY_PATCH_LEVEL=jcn2
+MY_PATCH_LEVEL=jcn3
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index a0bc2888e7300d2a23187f0d5894a8f9da17cc24..2497324dea736e4e01f51589d4c3b84333742c2a 100644 (file)
 
 (define emptybar empty1)
 (define setdynamic empty1)
-(define settext empty1)
-(define setnumber empty1)
+(define (settext s) (text "text" s))
+(define (setnumber s) (text "number" s))
+(define repeatbar empty1)
+(define startrepeat empty1)
 
+(define (setbold s) (text "bold" s))
+(define (setnumber-1 s) (text "numberj" s))
 
 ;;;;;;;; TeX
 
index a7c974e8f2d5fa210651d582fcb57fd4dba323bc..b2a6813d9f2a8b2be71ccd0b7e1d5472133d4d39 100644 (file)
@@ -12,14 +12,14 @@ table_sixteen=
    % index symbol #parameters          xmin xmax ymin ymax
 
      "style" = \table {
-               "bold"  "setbold"       1                       0.0\pt  7.50\pt 0.0\pt  8.0\pt
+               "bold"  "setbold"       1               0.0\pt  7.50\pt 0.0\pt  8.0\pt
                "dynamic"       "setdynamic"    1       0.0\pt  0.0\pt  0.0\pt  8.0\pt
                "finger"        "setfinger"     1       0.0\pt  2.0\pt  0.0\pt  4.0\pt
                "italic"        "setitalic"     1       0.0\pt  4.\pt   0.0\pt  8.0\pt
                "typewriter"    "settypewriter" 1       0.0\pt  4.\pt   0.0\pt  8.0\pt
                "large" "setlarge"      1                       0.0\pt  9.50\pt 0.0\pt  10.0\pt
                "number"        "setnumber"     1       0.0\pt  6.0\pt  0.0\pt  8.0\pt
-               "number-1"      "setnumber-1"   1       0.0\pt  4.0\pt  0.0\pt  6.0\pt
+               "number-1"      "setnumber-1"   1       0.0\pt  4.0\pt  0.0\pt  5.0\pt
                "roman" "settext"       1                       0.0\pt  4.5\pt  0.0\pt  8.0\pt
      }
      "dynamics" = \table {
index ab27995a36ab44bca8810a0d2dca188a0e582eba..ccb9bcbef43186663b676939b400a5301f5b30c9 100644 (file)
@@ -12,7 +12,7 @@ table_twenty =
     % index symbol #parameters         xmin xmax ymin ymax
 
      "style" = \table {
-               "bold"  "setbold"       1       0.0\pt  5.50\pt 0.0\pt  8.0\pt
+               "bold"  "setbold"       1       0.0\pt  5.50\pt 0.0\pt  10.0\pt
                "dynamic"       "setdynamic"    1       0.0\pt  0.0\pt  0.0\pt  10.0\pt
                "finger"        "setfinger"     1       0.0\pt  4.5\pt  0.0\pt  5.0\pt
                "typewriter"    "settypewriter" 1       0.0\pt  5.5\pt  0.0\pt  10.0\pt
@@ -21,7 +21,7 @@ table_twenty =
                "Large" "setLarge"      1       0.0\pt  6.50\pt 0.0\pt  12.0\pt
                "mark"  "setmark"       1       0.0\pt  6.50\pt 0.0\pt  12.0\pt
                "number"        "setnumber"     1       0.0\pt  8.0\pt  0.0\pt  10.0\pt
-               "number-1"      "setnumber-1"   1       0.0\pt  6.0\pt  0.0\pt  8.0\pt
+               "number-1"      "setnumber-1"   1       0.0\pt  6.0\pt  0.0\pt  7.0\pt
                "roman" "settext"       1       0.0\pt  5.6\pt  0.0\pt  10.0\pt
      }
 
index f4dbf0feb98f6a179ec0969aedbe532c2bad123e..914b665f96b10e62094228e048525e15e57ec660 100644 (file)
@@ -1,13 +1,13 @@
 \score{
        <
-                 \type Staff \notes\relative c''
-                         c c c c 
-                         \repeat 2 { { d d d d } }
-                         \alternative { { a a a a } { a a a a } }
+                 \type Staff \notes\relative c'{ 
+                         c d e f
+                         \repeat 2 { g a b c }
+                         \alternative { { c b a g } { f e d c } }
                  }
                  \type Lyrics \lyrics {
                          De eer- ste < { maat } { moet } >
-                         \repeat 2 { { } } 
+                         \repeat 2 { }
                          \alternative < 
                                  { en dan twee keer } 
                                  { een koe- plet _ } 
index f498e0bf4df34a8e2c4499cb46bd5c06b05b15f1..ffd911404b64a31e8f0ffd91c4bc3199bfbb989e 100644 (file)
@@ -15,8 +15,8 @@ copyright="public domain";
 
 $staff1_voice_1 = \notes {
   [a8.()fis16] 
-  \repeat 2 { d4 fis4 a4 d'2 [fis'8. e'16] d'4 fis4 gis4 a2 [a8 a8]
-  fis'4. e'8 d'4 cis'2 [b8. cis'16] d'4 d'4 a4 } }
+  \repeat 2 { d4 fis4 a4 d'2 [fis'8. e'16] d'4 fis4 gis4 a2 [a8 a8]
+  fis'4. e'8 d'4 cis'2 [b8. cis'16] d'4 d'4 a4 }
   \alternative { { fis4 d4 [a8. fis16] } { fis4 d4 [fis'8.  fis'16] } } 
   fis'4 g'4 a'4 a'2 [g'8 fis'8] e'4 fis'4
   g'4 g'2 g'4 fis'4. e'8 d'4 cis'2 [b8. cis'16] d'4 fis4 gis4 a2 a4
@@ -27,8 +27,8 @@ $staff1_voice_1 = \notes {
 
 $staff1_voice_2 = \notes { 
   [a8.()fis16] 
-  \repeat 2 { a,4 d4 e4 d4~fis4 [fis8. fis16] fis4 d4 d4 cis2
-  [e8 e8] a4. a8 a4 a2 [a8. a16] a4 a4 a4 } }
+  \repeat 2 { a,4 d4 e4 d4~fis4 [fis8. fis16] fis4 d4 d4 cis2
+  [e8 e8] a4. a8 a4 a2 [a8. a16] a4 a4 a4 }
   \alternative { { fis4 d4 [a8. fis16] } { fis4 d4 r4 } }
   a4 a4 d'4 d'2 [a8 a8] cis'4 cis'4 cis'4 cis'2 a4 a4. a8 a4 a2
   [a8. a16] d4 d4 d4 cis2 e4 fis4 e4 d4 d4 d4 dis4 g4 [g8()dis8] e4 e2
@@ -37,8 +37,8 @@ $staff1_voice_2 = \notes {
 
 $staff2_voice_1 = \notes { 
   r4 
-  \repeat 2 { fis4 a4 a4 b2 [cis'8. cis'16] b4 b4 b4 a2 [cis'8 cis'8]
-  d'4. cis'8 d'4 e'2 [e'8. e'16] d'4 d'4 a4 } }
+  \repeat 2 { fis4 a4 a4 b2 [cis'8. cis'16] b4 b4 b4 a2 [cis'8 cis'8]
+  d'4. cis'8 d'4 e'2 [e'8. e'16] d'4 d'4 a4 }
   \alternative { { fis4 d4 r4  } { fis4 d4 r4 } }
   d4 e4 fis4 fis'2 [e'8 d'8] e'4 e'4 e'4 e'2 cis'4  d'4. cis'8 d'4 e'2
   [e'8. e'16] a4 a4 e4 e2 cis'4 a4 a4 a4 g4 g4 b4 b4 b4 b4 a2
@@ -48,8 +48,8 @@ $staff2_voice_1 = \notes {
 
 $staff2_voice_2 = \notes { 
   r4 
-  \repeat 2 { d4 d4 cis4 b,2 [ais,8. ais,16] b,4 b,4 e4 a,2 [a8 a8] 
-  d4. e8 [fis8 g8] a2 [g8. g16] fis4 fis4 a4 } }
+  \repeat 2 { d4 d4 cis4 b,2 [ais,8. ais,16] b,4 b,4 e4 a,2 [a8 a8] 
+  d4. e8 [fis8 g8] a2 [g8. g16] fis4 fis4 a4 }
   \alternative { { fis4 d4 r4 } { fis4 d4 r4 } } 
   d4 d4 d4 d2 [d8 d8] a4 a4 a4 a2 a,4 d4. e8 [fis8 g8] a2 [g8. g16] 
   fis4 d4 e4 a,2 a4 d4 e4 fis4 g4 g4 fis4 e4 [e8()fis8] [g8()gis8] a2 
@@ -57,7 +57,7 @@ $staff2_voice_2 = \notes {
 }
 
 $text = \lyrics{
-  Oh4 __ \repeat 2 { { } } 
+  Oh4 __ \repeat 2 { }
   \alternative < 
   { say. can you see,2 by8. the16 dawn's4 ear- ly light2 What8
   so8 proud-4. ly8 we4 hailed,2 At8. the16 twi-4 light's last gleam-
diff --git a/input/test/unfold.ly b/input/test/unfold.ly
new file mode 100644 (file)
index 0000000..20ae554
--- /dev/null
@@ -0,0 +1,8 @@
+\score{
+       \type Staff \notes\relative c'' {
+       % doesn't quite work yet
+       %       \property Staff.unfoldRepeats = 1
+               \repeat 3 { a b c d } 
+               \alternative { { d c b a } { a b c d } } d d d d
+       }
+}
index 5495440493b635c7783ff10dbfc2d3b0c2c09e73..1e8c48a2d4671586b9721650c8f2d6afa816c524 100644 (file)
@@ -29,6 +29,10 @@ protected:
   virtual void do_process_and_next (Moment);
 
 private:
+  void start_next_element ();
+
+  int unfold_i_;
+  Moment here_mom_;
   Music_iterator* repeat_iter_p_;
   Music_list_iterator* alternative_iter_p_;
 };
index 1528f5810b195c2d9375a15c826e81d9ac1e1510..6175d45864782b4d7026d1283fa791fd313614aa 100644 (file)
@@ -19,11 +19,10 @@ class Repeated_music : public Music
 {
 public:
   int repeats_i_;
+  bool unfold_b_;
   Music* repeat_p_;
-//  Music_list* alternative_p_;
   Music_sequence* alternative_p_;
 
-//  Repeated_music (Music*, int n, Music_list*);
   Repeated_music (Music*, int n, Music_sequence*);
   Repeated_music (Repeated_music const& s);
   virtual ~Repeated_music ();
index c250189af087165e152f17d60c291fffa3a2963f..1a9a2803c457c02937fa5754ac1ff4db9fb155b0 100644 (file)
@@ -18,13 +18,13 @@ class Volta_spanner : public Directional_spanner
 public:
   Volta_spanner ();
  
-//  void add_column (Note_column*);
+  void add_column (Note_column*);
   void add_column (Bar*);
  
   P<Text_def>  number_p_;
   P<Text_def>  dot_p_;
-//  Link_array<Note_column> column_arr_;
   Link_array<Bar> column_arr_;
+  Link_array<Note_column> note_column_arr_;
   bool last_b_;
  
 protected:
index c6ce6f6297695c029ea744f83d5de844367e77a0..813d0049435d04115e1b16a33e06b2de1221eff9 100644 (file)
@@ -521,7 +521,8 @@ Lookup::volta (Real w, bool last_b) const
                       SCM_UNDEFINED);
   a.str_ = "volta";
   Real interline_f = paper_l_->interline_f ();
-  a.dim_[Y_AXIS] = Interval (-interline_f / 2, interline_f / 2);
+//  a.dim_[Y_AXIS] = Interval (0, 2 * interline_f);
+  a.dim_[Y_AXIS] = Interval (-interline_f, interline_f);
   a.dim_[X_AXIS] = Interval (0, w);
   return a;
 }
index 64c9dd8bae3ba872d1365d55b42b721cb5514b5a..c0c2230014ec3ed3c409b1a1801baa3406ff17ed 100644 (file)
@@ -47,7 +47,7 @@
 
 // mmm
 Mudela_version oldest_version ("1.0.7");
-Mudela_version version ("1.0.10");
+Mudela_version version ("1.0.11");
 
 
 // needed for bison.simple's malloc() and free()
@@ -290,7 +290,7 @@ yylex (YYSTYPE *s,  void * v_l)
 %type <trans>  translator_spec translator_spec_body
 %type <tempo>  tempo_request
 %type <notenametab> notenames_body notenames_block
-%expect 3
+%expect 4
 
 
 %left '-' '+'
@@ -747,11 +747,10 @@ Alternative_music: {
        }
        ;
 
-Repeated_music: REPEAT unsigned '{' Music '}' Alternative_music        {
-               // s/r conflicts -> '{' '}' 
-               Music_sequence* m = dynamic_cast <Music_sequence*> ($6);
+Repeated_music: REPEAT unsigned Music Alternative_music        {
+               Music_sequence* m = dynamic_cast <Music_sequence*> ($4);
                assert (m);
-               $$ = new Repeated_music ($4, $2, m);
+               $$ = new Repeated_music ($3, $2 >? 1, m);
        }
        ;
 
index 2502e60f3e3641bec421844f3449dcff4a0e54a7..a28a3caedc08c44c1ed4cf5545a0fb99d70258f2 100644 (file)
@@ -16,7 +16,7 @@
 #include "repeated-music.hh"
 #include "time-description.hh"
 #include "volta-spanner.hh"
-//#include "note-column.hh"
+#include "note-column.hh"
 
 ADD_THIS_TRANSLATOR (Repeat_engraver);
 
@@ -29,6 +29,10 @@ Repeat_engraver::do_try_music (Music* m)
 {
   if (Repeated_music* r = dynamic_cast<Repeated_music *> (m))
     {
+      r->unfold_b_ = get_property ("unfoldRepeats").to_bool ();
+      if (r->unfold_b_)
+        return true;
       Moment stop_mom = now_moment () + r->repeat_p_->duration () 
         + r->alternative_p_->music_p_list_p_->top ()->duration ();
       Moment alt_mom = now_moment () + r->repeat_p_->duration ();
@@ -63,7 +67,12 @@ void
 Repeat_engraver::acknowledge_element (Score_element_info i)
 {
   Moment now = now_moment ();
-//  if (Note_column *c = dynamic_cast<Note_column *> (i.elem_l_))
+  if (Note_column *c = dynamic_cast<Note_column *> (i.elem_l_))
+    {
+      for (int i = 0; i < volta_p_arr_.size (); i++)
+        if ((now >= alternative_start_mom_arr_[i]) && volta_p_arr_[i])
+         volta_p_arr_[i]->add_column (c);
+    }
   if (Bar *c = dynamic_cast<Bar*> (i.elem_l_))
     {
       for (int i = 0; i < volta_p_arr_.size (); i++)
index 5faf0880e7fcf3166b1c2fd60579c09034bc90af..8c6982ce7beb85b6febaa9fb96c5590d37b94ef7 100644 (file)
@@ -17,6 +17,12 @@ Repeated_music_iterator::Repeated_music_iterator ()
 {
   repeat_iter_p_ = 0;
   alternative_iter_p_ = 0;
+  here_mom_ = 0;
+#if 0
+  unfold_i_ = repeated_music_l ()->unfold_b_ ? 
+    repeated_music_l ()->repeats_i_ - 1 : 0;
+#endif
+  unfold_i_ = -1; 
 }
 
 Repeated_music_iterator::~Repeated_music_iterator ()
@@ -35,6 +41,10 @@ Repeated_music_iterator::do_print () const
 void
 Repeated_music_iterator::construct_children ()
 {
+#if 0
+  unfold_i_ = repeated_music_l ()->unfold_b_ ? 
+    repeated_music_l ()->repeats_i_ - 1 : 0;
+#endif
   repeat_iter_p_ = get_iterator_p (repeated_music_l ()->repeat_p_);  
 }
 
@@ -48,10 +58,9 @@ Repeated_music_iterator::do_process_and_next (Moment m)
        music_l_->warning ( _("No one to print a volta bracket"));
     }
   if (repeat_iter_p_ && repeat_iter_p_->ok ())
-    repeat_iter_p_->process_and_next (m);
+    repeat_iter_p_->process_and_next (m - here_mom_);
   else
-    alternative_iter_p_->process_and_next (m - 
-      repeated_music_l ()->repeat_p_->duration ());
+    alternative_iter_p_->process_and_next (m - here_mom_);
   Music_iterator::do_process_and_next (m);
 }
 
@@ -59,49 +68,31 @@ Moment
 Repeated_music_iterator::next_moment () const
 {
   if (repeat_iter_p_)
-    return repeat_iter_p_->next_moment ();
+    return repeat_iter_p_->next_moment () + here_mom_;
   else if (alternative_iter_p_)
-//    return alternative_iter_p_->next_moment ();
-    return alternative_iter_p_->next_moment () + 
-      repeated_music_l ()->repeat_p_->duration ();
-// return 0;
-  return repeated_music_l ()->repeat_p_->duration ();
+    return alternative_iter_p_->next_moment () + here_mom_;
+  // huh?
+//  return repeated_music_l ()->repeat_p_->duration () 
+//    * Moment (repeated_music_l ()->repeats_i_)
+//   + repeated_music_l ()->alternative_p_->duration () + here_mom_;
+  return repeated_music_l ()->alternative_p_->duration () + here_mom_;
 }
 
 bool
 Repeated_music_iterator::ok () const
 {
-#if 0
-  if (repeat_iter_p_)
-    return repeat_iter_p_->ok ();
-  else if (alternative_iter_p_)
-    return alternative_iter_p_->ok ();
-  return false;
-#elif 0
-  if (repeat_iter_p_ && repeat_iter_p_->ok ())
-    return true;
-  else if (!alternative_iter_p_)
+  if (!repeat_iter_p_ && !alternative_iter_p_)
+    return false;
+
+  if ((repeat_iter_p_ && repeat_iter_p_->ok ())
+    || (alternative_iter_p_ && alternative_iter_p_->ok ()))
     return true;
-  return alternative_iter_p_->ok ();
-#else // perhaps iterating stops because we return false on repeat_iter...
-  if (repeat_iter_p_)
-    {
-      if (repeat_iter_p_->ok ())
-        return true;
-      else
-        {
-         // urg, we're const
-         Repeated_music_iterator *urg = (Repeated_music_iterator*)this;
-         delete urg->repeat_iter_p_;
-         urg->repeat_iter_p_ = 0;
-         urg->alternative_iter_p_ = dynamic_cast<Music_list_iterator*>
-           (get_iterator_p ((Music*)repeated_music_l ()->alternative_p_));  
-       }
-    }
-  if (alternative_iter_p_)
-    return alternative_iter_p_->ok ();
-  return false;
-#endif
+
+  Repeated_music_iterator *urg = (Repeated_music_iterator*)this;
+  // urg, we're const
+  urg->start_next_element ();
+
+  return ok ();
 }
 
 Repeated_music*
@@ -110,3 +101,44 @@ Repeated_music_iterator::repeated_music_l () const
   return (Repeated_music*)Music_iterator::music_l_;
 }
 
+void
+Repeated_music_iterator::start_next_element ()
+{
+  if (repeat_iter_p_)
+    {
+      assert (!repeat_iter_p_->ok ());
+      assert (!alternative_iter_p_);
+      delete repeat_iter_p_;
+      repeat_iter_p_ = 0;
+      alternative_iter_p_ = dynamic_cast<Music_list_iterator*>
+       (get_iterator_p ((Music*)repeated_music_l ()->alternative_p_));  
+      here_mom_ += repeated_music_l ()->repeat_p_->duration ();
+    }
+  else if (alternative_iter_p_)
+    {
+      assert (!alternative_iter_p_->ok ());
+      assert (!repeat_iter_p_);
+      delete alternative_iter_p_;
+      alternative_iter_p_ = 0;
+      if (unfold_i_ < 0)
+       unfold_i_ = repeated_music_l ()->unfold_b_ ? 
+         repeated_music_l ()->repeats_i_ - 1 : 0;
+      if (unfold_i_)
+        {
+         unfold_i_--;
+         repeat_iter_p_ = get_iterator_p (repeated_music_l ()->repeat_p_);
+         // urg, assume same length alternatives for now...
+//       here_mom_ += repeated_music_l ()->alternative_p_->music_p_list_p_->top ()->duration ();
+         /*
+           URG
+           this is *wrong* but at least it doesn't dump core
+           when unfolding, the alternative (sequential) music 
+           shouldn't automatically move to the next alternative
+
+           how to intercept this...
+          */
+         here_mom_ += repeated_music_l ()->alternative_p_->duration ();
+       }
+    }
+}
+
index a3751c38cb4538501c766e029c2933cc344c1c7d..1bbd2be8c25d2f046456e63aa882998a39b3a8b1 100644 (file)
 #include "repeated-music.hh"
 #include "musical-pitch.hh"
 
-//Repeated_music::Repeated_music (Music* r, int n, Music_list* a)
 Repeated_music::Repeated_music (Music* r, int n, Music_sequence* a)
 {
   repeats_i_ = n;
+  unfold_b_ = false;
   repeat_p_ = r;
   alternative_p_ = a;
 }
@@ -29,7 +29,6 @@ Repeated_music::Repeated_music (Repeated_music const& s)
 {
   repeat_p_ = (s.repeat_p_) ? s.repeat_p_->clone () : 0;
   // urg?
-//  alternative_p_ = (s.alternative_p_) ? dynamic_cast <Music_list*> (s.alternative_p_->clone ()) : 0;
   alternative_p_ = (s.alternative_p_) ? dynamic_cast <Music_sequence*> (s.alternative_p_->clone ()) : 0;
 }
 
index 86a16e1c324fb04026d01fb23042f05192ba62de..d40848a56ea1c301a67e4ccf7b000a2a3fdae1aa 100644 (file)
@@ -11,7 +11,7 @@
 #include "debug.hh"
 #include "lookup.hh"
 #include "molecule.hh"
-//#include "note-column.hh"
+#include "note-column.hh"
 #include "p-col.hh" // urg
 #include "bar.hh"
 #include "p-col.hh"
@@ -40,27 +40,34 @@ Volta_spanner::brew_molecule_p () const
 {
   Molecule* mol_p = new Molecule;
 
-  if (column_arr_.size ()){
-    Real dx = paper ()->internote_f ();
-    Real w = width ().length () - 2 * dx;
-    Real dy = column_arr_.top ()->extent (Y_AXIS) [dir_] > 
-      column_arr_[0]->extent (Y_AXIS) [dir_];
-    dy += 4;
+  if (column_arr_.size ())
+    {
+      Real internote_f = paper ()->internote_f ();
+      Real dx = internote_f;
+      Real w = width ().length () - 2 * dx;
+      Atom volta (lookup_l ()->volta (w, last_b_));
+      Real h = volta.dim_.y ().length ();
+      Atom num (number_p_->get_atom (paper (), LEFT));
+      Atom dot (dot_p_->get_atom (paper (), LEFT));
+      Real dy = column_arr_.top ()->extent (Y_AXIS) [dir_] > 
+       column_arr_[0]->extent (Y_AXIS) [dir_];
+      dy += 2 * h;
+      for (int i = 0; i < note_column_arr_.size (); i++)
+        dy = dy >? note_column_arr_[i]->height ().max ();
+      dy -= h;
 
-    Atom num (number_p_->get_atom (paper (), LEFT));
-    Atom dot (dot_p_->get_atom (paper (), LEFT));
-    Real gap = num.dim_.x ().length () / 2;
-    Offset off (num.dim_.x ().length () + gap, 
-      num.dim_.y ().length () - 4 - gap / paper ()->internote_f ());
-    // urg?
-    off -= Offset (0, num.dim_.y ().length () + gap / paper ()->internote_f ());
-    num.translate (off);
-    dot.translate (off);
-    mol_p->add_atom (num);
-    mol_p->add_atom (dot);
-    mol_p->add_atom (lookup_l ()->volta (w, last_b_));
-    mol_p->translate (Offset (dx, dy));
-  }
+      Real gap = num.dim_.x ().length () / 2;
+      Offset off (num.dim_.x ().length () + gap, 
+        (h - num.dim_.y ().length ()) / internote_f - gap);
+      num.translate (off);
+      Real dotheight = dot.dim_.y ().length () / 7;
+      off -= Offset (0, dotheight);
+      dot.translate (off);
+      mol_p->add_atom (volta);
+      mol_p->add_atom (num);
+      mol_p->add_atom (dot);
+      mol_p->translate (Offset (dx, dy));
+    }
   return mol_p;
 }
   
@@ -87,17 +94,23 @@ Volta_spanner::do_post_processing ()
 void
 Volta_spanner::do_substitute_dependency (Score_element* o, Score_element* n)
 {
-//  if (Note_column* c = dynamic_cast <Note_column*> (o))
-//    column_arr_.substitute (c, dynamic_cast<Note_column*> (n));
-  if (Bar* c = dynamic_cast <Bar*> (o))
+  if (Note_column* c = dynamic_cast <Note_column*> (o))
+    note_column_arr_.substitute (c, dynamic_cast<Note_column*> (n));
+  else if (Bar* c = dynamic_cast <Bar*> (o))
     column_arr_.substitute (c, dynamic_cast<Bar*> (n));
 }
   
 void
-//Volta_spanner::add_column (Note_column* c)
 Volta_spanner::add_column (Bar* c)
 {
   column_arr_.push (c);
   add_dependency (c);
 }
 
+void
+Volta_spanner::add_column (Note_column* c)
+{
+  note_column_arr_.push (c);
+  add_dependency (c);
+}
+
index d8cf6e5e42281c624bde9043fb4edac70c34e594..26b1fbc219ccfe64f6503f2914162434559d6d02 100644 (file)
        /volta_w exch def
        staffheight 2 div /volta_h exch def
        volta_t setlinewidth
+% urg: the only Level-2 PS, check effect in print
+%      true setstrokeadjust
+       1 setlinecap
+       1 setlinejoin
        0 0 moveto
        0 volta_h lineto
        volta_w volta_h lineto