lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

1.5.43.rz1


From: Rune Zedeler
Subject: 1.5.43.rz1
Date: Wed, 20 Mar 2002 22:47:10 +0100

It seems like the list has eaten one of my messages, so I'll resend it.
(I sent the original 20 hrs ago, and it still doesn't show up).
Here goes:

Finished (imho) auto-accidentals.
PLEASE try them out and comment! Do they behave as they should?
I think that the cc is very flexible and I hope that most bugs (there
are probably lots) can be fixed from within property-init.ly

still TODO:
1) editorial accidentals. Ommit accidentals.
2) update-ly
3) regression test cleanup
4) refman
5) better way of setting properties

@1: editorial accidentals. Ommit accidentals.
Yeah, some sort of routine to typeset an accidental as a script. Syntax
for inserting editorial accidentals. Syntax for omitting an accidental.
Way of describing how the editorials should look like. Do we have to
support stuff like

  #
   |
   |
b O

? (a flattened note with a natural sign as editorial)

This has really nothing to do with the autoaccidentals, so I guess this
can wait till 1.7


@2: update-ly
I guess that we don't need to support the old 1.5.x accidentals (nobody
used them, afaik), but we NEED to support the replacement for
noResetKey, forgetAccidentals. The solution of this has probably
something to do with point 5.
Do we have volunteers for this? Actually I am very busy and if my
study-group knew what I was sitting and doing in the middle of the night
then I would be... Eh... Never mind...

@3: regression test cleanup
The new test added is imho nice but the two old ones need to be
simplified, perhaps with long examples moved to the refman.

@4: refman
Volunteers? Something needs to be written - especially about the
macros defined in property-init.ly

@5: better way of setting properties
The problem is that we have lots of definitions like

modernCautionaries = {
  \property Score.extraNatural = ##f
  \property Score.autoAccidentals = #'(Staff (same-octave . 0))
  \property Score.autoCautionaries = #'(Staff (any-octave . 0)
(any-octave . 1))  
}


Very nice. But it leaves us with two problems:

a) what if one wants modern cautionaries in one staff but not the entire
score?
 in this case he would need

  \property Staff.extraNatural = ##f
  \property Staff.autoAccidentals = #'(Staff (same-octave . 0))
  \property Staff.autoCautionaries = #'(Staff (any-octave . 0)
(any-octave . 1))  


b) what if one wants to make modern cationaries the default in a new
context?
 in this case he would need

  extraNatural = ##f
  autoAccidentals = #'(Staff (same-octave . 0))
  autoCautionaries = #'(Staff (any-octave . 0) (any-octave . 1))  


It would be so very nice if we could unify the syntax/semantics so that
the 3 situations could be handled with the same piece of code (i.e. the
same macro).
The other and ugly solution, which I prefer not to do, is to combine
autoAccidentals and autoCautionaries into ONE property (i.e. a pair), so
that one instead could do

modernCautionaries = #'( (Staff (same-octave . 0)) .
                         (Staff (any-octave . 0) (any-octave . 1))  )
...
\property Staff.autoAccidentals = \modernCautionaries

But I don't consider this a nice solution.


Well. Good night and happy debugging!


-Rune
Generated by (address unknown),
>From = lilypond-1.5.43, To = lilypond-1.5.43.rz1

usage 

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.5.43.rz1.diff

Patches do not contain automatically generated files 
or (urg) empty directories, 
i.e., you should rerun autoconf, configure

diff -purN ../lilypond-1.5.43/ChangeLog ./ChangeLog
--- ../lilypond-1.5.43/ChangeLog        Tue Mar 19 01:50:26 2002
+++ ./ChangeLog Wed Mar 20 02:24:52 2002
@@ -1,3 +1,29 @@
+2002-03-20  Rune Zedeler <address@hidden>
+       
+       * lily/beaming-info.cc: Stupid typo fixed
+       
+       * lily/accidental-engraver.cc: rewrote accidental-routines to get
+       support for cross-context auto-accidentals.
+       Now the engraver can stay in Staff-context and see other contexts
+       from there.
+       Changed properties: autoAccidentals, autoCautionaries
+
+       * lily/translator-group.cc (set_children_property):
+       Function added recursively setting the same property (deep_copied)
+       for all children of a Translator_group.
+       
+       * ly/property-init.ly: added commands
+       \pianoAccidentals \voiceAccidentals
+       \modernVoiceAccidentals \modernVoiceCautionaries
+
+       * ly/engraver-init.ly: Correct initialization of new accidentals.
+       
+       * scm/translator-property-description.scm: Updated
+       
+       * input/regression/accidental-voice.ly: Added
+       
+       * Documentation/regression-test.tely: Added new test    
+       
 2002-03-19  Han-Wen  <address@hidden>
 
        * VERSION: 1.5.43 released
diff -purN ../lilypond-1.5.43/Documentation/regression-test.tely 
./Documentation/regression-test.tely
--- ../lilypond-1.5.43/Documentation/regression-test.tely       Fri Mar 15 
14:27:48 2002
+++ ./Documentation/regression-test.tely        Wed Mar 20 01:43:13 2002
@@ -53,6 +53,8 @@ Accidentals are currently in a developme
 
 @lilypondfile[printfilename]{accidental-octave.ly}
 
address@hidden
+
 
 @section Stems
 
diff -purN ../lilypond-1.5.43/Documentation/topdocs/AUTHORS.texi 
./Documentation/topdocs/AUTHORS.texi
--- ../lilypond-1.5.43/Documentation/topdocs/AUTHORS.texi       Fri Mar 15 
14:17:12 2002
+++ ./Documentation/topdocs/AUTHORS.texi        Wed Mar 20 01:56:38 2002
@@ -86,7 +86,7 @@ list is alphabetically ordered.
 @item @email{august@@infran.ru, August S.Sigov}
     Russian translation
 @item @email{rune@@zedeler.dk, Rune Zedeler}
-    Drum notation, beaming and accidental fixes 
+    Drum notation, beaming and auto-accidental changes. Font updates. Misc 
fixes.
 @end itemize
 
 @bye
diff -purN ../lilypond-1.5.43/VERSION ./VERSION
--- ../lilypond-1.5.43/VERSION  Tue Mar 19 01:48:27 2002
+++ ./VERSION   Tue Mar 19 19:41:58 2002
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=5
 PATCH_LEVEL=43
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=rz1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff -purN ../lilypond-1.5.43/input/regression/accidental-octave.ly 
./input/regression/accidental-octave.ly
--- ../lilypond-1.5.43/input/regression/accidental-octave.ly    Thu Dec 13 
13:20:46 2001
+++ ./input/regression/accidental-octave.ly     Wed Mar 20 02:15:30 2002
@@ -1,8 +1,9 @@
-\version "1.5.24.rz2"
+\version "1.5.43.rz1"
 
 \header {
 texidoc="
 This shows how accidentals in different octaves are handled.
+Fixme: Shorten and docu
 "
 }
 
@@ -47,14 +48,14 @@ mel = \notes \transpose c'' {
 mus = \notes {
    \mel
    \property Score.oneMeasureLazy = ##t
-   \property Score.autoAccidentals = #'((measure-same-octave . 0))
-   < s1^""^""^"$\\backslash$property Score.autoAccidentals = 
\\#'((measure-same-octave . 0))" \mel >
-   \property Score.autoAccidentals = #'((measure-same-octave . 1))
-   < s1^""^""^"$\\backslash$property Score.autoAccidentals = 
\\#'((measure-same-octave . 1))" \mel >
-   \property Score.autoAccidentals = #'((measure-any-octave . 0))
-   < s1^""^""^"$\\backslash$property Score.autoAccidentals = 
\\#'((measure-any-octave . 0))" \mel >
-   \property Score.autoAccidentals = #'((measure-any-octave . 1))
-   < s1^""^""^"$\\backslash$property Score.autoAccidentals = 
\\#'((measure-any-octave . 1))" \mel >
+   \property Score.autoAccidentals = #'(Staff (same-octave . 0))
+   < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'(Staff 
(same-octave . 0))" \mel >
+   \property Score.autoAccidentals = #'(Staff (same-octave . 1))
+   < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'(Staff 
(same-octave . 1))" \mel >
+   \property Score.autoAccidentals = #'(Staff (any-octave . 0))
+   < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'(Staff 
(any-octave . 0))" \mel >
+   \property Score.autoAccidentals = #'(Staff (any-octave . 1))
+   < s1^""^""^"$\\backslash$property Score.autoAccidentals = \\#'(Staff 
(any-octave . 1))" \mel >
    \modernAccidentals
    < s1^""^""^"$\\backslash$modernAccidentals" \mel >
    \modernCautionaries
diff -purN ../lilypond-1.5.43/input/regression/accidental-voice.ly 
./input/regression/accidental-voice.ly
--- ../lilypond-1.5.43/input/regression/accidental-voice.ly     Thu Jan  1 
01:00:00 1970
+++ ./input/regression/accidental-voice.ly      Wed Mar 20 01:41:53 2002
@@ -0,0 +1,60 @@
+\version "1.5.43.rz1"
+
+\header{
+texidoc="
+This shows how modern cross voice auto cautionary accidentals are handled.
+The first two fisses get accidentals because they belong to different voices.
+The first f gets cautionary natural because of previous measure.
+The last f gets cautionary natural because fis was only in the other voice.
+"
+}
+
+#(define  (lo-octave p)
+  (let* ((a (pitch-alteration p))
+         (n (pitch-notename p)))
+    (make-pitch -1 n a)))
+
+#(define (no-octaves music)
+  (let* ((es (ly-get-mus-property music 'elements))
+         (e (ly-get-mus-property music 'element))
+         (p (ly-get-mus-property music 'pitch)))
+
+    (if (pair? es)
+        (ly-set-mus-property
+         music 'elements
+         (map no-octaves es)))
+
+    (if (music? e)
+        (ly-set-mus-property
+         music 'element
+         (no-octaves e)))
+
+    (if (pitch? p)
+        (begin
+          (set! p (lo-octave p))
+          (ly-set-mus-property music 'pitch p)))
+
+
+    music))
+
+voicea = \notes \transpose c'' {
+    \stemUp
+    fis2 a2 f4 fis a2
+}
+voiceb = \notes \transpose c'' {
+    \stemDown
+    c2 fis2  f4 c   f2
+}
+
+\score {
+    <
+       \notes
+       \context NoteNames=namesa \apply #no-octaves \voicea
+       \context Staff < 
+           \modernVoiceCautionaries
+           \context Voice = voicea \voicea
+           \context Voice = voiceb \voiceb
+       >
+       \context NoteNames=namesb \apply #no-octaves \voiceb
+    >
+}
diff -purN ../lilypond-1.5.43/input/regression/accidentals.ly 
./input/regression/accidentals.ly
--- ../lilypond-1.5.43/input/regression/accidentals.ly  Thu Dec 13 13:20:46 2001
+++ ./input/regression/accidentals.ly   Wed Mar 20 02:15:19 2002
@@ -1,4 +1,4 @@
-\version "1.5.24.rz2"
+\version "1.5.43.rz1"
 
 \header{
 texidoc="
@@ -45,14 +45,14 @@ mel = \notes { \key d \major \time 4/4
   \context Staff \transpose c''' {
    \mel
    \property Score.oneMeasureLazy = ##t
-   \property Score.autoAccidentals = #'((measure-same-octave . 0))
-   < s1^"$\\backslash$property Score.autoAccidentals = 
\\#'((measure-same-octave . 0))" \mel >
-   \property Score.autoAccidentals = #'((measure-same-octave . 1))
-   < s1^"$\\backslash$property Score.autoAccidentals = 
\\#'((measure-same-octave . 1))" \mel >
-   \property Score.autoAccidentals = #'((measure-any-octave . 0))
-   < s1^"$\\backslash$property Score.autoAccidentals = 
\\#'((measure-any-octave . 0))" \mel >
-   \property Score.autoAccidentals = #'((measure-any-octave . 1))
-   < s1^"$\\backslash$property Score.autoAccidentals = 
\\#'((measure-any-octave . 1))" \mel >
+   \property Score.autoAccidentals = #'(Staff (same-octave . 0))
+   < s1^"$\\backslash$property Score.autoAccidentals = \\#'((same-octave . 
0))" \mel >
+   \property Score.autoAccidentals = #'(Staff (same-octave . 1))
+   < s1^"$\\backslash$property Score.autoAccidentals = \\#'((same-octave . 
1))" \mel >
+   \property Score.autoAccidentals = #'(Staff (any-octave . 0))
+   < s1^"$\\backslash$property Score.autoAccidentals = \\#'((any-octave . 0))" 
\mel >
+   \property Score.autoAccidentals = #'(Staff (any-octave . 1))
+   < s1^"$\\backslash$property Score.autoAccidentals = \\#'((any-octave . 1))" 
\mel >
    \modernAccidentals
    < s1^"$\\backslash$modernAccidentals" \mel >
    \modernCautionaries
diff -purN ../lilypond-1.5.43/lily/accidental-engraver.cc 
./lily/accidental-engraver.cc
--- ../lilypond-1.5.43/lily/accidental-engraver.cc      Tue Feb 26 20:03:41 2002
+++ ./lily/accidental-engraver.cc       Wed Mar 20 02:20:17 2002
@@ -2,7 +2,7 @@
   accidental-engraver.cc -- implement accidental_engraver
 
   (c)  1997--2002 Han-Wen Nienhuys <address@hidden>
-  Modified 2001 by Rune Zedeler <address@hidden>
+  Modified 2001-2002 by Rune Zedeler <address@hidden>
 */
 
 #include "musical-request.hh"
@@ -19,6 +19,8 @@
 #include "arpeggio.hh"
 #include "warn.hh"
 
+#include "translator-group.hh"
+
 /**
 
 
@@ -43,7 +45,7 @@ protected:
   virtual void finalize ();
 public:
 
-  // todo -> property
+  // todo -> property   (why? -rz)
   SCM last_keysig_;
 
   /*
@@ -56,6 +58,7 @@ public:
   Link_array<Grob> head_l_arr_;
   Link_array<Item> forced_l_arr_;
   Link_array<Grob> tie_l_arr_;
+  Link_array<Translator_group> origin_l_arr_;
 
 };
 
@@ -70,14 +73,22 @@ void
 Accidental_engraver::initialize ()
 {
   last_keysig_ = get_property ("keySignature");
-  daddy_trans_l_->set_property ("localKeySignature",  last_keysig_);  
+
+  Translator_group * trans_ = daddy_trans_l_;
+  while (trans_) {
+    trans_ -> set_property ("localKeySignature",  ly_deep_copy(last_keysig_));
+    trans_ = trans_->daddy_trans_l_;
+  }
+  daddy_trans_l_->set_children_property("localKeySignature",last_keysig_);
+
 }
 
 /** calculates the number of accidentals on basis of the current local key sig
-  * (passed as argument).
+  * (passed as argument)
   * Returns number of accidentals (0, 1 or 2).
   *   Negative (-1 or -2) if accidental has changed.
   **/
+// FIXME: Use references for SCM-values
 static int
 number_accidentals (SCM sig, Note_req * note_l, SCM curbarnum, SCM lazyness,
                    bool ignore_octave_b)
@@ -114,31 +125,46 @@ number_accidentals (SCM sig, Note_req * 
   return a==p ? num : -num;
 }
 
-static int
-number_accidentals (SCM localsig, Note_req * note_l, SCM accidentals_l,
-                   SCM curbarnum) {
+int
+number_accidentals (Note_req * note_l, Translator_group * origin_l,
+                   SCM accidentals_sl, SCM curbarnum_s) {
   int number=0;
   int diff=0;
-  while(gh_pair_p(accidentals_l)) {
-    if(gh_pair_p(ly_car(accidentals_l))) {
-      SCM type = gh_caar(accidentals_l);
-      SCM lazyness = gh_cdar(accidentals_l);
-      bool measure_same_octave_b =
-       gh_eq_p(ly_symbol2scm("measure-same-octave"),type);
-      bool measure_any_octave_b =
-       gh_eq_p(ly_symbol2scm("measure-any-octave"),type);
-      if(measure_same_octave_b || measure_any_octave_b) {
+  if(gh_pair_p(accidentals_sl) && !gh_symbol_p(ly_car(accidentals_sl)))
+    warning(_f("Accidental typesetting list must begin with context-name: %s",
+              ly_scm2string(ly_car(accidentals_sl)).ch_C()));
+  while(gh_pair_p(accidentals_sl) && origin_l) {
+    // If pair then it is a new accidentals typesetting rule to be checked
+    if(gh_pair_p(ly_car(accidentals_sl))) {
+      SCM type = gh_caar(accidentals_sl);
+      SCM lazyness = gh_cdar(accidentals_sl);
+      SCM localsig = origin_l->get_property ("localKeySignature");
+      bool same_octave_b =
+       gh_eq_p(ly_symbol2scm("same-octave"),type);
+      bool any_octave_b =
+       gh_eq_p(ly_symbol2scm("any-octave"),type);
+      if(same_octave_b || any_octave_b) {
        int n = number_accidentals
-         (localsig,note_l,curbarnum,lazyness,measure_any_octave_b);
+         (localsig,note_l,curbarnum_s,lazyness,any_octave_b);
        diff |= n<0;
        number = max(number,abs(n));     
       }
-      else warning(_f("unknown accidental typesetting: %s",
+      else warning(_f("unknown accidental typesetting: %s. Ignored",
                      ly_symbol2string(type).ch_C()));
     }
-    else warning(_f("Accidental typesetting must be pair: %s",
-                     ly_scm2string(ly_car(accidentals_l)).ch_C()));
-    accidentals_l = ly_cdr(accidentals_l);
+    // if symbol then it is a context name. Scan parent contexts to find it.
+    else if (gh_symbol_p(ly_car(accidentals_sl))) {
+      String context = ly_symbol2string(ly_car(accidentals_sl));
+      while (origin_l && !origin_l->is_alias_b(context)) {
+        origin_l = origin_l->daddy_trans_l_;
+      }
+      if (!origin_l)
+       warning(_f("Symbol is not a parent context: %s. Ignored",
+                  context.ch_C()));
+    }
+    else warning(_f("Accidental typesetting must be pair or context-name: %s",
+                     ly_scm2string(ly_car(accidentals_sl)).ch_C()));
+    accidentals_sl = ly_cdr(accidentals_sl);
   }
   return diff ? -number : number;
 }
@@ -148,9 +174,9 @@ Accidental_engraver::create_grobs ()
 {
   if (!key_item_p_ && mel_l_arr_.size ()) 
     {
-      SCM localsig = get_property ("localKeySignature");
-      SCM accidentals_l =  get_property ("autoAccidentals");
-      SCM cautionaries_l =  get_property ("autoCautionaries");
+      //SCM localsig = get_property ("localKeySignature");
+      SCM accidentals_sl =  get_property ("autoAccidentals");
+      SCM cautionaries_sl =  get_property ("autoCautionaries");
       SCM barnum = get_property ("currentBarNumber");
 
       bool extra_natural_b = get_property ("extraNatural")==SCM_BOOL_T;
@@ -158,9 +184,10 @@ Accidental_engraver::create_grobs ()
        {
          Grob * support_l = head_l_arr_[i];
          Note_req * note_l = mel_l_arr_[i];
+         Translator_group * origin_l = origin_l_arr_[i];
 
-         int num = number_accidentals(localsig,note_l,accidentals_l,barnum);
-         int num_caut = 
number_accidentals(localsig,note_l,cautionaries_l,barnum);
+         int num = number_accidentals(note_l,origin_l,accidentals_sl,barnum);
+         int num_caut = 
number_accidentals(note_l,origin_l,cautionaries_sl,barnum);
          bool cautionary = to_boolean (note_l->get_mus_property 
("cautionary"));
          if (abs(num_caut)>abs(num))
            {
@@ -178,8 +205,8 @@ Accidental_engraver::create_grobs ()
 
          Grob *tie_break_reminder = 0;
          bool tie_changes = false;
-         for (int i=0; i < tie_l_arr_.size (); i++)
-           if (support_l == Tie::head (tie_l_arr_[i], RIGHT))
+         for (int j=0; j < tie_l_arr_.size (); j++)
+           if (support_l == Tie::head (tie_l_arr_[j], RIGHT))
              {
                tie_changes = different;
                /* Enable accidentals for broken tie
@@ -189,7 +216,7 @@ Accidental_engraver::create_grobs ()
                   
                   Maybe check property noTieBreakForceAccidental? */
                if (different)
-                 tie_break_reminder = tie_l_arr_[i];
+                 tie_break_reminder = tie_l_arr_[j];
                break;
              }
 
@@ -231,30 +258,40 @@ Accidental_engraver::create_grobs ()
          int n = pitch->notename_i_;
          int o = pitch->octave_i_;
          int a = pitch->alteration_i_;
-         SCM on = gh_cons (gh_int2scm (o), gh_int2scm (n));
-         if (tie_changes)
-           {
-             /*
-               Remember an alteration that is different both from
-               that of the tied note and of the key signature.
-              */
-             localsig = ly_assoc_front_x
-               (localsig, on, gh_cons(SCM_BOOL_T,barnum));
-           }
-         else
-           {
-             /*
-               not really really correct if there are more than one
-               noteheads with the same notename.
-              */
-             localsig = ly_assoc_front_x
-               (localsig, on, gh_cons(gh_int2scm (a),barnum)); 
-           }
-        }
-  
-      daddy_trans_l_->set_property ("localKeySignature",  localsig);
+         SCM on_s = gh_cons (gh_int2scm (o), gh_int2scm (n));
+
+         /*
+           TODO: Speed this up!
+           Perhaps only check translators mentioned in the auto-accidentals?
+           -rz
+         */
+         Translator_group * trans_ = origin_l_arr_[i];
+         while (trans_) {
+           SCM localsig = trans_->get_property ("localKeySignature");
+           if (tie_changes)
+             {
+               /*
+                 Remember an alteration that is different both from
+                 that of the tied note and of the key signature.
+               */
+               localsig = ly_assoc_front_x
+                 (localsig, on_s, gh_cons(SCM_BOOL_T,barnum));
+             }
+           else
+             {
+               /*
+                 not really really correct if there are more than one
+                 noteheads with the same notename.
+               */
+               localsig = ly_assoc_front_x
+                 (localsig, on_s, gh_cons(gh_int2scm (a),barnum)); 
+             }
+           trans_->set_property ("localKeySignature",  localsig);
+           trans_ = trans_->daddy_trans_l_;
+         }
+       }
     }
-  
+
   
   if (key_item_p_)
     {
@@ -293,7 +330,8 @@ Accidental_engraver::stop_translation_ti
   arpeggios_.clear ();
   tie_l_arr_.clear ();
   head_l_arr_.clear ();
-  forced_l_arr_.clear ();      
+  forced_l_arr_.clear ();
+  origin_l_arr_.clear ();
 }
 
 void
@@ -305,6 +343,7 @@ Accidental_engraver::acknowledge_grob (G
     {
       mel_l_arr_.push (note_l);
       head_l_arr_.push (info.grob_l_);
+      origin_l_arr_.push (info.origin_trans_l_->daddy_trans_l_);
     }
   else if (Tie::has_interface (info.grob_l_))
     {
@@ -327,12 +366,19 @@ Accidental_engraver::process_music ()
   
   SCM sig = get_property ("keySignature");
 
-  /* Detect key sig changes. */
-  if (last_keysig_ != sig) 
-    {
-      daddy_trans_l_->set_property ("localKeySignature",  ly_deep_copy (sig));
-      last_keysig_ = sig;
+  /* Detect key sig changes.
+     Update all parents and children
+     */
+  if (last_keysig_ != sig) {
+    Translator_group * trans_ = daddy_trans_l_;
+    while (trans_) {
+      trans_ -> set_property ("localKeySignature",  ly_deep_copy(sig));
+      trans_ = trans_->daddy_trans_l_;
     }
+    daddy_trans_l_->set_children_property("localKeySignature",sig);
+
+    last_keysig_ = sig;
+  }
 }
 
 
@@ -340,6 +386,7 @@ Accidental_engraver::process_music ()
 
 
 ENTER_DESCRIPTION(Accidental_engraver,
+/* The FIXME below is deprecated and should be removed. -rz */
 /* descr */       "Make accidentals.  Catches note heads, ties and notices 
key-change
 events.  Due to interaction with ties (which don't come together
 with note heads), this needs to be in a context higher than Tie_engraver. 
FIXME",
diff -purN ../lilypond-1.5.43/lily/beaming-info.cc ./lily/beaming-info.cc
--- ../lilypond-1.5.43/lily/beaming-info.cc     Fri Feb  1 19:16:15 2002
+++ ./lily/beaming-info.cc      Wed Mar 20 02:04:39 2002
@@ -38,7 +38,7 @@ Beaming_info_list::best_splitpoint_index
       beat_pos = infos_[i].start_mom_ / beat_length;
       int den = beat_pos.den ();
       if (infos_[i].beams_i_drul_[LEFT] == infos_[i-1].beams_i_drul_[RIGHT] && 
!subdivide)
-       den *= 4;
+       den *= 2;
       if (den < minden)
        {
          minidx = i;
diff -purN ../lilypond-1.5.43/lily/include/translator-group.hh 
./lily/include/translator-group.hh
--- ../lilypond-1.5.43/lily/include/translator-group.hh Fri Feb 22 12:54:07 2002
+++ ./lily/include/translator-group.hh  Wed Mar 20 01:33:43 2002
@@ -20,6 +20,7 @@
 // egcs
 typedef void (Translator::*Method_pointer) (void);
 #define set_property(x,y) internal_set_property(ly_symbol2scm(x),y)
+#define set_children_property(x,y) 
internal_set_children_property(ly_symbol2scm(x),y)
 
 class Scheme_hash_table;
 
@@ -43,6 +44,7 @@ public:
 
   void unset_property (SCM var_sym);
   void internal_set_property (SCM var_sym, SCM value);  
+  void internal_set_children_property (SCM var_sym, SCM value);  
   Translator_group *where_defined (SCM name_sym) const;
 
   String id_str_;
diff -purN ../lilypond-1.5.43/lily/translator-group.cc 
./lily/translator-group.cc
--- ../lilypond-1.5.43/lily/translator-group.cc Fri Mar  1 01:41:05 2002
+++ ./lily/translator-group.cc  Wed Mar 20 01:31:47 2002
@@ -312,6 +312,16 @@ Translator_group::internal_set_property 
   properties_dict ()->set (sym, val);
 }
 
+void
+Translator_group::internal_set_children_property (SCM sym, SCM val)
+{
+  internal_set_property (sym, val);
+  for (SCM p = trans_group_list_; gh_pair_p (p); p = ly_cdr(p)) {
+    Translator_group *trg =  dynamic_cast<Translator_group*> 
(unsmob_translator (ly_car (p)));
+    trg->internal_set_children_property(sym,ly_deep_copy(val));
+  }
+}
+
 /*
   TODO: look up to check whether we have inherited var? 
  */
diff -purN ../lilypond-1.5.43/ly/engraver-init.ly ./ly/engraver-init.ly
--- ../lilypond-1.5.43/ly/engraver-init.ly      Fri Mar 15 14:17:12 2002
+++ ./ly/engraver-init.ly       Wed Mar 20 02:16:58 2002
@@ -38,6 +38,7 @@ StaffContext=\translator {
        MinimumVerticalExtent = #'(-4 . 4)
        ExtraVerticalExtent = ##f
        VerticalExtent = ##f 
+       localKeySignature = #'()
 
        % explicitly set instrument, so we don't get 
        % weird effects when doing instrument names for
@@ -56,7 +57,8 @@ StaffContainerContext = \translator {
        MinimumVerticalExtent = ##f
        ExtraVerticalExtent = ##f
        VerticalExtent = ##f 
-       
+       localKeySignature = #'()
+
        \accepts Staff
        \name StaffContainer
 }
@@ -67,6 +69,7 @@ InnerChoirStaffContext = \translator {
        alignmentReference = #0
        \consists "System_start_delimiter_engraver"
        systemStartDelimiter = #'SystemStartBracket
+       localKeySignature = #'()
 
        \accepts "Staff"
        \accepts "RhythmicStaff"
@@ -92,6 +95,7 @@ RhythmicStaffContext=\translator{
        MinimumVerticalExtent = ##f
        ExtraVerticalExtent = ##f
        VerticalExtent = ##f 
+       localKeySignature = #'()
 
        \consists "Pitch_squash_engraver"
        \consists "Separating_line_group_engraver"      
@@ -118,6 +122,7 @@ VoiceContext = \translator {
        \name Voice
 
        Generic_property_list = #generic-voice-properties
+       localKeySignature = #'()
        \consists "Font_size_engraver"
        
        % must come before all
@@ -162,6 +167,7 @@ VoiceContext = \translator {
 ThreadContext = \translator{
        \type Engraver_group_engraver
        \name Thread
+       localKeySignature = #'()
 
        \consists "Font_size_engraver"  
        \consists "Thread_devnull_engraver"
@@ -175,6 +181,7 @@ ThreadContext = \translator{
 GrandStaffContext=\translator{
        \type "Engraver_group_engraver"
        \name GrandStaff
+       localKeySignature = #'()
        \consists "Span_bar_engraver"
        \consists "Span_arpeggio_engraver"
        \consists "System_start_delimiter_engraver"
@@ -186,6 +193,7 @@ GrandStaffContext=\translator{
 PianoStaffContext = \translator{
        \GrandStaffContext
        \name "PianoStaff"
+       \alias "GrandStaff"
 
        \consists "Vertical_align_engraver"
        \consists "Instrument_name_engraver"
@@ -202,6 +210,7 @@ PianoStaffContext = \translator{
 InnerStaffGroupContext= \translator {
        \type "Engraver_group_engraver"
        \name InnerStaffGroup
+       localKeySignature = #'()
 
        \consists "Span_bar_engraver"
        \consists "Span_arpeggio_engraver"
@@ -323,6 +332,7 @@ HaraKiriStaffContext = \translator {
 ScoreContext = \translator {
        \type Score_engraver
        \name Score
+       localKeySignature = #'()
        
        \consists "Repeat_acknowledge_engraver"
        \consists "Staff_collecting_engraver"
@@ -388,7 +398,7 @@ ScoreContext = \translator {
        
        subdivideBeams = ##f
        extraNatural = ##t
-       autoAccidentals = #'((measure-same-octave . 0))
+       autoAccidentals = #'(Staff (same-octave . 0))
        autoCautionaries = #'()  
 
 
diff -purN ../lilypond-1.5.43/ly/property-init.ly ./ly/property-init.ly
--- ../lilypond-1.5.43/ly/property-init.ly      Mon Feb 25 00:29:30 2002
+++ ./ly/property-init.ly       Wed Mar 20 02:13:24 2002
@@ -133,8 +133,17 @@ hideStaffSwitch = \property Voice.follow
 % accidentals as they were common in the 18th century.
 defaultAccidentals = {
   \property Score.extraNatural = ##t
-  \property Score.autoAccidentals = #'((measure-same-octave . 0))
-  \property Score.autoCautionaries = #'()  
+  \property Score.autoAccidentals = #'(Staff (same-octave . 0))
+  \property Score.autoCautionaries = #'()
+}
+
+% accidentals in voices instead of staves.
+% Notice that accidentals from one voice do NOT get cancelled in other voices
+voiceAccidentals = {
+  \property Score.extraNatural = ##t
+  \property Score.autoAccidentals = #'(Voice (same-octave . 0))
+  \property Score.autoCautionaries = #'()
+  
 }
 
 % accidentals as suggested by Kurt Stone, Music Notation in the 20th century.
@@ -142,22 +151,57 @@ defaultAccidentals = {
 % in other octaves and in the next measure.
 modernAccidentals = {
   \property Score.extraNatural = ##f
-  \property Score.autoAccidentals = #'((measure-same-octave . 0) 
(measure-any-octave . 0) (measure-any-octave . 1))
+  \property Score.autoAccidentals = #'(Staff (same-octave . 0) (any-octave . 
0) (any-octave . 1))
   \property Score.autoCautionaries = #'()  
 }
 
 % the accidentals that Stone adds to the old standard as cautionaries
 modernCautionaries = {
   \property Score.extraNatural = ##f
-  \property Score.autoAccidentals = #'((measure-same-octave . 0))
-  \property Score.autoCautionaries = #'((measure-any-octave . 0) 
(measure-any-octave . 1))  
+  \property Score.autoAccidentals = #'(Staff (same-octave . 0))
+  \property Score.autoCautionaries = #'(Staff (any-octave . 0) (any-octave . 
1))  
+}
+
+% Multivoice accidentals to be read both by musicians playing one voice
+% and musicians playing all voices.
+% Accidentals are typeset for each voice, but they ARE cancelled across voices.
+modernVoiceAccidentals = {
+  \property Staff.extraNatural = ##f
+  \property Staff.autoAccidentals = #'(
+    Voice (same-octave . 0) (any-octave . 0) (any-octave . 1)
+    Staff (same-octave . 0) (any-octave . 0) (any-octave . 1)
+  )
+  \property Staff.autoCautionaries = #'()  
+}
+
+% same as modernVoiceAccidental eccept that all special accidentals are typeset
+% as cautionaries
+modernVoiceCautionaries = {
+  \property Staff.extraNatural = ##f
+  \property Staff.autoAccidentals = #'(
+    Voice (same-octave . 0) 
+  )
+  \property Staff.autoCautionaries = #'(
+    Voice (any-octave . 0) (any-octave . 1)
+    Staff (same-octave . 0) (any-octave . 0) (any-octave . 1)
+  )  
+}
+
+% stone's suggestions for accidentals on grand staff.
+% Accidentals are cancelled across the staves in the same grand staff as well
+pianoAccidentals = {
+  \property GrandStaff.autoAccidentals = #'(
+    Staff (same-octave . 0) (any-octave . 0) (any-octave . 1)
+    GrandStaff (any-octave . 1)
+  )
+  \property GrandStaff.autoCautionaries = #'()  
 }
 
 % Do not reset the key at the start of a measure.  Accidentals will be
 % printed only once and are in effect until overridden, possibly many
 % measures later.
 noResetKey = {
-  \property Score.autoAccidentals = #'((measure-same-octave . #t))
+  \property Score.autoAccidentals = #'(Staff (same-octave . #t))
   \property Score.autoCautionaries = #'()
 }
 
@@ -167,7 +211,7 @@ noResetKey = {
 % remembered for the duration of a measure.
 % accidentals not being remembered, causing accidentals always to be typeset 
relative to the time signature
 forgetAccidentals = {
-  \property Score.autoAccidentals = #'((measure-same-octave . -1))
+  \property Score.autoAccidentals = #'(Staff (same-octave . -1))
   \property Score.autoCautionaries = #'()  
 }
 
diff -purN ../lilypond-1.5.43/scm/translator-property-description.scm 
./scm/translator-property-description.scm
--- ../lilypond-1.5.43/scm/translator-property-description.scm  Tue Feb 26 
19:34:27 2002
+++ ./scm/translator-property-description.scm   Wed Mar 20 02:13:55 2002
@@ -85,18 +85,23 @@ The head of the list:
 (translator-property-description 'autoAccidentals list? "List of
 different ways to typeset an accidental. All algorithms in the list
 are tried, and the one returning the most accidentals is used.
-Each algorithm-description is a name-value pair.
+Each entry is either a symbol containg a context name or a name-value
+pair containing an algorithm-description.
+The list must begin with a symbol (context name).
+The symbols denote in which context THE FOLLOWING algorithms (until next 
symbol) 
+will be interpreted. All notes in the interpretation context will share 
accidentals.
+The contexts must be stated in order, innermost first.
 The algorithms are:
 @table @samp
address@hidden measure-same-octave:
address@hidden same-octave:
 This is the default algorithm. Accidentals are typeset if the note changes
 the accidental of that note in that octave. Accidentals lasts to the end of 
the measure 
 and then as many measures as specified in the value. I.e. 1 means to the end
-of next measure, -1 means to the end of previous measure (that is: no duration 
at all), etc.
address@hidden measure-any-octave:
+of next measure, -1 means to the end of previous measure (that is: no duration 
at all), etc. #t means forever.
address@hidden any-octave:
 Accidentals are typeset if the note is different from 
 the previous note on the same pitch in any octave. The value has same meaning 
as in
-measure-same-octave.
+same-octave.
 @end table
 ")
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]