1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
6 %% This file is in the public domain.
12 %% Translation of GIT committish: 6977ddc9a3b63ea810eaecb864269c7d847ccf98
13 doctitlees = "Transportar música con el menor número de alteraciones"
15 Este ejemplo utiliza código de Scheme para forzar las
16 modificaciones enarmónicas de las notas, y así tener el menor
17 número de alteraciones accidentales. En este caso se aplican las
22 Se quitan las dobles alteraciones
38 De esta forma se selecciona el mayor número de notas enarmónicas
44 %% Translation of GIT committish: 0a868be38a775ecb1ef935b079000cebbc64de40
45 doctitlede = "Noten mit minimaler Anzahl an Versetzungszeichen transponieren."
46 texidocde = "Dieses Beispiel benutzt Scheme-Code, um enharmonische
47 Verwechslungen für Noten zu erzwingen, damit nur eine minimale Anzahl
48 an Versetzungszeichen ausgegeben wird. In diesem Fall gelten die
53 Doppelte Versetzungszeichen sollen entfernt werden
69 Auf diese Art werden am meisten natürliche Tonhöhen als enharmonische
74 %% Translation of GIT committish: d9d1da30361a0bcaea1ae058eb1bc8dd3a5b2e4c
76 Cet exemple, grâce à un peu de code Scheme, donne la priorité aux
77 enharmoniques afin de limiter le nombre d'altérations supplémentaires.
78 La règle appliquable est@tie{}:
82 Les altérations doubles sont supprimées
98 Cette façon de procéder aboutit à plus d'enharmoniques naturelles.
101 doctitlefr = "Transposition et réduction du nombre d'altérations accidentelles"
104 This example uses some Scheme code to enforce enharmonic modifications
105 for notes in order to have the minimum number of accidentals. In this
106 case, the following rules apply:
108 Double accidentals should be removed
123 In this manner, the most natural enharmonic notes are chosen.
126 doctitle = "Transposing pitches with minimum accidentals (\"Smart\" transpose)"
129 #(define (naturalize-pitch p)
130 (let ((o (ly:pitch-octave p))
131 (a (* 4 (ly:pitch-alteration p)))
132 ;; alteration, a, in quarter tone steps,
133 ;; for historical reasons
134 (n (ly:pitch-notename p)))
136 ((and (> a 1) (or (eq? n 6) (eq? n 2)))
139 ((and (< a -1) (or (eq? n 0) (eq? n 3)))
143 ((> a 2) (set! a (- a 4)) (set! n (+ n 1)))
144 ((< a -2) (set! a (+ a 4)) (set! n (- n 1))))
145 (if (< n 0) (begin (set! o (- o 1)) (set! n (+ n 7))))
146 (if (> n 6) (begin (set! o (+ o 1)) (set! n (- n 7))))
147 (ly:make-pitch o n (/ a 4))))
149 #(define (naturalize music)
150 (let ((es (ly:music-property music 'elements))
151 (e (ly:music-property music 'element))
152 (p (ly:music-property music 'pitch)))
154 (ly:music-set-property!
156 (map (lambda (x) (naturalize x)) es)))
158 (ly:music-set-property!
163 (set! p (naturalize-pitch p))
164 (ly:music-set-property! music 'pitch p)))
168 #(define-music-function (parser location m)
172 music = \relative c' { c4 d e g }
176 \transpose c ais { \music }
177 \naturalizeMusic \transpose c ais { \music }
178 \transpose c deses { \music }
179 \naturalizeMusic \transpose c deses { \music }