Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 ;;;; This file is part of LilyPond, the GNU music typesetter. | 1 ;;;; This file is part of LilyPond, the GNU music typesetter. |
2 ;;;; | 2 ;;;; |
3 ;;;; Copyright (C) 2000--2015 Jan Nieuwenhuizen <janneke@gnu.org> | 3 ;;;; Copyright (C) 2000--2015 Jan Nieuwenhuizen <janneke@gnu.org> |
4 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 ;;;; | 5 ;;;; |
6 ;;;; LilyPond is free software: you can redistribute it and/or modify | 6 ;;;; LilyPond is free software: you can redistribute it and/or modify |
7 ;;;; it under the terms of the GNU General Public License as published by | 7 ;;;; it under the terms of the GNU General Public License as published by |
8 ;;;; the Free Software Foundation, either version 3 of the License, or | 8 ;;;; the Free Software Foundation, either version 3 of the License, or |
9 ;;;; (at your option) any later version. | 9 ;;;; (at your option) any later version. |
10 ;;;; | 10 ;;;; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 (alt-semitones (pitch-alteration-semitones pitch)) | 82 (alt-semitones (pitch-alteration-semitones pitch)) |
83 (n-a (if (member (cons name alt-semitones) `((6 . -1) (6 . -2))) | 83 (n-a (if (member (cons name alt-semitones) `((6 . -1) (6 . -2))) |
84 (cons 7 (+ (if B-instead-of-Bb 1 0) alt-semitones)) | 84 (cons 7 (+ (if B-instead-of-Bb 1 0) alt-semitones)) |
85 (cons name alt-semitones)))) | 85 (cons name alt-semitones)))) |
86 (make-line-markup | 86 (make-line-markup |
87 (list | 87 (list |
88 (make-simple-markup | 88 (make-simple-markup |
89 (conditional-string-downcase | 89 (conditional-string-downcase |
90 (vector-ref #("C" "D" "E" "F" "G" "A" "H" "B") (car n-a)) | 90 (vector-ref #("C" "D" "E" "F" "G" "A" "H" "B") (car n-a)) |
91 lowercase?)) | 91 lowercase?)) |
92 (make-normal-size-super-markup | 92 (accidental->markup (/ (cdr n-a) 2)))))) |
93 (accidental->markup (/ (cdr n-a) 2))))))) | |
94 | 93 |
95 (define-safe-public (note-name->german-markup pitch lowercase?) | 94 (define-safe-public (note-name->german-markup pitch lowercase?) |
96 (let* ((name (ly:pitch-notename pitch)) | 95 (let* ((name (ly:pitch-notename pitch)) |
97 (alt-semitones (pitch-alteration-semitones pitch)) | 96 (alt-semitones (pitch-alteration-semitones pitch)) |
98 (n-a (if (member (cons name alt-semitones) `((6 . -1) (6 . -2))) | 97 (n-a (if (member (cons name alt-semitones) `((6 . -1) (6 . -2))) |
99 (cons 7 (+ 1 alt-semitones)) | 98 (cons 7 (+ 1 alt-semitones)) |
100 (cons name alt-semitones)))) | 99 (cons name alt-semitones)))) |
101 (make-line-markup | 100 (make-line-markup |
102 (list | 101 (list |
103 (string-append | 102 (string-append |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
168 (not (equal? ZERO-MOMENT (ly:music-length m))))) | 167 (not (equal? ZERO-MOMENT (ly:music-length m))))) |
169 | 168 |
170 (let* ((elts (filter is-event-chord? (ly:music-property seq 'elements))) | 169 (let* ((elts (filter is-event-chord? (ly:music-property seq 'elements))) |
171 (alist (map chord-to-exception-entry elts))) | 170 (alist (map chord-to-exception-entry elts))) |
172 (filter cdr alist))) | 171 (filter cdr alist))) |
173 | 172 |
174 ;; semantics procedures | 173 ;; semantics procedures |
175 (define-public (get-modifications-from-semantics semantics-list) | 174 (define-public (get-modifications-from-semantics semantics-list) |
176 (define (not-root-entry? pair) | 175 (define (not-root-entry? pair) |
177 (not (eq? (car pair) 'root))) | 176 (not (eq? (car pair) 'root))) |
178 (filter not-root-entry? semantics-list)) | 177 (filter not-root-entry? semantics-list)) |
pwm
2018/11/10 05:44:23
Could use a blank line between these two define-pu
| |
179 (define-public (get-root-from-semantics semantics-list) | 178 (define-public (get-root-from-semantics semantics-list) |
180 (assoc-ref 'root semantics-list)) | 179 (assoc-ref 'root semantics-list)) |
181 | 180 |
182 ;; chordmode->exception-entry | 181 ;; chordmode->exception-entry |
pwm
2018/11/10 05:44:23
This comment doesn't add much.
| |
183 (define-safe-public (chordmode->exception-entry chord markup) | 182 (define-safe-public (chordmode->exception-entry chord markup) |
184 "Transform event-chord entered in chordmode to alist | 183 "Transform event-chord entered in chordmode to alist |
185 entry in chordSemanticsNameExceptions list | 184 entry in chordSemanticsNameExceptions list |
186 " | 185 " |
pwm
2018/11/10 05:44:23
Closing " usually doesn't get its own line.
| |
187 (define (get-semantics-list chord) | 186 (define (get-semantics-list chord) |
188 (define (get-semantics-event music) | 187 (define (get-semantics-event music) |
pwm
2018/11/10 05:44:23
Optional, but it's probably clearer to move this d
| |
189 (let* ((return '()) | 188 (let* ((return '()) |
190 (es (if (ly:music? music) | 189 (es (if (ly:music? music) |
191 (ly:music-property music 'elements) | 190 (ly:music-property music 'elements) |
192 '())) | 191 '())) |
193 (e (if (ly:music? music) | 192 (e (if (ly:music? music) |
194 (ly:music-property music 'element) | 193 (ly:music-property music 'element) |
195 '()))) | 194 '()))) |
196 (cond ((ly:music? e) | 195 (cond ((ly:music? e) |
197 (set! return (get-semantics-event e))) | 196 (set! return (get-semantics-event e))) |
198 ((not (null? es)) | 197 ((not (null? es)) |
199 ;; need to set return to the car of the list in order for it | 198 ;; need to set return to the car of the list in order for it |
200 ;; to be music expression. The list can only be one element | 199 ;; to be music expression. The list can only be one element |
201 ;; anyway, the chord semantics element. | 200 ;; anyway, the chord semantics element. |
202 (set! return (car (flatten-list (map get-semantics-event es))))) | 201 (set! return (car (flatten-list (map get-semantics-event es))))) |
203 ((memq 'chord-semantics-event (ly:music-property music 'types)) | 202 ((memq 'chord-semantics-event (ly:music-property music 'types)) |
204 (set! return music))) | 203 (set! return music))) |
205 return)) | 204 return)) |
pwm
2018/11/10 05:44:23
The 'return' is not adding much here. I'd suggest
| |
206 (let* ((semantics-event (get-semantics-event chord)) | 205 (let* ((semantics-event (get-semantics-event chord)) |
207 (semantics-list (ly:music-property semantics-event 'chord-semantics)) ) | 206 (semantics-list (ly:music-property semantics-event 'chord-semantics)) ) |
208 semantics-list)) | 207 semantics-list)) |
209 (list (cons (get-modifications-from-semantics (get-semantics-list chord)) | 208 (list (cons (get-modifications-from-semantics (get-semantics-list chord)) |
210 markup))) | 209 markup))) |
LEFT | RIGHT |