]> git.donarmstrong.com Git - lilypond.git/commitdiff
key-signature: restore function for LilyJAZZ.ily; issue 3606
authorKeith OHara <k-ohara5a5a@oco.net>
Sat, 19 Oct 2013 16:54:56 +0000 (09:54 -0700)
committerKeith OHara <k-ohara5a5a@oco.net>
Sat, 19 Oct 2013 17:34:13 +0000 (10:34 -0700)
key-signature-interface::alteration-position

scm/output-lib.scm

index dc88b4387a8f00e87031a233c656642b3b533736..02170918a1bec6af6e72481c9f7256c59ba651fc 100644 (file)
@@ -673,6 +673,20 @@ and duration-log @var{log}."
                                     (prepend (+ x 7) (cons x l))))
           (prepend first-position '())))))
 
+(define-public (key-signature-interface::alteration-position
+                step alter c0-position)
+;; Deprecated.  Not a documented interface, and no longer used in LilyPond,
+;; but needed for a popular file, LilyJAZZ.ily for version 2.16
+  (if (pair? step)
+    (+ (cdr step) (* (car step) 7) c0-position)
+    (let* ((c-pos (modulo c0-position 7))
+           (hi (list-ref
+                 (if (< alter 0)
+                   '(2 3 4 2 1 2 1) ; position of highest flat
+                   '(4 5 4 2 3 2 3)); position of highest sharp
+                 c-pos)))
+      (- hi (modulo (- hi (+ c-pos step)) 7)))))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; annotations