]> git.donarmstrong.com Git - lilypond.git/blobdiff - input/test/smart-transpose.ly
*** empty log message ***
[lilypond.git] / input / test / smart-transpose.ly
index e857c41f09046de4a719fa079dbf2e7f64eb470f..c646cebc2d10a0dcb899ce96605abe5e025eb48c 100644 (file)
@@ -1,12 +1,13 @@
-\version "1.7.6"
+
+\version "1.9.6"
 
 \header {
-texidoc="
+texidoc="@cindex Smart Transpose
 @example
-    Here's a copy of my feature request :
+       Here's a copy of my feature request :
 @quotation
         Your task, if you accept it is to implement a \smarttranspose
-        command> that would translate such oddities into more natural
+        command>> that would translate such oddities into more natural
         notations. Double accidentals should be removed, as well as E-sharp
         (-> F), bC (-> B), bF (-> E), B-sharp (-> C).
 @end quotation
@@ -25,14 +26,14 @@ how useful these enharmonic modifications are. Mats B.
          (n (ly:pitch-notename p)))
 
     (cond
-     ((and (> a 0) (or (eq? n 6) (eq? n 2)))
-      (set! a (- a 1)) (set! n (+ n 1)))
-     ((and (< a 0) (or (eq? n 0) (eq? n 3)))
-      (set! a (+ a 1)) (set! n (- n 1))))
+     ((and (> a 1) (or (eq? n 6) (eq? n 2)))
+      (set! a (- a 2)) (set! n (+ n 1)))
+     ((and (< a -1) (or (eq? n 0) (eq? n 3)))
+      (set! a (+ a 2)) (set! n (- n 1))))
 
     (cond
-     ((eq? a 2)  (set! a 0) (set! n (+ n 1)))
-     ((eq? a -2) (set! a 0) (set! n (- n 1))))
+     ((eq? a 4)  (set! a 0) (set! n (+ n 1)))
+     ((eq? a -4) (set! a 0) (set! n (- n 1))))
 
     (if (< n 0) (begin (set!  o (- o 1)) (set! n (+ n 7))))
     (if (> n 6) (begin (set!  o (+ o 1)) (set! n (- n 7))))
@@ -68,7 +69,7 @@ music = \notes \relative c' { c4 d  e f g a b  c }
     \transpose c ais \music
     \apply #simplify \transpose c ais \music
   }
-  \paper { linewidth = -1. }
+  \paper { raggedright = ##t}
 }
 
-%% new-chords-done %%
+