]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.106
authorfred <fred>
Wed, 27 Mar 2002 00:32:53 +0000 (00:32 +0000)
committerfred <fred>
Wed, 27 Mar 2002 00:32:53 +0000 (00:32 +0000)
17 files changed:
CHANGES
NEWS
VERSION
input/test/manual-clef.ly [new file with mode: 0644]
lily/clef-engraver.cc
lily/include/context-specced-music.hh
lily/key-engraver.cc
lily/key-performer.cc
lily/lily-guile.cc
lily/parser.yy
lily/piano-pedal-engraver.cc
lily/property-engraver.cc
lily/translator-group.cc
ly/engraver.ly
scm/element-descriptions.scm
scm/lily.scm
scm/translator-description.scm

diff --git a/CHANGES b/CHANGES
index c72d0969f56ff677f67cdc6bd480c84f10062f5c..ecca8a8e2de7bcc8653525188cf668c06931f32b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,26 @@
-1.3.104.jcn3
+1.3.105.jcn1
 ============
 
+* Makeinfo html documentation generation fixes.
+
+1.3.105.uu1
+===========
+
+* Remove Bar_req, \bar is now a frontend to setting Score.whichBar
+
+* Move Context_specced_music::translator_{type,id}_str_ into music
+properties.
+
+* Don't make line breaks during note playing.
+
+* Clef engraver rewrite. Clef-engraver is now controlled through
+properties clefPosition, clefGlyph, clefOctavation. The \clef command
+is just a front-end to these, see scm/lily.scm, function
+clef-name-to-properties.  See also input/test/manual-clef.ly
+
+1.3.105
+=======
+
 * Bit of temporary makefile hacking to stay in sync with makeinfo patch.
 
 * Separate interface description (test phase).
@@ -213,7 +233,7 @@ input/test/instrument-name-grandstaff.ly
 
 * Moved Text_script_req's text_ member into mus-property.
 
-* Renamed ChordName to ChordNames, for consistancy.
+* Renamed ChordName to ChordNames, for consistency.
 
 * Resurrected most of chord names, superscripting and kerning
   is currently broken, though.
@@ -363,7 +383,6 @@ Break_align_item::space-alist, Chord_name::chord-name-function
 
 * Added \property combineParts: part combiner switched off by default.
 
-
 * Remove all print methods.
 
 * Use Scope::try_retrieve if possible.
diff --git a/NEWS b/NEWS
index 2f2f4347ae63b7dfe9d17865e134590631ef3016..fd86eddfd993953035312f45eb082588657fc443 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,8 @@ internals: LilyPond is smaller, cleaner, more flexible, etc.
 
 * New font selection scheme similar to Latex-NFSS.
 
+* Medieval notation features: clefs, custodes
+
 * Piano pedal support, Arpeggios, Custodes
 
 * MIDI: dynamics, tempo changes
@@ -38,6 +40,8 @@ internals: LilyPond is smaller, cleaner, more flexible, etc.
 
 * Finished ouverture Coriolan as full orchestral score example.
 
+* Self-documenting: generated internal documentation.
+
 * AsciiScript: ASCII-art output 
 
 * Translations into Japanese, French and Russian
diff --git a/VERSION b/VERSION
index 2e7b9bcdf65c3ef29159f8e182b92898b827647f..a70f97234ccd39ef0a99bde7ad07910508f57ffb 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,7 +1,7 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
-PATCH_LEVEL=105
+PATCH_LEVEL=106
 MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
diff --git a/input/test/manual-clef.ly b/input/test/manual-clef.ly
new file mode 100644 (file)
index 0000000..f6b08e0
--- /dev/null
@@ -0,0 +1,26 @@
+\version "1.3.105";
+
+%{
+
+Test clef engraver by setting \property directly. \clef is merely a front-end  to this.
+
+%}
+
+\score { \notes {
+  \property Staff.clefGlyph = #"clefs-F"
+  \property Staff.clefPosition = #2
+  c'4
+  \property Staff.clefGlyph = #"clefs-G"
+  c'4
+  \property Staff.clefGlyph = #"clefs-C"
+
+  c'4
+       \property Staff.clefOctavation = #7 
+  c'4
+       \property Staff.clefOctavation = #0 
+       \property Staff.clefPosition = #0
+  c'4
+       \clef "bla";
+  c'4
+
+}}
index 83eb544afe64ebca957910a826afa3d4cdc79ce4..818e3544a0f93c0c417ceda23a183713a797534c 100644 (file)
@@ -32,86 +32,81 @@ public:
   Clef_engraver ();
 
   Direction octave_dir_;
-  bool  first_b_;
 
 protected:
   virtual void do_process_music ();
   virtual void do_pre_move_processing ();
   virtual void do_creation_processing ();
   virtual void do_post_move_processing ();
-  virtual bool do_try_music (Music*);
   virtual void acknowledge_element (Score_element_info);
 
 private:
   Item * clef_p_;
   Item * octavate_p_;
   Clef_change_req * clef_req_l_;
-  
+
+  SCM prev_glyph_;
+  SCM prev_cpos_;
+  SCM prev_octavation_;
   void create_clef ();
-  bool set_type (String);
+  void set_central_c (SCM, SCM, SCM);
+  void set_glyph ();
 };
 
 Clef_engraver::Clef_engraver ()
 {
-  first_b_ = true;
   clef_p_ = 0;
   clef_req_l_ = 0;
   octave_dir_ = CENTER;
   octavate_p_ = 0;
+
+  /*
+    will trigger a clef at the start since #f != '()
+   */
+  prev_cpos_ = prev_glyph_ = SCM_BOOL_F;
 }
 
-bool
-Clef_engraver::set_type (String s)
+void
+Clef_engraver::set_central_c (SCM glyph,SCM clefpos, SCM octavation)
 {
-  if (s.right_str (2) == "_8") // Down one octave
-    {
-      octave_dir_ = DOWN;
-      s = s.left_str (s.length_i () - 2);
-    }
-  else if (s.right_str (2) == "^8") // Up one octave
-    {
-      octave_dir_ = UP;
-      s = s.left_str (s.length_i () - 2);
-    }
-  else
-    octave_dir_ = CENTER;
+  prev_cpos_ = clefpos;
+  prev_glyph_ = glyph;
+  prev_octavation_ = octavation;
 
-  SCM c = get_property ("supportedClefTypes");
   SCM p = get_property ("clefPitches");
-  
-  if (gh_list_p (c))
+  int c0_position =  0;
+  if (gh_list_p (p))
     {
-      SCM found = scm_assoc (ly_str02scm (s.ch_C ()), c);
+      SCM found = scm_assoc (glyph, p);
       if (found == SCM_BOOL_F)
-       return false;
-      
-      SCM glyph = gh_cadr (found);
-      SCM pos = gh_caddr (found);
-
-      daddy_trans_l_->set_property ("clefGlyph", glyph);
-      daddy_trans_l_->set_property ("clefPosition", pos);
-
-      found = scm_assoc (glyph, p);
-      if (found == SCM_BOOL_F)
-       return false;
+       {
+         c0_position =0;
+       }
+      else
+       {
+         c0_position =  gh_scm2int (gh_cdr (found));
 
-      int c0_position = gh_scm2int (pos) + gh_scm2int (gh_cdr (found));
-      daddy_trans_l_->set_property ("centralCPosition", gh_int2scm (c0_position));
+         if (gh_number_p (octavation))
+             c0_position -= gh_scm2int (octavation);
+      
+         if (gh_number_p (clefpos))
+           c0_position += gh_scm2int (clefpos);
+       }
+      
     }
-
-  int c0_position = gh_scm2int (get_property ("centralCPosition"));
-  c0_position -= (int)octave_dir_ * 7;
   daddy_trans_l_->set_property ("centralCPosition", gh_int2scm (c0_position));
+}
 
+void
+Clef_engraver::set_glyph ()
+{
+  SCM glyph_sym = ly_symbol2scm ("glyph");
+  SCM glyph = get_property ("clefGlyph");
 
   SCM basic = ly_symbol2scm ("Clef");
-  SCM gl = ly_symbol2scm ("glyph");
-
-  daddy_trans_l_->execute_single_pushpop_property (basic, gl, SCM_UNDEFINED);
-  daddy_trans_l_->execute_single_pushpop_property (basic, gl,
-                                                  get_property ("clefGlyph"));
-
-  return true;
+  
+  daddy_trans_l_->execute_single_pushpop_property (basic, glyph_sym, SCM_UNDEFINED);
+  daddy_trans_l_->execute_single_pushpop_property (basic, glyph_sym, glyph);
 }
 
 /** 
@@ -154,31 +149,9 @@ Clef_engraver::acknowledge_element (Score_element_info info)
 void
 Clef_engraver::do_creation_processing ()
 {
-  daddy_trans_l_->set_property ("clefPosition", gh_int2scm (0));
-  daddy_trans_l_->set_property ("clefGlyph", SCM_EOL);
-  daddy_trans_l_->set_property ("centralCPosition", gh_int2scm (0));
-
-  SCM def = get_property ("defaultClef");
-  if (gh_string_p (def))
-    {
-      set_type (ly_scm2string (def));
-    }
 }
 
-bool
-Clef_engraver::do_try_music (Music * r_l)
-{
-  if (Clef_change_req *cl = dynamic_cast <Clef_change_req *> (r_l))
-    {
-      clef_req_l_ = cl;
-      String t = ly_scm2string (cl->get_mus_property ("clef-type"));
-      if (!set_type (t))
-       cl->origin ()->warning (_ ("unknown clef type"));
 
-      return true;
-    }
-  return false;
-}
 
 void
 Clef_engraver::create_clef ()
@@ -186,16 +159,17 @@ Clef_engraver::create_clef ()
   if (!clef_p_)
     {
       Item *c= new Item (get_property ("Clef"));
-      announce_element (c, clef_req_l_);
+      announce_element (c, 0);
 
       Staff_symbol_referencer::set_interface (c);
       
       clef_p_ = c;
     }
   Staff_symbol_referencer::set_position (clef_p_,
-                                        gh_scm2int (get_property ("clefPosition")
-                                                    ));
-  if (octave_dir_)
+                                        gh_scm2int (get_property ("clefPosition")));
+
+  SCM oct =  get_property("clefOctavation");
+  if (gh_number_p (oct) && gh_scm2int (oct))
     {
       Item * g = new Item (get_property ("OctavateEight"));
 
@@ -204,18 +178,28 @@ Clef_engraver::create_clef ()
       g->set_parent (clef_p_, Y_AXIS);
       g->set_parent (clef_p_, X_AXIS);
 
-      g->set_elt_property ("direction", gh_int2scm (octave_dir_));
+      g->set_elt_property ("direction", gh_int2scm (sign (gh_scm2int (oct))));
       octavate_p_ = g;
-      announce_element (octavate_p_, clef_req_l_);
+      announce_element (octavate_p_, 0);
     }
 }
 
 void
 Clef_engraver::do_process_music ()
 {
-  if (clef_req_l_ || first_b_)
+  SCM glyph = get_property ("clefGlyph");
+  SCM clefpos = get_property ("clefPosition");
+  SCM octavation = get_property ("clefOctavation");
+  
+  if (scm_equal_p (glyph, prev_glyph_) == SCM_BOOL_F
+      || scm_equal_p (clefpos, prev_cpos_) == SCM_BOOL_F
+      || scm_equal_p (octavation, prev_octavation_) == SCM_BOOL_F)    
     {
+      set_glyph();
+      set_central_c (glyph, clefpos, octavation);
+       
       create_clef ();
+
       clef_p_->set_elt_property ("non-default", SCM_BOOL_T);
     }
 }
@@ -246,14 +230,11 @@ Clef_engraver::do_pre_move_processing ()
 
       octavate_p_ = 0;
     }
-
-  first_b_ = 0;
 }
 
 void
 Clef_engraver::do_post_move_processing ()
 {
-  clef_req_l_ = 0;
 }
 
 ADD_THIS_TRANSLATOR (Clef_engraver);
index abcf2c40f3710a810c88c1edc86761df273c4322..e6eb7c8b0f1128d6021d94f2d4632fe7cafe67ec 100644 (file)
 
 class Context_specced_music : public Music_wrapper
 {
-public:
+
+/*
   /// The kind of translation needed for this music.  
   String translator_type_str_;
 
   /// what identification for the translation unit
   String translator_id_str_;
+*/
+public:  
   Context_specced_music (Music*);
   VIRTUAL_COPY_CONS(Music);
 
index eff8a73a20a169b9eba72f8cc127a371639370fd..46f4d3f656f5ec93ea7d69d4c644533425ed9524 100644 (file)
@@ -150,7 +150,7 @@ void
 Key_engraver::read_req (Key_change_req const * r)
 {
   SCM p = r->get_mus_property ("pitch-alist");
-  if (p == SCM_UNDEFINED)
+  if (!gh_pair_p (p))
     return;
 
   SCM n = scm_list_copy (p);
index 79fdac637e6468d4ed7882c82a072b88f93921df..f13cc85d7d6f828b5bf053497623dcdd335878a4 100644 (file)
@@ -26,7 +26,8 @@ Key_performer::~Key_performer ()
 void
 Key_performer::do_process_music ()
 {
-  if (key_req_l_ && key_req_l_->get_mus_property ("pitch-alist") != SCM_UNDEFINED)
+  if (key_req_l_ &&
+      gh_list_p (key_req_l_->get_mus_property ("pitch-alist")))
     {
       audio_p_ = new Audio_key (); // *key_req_l_->key_);
       Audio_element_info info (audio_p_, key_req_l_);
index 7f56dbcf3e73575c67ca34829d0a0a7dea100cdd..91096bce8efe606d8f758e9ba17a6e281548a658 100644 (file)
@@ -390,11 +390,6 @@ wave_sweep_goodbye (void *dummy1, void *dummy2, void *dummy3)
 }
 #endif
 
-SCM
-undefd ()
-{
-  return SCM_UNDEFINED;
-}
 
 #include "version.hh"
 SCM
@@ -413,7 +408,7 @@ init_functions ()
   scm_make_gsubr ("ly-version", 0, 0, 0, (Scheme_function_unknown)ly_warning);  
   scm_make_gsubr ("ly-gulp-file", 1,0, 0, (Scheme_function_unknown)ly_gulp_file);
   scm_make_gsubr ("dir?", 1,0, 0, (Scheme_function_unknown)ly_isdir_p);
-  scm_make_gsubr ("undefd", 0,0, 0, (Scheme_function_unknown)undefd);  
+
   scm_make_gsubr ("ly-number->string", 1, 0,0, (Scheme_function_unknown) ly_number2string);
 
 
index 76d6d7e1696848d414a0d474d7138c3c455b2acb..6853bc91fd8e0eb963130a490d45f858d8428d66 100644 (file)
@@ -251,7 +251,7 @@ yylex (YYSTYPE *s,  void * v_l)
 %type <outputdef>  music_output_def_body
 %type <request> shorthand_command_req
 %type <request>        post_request 
-%type <request> command_req verbose_command_req
+%type <music> command_req verbose_command_req
 %type <request>        extender_req
 %type <request> hyphen_req
 %type <scm>    string bare_number number_expression
@@ -729,9 +729,8 @@ Composite_music:
        CONTEXT STRING Music    {
                Context_specced_music *csm =  new Context_specced_music ($3);
 
-               csm->translator_type_str_ = ly_scm2string ($2);
-               csm->translator_id_str_ = "";
-
+               csm->set_mus_property ("context-type",$2);
+               csm->set_mus_property ("context-id", ly_str02scm (""));
 
                $$ = csm;
        }
@@ -748,8 +747,8 @@ Composite_music:
        | CONTEXT STRING '=' STRING Music {
                Context_specced_music *csm =  new Context_specced_music ($5);
 
-               csm->translator_type_str_ = ly_scm2string ($2);
-               csm->translator_id_str_ = ly_scm2string ($4);
+               csm->set_mus_property ("context-type", $2);
+               csm->set_mus_property ("context-id", $4);
 
                $$ = csm;
        }
@@ -854,7 +853,7 @@ property_def:
                $$ = csm;
                $$->set_spot (THIS->here_input ());
 
-               csm-> translator_type_str_ = ly_scm2string ($2);
+               csm-> set_mus_property ("context-type", $2);
        }
        | PROPERTY STRING '.' STRING PUSH embedded_scm '=' embedded_scm {
                Music *t = new Music;
@@ -866,7 +865,7 @@ property_def:
                $$ = csm;
                $$->set_spot (THIS->here_input ());
 
-               csm-> translator_type_str_ = ly_scm2string ($2);
+               csm-> set_mus_property ("context-type", $2);
        }
        | PROPERTY STRING '.' STRING POP embedded_scm {
                Music *t = new Music;
@@ -878,7 +877,7 @@ property_def:
                $$ = csm;
                $$->set_spot (THIS->here_input ());
 
-               csm-> translator_type_str_ = ly_scm2string ($2);
+               csm-> set_mus_property ("context-type", $2);
        }
        ;
 
@@ -912,6 +911,19 @@ command_element:
                $$-> set_spot (THIS->here_input ());
                $1-> set_spot (THIS->here_input ());
        }
+       | BAR STRING ';'                        {
+               Music *t = new Music;
+
+               t->set_mus_property ("type", ly_symbol2scm ("property-set"));
+               t->set_mus_property ("symbol", ly_symbol2scm ("whichBar"));
+               t->set_mus_property ("value", $2);
+
+               Context_specced_music *csm = new Context_specced_music (t);
+               $$ = csm;
+               $$->set_spot (THIS->here_input ());
+
+               csm->set_mus_property ("context-type", ly_str02scm ("Score"));
+       }
        | PARTIAL duration_length ';'   {
                Music * p = new Music;
                p->set_mus_property ("symbol", ly_symbol2scm ( "measurePosition"));
@@ -922,12 +934,31 @@ command_element:
                delete $2; // ugh
                Context_specced_music * sp = new Context_specced_music (p);
                $$ =sp ;
-               sp-> translator_type_str_ = "Score";
+               sp-> set_mus_property ("context-type", ly_str02scm ( "Score"));
+       }
+       | CLEF STRING ';' {
+               SCM func = scm_eval2 (ly_symbol2scm ("clef-name-to-properties"), SCM_EOL);
+               SCM result = gh_call1 (func, $2);
+
+               SCM l = SCM_EOL; 
+               for (SCM s = result ; gh_pair_p (s); s = gh_cdr (s)) {
+                       Music * p = new Music;
+                       for (SCM k = gh_car (s) ; gh_pair_p (k); k = gh_cdr (k)) {
+                               p->set_mus_property (gh_caar (k), gh_cdar (k));
+                       }
+                       l = gh_cons (p->self_scm (), l);
+                       scm_unprotect_object (p->self_scm ());
+               }
+               Sequential_music * seq = new Sequential_music (l);
+
+               Context_specced_music * sp = new Context_specced_music (seq);
+               $$ =sp ;
+               sp-> set_mus_property("context-type", ly_str02scm("Staff"));
        }
        ;
 
 command_req:
-       shorthand_command_req
+       shorthand_command_req   { $$ = $1; }
        | verbose_command_req semicolon { $$ = $1; }
        ;
 
@@ -963,11 +994,7 @@ shorthand_command_req:
 
 
 verbose_command_req:
-       
-       BAR STRING                      {
-               $$ = new Bar_req (ly_scm2string ($2));
-       }
-       | COMMANDSPANREQUEST bare_int STRING {
+       COMMANDSPANREQUEST bare_int STRING {
                Span_req * sp_p = new Span_req;
                sp_p-> set_span_dir ( Direction($2));
                sp_p->set_mus_property ("span-type",$3);
@@ -1011,11 +1038,6 @@ verbose_command_req:
        | tempo_request {
                $$ = $1;
        }
-       | CLEF STRING {
-               $$ = new Clef_change_req;
-               $$->set_mus_property ("clef-type", $2);
-
-       }
        | KEY {
                Key_change_req *key_p= new Key_change_req;
                $$ = key_p;
index a510a141ff5835205df2d15eff4e7b0d2645d34c..3f09f169e1579d2bddc1ca60bc7f59fa1453ed00 100644 (file)
@@ -134,7 +134,7 @@ Piano_pedal_engraver::do_process_music ()
 {
   for (Pedal_info*p = info_list_; p->name_; p ++)
     {
-      SCM s = SCM_UNDEFINED;
+      SCM s = SCM_EOL;
       if (p->req_l_drul_[STOP] && p->req_l_drul_[START])
        {
          if (!p->start_req_l_)
index baddf06bb6999e70cb79cbb886da892cefa0c98f..9861866e82442545206b97bdfc2f00153a1dd147 100644 (file)
@@ -109,7 +109,7 @@ Property_engraver::apply_properties (SCM p, Score_element *e, Translator_group*o
   
       SCM val = get_property (prop_sym);
 
-      if (val == SCM_UNDEFINED)
+      if (val == SCM_EOL)
        ;                       // Not defined in context.
       else if (gh_apply (type_p, scm_listify (val, SCM_UNDEFINED))
               == SCM_BOOL_T)   // defined and  right type: do it
@@ -135,16 +135,16 @@ Property_engraver::apply_properties (SCM p, Score_element *e, Translator_group*o
       else
 
        /*
-           we don't print a warning if VAL == #f, because we would
+           we don't print a warning if VAL == (), because we would
            get lots of warnings when we restore stuff to default, eg.
 
-           slurDash = #1 [...] slurDash = ##f
+           slurDash = #1 [...] slurDash = ()
 
            should not cause "type error: slurDash expects number not
-           boolean"
+           boolean
 
        */
-       if (val != SCM_BOOL_F)
+       if (val != SCM_EOL)
          {                     // not the right type: error message.
            SCM errport = scm_current_error_port ();
            warning (_("Wrong type for property"));
index cf813de9636d8b6610c2573e5bd8410244a5ee7e..1b85d8113a1b147d3a14fb24ef7c279dba2c4de9 100644 (file)
@@ -282,12 +282,12 @@ Translator_group::where_defined (SCM sym) const
 }
 
 /*
-  TODO: return SCM_EOL iso. SCM_UNDEFINED when not found.
+  return SCM_EOL when not found.
 */
 SCM
 Translator_group::get_property (SCM sym) const
 {
-  SCM val =SCM_UNDEFINED;
+  SCM val =SCM_EOL;
   if (properties_dict ()->try_retrieve (sym, &val))
     return val;
 
@@ -322,10 +322,6 @@ Translator_group::execute_single_pushpop_property (SCM prop, SCM eltprop, SCM va
        {
          SCM prev = get_property (prop);
 
-         /*
-           we don't tack onto SCM_UNDEFINED, because it creates
-           errors down the line, if we do scm_assoc().
-          */
          if (gh_pair_p (prev) || prev == SCM_EOL)
            {
              bool ok = true;
@@ -333,6 +329,13 @@ Translator_group::execute_single_pushpop_property (SCM prop, SCM eltprop, SCM va
              SCM errport = scm_current_error_port ();
              
              SCM meta = scm_assoc (ly_symbol2scm ("meta"), prev);
+
+             /*
+               We're probably in a performer.
+              */
+             if (!gh_pair_p (meta))
+               return;
+             
              SCM props = scm_assoc (ly_symbol2scm ("properties"), gh_cdr (meta));
              SCM type_p = scm_assoc (eltprop, gh_cdr (props));
              if (!gh_pair_p (type_p))
@@ -348,7 +351,8 @@ Translator_group::execute_single_pushpop_property (SCM prop, SCM eltprop, SCM va
              else
                {
                  type_p = gh_cdr (type_p);
-                 if (gh_call1 (type_p, val) == SCM_BOOL_F)
+                 if (val != SCM_EOL
+                     && gh_call1 (type_p, val) == SCM_BOOL_F)
                    {
                      ok = false;
                      scm_puts (_("Failed typecheck for #'").ch_C (),errport);
index 383bb18c8c7541cbc97034cb4b522c626acb7394..be2d0f15e70893228453dd3c21a56de5e0c52444 100644 (file)
@@ -366,59 +366,11 @@ ScoreContext = \translator {
        splitInterval = #'(0 . 1)
        changeMoment = #`(,(make-moment 0 0) . ,(make-moment 1 512))
 
-       defaultClef = #"treble"
-
        StaffMinimumVerticalExtent = #(cons -4.0 4.0)
 
        barAuto = ##t
        voltaVisibility = ##t
        %  name, glyph id, clef position 
-       supportedClefTypes = #'(
-         ("treble" . ("clefs-G" -2))
-         ("violin" . ("clefs-G" -2))
-         ("G" . ("clefs-G" -2))
-         ("G2" . ("clefs-G" -2))
-         ("french" . ("clefs-G" -4 ))
-         ("soprano" . ("clefs-C" -4 ))
-         ("mezzosoprano" . ("clefs-C" -2 ))
-         ("alto" . ("clefs-C" 0 ))
-         ("tenor" . ("clefs-C" 2 ))
-         ("baritone" . ("clefs-C" 4 ))
-         ("varbaritone"  . ("clefs-F" 0))
-         ("bass" . ("clefs-F" 2 ))
-         ("F" . ( "clefs-F" 2))
-         ("subbass" . ("clefs-F" 4))
-         ("vaticana_do1" . ("clefs-vaticana_do" -1))
-         ("vaticana_do2" . ("clefs-vaticana_do" 1))
-         ("vaticana_do3" . ("clefs-vaticana_do" 3))
-         ("vaticana_fa1" . ("clefs-vaticana_fa" -1))
-         ("vaticana_fa2" . ("clefs-vaticana_fa" 1))
-         ("medicaea_do1" . ("clefs-medicaea_do" -1))
-         ("medicaea_do2" . ("clefs-medicaea_do" 1))
-         ("medicaea_do3" . ("clefs-medicaea_do" 3))
-         ("medicaea_fa1" . ("clefs-medicaea_fa" -1))
-         ("medicaea_fa2" . ("clefs-medicaea_fa" 1))
-         ("hufnagel_do1" . ("clefs-hufnagel_do" -1))
-         ("hufnagel_do2" . ("clefs-hufnagel_do" 1))
-         ("hufnagel_do3" . ("clefs-hufnagel_do" 3))
-         ("hufnagel_fa1" . ("clefs-hufnagel_fa" -1))
-         ("hufnagel_fa2" . ("clefs-hufnagel_fa" 1))
-         ("hufnagel" . ("clefs-hufnagel_do_fa" 4))
-         ("mensural1_c1" . ("clefs-mensural1_c" -4))
-         ("mensural1_c2" . ("clefs-mensural1_c" -2))
-         ("mensural1_c3" . ("clefs-mensural1_c" 0))
-         ("mensural1_c4" . ("clefs-mensural1_c" 2))
-         ("mensural2_c1" . ("clefs-mensural2_c" -4))
-         ("mensural2_c2" . ("clefs-mensural2_c" -2))
-         ("mensural2_c3" . ("clefs-mensural2_c" 0))
-         ("mensural2_c4" . ("clefs-mensural2_c" 2))
-         ("mensural2_c5" . ("clefs-mensural2_c" 4))
-         ("mensural3_c1" . ("clefs-mensural3_c" -2))
-         ("mensural3_c2" . ("clefs-mensural3_c" 0))
-         ("mensural3_c3" . ("clefs-mensural3_c" 2))
-         ("mensural3_c4" . ("clefs-mensural3_c" 4))
-         ("mensural_f" . ("clefs-mensural_f" 2))
-       )
        % where is c0 in this clef?
        clefPitches = #'(("clefs-G" . -4)
          ("clefs-C" . 0)
@@ -435,9 +387,11 @@ ScoreContext = \translator {
          ("clefs-mensural3_c" . 0)
          ("clefs-mensural_f" . 0))
 
+       clefGlyph = #"clefs-G"
+       clefPosition = #-2
+
         automaticPhrasing = ##t;
        alignmentReference = \down;
-       defaultClef = #"treble"
        defaultBarType = #"|"
 
        explicitClefVisibility = #all-visible
index cb5f5438d175d8e2d7e11878524098387a58a61d..9adc6639cb23379949c2d8c515f031d883644e68 100644 (file)
                (Y-offset-callbacks . (,Side_position::aligned_side))
                (molecule-callback . ,Text_item::brew_molecule)
                 (font-shape . italic)
+               (font-family . roman)
                (meta . ,(element-description "OctavateEight" text-interface font-interface ))
        ))
        
index be6872c6779dd92b43660812b78496e492f19117..6876a9cb6563701963920ccfe40e268c9616de0a 100644 (file)
   (eval-string (ly-gulp-file "chord-names.scm"))
   (eval-string (ly-gulp-file "element-descriptions.scm"))
  )
+
+
+;;
+;; (name . (glyph clef-position octavation))
+;; -- the name clefOctavation is misleading the value 7 is 1 octave not 7 Octaves.
+;;
+(define supported-clefs '(
+         ("treble" . ("clefs-G" -2 0))
+         ("violin" . ("clefs-G" -2 0))
+         ("G" . ("clefs-G" -2 0))
+         ("G2" . ("clefs-G" -2 0))
+         ("french" . ("clefs-G" -4  0))
+         ("soprano" . ("clefs-C" -4  0))
+         ("mezzosoprano" . ("clefs-C" -2  0))
+         ("alto" . ("clefs-C" 0  0))
+         ("tenor" . ("clefs-C" 2  0))
+         ("baritone" . ("clefs-C" 4  0))
+         ("varbaritone"  . ("clefs-F" 0 0))
+         ("bass" . ("clefs-F" 2  0))
+         ("F" . ( "clefs-F" 2 0))
+         ("subbass" . ("clefs-F" 4 0))
+
+         ;; should move mensural stuff to separate file? 
+         ("vaticana_do1" . ("clefs-vaticana_do" -1 0))
+         ("vaticana_do2" . ("clefs-vaticana_do" 1 0))
+         ("vaticana_do3" . ("clefs-vaticana_do" 3 0))
+         ("vaticana_fa1" . ("clefs-vaticana_fa" -1 0))
+         ("vaticana_fa2" . ("clefs-vaticana_fa" 1 0))
+         ("medicaea_do1" . ("clefs-medicaea_do" -1 0))
+         ("medicaea_do2" . ("clefs-medicaea_do" 1 0))
+         ("medicaea_do3" . ("clefs-medicaea_do" 3 0))
+         ("medicaea_fa1" . ("clefs-medicaea_fa" -1 0))
+         ("medicaea_fa2" . ("clefs-medicaea_fa" 1 0))
+         ("hufnagel_do1" . ("clefs-hufnagel_do" -1 0))
+         ("hufnagel_do2" . ("clefs-hufnagel_do" 1 0))
+         ("hufnagel_do3" . ("clefs-hufnagel_do" 3 0))
+         ("hufnagel_fa1" . ("clefs-hufnagel_fa" -1 0))
+         ("hufnagel_fa2" . ("clefs-hufnagel_fa" 1 0))
+         ("hufnagel" . ("clefs-hufnagel_do_fa" 4 0))
+         ("mensural1_c1" . ("clefs-mensural1_c" -4 0))
+         ("mensural1_c2" . ("clefs-mensural1_c" -2 0))
+         ("mensural1_c3" . ("clefs-mensural1_c" 0 0))
+         ("mensural1_c4" . ("clefs-mensural1_c" 2 0))
+         ("mensural2_c1" . ("clefs-mensural2_c" -4 0))
+         ("mensural2_c2" . ("clefs-mensural2_c" -2 0))
+         ("mensural2_c3" . ("clefs-mensural2_c" 0 0))
+         ("mensural2_c4" . ("clefs-mensural2_c" 2 0))
+         ("mensural2_c5" . ("clefs-mensural2_c" 4 0))
+         ("mensural3_c1" . ("clefs-mensural3_c" -2 0))
+         ("mensural3_c2" . ("clefs-mensural3_c" 0 0))
+         ("mensural3_c3" . ("clefs-mensural3_c" 2 0))
+         ("mensural3_c4" . ("clefs-mensural3_c" 4 0))
+         ("mensural_f" . ("clefs-mensural_f" 2 0))
+       )
+)
+
+(define (clef-name-to-properties cl)
+  (let ((e (assoc cl supported-clefs))
+       )
+    (if (pair? e)
+       `(((symbol . clefGlyph)
+          (type . property-set)
+          (value . ,(cadr e))
+          )
+         ((symbol . clefPosition)
+          (type . property-set)
+          (value . ,(caddr e))
+          )
+         ((symbol . clefOctavation)
+          (type . property-set)
+          (value . ,(caddr (cdr e)))
+         )
+         )
+       (begin
+         (ly-warn (string-append "Unknown clef type `" cl "'\nSee scm/lily.scm for supported clefs"))
+         '())
+    )))
index 61badb5ef96434fc42661599cc7344a119d40c3d..ee58d6ba18e132743138c700a50bfce2334c8f5b 100644 (file)
@@ -148,14 +148,13 @@ given in an @code{\alternative}.
      "Determine and set reference point for pitches"
      '(Clef OctavateEight)
      (list
-      (translator-property-description 'supportedClefTypes
-                                      list? "Clef settings supported. The value is an association list contain entries (NAME . (GLYPH . POSITION)), where  NAME is the clef name (alto, baritone, etc.), GLYPH the glyph name, POSITION an integer where the center symbol should go.")
-      (translator-property-description 'clefPosition number? " where the center of the symbol should go")
-      (translator-property-description 'clefGlyph string? "name of the symbol within the music font")
-      (translator-property-description 'centralCPosition number? "place of the central C. ")
-      (translator-property-description 'defaultClef string? "generate this clef at the very start of this staff. If not set, don't generate a clef")
-      (translator-property-description 'explicitClefVisibility procedure? "visibility-lambda function for clefs entered as \clef.")
-      (translator-property-description 'clefPitches list? "alist mapping GLYPHNAME to the position of the central C for that symbol")
+      (translator-property-description 'clefPosition number? "Where should the center of the symbol go?")
+      (translator-property-description 'clefGlyph string? "Name of the symbol within the music font")
+      (translator-property-description 'centralCPosition number? "Place of the central C. Usually determined by looking at clefPosition and clefGlyph.")
+      (translator-property-description 'clefOctavation integer? "Add
+this much extra octavation. Values of 7 and -7 are common.")
+      (translator-property-description 'explicitClefVisibility procedure? "visibility-lambda function for clef changes.")
+      (translator-property-description 'clefPitches list? "an alist mapping GLYPHNAME to the position of the central C for that symbol")
 
       )))