|
39 | 39 | #:getter cell:lyrics) |
40 | 40 | (opening #:init-keyword #:opening |
41 | 41 | #:getter cell:opening) |
| 42 | + (opening-lyrics #:init-keyword #:opening-lyrics |
| 43 | + #:getter cell:opening-lyrics) |
42 | 44 | (closing #:init-keyword #:closing |
43 | 45 | #:getter cell:closing) |
| 46 | + (closing-lyrics #:init-keyword #:closing-lyrics |
| 47 | + #:getter cell:closing-lyrics) |
44 | 48 | (barNumber #:init-keyword #:barNumber |
45 | 49 | #:getter cell:barNumber) |
46 | 50 | (transposeKey #:init-keyword #:transposeKey |
@@ -206,7 +210,9 @@ gridPutMusic = |
206 | 210 | #:music music |
207 | 211 | #:lyrics (props-get 'lyrics #f) |
208 | 212 | #:opening (props-get 'opening #{ #}) |
| 213 | + #:opening-lyrics (props-get 'opening-lyrics #f) |
209 | 214 | #:closing (props-get 'closing #{ #}) |
| 215 | + #:closing-lyrics (props-get 'closing-lyrics #f) |
210 | 216 | #:barNumber (props-get 'barNumber #f) |
211 | 217 | #:transposeKey (props-get 'transposeKey #f)))) |
212 | 218 | (hash-set! music-grid key value))) |
@@ -259,8 +265,10 @@ gridSetSegmentTemplate = |
259 | 265 | #:lyrics #{ #} |
260 | 266 | #:opening (cell:opening |
261 | 267 | (get-music-cell "<template>" i)) |
| 268 | + #:opening-lyrics #{ #} |
262 | 269 | #:closing (cell:closing |
263 | 270 | (get-music-cell "<template>" i)) |
| 271 | + #:closing-lyrics #{ #} |
264 | 272 | #:music (cell:music |
265 | 273 | (get-music-cell "<template>" i)) |
266 | 274 | #:barNumber (cell:barNumber |
@@ -326,12 +334,20 @@ gridGetLyrics = |
326 | 334 | #(define-music-function |
327 | 335 | (parser location part) (string?) |
328 | 336 | (let* ((cells (get-cell-range part #{ \getOption gridly.segment-range #})) |
329 | | - (lyrics (map cell:lyrics cells))) |
| 337 | + (lyrics (map cell:lyrics cells)) |
| 338 | + (opening-lyrics (let ((maybe-lyrics (cell:opening-lyrics (car cells)))) |
| 339 | + (if maybe-lyrics |
| 340 | + (list maybe-lyrics) |
| 341 | + '()))) |
| 342 | + (closing-lyrics (let ((maybe-lyrics (cell:closing-lyrics (car (last-pair cells))))) |
| 343 | + (if maybe-lyrics |
| 344 | + (list maybe-lyrics) |
| 345 | + '())))) |
330 | 346 | (if (member #f lyrics) |
331 | 347 | (ly:error "A segment is missing lyrics!") |
332 | 348 | (make-music |
333 | 349 | 'SequentialMusic |
334 | | - 'elements lyrics)))) |
| 350 | + 'elements (append opening-lyrics lyrics closing-lyrics))))) |
335 | 351 |
|
336 | 352 | #(define (format-cell-file-name parser part segment) |
337 | 353 | (let* ((max-segment-str-len (string-length |
@@ -364,7 +380,7 @@ gridCompileCell = |
364 | 380 | (lyrics (let ((maybe-lyrics (cell:lyrics |
365 | 381 | (get-music-cell part segment)))) |
366 | 382 | (if maybe-lyrics |
367 | | - #{ \new Lyrics \lyricsto $name $maybe-lyrics #} |
| 383 | + #{ \new Lyrics \lyricsto $name { \gridGetLyrics $part } #} |
368 | 384 | #{ #}))) |
369 | 385 | (book |
370 | 386 | #{ |
|
0 commit comments