]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix #236.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 16 Jan 2007 10:46:02 +0000 (11:46 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 16 Jan 2007 10:46:02 +0000 (11:46 +0100)
Always reset middleCPosition. This fixes switching from an
non-zero octavation to another non-zero octavation.

lily/ottava-engraver.cc
scm/define-context-properties.scm
scm/music-functions.scm

index 4dc46d96739f7aca6cd2e05531a2112e679feecc..c1afcfed3c7dee3588a244a62e469530e05da739 100644 (file)
@@ -61,7 +61,7 @@ Ottava_spanner_engraver::process_music ()
          span_->set_property ("text", ott);
 
          SCM c0 (get_property ("middleCPosition"));
-         SCM oc0 (get_property ("originalCentralCPosition"));
+         SCM oc0 (get_property ("originalMiddleCPosition"));
          if (scm_less_p (oc0, c0) == SCM_BOOL_T)
            span_->set_property ("direction", scm_from_int (DOWN));
        }
@@ -132,5 +132,10 @@ ADD_ACKNOWLEDGER (Ottava_spanner_engraver, note_column);
 ADD_TRANSLATOR (Ottava_spanner_engraver,
                /* doc */ "Create a text spanner when the ottavation property changes..",
                /* create */ "OttavaBracket",
-               /* read */ "ottavation",
+               /* read */ "ottavation "
+               "originalMiddleCPosition "
+               "currentMusicalColumn "
+               
+               ,
+               
                /* write */ "");
index 5debc1d10d531e510b84f5944c4178aad72deab3..7b990a22b5ed7d3d0779cf3d21b9abad1256e1c7 100644 (file)
@@ -485,7 +485,7 @@ Valid values are described in @internalsref{bar-line-interface}.
      )
 
    `((slurMelismaBusy ,boolean? "Signal if a slur is present.")
-     (originalCentralCPosition
+     (originalMiddleCPosition
       ,integer?
       "Used for temporary overriding middle C in octavation brackets. ")
      (melismaBusy ,boolean? "Signifies
index 76b8cf2edc710e8b9a7b803de6d0d28e5aa1fc5c..21617676ad71f64fef61530ba42116bb9c63e3d0 100644 (file)
@@ -415,23 +415,26 @@ i.e.  this is not an override"
 old middleCPosition, add OCTAVATION to middleCPosition, and set
 OTTAVATION to `8va', or whatever appropriate."     
       (if (number? (ly:context-property         context 'middleCPosition))
-         (if (= octavation 0)
-             (let ((where (ly:context-property-where-defined context 'middleCPosition))
-                   (oc0 (ly:context-property context 'originalCentralCPosition)))
-               (ly:context-set-property! context 'middleCPosition oc0)
-               (ly:context-unset-property where 'originalCentralCPosition)
-               (ly:context-unset-property where 'ottavation))
-             (let* ((where (ly:context-property-where-defined context 'middleCPosition))
-                    (c0 (ly:context-property context 'middleCPosition))
-                    (new-c0 (+ c0 (* -7 octavation)))
-                    (string (cdr (assoc octavation '((2 . "15ma")
-                                                     (1 . "8va")
-                                                     (0 . #f)
-                                                     (-1 . "8vb")
-                                                     (-2 . "15mb"))))))
-               (ly:context-set-property! context 'middleCPosition new-c0)
-               (ly:context-set-property! context 'originalCentralCPosition c0)
-               (ly:context-set-property! context 'ottavation string)))))
+         (begin
+           (if (number? (ly:context-property context 'originalMiddleCPosition))
+               (let ((where (ly:context-property-where-defined context 'middleCPosition)))
+                 
+                 (ly:context-set-property! context 'middleCPosition
+                                           (ly:context-property context 'originalMiddleCPosition))
+                 (ly:context-unset-property where 'originalMiddleCPosition)
+                 (ly:context-unset-property where 'ottavation)))
+ot         
+           (let* ((where (ly:context-property-where-defined context 'middleCPosition))
+                  (c0 (ly:context-property context 'middleCPosition))
+                  (new-c0 (+ c0 (* -7 octavation)))
+                  (string (cdr (assoc octavation '((2 . "15ma")
+                                                   (1 . "8va")
+                                                   (0 . #f)
+                                                   (-1 . "8vb")
+                                                   (-2 . "15mb"))))))
+             (ly:context-set-property! context 'middleCPosition new-c0)
+             (ly:context-set-property! context 'originalMiddleCPosition c0)
+             (ly:context-set-property! context 'ottavation string)))))
     (set! (ly:music-property m 'procedure) ottava-modify)
     (context-spec-music m 'Staff)))