X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Flsr%2Ftransposing-pitches-with-minimum-accidentals-smart-transpose.ly;h=4bce592109fad2cf31c3fe33d01aa3d6304bcec1;hb=9e7b53f94e1e3bd7b3f7a14ba11a6cae6c8e9a73;hp=69d3e3af7a2c88c2da54ff1b4d0ad98b31257945;hpb=4c1b01719b22ed0ae8d1aa393f14d1c205c3ac88;p=lilypond.git diff --git a/input/lsr/transposing-pitches-with-minimum-accidentals-smart-transpose.ly b/input/lsr/transposing-pitches-with-minimum-accidentals-smart-transpose.ly index 69d3e3af7a..4bce592109 100644 --- a/input/lsr/transposing-pitches-with-minimum-accidentals-smart-transpose.ly +++ b/input/lsr/transposing-pitches-with-minimum-accidentals-smart-transpose.ly @@ -1,20 +1,21 @@ -%% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it +%% Do not edit this file; it is auto-generated from input/new %% This file is in the public domain. -%% Tags: pitches -\version "2.11.35" - -\header { texidoc = " -There is a way to enforce enharmonic modifications for notes in order -to have the minimum number of accidentals. In that case, ``Double -accidentals should be removed, as well as E-sharp (-> F), bC (-> B), bF -(-> E), B-sharp (-> C).'', as proposed by a request for a new feature. -In this manner, the most natural enharmonic notes are chosen in this -example. -" } +\version "2.11.38" +\header { + doctitle = "Transposing music with minimum accidentals" + lsrtags = "pitches" + texidoc = "There is a way to enforce enharmonic modifications for +notes in order to have the minimum number of accidentals. In that +case, ``Double accidentals should be removed, as well as E-sharp +(-> F), bC (-> B), bF (-> E), B-sharp (-> C).'', as proposed by a +request for a new feature. In this manner, the most natural +enharmonic notes are chosen in this example. " +} % begin verbatim #(define (naturalise-pitch p) (let* ((o (ly:pitch-octave p)) - (a (ly:pitch-alteration p)) + (a (* 4 (ly:pitch-alteration p))) + ; alteration, a, in quarter tone steps, for historical reasons (n (ly:pitch-notename p))) (cond @@ -32,7 +33,7 @@ example. (if (< n 0) (begin (set! o (- o 1)) (set! n (+ n 7)))) (if (> n 6) (begin (set! o (+ o 1)) (set! n (- n 7)))) - (ly:make-pitch o n a))) + (ly:make-pitch o n (/ a 4)))) #(define (naturalise music) (let* ((es (ly:music-property music 'elements)) @@ -64,9 +65,10 @@ naturaliseMusic = (naturalise m)) \score { - \context Staff { - \transpose c ais \music - \naturaliseMusic \transpose c ais \music + \new Staff { + \transpose c ais \music + \naturaliseMusic \transpose c ais \music + \break \transpose c deses \music \naturaliseMusic \transpose c deses \music }