-%% 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"
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)))
;; for historical reasons
(n (ly:pitch-notename p)))
(cond
- ((and (> a 1) (or (= n 6) (= n 2)))
+ ((and (> a 1) (or (eqv? n 6) (eqv? n 2)))
(set! a (- a 2))
(set! n (+ n 1)))
- ((and (< a -1) (or (= n 0) (= n 3)))
+ ((and (< a -1) (or (eqv? n 0) (eqv? n 3)))
(set! a (+ a 2))
(set! n (- n 1))))
(cond
(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
music))
naturalizeMusic =
-#(define-music-function (parser location m)
+#(define-music-function (m)
(ly:music?)
(naturalize m))