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.
10 lsrtags = "workaround, pitches, scheme-language"
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: bbf8fd2b5a3ebf20a1fdc91613dc49045a53a270
46 Questo esempio usa del codice Scheme per imporre delle modifiche
47 enarmoniche alle note che permettano di avere il numero minimo di
48 alterazioni. In questo caso si applica la seguente regola:
50 Le doppie alterazioni devono essere eliminate
65 In questo modo vengono scelti i suoni enarmonici più semplici.
68 doctitleit = "Trasposizione delle altezze con numero minimo di alterazioni"
70 %% Translation of GIT committish: 0a868be38a775ecb1ef935b079000cebbc64de40
71 doctitlede = "Noten mit minimaler Anzahl an Versetzungszeichen transponieren."
72 texidocde = "Dieses Beispiel benutzt Scheme-Code, um enharmonische
73 Verwechslungen für Noten zu erzwingen, damit nur eine minimale Anzahl
74 an Versetzungszeichen ausgegeben wird. In diesem Fall gelten die
79 Doppelte Versetzungszeichen sollen entfernt werden
95 Auf diese Art werden am meisten natürliche Tonhöhen als enharmonische
100 %% Translation of GIT committish: 3b125956b08d27ef39cd48bfa3a2f1e1bb2ae8b4
102 Cet exemple, grâce à un peu de code Scheme, donne la priorité aux
103 enharmoniques afin de limiter le nombre d'altérations supplémentaires.
104 La règle appliquable est@tie{}:
108 Les altérations doubles sont supprimées
124 Cette façon de procéder aboutit à plus d'enharmoniques naturelles.
127 doctitlefr = "Transposition et réduction du nombre d'altérations accidentelles"
130 This example uses some Scheme code to enforce enharmonic modifications
131 for notes in order to have the minimum number of accidentals. In this
132 case, the following rules apply:
134 Double accidentals should be removed
149 In this manner, the most natural enharmonic notes are chosen.
152 doctitle = "Transposing pitches with minimum accidentals (\"Smart\" transpose)"
156 #(define (naturalize-pitch p)
157 (let ((o (ly:pitch-octave p))
158 (a (* 4 (ly:pitch-alteration p)))
159 ;; alteration, a, in quarter tone steps,
160 ;; for historical reasons
161 (n (ly:pitch-notename p)))
163 ((and (> a 1) (or (eq? n 6) (eq? n 2)))
166 ((and (< a -1) (or (eq? n 0) (eq? n 3)))
170 ((> a 2) (set! a (- a 4)) (set! n (+ n 1)))
171 ((< a -2) (set! a (+ a 4)) (set! n (- n 1))))
172 (if (< n 0) (begin (set! o (- o 1)) (set! n (+ n 7))))
173 (if (> n 6) (begin (set! o (+ o 1)) (set! n (- n 7))))
174 (ly:make-pitch o n (/ a 4))))
176 #(define (naturalize music)
177 (let ((es (ly:music-property music 'elements))
178 (e (ly:music-property music 'element))
179 (p (ly:music-property music 'pitch)))
181 (ly:music-set-property!
183 (map (lambda (x) (naturalize x)) es)))
185 (ly:music-set-property!
190 (set! p (naturalize-pitch p))
191 (ly:music-set-property! music 'pitch p)))
195 #(define-music-function (parser location m)
199 music = \relative c' { c4 d e g }
203 \transpose c ais { \music }
204 \naturalizeMusic \transpose c ais { \music }
205 \transpose c deses { \music }
206 \naturalizeMusic \transpose c deses { \music }