]> git.donarmstrong.com Git - lilypond.git/commitdiff
2002-09-09 Juergen Reuter <reuter@ipd.uka.de>
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 9 Sep 2002 23:46:49 +0000 (23:46 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 9 Sep 2002 23:46:49 +0000 (23:46 +0000)
* input/test/accid.ly: updated test file to show all available
accidentals styles

* lily/accidental.cc, lily/key-signature-interface.cc,
lily/include/accidental-interface.hh: added method
        get_fontcharname() to provide proper fall-back cases for missing
        accidentals; print warning if font char lookup fails

        * lily/time-signature.cc: fixed documentation bug

2002-09-07 Jeremie Lumbroso  <jeremie@lumbroso.fr>

* Documentation/user/refman.itely: replaced all occurrence "staffs"
with "staves".

ChangeLog
Documentation/user/refman.itely
input/test/accid.ly
lily/accidental.cc
lily/include/accidental-interface.hh
lily/key-signature-interface.cc
lily/time-signature.cc

index 4ab59b873ae33656ee33f853bbf3cbcfe68dd54b..1c263d068504135e2140e132fa5ec14053f458b0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+       
+2002-09-09  Juergen Reuter  <reuter@ipd.uka.de>
+
+       * input/test/accid.ly: updated test file to show all available
+       accidentals styles
+
+       * lily/accidental.cc, lily/key-signature-interface.cc,
+       lily/include/accidental-interface.hh: added method
+        get_fontcharname() to provide proper fall-back cases for missing
+        accidentals; print warning if font char lookup fails
+
+        * lily/time-signature.cc: fixed documentation bug
+
 2002-09-09  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
        * lily/musical-request.cc: do ADD_MUSIC for String_number_req.
@@ -27,7 +40,7 @@
 
        * lily/include/music-iterator.hh (class Music_iterator): smobify
        music-iterator; many changes throughout. They are now constructed
-       through procedures that return the smobbed iterator. 
+       through procedures that return to the smobbed iterator.
 
        * lily/include/*.hh: all derived_mark() functions are now const.
 
@@ -78,6 +91,9 @@
         * Documentation/user/refman.itely: very minor corrections and
        rephrasing of the reference manual -- revision up to line #400.
 
+       * Documentation/user/refman.itely: replaced all occurrence "staffs"
+       with "staves".
+
 2002-09-07  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
        * lily/lexer.ll: scan E_DIGIT
index fccd9f6440c8341bed77d81400b0e77ab5621696..55b111f7ceb05dda298747aee337f14ac7203d42 100644 (file)
@@ -352,7 +352,7 @@ of a chord is not supported in a simple way.  It can be achieved by
 moving the tie-engraver into the Thread context and turning on and off
 ties per Thread.
 
-Switching staffs when a tie is active will not work.
+Switching staves when a tie is active will not work.
 
 @node Automatic note splitting 
 @subsection Automatic note splitting
@@ -1014,8 +1014,8 @@ c4
 You are encouraged to use @code{\repeat} for repetitions.  See
 @ref{Repeats}.
 
-In scores with many staffs, the barlines are automatically placed at
-top level, and they are connected between different staffs of a
+In scores with many staves, the barlines are automatically placed at
+top level, and they are connected between different staves of a
 @internalsref{StaffGroup}:
 @lilypond[fragment, verbatim]
 < \context StaffGroup <
@@ -1235,7 +1235,7 @@ the object property @code{auto-knee-gap}.
 
 @refbugs
 
-Auto knee beams can not be used together with hara kiri staffs.
+Auto knee beams can not be used together with hara kiri staves.
 
 [TODO from bugs]
 
@@ -1973,7 +1973,7 @@ changes may appear halfway in between grace notes:
 @end lilypond
 
 The placement of these grace notes is synchronized between different
-staffs, using this grace timing.
+staves, using this grace timing.
 
 @lilypond[relative=2,verbatim,fragment] 
 < \context Staff = SA { e4 \grace { c16 d e f } e4 }
@@ -2024,7 +2024,7 @@ Grace notes can not be used in the smallest size (@file{paper11.ly}).
 
 Grace note synchronization can also lead to surprises. Staff notation,
 such as key signatures, barlines, etc. are also synchronized. Take
-care when you mix staffs with grace notes and staffs without.
+care when you mix staves with grace notes and staves without.
 
 @lilypond[relative=2,verbatim,fragment]
 < \context Staff = SA { e4 \bar "|:" \grace c16 d4 }
@@ -4324,13 +4324,13 @@ are chosen whenever the page gets full.
 @subsection Vertical spacing
 
 @cindex vertical spacing
-@cindex distance between staffs
+@cindex distance between staves
 @cindex staff distance
 @cindex between staves, distance
 
 The height of each system is determined automatically by lilypond, to
 keep systems from bumping into each other, some minimum distances are
-set.  By changing these, you can put staffs closer together, and thus
+set.  By changing these, you can put staves closer together, and thus
 put more  systems onto one page.
 
 Normally staves are stacked vertically. To make
@@ -4352,7 +4352,7 @@ Vertical aligment of staves is handled by the
 @internalsref{VerticalAlignment} object, which lives at
 @internalsref{Score} level.
 
-The piano staffs are handled a little differently: to make cross-staff
+The piano staves are handled a little differently: to make cross-staff
 beaming work correctly, it necessary that the distance between staves
 is fixed.  This is also done with a @internalsref{VerticalAlignment}
 object, created in @internalsref{PianoStaff}, but a forced distance is
@@ -4364,7 +4364,7 @@ want to override this, use a @code{\translator} block as follows:
     VerticalAlignment \override #'forced-distance = #9
   @}
 @end example
-This would bring the staffs together at a distance of 9 staff spaces,
+This would bring the staves together at a distance of 9 staff spaces,
 and again this is measured from the center line of each staff.
 
 
index 569bd6a31b0087e7f2f87cd88ddee4668e8e5d71..d26f5292bf66b3f2776ee293090b87faa55fd6b7 100644 (file)
@@ -3,7 +3,40 @@
 \score { 
   \context Voice \notes\relative c {
     \time 3/4
-       cisis'' cisis! cisis? |
+       \property Staff.Accidental \set #'style = #'default
+       cisis''^"Accidental style = \#'default" cisis! cisis? |
+       cis cis! cis? | 
+       c c! c? |
+       ces ces! ces? |
+       ceses ceses! ceses? |
+       \break
+       
+       \property Staff.Accidental \set #'style = #'hufnagel
+       cisis^"Accidental style = \#'hufnagel" cisis! cisis? |
+       cis cis! cis? | 
+       c c! c? |
+       ces ces! ces? |
+       ceses ceses! ceses? |
+       \break
+       
+       \property Staff.Accidental \set #'style = #'medicaea
+       cisis^"Accidental style = \#'medicaea" cisis! cisis? |
+       cis cis! cis? | 
+       c c! c? |
+       ces ces! ces? |
+       ceses ceses! ceses? |
+       \break
+       
+       \property Staff.Accidental \set #'style = #'vaticana
+       cisis^"Accidental style = \#'vaticana" cisis! cisis? |
+       cis cis! cis? | 
+       c c! c? |
+       ces ces! ces? |
+       ceses ceses! ceses? |
+       \break
+       
+       \property Staff.Accidental \set #'style = #'mensural
+       cisis^"Accidental style = \#'mensural" cisis! cisis? |
        cis cis! cis? | 
        c c! c? |
        ces ces! ces? |
index 4200f3b88aca3c76a64a14205a32f133cf22c76d..426f94fbb6ee8a05fd8be4af18454cda6879bf41 100644 (file)
@@ -95,6 +95,57 @@ Accidental_interface::accurate_boxes (Grob *a,Grob**common)
   return boxes;
 }
 
+/*
+ * Some styles do not provide all flavours of accidentals, e.g. there
+ * is currently no sharp accidental in vaticana style.  In these cases
+ * this function falls back to one of the other styles.
+ */
+String
+Accidental_interface::get_fontcharname(String style, int alteration)
+{
+  if (style == "hufnagel")
+    switch (alteration)
+      {
+      case -2: return "-2";
+      case -1: return "hufnagel-1";
+      case 0: return "vaticana0";
+      case 1: return "mensural1";
+      case 2: return "2";
+      }
+  if (style == "medicaea")
+    switch (alteration)
+      {
+      case -2: return "-2";
+      case -1: return "medicaea-1";
+      case 0: return "vaticana0";
+      case 1: return "mensural1";
+      case 2: return "2";
+      }
+  if (style == "vaticana")
+    switch (alteration)
+      {
+      case -2: return "-2";
+      case -1: return "vaticana-1";
+      case 0: return "vaticana0";
+      case 1: return "mensural1";
+      case 2: return "2";
+      }
+  if (style == "mensural")
+    switch (alteration)
+      {
+      case -2: return "-2";
+      case -1: return "mensural-1";
+      case 0: return "vaticana0";
+      case 1: return "mensural1";
+      case 2: return "2";
+      }
+  if (style == "neo_mensural")
+    style = ""; // currently same as default
+  if (style == "default")
+    style = "";
+  return style + to_string (alteration);
+}
+
 MAKE_SCHEME_CALLBACK (Accidental_interface,brew_molecule,1);
 SCM
 Accidental_interface::brew_molecule (SCM smob)
@@ -102,7 +153,7 @@ Accidental_interface::brew_molecule (SCM smob)
   Grob *me = unsmob_grob (smob);
   bool smaller = false;
   bool parens = false;
-  
+
   bool caut  = to_boolean (me->get_grob_property ("cautionary"));
   if (caut)
     {
@@ -110,7 +161,7 @@ Accidental_interface::brew_molecule (SCM smob)
       parens = gh_equal_p (cstyle, ly_symbol2scm ("parentheses"));
       smaller = gh_equal_p (cstyle, ly_symbol2scm ("smaller"));
     }
-  
+
   SCM scm_style = me->get_grob_property ("style");
   String style;
   if (gh_symbol_p (scm_style))
@@ -121,11 +172,10 @@ Accidental_interface::brew_molecule (SCM smob)
     {
       /*
        preferably no name for the default style.
-       */
+      */
       style = "";
     }
 
-
   Font_metric *fm = 0;
   if (smaller)
     {
@@ -141,16 +191,20 @@ Accidental_interface::brew_molecule (SCM smob)
 
   Molecule mol;
   for (SCM s = me->get_grob_property ("accidentals");
-       gh_pair_p (s);  s= gh_cdr (s))
+       gh_pair_p (s); = gh_cdr (s))
     {
-      SCM entry  = gh_car (s);
-      
-      
-      Molecule acc (fm->find_by_name (String ("accidentals-") +
-                                     style +
-                                     to_string (gh_scm2int(entry))));
-      
-      mol.add_at_edge (X_AXIS,  RIGHT, acc, 0.1);
+      int alteration = gh_scm2int (gh_car (s));
+      String font_char = get_fontcharname (style, alteration);
+      Molecule acc (fm->find_by_name ("accidentals-" + font_char));
+
+      if (acc.empty_b())
+       {
+         me->warning (_f ("accidental `%s' not found", font_char));
+       }
+      else
+       {
+         mol.add_at_edge (X_AXIS,  RIGHT, acc, 0.1);
+       }
     }
 
   if (parens)
index c2dd02232708b39562c4f7a06a74b5a28ac8316e..e906f9fcb45cb88787da161891168f6a41a58553 100644 (file)
@@ -19,6 +19,7 @@ public:
   DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));  
   static bool has_interface (Grob*);
   
+  static String get_fontcharname(String style, int alteration);
   static Array<Box> Accidental_interface::accurate_boxes (Grob *me,Grob**common);
 };
 
index 7b3c9ab3a1872aff183e7fd687061b641d949d22..81946e2769ef161fa84c51ba8c11a58e9b3f53c7 100644 (file)
@@ -17,7 +17,7 @@
 #include "lookup.hh"
 #include "lily-guile.hh"
 #include "lily-proto.hh"
-
+#include "accidental-interface.hh"
 
 struct Key_signature_interface
 {
@@ -99,7 +99,7 @@ Key_signature_interface::brew_molecule (SCM smob)
   Grob*me =unsmob_grob (smob);
 
   Real inter = Staff_symbol_referencer::staff_space (me)/2.0;
-  
+
   SCM scm_style = me->get_grob_property ("style");
   String style;
   if (gh_symbol_p (scm_style))
@@ -115,25 +115,34 @@ Key_signature_interface::brew_molecule (SCM smob)
   Molecule mol;
 
   SCM c0s = me->get_grob_property ("c0-position");
-  int c0p=0;
+  int c0p = 0;
   if (gh_number_p (c0s))
-     c0p = gh_scm2int (c0s);
+    c0p = gh_scm2int (c0s);
 
   /*
     SCM lists are stacks, so we work from right to left, ending with
     the cancellation signature.
   */
 
+  Font_metric *fm = Font_interface::get_default_font (me);
   for (SCM s = newas; gh_pair_p (s); s = ly_cdr (s))
     {
-      SCM what = ly_caar (s);
-      int alter = gh_scm2int (ly_cdar (s));
-      int pos = alteration_pos (what, alter, c0p);
-      
-      Molecule m = Font_interface::get_default_font (me)->
-         find_by_name (String ("accidentals-") + style + to_string (alter));
-      m.translate_axis (pos * inter, Y_AXIS);
-      mol.add_at_edge (X_AXIS, LEFT, m, 0);
+      int alteration = gh_scm2int (ly_cdar (s));
+      String font_char =
+       Accidental_interface::get_fontcharname (style, alteration);
+      Molecule acc (fm->find_by_name ("accidentals-" + font_char));
+
+      if (acc.empty_b())
+       {
+         me->warning (_f ("accidental `%s' not found", font_char));
+       }
+      else
+       {
+         SCM what = ly_caar (s);
+         int pos = alteration_pos (what, alteration, c0p);
+         acc.translate_axis (pos * inter, Y_AXIS);
+         mol.add_at_edge (X_AXIS, LEFT, acc, 0);
+       }
     }
 
   Item *it = dynamic_cast<Item*> (me) ;
@@ -163,8 +172,8 @@ Key_signature_interface::brew_molecule (SCM smob)
              || ly_cdr (found) != ly_cdar (old))
            {
              SCM what = ly_caar (old);
-             int alter = 0;
-             int pos = alteration_pos (what, alter, c0p);
+             int alteration = 0;
+             int pos = alteration_pos (what, alteration, c0p);
 
              Molecule m = natural;
               m.translate_axis (pos* inter, Y_AXIS);
index 31dbedea5bc32756e98b86d01ebf51689d946e95..e66adfc8d4214b6776b28bf66a5cc66de2368757 100644 (file)
@@ -133,21 +133,20 @@ ADD_INTERFACE (Time_signature,"time-signature-interface",
         4/4 and 2/2 are typeset as C and struck C, respectively.  All
         other time signatures are written with two digits.
 
-      @item @code{old}
+      @item @code{neo_mensural}
         2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are
-        typeset with old-style mensuration marks.  All other time
+        typeset with neo-mensural style mensuration marks.  All other time
+        signatures are written with two digits.
+
+      @item @code{mensural}
+        2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are
+        typeset with mensural style mensuration marks.  All other time
         signatures are written with two digits.
 
       @item @code{1xxx}
         All time signatures are typeset with a single
         digit, e.g. 3/2 is written as 3. (Any symbol starting
        with the digit @code{1} will do.)
-
-      @item @code{C}@var{M}@code{/}@var{N}, 
-@code{old}@var{M}@code{/}@var{N} or
-      @code{old6/8alt}
-        Tells LilyPond to use a specific symbol as time signature, 
-       regardless of the actual time signature.
     @end table
 
 See also the test-file @file{input/test/time.ly}.