OK, here's a patch to allow \clef "G_8"; and more.  Any clef name can
now be postfixed with "_8" to to octavate down, or "^8" to octavate
up.

To quote what will now leave the TODO: The names are of the form

            [FGC]n{[_^]8}   F, G or C clef, on nth line, subscripted
                            or superscripted with an 8.
        So:                 
            G, G2, treble, (== current `violin') G clef on second line.
            F, F4, bass    (== current `bass' )  F clef on fourth line
            G_8, G2_8      G clef on 2nd line, with 8 subscript
            G^8            G clef on 2nd line with 8 superscript
            C1, soprano    (==current `soprano') C clef on first line.
            C2,            (==current `mezzosoprano') C clef on second line
            C3, alto       (==current `alto')      C clef on third line
            C4, tenor      (==current `tenor')     C clef on fourth line
            C5             (==current `baritone') C clef on fifth line)

(Or, at least I think they are.  I've only touched the {[_^]8} part.)

Bugs: The placement of the octave indicator isn't quite perfect yet --
IMHO it should touch the clef.

-- 

Arvid

Generated by make-patch, old = lilypond-0.1.61, new = lilypond-0.1.61.ag1

usage 

        cd lilypond-source-dir; patch -E -p1 < patch-0.1.61.ag1

Patches do not contain automatically generated files, 
i.e. you should rerun autoconf and configure

diff -urN ../lilypond-0.1.61/TODO ./TODO
--- ../lilypond-0.1.61/TODO     Sun May  3 23:40:54 1998
+++ ./TODO      Wed May  6 11:38:17 1998
@@ -95,21 +95,8 @@
        - convert-mudela -e empty.ly
        - redo in python.
 
-      * clefs (AG): The names I'd like are of the form
-
-            [FGC]n{[_^]8}   F, G or C clef, on nth line, subscripted
-                            or superscripted with an 8.
-        So:                 
-            G, G2, treble, (== current `violin') G clef on second line.
-            F, F4, bass    (== current `bass' )  F clef on fourth line
-            G_8, G2_8      G clef on 2nd line, with 8 subscript
-            G^8            G clef on 2nd line with 8 superscript
-            C1, soprano    (==current `soprano') C clef on first line.
-            C2,            (==current `mezzosoprano') C clef on second line
-            C3, alto       (==current `alto')      C clef on third line
-            C4, tenor      (==current `tenor')     C clef on fourth line
-            C5             (==current `baritone') C clef on fifth line)
-
+        * clefs (AG): The "8" should appear closer to the actual clef,
+          touching it.
 
 
        * give Items/Spanners access to unbroken originals      
diff -urN ../lilypond-0.1.61/VERSION ./VERSION
--- ../lilypond-0.1.61/VERSION  Sun May  3 18:56:43 1998
+++ ./VERSION   Wed May  6 11:23:45 1998
@@ -1,7 +1,7 @@
 MAJOR_VERSION=0
 MINOR_VERSION=1
 PATCH_LEVEL=61
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=ag1
 
 # use the above to send patches, always empty for released version:
 # please don't move these comments up; the patch should fail if 
diff -urN ../lilypond-0.1.61/lily/clef-grav.cc ./lily/clef-grav.cc
--- ../lilypond-0.1.61/lily/clef-grav.cc        Sun May  3 22:20:48 1998
+++ ./lily/clef-grav.cc Wed May  6 11:15:46 1998
@@ -20,6 +20,7 @@
   clef_req_l_ =0;
   clef_type_str_ = 0;
   c0_position_i_ =0;
+  octave_dir_ = CENTER;
 }
 
 /*
@@ -28,6 +29,18 @@
 bool
 Clef_engraver::set_type (String s)
 {
+  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;
   clef_type_str_ = s;
   if (clef_type_str_ == "violin" || clef_type_str_ == "G" || clef_type_str_ == "G2")
     c0_position_i_= -6;
@@ -64,6 +77,7 @@
     default:
     return false;
     }              
+  c0_position_i_ -= (int) octave_dir_ * 7;
   
   return true;
 }
diff -urN ../lilypond-0.1.61/lily/clef-item.cc ./lily/clef-item.cc
--- ../lilypond-0.1.61/lily/clef-item.cc        Sun May  3 22:20:48 1998
+++ ./lily/clef-item.cc Wed May  6 11:29:12 1998
@@ -13,7 +13,7 @@
 #include "paper-def.hh"
 #include "lookup.hh"
 #include "clef-grav.hh"
-
+#include "text-item.hh"
 
 void
 Clef_item::do_pre_processing()
@@ -32,7 +32,12 @@
   breakable_b_ =true;
   default_b_ = false;
   change_b_ = true;
+  octave_dir_ = CENTER;
   read ("violin");
+  // Ugh: This should be const, I guess.
+  octave_marker_td_p_ = new Text_def();
+  octave_marker_td_p_->text_str_ = "8";
+  octave_marker_td_p_->style_str_ = "italic";
 }
 
 /*
@@ -129,6 +134,7 @@
 Clef_item::read (Clef_engraver const &k)
 {
   read (k.clef_type_str_);
+  octave_dir_ = k.octave_dir_;
 }
 
 Molecule*
@@ -140,6 +146,11 @@
   Atom s = paper()->lookup_l ()->clef (t);
   Molecule*output = new Molecule (Atom (s));
   output->translate_axis (paper()->internote_f () * y_position_i_, Y_AXIS);
+  if (octave_dir_)
+    output->add_at_edge (Y_AXIS, 
+                        octave_dir_,
+                        Molecule(octave_marker_td_p_->get_atom(paper(), 
+                                                               CENTER)));
   return output;
 }
 
diff -urN ../lilypond-0.1.61/lily/include/clef-grav.hh ./lily/include/clef-grav.hh
--- ../lilypond-0.1.61/lily/include/clef-grav.hh        Sun May  3 22:20:57 1998
+++ ./lily/include/clef-grav.hh Wed May  6 11:14:15 1998
@@ -13,6 +13,7 @@
 #include "scalar.hh"
 #include "varray.hh"
 #include "engraver.hh"
+#include "direction.hh"
 
 /// where is c-0 in the staff?
 class Clef_engraver : public  Engraver {
@@ -33,6 +34,7 @@
 public:
   TRANSLATOR_CLONE(Clef_engraver);
   int c0_position_i_;
+  enum Direction octave_dir_;
   String clef_type_str_;
 
   /* ************** */
diff -urN ../lilypond-0.1.61/lily/include/clef-item.hh ./lily/include/clef-item.hh
--- ../lilypond-0.1.61/lily/include/clef-item.hh        Sun May  3 22:20:57 1998
+++ ./lily/include/clef-item.hh Wed May  6 11:14:16 1998
@@ -7,6 +7,8 @@
 #ifndef CLEFITEM_HH
 #define CLEFITEM_HH
 #include "item.hh"
+#include "text-def.hh"
+#include "direction.hh"
 
 /**
   Set a clef in a staff.
@@ -26,6 +28,12 @@
     /// set because of existence of a bar
     bool default_b_;
 
+    /// should we print an octave symbol (8), and where? (up=1, down=1)?
+    enum Direction octave_dir_;
+
+    /// text def to put above/below clef (ugh: should be const)
+    Text_def * octave_marker_td_p_;
+  
     /* *************** */
     DECLARE_MY_RUNTIME_TYPEINFO;
     SCORE_ELEM_CLONE(Clef_item);
diff -urN ../lilypond-0.1.61/lily/span-score-bar.cc ./lily/span-score-bar.cc
--- ../lilypond-0.1.61/lily/span-score-bar.cc   Sun May  3 22:20:48 1998
+++ ./lily/span-score-bar.cc    Mon May  4 16:39:18 1998
@@ -51,7 +51,9 @@
 Atom
 Staff_bracket::get_bar_sym (Real dy) const
 {
-  return paper()->lookup_l ()->vbracket (dy);
+  Atom a = paper()->lookup_l ()->vbracket (dy);
+  a.translate_axis (- 1.5 * a.extent ().x ().length (), X_AXIS);
+  return a;
 }
 
 Interval

Reply via email to