]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.60.mb1: Re: LilyPond 1.3.60
authorMats Bengtsson <mats.bengtsson@s3.kth.se>
Fri, 16 Jun 2000 22:36:40 +0000 (00:36 +0200)
committerMats Bengtsson <mats.bengtsson@s3.kth.se>
Fri, 16 Jun 2000 22:36:40 +0000 (00:36 +0200)
1.3.60.mb1
===========

* First attempt to reintroduce support for keys with different
  accidentals in different octaves.

CHANGES
VERSION
lily/key-item.cc

diff --git a/CHANGES b/CHANGES
index e721f26d8c1800c93c2f925bdede38a0e537c805..3e50dfcb1e0e0ee661aa4a1126aeb636ecc9e1d1 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+1.3.60.mb1
+===========
+
+* First attempt to reintroduce support for keys with different
+  accidentals in different octaves.
+
 1.3.59.hwn1
 ===========
 
diff --git a/VERSION b/VERSION
index eb48af3ecc68169fd943ee16e8b34e8eb3a587ed..50f985861369a5158fd5d15485d9a7a5c3013440 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=60
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=mb1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 46ad565f5044ef075a3e8623470e1f0e835f1fde..f29c4ecd39bdad80ca4263d7477e6b9ba006c559 100644 (file)
@@ -36,42 +36,43 @@ const int SHARP_TOP_PITCH=4; /*  ais and bis typeset in lower octave */
 int
 Key_item::calculate_position(SCM pair) const
 {
-  int p = gh_scm2int (gh_car (pair));
+  SCM note = gh_car (pair);
+  if (gh_pair_p (note))
+    {
+      int o = gh_scm2int (gh_car (note));
+      int p = gh_scm2int (gh_cdr (note));
+      return p + o*7 + gh_scm2int (get_elt_property ("c0-position"));
+    }
+  int p = gh_scm2int (note);
   int a = gh_scm2int (gh_cdr (pair));  
   
-  if (to_boolean (get_elt_property ("multi-octave")))
+  // Find the c in the range -4 through 2
+  int from_bottom_pos = gh_scm2int (get_elt_property ("c0-position")) + 4;
+  from_bottom_pos = from_bottom_pos%7;
+  from_bottom_pos = (from_bottom_pos + 7)%7; // Precaution to get positive.
+  int c0 = from_bottom_pos - 4;
+  
+  
+  if ((a<0 && ((p>FLAT_TOP_PITCH) || (p+c0>4)) && (p+c0>1)) 
+      ||
+      (a>0 && ((p>SHARP_TOP_PITCH) || (p+c0>5)) && (p+c0>2))) 
     {
-      return p + gh_scm2int (get_elt_property ("c0-position"));
+      p -= 7; /* Typeset below c_position */
     }
-  else {
-    // Find the c in the range -4 through 2
-    int from_bottom_pos = gh_scm2int (get_elt_property ("c0-position")) + 4;
-    from_bottom_pos = from_bottom_pos%7;
-    from_bottom_pos = (from_bottom_pos + 7)%7; // Precaution to get positive.
-    int c0 = from_bottom_pos - 4;
-
-    
-    if ((a<0 && ((p>FLAT_TOP_PITCH) || (p+c0>4)) && (p+c0>1)) 
-       ||
-       (a>0 && ((p>SHARP_TOP_PITCH) || (p+c0>5)) && (p+c0>2))) 
-      {
-       p -= 7; /* Typeset below c_position */
-      }
-    /* Provide for the four cases in which there's a glitch 
-       it's a hack, but probably not worth  
-       the effort of finding a nicer solution.
-       --dl. */
-    if (c0==2 && a>0 && p==3)
-      p -= 7;
-    if (c0==-3 && a>0 && p==-1)
-      p += 7;
-    if (c0==-4 && a<0 && p==-1)
-      p += 7;
-    if (c0==-2 && a<0 && p==-3)
-      p += 7;
-    
-    return p + c0;
-  }
+  /* Provide for the four cases in which there's a glitch 
+     it's a hack, but probably not worth  
+     the effort of finding a nicer solution.
+     --dl. */
+  if (c0==2 && a>0 && p==3)
+    p -= 7;
+  if (c0==-3 && a>0 && p==-1)
+    p += 7;
+  if (c0==-4 && a<0 && p==-1)
+    p += 7;
+  if (c0==-2 && a<0 && p==-3)
+    p += 7;
+  
+  return p + c0;
 }
 
 MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Key_item)