OK, Here comes a new version of my patch with a the following
syntax for keys:

\key c \major;

\key g \minor;

\key f;  % Default: major keys!

Enjoy

     /Mats

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

usage 

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.0.17.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.17
1.0.17.mb1
++state
diff -urN ../lilypond-1.0.17/Documentation/tex/refman.yo ./Documentation/tex/refman.yo
--- ../lilypond-1.0.17/Documentation/tex/refman.yo      Tue Oct 13 16:05:24 1998
+++ ./Documentation/tex/refman.yo       Mon Oct 19 21:50:49 1998
@@ -951,8 +951,14 @@
 file(.ly) extension must be given, and the filename must be quoted.
 (An unquoted string will not work here.)
 
-dit(code(\key) var(pitch)code(;)) Change key signature to that of
-var(pitch)-major.
+dit(code(\key) var(pitch) var(type) code(;)) Change the key signature. 
+var(type) should be code(\major) or code(\minor) to get
+var(pitch)-major or var(pitch)-minor, respectively. The second
+argument is optional, the default is major keys. 
+The var(\type) argument can also be given as an integer, which tells
+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. code(\minor) is defined as 3.
 
 dit(code(\keysignature) var(pitchseq)code(;))
 Specify an arbitrary key signature.  The pitches from var(pitch) will
@@ -1295,9 +1301,6 @@
 dit(code(defaultBarType)) Sets the default type of bar line.  See
 code(\bar) keyword.
 
-
-
-
 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
 be different and is specified independently: code(\keysignature bes
@@ -1323,16 +1326,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 +1442,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)) Used as the second argument of the code(\key)
+command to get a major key.
+dit(code(\minor)) Used as the second argument of the code(\key)
+command to get a minor key.
 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.17/Documentation/tex/tutorial.yo 
./Documentation/tex/tutorial.yo
--- ../lilypond-1.0.17/Documentation/tex/tutorial.yo    Mon Oct 12 14:10:54 1998
+++ ./Documentation/tex/tutorial.yo     Mon Oct 19 21:41:10 1998
@@ -696,10 +696,12 @@
     \clef "treble"; c'4
     \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)'.
+dit(code(\key) var(pitch) var(type)) This command changes the current
+  key signature.  The key signature is printed at the start of every
+  line. The var(type) argument is set to code(\major) or code(\minor)
+  to get major or minor keys, respectively. Omitting the second
+  argument gives major keys. The key of C-minor can thus be specified
+  as `code(\key es)' or `code(\key \c minor)'. 
   
 dit(code(\keysignature) var(pitchlist))
 
diff -urN ../lilypond-1.0.17/NEWS ./NEWS
--- ../lilypond-1.0.17/NEWS     Mon Oct 19 14:09:33 1998
+++ ./NEWS      Mon Oct 19 22:06:27 1998
@@ -1,3 +1,11 @@
+pl 17.mb1
+        - bf: No unnecessary warnings about time signatures
+        - Added optional second argument of \key. Set to \major or \minor 
+         to get a major or minor key. Default: major.
+        - Parser support for cautionary accidentals, i.e. accidentals 
+          within parantheses. Syntax: cis? The main part of the 
+          implementation is still missing.
+
 pl 17
        - fixed RPM building.
 
diff -urN ../lilypond-1.0.17/TODO ./TODO
--- ../lilypond-1.0.17/TODO     Mon Oct 19 12:09:05 1998
+++ ./TODO      Mon Oct 19 20:13:37 1998
@@ -490,7 +490,6 @@
 
        * Keys:
        - merge key{item} & localkey{item}?
-       - Major/Minor
        - spacing, national styles?
 
        * Support for TAB
diff -urN ../lilypond-1.0.17/VERSION ./VERSION
--- ../lilypond-1.0.17/VERSION  Mon Oct 19 12:51:51 1998
+++ ./VERSION   Mon Oct 19 21:55:38 1998
@@ -2,7 +2,7 @@
 MAJOR_VERSION=1
 MINOR_VERSION=0
 PATCH_LEVEL=17
-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.17/init/declarations.ly ./init/declarations.ly
--- ../lilypond-1.0.17/init/declarations.ly     Tue Oct 13 16:05:24 1998
+++ ./init/declarations.ly      Mon Oct 19 21:30:04 1998
@@ -33,6 +33,9 @@
 break = { \penalty = 10000; }
 nobreak = { \penalty = -10000; }
 
+major = 0
+minor = 3
+
 \include "property.ly"
 
 % music = "\melodic\relative c"
diff -urN ../lilypond-1.0.17/input/test/keys.ly ./input/test/keys.ly
--- ../lilypond-1.0.17/input/test/keys.ly       Mon Oct 12 14:10:54 1998
+++ ./input/test/keys.ly        Mon Oct 19 21:27:36 1998
@@ -6,8 +6,8 @@
 \score {
   \notes
   {
-    \key bes; c1 \key c;  c1
+    \key bes; c1 \key c \minor;  c1
     \break
-    \key bes; c1 \key d;\break c1
+    \key bes \major; c1 \key d;\break c1
   }
 }
diff -urN ../lilypond-1.0.17/input/test/time.fly ./input/test/time.fly
--- ../lilypond-1.0.17/input/test/time.fly      Mon Oct  5 12:22:05 1998
+++ ./input/test/time.fly       Mon Oct 19 22:04:01 1998
@@ -1,3 +1,4 @@
+
 \property Staff.timeSignatureStyle = "C"
 \time 1/1;
 c''1^"timeSignatureStyle = \"C\"" |
diff -urN ../lilypond-1.0.17/lily/command-request.cc ./lily/command-request.cc
--- ../lilypond-1.0.17/lily/command-request.cc  Mon Oct 12 14:10:54 1998
+++ ./lily/command-request.cc   Mon Oct 19 21:21:41 1998
@@ -322,7 +322,7 @@
 
 Key_change_req::Key_change_req()
 {
-  minor_b_ = false;
+  modality_i_ = 0;
   ordinary_key_b_= false;
 }
 
@@ -366,7 +366,7 @@
 bool
 Key_change_req::minor_b() const
 {
-  return minor_b_;
+  return modality_i_ == 3;
 }
 
 int
diff -urN ../lilypond-1.0.17/lily/include/command-request.hh 
./lily/include/command-request.hh
--- ../lilypond-1.0.17/lily/include/command-request.hh  Tue Oct 13 15:52:20 1998
+++ ./lily/include/command-request.hh   Mon Oct 19 21:22:19 1998
@@ -145,7 +145,7 @@
 class Key_change_req  : public Command_req  {
 public:
   Array<Musical_pitch> pitch_arr_;
-  bool minor_b_;
+  int modality_i_;
   bool ordinary_key_b_;
 
   Key_change_req();
@@ -160,7 +160,6 @@
   int sharps_i();
 
   void transpose (Musical_pitch  d);
-  /// is minor key?
   bool minor_b() const;
 };
 
diff -urN ../lilypond-1.0.17/lily/include/lookup.hh ./lily/include/lookup.hh
--- ../lilypond-1.0.17/lily/include/lookup.hh   Mon Oct 12 14:10:54 1998
+++ ./lily/include/lookup.hh    Mon Oct 19 20:13:37 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.17/lily/include/musical-request.hh 
./lily/include/musical-request.hh
--- ../lilypond-1.0.17/lily/include/musical-request.hh  Tue Oct 13 15:52:20 1998
+++ ./lily/include/musical-request.hh   Mon Oct 19 20:13:38 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.17/lily/include/ps-lookup.hh ./lily/include/ps-lookup.hh
--- ../lilypond-1.0.17/lily/include/ps-lookup.hh        Mon Oct 12 14:10:55 1998
+++ ./lily/include/ps-lookup.hh Mon Oct 19 21:57:56 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=true) 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.17/lily/include/tex-lookup.hh ./lily/include/tex-lookup.hh
--- ../lilypond-1.0.17/lily/include/tex-lookup.hh       Mon Oct 12 14:10:55 1998
+++ ./lily/include/tex-lookup.hh        Mon Oct 19 21:58:09 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=true) 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.17/lily/key-engraver.cc ./lily/key-engraver.cc
--- ../lilypond-1.0.17/lily/key-engraver.cc     Mon Oct 19 12:09:05 1998
+++ ./lily/key-engraver.cc      Mon Oct 19 21:20:40 1998
@@ -116,8 +116,7 @@
       else
        {
          p = r->pitch_arr_[0].semitone_pitch ();
-         if (r->minor_b ())
-           p += 3;
+         p += r->modality_i_;
        }
       /* 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.17/lily/local-key-engraver.cc ./lily/local-key-engraver.cc
--- ../lilypond-1.0.17/lily/local-key-engraver.cc       Mon Oct  5 12:20:00 1998
+++ ./lily/local-key-engraver.cc        Mon Oct 19 20:13:38 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.17/lily/lookup.cc ./lily/lookup.cc
--- ../lilypond-1.0.17/lily/lookup.cc   Fri Oct  9 15:04:18 1998
+++ ./lily/lookup.cc    Mon Oct 19 20:13:38 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.17/lily/musical-request.cc ./lily/musical-request.cc
--- ../lilypond-1.0.17/lily/musical-request.cc  Mon Oct 12 14:10:55 1998
+++ ./lily/musical-request.cc   Mon Oct 19 20:13:38 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.17/lily/parser.yy ./lily/parser.yy
--- ../lilypond-1.0.17/lily/parser.yy   Mon Oct 19 12:09:05 1998
+++ ./lily/parser.yy    Mon Oct 19 22:05:47 1998
@@ -249,6 +249,7 @@
 %type <i>      abbrev_type
 %type <i>      int unsigned
 %type <i>      script_dir
+%type <i>      optional_modality
 %type <id>     identifier_init simple_identifier_init block_identifier
 %type <duration> steno_duration notemode_duration
 %type <duration> entered_notemode_duration explicit_duration
@@ -901,10 +902,11 @@
                $$ = new Clef_change_req (*$2);
                delete $2;
        }
-       | KEY NOTENAME_PITCH    {
+       | KEY NOTENAME_PITCH optional_modality  {
                Key_change_req *key_p= new Key_change_req;
                key_p->pitch_arr_.push(*$2);
                key_p->ordinary_key_b_ = true;
+               key_p->modality_i_ = $3;
                $$ = key_p;
                delete $2;
        }
@@ -961,6 +963,15 @@
        }
        ;
 
+optional_modality:
+       /* empty */     {
+               $$ = 0;
+       }
+       | int   {
+               $$ = $1;
+       }
+       ;
+
 sup_quotes:
        '\'' {
                $$ = 1;
@@ -1018,6 +1029,10 @@
        }
        | steno_notepitch  '!'          {
                $$->forceacc_b_ = ! $$->forceacc_b_;
+       }
+       | steno_notepitch  '?'          {
+               $$->forceacc_b_ = ! $$->forceacc_b_;
+               $$->cautionary_b_ = ! $$->cautionary_b_;
        }
        ;
 
diff -urN ../lilypond-1.0.17/lily/ps-lookup.cc ./lily/ps-lookup.cc
--- ../lilypond-1.0.17/lily/ps-lookup.cc        Mon Oct 12 14:10:55 1998
+++ ./lily/ps-lookup.cc Mon Oct 19 20:13:38 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.17/lily/tex-lookup.cc ./lily/tex-lookup.cc
--- ../lilypond-1.0.17/lily/tex-lookup.cc       Tue Oct 13 16:47:51 1998
+++ ./lily/tex-lookup.cc        Mon Oct 19 20:13:38 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.17/mutopia/gallina.ly ./mutopia/gallina.ly
--- ../lilypond-1.0.17/mutopia/gallina.ly       Mon Oct 12 14:10:55 1998
+++ ./mutopia/gallina.ly        Mon Oct 19 20:13:38 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