1 %% Do not edit this file; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% This file is in the public domain.
9 %% Translation of GIT committish: fa19277d20f8ab0397c560eb0e7b814bd804ecec
10 doctitlees = "Transportar música con el menor número de alteraciones"
12 Este ejemplo utiliza código de Scheme para forzar las
13 modificaciones enarmónicas de las notas, y así tener el menor
14 número de alteraciones accidentales. En este caso se aplican las
19 Se quitan las dobles alteraciones
35 De esta forma se selecciona el mayor número de notas enarmónicas
41 %% Translation of GIT committish: 0a868be38a775ecb1ef935b079000cebbc64de40
42 doctitlede = "Noten mit minimaler Anzahl an Versetzungszeichen transponieren."
43 texidocde = "Dieses Beispiel benutzt Scheme-Code, um enharmonische
44 Verwechslungen für Noten zu erzwingen, damit nur eine minimale Anzahl
45 an Versetzungszeichen ausgegeben wird. In diesem Fall gelten die
50 Doppelte Versetzungszeichen sollen entfernt werden
66 Auf diese Art werden am meisten natürliche Tonhöhen als enharmonische
71 %% Translation of GIT committish: 4ab2514496ac3d88a9f3121a76f890c97cedcf4e
73 Cet exemple, grâce à un peu de code Scheme, donne la priorité aux
74 enharmoniques afin de limiter le nombre d'altérations supplémentaires.
75 La règle appliquable est :
79 Les altérations doubles sont supprimées
95 Cette façon de procéder aboutit à plus d'enharmoniques naturelles.
99 doctitlefr = "Transposition et réduction du nombrer d'altérations accidentelles"
102 This example uses some Scheme code to enforce enharmonic modifications
103 for notes in order to have the minimum number of accidentals. In this
104 case, the following rules apply:
106 Double accidentals should be removed
121 In this manner, the most natural enharmonic notes are chosen.
124 doctitle = "Transposing pitches with minimum accidentals (\"Smart\" transpose)"
127 #(define (naturalize-pitch p)
128 (let ((o (ly:pitch-octave p))
129 (a (* 4 (ly:pitch-alteration p)))
130 ;; alteration, a, in quarter tone steps,
131 ;; for historical reasons
132 (n (ly:pitch-notename p)))
134 ((and (> a 1) (or (eq? n 6) (eq? n 2)))
137 ((and (< a -1) (or (eq? n 0) (eq? n 3)))
141 ((> a 2) (set! a (- a 4)) (set! n (+ n 1)))
142 ((< a -2) (set! a (+ a 4)) (set! n (- n 1))))
143 (if (< n 0) (begin (set! o (- o 1)) (set! n (+ n 7))))
144 (if (> n 6) (begin (set! o (+ o 1)) (set! n (- n 7))))
145 (ly:make-pitch o n (/ a 4))))
147 #(define (naturalize music)
148 (let ((es (ly:music-property music 'elements))
149 (e (ly:music-property music 'element))
150 (p (ly:music-property music 'pitch)))
152 (ly:music-set-property!
154 (map (lambda (x) (naturalize x)) es)))
156 (ly:music-set-property!
161 (set! p (naturalize-pitch p))
162 (ly:music-set-property! music 'pitch p)))
166 #(define-music-function (parser location m)
170 music = \relative c' { c4 d e g }
174 \transpose c ais { \music }
175 \naturalizeMusic \transpose c ais { \music }
176 \transpose c deses { \music }
177 \naturalizeMusic \transpose c deses { \music }