]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.2
authorfred <fred>
Tue, 26 Mar 2002 22:42:59 +0000 (22:42 +0000)
committerfred <fred>
Tue, 26 Mar 2002 22:42:59 +0000 (22:42 +0000)
12 files changed:
Documentation/programmer/regression-test.tely
input/test/key-clefs.ly [new file with mode: 0644]
input/test/tie-accidental.ly [new file with mode: 0644]
lily/break-align-item.cc
lily/include/lily-guile.hh
lily/key-item.cc
lily/lily-guile.cc
lily/local-key-engraver.cc
lily/mark-engraver.cc
lily/multi-measure-rest-engraver.cc
lily/paper-outputter.cc
lily/text-engraver.cc

index fe5ee1dbfdc0ce79df704d38443b36fedf808cad..f878b785869b14f71d897a3c065e7e4740f48486 100644 (file)
@@ -41,7 +41,7 @@ The dots go along as rests are shifted to avoid collisions.
 @mudelafile{dots.fly}
 
 Multiple measure rests do not collide with barlines and clefs.  They
-are not expanded when you set @code{Score.SkipBars}.  Although the
+are not expanded when you set @code{Score.skipBars}.  Although the
 multi-measure-rest is a Spanner, minimum distances are set to keep it
 colliding from barlines. 
 
@@ -129,6 +129,15 @@ The horizontal middle should not overlap with a staffline.
 
 @mudelafile{tie.ly}
 
+When tieing notes with accidentals across a bar boundary, the
+accidental must not be drawn on the note in the new bar.
+Instead, the next note of the same pitch in this bar should always show the
+accidental (even if it's natural).
+Well, and slurring a accidentaled note to a natural one across bar
+boundaries should be explicit...
+
+@mudelafile{tie-accidental.ly}
+
 Beams can be typeset over fixed distance aligned staffs, beam
 beautification doesn't really work, but knees do. Beams should be
 behave well, wherever the switching point is.
diff --git a/input/test/key-clefs.ly b/input/test/key-clefs.ly
new file mode 100644 (file)
index 0000000..4eb5b67
--- /dev/null
@@ -0,0 +1,25 @@
+\include "paper16.ly"
+
+\score { \notes
+  \relative cis' {
+
+% \clef french; % same as octaviated bass
+\clef violin;
+\key cis \major; cis1  \key ces \major; ces
+\clef soprano;
+\key cis \major; cis \key ces \major; ces
+\clef mezzosoprano;
+\key cis \major; cis \key ces \major; ces
+\clef alto;
+\key cis \major; cis \key ces \major; ces
+\clef tenor;
+\key cis \major; cis \key ces \major; ces
+\clef baritone;
+\key cis \major; cis \key ces \major; ces
+\clef bass;
+\key cis \major; cis \key ces \major;  ces
+}
+
+       \paper{\paper_sixteen}
+
+}
diff --git a/input/test/tie-accidental.ly b/input/test/tie-accidental.ly
new file mode 100644 (file)
index 0000000..572fb97
--- /dev/null
@@ -0,0 +1,12 @@
+
+\score { \notes
+  \relative cis' {
+
+\time 4/4;
+gis'2 gis ~ |
+gis gis4 gis |
+g2 gis ~ |
+gis g4 gis |
+g2 gis( |
+)g gis4 gis |
+}
index 32e573a68c17605a7590fae66daab8da8c0068ff..2718fdcd945089fe958640b5cdf43880b9025349 100644 (file)
@@ -32,7 +32,7 @@ Break_align_item::do_pre_processing()
   
   flip (&align_dir_);
   sort_elements ();
-  Real interline= paper_l ()->get_realvar (interline_scm_sym); 
+  Real interline= paper_l ()->get_var ("interline");   
   
   Link_array<Score_element> elems;
   for (int i=0; i < elem_l_arr_.size(); i++) 
@@ -47,7 +47,7 @@ Break_align_item::do_pre_processing()
 
   SCM symbol_list = SCM_EOL;
   Array<Real> dists;
-  SCM current_origin = ly_ch_C_to_scm ("");
+  SCM current_origin = ly_str02scm ("");
   for (int i=0; i <= elems.size (); i++)
     {
       Score_element *next_elt  = i < elems.size ()
@@ -58,14 +58,14 @@ Break_align_item::do_pre_processing()
 
       if (next_elt)
        {
-         next_origin = next_elt->get_elt_property (origin_scm_sym);
+         next_origin = next_elt->get_elt_property ("origin");
          next_origin =
-           (next_origin == SCM_BOOL_F)
-           ? ly_ch_C_to_scm ("")
-           : SCM_CDR (next_origin);
+           (next_origin == SCM_UNDEFINED)
+           ? ly_str02scm ("")
+           : next_origin;
        }
       else
-       next_origin = ly_ch_C_to_scm ("begin-of-note");
+       next_origin = ly_str02scm ("begin-of-note");
       
       SCM extra_space
        = scm_eval (scm_listify (ly_symbol ("break-align-spacer"),
@@ -84,7 +84,8 @@ Break_align_item::do_pre_processing()
   symbol_list  = SCM_CDR (scm_reverse (symbol_list));
   for (int i=0; i <elems.size()-1; i++)
     {
-      elems[i]->set_elt_property (SCM_CAR (symbol_list),
+      String sym_str = ly_scm2string (SCM_CAR (symbol_list));
+      elems[i]->set_elt_property (sym_str,
                                  scm_cons (gh_double2scm (0),
                                            gh_double2scm (dists[i+1])));
 
@@ -93,14 +94,14 @@ Break_align_item::do_pre_processing()
 
 
   // urg
-  SCM first_pair = elems[0]->get_elt_property (minimum_space_scm_sym);
-  if (first_pair == SCM_BOOL_F)
+  SCM first_pair = elems[0]->get_elt_property ("minimum-space");
+  if (first_pair == SCM_UNDEFINED)
     first_pair = gh_cons (gh_double2scm (0.0), gh_double2scm (0.0));
   else
-    first_pair = SCM_CDR (first_pair);
+    first_pair = first_pair;
   
   scm_set_car_x (first_pair, gh_double2scm (-dists[0]));
-  elems[0]->set_elt_property (minimum_space_scm_sym, first_pair);
+  elems[0]->set_elt_property ("minimum-space", first_pair);
   
   Axis_align_item::do_pre_processing();
 
@@ -112,12 +113,12 @@ Break_align_item::do_pre_processing()
   
   Real stretch_distance =0.;
   
-  if (SCM_CAR (symbol_list) == extra_space_scm_sym)
+  if (SCM_CAR (symbol_list) == gh_symbol2scm ("extra-space"))
     {
       spring_len += dists.top ();
       stretch_distance = dists.top ();
     }
-  else if (SCM_CAR (symbol_list) == minimum_space_scm_sym)
+  else if (SCM_CAR (symbol_list) == gh_symbol2scm ("minimum-space"))
     {
       spring_len = spring_len >? dists.top ();
       stretch_distance = spring_len;
@@ -129,11 +130,11 @@ Break_align_item::do_pre_processing()
 
     The pairs are in the format of an interval (ie. CAR <  CDR).
   */
-  column_l ()->set_elt_property (extra_space_scm_sym,
+  column_l ()->set_elt_property ("extra-space",
                                 scm_cons (gh_double2scm (pre_space),
                                           gh_double2scm (spring_len)));
 
-  column_l ()->set_elt_property (stretch_distance_scm_sym,
+  column_l ()->set_elt_property ("stretch-distance",
                                 gh_cons (gh_double2scm (-dists[0]),
                                          gh_double2scm (stretch_distance)));
                                 
@@ -148,12 +149,12 @@ Break_align_item::Break_align_item ()
 void
 Break_align_item::add_breakable_item (Item *it)
 {
-  SCM pr = it->remove_elt_property (break_priority_scm_sym); 
+  SCM pr = it->remove_elt_property ("break-priority"); 
 
-  if (pr == SCM_BOOL_F)
+  if (pr == SCM_UNDEFINED)
     return;
 
-  int priority = gh_scm2int (SCM_CDR (pr));
+  int priority = gh_scm2int (pr);
 
   Score_element * column_l = get_elt_by_priority (priority);
   Axis_group_item * hg=0;
@@ -171,7 +172,7 @@ Break_align_item::add_breakable_item (Item *it)
        warning bells about missing Y refpoints go off later on.
       */
       hg->set_parent (this, Y_AXIS);
-      hg->set_elt_property (ly_symbol ("origin"), ly_ch_C_to_scm (it->name ()));
+      hg->set_elt_property ("origin", ly_str02scm (it->name ()));
 
       pscore_l_->typeset_element (hg);
       add_element_priority (hg, priority);
@@ -182,3 +183,4 @@ Break_align_item::add_breakable_item (Item *it)
   
   hg->add_element (it);
 }
+
index 994489c41131914127e84c1b9fdb00e790a4eefb..dfdf39ffbf075f6236051a5fd6054c85fcb509f0 100644 (file)
@@ -15,7 +15,7 @@
 #include <libguile.h>
 #include "direction.hh"
 
-SCM ly_ch_C_to_scm (char const*c);
+SCM ly_str02scm (char const*c);
 SCM ly_ch_C_eval_scm (char const*c);
 SCM ly_symbol (String name);
 String symbol_to_string (SCM);
@@ -36,7 +36,7 @@ SCM array_to_list (SCM *a , int l);
 void read_lily_scm_file (String);
 void init_lily_guile ();
 
-#include "ly-symbols.hh"
+
 
 void init_ly_protection ();
 unsigned int ly_scm_hash (SCM s);
index d11424b41edaae8cbdcfcb2e51bd5c711b635626..f85303ff71956cca1a4caae7cf182ad6545d8481 100644 (file)
@@ -22,7 +22,7 @@ const int SHARP_TOP_PITCH=4; /*  ais and bis typeset in lower octave */
 Key_item::Key_item ()
 {
   multi_octave_b_ = false;
-  set_elt_property (breakable_scm_sym, SCM_BOOL_T);
+  set_elt_property ("breakable", SCM_BOOL_T);
   set_c_position (0);
 }
 
@@ -73,6 +73,17 @@ Key_item::calculate_position(int p, int a) const
       {
        p -= 7; /* Typeset below c_position */
       }
+    /* Provide for the four cases in which there's a glitch */
+    /* it's a hack, but probably not worth */
+    /* the effort of finding a nicer solution. dl. */
+    if (get_c_position ()==2 && a>0 && p==3)
+      p -= 7;
+    if (get_c_position ()==-3 && a>0 && p==-1)
+      p += 7;
+    if (get_c_position ()==-4 && a<0 && p==-1)
+      p += 7;
+    if (get_c_position ()==-2 && a<0 && p==-3)
+      p += 7;
     return p + get_c_position ();
   }
 }
@@ -131,3 +142,4 @@ Key_item::do_brew_molecule_p() const
 
 
 
+
index b42b34592e93b3788fe0c8db276aefba09bbf8d5..7fd60380af192ffedecf821611b38f51fd60f113 100644 (file)
@@ -20,7 +20,7 @@
 #include "debug.hh"
 
 SCM
-ly_ch_C_to_scm (char const*c)
+ly_str02scm (char const*c)
 {
   // this all really sucks, guile should take char const* arguments!
   return gh_str02scm ((char*)c);
@@ -168,7 +168,7 @@ ly_gulp_file (SCM name)
 
 
   Simple_file_storage f(s);
-  return ly_ch_C_to_scm (f.ch_C());
+  return ly_str02scm (f.ch_C());
 }
 
 void
index 8e773bf05a6e37683a0eb522e7a5e9d8ba2b8bf2..85c857f36951d32b62a7365fd8b7297465418ba6 100644 (file)
@@ -65,14 +65,9 @@ Local_key_engraver::process_acknowledged ()
          Item * support_l = support_l_arr_[i];
          Note_req * note_l = mel_l_arr_[i];
 
-         if (tied_l_arr_.find_l (support_l) && 
-             !note_l->forceacc_b_)
-           {
-             if (!forget)
-               local_key_.set (note_l->pitch_);
-             continue;
-           }
-           
+          if (tied_l_arr_.find_l (support_l) && !forget)
+            local_key_.set (note_l->pitch_);
+
          if (!note_l->forceacc_b_
              && local_key_.different_acc (note_l->pitch_))
            continue;
@@ -82,9 +77,8 @@ Local_key_engraver::process_acknowledged ()
              announce_element (Score_element_info (key_item_p_, 0));         
            }
 
-
          key_item_p_->add_pitch (note_l->pitch_,
-                                 note_l->cautionary_b_);
+                                 note_l->cautionary_b_);
          key_item_p_->add_support (support_l);
          
          if (!forget)
@@ -130,7 +124,7 @@ Local_key_engraver::acknowledge_element (Score_element_info info)
   SCM wg= get_property ("weAreGraceContext", 0);
   
   bool selfgr = gh_boolean_p (wg) &&gh_scm2bool (wg);
-  bool he_gr = info.elem_l_->get_elt_property (grace_scm_sym) != SCM_BOOL_F;
+  bool he_gr = info.elem_l_->get_elt_property ("grace") != SCM_UNDEFINED;
 
   Grace_align_item * gai = dynamic_cast<Grace_align_item*> (info.elem_l_);  
   if (he_gr && !selfgr && gai)
@@ -176,3 +170,4 @@ Local_key_engraver::do_process_requests()
 
 
 ADD_THIS_TRANSLATOR(Local_key_engraver);
+
index 444bd2ffeb46985750cf307502fa1c792a443ee3..17da3985e1425673e0e393c7207f73b83224067b 100644 (file)
@@ -46,8 +46,9 @@ Mark_engraver::do_process_requests ()
     {
       create_items (mark_req_l_);
       text_p_->text_str_ = mark_req_l_->str_;
-      SCM st = gh_str02scm ((text_p_->text_str_.index_any_i ("0123456789")  >= 0 )
+      SCM st = ly_str02scm ((text_p_->text_str_.index_any_i ("0123456789")  >= 0 )
                            ? "mark" : "large");
-      text_p_->set_elt_property (style_scm_sym,  st);
+      text_p_->set_elt_property ("style",  st);
     }
 }
+
index 51ff44654231651913b3ddc33fbe5a4ae4449007..e4e115b4dc6d3affc9abe0b24496aace4882da6f 100644 (file)
@@ -74,8 +74,8 @@ Multi_measure_rest_engraver::do_process_requests ()
       Time_description const *time = get_staff_info().time_C_;
       mmrest_p_ = new Multi_measure_rest;
       if(dynamic_cast<Repetitions_req *> (multi_measure_req_l_))
-       mmrest_p_->set_elt_property (alt_symbol_scm_sym
-                                    ly_ch_C_to_scm ("scripts-repeatsign"));
+       mmrest_p_->set_elt_property ("alt-symbol"
+                                    ly_str02scm ("scripts-repeatsign"));
       announce_element (Score_element_info (mmrest_p_, multi_measure_req_l_));
       start_measure_i_ = time->bars_i_;
     }
@@ -122,3 +122,4 @@ Multi_measure_rest_engraver::do_post_move_processing ()
     }
 }
 
+
index b58ba0eeafe4ba62a307695c30e4419a03074395..9dd7d28729a0e156418e04608e0e9c5ee1e0fe69 100644 (file)
@@ -80,8 +80,8 @@ Paper_outputter::output_header ()
     }
 
   SCM args_scm = 
-    gh_list (ly_ch_C_to_scm (creator.ch_l ()),
-            ly_ch_C_to_scm (generate.ch_l ()), SCM_UNDEFINED);
+    gh_list (ly_str02scm (creator.ch_l ()),
+            ly_str02scm (generate.ch_l ()), SCM_UNDEFINED);
 
 #ifndef NPRINT
   DEBUG_OUT << "output_header\n";
@@ -91,7 +91,7 @@ Paper_outputter::output_header ()
     }
 #endif
 
-  SCM scm = gh_cons (header_scm_sym, args_scm);
+  SCM scm = gh_cons (gh_symbol2scm ("header"), args_scm);
   output_scheme (scm);
 }
 
@@ -140,13 +140,13 @@ Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm)
       if (i->font_)
        {
          output_scheme (gh_list (ly_symbol ("select-font"),
-                                 ly_ch_C_to_scm (symbol_to_string (i->font_).ch_C()),
+                                 ly_str02scm (symbol_to_string (i->font_).ch_C()),
                                  SCM (i->magn_),
                                  SCM_UNDEFINED));
        }
 
       SCM box_scm
-       = gh_list (placebox_scm_sym,
+       = gh_list (gh_symbol2scm ("placebox"),
                   gh_double2scm (a_off.x ()),
                   gh_double2scm (a_off.y ()),
                   SCM(i->func_),
@@ -241,7 +241,7 @@ Paper_outputter::output_font_def (int i, String str)
 {
   SCM scm = gh_list (ly_symbol ("font-def"),
                     gh_int2scm (i),
-                    ly_ch_C_to_scm (str.ch_l ()),
+                    ly_str02scm (str.ch_l ()),
                     SCM_UNDEFINED);
 
   output_scheme (scm);
@@ -252,8 +252,8 @@ Paper_outputter::output_Real_def (String k, Real v)
 {
   
   SCM scm = gh_list (ly_symbol ("lily-def"),
-                    ly_ch_C_to_scm (k.ch_l ()),
-                    ly_ch_C_to_scm (to_str(v).ch_l ()),
+                    ly_str02scm (k.ch_l ()),
+                    ly_str02scm (to_str(v).ch_l ()),
                     SCM_UNDEFINED);
   output_scheme (scm);
 
@@ -265,20 +265,20 @@ Paper_outputter::output_String_def (String k, String v)
 {
   
   SCM scm = gh_list (ly_symbol ("lily-def"),
-                    ly_ch_C_to_scm (k.ch_l ()),
-                    ly_ch_C_to_scm (v.ch_l ()),
+                    ly_str02scm (k.ch_l ()),
+                    ly_str02scm (v.ch_l ()),
                     SCM_UNDEFINED);
   output_scheme (scm);
 
-  gh_define (k.ch_l (), ly_ch_C_to_scm (v.ch_l ()));
+  gh_define (k.ch_l (), ly_str02scm (v.ch_l ()));
 }
 
 void
 Paper_outputter::output_int_def (String k, int v)
 {
   SCM scm = gh_list (ly_symbol ("lily-def"),
-                    ly_ch_C_to_scm (k.ch_l ()),
-                    ly_ch_C_to_scm (to_str (v).ch_l ()),
+                    ly_str02scm (k.ch_l ()),
+                    ly_str02scm (to_str (v).ch_l ()),
                     SCM_UNDEFINED);
   output_scheme (scm);
 
@@ -300,3 +300,4 @@ Paper_outputter::stop_last_line ()
   SCM scm = gh_list (ly_symbol ("stop-last-line"), SCM_UNDEFINED);
   output_scheme (scm);
 }
+
index a2bd01461227a8e05a3848f5c80e2d3802f477ec..cf8c0ea0f635ad013504ce8c6a0bd1b33bc5d833 100644 (file)
@@ -91,7 +91,7 @@ Text_engraver::do_process_requests ()
                               
        }
       ss->set_victim (text);
-      ss->set_elt_property (script_priority_scm_sym,
+      ss->set_elt_property ("script-priority",
                            gh_int2scm (200));
 
       ss->dir_ = r->dir_;
@@ -99,7 +99,7 @@ Text_engraver::do_process_requests ()
       text->text_str_ = r->text_str_;
       
       if (r->style_str_.length_i ())
-       text->set_elt_property (style_scm_sym, ly_ch_C_to_scm (r->style_str_.ch_C()));
+       text->set_elt_property ("style", ly_str02scm (r->style_str_.ch_C()));
       
       SCM empty = get_property ("textEmptyDimension", 0);
       if (gh_boolean_p (empty) && gh_scm2bool (empty))
@@ -134,3 +134,4 @@ Text_engraver::do_post_move_processing ()
 }
 
 ADD_THIS_TRANSLATOR(Text_engraver);
+