]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.0.17.mb2: Re: LilyPond 1.0.17
authorMats Bengtsson <mats.bengtsson@s3.kth.se>
Wed, 21 Oct 1998 23:01:13 +0000 (01:01 +0200)
committerMats Bengtsson <mats.bengtsson@s3.kth.se>
Wed, 21 Oct 1998 23:01:13 +0000 (01:01 +0200)
pl 17.mb2
        - Full support for cautionary accidentals. Try input/test/accid.fly
  Note that the font has changed.

14 files changed:
Documentation/tex/refman.yo
NEWS
TODO
VERSION
input/test/accid.fly [new file with mode: 0644]
lily/include/lookup.hh
lily/include/musical-pitch.hh
lily/key-item.cc
lily/local-key-engraver.cc
lily/local-key-item.cc
lily/lookup.cc
lily/musical-pitch.cc
mf/feta-toevallig.mf
tex/lilyponddefs.tex

index aee4718c24ce55440706daa44f03bfcd00caff1c..7a2e4ec17a0f575602658950b3197a47b4a7f0c1 100644 (file)
@@ -347,7 +347,7 @@ label(notedesc)
 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 @@ will determine what accidentals to  typeset  depending on the  key and
 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 --git a/NEWS b/NEWS
index b9549a6e2417998c1b6e6121a7263c8a4653a1f2..ede37bf592a2a77428b132f185156c02934f4a34 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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 --git a/TODO b/TODO
index 57fddc2402df7f11a723df8c6534ca7c71ec6be7..4ea9f0da55fa4f63bac332eed515ef592a580492 100644 (file)
--- a/TODO
+++ b/TODO
@@ -270,8 +270,6 @@ ydirection and hshift preset
 
        * integrate midi-elts from mi2mu and lily?
 
-       * cautionary accidental
-
        * score-bar-scripts
        FMR: Free memory read:
          * This is occurring while in:
diff --git a/VERSION b/VERSION
index 4644aeabd9b2400bd57faa392fd6dd185524277f..330a5ed09cf73f4c6046e7fb99ae6eba5808c4a4 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 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 --git a/input/test/accid.fly b/input/test/accid.fly
new file mode 100644 (file)
index 0000000..d7a7775
--- /dev/null
@@ -0,0 +1,6 @@
+\time 3/4;
+cisis'' cisis! cisis? |
+cis cis! cis? | 
+c c! c? |
+ces ces! ces? |
+ceses ceses! ceses? |
index 23c9011fa49e7c3595f1ddf7ba5c422ea02246c3..2e1997cfc1fdf69bee1894ad1acd98c1d5075efa 100644 (file)
@@ -29,7 +29,7 @@ public:
   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;
index 2c4f1a55de1f3390efb63c18d7f3d776cdff1162..a46471fd61d5f35b5514a51f1f17dba0ce7710a0 100644 (file)
@@ -29,6 +29,8 @@ struct Musical_pitch : public Input
   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);
index 80e470f10fd734e9d2416d948a359b8e70223920..44fa94eaeeaa3b42c07244f4be2ca45a6dd62802 100644 (file)
@@ -133,7 +133,7 @@ Key_item::brew_molecule_p() const
              || (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 @@ Key_item::brew_molecule_p() const
  
   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);  
index a74b27d79e1736a39a5bc5caf5cb6138220cb69d..93098e2293f96e138c3e422253e02b0c5705da14 100644 (file)
@@ -67,10 +67,9 @@ Local_key_engraver::process_acknowledged ()
              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_);
index 2b2d0dd5db1660f3790c532679ad7451275355eb..393210546633062b1f612db1b1f814a71102a01b 100644 (file)
@@ -70,7 +70,8 @@ Local_key_item::brew_molecule_p() const
       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);
index bc8d12d71fb28d44dfcc3e4f957af198ef0cdb3e..971e9380d798877e0568a6433319a8ba62d2d393 100644 (file)
@@ -53,9 +53,21 @@ Lookup::~Lookup ()
 }
 
 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
index e7ffbd7014b1beeb45ec034c93da3bf76ae21274..9603e025d9a6397108665b87c33b5813b5006a59 100644 (file)
@@ -21,6 +21,7 @@ Musical_pitch::init ()
   notename_i_ = 0;
   octave_i_ = 0;
   accidental_i_ = 0;
+  cautionary_b_ = false;
 }
 
 void
index 7da404d0c7a1d5e863c552246f3770540229da1c..3477b5d322802613db17184c4a9f6b8b7ff38ad7 100644 (file)
@@ -247,8 +247,37 @@ fet_beginchar("Double sharp", "2", "sharpsharp")
        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");
 
index 38ea9553e81458f7a8192a9f7f3db5f9c9d1595e..4312a117a8fb2beda1d4d27d5e21c52a579faefb 100644 (file)
 
 %compatibility
 %urg
-\fetdef\repeatcolon{18}
+\fetdef\repeatcolon{20}
 \def\repeatbar{\repeatstopbar}
 \def\startrepeat{\repeatstartbar}
 \def\repeatbarstartrepeat{\repeatstopstart}