]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/note-head.cc (brew_ez_stencil): read vector note-names to
authorhanwen <hanwen>
Thu, 18 Mar 2004 23:27:22 +0000 (23:27 +0000)
committerhanwen <hanwen>
Thu, 18 Mar 2004 23:27:22 +0000 (23:27 +0000)
determine ez-notation letter.

* lily/system.cc (get_line): start with dumping layer 3. This
fixes ez notation.

ChangeLog
Documentation/user/changing-defaults.itely
Documentation/user/macros.itexi
input/regression/easy-notation.ly
lily/note-head.cc
lily/system.cc
scm/define-grob-properties.scm
scm/define-grobs.scm

index 10c38f33cebd1080e48f3c52ce83b77150399e78..f6f898137c0f2e3e698f7113e12f3b7021b00d1a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-03-19  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/note-head.cc (brew_ez_stencil): read vector note-names to
+       determine ez-notation letter. 
+
+       * lily/system.cc (get_line): start with dumping layer 3. This
+       fixes ez notation.
+
 2004-03-19  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * lily/paper-book.cc (pages): Bugfix: copy_height and tag_height
 2004-03-19  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * lily/paper-book.cc (pages): Bugfix: copy_height and tag_height
@@ -23,6 +31,9 @@
 
 2004-03-18  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
 
 2004-03-18  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/note-head.cc (brew_ez_stencil): add note-names
+       property. Provides internationalization for note names.
+
        * Documentation/user/changing-defaults.itely (Creating contexts):
        new node.
 
        * Documentation/user/changing-defaults.itely (Creating contexts):
        new node.
 
index e01217dc6307f7e573c63885d41975133de793fe..87dbecafb67831c5d879fbdeb2d06740165b457a 100644 (file)
@@ -243,14 +243,15 @@ clef and time signature are added. LilyPond @emph{interprets} the
 input. During this step, the musical information is inspected in time
 order, similar to reading a score from left to right. While reading,
 the program remembers where measure boundaries are, and what pitches
 input. During this step, the musical information is inspected in time
 order, similar to reading a score from left to right. While reading,
 the program remembers where measure boundaries are, and what pitches
-need explicit accidentals. 
+need explicit accidentals.
 
 
-This information can be present on several levels.  For example, the
-effect of an accidental is limited to a single stave, while a bar line
-must be synchronized across the entire score.  To match this
-hierarchy, LilyPond's interpretation step is hierarchical.  There are
-interpretation contexts, like @context{Voice}, Staff and Score, and each level
-can maintain its own properties.
+This is contextual information. and it can be present on several
+levels.  For example, the effect of an accidental is limited to a
+single stave, while a bar line must be synchronized across the entire
+score.  To match this hierarchy, LilyPond's interpretation step is
+hierarchical.  There are interpretation contexts, like
+@context{Voice}, Staff and Score, and each level can maintain its own
+properties.
 
 Full description of all available contexts is in the program
 reference, see
 
 Full description of all available contexts is in the program
 reference, see
@@ -344,7 +345,7 @@ They are combined by sending both to the same @context{Voice} context,
 music = \notes { c4 c4 }
 arts = \notes  { s4-. s4-> }
 \score {
 music = \notes { c4 c4 }
 arts = \notes  { s4-. s4-> }
 \score {
-  << \new Staff \context Voice = "A" \music
+       \notes \relative c''  << \new Staff \context Voice = "A" \music
      \context Voice = "A" \arts
   >>
 } 
      \context Voice = "A" \arts
   >>
 } 
@@ -450,7 +451,7 @@ easily with @code{\once}, for example in
   c4
 @end lilypond
 
   c4
 @end lilypond
 
-the property @code{fontSize} is unset automatically after the third
+the property @code{fontSize} is unset automatically after the second
 note.
 
 A full description of all available context properties is in the
 note.
 
 A full description of all available context properties is in the
index 64125bb81d2ca77bf934d7897838d08cb0d84c1d..6a8b7c7bb8cb7daddf3c096bbba97751f425088d 100644 (file)
@@ -161,7 +161,7 @@ internals document,  @internalsref{\NAME\}
 @end macro
 
 @macro context{NAME}
 @end macro
 
 @macro context{NAME}
-@code{NAME}@c should use internalsref
+@code{\NAME\}@c should use internalsref
 @cindex \NAME\@c
 @end macro
 
 @cindex \NAME\@c
 @end macro
 
index 8b3b43b8d960f786c4b222f165d773e5baf96562..35458dff68cc62616809731247e081d10a79160d 100644 (file)
@@ -1,14 +1,19 @@
 \version "2.1.30"
 
 \header {
 \version "2.1.30"
 
 \header {
-texidoc = " Easy-notation (or Ez-notation) prints names in note heads.
+    texidoc = " Easy-notation (or Ez-notation) prints names in note heads.
 You also get ledger lines, of course."
 }
 
 \score {
 You also get ledger lines, of course."
 }
 
 \score {
-        \notes { c'2 e'4 f' | g'1 b8 }
-        \paper { \context { \EasyNotation }
-                raggedright = ##t
-            } 
+    \notes {
+       \setEasyHeads
+       c'2 g'2 | g'1 
+       \override NoteHead #'note-names = ##("U" "V" "W" "X" "Y" "Z" "z")
+       c'2 e'4 f' | b'1
+    }
+    \paper {
+       raggedright = ##t
+    } 
 }
 
 }
 
index 9c063326588603eabd5d9acdb5b97ddd3f5bb10f..4b351332272c5862f225c448a21934279083b73e 100644 (file)
@@ -248,11 +248,18 @@ Note_head::brew_ez_stencil (SCM smob)
   SCM spitch = unsmob_music (cause)->get_property ("pitch");
   Pitch* pit =  unsmob_pitch (spitch);
 
   SCM spitch = unsmob_music (cause)->get_property ("pitch");
   Pitch* pit =  unsmob_pitch (spitch);
 
-  char s[2] = "a";
-  s[0] = (pit->get_notename () + 2)%7 + 'a';
-  s[0] = toupper (s[0]);
-  
-  SCM charstr = scm_makfrom0str (s);
+  SCM idx = gh_int2scm (pit->get_notename ());
+  SCM names = me->get_property ("note-names");
+  SCM charstr = SCM_EOL;
+  if (gh_vector_p (names))
+    charstr = scm_vector_ref (names, idx);
+  else
+    {
+      char s[2] = "a";
+      s[0] = (pit->get_notename () + 2)%7 + 'a';
+      s[0] = toupper (s[0]);
+      charstr = scm_makfrom0str (s);
+    }
   
   SCM at = scm_list_n (ly_symbol2scm ("ez-ball"),
                       charstr,
   
   SCM at = scm_list_n (ly_symbol2scm ("ez-ball"),
                       charstr,
@@ -331,5 +338,5 @@ Note_head::get_balltype (Grob*me)
 
 ADD_INTERFACE (Note_head,"note-head-interface",
   "Note head",
 
 ADD_INTERFACE (Note_head,"note-head-interface",
   "Note head",
-  "glyph-name-procedure accidental-grob style stem-attachment-function");
+  "note-names glyph-name-procedure accidental-grob style stem-attachment-function");
 
 
index a03ed8cf9fe733520efcb55f21d20559645b2c22..e11505700fb1d72d034bdc52c994e1ed13ffed32 100644 (file)
@@ -56,15 +56,17 @@ scm_default_compare (const void * a, const void *b)
   SCM pa = *(SCM *)a;
   SCM pb = *(SCM *)b;
 
   SCM pa = *(SCM *)a;
   SCM pb = *(SCM *)b;
 
-  if (pa < pb) return -1 ;
-  else if (pa > pb) return 1;
-  else return 0;
+  if (pa < pb)
+    return -1;
+  else if (pa > pb)
+    return 1;
+  else
+    return 0;
 }
 
 /*
   modify L in place: sort it 
 */
 }
 
 /*
   modify L in place: sort it 
 */
-
 SCM
 uniquify_list (SCM l)
 {
 SCM
 uniquify_list (SCM l)
 {
@@ -389,13 +391,18 @@ SCM
 System::get_line ()
 {  
   static int const LAYER_COUNT = 3;
 System::get_line ()
 {  
   static int const LAYER_COUNT = 3;
+
   SCM stencils = SCM_EOL;
   if (Stencil *me = get_stencil ())
     stencils = scm_cons (me->smobbed_copy (), stencils);
 
   /* Output stencils in three layers: 0, 1, 2.  The default layer is
   SCM stencils = SCM_EOL;
   if (Stencil *me = get_stencil ())
     stencils = scm_cons (me->smobbed_copy (), stencils);
 
   /* Output stencils in three layers: 0, 1, 2.  The default layer is
-     1.  */
-  for (int i = 0; i < LAYER_COUNT; i++)
+     1.
+
+     Start with layer 3, since  scm_cons prepends to list.
+     
+  */
+  for (int i = LAYER_COUNT; i--;)
     for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
       {
        Grob *g = unsmob_grob (ly_car (s));
     for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
       {
        Grob *g = unsmob_grob (ly_car (s));
index 78b1b33603fdc393b75234cb31c634d85dd8b9ee..3461bf407f5ebbc922cb9be9abf6a28f69b5d369 100644 (file)
@@ -316,6 +316,8 @@ should move (after padding).")
 returning a @code{Stencil} object.")
      (new-accidentals ,list? "List of @code{(@var{pitch}
 . @var{accidental})} pairs.")
 returning a @code{Stencil} object.")
      (new-accidentals ,list? "List of @code{(@var{pitch}
 . @var{accidental})} pairs.")
+     (note-names ,vector? "Vector of strings containing names for
+easy-notation note heads.")
      (no-spacing-rods ,boolean? "Items with this property do not cause
 spacing constraints.")
      (no-stem-extend ,boolean? "If set, notes with ledger lines do not
      (no-spacing-rods ,boolean? "Items with this property do not cause
 spacing constraints.")
      (no-stem-extend ,boolean? "If set, notes with ledger lines do not
index 5d27dc56bc62e48fe6d70b4b78548440db6853dc..1fcac561456f03b3e8548e0b16b3baf04e41b544 100644 (file)
        
     (Stem
      . (
        
     (Stem
      . (
-
        ;; this list is rather long. Trim --hwn
        (before-line-breaking-callback . ,Stem::before_line_breaking)
        (print-function . ,Stem::print)
        (thickness . 1.3)
 
        ;; this list is rather long. Trim --hwn
        (before-line-breaking-callback . ,Stem::before_line_breaking)
        (print-function . ,Stem::print)
        (thickness . 1.3)
 
-       ;; 3.5 (or 3 measured from note head) is standar length
+       ;; 3.5 (or 3 measured from note head) is standard length
        ;; 32nd, 64th flagged stems should be longer
        (lengths . (3.5 3.5 3.5 4.5 5.0))
        
        ;; 32nd, 64th flagged stems should be longer
        (lengths . (3.5 3.5 3.5 4.5 5.0))