]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/snippets/transposing-pitches-with-minimum-accidentals-smart-transpose.ly
Doc: CSS: A better brown for the usage manual
[lilypond.git] / Documentation / snippets / transposing-pitches-with-minimum-accidentals-smart-transpose.ly
index 2b647d08547461da83c800de38b9523222c3ee7f..3b209f08e2465aef6cf510c4feb954c1907bc3a2 100644 (file)
@@ -1,10 +1,11 @@
-%% DO NOT EDIT this file manually; it is automatically
-%% generated from LSR http://lsr.dsi.unimi.it
-%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
-%% and then run scripts/auxiliar/makelsr.py
-%%
-%% This file is in the public domain.
-\version "2.16.0"
+% DO NOT EDIT this file manually; it is automatically
+% generated from Documentation/snippets/new
+% Make any changes in Documentation/snippets/new/
+% and then run scripts/auxiliar/makelsr.py
+%
+% This file is in the public domain.
+%% Note: this file works from version 2.19.22
+\version "2.19.22"
 
 \header {
   lsrtags = "pitches, scheme-language, workaround"
@@ -35,7 +36,6 @@ In this manner, the most natural enharmonic notes are chosen.
   doctitle = "Transposing pitches with minimum accidentals (\"Smart\" transpose)"
 } % begin verbatim
 
-
 #(define (naturalize-pitch p)
    (let ((o (ly:pitch-octave p))
          (a (* 4 (ly:pitch-alteration p)))
@@ -43,10 +43,10 @@ In this manner, the most natural enharmonic notes are chosen.
          ;; for historical reasons
          (n (ly:pitch-notename p)))
      (cond
-      ((and (> a 1) (or (eq? n 6) (eq? n 2)))
+      ((and (> a 1) (or (eqv? n 6) (eqv? n 2)))
        (set! a (- a 2))
        (set! n (+ n 1)))
-      ((and (< a -1) (or (eq? n 0) (eq? n 3)))
+      ((and (< a -1) (or (eqv? n 0) (eqv? n 3)))
        (set! a (+ a 2))
        (set! n (- n 1))))
      (cond
@@ -63,7 +63,7 @@ In this manner, the most natural enharmonic notes are chosen.
      (if (pair? es)
          (ly:music-set-property!
           music 'elements
-          (map (lambda (x) (naturalize x)) es)))
+          (map naturalize es)))
      (if (ly:music? e)
          (ly:music-set-property!
           music 'element
@@ -75,7 +75,7 @@ In this manner, the most natural enharmonic notes are chosen.
      music))
 
 naturalizeMusic =
-#(define-music-function (parser location m)
+#(define-music-function (m)
    (ly:music?)
    (naturalize m))