]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.1.38
authorfred <fred>
Tue, 26 Mar 2002 21:48:48 +0000 (21:48 +0000)
committerfred <fred>
Tue, 26 Mar 2002 21:48:48 +0000 (21:48 +0000)
82 files changed:
Documentation/tex/refman.yo
NEWS
flower/include/axes.hh
input/test/hara-kiri.ly
input/test/incipit.ly [new file with mode: 0644]
input/test/script-column.fly [new file with mode: 0644]
lily/afm-reader.cc
lily/axis-align-item.cc
lily/axis-group-spanner.cc
lily/clef-engraver.cc
lily/clef-item.cc
lily/collision.cc
lily/command-request.cc
lily/direction.cc
lily/dynamic-engraver.cc
lily/extender-engraver.cc
lily/g-script-column-engraver.cc [new file with mode: 0644]
lily/g-script-column.cc [new file with mode: 0644]
lily/g-script-engraver.cc [new file with mode: 0644]
lily/g-script.cc [new file with mode: 0644]
lily/g-staff-side.cc
lily/g-stem-staff-side.cc [new file with mode: 0644]
lily/g-text-item.cc
lily/identifier.cc
lily/include/axis-align-item.hh
lily/include/axis-group-spanner.hh
lily/include/clef-item.hh
lily/include/command-request.hh
lily/include/g-script-column.hh [new file with mode: 0644]
lily/include/g-script-engraver.hh [new file with mode: 0644]
lily/include/g-script.hh [new file with mode: 0644]
lily/include/g-staff-side.hh
lily/include/g-stem-staff-side.hh [new file with mode: 0644]
lily/include/g-text-item.hh
lily/include/identifier.hh
lily/include/lily-proto.hh
lily/include/line-of-score.hh
lily/include/lookup.hh
lily/include/ly-symbols.hh
lily/include/musical-request.hh
lily/include/note-column.hh
lily/include/paper-outputter.hh
lily/include/request.hh
lily/include/rhythmic-column-engraver.hh
lily/include/score-element.hh
lily/include/stem.hh
lily/include/super-element.hh
lily/include/tuplet-spanner.hh
lily/include/volta-spanner.hh
lily/line-of-score.cc
lily/lookup.cc
lily/lyric-performer.cc
lily/multi-measure-rest.cc
lily/music-output-def.cc
lily/musical-request.cc
lily/my-lily-parser.cc
lily/note-column.cc
lily/p-score.cc
lily/paper-outputter.cc
lily/parser.yy
lily/repeat-engraver.cc
lily/request.cc
lily/rest-collision.cc
lily/rhythmic-column-engraver.cc
lily/score-element.cc
lily/score-engraver.cc
lily/slur-engraver.cc
lily/slur.cc
lily/spanner.cc
lily/stem.cc
lily/super-element.cc
lily/text-engraver.cc
lily/time-signature-performer.cc
lily/tuplet-engraver.cc
lily/tuplet-spanner.cc
lily/volta-spanner.cc
ly/declarations.ly
ly/engraver.ly
ly/script.ly
mf/feta-bolletjes.mf
scm/lily.scm
scm/script.scm [new file with mode: 0644]

index 251d65d461d6ad185a7c3d14a87873159eae1d57..2eba7062cde74a28b6394aba2be4571431cf4fb3 100644 (file)
@@ -1080,7 +1080,8 @@ mudela(center)(
            \clef baritone; c'4_"\kern -10mm baritone"
            \clef varbaritone; c'4^"\kern -10mm varbaritone"
            \clef tenor;     c'4_"\kern -10mm tenor"
-           \clef "G_8";   c'4^"\kern -6mm G\_8"  }  
+%           \clef "G_8";   c'4^"\kern -6mm G\_8"  %%% BROKEN!
+   }  
    \paper{ linewidth= 4.5 \in; }
 }
 )
@@ -1573,13 +1574,18 @@ mudela(fragment,center)(
 }
 )
 
-COMMENT(Broken!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)
+dit(code(restStyle)) Change the layout of rests shorter than quarter notes. 
+Currently, the standard layout code(restStyle="") and mensural notation
+code(restStyle="mensural") are available.
 
+dit(code(clefStyle)) Determines how clefs are typeset. When set to
+code(transparent), the clefs are not printed at all, when set to
+code(fullSizeChanges), clef changes in the middle of a line are
+typeset with a full size clef. By default, clef changes are typeset in
+smaller size.
 
 )
    
-
-
 subsubsubsect(GrandStaff properties)
 
 description( 
diff --git a/NEWS b/NEWS
index 8c09cf7b0ee006dd4ab6f3316fd8dc6beea7c7be..00ccefc1932cf850f864cd36b72aa8f9f83b7e56 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,45 @@
+pl 37.script2
+       - bf: AFM for BlueSky AFM files.
+       - \penalty = 4278 -> \penalty 4278
+       - URG!! fixed major (unnoticed) bug in dependency engine
+       - Further Script hacking:
+         * G_script_column
+         * G_script_column_engraver
+
+  pl 37.script1
+       - major Script rehack:
+         * G_stem_staff_side_item
+         * G_script
+         * G_script_engraver
+         * G_script_req
+       - junked Text_def, changed \property textstyle -> \property textStyle
+(todo -> convert-mudela)
+       - Line_of_score is an Axis_group_element, no more overlapping
+lines, hopefully.
+       - mf: whole diamond head tweak 
+  
+pl 37.mb2
+       - Added property clefStyle: "" / "transparent" / "fullSizeChanges"
+       - New example: input/test/incipit.ly
+       - Documented clefStyle and restStyle in refman.tex
+       - Partial bug fix: octaviated clefs. Still broken!!!
 
-       - diamond heads (probably really ugly).
-       - cross head.
-       - tweaked harmonic head a bit.
-       - property noteHeadStyle
+pl 37.mb1
+       - Added property restStyle. 
+       - mensural 4th, 8th and 16th rests.
+pl 37.uu1
+       - FreeBSD bf
+
+****
+pl 37 (march 30, 1999)
+       - note head styles, see input/test/noteheadstyle.fly
+         * \property noteHeadStyle:
+         * diamond note heads (probably really ugly)
+         * cross note head.
+         * harmonic head (mf sources were tweaked)
+         * transparent for no \heads
+         * \property noteHeadStyle ="" for normal heads.
 
 pl 36.mb2
        - bf: timeSignatureStyle
@@ -13,11 +50,12 @@ pl 36.hwn1
        - debian fixes.
        - don't insert extra alignment space for empty stuff.
        - Align_element derives from Axis_group_element
+       - junk cruft for detecting upbeam / downbeam.
        - junk all *{horizontal,vertical}* Score_element derived classes.
        - G_staff_side_item::padding_f_ now generic property.
        - some tweaking of beam & stem. 
        - junk pointerlist in Sources
-       - junk Stem::mult_i_, Stem::beam_gap_i_, G_staff_side_item::padding
+       - junk Stem::mult_i_, Stem::beam_gap_i_, G_staff_side_item::padding
        Bar::at_line_start_b_, Key_item::c_position_, Note_head::type_str_,
        Note_head::staff_size, Stem::xdir_
        
index dfacac28a1a9527e61113e9393c387db66eb96b1..b67eb47766a9d98bbf16f16bcf237856409e24ba 100644 (file)
@@ -16,13 +16,11 @@ enum Axis {
     NO_AXES=2,
 };
 
-#ifndef STANDALONE
 
 #include "string.hh"           // ugh
 
 String axis_name_str (Axis);
 
-#endif // STANDALONE
 
 /**
   the operator ++ for Axis. 
index 3acad5cad57c7bbd297e5a205b8a7711e4c2fe31..bdfbe78404b187d9f79d7082b52cd261651ffee7 100644 (file)
@@ -29,7 +29,7 @@ toeters = \type Staff = toeters <
        \toeter_ii
 >
  
-zager = \type Staff = zager \notes \relative c {
+zager = \type Staff = zager \notes \relative c'' {
        \clef bass;
        \property Staff.instrument = "Zager"
        \property Staff.instr = "Zag."
@@ -45,7 +45,7 @@ zager = \type Staff = zager \notes \relative c {
        f e d c
 }
 
-zoger = \type Staff = zoger \notes \relative c {
+zoger = \type Staff = zoger \notes \relative c'' {
        \clef bass;
        \property Staff.instrument = "Zoger"
        \property Staff.instr = "Zog."
@@ -76,7 +76,7 @@ zagers = \type GrandStaff <
        >
        \paper{
                linewidth = 40.0\mm;
-               \translator { \HaraKiriStaffContext }
+%              \translator { \HaraKiriStaffContext }
 %uh?
 %              \translator { \OrchestralScoreContext }
 %              \translator { \OrchestralPartStaffContext }
diff --git a/input/test/incipit.ly b/input/test/incipit.ly
new file mode 100644 (file)
index 0000000..150367d
--- /dev/null
@@ -0,0 +1,36 @@
+%{
+ Test of how to make an ``incipit'' to indicate scordatora 
+ tuning of a violin part, using the clefStyle property.
+ The two first bars of Biber's Rosary sonata III.
+
+   /Mats B
+%}
+
+\version "1.0.14";
+
+incipit = \notes\relative c'{
+  <b1 fis' b d>
+}
+
+violin = \notes\relative c''{
+  \specialkey \keysignature f' fis'' g' gis'';
+  \time 2/2;
+
+  a4. b8 c4 fis |
+  gis~ gis8 fis16^\trill ()e b8 c \type Staff<{\voiceone a d}{\voicetwo es,4}>|
+}
+
+\score{
+  \notes{
+    \property Staff.clefStyle = "transparent" 
+    \incipit 
+    \property Staff.clefStyle = "fullSizeChanges" \clef "treble"; \bar "";
+    \violin
+  }
+  \paper{
+    \translator{\StaffContext
+      timeSignatureStyle = "C";
+    }
+  }
+}  
+
diff --git a/input/test/script-column.fly b/input/test/script-column.fly
new file mode 100644 (file)
index 0000000..381c5fb
--- /dev/null
@@ -0,0 +1,3 @@
+%c''4^|^.^"foo"^"klap"
+c''4^|^.^"foo"^"klap"^"puk"^\fermata^\stopped
+c4_|_._"foo"_"klap"_"puk"_\fermata_\stopped
index 5a606bd28d79a585aca2ca5611d43a2adccba825..7663aab22b392f0902ad1ca7041eb9df1f7eba80 100644 (file)
@@ -47,6 +47,8 @@ read_char_metric (String s, int size)
       String c = strip_leading_white (a[i]);
 
       Array<String> b = String_convert::split_arr (c, ' ');
+      if (!b.size ())
+       continue;
       if (b[0] == "C")
        char_metric.C_ = b[1].value_i ();
       else if (b[0] == "WX")
@@ -71,7 +73,10 @@ Adobe_font_metric::read_char_metrics (Data_file &input, int size)
       Adobe_font_char_metric afm_char =read_char_metric (s, size);
       char_metrics_.push (afm_char);
       int i = char_metrics_.size ()-1;
-      ascii_to_metric_idx_ [afm_char.C_] = i;
+
+      // TFM files uses neg.  charcodes to store Space
+      if (afm_char.C_ >= 0)
+       ascii_to_metric_idx_ [afm_char.C_] = i;
       name_to_metric_dict_ [afm_char.N_] = i;
     }
 }
index a8859ba5886546f120671762bc427b9a823f7191..8990872b212ad9c655ee723770917d00b4cb5ac4 100644 (file)
@@ -1,5 +1,5 @@
 /*   
-  axis-align-item.cc --  implement 
+  axis-align-item.cc --  implement Axis_align_item
   
   source file of the GNU LilyPond music typesetter
   
@@ -12,3 +12,9 @@
 Axis_align_item::Axis_align_item ()
 {
 }
+
+void
+Axis_align_item::do_print () const
+{
+  Axis_group_item::do_print ();
+}
index 58214f51378b51387793665c6706196400957fbb..b625c6c6b3dcba2916213f0fbafba461e64d697e 100644 (file)
@@ -34,15 +34,24 @@ Axis_group_spanner::do_break_processing_if_unbroken()
                item_l->find_prebroken_piece (my_line);
              add_element (broken_item_l);
            }
-         remove_element (elems[i]);  
+
+         Spanner *spanner_l = dynamic_cast<Spanner*> (elems[i]);
+         if (spanner_l)
+           {
+             Spanner *broken_spanner_l =
+               spanner_l->find_broken_piece (my_line);
+             add_element (broken_spanner_l);
+           }
+         remove_element (elems[i]);
        }
+      
     }
 }
 
 void
 Axis_group_spanner::do_break_processing()
 {
-  DOUT << "do_break_processing ()\n";
+
   bool breaking_self_b = ! Spanner::line_l();
   if (!breaking_self_b)  
     {
index da300420b16aaf5bec51984711142df57f764449..0e0c79cc84ecd06f0953cf1c2496af2fb1a77049 100644 (file)
@@ -190,6 +190,11 @@ Clef_engraver::create_clef()
     {
       Clef_item *c= new Clef_item;
       c->set_elt_property (break_priority_scm_sym, gh_int2scm (-2)); // ugh
+      String clefstyle = get_property ("clefStyle", 0);
+      if (clefstyle.length_i ())
+       c->set_elt_property (style_scm_sym,
+                            gh_str02scm (clefstyle.ch_C()));
+      
       announce_element (Score_element_info (c, clef_req_l_));
       clef_p_ = c;
     }
index 282bd535ec9ac13fdad2f71b848d1e289b6bb2b3..2e6564003980975521a89b4afeade0449d0915b8 100644 (file)
@@ -19,10 +19,15 @@ void
 Clef_item::do_pre_processing()
 {
   dim_cache_[Y_AXIS].translate (y_position_i_ * staff_line_leading_f () / 2.0);
-  if (break_status_dir() != RIGHT)
-    {
-      symbol_ += "_change";    
-    }
+  SCM style_sym =get_elt_property (style_scm_sym);
+  String style;
+  if (style_sym != SCM_BOOL_F)
+    style = ly_scm2string (SCM_CDR(style_sym));
+  
+  if (break_status_dir() != RIGHT && style != "fullSizeChanges")
+    symbol_ += "_change";
+  if (style == "transparent")
+    set_elt_property (transparent_scm_sym, SCM_BOOL_T);
 }
 
 /*
@@ -46,7 +51,7 @@ Clef_item::do_add_processing ()
       SCM octave_dir = remove_elt_property (octave_dir_scm_sym);
       if (octave_dir != SCM_BOOL_F)
        {
-         Direction d = Direction (gh_int2scm (SCM_CDR(octave_dir)));
+         Direction d = Direction (gh_scm2int (SCM_CDR(octave_dir)));
          g = new G_text_item;
          pscore_l_->typeset_element (g);
       
index 706301aad1bd674051a19744d6dc528106a0e4fd..56676c1d9938e1f4a324a8d003b91e37f5290d89 100644 (file)
@@ -19,7 +19,6 @@ Collision::Collision()
 void
 Collision::add_column (Note_column* ncol_l)
 {
-  // ugh.  Fixme.
   clash_l_arr_.push (ncol_l);
   add_element (ncol_l);
   add_dependency (ncol_l);
@@ -33,7 +32,7 @@ int idx (int dir, bool h_shift_b)
   assert (abs (dir) == 1);
   int j = dir > 0 ? 0 : 3;
   if (h_shift_b)
-       j += dir;
+    j += dir;
   return j;
 }
 
@@ -49,22 +48,22 @@ void
 Collision::do_pre_processing()
 {
   if (clash_l_arr_.size() <= 1)
-       return;
+    return;
 
   /*
     [stem up, stem up shifted, stem down shifted, stem down]
-    */
+  */
   Array<Note_column*> clash_group_arr_a[4];
 
   for (int i=0; i < clash_l_arr_.size(); i++)
     {
       Note_column* c_l = clash_l_arr_[i];
-      if (! c_l->dir_)
+      Direction d = c_l->dir ();
+      if (!d)
        {
          warning (_ ("No stem direction set. Ignoring column in clash."));
          continue;
        }
-      int d = (c_l->dir_);
 
       SCM shift = c_l->remove_elt_property (horizontal_shift_scm_sym);
       bool shift_b  = (shift != SCM_BOOL_F);
@@ -130,6 +129,7 @@ Collision::do_pre_processing()
        x_off[idx (d, true)] = d *1.0 ;
     } while ((d *= -1) != 1);
 
+
   if (!middle.empty_b()
       && middle.length() < 2 && col_l_a[idx (1,0)] && col_l_a[idx (-1,0)]) {
     // reproduction of bugfix at 3am ?
@@ -151,13 +151,8 @@ Collision::do_pre_processing()
     {
       if (col_l_a[j])
        {
-         /* collision.cc:138: request for method `translate' is ambiguous
-
-            (shaddup)
-            */
          Offset o (x_off[j] * wid_f, 0);
          col_l_a[j]->translate (o);
-         //      ((Score_element*)col_l_a[j])->translate (o);
        }
     }
 }
index 904c74da9a315bc6ccdbc170e6ed7cad4f3ac8ec..84ff56f9f7f86c33a9859eb14d2a22986610c04b 100644 (file)
 #include "debug.hh"
 #include "musical-request.hh"
 
-void
-Command_script_req::do_print() const
-{}
-Command_script_req::Command_script_req(){}
-Command_script_req::~Command_script_req(){}
-
-
-
-
-
-
 void
 Cadenza_req::do_print() const
 {
@@ -58,14 +47,11 @@ Bar_req::do_equal_b (Request*r) const
 void
 Bar_req::do_print() const
 {
+#ifndef NPRINT
   DOUT << type_str_;
+#endif
 }
 
-void
-Bracket_req::do_print () const
-{
-  Span_req::do_print ();
-}
 
 Bar_req::Bar_req (String s)
 {
@@ -87,21 +73,6 @@ Partial_measure_req::do_equal_b (Request* r) const
 
 
 
-
-void
-Timing_req::do_print() const{}
-
-
-
-
-void
-Command_req::do_print() const{}
-
-
-
-void
-Barcheck_req::do_print() const{}
-
 bool
 Barcheck_req::do_equal_b (Request*r) const
 {
@@ -109,9 +80,6 @@ Barcheck_req::do_equal_b (Request*r) const
   return b;
 }
 
-
-
-
 void
 Clef_change_req::do_print() const
 {
@@ -125,11 +93,6 @@ Clef_change_req::Clef_change_req (String s)
   clef_str_ = s;
 }
 
-
-
-
-
-
 void
 Partial_measure_req::do_print() const
 {
@@ -184,11 +147,6 @@ Tempo_req::do_equal_b (Request *r) const
   return t&& t->dur_.length_mom ()== dur_.length_mom () && metronome_i_ == t->metronome_i_;
 }
 
-
-
-
-
-
 void
 Measure_grouping_req::do_print() const
 {
@@ -333,13 +291,6 @@ Break_req::Break_req ()
   penalty_i_ = 0;
 }
 
-void
-Break_req::do_print () const
-{
-}
-
-
-
 Mark_req::Mark_req (String s)
 {
   str_ = s;
index a0ac3e6bbf8ffe785ea9e4badc1eef1ab14db8e1..f4b46b1f5eae3b83b3f45b65664526a0fd32e299 100644 (file)
@@ -9,8 +9,8 @@
 
 #include "direction.hh"
 
-#if 0 
-String direction_str (Direction d, Axis a)
+String
+direction_str (Direction d, Axis a)
 {
   String s("center");
   if (a == Y_AXIS)
@@ -23,4 +23,3 @@ String direction_str (Direction d, Axis a)
     }
   return s;
 }
-#endif
index f3e72a2df31370eded624203e3c8332490d3a6eb..e2188d4eb7e3c0cce8c5a0067addb9d178f7d923 100644 (file)
@@ -101,6 +101,9 @@ Dynamic_engraver::do_process_requests()
          text_p_->style_str_ = prop.length_i () ? prop :  "dynamic";
 
          staff_side_p_ = new G_staff_side_item;
+         staff_side_p_->set_elt_property (script_priority_scm_sym,
+                                          gh_int2scm (100));
+                                          
          staff_side_p_->set_victim (text_p_);
          staff_side_p_->axis_ = Y_AXIS;
          
index f0478bebe2a7678b079543dddd1e07a83e85af63..1f616ec7951d674babd835f43069020e40c55085 100644 (file)
@@ -8,7 +8,6 @@
 #include "musical-request.hh"
 #include "extender-engraver.hh"
 #include "extender-spanner.hh"
-#include "text-def.hh"
 #include "score-column.hh"
 #include "g-text-item.hh"
 
diff --git a/lily/g-script-column-engraver.cc b/lily/g-script-column-engraver.cc
new file mode 100644 (file)
index 0000000..831f28b
--- /dev/null
@@ -0,0 +1,93 @@
+/*   
+  g-script-column-engraver.cc --  implement G_script_column_engraver
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "engraver.hh"
+#include "g-script-column.hh"
+#include "g-staff-side.hh"
+
+/**
+   Find potentially colliding scripts, and put them in a
+   G_script_column, that will fix the collisions.  */
+class G_script_column_engraver : public Engraver
+{
+  G_script_column *scol_p_;
+  Link_array<Item> script_l_arr_;
+  Link_array<G_staff_side_item> staff_side_l_arr_;  
+public:
+  G_script_column_engraver ();
+  VIRTUAL_COPY_CONS(Translator);
+protected:
+  virtual void acknowledge_element (Score_element_info);
+  virtual void process_acknowledged ();
+  virtual void  do_pre_move_processing ();
+  virtual void  do_post_move_processing ();
+};
+
+
+G_script_column_engraver::G_script_column_engraver()
+{
+  scol_p_ =0;
+}
+
+void
+G_script_column_engraver::do_pre_move_processing ()
+{
+  if (scol_p_)
+    {
+      typeset_element (scol_p_);
+      scol_p_ =0;
+    }
+}
+
+void
+G_script_column_engraver::do_post_move_processing ()
+{
+  script_l_arr_.clear ();
+  staff_side_l_arr_.clear ();
+}
+
+void
+G_script_column_engraver::acknowledge_element( Score_element_info inf) 
+{
+  Item *thing =  dynamic_cast<Item*>(inf.elem_l_);
+  if (!thing)
+    return;
+  
+  Dimension_cache * parcache = thing->dim_cache_[Y_AXIS].parent_l_;
+  if (!parcache || !thing)
+    return ;
+  
+  Graphical_element *parent = parcache->element_l ();
+
+  if (G_staff_side_item * ss = dynamic_cast<G_staff_side_item*>(parent))
+    {
+      if (!ss->breakable_b ())
+       {
+         script_l_arr_.push (thing);
+       }
+    }
+}
+
+void
+G_script_column_engraver::process_acknowledged ()
+{
+  if (!scol_p_ && script_l_arr_.size () > 1)
+    {
+      scol_p_ = new G_script_column;
+      announce_element (Score_element_info (scol_p_, 0));
+    }
+
+  if (scol_p_)
+    {
+      for (int i=0; i < script_l_arr_.size (); i++)
+       scol_p_->add_staff_sided (script_l_arr_[i]);
+      script_l_arr_.clear ();
+    }
+}
+ADD_THIS_TRANSLATOR(G_script_column_engraver);
diff --git a/lily/g-script-column.cc b/lily/g-script-column.cc
new file mode 100644 (file)
index 0000000..d6f3d8b
--- /dev/null
@@ -0,0 +1,76 @@
+/*   
+  g-script-column.cc --  implement G_script_column
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+#include "g-script-column.hh"
+#include "g-staff-side.hh"
+
+static G_staff_side_item *
+get_g_staff_side (Item *i)
+{
+  Graphical_element *e1 = i->dim_cache_[Y_AXIS].parent_l_->element_l ();
+
+  return dynamic_cast<G_staff_side_item*>(e1);
+}
+
+void
+G_script_column::add_staff_sided (Item *i)
+{
+  SCM p = get_g_staff_side (i)->get_elt_property (script_priority_scm_sym);
+  if (p == SCM_BOOL_F)
+    return;
+  
+  staff_sided_item_l_arr_.push (i);
+  add_dependency (i);
+}
+
+static int
+staff_side_compare (Item * const &i1,
+                   Item * const &i2)
+{
+  Score_element *e1 = get_g_staff_side (i1);
+  Score_element *e2 = get_g_staff_side (i2);
+
+  SCM p1 = e1->get_elt_property (script_priority_scm_sym);
+  SCM p2 = e2->get_elt_property (script_priority_scm_sym);
+
+  return gh_scm2int (SCM_CDR(p1)) - gh_scm2int (SCM_CDR(p2));
+}
+
+void
+G_script_column::do_pre_processing ()
+{
+  Drul_array<Link_array<Item> > arrs;
+
+  for (int i=0; i < staff_sided_item_l_arr_.size (); i++)
+    {
+      G_staff_side_item * ip = get_g_staff_side (staff_sided_item_l_arr_[i]);
+      arrs[ip->dir_].push (staff_sided_item_l_arr_[i]);
+    }
+
+  Direction d = DOWN;
+  do {
+    Link_array<Item> &arr(arrs[d]);
+    
+    arr.sort (staff_side_compare);
+
+    Item * last = 0;
+    for (int i=0; i < arr.size (); i++)
+      {
+       G_staff_side_item * gs = get_g_staff_side (arr[i]);
+       if (last)
+         {
+           gs->add_support (last);
+           gs->add_support (get_g_staff_side (last));
+         }
+           
+       gs->remove_elt_property (script_priority_scm_sym);
+       last = arr[i];
+      }
+    
+  } while (flip (&d) != DOWN);
+}
diff --git a/lily/g-script-engraver.cc b/lily/g-script-engraver.cc
new file mode 100644 (file)
index 0000000..7ddb4f7
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+  script-engraver.cc -- implement G_script_engraver
+
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "g-script-engraver.hh"
+#include "g-script.hh"
+#include "g-stem-staff-side.hh"
+#include "musical-request.hh"
+#include "stem.hh"
+#include "staff-symbol.hh"
+#include "rhythmic-head.hh"
+
+G_script_engraver::G_script_engraver()
+{
+  do_post_move_processing();
+}
+
+bool
+G_script_engraver::do_try_music (Music *r_l)
+{
+  if (Articulation_req *mr = dynamic_cast <Articulation_req *> (r_l))
+    {
+      for (int i=0; i < script_req_l_arr_.size(); i++) 
+       {
+         if (script_req_l_arr_[i]->equal_b (mr))
+           return true;
+       }
+      script_req_l_arr_.push (mr);
+      return true;
+    }
+  return false;
+}
+
+void
+G_script_engraver::do_process_requests()
+{
+  for (int i=0; i < script_req_l_arr_.size(); i++)
+    {
+      Articulation_req* l=script_req_l_arr_[i];
+
+
+      SCM list = gh_eval_str (("(articulation-to-scriptdef \"" + l->articulation_str_ + "\")").ch_C());
+      
+      if (list == SCM_BOOL_F)
+       {
+         l->warning(_f("don't know how to interpret articulation `%s'\n",
+                       l->articulation_str_.ch_C()));
+         continue;
+       }
+      G_script *p =new G_script;
+      G_stem_staff_side_item * ss =new G_stem_staff_side_item;
+      list = SCM_CDR (list);
+         
+      p->indices_drul_[LEFT] = ly_scm2string(SCM_CAAR (list));
+      p->indices_drul_[RIGHT] = ly_scm2string(SCM_CDAR (list));
+      list = SCM_CDR(list);
+      bool follow_staff = gh_scm2bool (SCM_CAR(list));
+      list = SCM_CDR(list);
+      int relative_stem_dir = gh_scm2int (SCM_CAR(list));
+      list = SCM_CDR(list);
+      int force_dir =gh_scm2int (SCM_CAR(list));
+      list = SCM_CDR(list);
+      SCM priority = SCM_CAR(list);
+
+      if (relative_stem_dir)
+         ss->relative_dir_ = relative_stem_dir;
+      else
+         ss->dir_ = force_dir;
+
+      if (l->dir_)
+       ss->dir_ = l->dir_;
+
+      ss->staff_support_b_ = !follow_staff;
+      p->set_staff_side (ss);
+      ss->set_elt_property (script_priority_scm_sym, priority);
+      ss->set_elt_property (padding_scm_sym, gh_double2scm(1.0));
+      script_p_arr_.push (p);
+      staff_side_p_arr_.push (ss);
+      
+      announce_element (Score_element_info (p, l));
+      announce_element (Score_element_info (ss, l));
+    }
+}
+
+void
+G_script_engraver::acknowledge_element (Score_element_info inf)
+{
+  if (Stem *s = dynamic_cast<Stem*>(inf.elem_l_))
+    {
+      for (int i=0; i < staff_side_p_arr_.size(); i++)
+       if (G_stem_staff_side_item * ss = dynamic_cast<G_stem_staff_side_item*>(staff_side_p_arr_[i]))
+         {
+           ss->set_stem (s);
+           ss->add_support (s);
+         }
+    }
+  else if (Rhythmic_head * rh = dynamic_cast<Rhythmic_head*>(inf.elem_l_))
+    {
+      for (int i=0; i < staff_side_p_arr_.size(); i++)
+       {
+         G_staff_side_item * ss = dynamic_cast<G_staff_side_item*>(staff_side_p_arr_[i]);
+         
+         if (!ss->dim_cache_[X_AXIS].parent_l_)
+           {
+             ss->dim_cache_[X_AXIS].parent_l_ = &inf.elem_l_->dim_cache_[X_AXIS];
+           }
+         ss->add_support (rh);
+       }
+    }  
+}
+
+void
+G_script_engraver::do_pre_move_processing()
+{
+  for (int i=0; i < script_p_arr_.size(); i++) 
+    {
+      typeset_element (script_p_arr_[i]);
+      typeset_element (staff_side_p_arr_[i]);
+    }
+  script_p_arr_.clear();
+  staff_side_p_arr_.clear ();
+}
+
+void
+G_script_engraver::do_post_move_processing()
+{
+  script_req_l_arr_.clear();
+}
+
+
+
+ADD_THIS_TRANSLATOR(G_script_engraver);
+
diff --git a/lily/g-script.cc b/lily/g-script.cc
new file mode 100644 (file)
index 0000000..867bcf7
--- /dev/null
@@ -0,0 +1,75 @@
+/*   
+  g-script.cc --  implement G_script
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+/*
+
+  TODO: Quantisation support (staccato dots between stafflines)
+
+*/
+#include "debug.hh"
+#include "g-script.hh"
+#include "lookup.hh"
+#include "g-staff-side.hh"
+
+G_script::G_script ()
+{
+  staff_side_l_ =0;
+}
+
+void
+G_script::do_substitute_element_pointer (Score_element*o, Score_element*n)
+{
+  if (o == staff_side_l_)
+    staff_side_l_ = dynamic_cast<G_staff_side_item*>(n);
+}
+
+
+
+Molecule
+G_script::get_molecule(Direction d) const
+{
+  return lookup_l ()->afm_find ("scripts-" + indices_drul_[d]);
+}
+
+
+void
+G_script::do_pre_processing ()
+{
+  Graphical_element * e
+    = staff_side_l_->dim_cache_[X_AXIS].parent_l_->element_l();
+  translate_axis (e->extent (X_AXIS).center (), X_AXIS);
+}
+
+void
+G_script::do_post_processing ()
+{
+  Direction d =  staff_side_l_->dir_;
+  Molecule m (get_molecule(d));
+  translate_axis (- m.dim_[Y_AXIS][Direction (-d)], Y_AXIS);
+}
+
+void
+G_script::set_staff_side (G_staff_side_item*g)
+{
+  staff_side_l_ = g;
+  add_dependency (g);
+  dim_cache_[Y_AXIS].parent_l_ = & g->dim_cache_[Y_AXIS];
+}
+
+Molecule*
+G_script::do_brew_molecule_p () const
+{
+  return new Molecule (get_molecule (staff_side_l_->dir_));
+}
+
+void
+G_script::do_print () const
+{
+  DOUT << "Indices: " << indices_drul_[LEFT] << ", " << indices_drul_[RIGHT];
+}
index 20812e55ad33b661c37cd42cd5f563cca3758050..4d74c166283821b48e5b45d53b6a501013db391f 100644 (file)
@@ -9,31 +9,33 @@
 
 #include "g-staff-side.hh"
 #include "staff-symbol.hh"
+#include "debug.hh"
 
 G_staff_side_item::G_staff_side_item ()
 {
   dir_ = CENTER;
   to_position_l_ = 0;
   set_elt_property (transparent_scm_sym, SCM_BOOL_T);
-
+  staff_support_b_ = true;
   axis_ = Y_AXIS;
 }
 
 
+
 void
 G_staff_side_item::do_pre_processing ()
 {
   if (!dir_)
-    set_default_direction ();
+    dir_ = get_default_direction ();
 
   if (axis_ == X_AXIS)
     position_self ();
 }
 
-void
-G_staff_side_item::set_default_direction ()
+Direction
+G_staff_side_item::get_default_direction () const
 {
-  dir_ = DOWN;
+  return DOWN;
 }
 
 
@@ -66,6 +68,7 @@ G_staff_side_item::do_substitute_element_pointer (Score_element*o, Score_element
 void
 G_staff_side_item::position_self ()
 {
+
   Interval dim;
   Dimension_cache *common = 0;
   if (support_l_arr_.size ())
@@ -85,15 +88,21 @@ G_staff_side_item::position_self ()
       dim = Interval(0,0);
       common = dim_cache_[axis_].parent_l_;
     }
-  Interval sym_dim = to_position_l_->extent (axis_);
+
+  
+  Interval sym_dim
+    = to_position_l_
+    ? to_position_l_->extent (axis_)
+    : Interval(0,0);
+
   Real off = dim_cache_[axis_].relative_coordinate (common);
 
-  SCM pad =   remove_elt_property (padding_scm_sym);
+  SCM pad = remove_elt_property (padding_scm_sym);
   if (pad != SCM_BOOL_F)
     {
-      off -= gh_scm2double (SCM_CDR(pad)) * dir_;
+      off += gh_scm2double (SCM_CDR(pad)) * dir_;
     }
-  dim_cache_[axis_].set_offset (dim[dir_] - sym_dim[-dir_] - off);
+  dim_cache_[axis_].set_offset (dim[dir_] - sym_dim[-dir_] + off);
 }
 
 void
@@ -107,8 +116,38 @@ G_staff_side_item::do_post_processing ()
 void
 G_staff_side_item::do_add_processing ()
 {
-  if (axis_ == Y_AXIS && staff_symbol_l ())
+  if (staff_support_b_
+      && axis_ == Y_AXIS && staff_symbol_l ())
     {
       add_support (staff_symbol_l ());
     }
 }
+
+Interval
+G_staff_side_item::do_height () const
+{
+  Interval i;
+  if (to_position_l_)
+    return to_position_l_->extent (Y_AXIS);
+  return i;
+}
+
+Interval
+G_staff_side_item::do_width () const
+{
+  Interval i;
+  if (to_position_l_)
+    return to_position_l_->extent (X_AXIS);
+  return i;
+}
+void
+G_staff_side_item::do_print () const
+{
+#ifndef NPRINT
+  if (to_position_l_)
+    DOUT << "positioning " << to_position_l_->name();
+
+  DOUT << "axis == " << axis_name_str (axis_)
+       << ", dir == " << to_str (dir_ );
+#endif
+}
diff --git a/lily/g-stem-staff-side.cc b/lily/g-stem-staff-side.cc
new file mode 100644 (file)
index 0000000..446e064
--- /dev/null
@@ -0,0 +1,55 @@
+/*   
+  g-stem-staff-side.cc --  implement G_stem_staff_side
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#include "g-stem-staff-side.hh"
+#include "stem.hh"
+
+G_stem_staff_side_item::G_stem_staff_side_item ()
+{
+  stem_l_ =0;
+  relative_dir_ = CENTER;
+}
+
+void
+G_stem_staff_side_item::do_substitute_element_pointer (Score_element*o,
+                                                      Score_element*n)
+{
+  if (o == stem_l_)
+    {
+      stem_l_ = dynamic_cast<Stem*> (n);
+    }
+}
+
+void
+G_stem_staff_side_item::set_stem (Stem*s)
+{
+  stem_l_ =s;
+  add_dependency (s);
+}
+
+
+Direction
+G_stem_staff_side_item::get_default_direction () const
+{
+  return relative_dir_ * stem_l_->dir_;
+}
+
+void
+G_stem_staff_side_item::do_pre_processing ()
+{
+  SCM p = remove_elt_property (padding_scm_sym);
+  if (p != SCM_BOOL_F && stem_l_)
+    {
+      p = SCM_CDR (p);
+      set_elt_property (padding_scm_sym,
+                       gh_double2scm(stem_l_->staff_line_leading_f ()
+                                     * gh_scm2double (p)));
+    }
+  G_staff_side_item :: do_pre_processing ();
+}
index 1854e96c5b3de513f80cdfe5af6ffb8a6a86a8c3..6f54c2ad0a427d3b249f39bc417f622b1ec47b4d 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "g-text-item.hh"
-
+#include "debug.hh"
 #include "molecule.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
@@ -25,3 +25,9 @@ G_text_item::G_text_item ()
 {
   style_str_ = "roman";
 }
+
+void
+G_text_item::do_print () const
+{
+  DOUT <<  "text= " << text_str_;
+}
index bf9205579f4a742c7be2029ec37a7ab557e3d9dc..8419dd36073386b9d0bc300d31c7f11bf32a0ab0 100644 (file)
@@ -13,7 +13,6 @@
 #include "identifier.hh"
 #include "my-lily-lexer.hh"
 #include "debug.hh"
-#include "script-def.hh"
 #include "request.hh"
 #include "translator.hh"
 #include "notename-table.hh"
@@ -82,7 +81,6 @@ Class ## _identifier::do_print () const { \
 
 
 
-DEFAULT_PRINT(General_script_def);
 DEFAULT_PRINT(Translator);
 DEFAULT_PRINT(Music);
 DEFAULT_PRINT(Request);
@@ -99,7 +97,6 @@ Class ## _identifier::do_str () const { \
 
 
 DUMMY_STR(Notename_table);
-DUMMY_STR(General_script_def);
 DUMMY_STR(Translator);
 DUMMY_STR(Music);
 DUMMY_STR(Request);
@@ -171,7 +168,6 @@ IMPLEMENT_ID_CLASS(Translator);
 IMPLEMENT_ID_CLASS(int);
 IMPLEMENT_ID_CLASS(Real);
 IMPLEMENT_ID_CLASS(String);
-IMPLEMENT_ID_CLASS(General_script_def);
 IMPLEMENT_ID_CLASS(Music);
 IMPLEMENT_ID_CLASS(Score);
 IMPLEMENT_ID_CLASS(Request);
@@ -181,7 +177,6 @@ IMPLEMENT_ID_CLASS(Notename_table);
 VIRTUAL_ACCESSOR(Music);
 VIRTUAL_ACCESSOR(Request);
 VIRTUAL_ACCESSOR(Translator);
-VIRTUAL_ACCESSOR(General_script_def);
 DEFAULT_ACCESSOR(Notename_table);
 DEFAULT_ACCESSOR(Duration);
 DEFAULT_ACCESSOR(int);
index 659919425b2743894092c9c478d88c3c81ccf95c..b6a0ab5231572f4d8c6211b06be70628c45c3e5c 100644 (file)
@@ -19,7 +19,8 @@ class Axis_align_item : public virtual Align_element,
 public:
   Axis_align_item ();
 protected:
-  virtual  void do_print () const {}
+  virtual void do_print ()const;
+
 };
 #endif /* AXIS_ALIGN_ITEM_HH */
 
index 40753a8a9a2267a68d8bcd27b24ac1a8682dd78a..0de8cc51efb3a6a2eaed60863454b14d2e21eadd 100644 (file)
@@ -7,8 +7,8 @@
 */
 
 
-#ifndef SPAN_AXIS_GROUP_HH
-#define SPAN_AXIS_GROUP_HH
+#ifndef AXIS_GROUP_SPANNER_HH
+#define AXIS_GROUP_SPANNER_HH
 
 #include "spanner.hh"
 #include "axis-group-element.hh"
index effd9886b556ef6ccfb22c6d21268cb78664101b..c37277e312768ce32cd607c423f029dd54b9f47f 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef CLEFITEM_HH
 #define CLEFITEM_HH
 #include "item.hh"
-#include "text-def.hh"
+
 #include "direction.hh"
 #include "pointer.hh"
 #include "staff-symbol-referencer.hh"
index 75004fb803cff9cca15150cf2089e2ab23506cad..63f8c11135f940ef63dbbc3d761e367c92ce847f 100644 (file)
 #include "duration.hh"
 #include "musical-pitch.hh"
 
-/** Request which are  assumed to be "happening" before the
-  musical requests.  Not coupled to a note or rest. */
-class Command_req  : public virtual Request  {
-public:
-  REQUESTMETHODS(Command_req);
-
-};
-
-
-class Break_req : public Command_req {
+class Break_req : public Request {
 public:
   enum { DISALLOW = -10000, FORCE = 10000 };
   int penalty_i_;
   Break_req ();
-  REQUESTMETHODS (Break_req);
+protected:
+  VIRTUAL_COPY_CONS(Music);
 };
 
-class Mark_req : public Command_req {
+class Mark_req : public Request {
 public:
   Mark_req (String);
   String str_;
-  REQUESTMETHODS (Mark_req);
-};
-
-class Command_script_req : public Command_req,  public Script_req {
-public:
-  // huh? 
-  Command_script_req();
-  ~Command_script_req();
-  REQUESTMETHODS(Command_script_req);
+protected:
+  virtual void do_print () const;  
+  VIRTUAL_COPY_CONS(Music);
 };
 
 
 /** Baseclass for time_signature/partial req. It has to be handled by
   Staff_{walker,column} baseclass.  */
-class Timing_req  : public Command_req  {
+class Timing_req  : public Request  {
 public:
-  REQUESTMETHODS(Timing_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 
@@ -63,7 +49,9 @@ public:
   int metronome_i_;
 
   Tempo_req();
-  REQUESTMETHODS(Tempo_req);
+protected:
+    virtual void do_print () const;
+  VIRTUAL_COPY_CONS(Music);
   bool do_equal_b (Request *) const;
 };
 
@@ -72,7 +60,9 @@ public:
   Moment length_mom_;
 
   Partial_measure_req (Moment);
-  REQUESTMETHODS(Partial_measure_req);
+protected:
+  VIRTUAL_COPY_CONS(Music);
+  virtual void do_print () const;
   bool do_equal_b (Request*) const;
 };
 
@@ -81,11 +71,14 @@ public:
  */
 class Time_signature_change_req  : public Timing_req  {
 public:
-  int beats_i_, one_beat_i_;
+  int beats_i_;
+  int one_beat_i_;
 
   Time_signature_change_req();
+protected:
+  virtual void do_print () const;
   bool do_equal_b (Request*) const;
-  REQUESTMETHODS(Time_signature_change_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /// toggle Cadenza mode
@@ -93,35 +86,42 @@ class Cadenza_req  : public Timing_req  {
 public:
   /// turn on?
   bool on_b_;
-  bool do_equal_b (Request*) const;
   Cadenza_req (bool);
-  REQUESTMETHODS(Cadenza_req);
+protected:
+  virtual void do_print () const;
+  
+  bool do_equal_b (Request*) const;
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /// check if we're at start of a  measure.
 class Barcheck_req  : public Timing_req  {
 public:
   bool do_equal_b (Request *) const;
-  REQUESTMETHODS(Barcheck_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 class Measure_grouping_req : public Timing_req  {
 public:
   Array<int> beat_i_arr_;
   Array<Moment> elt_length_arr_;
+protected:
+  virtual void do_print () const;
   bool do_equal_b (Request *) const;
-  REQUESTMETHODS(Measure_grouping_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /** draw a (repeat)-bar. This something different than #Barcheck_req#,
   the latter should only happen at the start of a measure.  */
-class Bar_req  : public Command_req  {
+class Bar_req  : public Request  {
 public:
   String type_str_;
   Bar_req (String);
+protected:
+  virtual void do_print () const;
   bool do_equal_b (Request*) const;
 
-  REQUESTMETHODS(Bar_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 
@@ -130,14 +130,13 @@ public:
     Routines for sharps and flats are separated, 
     so that caller may identify non-conventional keys.
 */
-class Key_change_req  : public Command_req  {
+class Key_change_req  : public Request  {
 public:
   Array<Musical_pitch> pitch_arr_;
   int modality_i_;
   bool ordinary_key_b_;
 
   Key_change_req();
-  REQUESTMETHODS(Key_change_req);
 
   /// squash the octaves to 1
   void squash_octaves();
@@ -146,22 +145,27 @@ public:
 
   /// return number of sharps in key
   int sharps_i();
+  bool minor_b() const;
 
+protected:
+  VIRTUAL_COPY_CONS(Music);
   void transpose (Musical_pitch  d);
-  bool minor_b() const;
+  virtual void do_print () const;
 };
 
-class Clef_change_req  : public Command_req  {
+class Clef_change_req  : public Request  {
 public:
   String clef_str_;
   Clef_change_req (String);
-  REQUESTMETHODS(Clef_change_req);
+protected:
+  virtual void do_print () const;
+  VIRTUAL_COPY_CONS(Music);
 };
 
-class Bracket_req :  public Span_req, public Command_req {
+class Bracket_req :  public Span_req {
 
 public:
-  REQUESTMETHODS(Bracket_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 
diff --git a/lily/include/g-script-column.hh b/lily/include/g-script-column.hh
new file mode 100644 (file)
index 0000000..62caab8
--- /dev/null
@@ -0,0 +1,30 @@
+/*   
+  g-script-column.hh -- declare G_script_column
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef G_SCRIPT_COLUMN_HH
+#define G_SCRIPT_COLUMN_HH
+
+#include "item.hh"
+
+class G_script_column : public Item
+{
+  /**
+     Array of objects that are placed by staffsides
+   */
+  Link_array<Item> staff_sided_item_l_arr_;
+public:
+  void add_staff_sided (Item*);
+protected:
+  virtual void do_pre_processing ();
+};
+
+
+#endif /* G_SCRIPT_COLUMN_HH */
+
+
diff --git a/lily/include/g-script-engraver.hh b/lily/include/g-script-engraver.hh
new file mode 100644 (file)
index 0000000..7f1774c
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+  script-engraver.hh -- part of GNU LilyPond
+
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef G_SCRIPT_GRAV
+#define G_SCRIPT_GRAV
+
+#include "engraver.hh"
+
+
+class G_script_engraver : public Engraver {
+  Link_array<G_script> script_p_arr_;
+  Link_array<G_staff_side_item> staff_side_p_arr_;
+  Link_array<Articulation_req> script_req_l_arr_;
+
+public:
+  VIRTUAL_COPY_CONS(Translator);
+  
+  G_script_engraver();
+protected:
+  virtual bool do_try_music (Music*);
+  virtual void do_process_requests ();
+  virtual void do_pre_move_processing ();
+  virtual void do_post_move_processing ();
+  virtual void acknowledge_element (Score_element_info);
+};
+
+#endif // G_SCRIPT_GRAV
diff --git a/lily/include/g-script.hh b/lily/include/g-script.hh
new file mode 100644 (file)
index 0000000..cbc5f6e
--- /dev/null
@@ -0,0 +1,40 @@
+/*   
+  g-script.hh -- declare G_script
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef G_STEM_SCRIPT_HH
+#define G_STEM_SCRIPT_HH
+
+#include "item.hh"
+#include "drul-array.hh"
+
+/**
+   articulation marks (and the like) that are attached to notes/stems.
+   Needs support from G_staff_side for proper operation.
+ */
+class G_script : public Item
+{
+  G_staff_side_item * staff_side_l_;
+
+  Molecule get_molecule (Direction d) const;
+public:
+  Drul_array<String> indices_drul_;
+  G_script ();
+  void set_staff_side (G_staff_side_item*);
+
+protected:
+virtual void do_print () const;
+  virtual void do_substitute_element_pointer (Score_element*o,
+                                             Score_element*n);
+  virtual void do_pre_processing ();
+  virtual void do_post_processing ();
+  Molecule* do_brew_molecule_p () const;
+};
+
+#endif /* G_STEM_SCRIPT_HH */
+
index c463360e273d1a80124d46e3a4c4162264a5b0f9..e6808863a6eee45ca0590ed6641a3e30048d6ad4 100644 (file)
 #include "item.hh"
 #include "staff-symbol-referencer.hh"
 
+/**
+   Position myself next to a set of elements.  Configurable in axis
+   and direction.
+
+  Properties:
+
+    padding :: Real
+
+    Amount of extra space to add.
+*/
 class G_staff_side_item : public Item, public Staff_symbol_referencer
 {
   void position_self ();
+
 public:
   Score_element * to_position_l_;
   Direction dir_;
   Link_array<Score_element> support_l_arr_;
   Axis axis_;
+  //junkme.
+  bool staff_support_b_;
   
   G_staff_side_item ();
   void set_victim (Score_element*);
   void add_support (Score_element*);
 
-  virtual void set_default_direction ();
   VIRTUAL_COPY_CONS(Score_element);
+  virtual Direction get_default_direction () const;
 protected:
+  virtual Interval do_height () const;
+  virtual Interval do_width () const;
+  virtual void do_print () const;
   virtual void do_add_processing ();
   virtual void do_substitute_element_pointer (Score_element*,Score_element*);
   virtual void do_pre_processing ();
diff --git a/lily/include/g-stem-staff-side.hh b/lily/include/g-stem-staff-side.hh
new file mode 100644 (file)
index 0000000..59e51ce
--- /dev/null
@@ -0,0 +1,40 @@
+/*   
+  g-stem-staff-side.hh -- declare G_stem_staff_side
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#ifndef G_STEM_STAFF_SIDE_HH
+#define G_STEM_STAFF_SIDE_HH
+
+#include "g-staff-side.hh"
+/**
+   Position self, analogous to G_staff_side_item, but use Stem direction
+   for determining direction.
+
+   Properties:
+
+   padding :: Real
+
+   Padding in staffline leading
+   
+ */
+class G_stem_staff_side_item : public G_staff_side_item
+{
+  Stem *stem_l_;
+public:
+  Direction relative_dir_;
+
+  void set_stem (Stem*);
+  G_stem_staff_side_item ();
+protected:
+  virtual Direction get_default_direction ()const;
+  virtual void do_pre_processing ();
+  virtual void do_substitute_element_pointer (Score_element*o,Score_element*e);
+};
+
+#endif /* G_STEM_STAFF_SIDE_HH */
+
index 2362a5d9bef412e64831d21e1fb982cd48295ee5..3edfe6c72c294f41593a292cbb994480aea761c3 100644 (file)
@@ -12,6 +12,9 @@
 
 #include "item.hh"
 
+/**
+   Print a text in specified style.
+ */
 class G_text_item : public Item
 {
 public:
@@ -21,6 +24,7 @@ public:
   G_text_item ();
   VIRTUAL_COPY_CONS (Score_element);
 protected:
+  virtual void do_print () const;
   virtual Molecule *do_brew_molecule_p () const;
 };
 
index 0ebfc65bcdafde793008be1a2ee38a01802aefd7..4d705020fbcbdc24490dc799057d485f6329cad3 100644 (file)
@@ -18,7 +18,7 @@
 class Notename_table_identifier;
 class Translator_identifier;
 class Music_identifier;
-class General_script_def_identifier;
+class Articulation_req_identifier;
 class Symtables_identifier;
 class Midi_def_identifier;
 class Paper_def_identifier;
@@ -54,7 +54,6 @@ struct Identifier : public Input {
   IDACCESSOR(Translator)
   IDACCESSOR(Notename_table)
   IDACCESSOR(Music)
-  IDACCESSOR(General_script_def)
   IDACCESSOR(Symtables)
   IDACCESSOR(Midi_def)
   IDACCESSOR(Paper_def)
index 367ff2febd78a04b8c990210aecf118c8630af5c..68667ae067013bd21ab7a40f4268633c17f351c2 100644 (file)
@@ -19,6 +19,7 @@ struct Abbreviation_req;
 struct Adobe_font_metric;
 struct Adobe_font_char_metric;
 struct All_font_metrics;
+struct Articulation_req;
 struct Atom;
 struct Audio_element;
 struct Audio_column;
@@ -81,6 +82,8 @@ struct Engraver;
 struct Engraver_group_engraver;
 struct Extender;
 struct Extender_req;
+struct G_script;
+struct G_script_req;
 struct G_staff_side_item;
 struct G_text_item;
 struct General_script_def;
index 187947afec79931870a1b8dd9486f7abb061bb16..2410acc2855a4f945d53930f40b06b4149d8a570 100644 (file)
@@ -8,27 +8,30 @@
 #define SCORELINE_HH
 
 #include "colhpos.hh"
-#include "spanner.hh"
+#include "axis-group-spanner.hh"
 #include "super-element.hh"
 
 /// the columns of a score that form one line.
-class Line_of_score : public Spanner, public Super_element
+class Line_of_score : public Axis_group_spanner, public Super_element
 {
-public:
   Link_array<Paper_column> cols_;
+public:
+
   Line_of_score();
     
-  void add_element (Score_element *);
-
   /// is #c# contained in #*this#?
   bool contains_b (Paper_column const *c) const;
     
   Link_array<Line_of_score> get_lines() const;
   Line_of_score * set_breaking (Array<Column_x_positions> const&, int j) const;
 
+
+  void output_all ();
+  void add_column (Paper_column*);
+  
 protected:
+  virtual void do_substitute_element_pointer (Score_element*, Score_element*);
   virtual Link_array<Score_element> get_extra_dependencies () const;
-  virtual Interval do_width() const;
   virtual void do_print() const;
   VIRTUAL_COPY_CONS(Score_element);
 };
index 9290359b1ee802da7b17fff4a50ffa836a7a5b18..827e094f03da2b0252671e1dc74fd46023474ada 100644 (file)
@@ -39,9 +39,9 @@ public:
   Molecule flag (int, Direction) const;
   Molecule hairpin (Real width, bool decresc, bool continued) const;
   Molecule plet (Real dy, Real dx, Direction dir) const;
-  Molecule rest (int, bool outside) const;
+  Molecule rest (int, bool outside, String) const;
   Molecule rule_symbol (Real height, Real width) const;
-  Molecule script (String idx) const;
+
   Molecule stem (Real y1_pos, Real y2_pos) const;
   Molecule slur (Array<Offset> controls) const;
   Molecule streepje (int type) const;
index 1e2c85eecb6e05b0f1ebf961da3b92215d65722f..322d4ab8cbcfcc6478dec96cf89ba46b61501fcf 100644 (file)
@@ -47,6 +47,7 @@ DECLARE_LY_SYMBOL(pianobrace);
 DECLARE_LY_SYMBOL(placebox);
 DECLARE_LY_SYMBOL(rulesym);
 DECLARE_LY_SYMBOL(rulethickness);
+DECLARE_LY_SYMBOL(script_priority);
 DECLARE_LY_SYMBOL(staffheight);
 DECLARE_LY_SYMBOL(style);
 DECLARE_LY_SYMBOL(text);
index 28d949b497cd56d9a739ba3423961986695af1da..b4950a7971d4a7224df78a0f351a5fbbdbabe8cd 100644 (file)
 #include "duration.hh"
 #include "musical-pitch.hh"
 
-/**
-  A request which is coupled to a note (that has duration).
-  Base class only
- */
-class Musical_req  : public virtual Request  {
-public:
-
-
-  REQUESTMETHODS(Musical_req);
-};
-
-
 
 /** a request with a duration.
   This request is used only used as a base class.
  */
-class Rhythmic_req  : public virtual Musical_req  {
+class Rhythmic_req  : public virtual Request  {
 public:
   Duration duration_;
-    
+  virtual void do_print () const;
+
+
   bool do_equal_b (Request*) const;
   void compress (Moment);
   virtual Moment length_mom () const;
   static int compare (Rhythmic_req const&,Rhythmic_req const&);
-  REQUESTMETHODS(Rhythmic_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 class Skip_req  : public Rhythmic_req  {
 public:
-  REQUESTMETHODS(Skip_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
-struct Spacing_req :virtual Request {
-  Moment next;
-  Real distance;
-  Real strength;
-  Spacing_req();
-  REQUESTMETHODS(Spacing_req);
-};
 
-struct Abbreviation_req : public Musical_req {
-  REQUESTMETHODS (Abbreviation_req);
+struct Abbreviation_req : public Request {
+  VIRTUAL_COPY_CONS (Abbreviation_req);
   Abbreviation_req ();
   int type_i_;
+  virtual void do_print () const;
 };
 
-class Blank_req  : public Spacing_req, Rhythmic_req  {
-public:
-  REQUESTMETHODS(Spacing_req);
-};
 
 /** a syllable  or lyric is a string with rhythm.
   */
 class Lyric_req  : public  Rhythmic_req  {
 public:
+  virtual void do_print () const;
   String text_str_;
-  REQUESTMETHODS(Lyric_req);
+  VIRTUAL_COPY_CONS(Music);
+};
+
+
+class Articulation_req : public G_script_req
+{
+public:
+  String articulation_str_;
+protected:
+  virtual bool do_equal_b (Request*) const;
+  virtual void do_print () const;
+  VIRTUAL_COPY_CONS(Music);
 };
 
+class Text_script_req : public G_script_req {
+public:
+  String text_str_;
+
+  // should be generic property of some kind.. 
+  String style_str_;
+protected:
+  VIRTUAL_COPY_CONS(Music);
+  virtual void do_print () const;
+};
 
 
 /// request which has some kind of pitch
-struct Melodic_req :virtual Musical_req
+struct Melodic_req :virtual Request
 {
   Musical_pitch pitch_;
+
+  static int compare (Melodic_req const&,Melodic_req const&);
+  
+protected:
   /// transpose. #delta# is relative to central c.
   virtual void transpose (Musical_pitch delta);
-  Melodic_req();
-  bool do_equal_b (Request*) const;
-  static int compare (Melodic_req const&,Melodic_req const&);
-  REQUESTMETHODS(Melodic_req);
+  virtual bool do_equal_b (Request*) const;
+  virtual void do_print () const;
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /// specify tonic of a chord
 struct Tonic_req : public Melodic_req
 {
-  Tonic_req ();
-  REQUESTMETHODS(Tonic_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /// Put a note of specified type, height, and with accidental on the staff.
@@ -104,8 +108,10 @@ public:
   /// Cautionary, i.e. parenthesized accidental.
   bool cautionary_b_;
   Note_req();
+protected:
+  virtual void do_print () const;
   bool do_equal_b (Request*) const;
-  REQUESTMETHODS(Note_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /**
@@ -113,7 +119,7 @@ Put a rest on the staff. Why a request? It might be a good idea to not typeset t
 */
 class Rest_req : public Rhythmic_req {
 public:
-  REQUESTMETHODS(Rest_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /**
@@ -122,24 +128,17 @@ public:
  */
 class Multi_measure_rest_req : public Rhythmic_req  {
 public:
-  REQUESTMETHODS(Multi_measure_rest_req);
+  VIRTUAL_COPY_CONS(Music);
 
 };
 
-class Musical_span_req : public Span_req, public virtual Musical_req
-{
-public:
-  REQUESTMETHODS(Musical_span_req);
-  
-};
-
 
 /** 
  Start / stop an abbreviation beam at this note. 
  */
-class Abbreviation_beam_req : public Musical_span_req  {
+class Abbreviation_beam_req : public Span_req  {
 public:
-  REQUESTMETHODS (Abbreviation_beam_req);
+  VIRTUAL_COPY_CONS(Abbreviation_beam_req);
 
   Abbreviation_beam_req ();
 
@@ -149,46 +148,49 @@ public:
 
 
 /// a slur
-class Slur_req  : public Musical_span_req  {
+class Slur_req  : public Span_req  {
 public:
-  REQUESTMETHODS(Slur_req);
+  VIRTUAL_COPY_CONS(Music);
 
 };
 
 /// an extender line
 class Extender_req : public Request  {
 public:
-  REQUESTMETHODS(Extender_req);
-  Extender_req ();
-};
+  VIRTUAL_COPY_CONS(Music);
 
-class Musical_script_req : public Musical_req,  public Script_req {
-public:
-  REQUESTMETHODS(Musical_script_req);
 };
 
 
-class Dynamic_req  : public virtual Musical_req  {
+class Dynamic_req  : public virtual Request  {
 public:
-  REQUESTMETHODS(Dynamic_req);
+  VIRTUAL_COPY_CONS(Music);
 };
-
+/*
+   merge with Articulation_req? 
+ */
 class Absolute_dynamic_req  : public Dynamic_req  {
 public:
   String loudness_str_;
-  virtual bool do_equal_b (Request*) const;
-  String loudness_str () const;
   Absolute_dynamic_req();
-  REQUESTMETHODS(Absolute_dynamic_req);
+
+protected:
+  virtual void do_print () const;
+  virtual bool do_equal_b (Request*) const;
+  VIRTUAL_COPY_CONS(Music);
 };
 
-class Span_dynamic_req  : public Dynamic_req, public Musical_span_req  {
+class Span_dynamic_req  : public Dynamic_req, public Span_req  {
 public:
-  virtual bool do_equal_b (Request*) const;
+
   /// Grow or shrink the volume: 1=cresc, -1 = decresc 
   Direction dynamic_dir_;
+
   Span_dynamic_req();
-  REQUESTMETHODS(Span_dynamic_req);
+protected:
+  virtual bool do_equal_b (Request*) const;
+  virtual void do_print () const;
+  VIRTUAL_COPY_CONS(Music);
 };
 
 #endif // MUSICALREQUESTS_HH
index 8fd5af02b115119ceb3aad9a9343cfca1aa53731..db18a621c9adbdb4e8191169be3e47c0a49ee709 100644 (file)
 #define NOTE_COLUMN_HH
 
 #include "item.hh"
-#include "script-column.hh"
+#include "axis-group-item.hh"
 
 /** a struct for treating a group of noteheads (noteheads, stem
   (chord) and scripts) as a single entity.  */
-class Note_column : public Script_column {
+class Note_column : public Axis_group_item {
 protected:
-  virtual void do_pre_processing();
+
   virtual void do_print () const;
   virtual void do_substitute_element_pointer (Score_element*,Score_element*);
 public:
@@ -27,10 +27,9 @@ public:
 
     JUNKME.v
     */
-  Direction dir_;
+  Direction dir () const;
   Stem* stem_l_;
 
-
   Link_array<Note_head> head_l_arr_;
   Link_array<Rest> rest_l_arr_;
     
@@ -38,14 +37,12 @@ public:
   //  Interval width () const;
 
   void translate_rests(int dy);
-        
   
   Note_column ();
   void set_stem (Stem*);
   void set_dotcol (Dot_column*);
   void add_head (Rhythmic_head*);
   bool rest_b () const;
-  virtual void add_script (Script*s);
   void sort ();
 };
 
index ef4d41a2c2624319b70f4f703bd15ab113121913..1b62555d0379d9838e84a308b3667976f0416940 100644 (file)
@@ -35,7 +35,7 @@ public:
   void output_molecule (Molecule const *, Offset, char const *);
   void output_comment (String s);
   void output_scheme (SCM scm);
-  void start_line ();
+  void start_line (Real height);
   void stop_line ();
   void switch_to_font (String fontname);
 
index 8cd5e4abdd87b0acc7cf729999d3ce514a474d2a..72134e8c334916475f80cb8083e2d3afb082cd2e 100644 (file)
 
  */
 class Request : public Music {
-
 public:
-    
   virtual ~Request(){}
-
-  
   VIRTUAL_COPY_CONS(Music);
-    
   bool equal_b (Request*) const;
 protected:
   virtual bool do_equal_b (Request*) const;
@@ -40,26 +35,27 @@ protected:
 };
 
 
-#define REQUESTMETHODS(T)      \
-\
-VIRTUAL_COPY_CONS(Request);\
-virtual void do_print() const
-
 
+class G_script_req : public virtual Request
+{
+public:
+  Direction dir_;
+  VIRTUAL_COPY_CONS(Music);
+};
 
 /** Put a script above or below this ``note'' or bar. eg upbow, downbow. Why
   a request? These symbols may conflict with slurs and brackets, so
   this also a request */
 
-class Script_req  : public virtual Request { 
+class Script_req  : public virtual G_script_req { 
 public:
-  Direction dir_;
   General_script_def *scriptdef_p_;
   
   bool do_equal_b (Request*) const;
 
   Script_req();
-  REQUESTMETHODS(Script_req);
+  VIRTUAL_COPY_CONS(Music);
+  virtual void do_print () const;
   ~Script_req();
   Script_req (Script_req const&);
 };
@@ -73,10 +69,12 @@ class Span_req  : public virtual Request  {
 public:
   /// should the spanner start or stop, or is it unwanted?
   Direction spantype_;
-  bool do_equal_b (Request*) const;
-  REQUESTMETHODS(Span_req);
 
   Span_req();
+protected:
+  virtual bool do_equal_b (Request*) const;
+  virtual void do_print() const;
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /**
@@ -84,13 +82,13 @@ public:
  */
 class Tie_req : public Request {
 public:
-  REQUESTMETHODS(Tie_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 /** Start / stop a beam at this note */
 class Beam_req  : public Span_req  {
 public:
-  REQUESTMETHODS(Beam_req);
+  VIRTUAL_COPY_CONS(Music);
 };
 
 #endif
index b9101c84d7489dea8d1b3094c67a6b04b42d2998..c4514f00bbb204ea49f6913407073142ed1f7fae 100644 (file)
@@ -14,7 +14,6 @@
 #include "parray.hh"
 
 class Rhythmic_column_engraver :public Engraver {
-  Link_array<Script> script_l_arr_;
   Link_array<Rhythmic_head> rhead_l_arr_;
   Stem * stem_l_;
   Note_column *ncol_p_;
index eaaaf1482bb48a54f99e75bf3ccf7be15d7c07be..719cc16d8ed2938e517f3d08e47c1e834809d273 100644 (file)
@@ -39,6 +39,9 @@ Boolean (true iff defined)
 class Score_element : public virtual Graphical_element {
   Protected_scm element_property_alist_;
   Link_array<Score_element> dependency_arr_;
+  /**
+     The lookup, determined by the font size. Cache this value.
+   */
   Lookup * lookup_l_;
 public:
   Score_element *original_l_;
@@ -85,7 +88,14 @@ public:
   bool linked_b () const;
   VIRTUAL_COPY_CONS(Score_element);
  
-  // ugh: no protection. Denk na, Vrij Veilig
+  /**
+     Recursively track all dependencies of this Score_element.  The
+     status_i_ field is used as a mark-field.  It is marked with
+     #busy# during execution of this function, and marked with #final#
+     when finished.
+
+     #funcptr# is the function to call to update this element.
+   */
   void calculate_dependencies (int final, int busy, Score_element_method_pointer funcptr);
 
 protected:
index f5e74a609dd7b9cf5cd62b3340745e3e742e58d8..4f3e219178960090476c4d276b0ea9ab279c988c 100644 (file)
@@ -63,6 +63,7 @@ public:
 
   Drul_array<int> beams_i_drul_;
 
+  void set_direction (Direction d);
   /// direction stem (that's me)
   Direction dir_;
 
@@ -97,7 +98,7 @@ public:
     
   /// heads that the stem encompasses (positions)
   Interval_t<int> head_positions() const;
-  virtual ~Stem ();
+
 protected:
   virtual void do_substitute_element_pointer (Score_element*,Score_element*);
   virtual void do_pre_processing();
index 8c3342a4e6a7f03aabb3db97a6e7c1f75c425fb2..6e541e0a8ab8af5d8d54f8f298d04d225305724b 100644 (file)
 #include "score-element.hh"
 /** The toplevel element. The Paper_score contains this element, and any
   element shoud be a dependency for the super element.
+
+  It is the entry point for the "constraint solver"/ dependency
+  tracker.  Every XXXX_processing () call traverses the entire
+  dependency graph, and calls the appropriate
+  Score_element::do_XXX_processing function on each Score_element it encounters.
+  
+  
   */
 class Super_element : public virtual Score_element {
 public:
-  Super_element();
-
   void space_processing ();
   void pre_processing();
   void breakable_col_processing();
   void break_processing();
   void post_processing();
   void output_all ();
-
-protected:
-  
 };
 
 #endif // Super_element_HH
index 224d88b17cd67253994d26e11f7cd8c989cf68c1..afb2d2262730150991ad3e8e2d36cb5481c1def6 100644 (file)
@@ -6,7 +6,7 @@
 
 #ifndef Tuplet_spanner_HH
 #define Tuplet_spanner_HH
-#include "text-def.hh"
+
 #include "pointer.hh"
 #include "directional-spanner.hh"
 
@@ -19,7 +19,12 @@ public:
  
   void add_column (Note_column*);
   void set_beam (Beam*);
-  P<Text_def>  tdef_p_;
+  
+
+  String  number_str_;
+  /*
+    junk us.
+   */
   bool bracket_visibility_b_;
   bool num_visibility_b_;
   
index 2195ac7f4f080795b74eca8e6db4dbcd8f93a084..a1debb439b20fe51c1414eb7231d794e6604f892 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef VOLTA_SPANNER_HH
 #define VOLTA_SPANNER_HH
 
-#include "text-def.hh"
+
 #include "pointer.hh"
 #include "spanner.hh"
 
@@ -21,11 +21,11 @@ public:
   void add_column (Note_column*);
   void add_column (Bar*);
  
-  P<Text_def>  number_p_;
+  String number_str_;
   Link_array<Bar> column_arr_;
   Link_array<Note_column> note_column_arr_;
   bool last_b_;
-  bool visible_b_;
+
  
 protected:
   virtual Molecule* do_brew_molecule_p () const;
index d7fdfed7b6abb377e98759f694d7088f39c80f30..084ee6013e10f7726b26969a56dddefc250821da 100644 (file)
@@ -7,22 +7,15 @@
 */
 
 #include "line-of-score.hh"
-#include "spanner.hh"
-
 #include "paper-def.hh"
+#include "paper-outputter.hh"
 #include "p-col.hh"
 #include "p-score.hh"
+#include "warn.hh"
 
 Line_of_score::Line_of_score()
 {
-}
-
-void
-Line_of_score::add_element (Score_element*e)
-{
-  // avoid excess dependencies.
-  if (! (e->parent_l (X_AXIS) || e->parent_l (Y_AXIS)) )
-    add_dependency (e);
+  set_axes (Y_AXIS,Y_AXIS);
 }
 
 bool
@@ -35,23 +28,13 @@ Line_of_score*
 Line_of_score::set_breaking (Array<Column_x_positions> const &breaking, int j) const
 {
   const Link_array<Paper_column> &curline (breaking[j].cols);
-
   const Array<Real> &config (breaking[j].config);
-       
   Line_of_score *line_l=0;
-       
-  if (breaking.size() >1) 
-    {
-      line_l = dynamic_cast <Line_of_score*> (clone());
-    }
-  else 
-    line_l = (Line_of_score*)( this);
+
+  line_l = dynamic_cast <Line_of_score*> (clone());
 
   line_l->cols_ = curline;
-  /*  Array<Paper_column*> &
-      ((Array<Paper_column*> &)) = */
   line_l->set_bounds(LEFT,curline[0]);
-      
   line_l->set_bounds(RIGHT,curline.top());
        
   for (int i=0; i < curline.size(); i++)
@@ -60,32 +43,55 @@ Line_of_score::set_breaking (Array<Column_x_positions> const &breaking, int j) c
       curline[i]->line_l_ = dynamic_cast<Line_of_score*>(line_l);
     }
 
+  Breaking_information b;
+  b.bounds_ = line_l->spanned_drul_;
+  b.broken_spanner_l_ = line_l;
+  b.line_l_ = line_l;
+  
+  broken_info_.push (b);
+
   return line_l;
 }
 
-
-
+void
+Line_of_score::add_column (Paper_column*p)
+{
+  cols_.push (p);
+}
 
 void
 Line_of_score::do_print() const
 {
   Spanner::do_print();
-}
-
-Interval
-Line_of_score::do_width() const
-{ 
-  return Spanner::do_width();
+  Axis_group_spanner::do_print ();
 }
 
 Link_array<Score_element>
 Line_of_score::get_extra_dependencies () const
 {
-  Link_array<Score_element> r;
+  Link_array<Score_element> r (Axis_group_spanner::get_extra_dependencies ());
   for (int i=0; i < cols_.size (); i++)
     r.push (cols_[i]);
   return r;
 }
 
+void
+Line_of_score::do_substitute_element_pointer (Score_element*o, Score_element*n)
+{
+  if (Paper_column *p = dynamic_cast<Paper_column*>(o))
+    cols_.substitute (p, dynamic_cast<Paper_column*>(n));
+}
 
-
+void
+Line_of_score::output_all ()
+{
+  Interval i(extent(Y_AXIS));
+  if (i.empty_b())
+    warning ("Huh? Empty Line_of_score?");
+  else
+    translate_axis (- i[MAX], Y_AXIS);
+  
+  pscore_l_->outputter_l_->start_line (i.length ());
+  Super_element::output_all ();
+  pscore_l_->outputter_l_->stop_line ();
+}
index b4ae24acb55ebce0498034d1adb193cbc2f3a13d..d588febb0553eec610dca9e28ec10a3774e5c6b4 100644 (file)
@@ -305,9 +305,9 @@ Lookup::flag (int j, Direction d) const
 }
 
 Molecule
-Lookup::rest (int j, bool o) const
+Lookup::rest (int j, bool o, String style) const
 {
-  return afm_find (String ("rests-") + to_str (j) + (o ? "o" : ""));
+  return afm_find (String ("rests-") + to_str (j) + (o ? "o" : "") + style);
 }
 
 Molecule
@@ -327,12 +327,6 @@ Lookup::rule_symbol (Real height, Real width) const
   return m;
 }
 
-Molecule
-Lookup::script (String str) const
-{
-  return afm_find (String ("scripts-") + str);
-}
-
 Molecule
 Lookup::special_time_signature (String s, int n, int d) const
 {
@@ -396,6 +390,8 @@ Molecule
 Lookup::text (String style, String text) const
 {
   Molecule m;
+  if (style.empty_b ())
+    style = "roman";
   
   int font_mag = 1;
   Real font_h = paper_l_->get_var ("font_normal");
@@ -409,6 +405,9 @@ Lookup::text (String style, String text) const
       font_mag = (int)paper_l_->get_var ("magnification_" + style);
     }
 
+  /*
+    UGH.
+   */
   SCM l = gh_eval_str (("(style-to-cmr \"" + style + "\")").ch_C());
   if (l != SCM_BOOL_F)
     {
index 32f3ebc0e0d93c1caf412fe2b12bb397fe1c682f..7ae048437948789e907f8a1865bd9b74a666ee6a 100644 (file)
@@ -7,7 +7,6 @@
 */
 
 #include "lyric-performer.hh"
-#include "text-def.hh"
 #include "musical-request.hh"
 #include "audio-item.hh"
 
index d161819a542ddaa6b2c392bda588792e95a13fd1..0b2aaee70424162ae1c19b068a580fa5ce093708 100644 (file)
@@ -14,8 +14,6 @@
 #include "bar.hh"
 #include "lookup.hh"
 #include "rest.hh"
-#include "script.hh"
-#include "text-def.hh"
 #include "molecule.hh"
 #include "misc.hh"
 
@@ -47,12 +45,12 @@ Multi_measure_rest::do_brew_molecule_p () const
   Molecule s;
   if (measures_i_ == 1 || measures_i_ == 2 || measures_i_ == 4) 
     {
-      s = (lookup_l ()->rest (- intlog2(measures_i_), 0));
+      s = (lookup_l ()->rest (- intlog2(measures_i_), 0, ""));
       s.translate_axis (-s.extent ()[X_AXIS].length () / 2, X_AXIS);
     }
   else 
     {
-      s = (lookup_l ()->rest (-4, 0));
+      s = (lookup_l ()->rest (-4, 0, ""));
     }
   mol_p->add_molecule (s);
   Real interline_f = staff_line_leading_f ();
@@ -63,11 +61,8 @@ Multi_measure_rest::do_brew_molecule_p () const
 
   if (measures_i_ > 1)
     {
-      Text_def text;
-      text.text_str_ = to_str (measures_i_);
-      text.style_str_ = "number";
-      text.align_dir_ = CENTER;
-      Molecule s = text.get_molecule (paper_l (), UP);
+      Molecule s ( lookup_l ()->text ("number", to_str (measures_i_)));
+
       s.translate_axis (3.0 * interline_f, Y_AXIS);
       mol_p->add_molecule (s);
     }
index 394ca287b375e26bc3865580b761b2f755cf8fca..86050545ba3fbbf888ba87af6f2711d4d621715f 100644 (file)
@@ -92,7 +92,9 @@ void
 Music_output_def::print () const
 {
 #ifndef NPRINT
+  DOUT << "Translators: \n";
   translator_p_dict_p_->print ();
+  DOUT << "Other definitions.\n";
   scope_p_->print( );
 #endif
 }
index adb284cce09461d3a5c321903dc08af0e342c689..369066fa7f19a1f03462551a40510e5ca772506a 100644 (file)
@@ -9,30 +9,8 @@
 #include "musical-request.hh"
 #include "misc.hh"
 #include "debug.hh"
-#include "script-def.hh"
-#include "text-def.hh"
-#include "music-list.hh"
-
-
-
-
-void
-Musical_req::do_print () const{}
-void
-Tie_req::do_print () const{}
-
 
-
-
-
-
-
-void
-Musical_span_req::do_print () const
-{
-  Span_req::do_print ();
-}
-            
+#include "music-list.hh"
 
 void
 Span_req::do_print () const
@@ -42,25 +20,6 @@ Span_req::do_print () const
 #endif
 }
 
-
-
-Spacing_req::Spacing_req ()
-{
-  next = 0;
-  distance = 0;
-  strength = 0;
-}
-
-void
-Spacing_req::do_print () const
-{
-#ifndef NPRINT
-  DOUT << "next " << next << "dist " << distance << "strength\n";
-#endif
-}
-
-
-
 Abbreviation_req::Abbreviation_req ()
 {
   type_i_ = 0;
@@ -77,16 +36,6 @@ Abbreviation_req::do_print () const
 
 
 
-void
-Blank_req::do_print () const
-{
-  Spacing_req::do_print ();
-}
-
-Melodic_req::Melodic_req ()
-{
-}
-
 void
 Melodic_req::transpose (Musical_pitch delta)
 {
@@ -117,21 +66,11 @@ Melodic_req::compare (Melodic_req const &m1 , Melodic_req const&m2)
 void
 Melodic_req::do_print () const
 {
-pitch_.print ();
+  pitch_.print ();
 }
 
 
-Tonic_req::Tonic_req ()
-{
-}
 
-void
-Tonic_req::do_print () const
-{
-#ifndef NPRINT
-  Melodic_req::do_print ();
-#endif
-}
 
 int
 Rhythmic_req::compare (Rhythmic_req const &r1, Rhythmic_req const &r2)
@@ -147,9 +86,6 @@ Rhythmic_req::do_equal_b (Request*r) const
   return rh && !compare (*this, *rh);
 }
 
-
-
-
 void
 Rhythmic_req::do_print () const
 {
@@ -211,54 +147,12 @@ Note_req::do_print () const
 #endif
 }
 
-void
-Rest_req::do_print () const
-{
-      Rhythmic_req::do_print ();
-}
-
-void
-Multi_measure_rest_req::do_print () const
-{
-      Rhythmic_req::do_print ();
-}
-
-
-void
-Beam_req::do_print () const
-{
-}
 
 Abbreviation_beam_req::Abbreviation_beam_req ()
 {
   type_i_ = 0;
 }
 
-void
-Abbreviation_beam_req::do_print () const
-{
-}
-
-
-void
-Slur_req::do_print () const
-{
-}
-
-
-
-
-
-Extender_req::Extender_req ()
-{
-}
-
-void
-Extender_req::do_print () const
-{
-}
-
-
 bool
 Span_req::do_equal_b (Request*r) const
 {
@@ -271,66 +165,6 @@ Span_req::Span_req ()
   spantype_ = CENTER;
 }
 
-Script_req::Script_req (Script_req const&s)
-{
-  dir_ = s.dir_;
-  scriptdef_p_ = s.scriptdef_p_ ? s.scriptdef_p_->clone () : 0;
-}
-
-/*
-  don't check dirs?
-
-  (d1.dir_ == d2.dir_)
- */
-bool
-Script_req::do_equal_b (Request*r) const
-{
-  Script_req * s = dynamic_cast <Script_req *> (r);
-  return s &&  scriptdef_p_->equal_b (*s->scriptdef_p_);
-}
-
-Script_req::Script_req ()
-{
-  dir_ = CENTER;
-  scriptdef_p_ = 0;
-}
-
-
-
-
-void
-Script_req::do_print () const
-{
-#ifndef NPRINT
-  DOUT << " dir " << dir_;
-  scriptdef_p_->print ();
-#endif
-}
-
-void
-Musical_script_req::do_print () const
-{
-  Script_req::do_print ();
-}
-
-Script_req::~Script_req ()
-{
-  delete scriptdef_p_;
-}
-
-void
-Skip_req::do_print () const
-{
-#ifndef NPRINT
-  DOUT << "duration: " << length_mom ();
-#endif
-}
-
-void
-Dynamic_req::do_print () const
-{
-  Musical_req::do_print ();
-}
 
 void
 Absolute_dynamic_req::do_print () const
@@ -376,5 +210,22 @@ Span_dynamic_req::do_print () const
 #endif
 }
 
+void
+Text_script_req::do_print () const
+{
+  DOUT << "text" << text_str_
+       << ", style = " << style_str_;
+}
 
+void
+Articulation_req::do_print () const
+{
+  DOUT << articulation_str_;
+}
 
+bool
+Articulation_req::do_equal_b (Request*r) const
+{
+  Articulation_req * a = dynamic_cast<Articulation_req*>(r);
+  return articulation_str_ == a->articulation_str_;
+}
index 207b755b47ec8091d37c9d53db251f8d838daa81..996cc8c5693987248ec3ebf1631dbf38777f33be 100644 (file)
@@ -171,20 +171,6 @@ My_lily_parser::get_chord (Musical_pitch tonic, Array<Musical_pitch>* add_arr_p,
   return v;
 }
 
-// junk me
-Simultaneous_music *
-My_lily_parser::get_note_element (Note_req *rq, Duration * duration_p)
-{
-  Simultaneous_music*v = new Request_chord;
-  v->set_spot (here_input ());
-
-  v->add_music (rq);
-
-  rq->duration_ = *duration_p;
-  rq->set_spot (here_input ());
-  delete duration_p ;
-  return v;
-}
 
 
 Input
index 28e4c011af07968d7ff67b0a56d7bc38c93dcb47..81fb1ea5ca02a1f2b265dc9cd9908f8cf42b45c7 100644 (file)
@@ -7,7 +7,7 @@
 */
 #include "dot-column.hh"
 #include "note-column.hh"
-#include "script.hh"
+
 #include "note-head.hh"
 #include "stem.hh"
 #include "rest.hh"
@@ -21,8 +21,8 @@ Note_column::rest_b () const
 
 Note_column::Note_column()
 {
+  set_axes (X_AXIS,X_AXIS);
   stem_l_ = 0;
-  dir_ =CENTER;
 }
 
 void
@@ -46,44 +46,27 @@ Note_column::head_positions_interval() const
   return iv;
 }
 
-void
-Note_column::do_pre_processing()
+Direction
+Note_column::dir () const
 {
-  if (!dir_)
-    {
-      if (stem_l_)
-       dir_ = stem_l_->dir_;
-      else if (head_l_arr_.size ())
-       {
-         //      assert (false);       // looks obsolete?
-         dir_ = sign (head_positions_interval().center ());
-       }
-    }
-  Script_column::do_pre_processing();
+  if (stem_l_)
+    return stem_l_->dir_;
+  else if (head_l_arr_.size ())
+    return sign (head_positions_interval().center ());
+
+  assert (false);
+  return CENTER;
 }
 
-  
 
 void
 Note_column::set_stem (Stem * stem_l)
 {
-  add_support (stem_l);
   stem_l_ = stem_l;
-  /* 
-     don't add stem to support; mostly invisible for rest-columns (and possibly taken . .)
-  */
-  Score_element::add_dependency (stem_l);
-  for (int i=0; i < script_l_arr_.size(); i++)
-    script_l_arr_[i]->set_stem (stem_l);
+  add_dependency (stem_l);
+  add_element (stem_l);
 }
 
-void
-Note_column::add_script (Script *script_l)
-{
-  Script_column::add_script (script_l) ;
-  if  (stem_l_)
-    script_l->set_stem (stem_l_);
-}
 
 void
 Note_column::do_substitute_element_pointer (Score_element*o, Score_element*n)
@@ -97,7 +80,7 @@ Note_column::do_substitute_element_pointer (Score_element*o, Score_element*n)
       head_l_arr_.substitute (dynamic_cast<Note_head *> (o), 
                              (n)? dynamic_cast<Note_head *> (n) : 0);
     }
-  Script_column::do_substitute_element_pointer (o,n);
+
   if (dynamic_cast<Rest *> (o)) 
     {
       rest_l_arr_.substitute (dynamic_cast<Rest *> (o), 
@@ -111,13 +94,12 @@ Note_column::add_head (Rhythmic_head *h)
   if (Rest*r=dynamic_cast<Rest *> (h))
     {
       rest_l_arr_.push (r);
-      add_support (r);  
     }
   if (Note_head *nh=dynamic_cast<Note_head *> (h))
     {
       head_l_arr_.push (nh);
-      add_support (nh);
     }
+  add_element (h);
 }
 
 /**
index 8a075e7a249535a76876c7ea35a94614f9fce4df..3cb525d7d1b03875da4ee7513d88beb3935a91e5 100644 (file)
@@ -210,12 +210,13 @@ Paper_score::process ()
     *mlog << elem_p_arr_.size ()  + span_p_arr_.size () << " elements. ";
 
   *mlog << "\nLine ... ";
+  line_l_->break_processing ();
   for (int i=0; i < lines.size (); i++)
     {
       *mlog << '[' << flush;
       
       Line_of_score *line_l = lines[i];
-      line_l->break_processing ();
+
       line_l->post_processing ();
        *mlog << i << flush;
       line_l->output_all ();
index 29ae5715cd845e5de1d712f1f54da7135f4f971a..308c07734d1b784cf41961abbb4df748c5d59c0c 100644 (file)
@@ -227,9 +227,11 @@ Paper_outputter::output_version ()
 }
 
 void
-Paper_outputter::start_line ()
+Paper_outputter::start_line (Real height)
 {
-  SCM scm = gh_list (ly_symbol ("start-line"), SCM_UNDEFINED);
+  SCM scm = gh_list (ly_symbol ("start-line"),
+                    gh_double2scm (height),
+                    SCM_UNDEFINED);
   output_scheme (scm);
 }
 
index 7e53b2ac00ee91b1604d74d4ceab9bfa54cf07d1..6ad7ffdb16ebcdd795a40bad0005d83464c3ab74 100644 (file)
@@ -14,7 +14,6 @@
 #include "notename-table.hh"
 #include "scalar.hh"
 #include "translation-property.hh"
-#include "script-def.hh"
 #include "lookup.hh"
 #include "misc.hh"
 #include "my-lily-lexer.hh"
@@ -30,7 +29,7 @@
 #include "command-request.hh"
 #include "musical-request.hh"
 #include "my-lily-parser.hh"
-#include "text-def.hh"
+
 #include "translator-group.hh"
 #include "score.hh"
 #include "music-list.hh"
@@ -96,7 +95,6 @@ Paper_def* current_paper = 0;
     Array<int> *intvec;
     Notename_table *chordmodifiertab;
     Duration *duration;
-    General_script_def * script;
     Identifier *id;
     Music *music;
     Music_list *music_list;
@@ -108,19 +106,16 @@ Paper_def* current_paper = 0;
     Musical_pitch * pitch;
     Midi_def* midi;
     Moment *moment;
-    Note_req *notereq;
     Notename_table *notenametab;
     Paper_def *paper;
     Real real;
     Request * request;
     Scalar *scalar;
-    Simultaneous_music *chord;
+
     String *string;
     Tempo_req *tempo;
-    Text_def * textdef;
     Translator* trans;
     char c;
-    const char *consstr;
     int i;
     int ii[10];
 }
@@ -196,7 +191,7 @@ yylex (YYSTYPE *s,  void * v_l)
 /* escaped */
 %token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR
 
-%type <i>      dots
+%type <i>      dots exclamations questions
 %token <i>     DIGIT
 %token <pitch> NOTENAME_PITCH
 %token <pitch> TONICNAME_PITCH
@@ -205,9 +200,7 @@ yylex (YYSTYPE *s,  void * v_l)
 %token <id>    IDENTIFIER
 %token <id>    NOTENAME_TABLE_IDENTIFIER
 %token <id>    MUSIC_IDENTIFIER
-%token <id>    POST_REQUEST_IDENTIFIER
-%token <id>    SCRIPT_IDENTIFIER
-%token <id>    COMMAND_IDENTIFIER
+%token <id>    REQUEST_IDENTIFIER
 %token <id>    REAL_IDENTIFIER
 %token <id>    STRING_IDENTIFIER
 %token <id>    TRANS_IDENTIFIER
@@ -224,6 +217,7 @@ yylex (YYSTYPE *s,  void * v_l)
 %type <outputdef> output_def
 %type <scope>  mudela_header mudela_header_body
 %type <request>        open_request_parens close_request_parens open_request close_request
+%type <request> request_with_dir request_that_take_dir verbose_request
 %type <i>      sub_quotes sup_quotes
 %type <music>  simple_element  request_chord command_element Simple_music  Composite_music 
 %type <music>  Alternative_music Repeated_music
@@ -236,10 +230,10 @@ yylex (YYSTYPE *s,  void * v_l)
 %type <duration> entered_notemode_duration explicit_duration
 %type <intvec> intastint_list int_list
 %type <reqvec>  pre_requests post_requests
-
+%type <request> gen_text_def
 %type <pitch>   explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
 %type <pitch>   steno_tonic_pitch
-%type <notereq>        steno_notepitch
+
 %type <pitch_arr>      pitch_list
 %type <music>  chord notemode_chord
 %type <pitch_arr>      chord_additions chord_subtractions chord_notes
@@ -254,20 +248,19 @@ yylex (YYSTYPE *s,  void * v_l)
 %type <paper>  paper_block paper_def_body
 %type <real>   real_expression real real_with_dimension
 %type <request> abbrev_command_req
-%type <request>        post_request structured_post_request
+%type <request>        post_request 
 %type <request> command_req verbose_command_req
-%type <request>        script_req  dynamic_req extender_req
+%type <request>        extender_req
 %type <string> string
 %type <score>  score_block score_body
 %type <intarr> shape_array
-%type <script> script_definition script_body mudela_script gen_script_def
-%type <textdef> text_def finger
+
 %type <string> script_abbreviation
 %type <trans>  translator_spec_block translator_spec_body
 %type <tempo>  tempo_request
 %type <notenametab> notenames_body notenames_block chordmodifiers_block
 
-%expect 7
+
 
 
 %left '-' '+'
@@ -312,17 +305,17 @@ toplevel_expression:
        ;
 
 embedded_scm:
-       SCMFILE STRING ';' {
+       SCMFILE STRING semicolon {
                read_lily_scm_file (*$2);
                delete $2;
        }
-       | SCM_T STRING ';' {
+       | SCM_T STRING semicolon {
                gh_eval_str ($2->ch_l ());
                delete $2;
        };
 
 check_version:
-       VERSION STRING ';'              {
+       VERSION STRING semicolon                {
                Mudela_version ver (*$2);
                if (!((ver >= oldest_version) && (ver <= version))) {
                        if (THIS->ignore_version_b_) {
@@ -367,7 +360,7 @@ mudela_header_body:
                $$ = new Scope;
                THIS->lexer_p_-> scope_l_arr_.push ($$);
        }
-       | mudela_header_body assignment ';' { 
+       | mudela_header_body assignment semicolon { 
 
        }
        ;
@@ -422,7 +415,7 @@ identifier_init:
        }
 
        | post_request {
-               $$ = new Request_identifier ($1, POST_REQUEST_IDENTIFIER);
+               $$ = new Request_identifier ($1, REQUEST_IDENTIFIER);
        }
        | explicit_duration {
                $$ = new Duration_identifier ($1, DURATION_IDENTIFIER);
@@ -436,10 +429,6 @@ identifier_init:
        | int   {
                $$ = new int_identifier (new int ($1), INT_IDENTIFIER);
        }
-       | script_definition {
-               $$ = new General_script_def_identifier ($1, SCRIPT_IDENTIFIER);
-
-       }
        ;
 
 translator_spec_block:
@@ -454,7 +443,7 @@ translator_spec_body:
                $$ = $1->access_content_Translator (true);
                $$-> set_spot (THIS->here_input ());
        }
-       | TYPE STRING ';'       {
+       | TYPE STRING semicolon {
                Translator* t = get_translator_l (*$2);
                Translator_group * tg = dynamic_cast<Translator_group*> (t);
 
@@ -466,7 +455,7 @@ translator_spec_body:
                $$ = t;
                delete $2;
        }
-       | translator_spec_body STRING '=' identifier_init ';'   { 
+       | translator_spec_body STRING '=' identifier_init semicolon     { 
                Identifier* id = $4;
                String_identifier *s = dynamic_cast<String_identifier*> (id);
                Real_identifier *r= dynamic_cast<Real_identifier*>(id);
@@ -484,19 +473,19 @@ translator_spec_body:
                Translator_group * tr = dynamic_cast<Translator_group*>($$);
                tr->set_property (*$2, str);
        }
-       | translator_spec_body NAME STRING ';' {
+       | translator_spec_body NAME STRING semicolon {
                $$->type_str_ = *$3;
                delete $3;
        }
-       | translator_spec_body CONSISTS STRING ';' {
+       | translator_spec_body CONSISTS STRING semicolon {
                dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
                delete $3;
        }
-       | translator_spec_body ACCEPTS STRING ';' {
+       | translator_spec_body ACCEPTS STRING semicolon {
                dynamic_cast<Translator_group*> ($$)-> set_acceptor (*$3, true);
                delete $3;
        }
-       | translator_spec_body REMOVE STRING ';' {
+       | translator_spec_body REMOVE STRING semicolon {
                dynamic_cast<Translator_group*> ($$)-> set_element (*$3, false);
                delete $3;
        }
@@ -569,6 +558,7 @@ paper_block:
        }
        ;
 
+
 optional_dot:
        /* empty */
        | '.'
@@ -591,13 +581,13 @@ paper_def_body:
                delete $5;
                $$->set_lookup ($2, l);
        }
-       | paper_def_body assignment ';' {
+       | paper_def_body assignment semicolon {
 
        }
        | paper_def_body translator_spec_block {
                $$->assign_translator ($2);
        }
-       | paper_def_body SHAPE '=' shape_array ';' {
+       | paper_def_body SHAPE '=' shape_array semicolon {
                $$->shape_int_a_ = *$4;
                delete $4;
        }
@@ -682,7 +672,7 @@ midi_body: /* empty */              {
        | midi_body translator_spec_block       {
                $$-> assign_translator ($2);
        }
-       | midi_body tempo_request ';' {
+       | midi_body tempo_request semicolon {
                $$->set_tempo ($2->dur_.length_mom (), $2->metronome_i_);
                delete $2;
        }
@@ -716,11 +706,8 @@ Music:
        | Composite_music
        ;
 
-Alternative_music: {
-               Music_list* m = new Music_list;
-               $$ = new Sequential_music (m);
-       }
-       | ALTERNATIVE Simultaneous_music {
+Alternative_music:
+       ALTERNATIVE Simultaneous_music {
                $$ = $2;
        }
        | ALTERNATIVE Sequential_music {
@@ -881,7 +868,7 @@ command_element:
 
 command_req:
        abbrev_command_req
-       | verbose_command_req ';'       { $$ = $1; }
+       | verbose_command_req semicolon { $$ = $1; }
        ;
 
 abbrev_command_req:
@@ -891,9 +878,6 @@ abbrev_command_req:
        | '|'                           {
                $$ = new Barcheck_req;
        }
-       | COMMAND_IDENTIFIER    {
-               $$ = $1->access_content_Request (true);
-       }
        | '~'   {
                $$ = new Tie_req;
        }
@@ -928,9 +912,9 @@ verbose_command_req:
                m->one_beat_i_=$4;
                $$ = m;
        }
-       | PENALTY '=' int       {
+       | PENALTY int   {
                Break_req * b = new Break_req;
-               b->penalty_i_ = $3;
+               b->penalty_i_ = $2;
                b-> set_spot (THIS->here_input ());
                $$ = b;
        }
@@ -962,14 +946,14 @@ verbose_command_req:
                $$ = key_p;
                delete $2;
        }
-       | KEYSIGNATURE pitch_list       {
+       | KEYSIGNATURE pitch_list {
                Key_change_req *key_p= new Key_change_req;
                key_p->pitch_arr_ = *$2;
                key_p->ordinary_key_b_ = false;
                $$ = key_p;
                delete $2;
        }
-       | GROUPING intastint_list {
+       | GROUPING intastint_list  {
                  Measure_grouping_req * mr_p = new Measure_grouping_req;
                  for (int i=0; i < $2->size();) 
                    {
@@ -987,33 +971,73 @@ post_requests:
        {
                $$ = new Link_array<Request>;
        }
-       | post_requests structured_post_request {
+       | post_requests post_request {
                $2->set_spot (THIS->here_input ());
                $$->push ($2);
        }
-       | post_requests close_request   {
-               $$->push ($2);
-       }
        ;
 
-structured_post_request:
-       script_req
-       | post_request
+post_request:
+       verbose_request
+       | request_with_dir
+       | close_request
        ;
 
-post_request:
-       POST_REQUEST_IDENTIFIER {
+
+request_that_take_dir:
+       gen_text_def
+       | verbose_request
+       | script_abbreviation {
+               Identifier*i = THIS->lexer_p_->lookup_identifier ("dash-" + *$1);
+               Articulation_req *a = new Articulation_req;
+               a->articulation_str_ = *i->access_content_String (false);
+               delete $1;
+               $$ = a;
+       }
+       ;
+
+request_with_dir:
+       script_dir request_that_take_dir        {
+               if (G_script_req * gs = dynamic_cast<G_script_req*> ($2))
+                       gs->dir_ = $1;
+               else if ($1)
+                       $2->warning ("Can't specify direction for this request");
+               $$ = $2;
+       }
+       ;
+       
+verbose_request:
+       REQUEST_IDENTIFIER      {
                $$ = (Request*)$1->access_content_Request (true);
+               $$->set_spot (THIS->here_input ());
        }
-       | dynamic_req {
-               $$ = $1;
+       | ABSDYNAMIC '{' STRING '}'     {
+               Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
+               ad_p ->loudness_str_ = *$3;
+               ad_p->set_spot (THIS->here_input ());
+               delete $3;
+               $$ =ad_p;
+       }
+       | SPANDYNAMIC '{' int int '}' {
+               Span_dynamic_req * sp_p = new Span_dynamic_req;
+               sp_p-> dynamic_dir_  = Direction($3);
+               sp_p->spantype_ = Direction($4);
+               sp_p->set_spot (THIS->here_input ());
+               $$ = sp_p;
        }
        | abbrev_type   {
                Abbreviation_req* a = new Abbreviation_req;
+               a->set_spot (THIS->here_input ());
                a->type_i_ = $1;
                $$ = a;
        }
-
+       | SCRIPT STRING         { 
+               Articulation_req * a = new Articulation_req;
+               a->articulation_str_ = *$2;
+               a->set_spot (THIS->here_input ());
+               $$ = a;
+               delete $2;
+       }
        ;
 
 optional_modality:
@@ -1088,23 +1112,6 @@ musical_pitch:
        | explicit_musical_pitch
        ;
 
-steno_notepitch:
-       musical_pitch   {
-               $$ = new Note_req;
-               
-               $$->pitch_ = *$1;
-               delete $1;
-       }
-       | steno_notepitch  '!'          {
-               $$->forceacc_b_ = ! $$->forceacc_b_;
-       }
-       | steno_notepitch  '?'          {
-               $$->forceacc_b_ = ! $$->forceacc_b_;
-               $$->cautionary_b_ = ! $$->cautionary_b_;
-       }
-       ;
-
-
 explicit_duration:
        DURATION '{' int_list '}'       {
                $$ = new Duration;
@@ -1126,22 +1133,6 @@ extender_req:
        }
        ;
 
-dynamic_req:
-       ABSDYNAMIC '{' STRING '}'       {
-               Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
-               ad_p ->loudness_str_ = *$3;
-               delete $3;
-               $$ =ad_p;
-       }
-       | SPANDYNAMIC '{' int int '}' {
-               Span_dynamic_req * sp_p = new Span_dynamic_req;
-               sp_p-> dynamic_dir_  = Direction($3);
-               sp_p->spantype_ = Direction($4);
-               $$ = sp_p;
-       }
-       ;
-
-
 close_request:
        close_request_parens {
                $$ = $1;
@@ -1184,60 +1175,16 @@ open_request_parens:
        }
        ;
 
-
-
-script_definition:
-       SCRIPT '{' script_body '}'      { $$ = $3; }
-       ;
-
-script_body:
-       STRING int int int int int              {
-               Script_def *s = new Script_def;
-               s->set_from_input (*$1,$2, $3,$4,$5, $6);
-               $$  = s;
-               delete $1;
-       }
-       ;
-
-script_req:
-       script_dir gen_script_def       {
-               Musical_script_req *m = new Musical_script_req;
-               $$ = m;
-               m->scriptdef_p_ = $2;
-               m->set_spot (THIS->here_input ());
-               if (!m->dir_)
-                 m->dir_  = (Direction)$1;
-       }
-       ;
-
-gen_script_def:
-       text_def        { 
-               $$ = $1;
-               ((Text_def*) $$)->align_dir_ = LEFT; /* UGH */
-       }
-       | mudela_script { 
-               $$ = $1;
-               $$-> set_spot (THIS->here_input ());
-       }
-       | finger {
-               $$ = $1;
-               ((Text_def*)$$)->align_dir_ = RIGHT; /* UGH */
-       }
-       ;
-
-text_def:
+gen_text_def:
        string {
-               Text_def *t  = new Text_def;
+               Text_script_req *t  = new Text_script_req;
                $$ = t;
                t->text_str_ = *$1;
                delete $1;
                $$->set_spot (THIS->here_input ());
        }
-       ;
-
-finger:
-        DIGIT {
-               Text_def* t  = new Text_def;
+       | DIGIT {
+               Text_script_req* t  = new Text_script_req;
                $$ = t;
                t->text_str_ = to_str ($1);
                t->style_str_ = "finger";
@@ -1247,40 +1194,25 @@ finger:
 
 script_abbreviation:
        '^'             {
-               $$ = THIS->lexer_p_
-               ->lookup_identifier ("dash-hat")->access_content_String (true)
-
+               $$ = new String ("hat");
        }
        | '+'           {
-               $$ = THIS->lexer_p_
-               ->lookup_identifier ("dash-plus")->access_content_String (true)
- }
-       | '-'           {
-               $$ = THIS->lexer_p_
-               ->lookup_identifier ("dash-dash")->access_content_String (true)
- }
+               $$ = new String ("plus");
+       }
+       | '-'           {
+               $$ = new String ("dash");
+       }
        | '|'           {
-               $$ = THIS->lexer_p_
-               ->lookup_identifier ("dash-bar")->access_content_String (true)
- }
+               $$ = new String ("bar");
+       }
        | '>'           {
-               $$ = THIS->lexer_p_
-               ->lookup_identifier ("dash-larger")->access_content_String (true)
- }
+               $$ = new String ("larger");
+       }
        | '.'           {
-               $$ = THIS->lexer_p_
-               ->lookup_identifier ("dash-dot")->access_content_String (true);
+               $$ = new String ("dot");
        }
        ;
 
-mudela_script:
-       SCRIPT_IDENTIFIER               { $$ = $1->access_content_General_script_def (true); }
-       | script_definition             { $$ = $1; }
-       | script_abbreviation           {
-               $$ = THIS->lexer_p_->lookup_identifier (*$1)->access_content_General_script_def (true);
-               delete $1;
-       }
-       ;
 
 script_dir:
        '_'     { $$ = DOWN; }
@@ -1315,18 +1247,11 @@ duration_length:
        }
        ;
 
-dots:
-       '.'             { $$ = 1; }
-       | dots '.'      { $$ ++; }
-       ;
-
 entered_notemode_duration:
-       /* */           {
+       dots            {
                $$ = new Duration (THIS->default_duration_);
-       }
-       | dots          {
-               $$ = new Duration (THIS->default_duration_);
-               $$->dots_i_  = $1;
+               if ($1)
+                       $$->dots_i_  = $1;
        }
        | steno_duration        {
                THIS->set_last_duration ($1);
@@ -1371,13 +1296,28 @@ abbrev_type:
        ;
 
 
-
 simple_element:
-       steno_notepitch notemode_duration  {
+       musical_pitch exclamations questions notemode_duration  {
                if (!THIS->lexer_p_->note_state_b ())
                        THIS->parser_error (_ ("have to be in Note mode for notes"));
-               $1->duration_ = *$2;
-               $$ = THIS->get_note_element ($1, $2);
+
+
+               Note_req *n = new Note_req;
+               
+               n->pitch_ = *$1;
+               delete $1;
+               n->duration_ = *$4;
+               delete $4;
+               n->forceacc_b_ = $2 % 2;
+               n->cautionary_b_ = $3 % 2;
+
+               Simultaneous_music*v = new Request_chord;
+               v->set_spot (THIS->here_input ());
+               n->set_spot (THIS->here_input ());
+
+               v->add_music (n);
+
+               $$ = v;
        }
        | RESTNAME notemode_duration            {
                $$ = THIS->get_rest_element (*$1, $2);
@@ -1421,6 +1361,7 @@ notemode_chord:
                 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
         };
 
+
 chord_additions: 
        {
                $$ = new Array<Musical_pitch>;
@@ -1440,6 +1381,21 @@ chord_notes:
        }
        ;
 
+chord_subtractions: 
+       {
+               $$ = new Array<Musical_pitch>;
+       } 
+       | '^' chord_notes {
+               $$ = $2;
+       }
+       ;
+
+
+/*
+       forevery : X : optional_X sucks. Devise  a solution.
+*/
+
+
 chord_addsub:
        chord_note optional_dot
        | CHORDMODIFIER_PITCH optional_dot
@@ -1484,15 +1440,6 @@ chord_note:
        }
         ;
 
-chord_subtractions: 
-       {
-               $$ = new Array<Musical_pitch>;
-       } 
-       | '^' chord_notes {
-               $$ = $2;
-       }
-       ;
-
 /*
        UTILITIES
  */
@@ -1552,8 +1499,27 @@ string:
 
 
 
+dots:
+                       { $$ = 0; }
+       | dots '.'      { $$ ++; }
+       ;
+
+
+
+exclamations:
+               { $$ = 0; }
+       | exclamations '!'      { $$ ++; }
+       ;
+
+questions:
+               { $$ = 0; }
+       | questions '?' { $$ ++; }
+       ;
 
 
+semicolon:
+       ';'
+       ;
 %%
 
 void
index 174737d34fe3f67ecfa6d9af77646a84703eb616..8a3cbdf59724680c5564c48e0c1a5f466a797983 100644 (file)
@@ -144,13 +144,13 @@ Repeat_engraver::do_process_requests ()
     {
       Volta_spanner* v = new Volta_spanner;
       Scalar prop = get_property ("voltaVisibility", 0);
-      v->visible_b_ = prop.to_bool ();
+      if (!prop.to_bool ())
+       v->set_elt_property (transparent_scm_sym, SCM_BOOL_T);
       prop = get_property ("voltaSpannerDuration", 0);
       if ((i == alternative_music_arr_.size () - 1) || prop.length_i ())
         v->last_b_ = true;
-      Text_def* t = new Text_def;
-      t->text_str_ = alternative_str_arr_[i];
-      v->number_p_.set_p (t);
+
+      v->number_str_ = alternative_str_arr_[i];
       volta_p_arr_.push (v);
       announce_element (Score_element_info (v, alternative_music_arr_[i]));
     }
index f72e59fbcfedccdf71287ad38b936eebddcf9aaa..1cb84c94817034d6508eb88147affae5e4144f29 100644 (file)
@@ -30,5 +30,6 @@ bool
 Request::do_equal_b (Request*) const
 {
   return true;
+
 }
   
index cd64e140c641b3dac4b37702b54883c970f2c17e..77eecea668677c904a23e72808f45897fd77295a 100644 (file)
@@ -14,9 +14,6 @@
 #include "collision.hh"
 #include "paper-def.hh"
 
-
-
-
 void
 Rest_collision::add_column (Note_column *nc_l)
 {
@@ -60,15 +57,15 @@ Rest_collision::do_pre_processing()
     {
       int dy = rest_l_arr_.size() > 2 ? 6 : 4;
        
-      rest_l_arr_[0]->translate_rests (rest_l_arr_[0]->dir_ *dy);      
+      rest_l_arr_[0]->translate_rests (rest_l_arr_[0]->dir () *dy);    
       // top is last element...
-      rest_l_arr_.top()->translate_rests (rest_l_arr_.top ()->dir_* dy);       
+      rest_l_arr_.top()->translate_rests (rest_l_arr_.top ()->dir ()* dy);     
     }
   // meisjes met jongetjes
   else 
     {
       // int dir_i = - ncol_l_arr_[0]->dir_;
-      Direction dir = rest_l_arr_[0]->dir_;
+      Direction dir = rest_l_arr_[0]->dir ();
        
       // minimum move
       int minpos = 4;
index ec90bcfdb41463571e42675227991db733793e95..5483ff9ace026a385bee7646257e81806ee3836a 100644 (file)
@@ -10,7 +10,6 @@
 #include "note-head.hh"
 #include "stem.hh"
 #include "note-column.hh"
-#include "script.hh"
 #include "dot-column.hh"
 #include "musical-request.hh"
 
@@ -53,14 +52,6 @@ Rhythmic_column_engraver::process_acknowledged ()
          ncol_p_->set_stem (stem_l_);
          stem_l_ = 0;
        }
-      
-      for (int i=0; i < script_l_arr_.size(); i++) 
-       {
-         if (ncol_p_)
-           ncol_p_->add_script (script_l_arr_[i]);
-       }
-  
-      script_l_arr_.clear();
     }
 }
 
@@ -70,14 +61,7 @@ Rhythmic_column_engraver::acknowledge_element (Score_element_info i)
   Item * item =  dynamic_cast <Item *> (i.elem_l_);
   if (!item)
     return;
-  if (Script *s=dynamic_cast<Script *> (item))
-    {
-      if (i.req_l_ && dynamic_cast <Musical_req *> (i.req_l_)) 
-       {
-         script_l_arr_.push (s);
-       }
-    }
-  else if (Stem*s=dynamic_cast<Stem *> (item))
+ if (Stem*s=dynamic_cast<Stem *> (item))
     {
       stem_l_ = s;
     }
@@ -101,9 +85,6 @@ Rhythmic_column_engraver::do_pre_move_processing()
        {
          ncol_p_->set_elt_property (horizontal_shift_scm_sym, SCM_BOOL_T);
        }
-      
-      if (! ncol_p_->dir_)
-       ncol_p_->dir_ =(Direction) int(get_property ("ydirection", 0));
 
       typeset_element (ncol_p_);
       ncol_p_ =0;
@@ -113,7 +94,6 @@ Rhythmic_column_engraver::do_pre_move_processing()
 void
 Rhythmic_column_engraver::do_post_move_processing()
 {
-  script_l_arr_.clear();
   dotcol_l_ =0;
   stem_l_ =0;
 }
index 986ede9eabc51c64d15b878fc729add948e7d183..992d2eee1d770802fd7a836a9e90a0d759176675 100644 (file)
@@ -134,17 +134,14 @@ Score_element::do_height() const
   return r;
 }
 
-
-/*
-  STANDARD METHS
- */
 void
 Score_element::print() const
 {
 #ifndef NPRINT
   DOUT << classname(this) << "{\n";
   DOUT << "dependencies: " << dependency_size();
+  if (original_l_)
+    DOUT << "Copy ";
   Graphical_element::do_print ();
   do_print();
   
index 12f762e36a86eff1d7bc17b6e4f89916b6bfaf99..5aef40446743e993f5d00fa0ec500c131a7123bb 100644 (file)
@@ -157,7 +157,8 @@ Score_engraver::typeset_all()
                musical_column_l_->add_element(item_p);
            }
        }
-      scoreline_l_->add_element (elem_p);
+      if (!elem_p->dim_cache_[Y_AXIS].parent_l_)
+       scoreline_l_->add_element (elem_p);
     }
   elem_p_arr_.clear();
 }
@@ -185,7 +186,7 @@ Score_engraver::set_columns (Score_column *new_command_l,
   if (command_column_l_ && command_column_l_->linked_b()) 
     {
       pscore_p_->add_column (command_column_l_);
-      scoreline_l_->add_element (command_column_l_);
+      scoreline_l_->add_column (command_column_l_);
     }
   else 
     {
@@ -200,7 +201,7 @@ Score_engraver::set_columns (Score_column *new_command_l,
   if (musical_column_l_ && musical_column_l_->linked_b()) 
     {
       pscore_p_->add_column (musical_column_l_);
-      scoreline_l_->add_element (musical_column_l_);
+      scoreline_l_->add_column (musical_column_l_);      
     }
   else 
     {
index 4d4fb48d0a50696eaa255b42538a6bb9f6a56d79..f81a08a45d9094482597c5cef5d7d5d8aecad9fe 100644 (file)
 bool
 Slur_engraver::do_try_music (Music *req_l)
 {
-  Musical_req *mus_l = dynamic_cast <Musical_req *> (req_l);
-  if (Slur_req *sl = dynamic_cast <Slur_req *> (mus_l))
+  if (Slur_req *sl = dynamic_cast <Slur_req *> (req_l))
     {
-      new_slur_req_l_arr_.push (dynamic_cast <Slur_req *> (mus_l));
+      new_slur_req_l_arr_.push (sl);
       return true;
     }
   return false;
index 0f9beffe3e0b5e4d6d15cfce29e2d0b9a287dc30..ff5c72076282cc3e07f99f3654a327b821189a3c 100644 (file)
@@ -50,7 +50,7 @@ Slur::set_default_dir ()
   dir_ = DOWN;
   for (int i=0; i < encompass_arr_.size (); i ++) 
     {
-      if (encompass_arr_[i]->dir_ < 0) 
+      if (encompass_arr_[i]->dir () < 0) 
        {
          dir_ = UP;
          break;
index 6428a80667b7971a48044b9fc297525b3fe12701..d5ac3fff5f4f21456fa788fc4ba45d8191e943ce 100644 (file)
@@ -21,12 +21,9 @@ Spanner::do_print() const
 #ifndef NPRINT
   DOUT << "Between " << classname (spanned_drul_[LEFT])
        << " and " << classname (spanned_drul_[RIGHT]) << '\n';
-  /*  if (broken_into_l_arr_.size())
-    {
-      DOUT << "with broken pieces:\n";
-      for (int i=0; i < broken_into_l_arr_.size (); i++)
-       broken_into_l_arr_[i]->print ();
-       }*/  
+
+  if (broken_b ())
+    DOUT << "Broken in " << to_str (broken_info_.size ()) << " pieces";
 #endif
 }
 
@@ -178,12 +175,6 @@ Spanner::find_broken_piece (Line_of_score*l) const
 
              
              info.broken_spanner_l_ = span_p;
-             /*              if (Axis_group_spanner *ags
-                 = dynamic_cast<Axis_group_spanner*> (span_p))
-               {
-               do something
-               }
-             */
              span_p->handle_broken_dependencies();
 
            }
index 751220e7a6acfb7cdcc2b60c3398698eaa475b03..9a9452175ac203b0efc2cd0062986c1765bb0a67 100644 (file)
 #include "beam.hh"
 #include "rest.hh"
 
-Stem::~Stem ()
+void
+Stem::set_direction (Direction d)
 {
+  if  (!dir_)
+    warning ("Stem direction set already!");
+
+  dir_ = d;
+
+  /*
+    todo
+  */
 }
 
 Stem::Stem ()
index c5ee89e9fbe2388ca94618fddb409aa301121bf4..0401602c7ad5248a479c90a32a9db74433e647b2 100644 (file)
 #include "paper-outputter.hh"
 
 
-Super_element::Super_element()
-{
-}
-
-
 /**
     for administration of what was done already
     */
@@ -40,13 +35,13 @@ enum Score_element_status {
 void
 Super_element::pre_processing ()
 {
-  calculate_dependencies (PRECALCING, PRECALCED, &Score_element::do_pre_processing);
+  calculate_dependencies (PRECALCED, PRECALCING, &Score_element::do_pre_processing);
 }
 
 void
 Super_element::space_processing ()
 {
-  calculate_dependencies (SPACING, SPACED, &Score_element::do_space_processing);
+  calculate_dependencies (SPACED, SPACING, &Score_element::do_space_processing);
 }
 
 /* for break processing, use only one status, because copies have to
@@ -68,15 +63,13 @@ Super_element::break_processing ()
 void
 Super_element::post_processing ()
 {
-  calculate_dependencies (POSTCALCING, POSTCALCED, &Score_element::do_post_processing);
+  calculate_dependencies (POSTCALCED, POSTCALCING, &Score_element::do_post_processing);
 }
 
 void
 Super_element::output_all () 
 {
-  pscore_l_->outputter_l_->start_line ();
-  calculate_dependencies (BREWING, BREWED, &Score_element::output_processing);
-  pscore_l_->outputter_l_->stop_line ();
+  calculate_dependencies (BREWED, BREWING, &Score_element::output_processing);
 }
 
 
index 16d5b76027993ba44cca120a517f74c77ade2ed5..e673126b2bc04e7e292b9c351964e6d31f654f76 100644 (file)
 #include "engraver.hh"
 #include "g-staff-side.hh"
 #include "g-text-item.hh"
-#include "text-def.hh"
+#include "musical-request.hh"
 #include "note-head.hh"
 #include "stem.hh"
 #include "staff-symbol.hh"
 
 class Text_engraver : public Engraver
 {
-  Link_array<Script_req> reqs_;
+  Link_array<Text_script_req> reqs_;
   Link_array<G_staff_side_item> positionings_;
   Link_array<G_text_item> texts_;
 public:
@@ -39,11 +39,8 @@ Text_engraver::Text_engraver ()
 bool
 Text_engraver::do_try_music (Music *m)
 {
-  if (Script_req *r = dynamic_cast<Script_req*> (m))
+  if (Text_script_req *r = dynamic_cast<Text_script_req*> (m))
     {
-      Text_def * t = dynamic_cast<Text_def*> (r->scriptdef_p_);
-      if (!t)
-       return false;
       reqs_.push (r);
       return true;
     }
@@ -75,19 +72,28 @@ Text_engraver::do_process_requests ()
 {
   for (int i=0; i < reqs_.size (); i++)
     {
-      Script_req * r = reqs_[i];
-      Text_def * t= dynamic_cast<Text_def*> (r->scriptdef_p_);
+      Text_script_req * r = reqs_[i];
 
       G_text_item *text = new G_text_item;
       G_staff_side_item *ss = new G_staff_side_item;
 
       ss->set_victim (text);
+      ss->set_elt_property (script_priority_scm_sym,
+                           gh_int2scm (200));
+
       ss->dir_ = r->dir_;
-      Scalar p (get_property ("textstyle", 0)); // textStyle?
-      if (p.length_i ())
-       text->style_str_ = p;
-      text->text_str_ = t->text_str_;
 
+      text->text_str_ = r->text_str_;
+      
+      if (r->style_str_.empty_b ())
+       {
+         Scalar p (get_property ("textStyle", 0));
+         if (p.length_i ())
+           text->style_str_ = p;
+       }
+      else
+       text->style_str_ = r->style_str_;
+      
       Scalar padding = get_property ("textScriptPadding", 0);
       if (padding.length_i() && padding.isnum_b ())
        {
index 00a6fa28a74ad2f61cdbe37021d6f300099af4b7..fdd75bea770e8d499caf8702d2e2f8678d54a3a4 100644 (file)
@@ -45,11 +45,12 @@ Time_signature_performer::do_try_music (Music* req_l)
   if (time_signature_req_l_)
     return false;
 
-  if (dynamic_cast <Command_req *> (req_l))
-    time_signature_req_l_ = dynamic_cast <Time_signature_change_req *> (req_l);
-
-  if (time_signature_req_l_)
-    return true;
+  if (Time_signature_change_req *t =
+      dynamic_cast <Time_signature_change_req *> (req_l))
+    {
+      time_signature_req_l_ = t;
+      return true;
+    }
 
   return false;
 }
index 73d36eec20d831d7a8c7fcee5d671f8caf701507..ebbbad4a3a64ed79fd32bc288a4cebf4c3269468 100644 (file)
@@ -12,7 +12,7 @@
 #include "tuplet-spanner.hh"
 #include "note-column.hh"
 #include "compressed-music.hh"
-#include "text-def.hh"
+
 #include "beam.hh"
 #include "music-list.hh"
 
@@ -40,10 +40,7 @@ Tuplet_engraver::do_process_requests ()
     {
       Tuplet_spanner* glep = new Tuplet_spanner;
       started_span_p_arr_.push (glep);
-
-      Text_def *t = new Text_def;
-      t->text_str_ = to_str (compressed_music_arr_[i]->den_i_);
-      glep->tdef_p_.set_p  (t);
+      glep->number_str_ = to_str (compressed_music_arr_[i]->den_i_);
       announce_element (Score_element_info (glep, compressed_music_arr_ [i]));
     }
 }
index f9fe68011259633ca7c98c8c62590f2abd58f9e5..a2068ecf254cb42c95f6e31414d749faed95d018 100644 (file)
@@ -18,7 +18,7 @@
 #include "paper-def.hh"
 #include "tuplet-spanner.hh"
 #include "stem.hh"
-#include "text-def.hh"
+
 #include "note-column.hh"
 
 Tuplet_spanner::Tuplet_spanner ()
@@ -26,10 +26,6 @@ Tuplet_spanner::Tuplet_spanner ()
   beam_l_ =0;
   bracket_visibility_b_ = true;
   num_visibility_b_ = true;
-  
-  tdef_p_.set_p(new Text_def);
-  tdef_p_->align_dir_ = CENTER;
-  tdef_p_->style_str_ = "italic";
 }
 
 Molecule*
@@ -39,7 +35,8 @@ Tuplet_spanner::do_brew_molecule_p () const
 
   if (column_arr_.size ()){
     Real ncw = column_arr_.top ()->extent (X_AXIS).length ();
-    Molecule num (tdef_p_->get_molecule (paper_l (), CENTER));
+    Molecule num (lookup_l ()->text ("italic",
+                                    number_str_));
 
     if (beam_l_ && !bracket_visibility_b_)
       {
@@ -106,7 +103,7 @@ Tuplet_spanner::set_default_dir ()
   dir_ = UP;
   for (int i=0; i < column_arr_.size (); i ++) 
     {
-      if (column_arr_[i]->dir_ < 0) 
+      if (column_arr_[i]->dir () < 0) 
        {
          dir_ = DOWN;
          break;
index 77afc20378567b34349606855f65861e549f790b..431d2aed374546f2bd74ca68db59e3327e7a87d1 100644 (file)
 #include "paper-def.hh"
 #include "volta-spanner.hh"
 #include "stem.hh"
-#include "text-def.hh"
-#include "pointer.tcc"
 
-template class P<Text_def>;            // UGH
+#include "pointer.tcc"
 
 Volta_spanner::Volta_spanner ()
 {
   last_b_ = false;
-  visible_b_ = true;
-  number_p_.set_p (new Text_def);
-  number_p_->align_dir_ = LEFT;
 }
 
 Molecule*
@@ -38,8 +33,6 @@ Volta_spanner::do_brew_molecule_p () const
   if (!column_arr_.size ())
     return mol_p;
 
-  if (!visible_b_)
-    return mol_p;
 
   Real internote_f = paper_l ()->get_realvar (interline_scm_sym)/2.0;
 
@@ -47,7 +40,9 @@ Volta_spanner::do_brew_molecule_p () const
   Real w = extent (X_AXIS).length () - dx;
   Molecule volta (lookup_l ()->volta (w, last_b_));
   Real h = volta.dim_.y ().length ();
-  Molecule num (number_p_->get_molecule (paper_l (), LEFT));
+
+  
+  Molecule num (lookup_l ()->text ("volta", number_str_));
   Real dy = column_arr_.top ()->extent (Y_AXIS) [UP] > 
      column_arr_[0]->extent (Y_AXIS) [UP];
   dy += 2 * h;
@@ -59,10 +54,7 @@ Volta_spanner::do_brew_molecule_p () const
     dy = dy >? note_column_arr_[i]->extent (Y_AXIS).max ();
   dy -= h;
 
-  Text_def two_text;
-  two_text.text_str_ = "2";
-  two_text.style_str_ = number_p_->style_str_;
-  Molecule two (two_text.get_molecule (paper_l (), LEFT));
+  Molecule two (lookup_l ()->text ("number", "2"));
   Real gap = two.dim_.x ().length () / 2;
   Offset off (num.dim_.x ().length () + gap, 
              h / internote_f - gap);
@@ -81,9 +73,6 @@ Volta_spanner::do_add_processing ()
       set_bounds (LEFT, column_arr_[0]);
       set_bounds (RIGHT, column_arr_.top ());  
     }
-
-  // number_p_->style_str_ = "number-1";
-  number_p_->style_str_ = "volta";
 }
   
 Interval
index 7d01eca86eefd183140f63d73b7599d6b01e1dc8..15764317c036b02083ce0a03235400a9888966a8 100644 (file)
@@ -22,8 +22,8 @@ bigger = 1
 
 center=0
 
-break = { \penalty = 10000; }
-nobreak = { \penalty = -10000; }
+break =  \penalty  10000; 
+nobreak =  \penalty  -10000; 
 
 major = 0
 minor = 3
index 8f11a285f697477f0bc1445c813b548a1c355b63..6f3107548944df51a8bcab49402347bc8ede85f4 100644 (file)
@@ -109,7 +109,8 @@ VoiceContext = \translator {
 
        % ugh.  Order matters here.
        \consists "Text_engraver";
-       \consists "Script_engraver";
+       \consists "G_script_engraver";
+       \consists "G_script_column_engraver";
        \consists "Rhythmic_column_engraver";
        \consists "Font_size_engraver";
        \consists "Slur_engraver";
index 5a80b52e9ea9b5fc6522599145519bd1386be250..3ff6986bd862680992714cd9706c9ee3d47f7f5c 100644 (file)
@@ -1,68 +1,5 @@
 
-% name = \script {
-% indexstring follow_into_staff same_dir_as_stem above_below_staff symbol_can_beinverted priority }
-%
-
-thumb = \script { "thumb" 0 0 1 0 0 }
-accent = \script { "sforzato"  0 -1 0 0 0 }
-marcato = \script { "marcato" 0 -1 0 1  0 }
-staccatissimo = \script { "staccatissimo" 0  -1 0 1 0 }
-portato= \script { "portato" 0 -1 0 1 0 }
-fermata = \script { "fermata" 0 1 0 1 0 }
-stopped = \script { "stopped" 0 0 1 0 0 }
-staccato = \script { "staccato" 1 -1 0 0 0 }
-tenuto = \script {"tenuto" 1 -1 0 0 0 }
-upbow = \script { "upbow" 0 0 1 0 0 }
-downbow = \script { "downbow" 0 0 1 0 0 }
-lheel = \script { "upedalheel" 0 0 -1  0 0 }
-rheel = \script { "dpedalheel" 0 0 1 0 0 }
-ltoe = \script { "upedaltoe" 0 0 -1 0 0 }
-rtoe = \script { "dpedaltoe" 0 0 1 0 0 }
-turn = \script { "turn" 0 0 1 0 0 }
-open = \script { "open" 0 0 1 0 0 }
-flageolet = \script { "flageolet"  0 0 1 0 0 }
-reverseturn = \script { "reverseturn"   0 0 1 0 0 }
-
-
-% could  we do without this bloat?
-%
-lbheel = \script { "bheel" 0 0 -1  0 0 }
-rbheel = \script { "bheel" 0 0 1 0 0 }
-lbtoe = \script { "btoe" 0 0 -1 0 0 }
-rbtoe = \script { "btoe" 0 0 1 0 0 }
-lfheel = \script { "fheel" 0 0 -1  0 0 }
-rfheel = \script { "fheel" 0 0 1 0 0 }
-lftoe = \script { "ftoe" 0 0 -1 0 0 }
-rftoe = \script { "ftoe" 0 0 1 0 0 }
-
-%
-% left toe:      right heel:
-%
-%                    u     -
-%                    -     u
-%  ---|-----|--   --|x----|x--
-%  ---|-----|--   --|-----|---
-%  --x|----x|--   --|-----|---
-%    ^     -                   
-%    -     ^                   
-%  back  front     back  front
-%
-% 
-% heu, me thought for a moment that order in table_xxx.ly was
-% being translated into priority...
-back = \script { "back" 0 -1 -1  0 0 }
-front = \script { "front" 0 -1 1 0 0 }
-
-trill =\script { "trill" 0 0 1 0 
-       2000   % be above text. 
-}
-
-prall =\script { "prall" 0 0 1 0 0 }
-mordent =\script { "mordent" 0 0 1 0 0 }
-prallprall =\script { "prallprall" 0 0 1 0 0 }
-prallmordent =\script { "prallmordent" 0 0 1 0 0 }
-upprall =\script { "upprall" 0 0 1 0 0 }
-downprall =\script { "downprall" 0 0 1 0 0 }
+\scmfile "script.scm";
 
 "dash-hat" = "marcato"
 "dash-plus" = "stopped"
@@ -70,3 +7,31 @@ downprall =\script { "downprall" 0 0 1 0 0 }
 "dash-bar" = "staccatissimo"
 "dash-larger" = "accent"
 "dash-dot" = "staccato"
+
+
+thumb = \script "thumb"
+accent = \script "accent"
+marcato = \script "marcato"
+staccatissimo = \script "staccatissimo"
+portato = \script "portato"
+fermata = \script "fermata"
+stopped = \script "stopped"
+staccato = \script "staccato"
+tenuto = \script "tenuto"
+upbow = \script "upbow"
+downbow = \script "downbow"
+lheel = \script "lheel"
+rheel = \script "rheel"
+ltoe = \script "ltoe"
+rtoe = \script "rtoe"
+turn = \script "turn"
+open = \script "open"
+flageolet = \script "flageolet"
+reverseturn = \script "reverseturn"
+trill = \script "trill"
+prall = \script "prall"
+mordent = \script "mordent"
+prallprall = \script "prallprall"
+prallmordent = \script "prallmordent"
+upprall = \script "upprall"
+downprall = \script "downprall"
index 922e0fa03ae02ee035a68bd699e7ea07375a7661..018069ed0c6b0ad3881d43b380856cd334415f0e 100644 (file)
@@ -244,7 +244,7 @@ fet_beginchar("Whole diamondhead", "0diamond", "wholediamondhead")
        err_y_a:=0; % no slant
        tilt:=0;
        superness:=0.495;
-       ai_a:=0.400;
+       ai_a:=0.350;
        % ai_bi:=1.23;
        ai_bi:=1.30; % jcn
        % err_y_ai:=0.0938;
index a07a1fcd7e22ac573e6fd52da99467c7d84c77de..9c57c962c9905f6f56ecb9247074372fbb06596f 100644 (file)
 (define (spanbar_non_postbreak_visibility d) (if (= d -1) '(#t . #t) '(#f . #f)))
 
 (define (non_postbreak_visibility d) (if (= d 1) '(#t . #t) '(#f . #f)))
+(define (non_prebreak_visibility d) (if (= d -1) '(#t . #t) '(#f . #f)))
 
 
 ;; Score_span_bars are only visible at start of line
 ;; i.e. if break_dir == RIGHT == 1
 (define Span_bar_engraver_visibility non_postbreak_visibility)
-
+(define mark-visibility non_prebreak_visibility)
 (define Span_score_bar_engraver_visibility postbreak_only_visibility)
 (define Piano_bar_engraver_visibility postbreak_only_visibility)
 (define Staff_group_bar_engraver_visibility postbreak_only_visibility)
     ("volta" . "feta-nummer"))
 )
 
+(define script-alist '())
+(define (articulation-to-scriptdef a)
+  (assoc a script-alist)
+  )
 
 ;; Map style names to TeX font names.  Return false if 
 ;; no font name found. 
                  (set! font-cmd (cached-fontname font-count))
                  (set! font-alist (acons font-name font-cmd font-alist))
                  (set! font-count (+ 1 font-count))
+                 (if (equal? font-name "")
+                     (error "Empty fontname -- SELECT-FONT"))
                  (string-append "\\font" font-cmd "=" font-name font-cmd))
                (cdr font-cmd)))
          ""                            ;no switch needed
     (embedded-ps ((ps-scm 'bezier-sandwich) l)))
 
 
-  (define (start-line)
+  (define (start-line ht)
     (begin
       (clear-fontcache)
-      "\\hbox{%\n")
+      (string-append"\\vbox to " (number->dim ht) "{\\hbox{%\n"))
     )
+  (define (stop-line) 
+    "}\\vss}\\interscoreline")
 
   (define (filledbox breapth width depth height) 
     (string-append 
      "depth " (number->dim depth)
      "height " (number->dim height) " "))
 
-  (define (stop-line) 
-    "}\\interscoreline")
 
 
   (define (text s)
        (else (error "unknown tag -- PS-SCM " action-name))
        )
   )
-  
 
-;
+                                       ;
 ; Russ McManus, <mcmanus@IDT.NET>  
 ; 
 ; I use the following, which should definitely be provided somewhere
diff --git a/scm/script.scm b/scm/script.scm
new file mode 100644 (file)
index 0000000..c1c209f
--- /dev/null
@@ -0,0 +1,38 @@
+;; (name . '((downindexstring . upindexstring)
+;;           follow-into-staff :: bool
+;;           dir-relative-to-stem :: int
+;;           force-dir :: int
+;;           priority :: int
+
+;;TODO?      extra padding :: Real (given in staff spaces)
+
+(set! script-alist
+      (append 
+      '(("thumb" . (("thumb"  . "thumb") #f 0 1 0))
+       ("accent" . (("sforzato" .  "sforzato") #f -1 0 0))
+       ("marcato" . (("dmarcato" . "umarcato") #f -1 0  0))
+       ("staccatissimo" . (("dstaccatissimo" . "ustaccatissimo") #f  -1 0 0 0))
+       ("portato" . (("dportato" . "uportato") #f -1 0 0))
+       ("fermata" . (("dfermata" . "ufermata") #f 1 0 0))
+       ("stopped" . (("stopped" . "stopped") #f 0 1 0))
+       ("staccato" . (("staccato" . "staccato") #t -1 0 -100))
+       ("tenuto" . (("tenuto" . "tenuto") 1 -1 0 0))
+       ("upbow" . (("upbow" . "upbow") #f 0 1 0))
+       ("downbow" . (("downbow" . "downbow") #f 0 1 0))
+       ("lheel" . (("upedalheel" . "upedalheel") #f 0 -1  0))
+       ("rheel" . (("dpedalheel" . "dpedalheel") #f 0 1 0))
+       ("ltoe" . (("upedaltoe" . "upedaltoe") #f 0 -1 0))
+       ("rtoe" . (("dpedaltoe" . "dpedaltoe") #f 0 1 0))
+       ("turn" . (("turn" . "turn") #f 0 1 0))
+       ("open" . (("open" . "open") #f 0 1 0))
+       ("flageolet" . (("flageolet" . "flageolet")  0 0 1 0))
+       ("reverseturn" . (("reverseturn" . "reverseturn")   0 0 1 0))
+       ("trill" . (("trill" . "trill") #f 0 1 2000))
+       ("prall" . (("prall" . "prall") #f 0 1 0))
+       ("mordent" . (("mordent" . "mordent") #f 0 1 0))
+       ("prallprall" . (("prallprall" . "prallprall") #f 0 1 0))
+       ("prallmordent" . (("prallmordent" . "prallmordent") #f 0 1 0))
+       ("upprall" . (("upprall" . "upprall") #f 0 1 0))
+       ("downprall" . (("downprall" . "downprall") #f 0 1 0)))
+      script-alist)
+      )