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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 (if force-line-break 1 0) | 378 (if force-line-break 1 0) |
379 (if force-line-break (*indent*) 1)))) | 379 (if force-line-break (*indent*) 1)))) |
380 | 380 |
381 (define-display-method SimultaneousMusic (sim) | 381 (define-display-method SimultaneousMusic (sim) |
382 (parameterize ((*indent* (+ 3 (*indent*)))) | 382 (parameterize ((*indent* (+ 3 (*indent*)))) |
383 (format #f "<< ~{~a ~}>>" | 383 (format #f "<< ~{~a ~}>>" |
384 (map-in-order (lambda (music) | 384 (map-in-order (lambda (music) |
385 (music->lily-string music)) | 385 (music->lily-string music)) |
386 (ly:music-property sim 'elements))))) | 386 (ly:music-property sim 'elements))))) |
387 | 387 |
388 (define-extra-display-method SimultaneousMusic (expr) | |
389 "If `sim' is an \afterGrace expression, return \"\\afterGrace ...\". | |
390 Otherwise, return #f." | |
391 ;; TODO: do something with afterGraceFraction? | |
392 (with-music-match (expr (music 'SimultaneousMusic | |
393 elements (?before-grace | |
394 (music 'SequentialMusic | |
395 elements ((music 'SkipMusic) | |
396 (music 'GraceMusic | |
397 element ?grac
e)))))) | |
398 (format #f "\\afterGrace ~a ~a" | |
399 (music->lily-string ?before-grace) | |
400 (music->lily-string ?grace)))) | |
401 | |
402 ;;; | 388 ;;; |
403 ;;; Chords | 389 ;;; Chords |
404 ;;; | 390 ;;; |
405 | 391 |
406 (define-display-method EventChord (chord) | 392 (define-display-method EventChord (chord) |
407 ;; event_chord : command_element | 393 ;; event_chord : command_element |
408 ;; | note_chord_element | 394 ;; | note_chord_element |
409 | 395 |
410 ;; TODO : tagged post_events | 396 ;; TODO : tagged post_events |
411 ;; post_events : ( post_event | tagged_post_event )* | 397 ;; post_events : ( post_event | tagged_post_event )* |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 (map (lambda (op) | 718 (map (lambda (op) |
733 (format #f "~%~v_\\~a ~s" | 719 (format #f "~%~v_\\~a ~s" |
734 (*indent*) | 720 (*indent*) |
735 (first op) | 721 (first op) |
736 (second op))) | 722 (second op))) |
737 operations)) | 723 operations)) |
738 (*indent*))) | 724 (*indent*))) |
739 (parameterize ((*current-context* ctype)) | 725 (parameterize ((*current-context* ctype)) |
740 (music->lily-string music))))) | 726 (music->lily-string music))))) |
741 | 727 |
| 728 ;; \afterGrace |
| 729 (define-extra-display-method ContextSpeccedMusic (expr) |
| 730 "If `sim' is an \afterGrace expression, return \"\\afterGrace ...\". |
| 731 Otherwise, return #f." |
| 732 ;; TODO: do something with afterGraceFraction? |
| 733 (with-music-match |
| 734 (expr (music 'ContextSpeccedMusic |
| 735 context-type 'Bottom |
| 736 element |
| 737 (music 'SimultaneousMusic |
| 738 elements (?before-grace |
| 739 (music 'SequentialMusic |
| 740 elements ((music 'SkipMusic) |
| 741 (music 'GraceMusic |
| 742 element ?grace))))))) |
| 743 (format #f "\\afterGrace ~a ~a" |
| 744 (music->lily-string ?before-grace) |
| 745 (music->lily-string ?grace)))) |
| 746 |
| 747 |
742 ;; special cases: \figures \lyrics \drums | 748 ;; special cases: \figures \lyrics \drums |
743 (define-extra-display-method ContextSpeccedMusic (expr) | 749 (define-extra-display-method ContextSpeccedMusic (expr) |
744 (with-music-match (expr (music 'ContextSpeccedMusic | 750 (with-music-match (expr (music 'ContextSpeccedMusic |
745 create-new #t | 751 create-new #t |
746 property-operations ?op | 752 property-operations ?op |
747 context-type ?context-type | 753 context-type ?context-type |
748 element ?sequence)) | 754 element ?sequence)) |
749 (if (null? ?op) | 755 (if (null? ?op) |
750 (parameterize ((*explicit-mode* #f)) | 756 (parameterize ((*explicit-mode* #f)) |
751 (case ?context-type | 757 (case ?context-type |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 context-type 'Voice) | 1046 context-type 'Voice) |
1041 (music 'ContextSpeccedMusic | 1047 (music 'ContextSpeccedMusic |
1042 context-id "shared" | 1048 context-id "shared" |
1043 context-type 'Voice) | 1049 context-type 'Voice) |
1044 (music 'ContextSpeccedMusic | 1050 (music 'ContextSpeccedMusic |
1045 context-id "solo" | 1051 context-id "solo" |
1046 context-type 'Voice) | 1052 context-type 'Voice) |
1047 (music 'ContextSpeccedMusic | 1053 (music 'ContextSpeccedMusic |
1048 context-id "null" | 1054 context-id "null" |
1049 context-type 'NullVoice) | 1055 context-type 'NullVoice) |
1050 ?pc-music)))) | 1056 ?pc-music |
| 1057 ?pc-marks)))) |
1051 (with-music-match | 1058 (with-music-match |
1052 (?pc-music (music 'PartCombineMusic)) | 1059 (?pc-music (music 'PartCombineMusic)) |
1053 (format #f "~a" (music->lily-string ?pc-music))))) | 1060 (format #f "~a" (music->lily-string ?pc-music))))) |
1054 | 1061 |
1055 (define-display-method UnrelativableMusic (expr) | 1062 (define-display-method UnrelativableMusic (expr) |
1056 (music->lily-string (ly:music-property expr 'element))) | 1063 (music->lily-string (ly:music-property expr 'element))) |
1057 | 1064 |
1058 ;;; Cue notes | 1065 ;;; Cue notes |
1059 (define-display-method QuoteMusic (expr) | 1066 (define-display-method QuoteMusic (expr) |
1060 (or (with-music-match (expr (music | 1067 (or (with-music-match (expr (music |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 (music->lily-string ?note-sequence) | 1162 (music->lily-string ?note-sequence) |
1156 (new-line->lily-string) | 1163 (new-line->lily-string) |
1157 (parameterize ((*explicit-mode* #f) | 1164 (parameterize ((*explicit-mode* #f) |
1158 (*omit-duration* #t)) | 1165 (*omit-duration* #t)) |
1159 (music->lily-string ?lyric-sequenc
e))) | 1166 (music->lily-string ?lyric-sequenc
e))) |
1160 #f))) | 1167 #f))) |
1161 | 1168 |
1162 ;; Silence internal event sent at end of each lyrics block | 1169 ;; Silence internal event sent at end of each lyrics block |
1163 (define-display-method CompletizeExtenderEvent (expr) | 1170 (define-display-method CompletizeExtenderEvent (expr) |
1164 "") | 1171 "") |
OLD | NEW |