From: Mats Bengtsson Date: Fri, 16 Jun 2000 22:36:40 +0000 (+0200) Subject: patch::: 1.3.60.mb1: Re: LilyPond 1.3.60 X-Git-Tag: release/1.3.61~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c6af0ba0fdc5678ab73933d65d6d9128022036bc;p=lilypond.git patch::: 1.3.60.mb1: Re: LilyPond 1.3.60 1.3.60.mb1 =========== * First attempt to reintroduce support for keys with different accidentals in different octaves. --- diff --git a/CHANGES b/CHANGES index e721f26d8c..3e50dfcb1e 100644 --- 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 eb48af3ecc..50f9858613 100644 --- 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. diff --git a/lily/key-item.cc b/lily/key-item.cc index 46ad565f50..f29c4ecd39 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -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)