Hi, 

Here's a little patch for pl 16. I fixed the warnings on missing
time signatures and prepared the parser to support cautionary
accidentals (accidentals within parentheses as a reminder or to 
indicate an editors additions). The syntax is the same as for
forced accidentals but with a '?' instead of the '!'.
Don't try it yet, the processing and output part is still 
missing. Any ideas for the remaining implementation are
welcome.

The greatest news in this patch, however, is the support for
major and minor keys (easily extendible to dorian a.s.o.).
Just write \major or \minor to indicate if all following
\key commands are given in \major or \minor, respectively.
Note that a \major or \minor doesn't change the key directly, 
just influences the coming \key commands.

       /Mats


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

usage 

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.0.16.mb1.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.16
1.0.16.mb1
++state
diff -urN ../lilypond-1.0.16/Documentation/tex/refman.yo ./Documentation/tex/refman.yo
--- ../lilypond-1.0.16/Documentation/tex/refman.yo      Tue Oct 13 16:05:24 1998
+++ ./Documentation/tex/refman.yo       Sat Oct 17 21:51:18 1998
@@ -952,7 +952,10 @@
 (An unquoted string will not work here.)
 
 dit(code(\key) var(pitch)code(;)) Change key signature to that of
-var(pitch)-major.
+var(pitch)-major. The predefined identifiers code(\major) and
+code(\minor) decide if all subsequent code(\key) commands are given in
+major or minor, respectively.
+  
 
 dit(code(\keysignature) var(pitchseq)code(;))
 Specify an arbitrary key signature.  The pitches from var(pitch) will
@@ -1296,7 +1299,10 @@
 code(\bar) keyword.
 
 
-
+dit(code(keymodality)) The number of semitones that should be added to
+the pitch given in the subsequent code(\key) commands to get the
+corresponding major key, e.g. minor keys are specified by
+code(keymodality=3). Is set by code(\major) and code(\minor).
 
 dit(code(keyoctaviation)) If set to 1, then keys are the same in all
 octaves.  If set to 0 then the key signature for different octaves can
@@ -1323,16 +1329,16 @@
 dit(code(timeSignatureStyle)) Changes the default two-digit layout
    for time signatures. The following values are recognized:
    description(
-      dit(code(C)): 4/4 and 2/2 are typeset as C and struck C,
+      dit(code(C)) 4/4 and 2/2 are typeset as C and struck C,
       respectively. All other time signatures are written with two digits.
-      dit(code(old)): 2/2, 3/2, 3/4, 4/4, 6/4 and 9/4 are typeset with
+      dit(code(old)) 2/2, 3/2, 3/4, 4/4, 6/4 and 9/4 are typeset with
       old-style mensuration marks. All other time signatures are 
       written with two digits.
-      dit(code(1)): All time signatures are typeset with a single
+      dit(code(1)) All time signatures are typeset with a single
       digit, e.g. 3/2 is written as 3.
       dit(code(C2/2), code(C4/4), code(old2/2), code(old3/2),
       code(old3/4), code(old4/4), code(old6/4) or
-      code(old9/4)): Tells Lilypond to use a specific symbol as time
+      code(old9/4)) Tells Lilypond to use a specific symbol as time
       signature.
    )
 The different time signature characters are shown below with
@@ -1439,6 +1445,10 @@
 dit(code(\infinity)) Used for setting the Score.beamslopedamping
 property.  Is actually equal to 10000.  
 dit(code(\left)) Used for setting textalignment property.  Is equal to -1.
+dit(code(\major)) All subsequent code(\key) commands are interpreted
+as major keys.
+dit(code(\minor)) All subsequent code(\key) commands are interpreted
+as minor keys.
 dit(code(\mf)) Print mezzoforte symbol on preceeding note. 
 dit(code(\mp)) Print mezzopiano symbol on preceeding note. 
 dit(code(\nobreak)) Prevent a line break in music by using a large
diff -urN ../lilypond-1.0.16/Documentation/tex/tutorial.yo 
./Documentation/tex/tutorial.yo
--- ../lilypond-1.0.16/Documentation/tex/tutorial.yo    Mon Oct 12 14:10:54 1998
+++ ./Documentation/tex/tutorial.yo     Sat Oct 17 21:54:58 1998
@@ -697,9 +697,11 @@
     \clef "alto"; c'4    
   )
 dit(code(\key) var(pitch)) This command changes the current key signature.  The
-  key signature is printed at the start of every line.  The argument
-  is the name of the corresponding major key.  The key of C-minor can 
-  thus be specified as `code(\key es)'.
+  key signature is printed at the start of every line. The identifiers
+  code(\major) and code(\minor) can be used to decide if all the 
+  subsequent code(\key) commands are major or minor, respectively. 
+  The default is major keys. The key of C-minor can 
+  thus be specified as `code(\key es)' or `code(\minor \key c)'.
   
 dit(code(\keysignature) var(pitchlist))
 
diff -urN ../lilypond-1.0.16/NEWS ./NEWS
--- ../lilypond-1.0.16/NEWS     Wed Oct 14 15:44:20 1998
+++ ./NEWS      Sat Oct 17 22:49:37 1998
@@ -1,3 +1,11 @@
+pl 16.mb1
+       - bf: No unnecessary warnings about time signatures
+       - \major and \minor affects how all subsequent key signatures
+         are interpreted.
+       - Parser support for cautionary accidentals, i.e. accidentals 
+         within parantheses. Syntax: cis? The main part of the 
+         implementation is still missing.
+
 pl 16
        - read property ydirection and tieYDirection for tie direction.
        - bf: slur over rest.
diff -urN ../lilypond-1.0.16/TODO ./TODO
--- ../lilypond-1.0.16/TODO     Wed Oct 14 12:21:16 1998
+++ ./TODO      Sat Oct 17 21:27:31 1998
@@ -531,7 +531,6 @@
 
        * Keys:
        - merge key{item} & localkey{item}?
-       - Major/Minor
        - spacing, national styles?
 
        * Support for TAB
diff -urN ../lilypond-1.0.16/VERSION ./VERSION
--- ../lilypond-1.0.16/VERSION  Wed Oct 14 17:20:16 1998
+++ ./VERSION   Sat Oct 17 21:27:40 1998
@@ -2,7 +2,7 @@
 MAJOR_VERSION=1
 MINOR_VERSION=0
 PATCH_LEVEL=16
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=mb1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff -urN ../lilypond-1.0.16/init/property.ly ./init/property.ly
--- ../lilypond-1.0.16/init/property.ly Mon Oct  5 12:22:05 1998
+++ ./init/property.ly  Sat Oct 17 01:07:15 1998
@@ -48,6 +48,11 @@
 keyoctaviation 0       Key signature only for specified octave \specialkey
 keyoctaviation 1       Key signature for all octaves   \normalkey
 
+keymodality            0       Major key               \major
+keymodality            3       Minor key               \minor
+keymodality            n       modality n half tones from the major key
+
+
 timeSignatureStyle     C       Use C and stroked C for 4/4,2/2
 timeSignatureStyle     old     Use old style mensuration marks
 timeSignatureStyle     1       Use single number
@@ -271,3 +276,10 @@
        \property Staff.keyoctaviation = 0
 }
 
+major = {
+       \property Staff.keymodality = 0
+}
+
+minor = {
+       \property Staff.keymodality = 3
+}
diff -urN ../lilypond-1.0.16/input/test/keys.ly ./input/test/keys.ly
--- ../lilypond-1.0.16/input/test/keys.ly       Mon Oct 12 14:10:54 1998
+++ ./input/test/keys.ly        Sat Oct 17 01:12:32 1998
@@ -6,8 +6,8 @@
 \score {
   \notes
   {
-    \key bes; c1 \key c;  c1
+    \key bes; c1 \minor \key c;  c1
     \break
-    \key bes; c1 \key d;\break c1
+    \major \key bes; c1 \key d;\break c1
   }
 }
diff -urN ../lilypond-1.0.16/input/test/time.fly ./input/test/time.fly
--- ../lilypond-1.0.16/input/test/time.fly      Mon Oct  5 12:22:05 1998
+++ ./input/test/time.fly       Sat Oct 17 22:54:50 1998
@@ -1,3 +1,5 @@
+\version "1.0.7";
+
 \property Staff.timeSignatureStyle = "C"
 \time 1/1;
 c''1^"timeSignatureStyle = \"C\"" |
diff -urN ../lilypond-1.0.16/lily/include/lookup.hh ./lily/include/lookup.hh
--- ../lilypond-1.0.16/lily/include/lookup.hh   Mon Oct 12 14:10:54 1998
+++ ./lily/include/lookup.hh    Sat Oct 17 01:20:34 1998
@@ -31,8 +31,8 @@
   
   Atom accidental (int) const;
   void add (String, Symtable*);
-  virtual Atom afm_find (String s) const = 0;
-  Atom afm_find (String, String) const;
+  virtual Atom afm_find (String s, bool warn=true) const = 0;
+  Atom afm_find (String, String, bool warn=true) const;
   virtual Atom* atom_p (String, int, Box) const = 0;
   Atom ball (int) const;
   Atom bar (String, Real height) const;
diff -urN ../lilypond-1.0.16/lily/include/musical-request.hh 
./lily/include/musical-request.hh
--- ../lilypond-1.0.16/lily/include/musical-request.hh  Tue Oct 13 15:52:20 1998
+++ ./lily/include/musical-request.hh   Sat Oct 17 22:11:21 1998
@@ -129,6 +129,8 @@
     
   /// force/supress printing of accidental.
   bool forceacc_b_;
+  /// Cautionary, i.e. parenthesized accidental.
+  bool cautionary_b_;
   Note_req();
   bool do_equal_b (Request*) const;
   Rhythmic_req* access_Rhythmic_req () { return Rhythmic_req::access_Rhythmic_req (); 
}
diff -urN ../lilypond-1.0.16/lily/include/ps-lookup.hh ./lily/include/ps-lookup.hh
--- ../lilypond-1.0.16/lily/include/ps-lookup.hh        Mon Oct 12 14:10:55 1998
+++ ./lily/include/ps-lookup.hh Sat Oct 17 01:22:03 1998
@@ -19,7 +19,7 @@
   Ps_lookup (Symtables const& s);
   virtual ~Ps_lookup ();
 
-  virtual Atom afm_find (String s) const;
+  virtual Atom afm_find (String s, bool warn=false) const;
   virtual Atom* atom_p (String, int, Box) const;
   virtual String character_str (int i) const;
   virtual Atom dashed_slur (Array<Offset> controls, Real thick, Real dash) const;
diff -urN ../lilypond-1.0.16/lily/include/tex-lookup.hh ./lily/include/tex-lookup.hh
--- ../lilypond-1.0.16/lily/include/tex-lookup.hh       Mon Oct 12 14:10:55 1998
+++ ./lily/include/tex-lookup.hh        Sat Oct 17 01:21:50 1998
@@ -20,7 +20,7 @@
   Tex_lookup (Symtables const& s);
   virtual ~Tex_lookup();
 
-  virtual Atom afm_find (String s) const;
+  virtual Atom afm_find (String s, bool warn=false) const;
   virtual String character_str (int i) const;
   virtual Atom dashed_slur (Array<Offset> controls, Real thick, Real dash) const;
   virtual Atom* atom_p (String, int, Box) const;
diff -urN ../lilypond-1.0.16/lily/key-engraver.cc ./lily/key-engraver.cc
--- ../lilypond-1.0.16/lily/key-engraver.cc     Tue Sep 22 11:17:27 1998
+++ ./lily/key-engraver.cc      Sat Oct 17 01:06:17 1998
@@ -95,6 +95,7 @@
 void
 Key_engraver::read_req (Key_change_req const * r)
 {
+  int modality=0;
   old_accidental_idx_arr_ = accidental_idx_arr_;
   key_.clear ();
   Scalar prop = get_property ("keyoctaviation");
@@ -102,6 +103,11 @@
     {
       key_.multi_octave_b_ = ! prop.to_bool ();
     }
+  prop = get_property ("keymodality");
+  if (prop.isnum_b ())
+    {
+      modality=(int)prop;
+    }
   
   accidental_idx_arr_.clear ();
 
@@ -116,8 +122,7 @@
       else
        {
          p = r->pitch_arr_[0].semitone_pitch ();
-         if (r->minor_b ())
-           p += 3;
+         p += modality;
        }
       /* Solve the equation 7*no_of_acc mod 12 = p, -6 <= no_of_acc <= 5 */
       int no_of_acc = (7*p) % 12;
diff -urN ../lilypond-1.0.16/lily/local-key-engraver.cc ./lily/local-key-engraver.cc
--- ../lilypond-1.0.16/lily/local-key-engraver.cc       Mon Oct  5 12:20:00 1998
+++ ./lily/local-key-engraver.cc        Sat Oct 17 22:32:39 1998
@@ -67,6 +67,12 @@
              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"));
+           }
+
          key_item_p_->add (note_l->pitch_);
          key_item_p_->add_support (support_l);
          local_key_.set (note_l->pitch_);
diff -urN ../lilypond-1.0.16/lily/lookup.cc ./lily/lookup.cc
--- ../lilypond-1.0.16/lily/lookup.cc   Fri Oct  9 15:04:18 1998
+++ ./lily/lookup.cc    Sat Oct 17 01:24:16 1998
@@ -65,7 +65,7 @@
 }
 
 Atom
-Lookup::afm_find (String s, String str) const
+Lookup::afm_find (String s, String str, bool warn) const
 {
   if (!afm_p_)
     {
@@ -74,7 +74,7 @@
       *mlog << "]" << flush ;
       DOUT << this->afm_p_->str ();
     }
-  Adobe_font_char_metric m = afm_p_->find_char (s);
+  Adobe_font_char_metric m = afm_p_->find_char (s, warn);
 
   Atom a;
   if (m.code () < 0)
@@ -229,11 +229,11 @@
 Lookup::special_time_signature (String s, Array<Scalar> arr) const
 {
   String symbolname = "timesig-"+s+"%/%";
-  Atom a (afm_find (substitute_args (symbolname, arr)));
+  Atom a (afm_find (substitute_args (symbolname, arr), false));
   if (!a.empty ()) 
     return a;
   // Try if the full name was given
-  a = afm_find ("timesig-"+s);
+  a = afm_find ("timesig-"+s, false);
   if (!a.empty ()) 
     return a;
   // Resort to default layout with numbers
diff -urN ../lilypond-1.0.16/lily/musical-request.cc ./lily/musical-request.cc
--- ../lilypond-1.0.16/lily/musical-request.cc  Mon Oct 12 14:10:55 1998
+++ ./lily/musical-request.cc   Sat Oct 17 22:14:07 1998
@@ -184,6 +184,7 @@
 
 Note_req::Note_req ()
 {
+  cautionary_b_ = false;
   forceacc_b_ = false;
 }
 
@@ -194,7 +195,11 @@
 {
 #ifndef NPRINT
   Melodic_req::do_print ();
-  if (forceacc_b_)
+  if (cautionary_b_)
+    {
+       DOUT << " force cautionary accidental\n";
+    }
+  else if (forceacc_b_)
     {
        DOUT << " force accidental\n";
     }
diff -urN ../lilypond-1.0.16/lily/parser.yy ./lily/parser.yy
--- ../lilypond-1.0.16/lily/parser.yy   Mon Oct 12 14:10:55 1998
+++ ./lily/parser.yy    Sat Oct 17 22:46:31 1998
@@ -1019,6 +1019,10 @@
        | steno_notepitch  '!'          {
                $$->forceacc_b_ = ! $$->forceacc_b_;
        }
+       | steno_notepitch  '?'          {
+               $$->forceacc_b_ = ! $$->forceacc_b_;
+               $$->cautionary_b_ = ! $$->cautionary_b_;
+       }
        ;
 
 
diff -urN ../lilypond-1.0.16/lily/ps-lookup.cc ./lily/ps-lookup.cc
--- ../lilypond-1.0.16/lily/ps-lookup.cc        Mon Oct 12 14:10:55 1998
+++ ./lily/ps-lookup.cc Sat Oct 17 01:22:16 1998
@@ -43,9 +43,9 @@
 }
 
 Atom
-Ps_lookup::afm_find (String s) const
+Ps_lookup::afm_find (String s, bool warn) const
 {
-  return Lookup::afm_find (s, String ("(\\%03o) show "));
+  return Lookup::afm_find (s, String ("(\\%03o) show "), warn);
 }
 
 Atom*
diff -urN ../lilypond-1.0.16/lily/tex-lookup.cc ./lily/tex-lookup.cc
--- ../lilypond-1.0.16/lily/tex-lookup.cc       Tue Oct 13 16:47:51 1998
+++ ./lily/tex-lookup.cc        Sat Oct 17 01:22:35 1998
@@ -42,9 +42,9 @@
 }
 
 Atom
-Tex_lookup::afm_find (String s) const
+Tex_lookup::afm_find (String s, bool warn) const
 {
-  return Lookup::afm_find (s, String ("\\char%d"));
+  return Lookup::afm_find (s, String ("\\char%d"), warn);
 }
 
 Atom*
diff -urN ../lilypond-1.0.16/make/STATE-VECTOR ./make/STATE-VECTOR
--- ../lilypond-1.0.16/make/STATE-VECTOR        Wed Oct 14 17:20:39 1998
+++ ./make/STATE-VECTOR Sat Oct 17 23:15:21 1998
@@ -102,3 +102,4 @@
 1.0.15
 1.0.15.uu1
 1.0.16
+1.0.16.mb1
diff -urN ../lilypond-1.0.16/mutopia/gallina.ly ./mutopia/gallina.ly
--- ../lilypond-1.0.16/mutopia/gallina.ly       Mon Oct 12 14:10:55 1998
+++ ./mutopia/gallina.ly        Sat Oct 17 23:15:06 1998
@@ -29,8 +29,8 @@
 
       /Mats
 
-
-Tested Features: Note placement, multipart score, figured base, \breve
+Tested Features: Note placement, multipart score, figured base, \breve,
+       time signature styles
 
 %}
 %{
@@ -47,8 +47,28 @@
 
 \version "1.0.7";
 
-vi1=\notes \relative c'' {
+global = \notes {
+  \property StaffGroup.timeSignatureStyle = "old"
+  \time 4/4;
+  \tempo 4=80;
+  \skip 1*31;
+  \property StaffGroup.timeSignatureStyle = "1"
+  \time 3/2;
+  \bar ":|:";
+  \tempo 2=140;
+  \skip 1.*15;
+  \property StaffGroup.timeSignatureStyle = "old"
   \time 4/4;
+  \tempo 4=80;
+  \skip 1;
+  \bar ":|:";
+  \skip 1*13;
+  \bar "|.";
+}
+
+vi1=\type Staff = vi1 <
+\global
+\notes \relative c'' {
 
   [d8 d d d] d4 [a16 b c a] |
   [b8 g ][ g g16 a][ b8 g ][ g g16 a] | 
@@ -80,9 +100,8 @@
   [c8 g ][ g g16 f] e4 d |
   r8 g [g g16 f] e4 d |
   r8 [d16 a ][ b8 b16 c] a2 |
-  b1 |
-  \time 3/2;
-  \tempo 2=140;
+  b1 | 
+
   r4 d d d d d |
   e1. |
   r4 c c c c c |
@@ -98,8 +117,7 @@
   a4 [c8 b] a4 [b8 c] f,4 [g8 a] |
   d,4 g g g g g |
   a [d,8 c] b4 [c8 d] a2 |
-  \time 4/4;
-  \tempo 4=80;
+
   b1 |
   [d8 d d d] d4 [a16 b c a] |
   [b8 g ][ g g16 a] [b8 g ][ g g16 a] | 
@@ -114,11 +132,11 @@
   fis4 g2 fis!4 |
   \cadenza 1;
   g\breve
-  \bar "|.";
-}
+}>
 
-vi2=\notes \relative c'' {
-  \time 4/4;
+vi2=\type Staff = vi2 <
+\global
+\notes \relative c'' {
 
   r1 | r | r | 
   [d8 d d d] d4 [a16 b c a] |
@@ -149,7 +167,7 @@
   e4 d r8 [c16 g ][ b8 b16 c] |
   a4 g2 fis4 |
   g1 |
-  \time 3/2;
+
   r1. |
   r4 [g'8 f] e4 [f8 g] c,4 [d8 e] |
   a,1. |
@@ -165,7 +183,7 @@
   c,4 a a a a a |
   b [d8 c] b4 [c8 d] d,4 e |
   fis2 g fis! |
-  \time 4/4;
+
   g1 |
   r1 | r1 |
   [g'8 g g g] g4 [d16 e f d] |
@@ -179,13 +197,13 @@
   [a d c b ][ a g fis e] d4 d' |
   \cadenza 1;
   b\breve
-  \bar "|.";
-}
+}>
 
 
-bc=\notes\transpose c'{
+bc=\type Staff = bc <
+\global
+\notes\transpose c'{
   \clef "bass";
-  \time 4/4;
 
   G2 d^"4 3" | G1 |
   g2 c4 G | d1^"3 4 3" |
@@ -203,7 +221,7 @@
   G1^"3 4 3" | c4 B c g |
   c B c G | d1^"3 4 3" |
   G1 |
-  \time 3/2;
+
   g1. | c |
   f | d^"\\textsharp" |
   g | c |
@@ -212,8 +230,9 @@
   d^"\\textsharp" | e |
   f | g1 B2 |
   d1.^"3 4 3" |
-  \time 4/4;
+
   G1 |
+  \bar ":|:";
   g2 fis | g G |
   g1^"3 4 3" | c |
   G^"3 4 3" | c2 G |
@@ -222,12 +241,10 @@
   ) d^"3 4 3" | 
   \cadenza 1;
   G\breve 
-  \bar "|.";
-}
+}>
 
 \score{
   \type StaffGroup <
-    \property StaffGroup.timeSignatureStyle = "old"
     \vi1
     \vi2
     \bc

Reply via email to