X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fsnippets%2Ftransposing-pitches-with-minimum-accidentals-smart-transpose.ly;h=3b209f08e2465aef6cf510c4feb954c1907bc3a2;hb=f1b23dd196d0fe5b47f3baf6bf6b9afccf81adef;hp=afc18dfc95ef3a40a51033e57e42032a3b895c38;hpb=8247813bc580a90f7838846dc38aad5d49ac9d9d;p=lilypond.git diff --git a/Documentation/snippets/transposing-pitches-with-minimum-accidentals-smart-transpose.ly b/Documentation/snippets/transposing-pitches-with-minimum-accidentals-smart-transpose.ly index afc18dfc95..3b209f08e2 100644 --- a/Documentation/snippets/transposing-pitches-with-minimum-accidentals-smart-transpose.ly +++ b/Documentation/snippets/transposing-pitches-with-minimum-accidentals-smart-transpose.ly @@ -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.14.2" +% 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))