OLD | NEW |
1 ;;; define-music-display-methods.scm -- data for displaying music | 1 ;;; define-music-display-methods.scm -- data for displaying music |
2 ;;; expressions using LilyPond notation. | 2 ;;; expressions using LilyPond notation. |
3 ;;; | 3 ;;; |
4 ;;; Copyright (C) 2005--2015 Nicolas Sceaux <nicolas.sceaux@free.fr> | 4 ;;; Copyright (C) 2005--2015 Nicolas Sceaux <nicolas.sceaux@free.fr> |
5 ;;; | 5 ;;; |
6 | 6 |
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
8 ;;; | 8 ;;; |
9 ;;; Display method implementation | 9 ;;; Display method implementation |
10 ;;; | 10 ;;; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 ((or result (null? alist)) result) | 82 ((or result (null? alist)) result) |
83 (if (and (car alist) (test item (cdar alist))) | 83 (if (and (car alist) (test item (cdar alist))) |
84 (set! result (car alist))))) | 84 (set! result (car alist))))) |
85 | 85 |
86 (define-public (note-name->lily-string ly-pitch) | 86 (define-public (note-name->lily-string ly-pitch) |
87 ;; here we define a custom pitch= function, since we do not want to | 87 ;; here we define a custom pitch= function, since we do not want to |
88 ;; test whether octaves are also equal. (otherwise, we would be using equal?) | 88 ;; test whether octaves are also equal. (otherwise, we would be using equal?) |
89 (define (pitch= pitch1 pitch2) | 89 (define (pitch= pitch1 pitch2) |
90 (and (= (ly:pitch-notename pitch1) (ly:pitch-notename pitch2)) | 90 (and (= (ly:pitch-notename pitch1) (ly:pitch-notename pitch2)) |
91 (= (ly:pitch-alteration pitch1) (ly:pitch-alteration pitch2)))) | 91 (= (ly:pitch-alteration pitch1) (ly:pitch-alteration pitch2)))) |
92 (let* ((pitches (ly:parser-lookup 'pitchnames)) | 92 (let* ((result (rassoc ly-pitch pitchnames pitch=))) |
93 (result (rassoc ly-pitch pitches pitch=))) | |
94 (and result (car result)))) | 93 (and result (car result)))) |
95 | 94 |
96 (define-public (octave->lily-string pitch) | 95 (define-public (octave->lily-string pitch) |
97 (let ((octave (ly:pitch-octave pitch))) | 96 (let ((octave (ly:pitch-octave pitch))) |
98 (cond ((>= octave 0) | 97 (cond ((>= octave 0) |
99 (make-string (1+ octave) #\')) | 98 (make-string (1+ octave) #\')) |
100 ((< octave -1) | 99 ((< octave -1) |
101 (make-string (1- (* -1 octave)) #\,)) | 100 (make-string (1- (* -1 octave)) #\,)) |
102 (else "")))) | 101 (else "")))) |
103 | 102 |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1152 (music->lily-string ?note-sequence) | 1151 (music->lily-string ?note-sequence) |
1153 (new-line->lily-string) | 1152 (new-line->lily-string) |
1154 (parameterize ((*explicit-mode* #f) | 1153 (parameterize ((*explicit-mode* #f) |
1155 (*omit-duration* #t)) | 1154 (*omit-duration* #t)) |
1156 (music->lily-string ?lyric-sequenc
e))) | 1155 (music->lily-string ?lyric-sequenc
e))) |
1157 #f))) | 1156 #f))) |
1158 | 1157 |
1159 ;; Silence internal event sent at end of each lyrics block | 1158 ;; Silence internal event sent at end of each lyrics block |
1160 (define-display-method CompletizeExtenderEvent (expr) | 1159 (define-display-method CompletizeExtenderEvent (expr) |
1161 "") | 1160 "") |
OLD | NEW |