Hi,
here is a second patch for pl17 which gives full support for
cautionary accidentals.
Note that two symbols have been added to the font, so everything
will look very weird unless you remove all old generated fonts.

I noticed that Lilypond's status printouts are buffered differently
now. The [1][2].. are not printed character per character but 
several lines at a time.

I don't realize how to use any of the predefined contexts to 
include the instrument names in the staff margin. I guess it 
should be included in OrchestralScoreContext.

I think \property Score.timeSignatureStyle = "C" would be
a good candidate for a default behaviour, what do you think?

  /Mats


----------------
Generated by (address unknown) using package-diff 0.62,
>From = lilypond-1.0.17.mb1, To = lilypond-1.0.17.mb2

usage 

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.0.17.mb2.diff

Patches do not contain automatically generated files 
or (urg) empty directories, 
i.e., you should rerun autoconf, configure 
and possibly make outdirs.

--state
1.0.17.mb1
1.0.17.mb2
++state
diff -urN ../lilypond-1.0.17.mb1/Documentation/tex/refman.yo 
./Documentation/tex/refman.yo
--- ../lilypond-1.0.17.mb1/Documentation/tex/refman.yo  Mon Oct 19 21:50:49 1998
+++ ./Documentation/tex/refman.yo       Thu Oct 22 00:20:15 1998
@@ -347,7 +347,7 @@
 subsect(Basic Note Specification)
 
 A note specification has the form 
-var(pitch)[var(octavespec)][code(!)][var(duration)].
+var(pitch)[var(octavespec)][code(!)][code(?)][var(duration)].
 The pitch of the note is specified by the note's name.  
 
 LilyPond has predefined note names for various languages.  The default
@@ -395,9 +395,11 @@
 context.   
 A reminder accidental can be forced by
 using the  optional exclamation mark `code(!)'
-on a pitch.
+on the pitch.
+A cautionary accidental, i.e., an accidental within paranthesis
+can be obtained using the optional question mark `code(?)' on the pitch.
 mudela(fragment,verbatim,center)(
-cis' d' e' cis'  c'! d' e' c' 
+cis' d' e' cis'  c'? d' e' c'!  
 )
 
 
diff -urN ../lilypond-1.0.17.mb1/NEWS ./NEWS
--- ../lilypond-1.0.17.mb1/NEWS Mon Oct 19 22:06:27 1998
+++ ./NEWS      Thu Oct 22 00:22:51 1998
@@ -1,3 +1,7 @@
+pl 17.mb2
+        - Full support for cautionary accidentals. Try input/test/accid.fly
+         Note that the font has changed.
+
 pl 17.mb1
         - bf: No unnecessary warnings about time signatures
         - Added optional second argument of \key. Set to \major or \minor 
diff -urN ../lilypond-1.0.17.mb1/TODO ./TODO
--- ../lilypond-1.0.17.mb1/TODO Mon Oct 19 20:13:37 1998
+++ ./TODO      Thu Oct 22 00:34:25 1998
@@ -270,8 +270,6 @@
 
        * integrate midi-elts from mi2mu and lily?
 
-       * cautionary accidental
-
        * score-bar-scripts
        FMR: Free memory read:
          * This is occurring while in:
diff -urN ../lilypond-1.0.17.mb1/VERSION ./VERSION
--- ../lilypond-1.0.17.mb1/VERSION      Mon Oct 19 21:55:38 1998
+++ ./VERSION   Thu Oct 22 00:20:58 1998
@@ -2,7 +2,7 @@
 MAJOR_VERSION=1
 MINOR_VERSION=0
 PATCH_LEVEL=17
-MY_PATCH_LEVEL=mb1
+MY_PATCH_LEVEL=mb2
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff -urN ../lilypond-1.0.17.mb1/input/test/accid.fly ./input/test/accid.fly
--- ../lilypond-1.0.17.mb1/input/test/accid.fly Thu Jan  1 01:00:00 1970
+++ ./input/test/accid.fly      Wed Oct 21 23:49:12 1998
@@ -0,0 +1,6 @@
+\time 3/4;
+cisis'' cisis! cisis? |
+cis cis! cis? | 
+c c! c? |
+ces ces! ces? |
+ceses ceses! ceses? |
diff -urN ../lilypond-1.0.17.mb1/lily/include/lookup.hh ./lily/include/lookup.hh
--- ../lilypond-1.0.17.mb1/lily/include/lookup.hh       Mon Oct 19 20:13:37 1998
+++ ./lily/include/lookup.hh    Wed Oct 21 22:52:19 1998
@@ -29,7 +29,7 @@
   Lookup (Symtables const&);
   virtual ~Lookup ();
   
-  Atom accidental (int) const;
+  Atom accidental (int,bool) const;
   void add (String, Symtable*);
   virtual Atom afm_find (String s, bool warn=true) const = 0;
   Atom afm_find (String, String, bool warn=true) const;
diff -urN ../lilypond-1.0.17.mb1/lily/include/musical-pitch.hh 
./lily/include/musical-pitch.hh
--- ../lilypond-1.0.17.mb1/lily/include/musical-pitch.hh        Tue Sep 15 19:22:42 
1998
+++ ./lily/include/musical-pitch.hh     Wed Oct 21 22:44:38 1998
@@ -29,6 +29,8 @@
   int octave_i_;
   /// 0 natural, 1 sharp, etc
   int accidental_i_;
+  /// Used for cautionary accidentals
+  bool cautionary_b_;
 
   void init () ;
   Musical_pitch to_relative_octave (Musical_pitch);
diff -urN ../lilypond-1.0.17.mb1/lily/key-item.cc ./lily/key-item.cc
--- ../lilypond-1.0.17.mb1/lily/key-item.cc     Mon Oct 19 12:09:05 1998
+++ ./lily/key-item.cc  Wed Oct 21 23:19:57 1998
@@ -133,7 +133,7 @@
              || (old_pitch_arr_[i] == pitch_arr_[j]
                  && old_acc_arr_[i] != acc_arr_[j]))
             {
-              Atom a =lookup_l ()->accidental (0);
+              Atom a =lookup_l ()->accidental (0,false);
               a.translate_axis (calculate_position(old_pitch_arr_[i], 
old_acc_arr_[i]) * inter, Y_AXIS);
               Molecule m (a);
               output->add_at_edge (X_AXIS, RIGHT, m);  
@@ -153,7 +153,7 @@
  
   for (int i =0; i < pitch_arr_.size(); i++) 
     {
-      Atom a =lookup_l ()->accidental (acc_arr_[i]);
+      Atom a =lookup_l ()->accidental (acc_arr_[i],false);
       a.translate_axis (calculate_position(pitch_arr_[i], acc_arr_[i]) * inter, 
Y_AXIS);
       Molecule m (a);
       output->add_at_edge (X_AXIS, RIGHT, m);  
diff -urN ../lilypond-1.0.17.mb1/lily/local-key-engraver.cc 
./lily/local-key-engraver.cc
--- ../lilypond-1.0.17.mb1/lily/local-key-engraver.cc   Mon Oct 19 20:13:38 1998
+++ ./lily/local-key-engraver.cc        Wed Oct 21 22:50:07 1998
@@ -67,10 +67,9 @@
              key_item_p_ = new Local_key_item;
              announce_element (Score_element_info (key_item_p_, 0));         
            }
-         ///////// TODO: Handle cautionary accidentals
          if (note_l->cautionary_b_)
            {
-             warning (_("cautionary accidentals are not yet supported"));
+             note_l->pitch_.cautionary_b_ = true;
            }
 
          key_item_p_->add (note_l->pitch_);
diff -urN ../lilypond-1.0.17.mb1/lily/local-key-item.cc ./lily/local-key-item.cc
--- ../lilypond-1.0.17.mb1/lily/local-key-item.cc       Mon Oct 19 12:09:05 1998
+++ ./lily/local-key-item.cc    Wed Oct 21 23:21:48 1998
@@ -70,7 +70,8 @@
       Real dy =
        (c0_position_i_ + accidental_pitch_arr_[i].notename_i_)
        * paper()->internote_f ();
-      Atom a (lookup_l ()->accidental (accidental_pitch_arr_[i].accidental_i_));
+      Atom a (lookup_l ()->accidental (accidental_pitch_arr_[i].accidental_i_, 
+             accidental_pitch_arr_[i].cautionary_b_));
 
       a.translate_axis (dy, Y_AXIS);
       Molecule m(a);
diff -urN ../lilypond-1.0.17.mb1/lily/lookup.cc ./lily/lookup.cc
--- ../lilypond-1.0.17.mb1/lily/lookup.cc       Mon Oct 19 20:13:38 1998
+++ ./lily/lookup.cc    Wed Oct 21 23:17:01 1998
@@ -53,9 +53,21 @@
 }
 
 Atom
-Lookup::accidental (int j) const
+Lookup::accidental (int j, bool cautionary) const
 {
-  return afm_find (String ("accidentals") + String ("-") + to_str (j));
+  Atom a = afm_find (String ("accidentals") + String ("-") + to_str (j));
+  if (cautionary) 
+    {
+      Box b=a.extent();
+      Atom lparen = afm_find (String ("accidentals") + String ("-("));
+      lparen.translate_axis(b.x().min(),X_AXIS);
+      b.unite(lparen.extent());
+      Atom rparen = afm_find (String ("accidentals") + String ("-)"));
+      rparen.translate_axis(b.x().max(),X_AXIS);
+      b.unite(rparen.extent());
+      a = Atom(lparen.str_ + a.str_ + rparen.str_, b);
+    }
+  return a;
 }
 
 void
diff -urN ../lilypond-1.0.17.mb1/lily/musical-pitch.cc ./lily/musical-pitch.cc
--- ../lilypond-1.0.17.mb1/lily/musical-pitch.cc        Tue Sep 15 19:22:42 1998
+++ ./lily/musical-pitch.cc     Wed Oct 21 22:45:01 1998
@@ -21,6 +21,7 @@
   notename_i_ = 0;
   octave_i_ = 0;
   accidental_i_ = 0;
+  cautionary_b_ = false;
 }
 
 void
diff -urN ../lilypond-1.0.17.mb1/mf/feta-toevallig.mf ./mf/feta-toevallig.mf
--- ../lilypond-1.0.17.mb1/mf/feta-toevallig.mf Tue Sep 15 19:22:43 1998
+++ ./mf/feta-toevallig.mf      Wed Oct 21 23:57:52 1998
@@ -247,8 +247,37 @@
        currentpicture := currentpicture  shifted (w/2,0);
 
 
-       fet_endchar;
+fet_endchar;
 
+
+def draw_paren =
+       save leftindent;
+       leftindent# := .2 interline#;
+       define_pixels(leftindent);
+       set_char_box(0, .5 interline#+stafflinethickness#,
+         interline#, interline#);
+       z1 = (leftindent,h);
+       z2 = (w-stafflinethickness,0);
+       z3 = (leftindent,-d);
+
+       penpos1(stafflinethickness, 35);
+       penpos2(2 stafflinethickness, 0);
+       penpos3(stafflinethickness, -35);
+
+       penlabels(1,2,3);
+       fill z2l{down} .. simple_serif(z3l, z3r, 90) .. z2r{up}
+       .. simple_serif(z1r, z1l, 90) .. z2l{down} -- cycle;
+enddef;
+  
+fet_beginchar("Right paranthesis", ")", "rightparen")
+       draw_paren;
+fet_endchar;
+
+fet_beginchar("Left paranthesis", "(", "leftparen")
+       draw_paren;
+        currentpicture := currentpicture xscaled -1;
+        set_char_box(charwd, charbp, chardp, charht);
+fet_endchar;
 
 fet_endgroup("accidentals");
 
diff -urN ../lilypond-1.0.17.mb1/tex/lilyponddefs.tex ./tex/lilyponddefs.tex
--- ../lilypond-1.0.17.mb1/tex/lilyponddefs.tex Fri Oct  9 17:03:33 1998
+++ ./tex/lilyponddefs.tex      Thu Oct 22 00:38:19 1998
@@ -165,7 +165,7 @@
 
 %compatibility
 %urg
-\fetdef\repeatcolon{18}
+\fetdef\repeatcolon{20}
 \def\repeatbar{\repeatstopbar}
 \def\startrepeat{\repeatstartbar}
 \def\repeatbarstartrepeat{\repeatstopstart}

Reply via email to